@aerogel/core 0.0.0-next.fd1bd21aea7a9ab8c4eab69a5f5776db5de8bf35 → 0.1.0-next.f99d02aba04109e68987d90489974bfa0bb54a41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/dist/aerogel-core.css +1 -0
  2. package/dist/aerogel-core.d.ts +2263 -1698
  3. package/dist/aerogel-core.js +3813 -0
  4. package/dist/aerogel-core.js.map +1 -0
  5. package/package.json +32 -37
  6. package/src/bootstrap/bootstrap.test.ts +4 -8
  7. package/src/bootstrap/index.ts +25 -16
  8. package/src/bootstrap/options.ts +1 -1
  9. package/src/components/AppLayout.vue +14 -0
  10. package/src/components/{AGAppModals.vue → AppModals.vue} +3 -4
  11. package/src/components/AppOverlays.vue +9 -0
  12. package/src/components/AppToasts.vue +16 -0
  13. package/src/components/contracts/AlertModal.ts +19 -0
  14. package/src/components/contracts/Button.ts +16 -0
  15. package/src/components/contracts/ConfirmModal.ts +48 -0
  16. package/src/components/contracts/DropdownMenu.ts +25 -0
  17. package/src/components/contracts/ErrorReportModal.ts +33 -0
  18. package/src/components/contracts/Input.ts +26 -0
  19. package/src/components/contracts/LoadingModal.ts +26 -0
  20. package/src/components/contracts/Modal.ts +21 -0
  21. package/src/components/contracts/PromptModal.ts +34 -0
  22. package/src/components/contracts/Select.ts +45 -0
  23. package/src/components/contracts/Toast.ts +15 -0
  24. package/src/components/contracts/index.ts +11 -0
  25. package/src/components/headless/HeadlessButton.vue +51 -0
  26. package/src/components/headless/HeadlessInput.vue +59 -0
  27. package/src/components/headless/{forms/AGHeadlessInputDescription.vue → HeadlessInputDescription.vue} +7 -8
  28. package/src/components/headless/{forms/AGHeadlessInputError.vue → HeadlessInputError.vue} +4 -8
  29. package/src/components/headless/HeadlessInputInput.vue +86 -0
  30. package/src/components/headless/{forms/AGHeadlessInputLabel.vue → HeadlessInputLabel.vue} +3 -7
  31. package/src/components/headless/{forms/AGHeadlessInputTextArea.vue → HeadlessInputTextArea.vue} +11 -11
  32. package/src/components/headless/HeadlessModal.vue +57 -0
  33. package/src/components/headless/HeadlessModalContent.vue +30 -0
  34. package/src/components/headless/HeadlessModalDescription.vue +12 -0
  35. package/src/components/headless/HeadlessModalOverlay.vue +12 -0
  36. package/src/components/headless/HeadlessModalTitle.vue +12 -0
  37. package/src/components/headless/HeadlessSelect.vue +120 -0
  38. package/src/components/headless/{forms/AGHeadlessSelectError.vue → HeadlessSelectError.vue} +5 -6
  39. package/src/components/headless/HeadlessSelectLabel.vue +25 -0
  40. package/src/components/headless/HeadlessSelectOption.vue +34 -0
  41. package/src/components/headless/HeadlessSelectOptions.vue +42 -0
  42. package/src/components/headless/HeadlessSelectTrigger.vue +22 -0
  43. package/src/components/headless/HeadlessSelectValue.vue +18 -0
  44. package/src/components/headless/HeadlessSwitch.vue +96 -0
  45. package/src/components/headless/HeadlessToast.vue +18 -0
  46. package/src/components/headless/HeadlessToastAction.vue +13 -0
  47. package/src/components/headless/index.ts +20 -3
  48. package/src/components/index.ts +6 -9
  49. package/src/components/ui/AdvancedOptions.vue +18 -0
  50. package/src/components/ui/AlertModal.vue +17 -0
  51. package/src/components/ui/Button.vue +115 -0
  52. package/src/components/ui/Checkbox.vue +56 -0
  53. package/src/components/ui/ConfirmModal.vue +50 -0
  54. package/src/components/ui/DropdownMenu.vue +32 -0
  55. package/src/components/ui/DropdownMenuOption.vue +22 -0
  56. package/src/components/ui/DropdownMenuOptions.vue +44 -0
  57. package/src/components/ui/EditableContent.vue +82 -0
  58. package/src/components/ui/ErrorLogs.vue +19 -0
  59. package/src/components/ui/ErrorLogsModal.vue +48 -0
  60. package/src/components/ui/ErrorMessage.vue +15 -0
  61. package/src/components/ui/ErrorReportModal.vue +73 -0
  62. package/src/components/{modals/AGErrorReportModalButtons.vue → ui/ErrorReportModalButtons.vue} +34 -27
  63. package/src/components/ui/ErrorReportModalTitle.vue +24 -0
  64. package/src/components/{forms/AGForm.vue → ui/Form.vue} +4 -5
  65. package/src/components/ui/Input.vue +56 -0
  66. package/src/components/ui/Link.vue +12 -0
  67. package/src/components/ui/LoadingModal.vue +34 -0
  68. package/src/components/ui/Markdown.vue +97 -0
  69. package/src/components/ui/Modal.vue +131 -0
  70. package/src/components/ui/ModalContext.vue +31 -0
  71. package/src/components/ui/ProgressBar.vue +51 -0
  72. package/src/components/ui/PromptModal.vue +38 -0
  73. package/src/components/ui/Select.vue +27 -0
  74. package/src/components/ui/SelectLabel.vue +21 -0
  75. package/src/components/ui/SelectOption.vue +29 -0
  76. package/src/components/ui/SelectOptions.vue +35 -0
  77. package/src/components/ui/SelectTrigger.vue +29 -0
  78. package/src/components/ui/Setting.vue +31 -0
  79. package/src/components/ui/SettingsModal.vue +15 -0
  80. package/src/components/ui/StartupCrash.vue +76 -0
  81. package/src/components/ui/Switch.vue +11 -0
  82. package/src/components/ui/TextArea.vue +56 -0
  83. package/src/components/ui/Toast.vue +46 -0
  84. package/src/components/ui/index.ts +35 -0
  85. package/src/directives/index.ts +10 -4
  86. package/src/directives/measure.ts +33 -8
  87. package/src/directives/safe-html.ts +10 -0
  88. package/src/errors/Errors.state.ts +2 -1
  89. package/src/errors/Errors.ts +56 -33
  90. package/src/errors/JobCancelledError.ts +3 -0
  91. package/src/errors/index.ts +15 -8
  92. package/src/errors/settings/Debug.vue +14 -0
  93. package/src/errors/settings/index.ts +10 -0
  94. package/src/errors/utils.ts +17 -1
  95. package/src/forms/FormController.test.ts +113 -0
  96. package/src/forms/{Form.ts → FormController.ts} +73 -42
  97. package/src/forms/index.ts +3 -3
  98. package/src/forms/utils.ts +65 -24
  99. package/src/forms/validation.ts +50 -0
  100. package/src/index.css +76 -0
  101. package/src/jobs/Job.ts +144 -2
  102. package/src/jobs/index.ts +4 -1
  103. package/src/jobs/listeners.ts +3 -0
  104. package/src/jobs/status.ts +4 -0
  105. package/src/lang/DefaultLangProvider.ts +46 -0
  106. package/src/lang/Lang.state.ts +11 -0
  107. package/src/lang/Lang.ts +48 -21
  108. package/src/lang/index.ts +12 -6
  109. package/src/lang/settings/Language.vue +48 -0
  110. package/src/lang/settings/index.ts +10 -0
  111. package/src/plugins/Plugin.ts +1 -1
  112. package/src/plugins/index.ts +10 -7
  113. package/src/services/App.state.ts +36 -3
  114. package/src/services/App.ts +19 -3
  115. package/src/services/Cache.ts +1 -1
  116. package/src/services/Events.test.ts +8 -8
  117. package/src/services/Events.ts +16 -12
  118. package/src/services/Service.ts +135 -59
  119. package/src/services/Storage.ts +20 -0
  120. package/src/services/index.ts +16 -7
  121. package/src/services/utils.ts +18 -0
  122. package/src/testing/index.ts +8 -3
  123. package/src/testing/setup.ts +11 -0
  124. package/src/ui/UI.state.ts +14 -12
  125. package/src/ui/UI.ts +250 -123
  126. package/src/ui/index.ts +28 -28
  127. package/src/ui/utils.ts +16 -0
  128. package/src/utils/app.ts +7 -0
  129. package/src/utils/classes.ts +41 -0
  130. package/src/utils/composition/events.ts +4 -6
  131. package/src/utils/composition/forms.ts +20 -4
  132. package/src/utils/composition/persistent.test.ts +33 -0
  133. package/src/utils/composition/persistent.ts +11 -0
  134. package/src/utils/composition/state.test.ts +47 -0
  135. package/src/utils/composition/state.ts +33 -0
  136. package/src/utils/index.ts +6 -1
  137. package/src/utils/markdown.test.ts +50 -0
  138. package/src/utils/markdown.ts +53 -6
  139. package/src/utils/types.ts +3 -0
  140. package/src/utils/vue.ts +38 -132
  141. package/dist/aerogel-core.cjs.js +0 -2
  142. package/dist/aerogel-core.cjs.js.map +0 -1
  143. package/dist/aerogel-core.esm.js +0 -2
  144. package/dist/aerogel-core.esm.js.map +0 -1
  145. package/histoire.config.ts +0 -7
  146. package/noeldemartin.config.js +0 -5
  147. package/postcss.config.js +0 -6
  148. package/src/assets/histoire.css +0 -3
  149. package/src/components/AGAppLayout.vue +0 -16
  150. package/src/components/AGAppOverlays.vue +0 -41
  151. package/src/components/AGAppSnackbars.vue +0 -13
  152. package/src/components/constants.ts +0 -8
  153. package/src/components/forms/AGButton.vue +0 -44
  154. package/src/components/forms/AGCheckbox.vue +0 -41
  155. package/src/components/forms/AGInput.vue +0 -40
  156. package/src/components/forms/AGSelect.story.vue +0 -46
  157. package/src/components/forms/AGSelect.vue +0 -60
  158. package/src/components/forms/index.ts +0 -5
  159. package/src/components/headless/forms/AGHeadlessButton.vue +0 -56
  160. package/src/components/headless/forms/AGHeadlessInput.ts +0 -32
  161. package/src/components/headless/forms/AGHeadlessInput.vue +0 -57
  162. package/src/components/headless/forms/AGHeadlessInputInput.vue +0 -81
  163. package/src/components/headless/forms/AGHeadlessSelect.ts +0 -42
  164. package/src/components/headless/forms/AGHeadlessSelect.vue +0 -77
  165. package/src/components/headless/forms/AGHeadlessSelectButton.vue +0 -24
  166. package/src/components/headless/forms/AGHeadlessSelectLabel.vue +0 -24
  167. package/src/components/headless/forms/AGHeadlessSelectOption.ts +0 -4
  168. package/src/components/headless/forms/AGHeadlessSelectOption.vue +0 -39
  169. package/src/components/headless/forms/AGHeadlessSelectOptions.ts +0 -3
  170. package/src/components/headless/forms/composition.ts +0 -10
  171. package/src/components/headless/forms/index.ts +0 -17
  172. package/src/components/headless/modals/AGHeadlessModal.ts +0 -34
  173. package/src/components/headless/modals/AGHeadlessModal.vue +0 -86
  174. package/src/components/headless/modals/AGHeadlessModalPanel.vue +0 -28
  175. package/src/components/headless/modals/AGHeadlessModalTitle.vue +0 -13
  176. package/src/components/headless/modals/index.ts +0 -4
  177. package/src/components/headless/snackbars/AGHeadlessSnackbar.vue +0 -10
  178. package/src/components/headless/snackbars/index.ts +0 -40
  179. package/src/components/lib/AGErrorMessage.vue +0 -16
  180. package/src/components/lib/AGLink.vue +0 -9
  181. package/src/components/lib/AGMarkdown.vue +0 -41
  182. package/src/components/lib/AGMeasured.vue +0 -15
  183. package/src/components/lib/AGStartupCrash.vue +0 -31
  184. package/src/components/lib/index.ts +0 -5
  185. package/src/components/modals/AGAlertModal.ts +0 -15
  186. package/src/components/modals/AGAlertModal.vue +0 -14
  187. package/src/components/modals/AGConfirmModal.ts +0 -27
  188. package/src/components/modals/AGConfirmModal.vue +0 -26
  189. package/src/components/modals/AGErrorReportModal.ts +0 -46
  190. package/src/components/modals/AGErrorReportModal.vue +0 -54
  191. package/src/components/modals/AGErrorReportModalTitle.vue +0 -25
  192. package/src/components/modals/AGLoadingModal.ts +0 -23
  193. package/src/components/modals/AGLoadingModal.vue +0 -15
  194. package/src/components/modals/AGModal.ts +0 -10
  195. package/src/components/modals/AGModal.vue +0 -39
  196. package/src/components/modals/AGModalContext.ts +0 -8
  197. package/src/components/modals/AGModalContext.vue +0 -22
  198. package/src/components/modals/AGModalTitle.vue +0 -9
  199. package/src/components/modals/AGPromptModal.ts +0 -30
  200. package/src/components/modals/AGPromptModal.vue +0 -34
  201. package/src/components/modals/index.ts +0 -17
  202. package/src/components/snackbars/AGSnackbar.vue +0 -36
  203. package/src/components/snackbars/index.ts +0 -3
  204. package/src/components/utils.ts +0 -10
  205. package/src/directives/initial-focus.ts +0 -11
  206. package/src/forms/Form.test.ts +0 -58
  207. package/src/forms/composition.ts +0 -6
  208. package/src/main.histoire.ts +0 -1
  209. package/src/utils/tailwindcss.test.ts +0 -26
  210. package/src/utils/tailwindcss.ts +0 -7
  211. package/tailwind.config.js +0 -4
  212. package/tsconfig.json +0 -11
  213. package/vite.config.ts +0 -14
  214. /package/src/{main.ts → index.ts} +0 -0
@@ -0,0 +1,3813 @@
1
+ var St = Object.defineProperty;
2
+ var Tt = (t, s, e) => s in t ? St(t, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[s] = e;
3
+ var _ = (t, s, e) => Tt(t, typeof s != "symbol" ? s + "" : s, e);
4
+ import { markRaw as E, Comment as Mt, Text as Ht, Static as Et, inject as X, reactive as pe, unref as o, onUnmounted as ge, ref as U, computed as c, readonly as ve, nextTick as Oe, useAttrs as Ne, onMounted as Vt, watch as Me, toRaw as Lt, watchEffect as Y, defineComponent as g, createBlock as h, openBlock as u, mergeProps as H, withCtx as f, renderSlot as w, createPropsRestProxy as N, createVNode as p, normalizeProps as ne, guardReactiveProps as ae, createTextVNode as I, toDisplayString as x, normalizeClass as k, createElementBlock as b, Fragment as D, renderList as F, provide as le, resolveDynamicComponent as W, useSlots as He, createCommentVNode as T, createElementVNode as y, h as It, toRef as Re, useTemplateRef as G, withModifiers as We, withDirectives as Ke, vModelCheckbox as qt, normalizeStyle as zt, resolveComponent as Rt, createApp as Pt, vModelText as At } from "vue";
5
+ import { JSError as be, stringToSlug as Dt, tap as ee, MagicObject as Qe, PromisedValue as K, Storage as O, objectOnly as oe, arrayFrom as Je, isEmpty as xe, objectDeepClone as jt, fail as Q, facade as te, arrayRemove as Se, getEnv as Bt, updateLocationQueryParameters as Ft, forever as Ut, toString as B, objectWithout as Ot, noop as Nt, debounce as Wt, stringMatchAll as Ze, isDevelopment as J, isTesting as Ee, after as ue, uuid as re, required as Kt, isObject as ce, objectWithoutEmpty as Xe, value as Qt, isInstanceOf as Pe, stringExcerpt as Jt, arraySorted as Zt, ListenersManager as Xt, toError as Yt, round as Gt } from "@noeldemartin/utils";
6
+ import j from "virtual:aerogel";
7
+ import { createPinia as es, setActivePinia as ts, defineStore as ss } from "pinia";
8
+ import rs from "dompurify";
9
+ import { marked as ns, Renderer as Ae } from "marked";
10
+ import as from "clsx";
11
+ import { cva as ls } from "class-variance-authority";
12
+ import { twMerge as os } from "tailwind-merge";
13
+ import { Primitive as is, SelectValue as De, SelectTrigger as us, SelectIcon as cs, SelectItem as ds, SelectItemText as ps, SelectPortal as ms, SelectContent as fs, SelectViewport as hs, SelectRoot as gs, Label as vs, useForwardExpose as Ve, SwitchRoot as bs, SwitchThumb as ys, DialogRoot as ws, DialogPortal as $s, DialogContent as _s, DialogDescription as xs, DialogOverlay as Cs, DialogTitle as ks, ToastClose as Ss, ToastRoot as Ts, ToastProvider as Ms, ToastViewport as Hs, DropdownMenuItem as Es, DropdownMenuContent as Vs, DropdownMenuRoot as Ls, DropdownMenuTrigger as Is, DropdownMenuPortal as qs } from "reka-ui";
14
+ class Te extends be {
15
+ constructor(s, e) {
16
+ super(`Service '${s}' failed booting`, { cause: e });
17
+ }
18
+ }
19
+ function zs() {
20
+ return j.namespace ?? Dt(j.name);
21
+ }
22
+ let Le = null;
23
+ function Ye() {
24
+ return Le ?? Rs();
25
+ }
26
+ function Rs() {
27
+ return ee(es(), (t) => {
28
+ Le = t, ts(t);
29
+ });
30
+ }
31
+ function Ps() {
32
+ return Le ?? Ye();
33
+ }
34
+ function As(t, s) {
35
+ return Ye(), ss(t, s)();
36
+ }
37
+ function ye(t) {
38
+ var s;
39
+ return s = class extends we {
40
+ usesStore() {
41
+ return !0;
42
+ }
43
+ getName() {
44
+ return t.name ?? null;
45
+ }
46
+ getInitialState() {
47
+ return typeof t.initialState == "function" ? t.initialState() : Object.entries(t.initialState).reduce((e, [r, n]) => {
48
+ try {
49
+ n = structuredClone(n);
50
+ } catch {
51
+ console.warn(
52
+ `Could not clone '${r}' state from ${this.getName()} service, this may cause problems if you're using multiple instances of the service (for example, in unit tests).
53
+ To fix this problem, declare your initialState as a function instead.`
54
+ );
55
+ }
56
+ return e[r] = n, e;
57
+ }, {});
58
+ }
59
+ getComputedStateDefinition() {
60
+ return t.computed ?? {};
61
+ }
62
+ getStateWatchers() {
63
+ return t.watch ?? {};
64
+ }
65
+ serializePersistedState(e) {
66
+ var r;
67
+ return ((r = t.serialize) == null ? void 0 : r.call(t, e)) ?? e;
68
+ }
69
+ deserializePersistedState(e) {
70
+ var r;
71
+ return ((r = t.restore) == null ? void 0 : r.call(t, e)) ?? e;
72
+ }
73
+ }, _(s, "persist", t.persist ?? []), s;
74
+ }
75
+ var ke;
76
+ let we = (ke = class extends Qe {
77
+ constructor() {
78
+ super();
79
+ _(this, "_name");
80
+ _(this, "_booted");
81
+ _(this, "_computedStateKeys");
82
+ _(this, "_watchers");
83
+ _(this, "_store");
84
+ const e = this.getComputedStateDefinition();
85
+ this._name = this.getName() ?? new.target.name, this._booted = new K(), this._computedStateKeys = new Set(Object.keys(e)), this._watchers = this.getStateWatchers(), this._store = this.usesStore() && As(this._name, {
86
+ state: () => this.getInitialState(),
87
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
88
+ getters: e
89
+ });
90
+ }
91
+ get booted() {
92
+ return this._booted;
93
+ }
94
+ static(e) {
95
+ return super.static(e);
96
+ }
97
+ launch() {
98
+ const e = (r) => this._booted.reject(new Te(this._name, r));
99
+ try {
100
+ this.frameworkBoot().then(() => this.boot()).then(() => this._booted.resolve()).catch(e);
101
+ } catch (r) {
102
+ e(r);
103
+ }
104
+ return this._booted;
105
+ }
106
+ hasPersistedState() {
107
+ return O.has(this.storageKey);
108
+ }
109
+ hasState(e) {
110
+ return this._store ? e in this._store.$state || this._computedStateKeys.has(e) : !1;
111
+ }
112
+ getState(e) {
113
+ const r = this._store;
114
+ return e ? r ? r[e] : void 0 : r || {};
115
+ }
116
+ setState(e, r) {
117
+ if (!this._store)
118
+ return;
119
+ const n = typeof e == "string" ? { [e]: r } : e, a = oe(this._store.$state, Object.keys(n));
120
+ Object.assign(this._store.$state, n), this.onStateUpdated(n, a);
121
+ }
122
+ updatePersistedState(e) {
123
+ if (!this._store)
124
+ return;
125
+ const r = Je(e), n = oe(this._store.$state, r);
126
+ xe(n) || this.onPersistentStateUpdated(n);
127
+ }
128
+ __get(e) {
129
+ return this.hasState(e) ? this.getState(e) : super.__get(e);
130
+ }
131
+ __set(e, r) {
132
+ this.setState({ [e]: r });
133
+ }
134
+ get storageKey() {
135
+ return `${zs()}:${this._name}`;
136
+ }
137
+ onStateUpdated(e, r) {
138
+ const n = oe(e, this.static("persist"));
139
+ xe(n) || this.onPersistentStateUpdated(n);
140
+ for (const a in e) {
141
+ const i = this._watchers[a];
142
+ !i || e[a] === r[a] || i.call(this, e[a], r[a]);
143
+ }
144
+ }
145
+ onPersistentStateUpdated(e) {
146
+ const r = O.get(this.storageKey);
147
+ r && O.set(this.storageKey, {
148
+ ...r,
149
+ ...this.serializePersistedState(jt(e))
150
+ });
151
+ }
152
+ usesStore() {
153
+ return !1;
154
+ }
155
+ getName() {
156
+ return null;
157
+ }
158
+ getInitialState() {
159
+ return {};
160
+ }
161
+ getComputedStateDefinition() {
162
+ return {};
163
+ }
164
+ getStateWatchers() {
165
+ return {};
166
+ }
167
+ serializePersistedState(e) {
168
+ return e;
169
+ }
170
+ deserializePersistedState(e) {
171
+ return e;
172
+ }
173
+ async frameworkBoot() {
174
+ this.restorePersistedState();
175
+ }
176
+ async boot() {
177
+ }
178
+ restorePersistedState() {
179
+ if (!(!this.usesStore() || xe(this.static("persist")))) {
180
+ if (O.has(this.storageKey)) {
181
+ const e = O.require(this.storageKey);
182
+ this.setState(this.deserializePersistedState(e));
183
+ return;
184
+ }
185
+ O.set(this.storageKey, oe(this.getState(), this.static("persist")));
186
+ }
187
+ }
188
+ requireStore() {
189
+ return this._store ? this._store : Q(`Failed getting '${this._name}' store`);
190
+ }
191
+ }, _(ke, "persist", []), ke);
192
+ const ol = {
193
+ Low: -256,
194
+ Default: 0,
195
+ High: 256
196
+ };
197
+ class Ds extends we {
198
+ constructor() {
199
+ super(...arguments);
200
+ _(this, "listeners", {});
201
+ }
202
+ async boot() {
203
+ Object.entries(globalThis.__aerogelEvents__ ?? {}).forEach(([e, r]) => (
204
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
205
+ this.on(e, r)
206
+ ));
207
+ }
208
+ async emit(e, r) {
209
+ var a;
210
+ const n = this.listeners[e] ?? { priorities: [], handlers: {} };
211
+ for (const i of n.priorities)
212
+ await Promise.all(((a = n.handlers[i]) == null ? void 0 : a.map((l) => l(r))) ?? []);
213
+ }
214
+ // prettier-ignore
215
+ /* eslint-enable max-len */
216
+ on(e, r, n) {
217
+ const a = typeof r == "function" ? {} : typeof r == "number" ? { priority: r } : r, i = typeof r == "function" ? r : n;
218
+ return this.registerListener(e, a, i), () => this.off(e, i);
219
+ }
220
+ // prettier-ignore
221
+ /* eslint-enable max-len */
222
+ once(e, r, n) {
223
+ let a = null;
224
+ const i = typeof r == "function" ? {} : r, l = typeof r == "function" ? r : n;
225
+ return ee(
226
+ () => a && this.off(e, a),
227
+ (d) => {
228
+ a = (...v) => (d(), l(...v)), this.registerListener(e, i, l);
229
+ }
230
+ );
231
+ }
232
+ off(e, r) {
233
+ var i;
234
+ const n = this.listeners[e];
235
+ if (!n)
236
+ return;
237
+ const a = [...n.priorities];
238
+ for (const l of a)
239
+ Se(n.handlers[l] ?? [], r), ((i = n.handlers[l]) == null ? void 0 : i.length) === 0 && (delete n.handlers[l], Se(n.priorities, l));
240
+ n.priorities.length === 0 && delete this.listeners[e];
241
+ }
242
+ registerListener(e, r, n) {
243
+ var d, v, $;
244
+ const a = r.priority ?? 0;
245
+ e in this.listeners || (this.listeners[e] = { priorities: [], handlers: {} });
246
+ const i = ((d = this.listeners[e]) == null ? void 0 : d.priorities) ?? Q(`priorities missing for event '${e}'`), l = ((v = this.listeners[e]) == null ? void 0 : v.handlers) ?? Q(`handlers missing for event '${e}'`);
247
+ i.includes(a) || (i.push(a), i.sort((m, C) => C - m), l[a] = []), ($ = l[a]) == null || $.push(n);
248
+ }
249
+ }
250
+ const R = te(Ds);
251
+ function il(t) {
252
+ return t;
253
+ }
254
+ const js = ye({
255
+ name: "app",
256
+ initialState: {
257
+ plugins: {},
258
+ instance: null,
259
+ environment: Bt() ?? "development",
260
+ version: j.version,
261
+ sourceUrl: j.sourceUrl,
262
+ settings: []
263
+ },
264
+ computed: {
265
+ development: (t) => t.environment === "development",
266
+ staging: (t) => t.environment === "staging",
267
+ testing: (t) => t.environment === "test" || t.environment === "testing",
268
+ versionName(t) {
269
+ return this.development ? "dev." + j.sourceHash.toString().substring(0, 7) : this.staging ? "staging." + j.sourceHash.toString().substring(0, 7) : `v${t.version}`;
270
+ },
271
+ versionUrl(t) {
272
+ return t.sourceUrl + (this.development || this.staging ? `/tree/${j.sourceHash}` : `/releases/tag/${this.versionName}`);
273
+ }
274
+ }
275
+ });
276
+ class Bs extends js {
277
+ constructor() {
278
+ super(...arguments);
279
+ _(this, "name", j.name);
280
+ _(this, "ready", new K());
281
+ _(this, "mounted", new K());
282
+ }
283
+ isReady() {
284
+ return this.ready.isResolved();
285
+ }
286
+ isMounted() {
287
+ return this.mounted.isResolved();
288
+ }
289
+ addSetting(e) {
290
+ this.settings.push(E(e));
291
+ }
292
+ async whenReady(e) {
293
+ return await this.ready.then(e);
294
+ }
295
+ async reload(e) {
296
+ e && Ft(e), location.reload(), await Ut();
297
+ }
298
+ plugin(e) {
299
+ return this.plugins[e] ?? null;
300
+ }
301
+ service(e) {
302
+ var r;
303
+ return ((r = this.instance) == null ? void 0 : r.config.globalProperties[e]) ?? null;
304
+ }
305
+ async boot() {
306
+ R.once("application-ready", () => this.ready.resolve()), R.once("application-mounted", () => this.mounted.resolve());
307
+ }
308
+ }
309
+ const A = te(Bs);
310
+ function ul(t) {
311
+ return t;
312
+ }
313
+ async function Fs(t, ...s) {
314
+ A.setState(
315
+ "plugins",
316
+ t.reduce(
317
+ (e, r) => (r.name && (e[r.name] = r), e),
318
+ {}
319
+ )
320
+ ), await Promise.all(t.map((e) => e.install(...s)) ?? []);
321
+ }
322
+ function Us(t) {
323
+ return Object.entries(t.props ?? {}).reduce((s, [e, r]) => s + `${e}="${B(r)}"`, "");
324
+ }
325
+ function cl(t) {
326
+ return t;
327
+ }
328
+ function Os(t) {
329
+ const s = X(t);
330
+ return s ? pe(s) : void 0;
331
+ }
332
+ function V(t, s) {
333
+ return Os(t) ?? Q(s ?? `Could not resolve '${B(t)}' injection key`);
334
+ }
335
+ function Ns(t, s) {
336
+ return X(t) ?? Q(s ?? `Could not resolve '${B(t)}' injection key`);
337
+ }
338
+ function Ge(t) {
339
+ return typeof t == "string" ? t : t.type === Mt ? "" : t.type === Ht || t.type === Et ? t.children : t.type === "br" ? `
340
+
341
+ ` : `<${t.type} ${Us(t)}>${Array.from(t.children).map(Ge).join("")}</${t.type}>`;
342
+ }
343
+ const Ce = /* @__PURE__ */ new WeakMap(), Ws = {
344
+ mounted(t, { value: s, modifiers: e }) {
345
+ const r = typeof s == "function" ? s : null, n = () => {
346
+ const a = t.getBoundingClientRect();
347
+ e.css && (t.style.setProperty("--width", `${a.width}px`), t.style.setProperty("--height", `${a.height}px`)), r == null || r({ width: a.width, height: a.height });
348
+ };
349
+ e.watch && Ce.set(t, ee(new ResizeObserver(n)).observe(t)), n();
350
+ },
351
+ unmounted(t) {
352
+ var s;
353
+ (s = Ce.get(t)) == null || s.unobserve(t), Ce.delete(t);
354
+ }
355
+ };
356
+ function et(t, s) {
357
+ const { baseClasses: e, ...r } = t, { baseClasses: n, ...a } = s, i = ls(n, a);
358
+ return M(i(r), o(e));
359
+ }
360
+ function M(...t) {
361
+ return os(as(t));
362
+ }
363
+ function tt(t, s) {
364
+ const e = R.on(t, s);
365
+ ge(() => e());
366
+ }
367
+ const Ks = {
368
+ required: (t) => t ? void 0 : "required"
369
+ };
370
+ function Qs(t, s) {
371
+ var e;
372
+ if (t == null)
373
+ return !0;
374
+ switch (s.type) {
375
+ case "string":
376
+ return typeof t == "string";
377
+ case "enum":
378
+ return !!((e = s.values) != null && e.includes(t));
379
+ case "number":
380
+ return typeof t == "number";
381
+ case "boolean":
382
+ return typeof t == "boolean";
383
+ case "date":
384
+ return t instanceof Date;
385
+ case "object":
386
+ return typeof t == "object";
387
+ }
388
+ }
389
+ const de = { ...Ks };
390
+ function dl(t, s) {
391
+ de[t] = s;
392
+ }
393
+ function Js(t, s) {
394
+ return Qs(t, s) ? [] : ["invalid_value"];
395
+ }
396
+ function Zs(t, s) {
397
+ var r;
398
+ const e = (r = de[s]) == null ? void 0 : r.call(de, t);
399
+ return e ? Je(e) : [];
400
+ }
401
+ const pl = Symbol(), je = /* @__PURE__ */ new WeakMap();
402
+ class Xs extends Qe {
403
+ constructor(e) {
404
+ super();
405
+ _(this, "errors");
406
+ _(this, "_fields");
407
+ _(this, "_data");
408
+ _(this, "_submitted");
409
+ _(this, "_errors");
410
+ _(this, "_listeners", {});
411
+ this._fields = e, this._submitted = U(!1), this._data = this.getInitialData(e), this._errors = this.getInitialErrors(e), je.set(
412
+ this,
413
+ c(() => !Object.values(this._errors).some((r) => r !== null))
414
+ ), this.errors = ve(this._errors);
415
+ }
416
+ get valid() {
417
+ var e;
418
+ return !!((e = je.get(this)) != null && e.value);
419
+ }
420
+ get submitted() {
421
+ return this._submitted.value;
422
+ }
423
+ setFieldValue(e, r) {
424
+ const n = this._fields[e] ?? Q(`Trying to set undefined '${B(e)}' field`);
425
+ this._data[e] = n.type === "string" && (n.trim ?? !0) ? B(r).trim() : r, this._submitted.value && this.validate();
426
+ }
427
+ getFieldValue(e) {
428
+ return this._data[e];
429
+ }
430
+ getFieldRules(e) {
431
+ var r, n;
432
+ return ((n = (r = this._fields[e]) == null ? void 0 : r.rules) == null ? void 0 : n.split("|")) ?? [];
433
+ }
434
+ getFieldType(e) {
435
+ var r;
436
+ return ((r = this._fields[e]) == null ? void 0 : r.type) ?? null;
437
+ }
438
+ data() {
439
+ return { ...this._data };
440
+ }
441
+ validate() {
442
+ const e = Object.entries(this._fields).reduce(
443
+ (r, [n, a]) => (r[n] = this.getFieldErrors(n, a), r),
444
+ {}
445
+ );
446
+ return this.resetErrors(e), this.valid;
447
+ }
448
+ reset(e = {}) {
449
+ this._submitted.value = !1, e.keepData || this.resetData(), e.keepErrors || this.resetErrors();
450
+ }
451
+ submit() {
452
+ var r;
453
+ this._submitted.value = !0;
454
+ const e = this.validate();
455
+ return e && ((r = this._listeners.submit) == null || r.forEach((n) => n())), e;
456
+ }
457
+ on(e, r) {
458
+ var n, a;
459
+ return (n = this._listeners)[e] ?? (n[e] = []), (a = this._listeners[e]) == null || a.push(r), () => this.off(e, r);
460
+ }
461
+ off(e, r) {
462
+ Se(this._listeners[e] ?? [], r);
463
+ }
464
+ async focus(e) {
465
+ var r;
466
+ await Oe(), (r = this._listeners.focus) == null || r.forEach((n) => n(e));
467
+ }
468
+ __get(e) {
469
+ return e in this._fields ? this.getFieldValue(e) : super.__get(e);
470
+ }
471
+ __set(e, r) {
472
+ if (!(e in this._fields)) {
473
+ super.__set(e, r);
474
+ return;
475
+ }
476
+ this.setFieldValue(e, r);
477
+ }
478
+ getFieldErrors(e, r) {
479
+ var l;
480
+ const n = [], a = this._data[e], i = ((l = r.rules) == null ? void 0 : l.split("|")) ?? [];
481
+ n.push(...Js(a, r));
482
+ for (const d of i)
483
+ d !== "required" && a == null || n.push(...Zs(a, d));
484
+ return n.length > 0 ? n : null;
485
+ }
486
+ getInitialData(e) {
487
+ if (this.static().isConjuring())
488
+ return {};
489
+ const r = Object.entries(e).reduce((n, [a, i]) => (n[a] = i.default ?? null, n), {});
490
+ return pe(r);
491
+ }
492
+ getInitialErrors(e) {
493
+ if (this.static().isConjuring())
494
+ return {};
495
+ const r = Object.keys(e).reduce((n, a) => (n[a] = null, n), {});
496
+ return pe(r);
497
+ }
498
+ resetData() {
499
+ for (const [e, r] of Object.entries(this._fields))
500
+ this._data[e] = r.default ?? null;
501
+ }
502
+ resetErrors(e) {
503
+ Object.keys(this._errors).forEach((r) => delete this._errors[r]), e && Object.assign(this._errors, e);
504
+ }
505
+ }
506
+ function st(t, s) {
507
+ const e = X("form", null), r = e == null ? void 0 : e.on("focus", (n) => t.name === n && s());
508
+ ge(() => r == null ? void 0 : r());
509
+ }
510
+ function rt(t) {
511
+ return new Xs(t);
512
+ }
513
+ function Ie() {
514
+ const t = Ne(), s = c(() => t.class);
515
+ return [c(() => Ot(t, "class")), s];
516
+ }
517
+ function ml(t) {
518
+ let s = Nt;
519
+ Vt(() => s = t()), ge(() => s());
520
+ }
521
+ function fl(t, s) {
522
+ const e = pe(O.get(t) ?? s);
523
+ return Me(e, () => O.set(t, Lt(e))), e;
524
+ }
525
+ function hl(t) {
526
+ const s = U(), e = c(t);
527
+ return Me(e, async () => s.value = await e.value, { immediate: !0 }), s;
528
+ }
529
+ function gl(t, s) {
530
+ const e = s ? t : {}, r = s ?? t, n = U(e.initial ?? null), a = Wt((i) => n.value = i, e.delay ?? 300);
531
+ return Y(() => a(r())), n;
532
+ }
533
+ let ie = null;
534
+ function Ys() {
535
+ return ee(new Ae(), (t) => {
536
+ t.link = function(s) {
537
+ const e = Ae.prototype.link.apply(this, [s]);
538
+ return s.href.startsWith("#") ? e : e.replace("<a", '<a target="_blank"');
539
+ };
540
+ });
541
+ }
542
+ function Gs(t) {
543
+ const s = Ze(t, /<a[^>]*href="#action:([^"]+)"[^>]*>([^<]+)<\/a>/g);
544
+ for (const [e, r, n] of s)
545
+ t = t.replace(e, `<button type="button" data-markdown-action="${r}">${n}</button>`);
546
+ return t;
547
+ }
548
+ function er(t) {
549
+ const s = Ze(t, /<a[^>]*href="#route:([^"]+)"[^>]*>([^<]+)<\/a>/g);
550
+ for (const [e, r, n] of s) {
551
+ const a = (ie == null ? void 0 : ie.resolve(r)) ?? r;
552
+ t = t.replace(e, `<a data-markdown-route="${r}" href="${a}">${n}</a>`);
553
+ }
554
+ return t;
555
+ }
556
+ function tr() {
557
+ return ie;
558
+ }
559
+ function vl(t) {
560
+ ie = t;
561
+ }
562
+ function sr(t) {
563
+ let s = ns(t, { renderer: Ys(), async: !1 });
564
+ return s = nt(s), s = Gs(s), s = er(s), s;
565
+ }
566
+ function nt(t) {
567
+ return rs.sanitize(t, { ADD_ATTR: ["target"] });
568
+ }
569
+ const rr = {
570
+ mounted(t, { value: s }) {
571
+ t.innerHTML = nt(s);
572
+ }
573
+ }, nr = {
574
+ measure: Ws,
575
+ "safe-html": rr
576
+ }, ar = {
577
+ install(t, s) {
578
+ const e = {
579
+ ...nr,
580
+ ...s.directives
581
+ };
582
+ for (const [r, n] of Object.entries(e))
583
+ t.directive(r, n);
584
+ }
585
+ };
586
+ class lr extends we {
587
+ constructor() {
588
+ super(...arguments);
589
+ _(this, "cache");
590
+ }
591
+ async get(e) {
592
+ return await (await this.open()).match(e) ?? null;
593
+ }
594
+ async store(e, r) {
595
+ await (await this.open()).put(e, r);
596
+ }
597
+ async replace(e, r) {
598
+ const n = await this.open();
599
+ (await n.keys(e)).length !== 0 && await n.put(e, r);
600
+ }
601
+ async open() {
602
+ return this.cache = this.cache ?? ee(new K(), (e) => {
603
+ caches.open("app").then((r) => e.resolve(r));
604
+ });
605
+ }
606
+ }
607
+ const bl = te(lr);
608
+ class or extends we {
609
+ async purge() {
610
+ await R.emit("purge-storage");
611
+ }
612
+ }
613
+ const at = te(or);
614
+ function yl(t, s) {
615
+ return {
616
+ ...t,
617
+ ...oe(s, Object.keys(t))
618
+ };
619
+ }
620
+ const ir = {
621
+ $app: A,
622
+ $events: R,
623
+ $storage: at
624
+ };
625
+ async function $e(t, s) {
626
+ await Promise.all(
627
+ Object.entries(s).map(async ([e, r]) => {
628
+ await r.launch().catch((n) => {
629
+ var a, i;
630
+ return (i = (a = t.config).errorHandler) == null ? void 0 : i.call(a, n, null, `Failed launching ${e}.`);
631
+ });
632
+ })
633
+ ), Object.assign(t.config.globalProperties, s), (J() || Ee()) && Object.assign(globalThis, s);
634
+ }
635
+ const ur = {
636
+ async install(t, s) {
637
+ var r;
638
+ const e = {
639
+ ...ir,
640
+ ...s.services
641
+ };
642
+ t.use(Ps()), (r = s.settings) == null || r.forEach((n) => A.addSetting(n)), await $e(t, e);
643
+ }
644
+ }, lt = 768, me = {
645
+ Mobile: "mobile",
646
+ Desktop: "desktop"
647
+ };
648
+ function ot() {
649
+ return globalThis.innerWidth > lt ? me.Desktop : me.Mobile;
650
+ }
651
+ const cr = ye({
652
+ name: "ui",
653
+ initialState: {
654
+ modals: [],
655
+ toasts: [],
656
+ layout: ot()
657
+ },
658
+ computed: {
659
+ desktop: ({ layout: t }) => t === me.Desktop,
660
+ mobile: ({ layout: t }) => t === me.Mobile,
661
+ openModals: ({ modals: t }) => t.filter(({ closing: s }) => !s)
662
+ }
663
+ });
664
+ class dr extends cr {
665
+ constructor() {
666
+ super(...arguments);
667
+ _(this, "modalCallbacks", {});
668
+ _(this, "components", {});
669
+ }
670
+ registerComponent(e, r) {
671
+ this.components[e] = r;
672
+ }
673
+ resolveComponent(e) {
674
+ return this.components[e] ?? null;
675
+ }
676
+ requireComponent(e) {
677
+ return this.resolveComponent(e) ?? Q(`UI Component '${e}' is not defined!`);
678
+ }
679
+ alert(e, r) {
680
+ const n = () => typeof r != "string" ? { message: e } : {
681
+ title: e,
682
+ message: r
683
+ };
684
+ this.modal(this.requireComponent("alert-modal"), n());
685
+ }
686
+ // prettier-ignore
687
+ /* eslint-enable max-len */
688
+ async confirm(e, r, n) {
689
+ const i = typeof r != "string" ? {
690
+ ...r ?? {},
691
+ message: e,
692
+ required: !!(r != null && r.required)
693
+ } : {
694
+ ...n ?? {},
695
+ title: e,
696
+ message: r,
697
+ required: !!(n != null && n.required)
698
+ }, l = await this.modalForm(this.requireComponent("confirm-modal"), i), d = typeof l == "object" ? l[0] : l ?? !1, v = typeof l == "object" ? l[1] : Object.entries(i.checkboxes ?? {}).reduce(
699
+ ($, [m, { default: C }]) => ({
700
+ [m]: C ?? !1,
701
+ ...$
702
+ }),
703
+ {}
704
+ );
705
+ for (const [$, m] of Object.entries(i.checkboxes ?? {}))
706
+ if (!(!m.required || v[$]))
707
+ return d && J() && console.warn(`Confirmed confirm modal was suppressed because required '${$}' checkbox was missing`), [!1, v];
708
+ return "checkboxes" in i ? [d, v] : d;
709
+ }
710
+ async prompt(e, r, n) {
711
+ const a = (n == null ? void 0 : n.trim) ?? !0, i = () => typeof r != "string" ? {
712
+ message: e,
713
+ ...r ?? {}
714
+ } : {
715
+ title: e,
716
+ message: r,
717
+ ...n ?? {}
718
+ }, l = await this.modalForm(this.requireComponent("prompt-modal"), i());
719
+ return (a && typeof l == "string" ? l == null ? void 0 : l.trim() : l) ?? null;
720
+ }
721
+ async loading(e, r) {
722
+ const n = (m) => typeof m == "function" ? Promise.resolve(m()) : m, a = () => {
723
+ if (typeof e == "string")
724
+ return {
725
+ props: { message: e },
726
+ operationPromise: n(r)
727
+ };
728
+ if (typeof e == "function" || e instanceof Promise)
729
+ return { operationPromise: n(e) };
730
+ const { delay: m, ...C } = e;
731
+ return {
732
+ props: C,
733
+ delay: o(m),
734
+ operationPromise: n(r)
735
+ };
736
+ };
737
+ let i = !1;
738
+ const { operationPromise: l, props: d, delay: v } = a();
739
+ if (v && await Promise.race([ue({ ms: v }).then(() => i = !0), l]), v && !i)
740
+ return l;
741
+ const $ = await this.modal(this.requireComponent("loading-modal"), d);
742
+ try {
743
+ const m = await l;
744
+ return await ue({ ms: 500 }), m;
745
+ } finally {
746
+ await this.closeModal($.id);
747
+ }
748
+ }
749
+ toast(e, r = {}) {
750
+ const { component: n, ...a } = r, i = {
751
+ id: re(),
752
+ properties: { message: e, ...a },
753
+ component: E(n ?? this.requireComponent("toast"))
754
+ };
755
+ this.setState("toasts", this.toasts.concat(i));
756
+ }
757
+ async modal(e, r) {
758
+ const n = re(), a = {}, i = {
759
+ id: n,
760
+ closing: !1,
761
+ properties: r ?? {},
762
+ component: E(e),
763
+ beforeClose: new Promise((d) => a.willClose = d),
764
+ afterClose: new Promise((d) => a.hasClosed = d)
765
+ }, l = this.modals.concat(i);
766
+ return this.modalCallbacks[i.id] = a, this.setState({ modals: l }), await Oe(), i;
767
+ }
768
+ async modalForm(e, r) {
769
+ return await (await this.modal(e, r)).beforeClose;
770
+ }
771
+ async closeModal(e, r) {
772
+ if (!A.isMounted()) {
773
+ await this.removeModal(e, r);
774
+ return;
775
+ }
776
+ await R.emit("close-modal", { id: e, result: r });
777
+ }
778
+ async closeAllModals() {
779
+ for (; this.modals.length > 0; )
780
+ await this.closeModal(Kt(this.modals[this.modals.length - 1]).id);
781
+ }
782
+ async boot() {
783
+ this.watchModalEvents(), this.watchMountedEvent(), this.watchViewportBreakpoints();
784
+ }
785
+ async removeModal(e, r) {
786
+ var n, a;
787
+ this.setState(
788
+ "modals",
789
+ this.modals.filter((i) => i.id !== e)
790
+ ), (a = (n = this.modalCallbacks[e]) == null ? void 0 : n.hasClosed) == null || a.call(n, r), delete this.modalCallbacks[e];
791
+ }
792
+ watchModalEvents() {
793
+ R.on("modal-will-close", ({ modal: { id: e }, result: r }) => {
794
+ var a, i;
795
+ const n = this.modals.find((l) => e === l.id);
796
+ n && (n.closing = !0), (i = (a = this.modalCallbacks[e]) == null ? void 0 : a.willClose) == null || i.call(a, r);
797
+ }), R.on("modal-has-closed", async ({ modal: { id: e }, result: r }) => {
798
+ await this.removeModal(e, r);
799
+ });
800
+ }
801
+ watchMountedEvent() {
802
+ R.once("application-mounted", async () => {
803
+ if (!globalThis.document || !globalThis.getComputedStyle)
804
+ return;
805
+ const e = globalThis.document.getElementById("splash");
806
+ e && (globalThis.getComputedStyle(e).opacity !== "0" && (e.style.opacity = "0", await ue({ ms: 600 })), e.remove());
807
+ });
808
+ }
809
+ watchViewportBreakpoints() {
810
+ if (!globalThis.matchMedia)
811
+ return;
812
+ globalThis.matchMedia(`(min-width: ${lt}px)`).addEventListener("change", () => this.setState({ layout: ot() }));
813
+ }
814
+ }
815
+ const z = te(dr);
816
+ class pr {
817
+ constructor(s, e) {
818
+ this.locale = s, this.fallbackLocale = e;
819
+ }
820
+ getLocale() {
821
+ return this.locale;
822
+ }
823
+ async setLocale(s) {
824
+ this.locale = s;
825
+ }
826
+ getFallbackLocale() {
827
+ return this.fallbackLocale;
828
+ }
829
+ async setFallbackLocale(s) {
830
+ this.fallbackLocale = s;
831
+ }
832
+ getLocales() {
833
+ return ["en"];
834
+ }
835
+ translate(s) {
836
+ return J() && console.warn("Lang provider is missing"), s;
837
+ }
838
+ translateWithDefault(s, e) {
839
+ return J() && console.warn("Lang provider is missing"), e;
840
+ }
841
+ }
842
+ const mr = ye({
843
+ name: "lang",
844
+ persist: ["locale", "fallbackLocale"],
845
+ initialState: {
846
+ locale: null,
847
+ locales: ["en"],
848
+ fallbackLocale: "en"
849
+ }
850
+ });
851
+ class fr extends mr {
852
+ constructor() {
853
+ super();
854
+ _(this, "provider");
855
+ this.provider = new pr(
856
+ this.getState("locale") ?? this.getBrowserLocale(),
857
+ this.getState("fallbackLocale")
858
+ );
859
+ }
860
+ async setProvider(e) {
861
+ this.provider = e, this.locales = e.getLocales(), await e.setLocale(this.locale ?? this.getBrowserLocale()), await e.setFallbackLocale(this.fallbackLocale);
862
+ }
863
+ translate(e, r) {
864
+ return this.provider.translate(e, r) ?? e;
865
+ }
866
+ translateWithDefault(e, r, n = {}) {
867
+ return this.provider.translateWithDefault(e, r, n);
868
+ }
869
+ getBrowserLocale() {
870
+ const e = this.getState("locales");
871
+ return navigator.languages.find((r) => e.includes(r)) ?? "en";
872
+ }
873
+ async boot() {
874
+ globalThis.document && this.requireStore().$subscribe(
875
+ async () => {
876
+ var e, r;
877
+ await this.provider.setLocale(this.locale ?? this.getBrowserLocale()), await this.provider.setFallbackLocale(this.fallbackLocale), this.locale ? (e = document.querySelector("html")) == null || e.setAttribute("lang", this.locale) : (r = document.querySelector("html")) == null || r.removeAttribute("lang");
878
+ },
879
+ { immediate: !0 }
880
+ );
881
+ }
882
+ }
883
+ const Z = te(fr), it = Z.translate.bind(Z), S = Z.translateWithDefault.bind(Z), hr = ye({
884
+ name: "errors",
885
+ initialState: {
886
+ logs: [],
887
+ startupErrors: [],
888
+ debug: !1
889
+ },
890
+ computed: {
891
+ hasErrors: ({ logs: t }) => t.length > 0,
892
+ hasNewErrors: ({ logs: t }) => t.some((s) => !s.seen),
893
+ hasStartupErrors: ({ startupErrors: t }) => t.length > 0
894
+ }
895
+ });
896
+ class gr extends hr {
897
+ constructor() {
898
+ super(...arguments);
899
+ _(this, "forceReporting", !1);
900
+ _(this, "enabled", !0);
901
+ _(this, "eruda", null);
902
+ }
903
+ enable() {
904
+ this.enabled = !0;
905
+ }
906
+ disable() {
907
+ this.enabled = !1;
908
+ }
909
+ async inspect(e, r) {
910
+ if (Array.isArray(e) && e.length === 0) {
911
+ z.alert(S("errors.inspectEmpty", "Nothing to inspect!"));
912
+ return;
913
+ }
914
+ const n = Array.isArray(e) ? e[0] : this.isErrorReport(e) ? e : await this.createErrorReport(e), a = Array.isArray(e) ? e : r ?? [n];
915
+ z.modal(z.requireComponent("error-report-modal"), { report: n, reports: a });
916
+ }
917
+ async report(e, r) {
918
+ if (await R.emit("error", { error: e, message: r }), Ee("unit") || (J() && this.logError(e), !this.enabled))
919
+ throw e;
920
+ if (!A.isMounted()) {
921
+ const i = await this.createStartupErrorReport(e);
922
+ i && this.setState({ startupErrors: this.startupErrors.concat(i) });
923
+ return;
924
+ }
925
+ const n = await this.createErrorReport(e), a = {
926
+ report: n,
927
+ seen: !1,
928
+ date: /* @__PURE__ */ new Date()
929
+ };
930
+ z.toast(
931
+ r ?? S("errors.notice", "Something went wrong, but it's not your fault. Try again!"),
932
+ {
933
+ variant: "danger",
934
+ actions: [
935
+ {
936
+ label: S("errors.viewDetails", "View details"),
937
+ dismiss: !0,
938
+ click: () => z.modal(z.requireComponent("error-report-modal"), { report: n, reports: [n] })
939
+ }
940
+ ]
941
+ }
942
+ ), this.setState({ logs: [a].concat(this.logs) });
943
+ }
944
+ reportDevelopmentError(e, r) {
945
+ J() && (r && console.warn(r), this.logError(e));
946
+ }
947
+ see(e) {
948
+ this.setState({
949
+ logs: this.logs.map((r) => r.report !== e ? r : {
950
+ ...r,
951
+ seen: !0
952
+ })
953
+ });
954
+ }
955
+ async boot() {
956
+ Y(async () => {
957
+ var e;
958
+ if (!this.debug) {
959
+ (e = this.eruda) == null || e.destroy();
960
+ return;
961
+ }
962
+ this.eruda ?? (this.eruda = (await import("eruda")).default), this.eruda.init();
963
+ });
964
+ }
965
+ logError(e) {
966
+ console.error(e), ce(e) && e.cause && this.logError(e.cause);
967
+ }
968
+ isErrorReport(e) {
969
+ return ce(e) && "title" in e;
970
+ }
971
+ async createErrorReport(e) {
972
+ return typeof e == "string" ? { title: e } : e instanceof Error || e instanceof be ? this.createErrorReportFromError(e) : ce(e) ? Xe({
973
+ title: B(
974
+ e.name ?? e.title ?? S("errors.unknown", "Unknown Error")
975
+ ),
976
+ description: B(
977
+ e.message ?? e.description ?? S("errors.unknownDescription", "Unknown error object")
978
+ ),
979
+ error: e
980
+ }) : {
981
+ title: S("errors.unknown", "Unknown Error"),
982
+ error: e
983
+ };
984
+ }
985
+ async createStartupErrorReport(e) {
986
+ return e instanceof Te ? e.cause instanceof Te ? null : this.createErrorReport(e.cause) : this.createErrorReport(e);
987
+ }
988
+ createErrorReportFromError(e, r = {}) {
989
+ return {
990
+ title: e.name,
991
+ description: e.message,
992
+ details: e.stack,
993
+ error: e,
994
+ ...r
995
+ };
996
+ }
997
+ }
998
+ const ut = te(gr), ct = /* @__PURE__ */ g({
999
+ __name: "HeadlessButton",
1000
+ props: {
1001
+ class: {},
1002
+ disabled: { type: Boolean },
1003
+ href: {},
1004
+ route: {},
1005
+ routeParams: {},
1006
+ routeQuery: {},
1007
+ size: {},
1008
+ submit: { type: Boolean },
1009
+ variant: {},
1010
+ asChild: { type: Boolean },
1011
+ as: {}
1012
+ },
1013
+ setup(t) {
1014
+ const s = c(() => t.as ? { as: t.as } : t.route ? {
1015
+ as: z.resolveComponent("router-link") ?? "a",
1016
+ to: Xe({
1017
+ name: t.route,
1018
+ params: t.routeParams,
1019
+ query: t.routeQuery
1020
+ })
1021
+ } : t.href ? {
1022
+ as: "a",
1023
+ target: "_blank",
1024
+ href: t.href
1025
+ } : {
1026
+ as: "button",
1027
+ type: t.submit ? "submit" : "button"
1028
+ });
1029
+ return (e, r) => (u(), h(o(is), H({
1030
+ class: t.class,
1031
+ "as-child": e.asChild,
1032
+ disabled: e.disabled
1033
+ }, s.value), {
1034
+ default: f(() => [
1035
+ w(e.$slots, "default")
1036
+ ]),
1037
+ _: 3
1038
+ }, 16, ["class", "as-child", "disabled"]));
1039
+ }
1040
+ }), q = /* @__PURE__ */ g({
1041
+ __name: "Button",
1042
+ props: {
1043
+ class: {},
1044
+ disabled: { type: Boolean },
1045
+ href: {},
1046
+ route: {},
1047
+ routeParams: {},
1048
+ routeQuery: {},
1049
+ size: {},
1050
+ submit: { type: Boolean },
1051
+ variant: {},
1052
+ asChild: { type: Boolean },
1053
+ as: {}
1054
+ },
1055
+ setup(t) {
1056
+ const s = N(t, ["class", "size", "variant", "disabled"]), e = c(() => et(
1057
+ { baseClasses: t.class, variant: t.variant, size: t.size, disabled: t.disabled },
1058
+ {
1059
+ baseClasses: "focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2",
1060
+ variants: {
1061
+ variant: {
1062
+ default: "bg-primary-600 text-white focus-visible:outline-primary-600",
1063
+ secondary: "bg-background text-gray-900 ring-gray-300",
1064
+ danger: "bg-red-600 text-white focus-visible:outline-red-600",
1065
+ ghost: "bg-transparent",
1066
+ outline: "bg-transparent text-primary-600 ring-primary-600",
1067
+ link: "text-links"
1068
+ },
1069
+ size: {
1070
+ small: "text-xs min-h-6",
1071
+ default: "text-sm min-h-8",
1072
+ large: "text-base min-h-10",
1073
+ icon: "rounded-full p-2.5"
1074
+ },
1075
+ disabled: {
1076
+ false: null,
1077
+ true: "opacity-50 cursor-not-allowed"
1078
+ }
1079
+ },
1080
+ compoundVariants: [
1081
+ {
1082
+ variant: ["default", "secondary", "danger", "ghost", "outline"],
1083
+ class: "flex items-center justify-center gap-1 font-medium"
1084
+ },
1085
+ {
1086
+ variant: ["default", "danger"],
1087
+ class: "shadow-sm"
1088
+ },
1089
+ {
1090
+ variant: ["secondary", "outline"],
1091
+ class: "ring-1 ring-inset"
1092
+ },
1093
+ {
1094
+ variant: ["default", "secondary", "danger", "ghost", "outline"],
1095
+ size: "small",
1096
+ class: "rounded px-2 py-1"
1097
+ },
1098
+ {
1099
+ variant: ["default", "secondary", "danger", "ghost", "outline"],
1100
+ size: "default",
1101
+ class: "rounded-md px-2.5 py-1.5"
1102
+ },
1103
+ {
1104
+ variant: ["default", "secondary", "danger", "ghost", "outline"],
1105
+ size: "large",
1106
+ class: "rounded-md px-3 py-2"
1107
+ },
1108
+ {
1109
+ variant: "default",
1110
+ disabled: !1,
1111
+ class: "hover:bg-primary-500"
1112
+ },
1113
+ {
1114
+ variant: ["secondary", "ghost", "outline"],
1115
+ disabled: !1,
1116
+ class: "hover:bg-gray-50"
1117
+ },
1118
+ {
1119
+ variant: "danger",
1120
+ disabled: !1,
1121
+ class: "hover:bg-red-500"
1122
+ },
1123
+ {
1124
+ variant: "link",
1125
+ disabled: !1,
1126
+ class: "hover:underline"
1127
+ },
1128
+ {
1129
+ variant: "link",
1130
+ size: "small",
1131
+ class: "leading-6"
1132
+ },
1133
+ {
1134
+ variant: "link",
1135
+ size: "default",
1136
+ class: "leading-8"
1137
+ },
1138
+ {
1139
+ variant: "link",
1140
+ size: "large",
1141
+ class: "leading-10"
1142
+ }
1143
+ ],
1144
+ defaultVariants: {
1145
+ variant: "default",
1146
+ size: "default",
1147
+ disabled: !1
1148
+ }
1149
+ }
1150
+ ));
1151
+ return (r, n) => (u(), h(ct, H({
1152
+ class: e.value,
1153
+ disabled: r.disabled
1154
+ }, s), {
1155
+ default: f(() => [
1156
+ w(r.$slots, "default")
1157
+ ]),
1158
+ _: 3
1159
+ }, 16, ["class", "disabled"]));
1160
+ }
1161
+ });
1162
+ function vr(t) {
1163
+ return typeof t == "object" && t !== null && "label" in t;
1164
+ }
1165
+ const dt = /* @__PURE__ */ g({
1166
+ __name: "HeadlessSelectValue",
1167
+ setup(t) {
1168
+ const s = V(
1169
+ "select",
1170
+ "<HeadlessSelectValue> must be a child of a <HeadlessSelect>"
1171
+ );
1172
+ return (e, r) => e.$slots.default ? (u(), h(o(De), {
1173
+ key: 0,
1174
+ placeholder: o(s).placeholder
1175
+ }, {
1176
+ default: f(() => [
1177
+ w(e.$slots, "default")
1178
+ ]),
1179
+ _: 3
1180
+ }, 8, ["placeholder"])) : (u(), h(o(De), {
1181
+ key: 1,
1182
+ placeholder: o(s).placeholder
1183
+ }, null, 8, ["placeholder"]));
1184
+ }
1185
+ }), pt = /* @__PURE__ */ g({
1186
+ __name: "HeadlessSelectTrigger",
1187
+ setup(t) {
1188
+ const s = V(
1189
+ "select",
1190
+ "<HeadlessSelectTrigger> must be a child of a <HeadlessSelect>"
1191
+ );
1192
+ return (e, r) => (u(), h(o(us), {
1193
+ id: o(s).id
1194
+ }, {
1195
+ default: f(() => [
1196
+ w(e.$slots, "default", {}, () => [
1197
+ p(dt, {
1198
+ placeholder: o(s).placeholder
1199
+ }, null, 8, ["placeholder"]),
1200
+ p(o(cs))
1201
+ ])
1202
+ ]),
1203
+ _: 3
1204
+ }, 8, ["id"]));
1205
+ }
1206
+ }), mt = /* @__PURE__ */ g({
1207
+ __name: "HeadlessSelectOption",
1208
+ props: {
1209
+ value: {},
1210
+ disabled: { type: Boolean },
1211
+ textValue: {},
1212
+ asChild: { type: Boolean },
1213
+ as: {}
1214
+ },
1215
+ setup(t) {
1216
+ const s = V(
1217
+ "select",
1218
+ "<HeadlessSelectOption> must be a child of a <HeadlessSelect>"
1219
+ ), e = c(() => {
1220
+ var n;
1221
+ const r = (n = s.options) == null ? void 0 : n.find((a) => a.value === t.value);
1222
+ return r ? r.label : B(t.value);
1223
+ });
1224
+ return (r, n) => (u(), h(o(ds), ne(ae(r.$props)), {
1225
+ default: f(() => [
1226
+ p(o(ps), null, {
1227
+ default: f(() => [
1228
+ w(r.$slots, "default", {}, () => [
1229
+ I(x(e.value), 1)
1230
+ ])
1231
+ ]),
1232
+ _: 3
1233
+ })
1234
+ ]),
1235
+ _: 3
1236
+ }, 16));
1237
+ }
1238
+ }), ft = /* @__PURE__ */ g({
1239
+ __name: "HeadlessSelectOptions",
1240
+ props: {
1241
+ class: {},
1242
+ innerClass: {}
1243
+ },
1244
+ setup(t) {
1245
+ const s = V(
1246
+ "select",
1247
+ "<HeadlessSelectOptions> must be a child of a <HeadlessSelect>"
1248
+ ), e = c(() => M("min-w-(--reka-select-trigger-width) max-h-(--reka-select-content-available-height)", t.class));
1249
+ return (r, n) => (u(), h(o(ms), null, {
1250
+ default: f(() => [
1251
+ p(o(fs), {
1252
+ position: "popper",
1253
+ class: k(e.value),
1254
+ align: o(s).align,
1255
+ side: o(s).side,
1256
+ "side-offset": 4
1257
+ }, {
1258
+ default: f(() => [
1259
+ p(o(hs), {
1260
+ class: k(r.innerClass)
1261
+ }, {
1262
+ default: f(() => [
1263
+ w(r.$slots, "default", {}, () => [
1264
+ (u(!0), b(D, null, F(o(s).options ?? [], (a) => (u(), h(mt, {
1265
+ key: a.key,
1266
+ value: a.value
1267
+ }, null, 8, ["value"]))), 128))
1268
+ ])
1269
+ ]),
1270
+ _: 3
1271
+ }, 8, ["class"])
1272
+ ]),
1273
+ _: 3
1274
+ }, 8, ["class", "align", "side"])
1275
+ ]),
1276
+ _: 3
1277
+ }));
1278
+ }
1279
+ }), br = /* @__PURE__ */ g({
1280
+ inheritAttrs: !1,
1281
+ __name: "HeadlessSelect",
1282
+ props: {
1283
+ as: { default: "div" },
1284
+ options: {},
1285
+ placeholder: {},
1286
+ renderOption: { type: Function },
1287
+ compareOptions: { type: Function, default: (t, s) => t === s },
1288
+ labelClass: {},
1289
+ optionsClass: {},
1290
+ align: {},
1291
+ side: {},
1292
+ name: {},
1293
+ label: {},
1294
+ description: {},
1295
+ modelValue: {}
1296
+ },
1297
+ emits: ["update:modelValue"],
1298
+ setup(t, { expose: s, emit: e }) {
1299
+ const r = e, n = X("form", null), a = c(() => n && t.name ? n.getFieldValue(t.name) : t.modelValue), i = c(() => a.value), l = c(() => !n || !t.name ? null : n.errors[t.name] ?? null), d = c(() => t.options ? t.options.map((m) => ({
1300
+ key: re(),
1301
+ label: t.renderOption ? t.renderOption(m) : vr(m) ? Qt(m.label) : B(m),
1302
+ value: m
1303
+ })) : null), v = {
1304
+ labelClass: t.labelClass,
1305
+ optionsClass: t.optionsClass,
1306
+ align: t.align,
1307
+ side: t.side,
1308
+ value: a,
1309
+ id: `select-${re()}`,
1310
+ name: c(() => t.name),
1311
+ label: c(() => t.label),
1312
+ description: c(() => t.description),
1313
+ placeholder: c(() => t.placeholder ?? S("ui.select", "Select an option")),
1314
+ options: d,
1315
+ selectedOption: c(() => {
1316
+ var m;
1317
+ return (m = d.value) == null ? void 0 : m.find((C) => C.value === t.modelValue);
1318
+ }),
1319
+ errors: ve(l),
1320
+ required: c(() => {
1321
+ if (!(!t.name || !n))
1322
+ return n.getFieldRules(t.name).includes("required");
1323
+ }),
1324
+ update(m) {
1325
+ if (n && t.name) {
1326
+ n.setFieldValue(t.name, m);
1327
+ return;
1328
+ }
1329
+ r("update:modelValue", m);
1330
+ }
1331
+ };
1332
+ function $(m) {
1333
+ v.update(m);
1334
+ }
1335
+ return le("select", v), s(v), (m, C) => (u(), h(o(gs), {
1336
+ "model-value": i.value,
1337
+ by: m.compareOptions,
1338
+ "onUpdate:modelValue": C[0] || (C[0] = (L) => $(L))
1339
+ }, {
1340
+ default: f(({ open: L }) => [
1341
+ (u(), h(W(m.as), ne(ae(m.$attrs)), {
1342
+ default: f(() => [
1343
+ w(m.$slots, "default", {
1344
+ modelValue: m.modelValue,
1345
+ open: L
1346
+ }, () => [
1347
+ p(pt),
1348
+ p(ft)
1349
+ ])
1350
+ ]),
1351
+ _: 2
1352
+ }, 1040))
1353
+ ]),
1354
+ _: 3
1355
+ }, 8, ["model-value", "by"]));
1356
+ }
1357
+ }), Be = /* @__PURE__ */ g({
1358
+ __name: "HeadlessSelectLabel",
1359
+ props: {
1360
+ asChild: { type: Boolean },
1361
+ as: {}
1362
+ },
1363
+ setup(t) {
1364
+ const s = V(
1365
+ "select",
1366
+ "<HeadlessSelectLabel> must be a child of a <HeadlessSelect>"
1367
+ ), e = He(), r = c(() => !!(s.label || e.default));
1368
+ return (n, a) => r.value ? (u(), h(o(vs), H({
1369
+ key: 0,
1370
+ for: o(s).id
1371
+ }, n.$props), {
1372
+ default: f(() => [
1373
+ w(n.$slots, "default", {}, () => [
1374
+ I(x(o(s).label), 1)
1375
+ ])
1376
+ ]),
1377
+ _: 3
1378
+ }, 16, ["for"])) : T("", !0);
1379
+ }
1380
+ }), ht = /* @__PURE__ */ g({
1381
+ __name: "SelectLabel",
1382
+ props: {
1383
+ class: {}
1384
+ },
1385
+ setup(t) {
1386
+ const s = V("select", "<SelectLabel> must be a child of a <Select>"), e = c(() => M("block text-sm leading-6 font-medium text-gray-900", s.labelClass, t.class));
1387
+ return (r, n) => r.$slots.default ? (u(), h(Be, {
1388
+ key: 0,
1389
+ class: k(e.value)
1390
+ }, {
1391
+ default: f(() => [
1392
+ w(r.$slots, "default")
1393
+ ]),
1394
+ _: 3
1395
+ }, 8, ["class"])) : (u(), h(Be, {
1396
+ key: 1,
1397
+ class: k(e.value)
1398
+ }, null, 8, ["class"]));
1399
+ }
1400
+ }), Fe = /* @__PURE__ */ g({
1401
+ __name: "SelectOption",
1402
+ props: {
1403
+ value: {},
1404
+ class: {},
1405
+ innerClass: {}
1406
+ },
1407
+ setup(t) {
1408
+ const s = c(() => M("group p-1 outline-none", t.class)), e = c(() => M(
1409
+ // eslint-disable-next-line vue/max-len
1410
+ "relative flex max-w-[calc(100vw-2rem)] cursor-pointer items-center truncate rounded-md gap-2 px-2 py-1 text-sm select-none *:truncate group-data-[highlighted]:bg-gray-100 group-data-[state=checked]:font-semibold group-data-[state=unchecked]:opacity-50",
1411
+ t.innerClass
1412
+ ));
1413
+ return (r, n) => (u(), h(mt, {
1414
+ class: k(s.value),
1415
+ value: r.value
1416
+ }, {
1417
+ default: f(() => [
1418
+ y("div", {
1419
+ class: k(e.value)
1420
+ }, [
1421
+ w(r.$slots, "default")
1422
+ ], 2)
1423
+ ]),
1424
+ _: 3
1425
+ }, 8, ["class", "value"]));
1426
+ }
1427
+ }), gt = /* @__PURE__ */ g({
1428
+ __name: "SelectOptions",
1429
+ props: {
1430
+ class: {}
1431
+ },
1432
+ setup(t) {
1433
+ const s = V("select", "<SelectOptions> must be a child of a <Select>"), e = c(() => M(
1434
+ "z-50 overflow-auto rounded-lg bg-white text-base shadow-lg ring-1 ring-black/5 focus:outline-hidden",
1435
+ s.optionsClass,
1436
+ t.class
1437
+ ));
1438
+ return (r, n) => (u(), h(ft, {
1439
+ class: k(e.value)
1440
+ }, {
1441
+ default: f(() => {
1442
+ var a;
1443
+ return [
1444
+ (a = o(s).options) != null && a.length ? w(r.$slots, "default", { key: 0 }, () => {
1445
+ var i;
1446
+ return [
1447
+ (u(!0), b(D, null, F(((i = o(s)) == null ? void 0 : i.options) ?? [], (l) => (u(), h(Fe, {
1448
+ key: l.key,
1449
+ value: l.value
1450
+ }, {
1451
+ default: f(() => [
1452
+ I(x(l.label), 1)
1453
+ ]),
1454
+ _: 2
1455
+ }, 1032, ["value"]))), 128))
1456
+ ];
1457
+ }) : w(r.$slots, "default", { key: 1 }, () => [
1458
+ p(Fe, {
1459
+ disabled: "",
1460
+ value: null
1461
+ }, {
1462
+ default: f(() => [
1463
+ I(x(r.$td("ui.selectEmpty", "No options available")), 1)
1464
+ ]),
1465
+ _: 1
1466
+ })
1467
+ ])
1468
+ ];
1469
+ }),
1470
+ _: 3
1471
+ }, 8, ["class"]));
1472
+ }
1473
+ }), yr = {
1474
+ viewBox: "0 0 20 20",
1475
+ width: "1.2em",
1476
+ height: "1.2em"
1477
+ };
1478
+ function wr(t, s) {
1479
+ return u(), b("svg", yr, s[0] || (s[0] = [
1480
+ y("path", {
1481
+ fill: "currentColor",
1482
+ d: "m9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828L5.757 6.586L4.343 8z"
1483
+ }, null, -1)
1484
+ ]));
1485
+ }
1486
+ const $r = E({ name: "zondicons-cheveron-down", render: wr }), vt = /* @__PURE__ */ g({
1487
+ __name: "SelectTrigger",
1488
+ props: {
1489
+ class: {}
1490
+ },
1491
+ setup(t) {
1492
+ const s = V("select", "<SelectTrigger> must be a child of a <Select>"), e = c(() => M(
1493
+ // eslint-disable-next-line vue/max-len
1494
+ "focus:outline-primary-600 data-[state=open]:outline-primary-600 grid w-full cursor-default grid-cols-1 rounded-md bg-white py-1.5 pr-2 pl-3 text-left text-gray-900 outline-1 -outline-offset-1 outline-gray-300 focus:outline-2 focus:-outline-offset-2 sm:text-sm/6",
1495
+ { "mt-1": s.label },
1496
+ t.class
1497
+ ));
1498
+ return (r, n) => (u(), h(pt, {
1499
+ class: k(e.value)
1500
+ }, {
1501
+ default: f(() => [
1502
+ p(dt, { class: "col-start-1 row-start-1 truncate pr-6" }),
1503
+ p(o($r), { class: "col-start-1 row-start-1 size-5 self-center justify-self-end text-gray-500 sm:size-4" })
1504
+ ]),
1505
+ _: 1
1506
+ }, 8, ["class"]));
1507
+ }
1508
+ }), _r = /* @__PURE__ */ g({
1509
+ __name: "Select",
1510
+ props: {
1511
+ as: {},
1512
+ options: {},
1513
+ placeholder: {},
1514
+ renderOption: { type: Function },
1515
+ compareOptions: { type: Function },
1516
+ labelClass: {},
1517
+ optionsClass: {},
1518
+ align: {},
1519
+ side: {},
1520
+ name: {},
1521
+ label: {},
1522
+ description: {},
1523
+ modelValue: {}
1524
+ },
1525
+ emits: ["update:modelValue"],
1526
+ setup(t) {
1527
+ const { forwardRef: s } = Ve();
1528
+ return (e, r) => (u(), h(br, H({ ref: o(s) }, e.$props, {
1529
+ "onUpdate:modelValue": r[0] || (r[0] = (n) => e.$emit("update:modelValue", n))
1530
+ }), {
1531
+ default: f(() => [
1532
+ p(ht),
1533
+ w(e.$slots, "default", {}, () => [
1534
+ p(vt),
1535
+ p(gt)
1536
+ ])
1537
+ ]),
1538
+ _: 3
1539
+ }, 16));
1540
+ }
1541
+ }), xr = { class: "grow" }, Cr = /* @__PURE__ */ g({
1542
+ __name: "Language",
1543
+ setup(t) {
1544
+ const s = Z.getBrowserLocale(), e = c(() => [null, ...Z.locales]);
1545
+ function r(n) {
1546
+ return (n && j.locales[n]) ?? S("settings.localeDefault", "{locale} (default)", {
1547
+ locale: j.locales[s] ?? s
1548
+ });
1549
+ }
1550
+ return (n, a) => (u(), h(_r, {
1551
+ modelValue: n.$lang.locale,
1552
+ "onUpdate:modelValue": a[0] || (a[0] = (i) => n.$lang.locale = i),
1553
+ class: "flex flex-col items-start md:flex-row",
1554
+ as: "div",
1555
+ options: e.value,
1556
+ "render-option": r
1557
+ }, {
1558
+ default: f(() => [
1559
+ y("div", xr, [
1560
+ p(ht, { class: "text-base font-semibold" }, {
1561
+ default: f(() => [
1562
+ I(x(n.$td("settings.locale", "Language")), 1)
1563
+ ]),
1564
+ _: 1
1565
+ }),
1566
+ p(P, {
1567
+ "lang-key": "settings.localeDescription",
1568
+ "lang-default": "Choose the application's language.",
1569
+ class: "mt-1 text-sm text-gray-500"
1570
+ })
1571
+ ]),
1572
+ p(q, {
1573
+ variant: "ghost",
1574
+ as: vt,
1575
+ class: "grid w-auto outline-none"
1576
+ }),
1577
+ p(gt)
1578
+ ]),
1579
+ _: 1
1580
+ }, 8, ["modelValue", "options"]));
1581
+ }
1582
+ }), kr = [
1583
+ {
1584
+ priority: 100,
1585
+ component: Cr
1586
+ }
1587
+ ], Sr = { $lang: Z }, Tr = {
1588
+ async install(t) {
1589
+ var s;
1590
+ (s = t.config.globalProperties).$t ?? (s.$t = it), t.config.globalProperties.$td = S, kr.forEach((e) => A.addSetting(e)), await $e(t, Sr);
1591
+ }
1592
+ }, Mr = /* @__PURE__ */ g({
1593
+ __name: "Markdown",
1594
+ props: {
1595
+ as: {},
1596
+ inline: { type: Boolean },
1597
+ langKey: {},
1598
+ langParams: {},
1599
+ langDefault: {},
1600
+ text: {},
1601
+ actions: {}
1602
+ },
1603
+ setup(t) {
1604
+ const s = Ne(), e = He(), r = c(() => e.default ? e.default().map(Ge).join("") : t.text ?? (t.langKey && (t.langDefault ? S(t.langKey, t.langDefault, t.langParams ?? {}) : it(t.langKey, t.langParams ?? {})))), n = c(() => {
1605
+ if (!r.value)
1606
+ return null;
1607
+ let l = sr(r.value);
1608
+ return t.inline && (l = l.replace("<p>", "<span>").replace("</p>", "</span>")), l;
1609
+ }), a = () => It(t.as ?? (t.inline ? "span" : "div"), {
1610
+ innerHTML: n.value,
1611
+ onClick: i,
1612
+ ...s,
1613
+ class: `${s.class ?? ""} ${t.inline ? "" : "prose"}`
1614
+ });
1615
+ async function i(l) {
1616
+ var v, $;
1617
+ const { target: d } = l;
1618
+ if (Pe(d, HTMLElement) && d.dataset.markdownAction) {
1619
+ ($ = (v = t.actions) == null ? void 0 : v[d.dataset.markdownAction]) == null || $.call(v);
1620
+ return;
1621
+ }
1622
+ if (Pe(d, HTMLAnchorElement) && d.dataset.markdownRoute) {
1623
+ const m = tr();
1624
+ m && (l.preventDefault(), m.visit(d.dataset.markdownRoute));
1625
+ return;
1626
+ }
1627
+ }
1628
+ return (l, d) => (u(), h(a));
1629
+ }
1630
+ }), Hr = (t, s) => {
1631
+ const e = t.__vccOpts || t;
1632
+ for (const [r, n] of s)
1633
+ e[r] = n;
1634
+ return e;
1635
+ }, P = /* @__PURE__ */ Hr(Mr, [["__scopeId", "data-v-8b211cfb"]]), Er = { class: "flex-grow" }, Vr = ["id"], Lr = /* @__PURE__ */ g({
1636
+ __name: "Setting",
1637
+ props: {
1638
+ title: {},
1639
+ titleId: {},
1640
+ description: {},
1641
+ class: {},
1642
+ layout: { default: "horizontal" }
1643
+ },
1644
+ setup(t) {
1645
+ const s = c(() => M(t.class, "flex flex-col justify-center gap-1"));
1646
+ return (e, r) => (u(), b("div", {
1647
+ class: k(["mt-4 flex", { "flex-col": e.layout === "vertical" }])
1648
+ }, [
1649
+ y("div", Er, [
1650
+ y("h3", {
1651
+ id: e.titleId,
1652
+ class: "text-base font-semibold"
1653
+ }, x(e.title), 9, Vr),
1654
+ e.description ? (u(), h(P, {
1655
+ key: 0,
1656
+ text: e.description,
1657
+ class: "mt-1 text-sm text-gray-500"
1658
+ }, null, 8, ["text"])) : T("", !0)
1659
+ ]),
1660
+ y("div", {
1661
+ class: k(s.value)
1662
+ }, [
1663
+ w(e.$slots, "default")
1664
+ ], 2)
1665
+ ], 2));
1666
+ }
1667
+ }), Ir = ["for"], qr = /* @__PURE__ */ g({
1668
+ inheritAttrs: !1,
1669
+ __name: "HeadlessSwitch",
1670
+ props: {
1671
+ name: {},
1672
+ label: {},
1673
+ description: {},
1674
+ modelValue: {},
1675
+ class: {},
1676
+ labelClass: {},
1677
+ inputClass: {},
1678
+ thumbClass: {}
1679
+ },
1680
+ emits: ["update:modelValue"],
1681
+ setup(t, { expose: s, emit: e }) {
1682
+ const r = e, n = X("form", null), a = c(() => !n || !t.name ? null : n.errors[t.name] ?? null), i = {
1683
+ id: `switch-${re()}`,
1684
+ name: c(() => t.name),
1685
+ label: c(() => t.label),
1686
+ description: c(() => t.description),
1687
+ value: c(() => n && t.name ? n.getFieldValue(t.name) : t.modelValue),
1688
+ errors: ve(a),
1689
+ required: c(() => {
1690
+ if (!(!t.name || !n))
1691
+ return n.getFieldRules(t.name).includes("required");
1692
+ }),
1693
+ update(l) {
1694
+ if (n && t.name) {
1695
+ n.setFieldValue(t.name, l);
1696
+ return;
1697
+ }
1698
+ r("update:modelValue", l);
1699
+ }
1700
+ };
1701
+ return s(i), Y(() => {
1702
+ !t.description && !a.value || console.warn("Errors and description not implemented in <HeadlessSwitch>");
1703
+ }), (l, d) => (u(), b("div", {
1704
+ class: k(t.class)
1705
+ }, [
1706
+ l.label ? (u(), b("label", {
1707
+ key: 0,
1708
+ for: i.id,
1709
+ class: k(l.labelClass)
1710
+ }, x(l.label), 11, Ir)) : T("", !0),
1711
+ p(o(bs), H({
1712
+ id: i.id,
1713
+ name: l.name,
1714
+ "model-value": i.value.value
1715
+ }, l.$attrs, {
1716
+ class: l.inputClass,
1717
+ "onUpdate:modelValue": d[0] || (d[0] = (v) => l.$emit("update:modelValue", v))
1718
+ }), {
1719
+ default: f(() => [
1720
+ p(o(ys), {
1721
+ class: k(l.thumbClass)
1722
+ }, null, 8, ["class"])
1723
+ ]),
1724
+ _: 1
1725
+ }, 16, ["id", "name", "model-value", "class"])
1726
+ ], 2));
1727
+ }
1728
+ }), zr = /* @__PURE__ */ g({
1729
+ __name: "Switch",
1730
+ setup(t) {
1731
+ return (s, e) => (u(), h(qr, {
1732
+ class: "flex flex-row items-center gap-1",
1733
+ "input-class": "disabled:opacity-50 disabled:cursor-not-allowed data-[state=checked]:bg-primary-600 data-[state=unchecked]:bg-gray-200 relative inline-flex h-6 w-11 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focusdisabled:opacity-50 disabled:cursor-not-allowed :ring-2 focus:ring-primary-600 focus:ring-offset-2 focus:outline-hidden",
1734
+ "thumb-class": "data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0 pointer-events-none inline-block size-5 transform rounded-full bg-white shadow-sm ring-0 transition duration-200 ease-in-out"
1735
+ }));
1736
+ }
1737
+ }), Rr = /* @__PURE__ */ g({
1738
+ __name: "Debug",
1739
+ setup(t) {
1740
+ return (s, e) => (u(), h(Lr, {
1741
+ "title-id": "debug-setting",
1742
+ title: s.$td("settings.debug", "Debugging"),
1743
+ description: s.$td("settings.debugDescription", "Enable debugging with [Eruda](https://eruda.liriliri.io/).")
1744
+ }, {
1745
+ default: f(() => [
1746
+ p(zr, {
1747
+ modelValue: s.$errors.debug,
1748
+ "onUpdate:modelValue": e[0] || (e[0] = (r) => s.$errors.debug = r),
1749
+ "aria-labelledby": "debug-setting"
1750
+ }, null, 8, ["modelValue"])
1751
+ ]),
1752
+ _: 1
1753
+ }, 8, ["title", "description"]));
1754
+ }
1755
+ }), Pr = [
1756
+ {
1757
+ priority: 10,
1758
+ component: Rr
1759
+ }
1760
+ ], bt = [];
1761
+ function wl(t) {
1762
+ bt.push(t);
1763
+ }
1764
+ function yt(t) {
1765
+ for (const s of bt) {
1766
+ const e = s(t);
1767
+ if (e)
1768
+ return e;
1769
+ }
1770
+ return typeof t == "string" ? t : t instanceof Error || t instanceof be ? t.message : ce(t) ? B(t.message ?? t.description ?? "Unknown error object") : S("errors.unknown", "Unknown Error");
1771
+ }
1772
+ class Ue extends be {
1773
+ }
1774
+ const Ar = { $errors: ut }, Dr = (t) => (ut.report(t), !0);
1775
+ function jr(t, s = () => !1) {
1776
+ const e = (r) => s(r) || Dr(r);
1777
+ t.config.errorHandler = e, globalThis.onerror = (r, n, a, i, l) => e(l ?? r), globalThis.onunhandledrejection = (r) => e(r.reason);
1778
+ }
1779
+ const Br = {
1780
+ async install(t, s) {
1781
+ jr(t, s.handleError), Pr.forEach((e) => A.addSetting(e)), await $e(t, Ar);
1782
+ }
1783
+ }, Fr = {
1784
+ async install() {
1785
+ Ee() && (globalThis.testingRuntime = {
1786
+ on: (...t) => R.on(...t),
1787
+ service: (t) => A.service(t)
1788
+ });
1789
+ }
1790
+ }, Ur = {
1791
+ viewBox: "0 0 20 20",
1792
+ width: "1.2em",
1793
+ height: "1.2em"
1794
+ };
1795
+ function Or(t, s) {
1796
+ return u(), b("svg", Ur, s[0] || (s[0] = [
1797
+ y("path", {
1798
+ fill: "currentColor",
1799
+ d: "M10 8.586L2.929 1.515L1.515 2.929L8.586 10l-7.071 7.071l1.414 1.414L10 11.414l7.071 7.071l1.414-1.414L11.414 10l7.071-7.071l-1.414-1.414z"
1800
+ }, null, -1)
1801
+ ]));
1802
+ }
1803
+ const Nr = E({ name: "zondicons-close", render: Or }), Wr = /* @__PURE__ */ g({
1804
+ __name: "HeadlessModal",
1805
+ props: {
1806
+ persistent: { type: Boolean },
1807
+ title: {},
1808
+ titleHidden: { type: Boolean },
1809
+ description: {},
1810
+ descriptionHidden: { type: Boolean }
1811
+ },
1812
+ setup(t, { expose: s }) {
1813
+ const e = U(null), { modal: r } = V(
1814
+ "modal",
1815
+ "could not obtain modal reference from <HeadlessModal>, did you render this component manually? Show it using $ui.modal() instead"
1816
+ );
1817
+ s({ close: i, $content: e });
1818
+ const { forwardRef: n } = Ve(), a = U(!1);
1819
+ le("$modalContentRef", e), tt("close-modal", async ({ id: l, result: d }) => {
1820
+ l === r.id && await i(d);
1821
+ });
1822
+ async function i(l) {
1823
+ a.value || (await R.emit("modal-will-close", { modal: r, result: l }), a.value = !0, await R.emit("modal-has-closed", { modal: r, result: l }));
1824
+ }
1825
+ return (l, d) => (u(), h(o(ws), {
1826
+ ref: o(n),
1827
+ open: "",
1828
+ "onUpdate:open": d[0] || (d[0] = (v) => l.persistent || i())
1829
+ }, {
1830
+ default: f(() => [
1831
+ p(o($s), null, {
1832
+ default: f(() => [
1833
+ w(l.$slots, "default", { close: i })
1834
+ ]),
1835
+ _: 3
1836
+ })
1837
+ ]),
1838
+ _: 3
1839
+ }, 512));
1840
+ }
1841
+ }), wt = /* @__PURE__ */ g({
1842
+ __name: "ModalContext",
1843
+ props: {
1844
+ modal: {},
1845
+ childIndex: {}
1846
+ },
1847
+ setup(t) {
1848
+ const s = t, e = c(() => {
1849
+ const r = {};
1850
+ for (const n in s.modal.properties)
1851
+ r[n] = o(s.modal.properties[n]);
1852
+ return r;
1853
+ });
1854
+ return le("modal", {
1855
+ modal: Re(s, "modal"),
1856
+ childIndex: Re(s, "childIndex")
1857
+ }), (r, n) => (u(), h(W(r.modal.component), ne(ae(e.value)), null, 16));
1858
+ }
1859
+ }), Kr = /* @__PURE__ */ g({
1860
+ __name: "HeadlessModalContent",
1861
+ setup(t) {
1862
+ const { childIndex: s = 0 } = V(
1863
+ "modal",
1864
+ "could not obtain modal reference from <HeadlessModalContent>, did you render this component manually? Show it using $ui.modal() instead"
1865
+ ), e = Ns("$modalContentRef"), r = G("$contentRef"), n = c(() => z.modals[s] ?? null);
1866
+ return Y(() => e.value = r.value), (a, i) => (u(), h(o(_s), { ref: "$contentRef" }, {
1867
+ default: f(() => [
1868
+ w(a.$slots, "default"),
1869
+ n.value ? (u(), h(wt, {
1870
+ key: 0,
1871
+ "child-index": o(s) + 1,
1872
+ modal: n.value
1873
+ }, null, 8, ["child-index", "modal"])) : T("", !0)
1874
+ ]),
1875
+ _: 3
1876
+ }, 512));
1877
+ }
1878
+ }), Qr = /* @__PURE__ */ g({
1879
+ __name: "HeadlessModalDescription",
1880
+ props: {
1881
+ asChild: { type: Boolean },
1882
+ as: {}
1883
+ },
1884
+ setup(t) {
1885
+ return (s, e) => (u(), h(o(xs), ne(ae(s.$props)), {
1886
+ default: f(() => [
1887
+ w(s.$slots, "default")
1888
+ ]),
1889
+ _: 3
1890
+ }, 16));
1891
+ }
1892
+ }), Jr = /* @__PURE__ */ g({
1893
+ __name: "HeadlessModalOverlay",
1894
+ props: {
1895
+ forceMount: { type: Boolean },
1896
+ asChild: { type: Boolean },
1897
+ as: {}
1898
+ },
1899
+ setup(t) {
1900
+ return (s, e) => (u(), h(o(Cs), ne(ae(s.$props)), {
1901
+ default: f(() => [
1902
+ w(s.$slots, "default")
1903
+ ]),
1904
+ _: 3
1905
+ }, 16));
1906
+ }
1907
+ }), Zr = /* @__PURE__ */ g({
1908
+ __name: "HeadlessModalTitle",
1909
+ props: {
1910
+ asChild: { type: Boolean },
1911
+ as: {}
1912
+ },
1913
+ setup(t) {
1914
+ return (s, e) => (u(), h(o(ks), ne(ae(s.$props)), {
1915
+ default: f(() => [
1916
+ w(s.$slots, "default")
1917
+ ]),
1918
+ _: 3
1919
+ }, 16));
1920
+ }
1921
+ }), Xr = {
1922
+ key: 0,
1923
+ class: "absolute top-0 right-0 hidden pt-3.5 pr-2.5 sm:block"
1924
+ }, Yr = ["onClick"], Gr = { class: "sr-only" }, se = /* @__PURE__ */ g({
1925
+ __name: "Modal",
1926
+ props: {
1927
+ persistent: { type: Boolean },
1928
+ title: {},
1929
+ titleHidden: { type: Boolean },
1930
+ description: {},
1931
+ descriptionHidden: { type: Boolean },
1932
+ wrapperClass: { default: "" },
1933
+ class: { default: "" },
1934
+ closeHidden: { type: Boolean }
1935
+ },
1936
+ setup(t, { expose: s }) {
1937
+ const e = N(t, ["class", "wrapperClass", "title", "titleHidden", "description", "persistent", "closeHidden"]);
1938
+ s({
1939
+ close: async (m) => {
1940
+ var C;
1941
+ return (C = a.value) == null ? void 0 : C.close(m);
1942
+ },
1943
+ $content: c(() => {
1944
+ var m;
1945
+ return (m = a.value) == null ? void 0 : m.$content;
1946
+ })
1947
+ });
1948
+ const { forwardRef: r, currentRef: n } = Ve(), a = n, i = V("modal"), l = c(() => !i.modal.closing && i.childIndex === z.openModals.length), d = c(() => t.description ? {} : { "aria-describedby": void 0 }), v = c(() => M("max-h-[90vh] overflow-auto px-4 pb-4", { "pt-4": !t.title || t.titleHidden }, t.class)), $ = c(() => M(
1949
+ "isolate fixed top-1/2 left-1/2 z-50 w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2",
1950
+ "overflow-hidden rounded-lg bg-white text-left shadow-xl sm:max-w-lg",
1951
+ "animate-[fade-in_var(--tw-duration)_ease-in-out,grow_var(--tw-duration)_ease-in-out]",
1952
+ "transition-[scale,opacity] will-change-[scale,opacity] duration-300",
1953
+ {
1954
+ "scale-50 opacity-0": !l.value,
1955
+ "scale-100 opacity-100": l.value
1956
+ },
1957
+ t.wrapperClass
1958
+ ));
1959
+ return tt("modal-will-close", async ({ modal: { id: m } }) => {
1960
+ m === i.modal.id && await ue({ ms: 300 });
1961
+ }), (m, C) => (u(), h(Wr, H(e, {
1962
+ ref: (L) => o(r)(L),
1963
+ persistent: m.persistent
1964
+ }), {
1965
+ default: f(({ close: L }) => [
1966
+ p(Jr, {
1967
+ class: k(["fixed inset-0 animate-[fade-in_var(--tw-duration)_ease-in-out] transition-opacity duration-300 will-change-[opacity]", {
1968
+ "bg-black/30": o(i).childIndex === 1,
1969
+ "opacity-0": o(i).childIndex === 1 && o(i).modal.closing
1970
+ }])
1971
+ }, null, 8, ["class"]),
1972
+ p(Kr, H(d.value, { class: $.value }), {
1973
+ default: f(() => [
1974
+ !m.persistent && !m.closeHidden ? (u(), b("div", Xr, [
1975
+ y("button", {
1976
+ type: "button",
1977
+ class: "clickable z-10 rounded-full p-2.5 text-gray-400 hover:text-gray-500",
1978
+ onClick: (_e) => L()
1979
+ }, [
1980
+ y("span", Gr, x(m.$td("ui.close", "Close")), 1),
1981
+ p(o(Nr), { class: "size-4" })
1982
+ ], 8, Yr)
1983
+ ])) : T("", !0),
1984
+ m.title ? (u(), h(Zr, {
1985
+ key: 1,
1986
+ class: k(["px-4 pt-5 text-base font-semibold text-gray-900", {
1987
+ "sr-only": m.titleHidden,
1988
+ "pb-0": m.description && !m.descriptionHidden,
1989
+ "pb-2": !m.description || m.descriptionHidden
1990
+ }])
1991
+ }, {
1992
+ default: f(() => [
1993
+ p(P, {
1994
+ text: m.title,
1995
+ inline: ""
1996
+ }, null, 8, ["text"])
1997
+ ]),
1998
+ _: 1
1999
+ }, 8, ["class"])) : T("", !0),
2000
+ m.description ? (u(), h(Qr, {
2001
+ key: 2,
2002
+ class: k(["px-4 pt-1 pb-2", { "sr-only": m.descriptionHidden }])
2003
+ }, {
2004
+ default: f(() => [
2005
+ p(P, {
2006
+ text: m.description,
2007
+ class: "text-sm leading-6 text-gray-500"
2008
+ }, null, 8, ["text"])
2009
+ ]),
2010
+ _: 1
2011
+ }, 8, ["class"])) : T("", !0),
2012
+ y("div", {
2013
+ class: k(v.value)
2014
+ }, [
2015
+ w(m.$slots, "default", { close: L })
2016
+ ], 2)
2017
+ ]),
2018
+ _: 2
2019
+ }, 1040, ["class"])
2020
+ ]),
2021
+ _: 3
2022
+ }, 16, ["persistent"]));
2023
+ }
2024
+ });
2025
+ function en(t) {
2026
+ const s = c(() => t.title ?? S("ui.alert", "Alert")), e = c(() => !t.title);
2027
+ return { renderedTitle: s, titleHidden: e };
2028
+ }
2029
+ const tn = /* @__PURE__ */ g({
2030
+ __name: "AlertModal",
2031
+ props: {
2032
+ title: {},
2033
+ message: {}
2034
+ },
2035
+ setup(t, { expose: s }) {
2036
+ const e = t, { renderedTitle: r, titleHidden: n } = en(e);
2037
+ return s(), (a, i) => (u(), h(se, {
2038
+ title: o(r),
2039
+ "title-hidden": o(n)
2040
+ }, {
2041
+ default: f(() => [
2042
+ p(P, { text: a.message }, null, 8, ["text"])
2043
+ ]),
2044
+ _: 1
2045
+ }, 8, ["title", "title-hidden"]));
2046
+ }
2047
+ }), $t = /* @__PURE__ */ g({
2048
+ __name: "Form",
2049
+ props: {
2050
+ form: {}
2051
+ },
2052
+ emits: ["submit"],
2053
+ setup(t, { emit: s }) {
2054
+ let e;
2055
+ const r = s;
2056
+ return Y((n) => {
2057
+ var a;
2058
+ e == null || e(), e = (a = t.form) == null ? void 0 : a.on("submit", () => r("submit")), n(() => e == null ? void 0 : e());
2059
+ }), le("form", t.form), (n, a) => (u(), b("form", {
2060
+ onSubmit: a[0] || (a[0] = We((i) => {
2061
+ var l;
2062
+ return (l = n.form) == null ? void 0 : l.submit();
2063
+ }, ["prevent"]))
2064
+ }, [
2065
+ w(n.$slots, "default")
2066
+ ], 32));
2067
+ }
2068
+ });
2069
+ function sn(t) {
2070
+ const s = rt(
2071
+ Object.entries(t.checkboxes ?? {}).reduce(
2072
+ (i, [l, d]) => ({
2073
+ [l]: {
2074
+ type: "boolean",
2075
+ default: d.default,
2076
+ required: d.required ? "required" : void 0
2077
+ },
2078
+ ...i
2079
+ }),
2080
+ {}
2081
+ )
2082
+ ), e = c(() => t.title ?? S("ui.confirm", "Confirm")), r = c(() => !t.title), n = c(() => t.acceptText ?? S("ui.accept", "Ok")), a = c(() => t.cancelText ?? S("ui.cancel", "Cancel"));
2083
+ return { form: s, renderedTitle: e, titleHidden: r, renderedAcceptText: n, renderedCancelText: a };
2084
+ }
2085
+ const rn = {
2086
+ key: 0,
2087
+ class: "mt-4 flex flex-col text-sm text-gray-600"
2088
+ }, nn = { class: "flex items-center" }, an = ["onUpdate:modelValue", "required"], ln = { class: "ml-1.5" }, on = { class: "mt-4 flex flex-row-reverse gap-2" }, un = /* @__PURE__ */ g({
2089
+ __name: "ConfirmModal",
2090
+ props: {
2091
+ title: {},
2092
+ message: {},
2093
+ acceptText: {},
2094
+ acceptVariant: {},
2095
+ cancelText: {},
2096
+ cancelVariant: { default: "secondary" },
2097
+ checkboxes: {},
2098
+ actions: {},
2099
+ required: { type: Boolean }
2100
+ },
2101
+ setup(t, { expose: s }) {
2102
+ const e = N(t, ["cancelVariant"]), { form: r, renderedTitle: n, titleHidden: a, renderedAcceptText: i, renderedCancelText: l } = sn(e);
2103
+ return s(), (d, v) => (u(), h(se, {
2104
+ title: o(n),
2105
+ "title-hidden": o(a),
2106
+ persistent: ""
2107
+ }, {
2108
+ default: f(({ close: $ }) => [
2109
+ p($t, {
2110
+ form: o(r),
2111
+ onSubmit: (m) => $([!0, o(r).data()])
2112
+ }, {
2113
+ default: f(() => [
2114
+ p(P, {
2115
+ text: d.message,
2116
+ actions: d.actions
2117
+ }, null, 8, ["text", "actions"]),
2118
+ d.checkboxes ? (u(), b("ul", rn, [
2119
+ (u(!0), b(D, null, F(d.checkboxes, (m, C) => (u(), b("li", { key: C }, [
2120
+ y("label", nn, [
2121
+ Ke(y("input", {
2122
+ "onUpdate:modelValue": (L) => o(r)[C] = L,
2123
+ type: "checkbox",
2124
+ required: m.required,
2125
+ class: "border-primary-600 text-primary-600 hover:bg-primary-50 hover:checked:bg-primary-500 focus:ring-primary-600 focus-visible:ring-primary-600 rounded border-2"
2126
+ }, null, 8, an), [
2127
+ [qt, o(r)[C]]
2128
+ ]),
2129
+ y("span", ln, x(m.label), 1)
2130
+ ])
2131
+ ]))), 128))
2132
+ ])) : T("", !0),
2133
+ y("div", on, [
2134
+ p(q, {
2135
+ variant: d.acceptVariant,
2136
+ submit: ""
2137
+ }, {
2138
+ default: f(() => [
2139
+ I(x(o(i)), 1)
2140
+ ]),
2141
+ _: 1
2142
+ }, 8, ["variant"]),
2143
+ d.required ? T("", !0) : (u(), h(q, {
2144
+ key: 0,
2145
+ variant: d.cancelVariant,
2146
+ onClick: (m) => $(!1)
2147
+ }, {
2148
+ default: f(() => [
2149
+ I(x(o(l)), 1)
2150
+ ]),
2151
+ _: 2
2152
+ }, 1032, ["variant", "onClick"]))
2153
+ ])
2154
+ ]),
2155
+ _: 2
2156
+ }, 1032, ["form", "onSubmit"])
2157
+ ]),
2158
+ _: 1
2159
+ }, 8, ["title", "title-hidden"]));
2160
+ }
2161
+ }), cn = {
2162
+ viewBox: "0 0 20 20",
2163
+ width: "1.2em",
2164
+ height: "1.2em"
2165
+ };
2166
+ function dn(t, s) {
2167
+ return u(), b("svg", cn, s[0] || (s[0] = [
2168
+ y("path", {
2169
+ fill: "currentColor",
2170
+ d: "M7.05 9.293L6.343 10L12 15.657l1.414-1.414L9.172 10l4.242-4.243L12 4.343z"
2171
+ }, null, -1)
2172
+ ]));
2173
+ }
2174
+ const pn = E({ name: "zondicons-cheveron-left", render: dn }), mn = {
2175
+ viewBox: "0 0 20 20",
2176
+ width: "1.2em",
2177
+ height: "1.2em"
2178
+ };
2179
+ function fn(t, s) {
2180
+ return u(), b("svg", mn, s[0] || (s[0] = [
2181
+ y("path", {
2182
+ fill: "currentColor",
2183
+ d: "m12.95 10.707l.707-.707L8 4.343L6.586 5.757L10.828 10l-4.242 4.243L8 15.657z"
2184
+ }, null, -1)
2185
+ ]));
2186
+ }
2187
+ const _t = E({ name: "zondicons-cheveron-right", render: fn }), hn = {
2188
+ viewBox: "0 0 20 20",
2189
+ width: "1.2em",
2190
+ height: "1.2em"
2191
+ };
2192
+ function gn(t, s) {
2193
+ return u(), b("svg", hn, s[0] || (s[0] = [
2194
+ y("path", {
2195
+ fill: "currentColor",
2196
+ d: "M2.93 17.07A10 10 0 1 1 17.07 2.93A10 10 0 0 1 2.93 17.07M9 5v6h2V5zm0 8v2h2v-2z"
2197
+ }, null, -1)
2198
+ ]));
2199
+ }
2200
+ const qe = E({ name: "zondicons-exclamation-solid", render: gn }), vn = {
2201
+ viewBox: "0 0 24 24",
2202
+ width: "1.2em",
2203
+ height: "1.2em"
2204
+ };
2205
+ function bn(t, s) {
2206
+ return u(), b("svg", vn, s[0] || (s[0] = [
2207
+ y("path", {
2208
+ fill: "currentColor",
2209
+ d: "M20 19V7H4v12zm0-16a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2zm-7 14v-2h5v2zm-3.42-4L5.57 9H8.4l3.3 3.3c.39.39.39 1.03 0 1.42L8.42 17H5.59z"
2210
+ }, null, -1)
2211
+ ]));
2212
+ }
2213
+ const yn = E({ name: "mdi-console", render: bn }), wn = {
2214
+ viewBox: "0 0 20 20",
2215
+ width: "1.2em",
2216
+ height: "1.2em"
2217
+ };
2218
+ function $n(t, s) {
2219
+ return u(), b("svg", wn, s[0] || (s[0] = [
2220
+ y("path", {
2221
+ fill: "currentColor",
2222
+ d: "M6 6V2c0-1.1.9-2 2-2h10a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-4v4a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V8c0-1.1.9-2 2-2zm2 0h4a2 2 0 0 1 2 2v4h4V2H8zM2 8v10h10V8z"
2223
+ }, null, -1)
2224
+ ]));
2225
+ }
2226
+ const _n = E({ name: "zondicons-copy", render: $n }), xn = {
2227
+ viewBox: "0 0 24 24",
2228
+ width: "1.2em",
2229
+ height: "1.2em"
2230
+ };
2231
+ function Cn(t, s) {
2232
+ return u(), b("svg", xn, s[0] || (s[0] = [
2233
+ y("path", {
2234
+ fill: "currentColor",
2235
+ d: "M12 2A10 10 0 0 0 2 12c0 4.42 2.87 8.17 6.84 9.5c.5.08.66-.23.66-.5v-1.69c-2.77.6-3.36-1.34-3.36-1.34c-.46-1.16-1.11-1.47-1.11-1.47c-.91-.62.07-.6.07-.6c1 .07 1.53 1.03 1.53 1.03c.87 1.52 2.34 1.07 2.91.83c.09-.65.35-1.09.63-1.34c-2.22-.25-4.55-1.11-4.55-4.92c0-1.11.38-2 1.03-2.71c-.1-.25-.45-1.29.1-2.64c0 0 .84-.27 2.75 1.02c.79-.22 1.65-.33 2.5-.33s1.71.11 2.5.33c1.91-1.29 2.75-1.02 2.75-1.02c.55 1.35.2 2.39.1 2.64c.65.71 1.03 1.6 1.03 2.71c0 3.82-2.34 4.66-4.57 4.91c.36.31.69.92.69 1.85V21c0 .27.16.59.67.5C19.14 20.16 22 16.42 22 12A10 10 0 0 0 12 2"
2236
+ }, null, -1)
2237
+ ]));
2238
+ }
2239
+ const kn = E({ name: "mdi-github", render: Cn }), Sn = { class: "flex" }, Tn = { class: "sr-only" }, Mn = /* @__PURE__ */ g({
2240
+ __name: "ErrorReportModalButtons",
2241
+ props: {
2242
+ report: {}
2243
+ },
2244
+ setup(t) {
2245
+ const s = t, e = c(() => s.report.description ? `${s.report.title}: ${s.report.description}` : s.report.title), r = c(() => {
2246
+ if (!A.sourceUrl)
2247
+ return !1;
2248
+ const a = encodeURIComponent(e.value), i = encodeURIComponent(
2249
+ [
2250
+ "[Please, explain here what you were trying to do when this error appeared]",
2251
+ "",
2252
+ "Error details:",
2253
+ "```",
2254
+ Jt(
2255
+ s.report.details ?? "Details missing from report",
2256
+ 1800 - a.length - A.sourceUrl.length
2257
+ ).trim(),
2258
+ "```"
2259
+ ].join(`
2260
+ `)
2261
+ );
2262
+ return `${A.sourceUrl}/issues/new?title=${a}&body=${i}`;
2263
+ }), n = c(() => ee(
2264
+ [
2265
+ {
2266
+ id: "clipboard",
2267
+ description: "Copy to clipboard",
2268
+ iconComponent: _n,
2269
+ async click() {
2270
+ await navigator.clipboard.writeText(`${e.value}
2271
+
2272
+ ${s.report.details}`), z.toast(S("errors.copiedToClipboard", "Debug information copied to clipboard"));
2273
+ }
2274
+ },
2275
+ {
2276
+ id: "console",
2277
+ description: "Log to console",
2278
+ iconComponent: yn,
2279
+ click() {
2280
+ const a = s.report.error ?? s.report;
2281
+ window.error = a, console.error(a), z.toast(
2282
+ S(
2283
+ "errors.addedToConsole",
2284
+ "You can now use the **error** variable in the console"
2285
+ )
2286
+ );
2287
+ }
2288
+ }
2289
+ ],
2290
+ (a) => {
2291
+ r.value && a.push({
2292
+ id: "github",
2293
+ description: "Report in GitHub",
2294
+ iconComponent: kn,
2295
+ url: r.value
2296
+ });
2297
+ }
2298
+ ));
2299
+ return (a, i) => (u(), b("div", Sn, [
2300
+ (u(!0), b(D, null, F(n.value, (l) => w(a.$slots, "default", H({ ref_for: !0 }, l), () => [
2301
+ p(q, {
2302
+ size: "icon",
2303
+ variant: "ghost",
2304
+ class: "group whitespace-nowrap",
2305
+ href: l.url,
2306
+ title: a.$td(`errors.report_${l.id}`, l.description),
2307
+ onClick: l.click
2308
+ }, {
2309
+ default: f(() => [
2310
+ y("span", Tn, x(a.$td(`errors.report_${l.id}`, l.description)), 1),
2311
+ (u(), h(W(l.iconComponent), {
2312
+ class: "size-4",
2313
+ "aria-hidden": "true"
2314
+ }))
2315
+ ]),
2316
+ _: 2
2317
+ }, 1032, ["href", "title", "onClick"])
2318
+ ])), 256))
2319
+ ]));
2320
+ }
2321
+ }), Hn = /* @__PURE__ */ g({
2322
+ __name: "ErrorReportModalTitle",
2323
+ props: {
2324
+ report: {},
2325
+ currentReport: {},
2326
+ totalReports: {}
2327
+ },
2328
+ setup(t) {
2329
+ const s = c(() => !t.totalReports || t.totalReports <= 1 ? t.report.title : `${t.report.title} (${t.currentReport}/${t.totalReports})`);
2330
+ return (e, r) => (u(), h(P, {
2331
+ text: s.value,
2332
+ inline: ""
2333
+ }, null, 8, ["text"]));
2334
+ }
2335
+ });
2336
+ function En(t) {
2337
+ const s = U(t.reports.includes(t.report) ? t.reports.indexOf(t.report) : 0), e = c(() => t.reports[s.value]), r = c(
2338
+ () => {
2339
+ var i;
2340
+ return ((i = e.value.details) == null ? void 0 : i.trim()) || S("errors.detailsEmpty", "This error is missing a stacktrace.");
2341
+ }
2342
+ ), n = S("errors.previousReport", "Show previous report"), a = S("errors.nextReport", "Show next report");
2343
+ return {
2344
+ activeReportIndex: s,
2345
+ details: r,
2346
+ nextReportText: a,
2347
+ previousReportText: n,
2348
+ activeReport: e
2349
+ };
2350
+ }
2351
+ const Vn = { class: "px-4 pt-5 pb-4" }, Ln = { class: "flex justify-between gap-4" }, In = { class: "flex items-center gap-2" }, qn = {
2352
+ key: 0,
2353
+ class: "flex gap-0.5"
2354
+ }, zn = { class: "-mt-2 max-h-[75vh] overflow-auto bg-red-800/10" }, Rn = ["textContent"], Pn = /* @__PURE__ */ g({
2355
+ __name: "ErrorReportModal",
2356
+ props: {
2357
+ report: {},
2358
+ reports: {}
2359
+ },
2360
+ setup(t, { expose: s }) {
2361
+ const e = t, { activeReportIndex: r, details: n, nextReportText: a, previousReportText: i, activeReport: l } = En(e);
2362
+ return s(), (d, v) => (u(), h(se, {
2363
+ title: d.$td("errors.report", "Error report"),
2364
+ "title-hidden": "",
2365
+ "close-hidden": "",
2366
+ class: "p-0",
2367
+ "wrapper-class": "sm:w-auto sm:min-w-lg sm:max-w-[80vw]"
2368
+ }, {
2369
+ default: f(() => [
2370
+ y("div", Vn, [
2371
+ y("h2", Ln, [
2372
+ y("div", In, [
2373
+ p(o(qe), { class: "size-5 text-red-600" }),
2374
+ p(Hn, {
2375
+ class: "text-lg leading-6 font-semibold text-gray-900",
2376
+ report: o(l),
2377
+ "current-report": o(r) + 1,
2378
+ "total-reports": d.reports.length
2379
+ }, null, 8, ["report", "current-report", "total-reports"]),
2380
+ d.reports.length > 1 ? (u(), b("span", qn, [
2381
+ p(q, {
2382
+ size: "icon",
2383
+ variant: "ghost",
2384
+ disabled: o(r) === 0,
2385
+ "aria-label": o(i),
2386
+ title: o(i),
2387
+ onClick: v[0] || (v[0] = ($) => r.value--)
2388
+ }, {
2389
+ default: f(() => [
2390
+ p(o(pn), { class: "size-4" })
2391
+ ]),
2392
+ _: 1
2393
+ }, 8, ["disabled", "aria-label", "title"]),
2394
+ p(q, {
2395
+ size: "icon",
2396
+ variant: "ghost",
2397
+ disabled: o(r) === d.reports.length - 1,
2398
+ "aria-label": o(a),
2399
+ title: o(a),
2400
+ onClick: v[1] || (v[1] = ($) => r.value++)
2401
+ }, {
2402
+ default: f(() => [
2403
+ p(o(_t), { class: "size-4" })
2404
+ ]),
2405
+ _: 1
2406
+ }, 8, ["disabled", "aria-label", "title"])
2407
+ ])) : T("", !0)
2408
+ ]),
2409
+ p(Mn, {
2410
+ report: o(l),
2411
+ class: "gap-0.5"
2412
+ }, null, 8, ["report"])
2413
+ ]),
2414
+ o(l).description ? (u(), h(P, {
2415
+ key: 0,
2416
+ text: o(l).description,
2417
+ class: "text-gray-600"
2418
+ }, null, 8, ["text"])) : T("", !0)
2419
+ ]),
2420
+ y("div", zn, [
2421
+ y("pre", {
2422
+ class: "p-4 text-xs text-red-800",
2423
+ textContent: x(o(n))
2424
+ }, null, 8, Rn)
2425
+ ])
2426
+ ]),
2427
+ _: 1
2428
+ }, 8, ["title"]));
2429
+ }
2430
+ }), An = {
2431
+ viewBox: "0 0 24 24",
2432
+ width: "1.2em",
2433
+ height: "1.2em"
2434
+ };
2435
+ function Dn(t, s) {
2436
+ return u(), b("svg", An, s[0] || (s[0] = [
2437
+ y("path", {
2438
+ fill: "currentColor",
2439
+ d: "M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z",
2440
+ opacity: ".25"
2441
+ }, null, -1),
2442
+ y("path", {
2443
+ fill: "currentColor",
2444
+ d: "M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z"
2445
+ }, [
2446
+ y("animateTransform", {
2447
+ attributeName: "transform",
2448
+ dur: "0.75s",
2449
+ repeatCount: "indefinite",
2450
+ type: "rotate",
2451
+ values: "0 12 12;360 12 12"
2452
+ })
2453
+ ], -1)
2454
+ ]));
2455
+ }
2456
+ const jn = E({ name: "svg-spinners-90-ring-with-bg", render: Dn }), Bn = { class: "mt-1 h-2 w-full overflow-hidden rounded-full bg-gray-200" }, Fn = { class: "sr-only" }, Un = /* @__PURE__ */ g({
2457
+ __name: "ProgressBar",
2458
+ props: {
2459
+ filledClass: {},
2460
+ progress: {},
2461
+ job: {}
2462
+ },
2463
+ setup(t) {
2464
+ let s;
2465
+ const e = U(0), r = c(() => M("size-full transition-transform duration-500 rounded-r-full ease-linear bg-primary-600", t.filledClass)), n = c(() => typeof t.progress == "number" ? t.progress : e.value);
2466
+ return Me(
2467
+ () => t.job,
2468
+ () => {
2469
+ s && s(), e.value = t.job ? t.job.progress : 0, s = t.job && t.job.listeners.add({ onUpdated: (a) => e.value = a });
2470
+ },
2471
+ { immediate: !0 }
2472
+ ), ge(() => s && s()), (a, i) => (u(), b("div", Bn, [
2473
+ y("div", {
2474
+ class: k(r.value),
2475
+ style: zt(`transform:translateX(-${(1 - n.value) * 100}%)`)
2476
+ }, null, 6),
2477
+ y("span", Fn, x(a.$td("ui.progress", "{progress}% complete", {
2478
+ progress: n.value * 100
2479
+ })), 1)
2480
+ ]));
2481
+ }
2482
+ });
2483
+ function On(t) {
2484
+ const s = c(() => t.title ?? S("ui.loading", "Loading")), e = c(
2485
+ () => t.message ?? S("ui.loadingInProgress", "Loading in progress...")
2486
+ ), r = c(() => typeof t.progress == "number" || !!t.job), n = c(() => !t.title);
2487
+ return { renderedTitle: s, renderedMessage: e, titleHidden: n, showProgress: r };
2488
+ }
2489
+ const Nn = /* @__PURE__ */ g({
2490
+ __name: "LoadingModal",
2491
+ props: {
2492
+ title: {},
2493
+ message: {},
2494
+ progress: {},
2495
+ job: {}
2496
+ },
2497
+ setup(t, { expose: s }) {
2498
+ const e = t, { renderedTitle: r, renderedMessage: n, titleHidden: a, showProgress: i } = On(e);
2499
+ return s(), (l, d) => (u(), h(se, {
2500
+ persistent: "",
2501
+ class: k(["flex", { "flex-col-reverse": o(i), "items-center justify-center gap-2": !o(i) }]),
2502
+ "wrapper-class": "w-auto",
2503
+ title: o(r),
2504
+ "title-hidden": o(a)
2505
+ }, {
2506
+ default: f(() => [
2507
+ o(i) ? (u(), h(Un, {
2508
+ key: 0,
2509
+ progress: l.progress,
2510
+ job: l.job,
2511
+ class: "min-w-[min(400px,80vw)]"
2512
+ }, null, 8, ["progress", "job"])) : (u(), h(o(jn), {
2513
+ key: 1,
2514
+ class: "text-primary-600 mr-1 size-6"
2515
+ })),
2516
+ p(P, { text: o(n) }, null, 8, ["text"])
2517
+ ]),
2518
+ _: 1
2519
+ }, 8, ["title", "title-hidden", "class"]));
2520
+ }
2521
+ }), ze = /* @__PURE__ */ g({
2522
+ __name: "HeadlessInput",
2523
+ props: {
2524
+ name: {},
2525
+ label: {},
2526
+ description: {},
2527
+ modelValue: {},
2528
+ as: { default: "div" }
2529
+ },
2530
+ emits: ["update:modelValue"],
2531
+ setup(t, { expose: s, emit: e }) {
2532
+ const r = e, n = X("form", null), a = c(() => !n || !t.name ? null : n.errors[t.name] ?? null), i = {
2533
+ id: `input-${re()}`,
2534
+ name: c(() => t.name),
2535
+ label: c(() => t.label),
2536
+ description: c(() => t.description),
2537
+ value: c(() => n && t.name ? n.getFieldValue(t.name) : t.modelValue),
2538
+ errors: ve(a),
2539
+ required: c(() => {
2540
+ if (!(!t.name || !n))
2541
+ return n.getFieldRules(t.name).includes("required");
2542
+ }),
2543
+ update(l) {
2544
+ if (n && t.name) {
2545
+ n.setFieldValue(t.name, l);
2546
+ return;
2547
+ }
2548
+ r("update:modelValue", l);
2549
+ }
2550
+ };
2551
+ return le("input", i), s(i), (l, d) => (u(), h(W(l.as), null, {
2552
+ default: f(() => [
2553
+ w(l.$slots, "default")
2554
+ ]),
2555
+ _: 3
2556
+ }));
2557
+ }
2558
+ }), Wn = ["for"], fe = /* @__PURE__ */ g({
2559
+ __name: "HeadlessInputLabel",
2560
+ setup(t) {
2561
+ const s = V("input", "<HeadlessInputLabel> must be a child of a <HeadlessInput>"), e = He(), r = c(() => !!(s.label || e.default));
2562
+ return (n, a) => r.value ? (u(), b("label", {
2563
+ key: 0,
2564
+ for: o(s).id
2565
+ }, [
2566
+ w(n.$slots, "default", {}, () => [
2567
+ I(x(o(s).label), 1)
2568
+ ])
2569
+ ], 8, Wn)) : T("", !0);
2570
+ }
2571
+ }), Kn = ["id", "name", "checked", "type", "required", "aria-invalid", "aria-describedby"], xt = /* @__PURE__ */ g({
2572
+ __name: "HeadlessInputInput",
2573
+ props: {
2574
+ type: {}
2575
+ },
2576
+ setup(t) {
2577
+ const s = G("$inputRef"), e = V("input", "<HeadlessInputInput> must be a child of a <HeadlessInput>"), r = X("form", null), n = c(() => e.name ?? void 0), a = c(() => e.value), i = c(() => {
2578
+ if (t.type)
2579
+ return t.type;
2580
+ const $ = (n.value && (r == null ? void 0 : r.getFieldType(n.value))) ?? "";
2581
+ return ["text", "email", "number", "tel", "url"].includes($) ? $ : "text";
2582
+ }), l = c(() => {
2583
+ if (t.type === "checkbox")
2584
+ return !!a.value;
2585
+ });
2586
+ function d() {
2587
+ s.value && e.update(v());
2588
+ }
2589
+ function v() {
2590
+ if (!s.value)
2591
+ return null;
2592
+ switch (t.type) {
2593
+ case "checkbox":
2594
+ return s.value.checked;
2595
+ case "date":
2596
+ return s.value.valueAsDate;
2597
+ default:
2598
+ return s.value.value;
2599
+ }
2600
+ }
2601
+ return st(e, () => {
2602
+ var $;
2603
+ return ($ = s.value) == null ? void 0 : $.focus();
2604
+ }), Y(() => {
2605
+ if (s.value) {
2606
+ if (t.type === "date" && a.value instanceof Date) {
2607
+ s.value.valueAsDate = a.value;
2608
+ return;
2609
+ }
2610
+ s.value.value = a.value ?? null;
2611
+ }
2612
+ }), ($, m) => (u(), b("input", {
2613
+ id: o(e).id,
2614
+ ref: "$inputRef",
2615
+ name: n.value,
2616
+ checked: l.value,
2617
+ type: i.value,
2618
+ required: o(e).required ?? void 0,
2619
+ "aria-invalid": o(e).errors ? "true" : "false",
2620
+ "aria-describedby": o(e).errors ? `${o(e).id}-error` : o(e).description ? `${o(e).id}-description` : void 0,
2621
+ onInput: d
2622
+ }, null, 40, Kn));
2623
+ }
2624
+ }), Ct = /* @__PURE__ */ g({
2625
+ inheritAttrs: !1,
2626
+ __name: "HeadlessInputDescription",
2627
+ setup(t) {
2628
+ const s = V(
2629
+ "input",
2630
+ "<HeadlessInputDescription> must be a child of a <HeadlessInput>"
2631
+ ), e = c(() => typeof s.description == "string" ? s.description : ""), r = c(() => !!s.description);
2632
+ return (n, a) => w(n.$slots, "default", {
2633
+ id: `${o(s).id}-description`
2634
+ }, () => [
2635
+ r.value ? (u(), h(P, H({ key: 0 }, n.$attrs, {
2636
+ id: `${o(s).id}-description`,
2637
+ text: e.value
2638
+ }), null, 16, ["id", "text"])) : T("", !0)
2639
+ ]);
2640
+ }
2641
+ }), Qn = ["id"], he = /* @__PURE__ */ g({
2642
+ __name: "HeadlessInputError",
2643
+ setup(t) {
2644
+ const s = V("input", "<HeadlessInputError> must be a child of a <HeadlessInput>"), e = c(() => s.errors ? S(`errors.${s.errors[0]}`, `Error: ${s.errors[0]}`) : null);
2645
+ return (r, n) => e.value ? (u(), b("p", {
2646
+ key: 0,
2647
+ id: `${o(s).id}-error`
2648
+ }, x(e.value), 9, Qn)) : T("", !0);
2649
+ }
2650
+ }), Jn = {
2651
+ key: 0,
2652
+ class: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3"
2653
+ }, Zn = /* @__PURE__ */ g({
2654
+ inheritAttrs: !1,
2655
+ __name: "Input",
2656
+ props: {
2657
+ name: {},
2658
+ label: {},
2659
+ description: {},
2660
+ modelValue: {},
2661
+ inputClass: {},
2662
+ wrapperClass: {}
2663
+ },
2664
+ emits: ["update:modelValue"],
2665
+ setup(t) {
2666
+ const s = N(t, ["label", "inputClass", "wrapperClass"]), e = G("$inputRef"), [r, n] = Ie(), a = c(() => M("relative rounded-md shadow-2xs", { "mt-1": t.label }, t.wrapperClass)), i = c(() => {
2667
+ var l, d, v;
2668
+ return M(
2669
+ // eslint-disable-next-line vue/max-len
2670
+ "block w-full rounded-md border-0 py-1.5 ring-1 ring-inset focus:ring-2 focus:ring-inset sm:text-sm sm:leading-6",
2671
+ {
2672
+ "focus:ring-primary-600": !((l = e.value) != null && l.errors),
2673
+ "text-gray-900 shadow-2xs ring-gray-900/10 placeholder:text-gray-400": !((d = e.value) != null && d.errors),
2674
+ "pr-10 text-red-900 ring-red-900/10 placeholder:text-red-300 focus:ring-red-500": (v = e.value) == null ? void 0 : v.errors
2675
+ },
2676
+ t.inputClass
2677
+ );
2678
+ });
2679
+ return (l, d) => (u(), h(ze, H({
2680
+ ref: "$inputRef",
2681
+ label: l.label,
2682
+ class: o(n)
2683
+ }, s, {
2684
+ "onUpdate:modelValue": d[0] || (d[0] = (v) => l.$emit("update:modelValue", v))
2685
+ }), {
2686
+ default: f(() => {
2687
+ var v;
2688
+ return [
2689
+ p(fe, { class: "block text-sm leading-6 font-medium text-gray-900" }),
2690
+ y("div", {
2691
+ class: k(a.value)
2692
+ }, [
2693
+ p(xt, H(o(r), { class: i.value }), null, 16, ["class"]),
2694
+ (v = e.value) != null && v.errors ? (u(), b("div", Jn, [
2695
+ p(o(qe), { class: "size-5 text-red-500" })
2696
+ ])) : T("", !0)
2697
+ ], 2),
2698
+ p(Ct, { class: "mt-2 text-sm text-gray-600" }),
2699
+ p(he, { class: "mt-2 text-sm text-red-600" })
2700
+ ];
2701
+ }),
2702
+ _: 1
2703
+ }, 16, ["label", "class"]));
2704
+ }
2705
+ });
2706
+ function $l(t, s = {}) {
2707
+ return {
2708
+ default: t,
2709
+ type: "boolean",
2710
+ rules: s.rules
2711
+ };
2712
+ }
2713
+ function _l(t, s = {}) {
2714
+ return {
2715
+ default: t,
2716
+ type: "date",
2717
+ rules: s.rules
2718
+ };
2719
+ }
2720
+ function xl(t, s, e = {}) {
2721
+ return {
2722
+ default: s,
2723
+ type: "enum",
2724
+ rules: e.rules,
2725
+ values: t
2726
+ };
2727
+ }
2728
+ function Cl(t) {
2729
+ return {
2730
+ default: t,
2731
+ type: "boolean",
2732
+ rules: "required"
2733
+ };
2734
+ }
2735
+ function kl(t) {
2736
+ return {
2737
+ default: t,
2738
+ type: "date",
2739
+ rules: "required"
2740
+ };
2741
+ }
2742
+ function Sl(t, s) {
2743
+ return {
2744
+ default: s,
2745
+ type: "enum",
2746
+ rules: "required",
2747
+ values: t
2748
+ };
2749
+ }
2750
+ function Tl(t) {
2751
+ return {
2752
+ default: t,
2753
+ type: "number",
2754
+ rules: "required"
2755
+ };
2756
+ }
2757
+ function Ml(t) {
2758
+ return {
2759
+ default: t,
2760
+ type: "object",
2761
+ rules: "required"
2762
+ };
2763
+ }
2764
+ function Xn(t) {
2765
+ return {
2766
+ default: t,
2767
+ type: "string",
2768
+ rules: "required"
2769
+ };
2770
+ }
2771
+ function Hl(t, s = {}) {
2772
+ return {
2773
+ default: t,
2774
+ type: "number",
2775
+ rules: s.rules
2776
+ };
2777
+ }
2778
+ function El(t, s = {}) {
2779
+ return {
2780
+ default: t,
2781
+ type: "object",
2782
+ rules: s.rules
2783
+ };
2784
+ }
2785
+ function Vl(t, s = {}) {
2786
+ return {
2787
+ default: t,
2788
+ type: "string",
2789
+ rules: s.rules
2790
+ };
2791
+ }
2792
+ function Yn(t) {
2793
+ const s = rt({
2794
+ draft: Xn(t.defaultValue ?? "")
2795
+ }), e = c(() => t.title ?? t.message), r = c(() => t.title ? t.message : null), n = c(() => t.acceptText ?? S("ui.accept", "Ok")), a = c(() => t.cancelText ?? S("ui.cancel", "Cancel"));
2796
+ return { form: s, renderedTitle: e, renderedMessage: r, renderedAcceptText: n, renderedCancelText: a };
2797
+ }
2798
+ const Gn = { class: "mt-4 flex flex-row-reverse gap-2" }, ea = /* @__PURE__ */ g({
2799
+ __name: "PromptModal",
2800
+ props: {
2801
+ title: {},
2802
+ message: {},
2803
+ label: {},
2804
+ defaultValue: {},
2805
+ placeholder: {},
2806
+ acceptText: {},
2807
+ acceptVariant: {},
2808
+ cancelText: {},
2809
+ cancelVariant: { default: "secondary" }
2810
+ },
2811
+ setup(t, { expose: s }) {
2812
+ const e = N(t, ["cancelVariant"]), { form: r, renderedTitle: n, renderedMessage: a, renderedAcceptText: i, renderedCancelText: l } = Yn(e);
2813
+ return s(), (d, v) => (u(), h(se, {
2814
+ title: o(n),
2815
+ persistent: ""
2816
+ }, {
2817
+ default: f(({ close: $ }) => [
2818
+ p($t, {
2819
+ form: o(r),
2820
+ onSubmit: (m) => $(o(r).draft)
2821
+ }, {
2822
+ default: f(() => [
2823
+ o(a) ? (u(), h(P, {
2824
+ key: 0,
2825
+ text: o(a)
2826
+ }, null, 8, ["text"])) : T("", !0),
2827
+ p(Zn, {
2828
+ name: "draft",
2829
+ class: "mt-2",
2830
+ placeholder: d.placeholder,
2831
+ label: d.label
2832
+ }, null, 8, ["placeholder", "label"]),
2833
+ y("div", Gn, [
2834
+ p(q, {
2835
+ variant: d.acceptVariant,
2836
+ submit: ""
2837
+ }, {
2838
+ default: f(() => [
2839
+ I(x(o(i)), 1)
2840
+ ]),
2841
+ _: 1
2842
+ }, 8, ["variant"]),
2843
+ p(q, {
2844
+ variant: d.cancelVariant,
2845
+ onClick: (m) => $()
2846
+ }, {
2847
+ default: f(() => [
2848
+ I(x(o(l)), 1)
2849
+ ]),
2850
+ _: 2
2851
+ }, 1032, ["variant", "onClick"])
2852
+ ])
2853
+ ]),
2854
+ _: 2
2855
+ }, 1032, ["form", "onSubmit"])
2856
+ ]),
2857
+ _: 1
2858
+ }, 8, ["title"]));
2859
+ }
2860
+ }), ta = {
2861
+ viewBox: "0 0 24 24",
2862
+ width: "1.2em",
2863
+ height: "1.2em"
2864
+ };
2865
+ function sa(t, s) {
2866
+ return u(), b("svg", ta, s[0] || (s[0] = [
2867
+ y("path", {
2868
+ fill: "currentColor",
2869
+ d: "M12 21q-1.625 0-3.012-.8T6.8 18H4v-2h2.1q-.075-.5-.088-1T6 14H4v-2h2q0-.5.012-1t.088-1H4V8h2.8q.35-.575.788-1.075T8.6 6.05L7 4.4L8.4 3l2.15 2.15q.7-.225 1.425-.225t1.425.225L15.6 3L17 4.4l-1.65 1.65q.575.375 1.038.862T17.2 8H20v2h-2.1q.075.5.088 1T18 12h2v2h-2q0 .5-.013 1t-.087 1H20v2h-2.8q-.8 1.4-2.187 2.2T12 21m-2-5h4v-2h-4zm0-4h4v-2h-4z"
2870
+ }, null, -1)
2871
+ ]));
2872
+ }
2873
+ const ra = E({ name: "material-symbols-bug-report", render: sa }), na = {
2874
+ viewBox: "0 0 24 24",
2875
+ width: "1.2em",
2876
+ height: "1.2em"
2877
+ };
2878
+ function aa(t, s) {
2879
+ return u(), b("svg", na, s[0] || (s[0] = [
2880
+ y("path", {
2881
+ fill: "currentColor",
2882
+ d: "M7 21q-.825 0-1.412-.587T5 19V6q-.425 0-.712-.288T4 5t.288-.712T5 4h4q0-.425.288-.712T10 3h4q.425 0 .713.288T15 4h4q.425 0 .713.288T20 5t-.288.713T19 6v13q0 .825-.587 1.413T17 21zm5-7.1l1.9 1.9q.275.275.7.275t.7-.275t.275-.7t-.275-.7l-1.9-1.9l1.9-1.9q.275-.275.275-.7t-.275-.7t-.7-.275t-.7.275L12 11.1l-1.9-1.9q-.275-.275-.7-.275t-.7.275t-.275.7t.275.7l1.9 1.9l-1.9 1.9q-.275.275-.275.7t.275.7t.7.275t.7-.275z"
2883
+ }, null, -1)
2884
+ ]));
2885
+ }
2886
+ const la = E({ name: "material-symbols-delete-forever-rounded", render: aa }), oa = {
2887
+ viewBox: "0 0 24 24",
2888
+ width: "1.2em",
2889
+ height: "1.2em"
2890
+ };
2891
+ function ia(t, s) {
2892
+ return u(), b("svg", oa, s[0] || (s[0] = [
2893
+ y("path", {
2894
+ fill: "currentColor",
2895
+ d: "M11.25 13.5q.95 0 1.6-.65t.65-1.6t-.65-1.6t-1.6-.65t-1.6.65t-.65 1.6t.65 1.6t1.6.65m4.825 4l-2.625-2.625q-.5.325-1.062.475t-1.138.15q-1.775 0-3.012-1.237T7 11.25t1.238-3.012T11.25 7t3.013 1.238T15.5 11.25q0 .575-.162 1.138t-.488 1.062l2.65 2.65zM5 21q-.825 0-1.412-.587T3 19v-4h2v4h4v2zm10 0v-2h4v-4h2v4q0 .825-.587 1.413T19 21zM3 9V5q0-.825.588-1.412T5 3h4v2H5v4zm16 0V5h-4V3h4q.825 0 1.413.588T21 5v4z"
2896
+ }, null, -1)
2897
+ ]));
2898
+ }
2899
+ const ua = E({ name: "material-symbols-frame-inspect", render: ia }), ca = {
2900
+ viewBox: "0 0 24 24",
2901
+ width: "1.2em",
2902
+ height: "1.2em"
2903
+ };
2904
+ function da(t, s) {
2905
+ return u(), b("svg", ca, s[0] || (s[0] = [
2906
+ y("path", {
2907
+ fill: "currentColor",
2908
+ d: "M12 20q-3.35 0-5.675-2.325T4 12t2.325-5.675T12 4q1.725 0 3.3.712T18 6.75V5q0-.425.288-.712T19 4t.713.288T20 5v5q0 .425-.288.713T19 11h-5q-.425 0-.712-.288T13 10t.288-.712T14 9h3.2q-.8-1.4-2.187-2.2T12 6Q9.5 6 7.75 7.75T6 12t1.75 4.25T12 18q1.7 0 3.113-.862t2.187-2.313q.2-.35.563-.487t.737-.013q.4.125.575.525t-.025.75q-1.025 2-2.925 3.2T12 20"
2909
+ }, null, -1)
2910
+ ]));
2911
+ }
2912
+ const pa = E({ name: "material-symbols-refresh-rounded", render: da }), ma = { class: "grid grow place-items-center" }, fa = { class: "flex flex-col items-center p-8" }, ha = { class: "mt-0 mb-0 text-center text-4xl font-medium text-red-600" }, ga = { class: "mt-4 grid grid-cols-1 gap-2 sm:grid-cols-2 [&_button]:justify-start sm:[&_button]:size-32 sm:[&_button]:flex-col sm:[&_button]:justify-center [&_svg]:size-6 sm:[&_svg]:size-8" }, va = /* @__PURE__ */ g({
2913
+ __name: "StartupCrash",
2914
+ setup(t) {
2915
+ async function s() {
2916
+ await z.confirm(
2917
+ S("startupCrash.purgeConfirmTitle", "Delete everything?"),
2918
+ S(
2919
+ "startupCrash.purgeConfirmMessage",
2920
+ `If the problem persists, one drastic solution may be to wipe the storage in this device to start from scratch. However, keep in mind that **all the data that you haven't synchronized will be deleted forever**.
2921
+
2922
+ Do you still want to proceed?`
2923
+ ),
2924
+ {
2925
+ acceptVariant: "danger",
2926
+ acceptText: S("startupCrash.purgeConfirmAccept", "Purge device")
2927
+ }
2928
+ ) && (await at.purge(), await A.reload());
2929
+ }
2930
+ return (e, r) => {
2931
+ const n = Rt("i-majesticons-exclamation");
2932
+ return u(), b("div", ma, [
2933
+ y("div", fa, [
2934
+ p(n, { class: "size-20 text-red-600" }),
2935
+ y("h1", ha, x(e.$td("startupCrash.title", "Oops, something went wrong!")), 1),
2936
+ p(P, {
2937
+ text: e.$td(
2938
+ "startupCrash.message",
2939
+ "There was a problem starting the application, but here's some things you can do:"
2940
+ ),
2941
+ class: "mt-4 text-center"
2942
+ }, null, 8, ["text"]),
2943
+ y("div", ga, [
2944
+ p(q, {
2945
+ variant: "danger",
2946
+ onClick: r[0] || (r[0] = (a) => e.$app.reload())
2947
+ }, {
2948
+ default: f(() => [
2949
+ p(o(pa)),
2950
+ I(" " + x(e.$td("startupCrash.reload", "Try again")), 1)
2951
+ ]),
2952
+ _: 1
2953
+ }),
2954
+ p(q, {
2955
+ variant: "danger",
2956
+ onClick: r[1] || (r[1] = (a) => e.$errors.inspect(e.$errors.startupErrors))
2957
+ }, {
2958
+ default: f(() => [
2959
+ p(o(ra)),
2960
+ I(" " + x(e.$td("startupCrash.inspect", "View error details")), 1)
2961
+ ]),
2962
+ _: 1
2963
+ }),
2964
+ p(q, {
2965
+ variant: "danger",
2966
+ onClick: r[2] || (r[2] = (a) => s())
2967
+ }, {
2968
+ default: f(() => [
2969
+ p(o(la)),
2970
+ I(" " + x(e.$td("startupCrash.purge", "Purge device")), 1)
2971
+ ]),
2972
+ _: 1
2973
+ }),
2974
+ p(q, {
2975
+ variant: "danger",
2976
+ onClick: r[3] || (r[3] = (a) => e.$errors.debug = !e.$errors.debug)
2977
+ }, {
2978
+ default: f(() => [
2979
+ p(o(ua)),
2980
+ I(" " + x(e.$td("startupCrash.debug", "Toggle debugging")), 1)
2981
+ ]),
2982
+ _: 1
2983
+ })
2984
+ ])
2985
+ ])
2986
+ ]);
2987
+ };
2988
+ }
2989
+ }), kt = /* @__PURE__ */ g({
2990
+ __name: "HeadlessToastAction",
2991
+ props: {
2992
+ action: {}
2993
+ },
2994
+ setup(t) {
2995
+ return (s, e) => (u(), h(W(s.action.dismiss ? o(Ss) : "button"), {
2996
+ type: "button",
2997
+ onClick: s.action.click
2998
+ }, {
2999
+ default: f(() => [
3000
+ I(x(s.action.label), 1)
3001
+ ]),
3002
+ _: 1
3003
+ }, 8, ["onClick"]));
3004
+ }
3005
+ }), ba = { key: 0 }, ya = /* @__PURE__ */ g({
3006
+ __name: "HeadlessToast",
3007
+ props: {
3008
+ message: {},
3009
+ actions: {},
3010
+ variant: {}
3011
+ },
3012
+ setup(t) {
3013
+ return (s, e) => (u(), h(o(Ts), null, {
3014
+ default: f(() => [
3015
+ w(s.$slots, "default", {}, () => [
3016
+ s.message ? (u(), b("span", ba, x(s.message), 1)) : T("", !0),
3017
+ (u(!0), b(D, null, F(s.actions, (r, n) => (u(), h(kt, {
3018
+ key: n,
3019
+ action: r
3020
+ }, null, 8, ["action"]))), 128))
3021
+ ])
3022
+ ]),
3023
+ _: 3
3024
+ }));
3025
+ }
3026
+ }), wa = /* @__PURE__ */ g({
3027
+ __name: "Toast",
3028
+ props: {
3029
+ message: {},
3030
+ actions: {},
3031
+ variant: { default: "secondary" },
3032
+ class: {}
3033
+ },
3034
+ setup(t, { expose: s }) {
3035
+ const e = c(() => et(
3036
+ { baseClasses: t.class, variant: t.variant },
3037
+ {
3038
+ baseClasses: "flex items-center gap-2 rounded-md p-2 ring-1 shadow-lg border-gray-200",
3039
+ variants: {
3040
+ variant: {
3041
+ secondary: "bg-gray-900 text-white ring-black",
3042
+ danger: "bg-red-50 text-red-900 ring-red-100"
3043
+ }
3044
+ },
3045
+ defaultVariants: {
3046
+ variant: "secondary"
3047
+ }
3048
+ }
3049
+ ));
3050
+ return s(), (r, n) => (u(), h(ya, {
3051
+ class: k(e.value)
3052
+ }, {
3053
+ default: f(() => [
3054
+ r.message ? (u(), h(P, {
3055
+ key: 0,
3056
+ text: r.message,
3057
+ inline: ""
3058
+ }, null, 8, ["text"])) : T("", !0),
3059
+ (u(!0), b(D, null, F(r.actions, (a, i) => (u(), h(q, {
3060
+ key: i,
3061
+ action: a,
3062
+ variant: r.variant,
3063
+ as: kt
3064
+ }, null, 8, ["action", "variant"]))), 128))
3065
+ ]),
3066
+ _: 1
3067
+ }, 8, ["class"]));
3068
+ }
3069
+ }), $a = { $ui: z }, _a = {
3070
+ async install(t, s) {
3071
+ const e = {
3072
+ "alert-modal": tn,
3073
+ "confirm-modal": un,
3074
+ "error-report-modal": Pn,
3075
+ "loading-modal": Nn,
3076
+ "prompt-modal": ea,
3077
+ "startup-crash": va,
3078
+ toast: wa,
3079
+ ...s.components
3080
+ };
3081
+ for (const [r, n] of Object.entries(e))
3082
+ z.registerComponent(r, n);
3083
+ await $e(t, $a);
3084
+ }
3085
+ };
3086
+ async function xa(t, s = {}) {
3087
+ var r;
3088
+ const e = [Fr, ar, Br, Tr, ur, _a, ...s.plugins ?? []];
3089
+ A.instance = t, await Fs(e, t, s), await ((r = s.install) == null ? void 0 : r.call(s, t)), await R.emit("application-ready");
3090
+ }
3091
+ async function Ll(t, s = {}) {
3092
+ var r;
3093
+ const e = Pt(t);
3094
+ J() && (window.$aerogel = e), await xa(e, s), e.mount("#app"), (r = e._container) == null || r.classList.remove("loading"), await R.emit("application-mounted");
3095
+ }
3096
+ const Ca = { key: 0 }, ka = /* @__PURE__ */ g({
3097
+ __name: "AppModals",
3098
+ setup(t) {
3099
+ const s = c(() => z.modals[0] ?? null);
3100
+ return (e, r) => s.value ? (u(), b("aside", Ca, [
3101
+ p(wt, {
3102
+ "child-index": 1,
3103
+ modal: s.value
3104
+ }, null, 8, ["modal"])
3105
+ ])) : T("", !0);
3106
+ }
3107
+ }), Sa = /* @__PURE__ */ g({
3108
+ __name: "AppToasts",
3109
+ setup(t) {
3110
+ return (s, e) => (u(), h(o(Ms), null, {
3111
+ default: f(() => [
3112
+ (u(!0), b(D, null, F(s.$ui.toasts, (r) => (u(), h(W(r.component), H({
3113
+ id: r.id,
3114
+ key: r.id,
3115
+ ref_for: !0
3116
+ }, r.properties), null, 16, ["id"]))), 128)),
3117
+ p(o(Hs), { class: "fixed right-0 bottom-0 z-50 flex flex-col items-end space-y-4 px-4 py-6 sm:p-6" })
3118
+ ]),
3119
+ _: 1
3120
+ }));
3121
+ }
3122
+ }), Ta = /* @__PURE__ */ g({
3123
+ __name: "AppOverlays",
3124
+ setup(t) {
3125
+ return (s, e) => (u(), b(D, null, [
3126
+ p(ka),
3127
+ p(Sa)
3128
+ ], 64));
3129
+ }
3130
+ }), Ma = { class: "flex min-h-full flex-col text-base leading-tight font-normal text-gray-900 antialiased" }, Il = /* @__PURE__ */ g({
3131
+ __name: "AppLayout",
3132
+ setup(t) {
3133
+ return (s, e) => (u(), b("div", Ma, [
3134
+ s.$errors.hasStartupErrors ? w(s.$slots, "startup-crash", { key: 0 }, () => [
3135
+ (u(), h(W(s.$ui.requireComponent("startup-crash"))))
3136
+ ]) : w(s.$slots, "default", { key: 1 }),
3137
+ p(Ta)
3138
+ ]));
3139
+ }
3140
+ }), Ha = ["id", "name", "value", "required", "aria-invalid", "aria-describedby"], Ea = /* @__PURE__ */ g({
3141
+ __name: "HeadlessInputTextArea",
3142
+ setup(t) {
3143
+ const s = G("$textAreaRef"), e = V(
3144
+ "input",
3145
+ "<HeadlessInputTextArea> must be a child of a <HeadlessInput>"
3146
+ ), r = c(() => e.name ?? void 0), n = c(() => e.value);
3147
+ function a() {
3148
+ s.value && e.update(s.value.value);
3149
+ }
3150
+ return st(e, () => {
3151
+ var i;
3152
+ return (i = s.value) == null ? void 0 : i.focus();
3153
+ }), (i, l) => (u(), b("textarea", {
3154
+ id: o(e).id,
3155
+ ref: "$textAreaRef",
3156
+ name: r.value,
3157
+ value: n.value,
3158
+ required: o(e).required ?? void 0,
3159
+ "aria-invalid": o(e).errors ? "true" : "false",
3160
+ "aria-describedby": o(e).errors ? `${o(e).id}-error` : o(e).description ? `${o(e).id}-description` : void 0,
3161
+ onInput: a
3162
+ }, null, 40, Ha));
3163
+ }
3164
+ }), Va = { class: "group" }, La = { class: "-ml-2 flex w-[max-content] items-center rounded-lg py-2 pr-3 pl-1 hover:bg-gray-100 focus-visible:outline focus-visible:outline-gray-700" }, Ia = { class: "pt-2 pl-4" }, ql = /* @__PURE__ */ g({
3165
+ __name: "AdvancedOptions",
3166
+ setup(t) {
3167
+ return (s, e) => (u(), b("details", Va, [
3168
+ y("summary", La, [
3169
+ p(o(_t), { class: "size-6 transition-transform group-open:rotate-90" }),
3170
+ y("span", null, x(s.$td("ui.advancedOptions", "Advanced options")), 1)
3171
+ ]),
3172
+ y("div", Ia, [
3173
+ w(s.$slots, "default")
3174
+ ])
3175
+ ]));
3176
+ }
3177
+ }), qa = { class: "flex h-6 items-center" }, zl = /* @__PURE__ */ g({
3178
+ inheritAttrs: !1,
3179
+ __name: "Checkbox",
3180
+ props: {
3181
+ name: {},
3182
+ label: {},
3183
+ description: {},
3184
+ modelValue: {},
3185
+ inputClass: {},
3186
+ labelClass: {}
3187
+ },
3188
+ emits: ["update:modelValue"],
3189
+ setup(t) {
3190
+ const s = N(t, ["inputClass", "labelClass"]), e = G("$inputRef"), [r, n] = Ie(), a = c(() => M("relative flex items-start", n.value)), i = c(() => {
3191
+ var d, v;
3192
+ return M(
3193
+ "size-4 rounded text-primary-600 not-checked:hover:bg-gray-200 checked:hover:text-primary-500 checked:border-0",
3194
+ {
3195
+ "border-gray-300 focus:ring-primary-600": !((d = e.value) != null && d.errors),
3196
+ "border-red-400 border-2 focus:ring-red-600": (v = e.value) == null ? void 0 : v.errors
3197
+ },
3198
+ t.inputClass
3199
+ );
3200
+ }), l = c(() => M("ml-2 text-sm leading-6", t.labelClass));
3201
+ return (d, v) => (u(), h(ze, H({
3202
+ ref: "$inputRef",
3203
+ class: a.value
3204
+ }, s, {
3205
+ "onUpdate:modelValue": v[0] || (v[0] = ($) => d.$emit("update:modelValue", $))
3206
+ }), {
3207
+ default: f(() => [
3208
+ y("div", qa, [
3209
+ p(xt, H(o(r), {
3210
+ type: "checkbox",
3211
+ class: i.value
3212
+ }), null, 16, ["class"])
3213
+ ]),
3214
+ d.$slots.default ? (u(), b("div", {
3215
+ key: 0,
3216
+ class: k(l.value)
3217
+ }, [
3218
+ p(fe, { class: "text-gray-900" }, {
3219
+ default: f(() => [
3220
+ w(d.$slots, "default")
3221
+ ]),
3222
+ _: 3
3223
+ }),
3224
+ p(he, { class: "text-red-600" })
3225
+ ], 2)) : d.label ? (u(), b("div", {
3226
+ key: 1,
3227
+ class: k(l.value)
3228
+ }, [
3229
+ p(fe, { class: "text-gray-900" }),
3230
+ p(he, { class: "text-red-600" })
3231
+ ], 2)) : T("", !0)
3232
+ ]),
3233
+ _: 3
3234
+ }, 16, ["class"]));
3235
+ }
3236
+ }), za = /* @__PURE__ */ g({
3237
+ __name: "DropdownMenuOption",
3238
+ props: {
3239
+ class: {},
3240
+ asChild: { type: Boolean },
3241
+ as: {}
3242
+ },
3243
+ emits: ["select"],
3244
+ setup(t) {
3245
+ const s = N(t, ["class"]), e = c(() => M(
3246
+ "flex w-full items-center gap-2 rounded-lg px-2 py-2 text-sm text-gray-900 data-[highlighted]:bg-gray-100",
3247
+ t.class
3248
+ ));
3249
+ return (r, n) => (u(), h(o(Es), H({ class: e.value }, s, {
3250
+ onSelect: n[0] || (n[0] = (a) => r.$emit("select"))
3251
+ }), {
3252
+ default: f(() => [
3253
+ w(r.$slots, "default")
3254
+ ]),
3255
+ _: 3
3256
+ }, 16, ["class"]));
3257
+ }
3258
+ }), Ra = /* @__PURE__ */ g({
3259
+ __name: "DropdownMenuOptions",
3260
+ setup(t) {
3261
+ const s = V(
3262
+ "dropdown-menu",
3263
+ "<DropdownMenuOptions> must be a child of a <DropdownMenu>"
3264
+ );
3265
+ return (e, r) => (u(), h(o(Vs), {
3266
+ class: "gap-y-0.5 rounded-lg bg-white p-1.5 shadow-lg ring-1 ring-black/5",
3267
+ align: o(s).align,
3268
+ side: o(s).side
3269
+ }, {
3270
+ default: f(() => [
3271
+ w(e.$slots, "default", {}, () => [
3272
+ (u(!0), b(D, null, F(o(s).options, (n, a) => (u(), h(za, H(
3273
+ {
3274
+ key: a,
3275
+ as: n.route || n.href ? ct : void 0,
3276
+ class: n.class,
3277
+ ref_for: !0
3278
+ },
3279
+ n.route || n.href ? {
3280
+ href: n.href,
3281
+ route: n.route,
3282
+ routeParams: n.routeParams,
3283
+ routeQuery: n.routeQuery
3284
+ } : {},
3285
+ {
3286
+ onSelect: (i) => {
3287
+ var l;
3288
+ return (l = n.click) == null ? void 0 : l.call(n);
3289
+ }
3290
+ }
3291
+ ), {
3292
+ default: f(() => [
3293
+ I(x(n.label), 1)
3294
+ ]),
3295
+ _: 2
3296
+ }, 1040, ["as", "class", "onSelect"]))), 128))
3297
+ ])
3298
+ ]),
3299
+ _: 3
3300
+ }, 8, ["align", "side"]));
3301
+ }
3302
+ }), Rl = /* @__PURE__ */ g({
3303
+ __name: "DropdownMenu",
3304
+ props: {
3305
+ align: {},
3306
+ side: {},
3307
+ options: {}
3308
+ },
3309
+ setup(t, { expose: s }) {
3310
+ const e = {
3311
+ align: t.align,
3312
+ side: t.side,
3313
+ options: c(() => {
3314
+ var r;
3315
+ return (r = t.options) == null ? void 0 : r.filter(Boolean);
3316
+ })
3317
+ };
3318
+ return le("dropdown-menu", e), s(e), (r, n) => (u(), h(o(Ls), null, {
3319
+ default: f(() => [
3320
+ p(o(Is), null, {
3321
+ default: f(() => [
3322
+ w(r.$slots, "default")
3323
+ ]),
3324
+ _: 3
3325
+ }),
3326
+ p(o(qs), null, {
3327
+ default: f(() => [
3328
+ w(r.$slots, "options", {}, () => [
3329
+ p(Ra)
3330
+ ])
3331
+ ]),
3332
+ _: 3
3333
+ })
3334
+ ]),
3335
+ _: 3
3336
+ }));
3337
+ }
3338
+ }), Pa = ["aria-hidden"], Aa = ["tabindex", "aria-label", "type"], Pl = /* @__PURE__ */ g({
3339
+ __name: "EditableContent",
3340
+ props: {
3341
+ type: { default: "text" },
3342
+ contentClass: {},
3343
+ ariaLabel: {},
3344
+ formAriaHidden: { type: Boolean },
3345
+ tabindex: {},
3346
+ text: {},
3347
+ disabled: { type: Boolean }
3348
+ },
3349
+ emits: ["update", "save"],
3350
+ setup(t, { emit: s }) {
3351
+ const e = s, r = G("$inputRef"), n = U(null), a = U(t.text), i = c(() => M("inline whitespace-pre", t.contentClass)), l = c(() => M("invisible whitespace-pre", t.contentClass)), d = c(() => M("absolute inset-0 h-full w-full resize-none border-0 bg-transparent p-0 focus:ring-0", t.contentClass));
3352
+ function v() {
3353
+ n.value = t.text;
3354
+ }
3355
+ function $() {
3356
+ n.value && (t.type !== "number" && a.value.trim().length === 0 && (a.value = n.value, e("update", a.value)), n.value = null, e("save"));
3357
+ }
3358
+ return Y(() => a.value = t.text), (m, C) => (u(), b("div", {
3359
+ class: k(["relative", { "pointer-events-none!": m.disabled && !n.value }])
3360
+ }, [
3361
+ n.value ? (u(), b("span", {
3362
+ key: 1,
3363
+ class: k(l.value)
3364
+ }, x(a.value), 3)) : (u(), b("div", {
3365
+ key: 0,
3366
+ class: k(i.value)
3367
+ }, [
3368
+ w(m.$slots, "default")
3369
+ ], 2)),
3370
+ m.type === "number" ? (u(), b("span", {
3371
+ key: 2,
3372
+ class: k(["inline-block transition-[width]", n.value ? "w-5" : "w-0"])
3373
+ }, null, 2)) : T("", !0),
3374
+ y("form", {
3375
+ class: "w-full",
3376
+ "aria-hidden": m.formAriaHidden,
3377
+ onSubmit: C[4] || (C[4] = We((L) => {
3378
+ var _e;
3379
+ return (_e = r.value) == null ? void 0 : _e.blur();
3380
+ }, ["prevent"]))
3381
+ }, [
3382
+ Ke(y("input", {
3383
+ ref: "$inputRef",
3384
+ "onUpdate:modelValue": C[0] || (C[0] = (L) => a.value = L),
3385
+ tabindex: m.tabindex ?? void 0,
3386
+ "aria-label": m.ariaLabel ?? void 0,
3387
+ type: m.type,
3388
+ class: k([
3389
+ d.value,
3390
+ { "opacity-0": !n.value, "appearance-textfield": !n.value && m.type === "number" }
3391
+ ]),
3392
+ onKeyup: C[1] || (C[1] = (L) => m.$emit("update", a.value)),
3393
+ onFocus: C[2] || (C[2] = (L) => v()),
3394
+ onBlur: C[3] || (C[3] = (L) => $())
3395
+ }, null, 42, Aa), [
3396
+ [At, a.value]
3397
+ ])
3398
+ ], 40, Pa)
3399
+ ], 2));
3400
+ }
3401
+ }), Da = {
3402
+ viewBox: "0 0 512 512",
3403
+ width: "1.2em",
3404
+ height: "1.2em"
3405
+ };
3406
+ function ja(t, s) {
3407
+ return u(), b("svg", Da, s[0] || (s[0] = [
3408
+ y("path", {
3409
+ fill: "currentColor",
3410
+ d: "M449.07 399.08L278.64 82.58c-12.08-22.44-44.26-22.44-56.35 0L51.87 399.08A32 32 0 0 0 80 446.25h340.89a32 32 0 0 0 28.18-47.17m-198.6-1.83a20 20 0 1 1 20-20a20 20 0 0 1-20 20m21.72-201.15l-5.74 122a16 16 0 0 1-32 0l-5.74-121.95a21.73 21.73 0 0 1 21.5-22.69h.21a21.74 21.74 0 0 1 21.73 22.7Z"
3411
+ }, null, -1)
3412
+ ]));
3413
+ }
3414
+ const Ba = E({ name: "ion-warning", render: ja }), Fa = {
3415
+ viewBox: "0 0 20 20",
3416
+ width: "1.2em",
3417
+ height: "1.2em"
3418
+ };
3419
+ function Ua(t, s) {
3420
+ return u(), b("svg", Fa, s[0] || (s[0] = [
3421
+ y("path", {
3422
+ fill: "currentColor",
3423
+ d: "M.2 10a11 11 0 0 1 19.6 0A11 11 0 0 1 .2 10m9.8 4a4 4 0 1 0 0-8a4 4 0 0 0 0 8m0-2a2 2 0 1 1 0-4a2 2 0 0 1 0 4"
3424
+ }, null, -1)
3425
+ ]));
3426
+ }
3427
+ const Oa = E({ name: "zondicons-view-show", render: Ua }), Na = { class: "font-medium" }, Wa = ["datetime"], Ka = /* @__PURE__ */ g({
3428
+ __name: "ErrorLogsModal",
3429
+ setup(t) {
3430
+ return (s, e) => (u(), h(se, {
3431
+ title: s.$td("errors.report", "Errors ({count})", { count: s.$errors.logs.length })
3432
+ }, {
3433
+ default: f(() => [
3434
+ y("ol", null, [
3435
+ (u(!0), b(D, null, F(s.$errors.logs, (r, n) => (u(), b("li", {
3436
+ key: n,
3437
+ class: "mb-2 flex max-w-prose min-w-56 justify-between py-2 last:mb-0"
3438
+ }, [
3439
+ y("div", null, [
3440
+ y("h3", Na, x(r.report.title), 1),
3441
+ y("time", {
3442
+ datetime: r.date.toISOString(),
3443
+ class: "text-xs text-gray-700"
3444
+ }, x(r.date.toLocaleTimeString()), 9, Wa),
3445
+ p(P, {
3446
+ class: "text-sm text-gray-500",
3447
+ text: r.report.description ?? o(yt)(r.report)
3448
+ }, null, 8, ["text"])
3449
+ ]),
3450
+ p(q, {
3451
+ size: "icon",
3452
+ variant: "ghost",
3453
+ "aria-label": s.$td("errors.viewDetails", "View details"),
3454
+ title: s.$td("errors.viewDetails", "View details"),
3455
+ class: "self-center",
3456
+ onClick: (a) => s.$errors.inspect(
3457
+ r.report,
3458
+ s.$errors.logs.map(({ report: i }) => i)
3459
+ )
3460
+ }, {
3461
+ default: f(() => [
3462
+ p(o(Oa), {
3463
+ class: "size-4",
3464
+ "aria-hidden": "true"
3465
+ })
3466
+ ]),
3467
+ _: 2
3468
+ }, 1032, ["aria-label", "title", "onClick"])
3469
+ ]))), 128))
3470
+ ])
3471
+ ]),
3472
+ _: 1
3473
+ }, 8, ["title"]));
3474
+ }
3475
+ }), Al = /* @__PURE__ */ g({
3476
+ __name: "ErrorLogs",
3477
+ setup(t) {
3478
+ return (s, e) => s.$errors.logs.length > 0 ? (u(), h(q, {
3479
+ key: 0,
3480
+ size: "icon",
3481
+ variant: "ghost",
3482
+ title: s.$td("errors.viewLogs", "View error logs"),
3483
+ "aria-label": s.$td("errors.viewLogs", "View error logs"),
3484
+ onClick: e[0] || (e[0] = (r) => s.$ui.modal(Ka))
3485
+ }, {
3486
+ default: f(() => [
3487
+ p(o(Ba), { class: "size-6 text-red-500" })
3488
+ ]),
3489
+ _: 1
3490
+ }, 8, ["title", "aria-label"])) : T("", !0);
3491
+ }
3492
+ }), Dl = /* @__PURE__ */ g({
3493
+ __name: "ErrorMessage",
3494
+ props: {
3495
+ error: {}
3496
+ },
3497
+ setup(t) {
3498
+ const s = c(() => yt(t.error));
3499
+ return (e, r) => (u(), h(P, {
3500
+ text: s.value,
3501
+ inline: ""
3502
+ }, null, 8, ["text"]));
3503
+ }
3504
+ }), jl = /* @__PURE__ */ g({
3505
+ __name: "Link",
3506
+ props: {
3507
+ class: {},
3508
+ disabled: { type: Boolean },
3509
+ href: {},
3510
+ route: {},
3511
+ routeParams: {},
3512
+ routeQuery: {},
3513
+ size: {},
3514
+ submit: { type: Boolean },
3515
+ asChild: { type: Boolean },
3516
+ as: {}
3517
+ },
3518
+ setup(t) {
3519
+ return (s, e) => (u(), h(q, H({ variant: "link" }, s.$props), {
3520
+ default: f(() => [
3521
+ w(s.$slots, "default")
3522
+ ]),
3523
+ _: 3
3524
+ }, 16));
3525
+ }
3526
+ }), Bl = /* @__PURE__ */ g({
3527
+ __name: "SettingsModal",
3528
+ setup(t) {
3529
+ const s = c(() => Zt(A.settings, "priority", "desc"));
3530
+ return (e, r) => (u(), h(se, {
3531
+ title: e.$td("settings.title", "Settings")
3532
+ }, {
3533
+ default: f(() => [
3534
+ (u(!0), b(D, null, F(s.value, (n, a) => (u(), h(W(n.component), { key: a }))), 128))
3535
+ ]),
3536
+ _: 1
3537
+ }, 8, ["title"]));
3538
+ }
3539
+ }), Qa = {
3540
+ key: 0,
3541
+ class: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3"
3542
+ }, Fl = /* @__PURE__ */ g({
3543
+ inheritAttrs: !1,
3544
+ __name: "TextArea",
3545
+ props: {
3546
+ name: {},
3547
+ label: {},
3548
+ description: {},
3549
+ modelValue: {},
3550
+ inputClass: {},
3551
+ wrapperClass: {}
3552
+ },
3553
+ emits: ["update:modelValue"],
3554
+ setup(t) {
3555
+ const s = N(t, ["label", "inputClass", "wrapperClass"]), e = G("$inputRef"), [r, n] = Ie(), a = c(() => M("relative rounded-md shadow-2xs", { "mt-1": t.label }, t.wrapperClass)), i = c(() => {
3556
+ var l, d, v;
3557
+ return M(
3558
+ // eslint-disable-next-line vue/max-len
3559
+ "block w-full rounded-md border-0 py-1.5 ring-1 ring-inset focus:ring-2 focus:ring-inset sm:text-sm sm:leading-6",
3560
+ {
3561
+ "focus:ring-primary-600": !((l = e.value) != null && l.errors),
3562
+ "text-gray-900 shadow-2xs ring-gray-900/10 placeholder:text-gray-400": !((d = e.value) != null && d.errors),
3563
+ "pr-10 text-red-900 ring-red-900/10 placeholder:text-red-300 focus:ring-red-500": (v = e.value) == null ? void 0 : v.errors
3564
+ },
3565
+ t.inputClass
3566
+ );
3567
+ });
3568
+ return (l, d) => (u(), h(ze, H({
3569
+ ref: "$inputRef",
3570
+ label: l.label,
3571
+ class: o(n)
3572
+ }, s, {
3573
+ "onUpdate:modelValue": d[0] || (d[0] = (v) => l.$emit("update:modelValue", v))
3574
+ }), {
3575
+ default: f(() => {
3576
+ var v;
3577
+ return [
3578
+ p(fe, { class: "block text-sm leading-6 font-medium text-gray-900" }),
3579
+ y("div", {
3580
+ class: k(a.value)
3581
+ }, [
3582
+ p(Ea, H(o(r), { class: i.value }), null, 16, ["class"]),
3583
+ (v = e.value) != null && v.errors ? (u(), b("div", Qa, [
3584
+ p(o(qe), { class: "size-5 text-red-500" })
3585
+ ])) : T("", !0)
3586
+ ], 2),
3587
+ p(Ct, { class: "mt-2 text-sm text-gray-600" }),
3588
+ p(he, { class: "mt-2 text-sm text-red-600" })
3589
+ ];
3590
+ }),
3591
+ _: 1
3592
+ }, 16, ["label", "class"]));
3593
+ }
3594
+ });
3595
+ class Ul {
3596
+ constructor() {
3597
+ _(this, "status");
3598
+ _(this, "_listeners");
3599
+ _(this, "_progress");
3600
+ _(this, "_cancelled");
3601
+ _(this, "_started");
3602
+ _(this, "_completed");
3603
+ this.status = this.getInitialStatus(), this._listeners = new Xt(), this._started = new K(), this._completed = new K();
3604
+ }
3605
+ async start() {
3606
+ this.beforeStart(), this._started.resolve();
3607
+ try {
3608
+ await this.updateProgress(), await this.run(), await this.updateProgress(), this._completed.resolve();
3609
+ } catch (s) {
3610
+ if (s instanceof Ue)
3611
+ return;
3612
+ throw ee(Yt(s), (e) => {
3613
+ this._completed.reject(e);
3614
+ });
3615
+ }
3616
+ }
3617
+ async cancel() {
3618
+ this._cancelled = new K(), await this._cancelled;
3619
+ }
3620
+ serialize() {
3621
+ return this.serializeStatus(this.status);
3622
+ }
3623
+ get listeners() {
3624
+ return this._listeners;
3625
+ }
3626
+ get progress() {
3627
+ return this._progress ?? 0;
3628
+ }
3629
+ get cancelled() {
3630
+ var s;
3631
+ return !!((s = this._cancelled) != null && s.isResolved());
3632
+ }
3633
+ get started() {
3634
+ return this._started;
3635
+ }
3636
+ get completed() {
3637
+ return this._completed;
3638
+ }
3639
+ getInitialStatus() {
3640
+ return { completed: !1 };
3641
+ }
3642
+ beforeStart() {
3643
+ if (this._started.isResolved()) {
3644
+ if (this._cancelled) {
3645
+ delete this._progress, delete this._cancelled;
3646
+ return;
3647
+ }
3648
+ throw new Error("Job already started!");
3649
+ }
3650
+ }
3651
+ assertNotCancelled() {
3652
+ if (this._cancelled)
3653
+ throw this._cancelled.resolve(), new Ue();
3654
+ }
3655
+ calculateCurrentProgress(s) {
3656
+ return s ?? (s = this.status), s.completed ? 1 : s.children ? Gt(
3657
+ s.children.reduce((e, r) => e + this.calculateCurrentProgress(r), 0) / s.children.length,
3658
+ 2
3659
+ ) : 0;
3660
+ }
3661
+ async updateProgress(s) {
3662
+ await (s == null ? void 0 : s(this.status));
3663
+ const e = this.calculateCurrentProgress();
3664
+ e !== this._progress && (this._progress = e, await this._listeners.emit("onUpdated", e));
3665
+ }
3666
+ serializeStatus(s) {
3667
+ return { ...s };
3668
+ }
3669
+ }
3670
+ async function Ol(t) {
3671
+ await t.start();
3672
+ }
3673
+ export {
3674
+ ql as AdvancedOptions,
3675
+ tn as AlertModal,
3676
+ A as App,
3677
+ Il as AppLayout,
3678
+ ka as AppModals,
3679
+ Ta as AppOverlays,
3680
+ Bs as AppService,
3681
+ Sa as AppToasts,
3682
+ q as Button,
3683
+ bl as Cache,
3684
+ lr as CacheService,
3685
+ zl as Checkbox,
3686
+ un as ConfirmModal,
3687
+ Rl as DropdownMenu,
3688
+ za as DropdownMenuOption,
3689
+ Ra as DropdownMenuOptions,
3690
+ Pl as EditableContent,
3691
+ Al as ErrorLogs,
3692
+ Ka as ErrorLogsModal,
3693
+ Dl as ErrorMessage,
3694
+ Pn as ErrorReportModal,
3695
+ Mn as ErrorReportModalButtons,
3696
+ Hn as ErrorReportModalTitle,
3697
+ ut as Errors,
3698
+ ol as EventListenerPriorities,
3699
+ R as Events,
3700
+ Ds as EventsService,
3701
+ $t as Form,
3702
+ Xs as FormController,
3703
+ ct as HeadlessButton,
3704
+ ze as HeadlessInput,
3705
+ Ct as HeadlessInputDescription,
3706
+ he as HeadlessInputError,
3707
+ xt as HeadlessInputInput,
3708
+ fe as HeadlessInputLabel,
3709
+ Ea as HeadlessInputTextArea,
3710
+ Wr as HeadlessModal,
3711
+ Kr as HeadlessModalContent,
3712
+ Qr as HeadlessModalDescription,
3713
+ Jr as HeadlessModalOverlay,
3714
+ Zr as HeadlessModalTitle,
3715
+ br as HeadlessSelect,
3716
+ Be as HeadlessSelectLabel,
3717
+ mt as HeadlessSelectOption,
3718
+ ft as HeadlessSelectOptions,
3719
+ pt as HeadlessSelectTrigger,
3720
+ dt as HeadlessSelectValue,
3721
+ qr as HeadlessSwitch,
3722
+ ya as HeadlessToast,
3723
+ Zn as Input,
3724
+ Ul as Job,
3725
+ Ue as JobCancelledError,
3726
+ Z as Lang,
3727
+ me as Layouts,
3728
+ jl as Link,
3729
+ Nn as LoadingModal,
3730
+ lt as MOBILE_BREAKPOINT,
3731
+ P as Markdown,
3732
+ se as Modal,
3733
+ wt as ModalContext,
3734
+ Un as ProgressBar,
3735
+ ea as PromptModal,
3736
+ _r as Select,
3737
+ ht as SelectLabel,
3738
+ Fe as SelectOption,
3739
+ gt as SelectOptions,
3740
+ vt as SelectTrigger,
3741
+ we as Service,
3742
+ Te as ServiceBootError,
3743
+ Lr as Setting,
3744
+ Bl as SettingsModal,
3745
+ va as StartupCrash,
3746
+ at as Storage,
3747
+ zr as Switch,
3748
+ Fl as TextArea,
3749
+ wa as Toast,
3750
+ z as UI,
3751
+ dr as UIService,
3752
+ pl as __valueType,
3753
+ zs as appNamespace,
3754
+ $l as booleanInput,
3755
+ $e as bootServices,
3756
+ Ll as bootstrap,
3757
+ xa as bootstrapApplication,
3758
+ M as classes,
3759
+ hl as computedAsync,
3760
+ gl as computedDebounce,
3761
+ _l as dateInput,
3762
+ cl as defineDirective,
3763
+ dl as defineFormValidationRule,
3764
+ ul as definePlugin,
3765
+ ye as defineServiceState,
3766
+ As as defineServiceStore,
3767
+ il as defineSettings,
3768
+ Ol as dispatch,
3769
+ xl as enumInput,
3770
+ ot as getCurrentLayout,
3771
+ yt as getErrorMessage,
3772
+ tr as getMarkdownRouter,
3773
+ Ps as getPiniaStore,
3774
+ vr as hasSelectOptionLabel,
3775
+ Ns as injectOrFail,
3776
+ Os as injectReactive,
3777
+ V as injectReactiveOrFail,
3778
+ Fs as installPlugins,
3779
+ Hl as numberInput,
3780
+ El as objectInput,
3781
+ ml as onCleanMounted,
3782
+ st as onFormFocus,
3783
+ fl as persistent,
3784
+ wl as registerErrorHandler,
3785
+ sr as renderMarkdown,
3786
+ Ge as renderVNode,
3787
+ yl as replaceExisting,
3788
+ Cl as requiredBooleanInput,
3789
+ kl as requiredDateInput,
3790
+ Sl as requiredEnumInput,
3791
+ Tl as requiredNumberInput,
3792
+ Ml as requiredObjectInput,
3793
+ Xn as requiredStringInput,
3794
+ Rs as resetPiniaStore,
3795
+ nt as safeHtml,
3796
+ vl as setMarkdownRouter,
3797
+ Vl as stringInput,
3798
+ it as translate,
3799
+ S as translateWithDefault,
3800
+ en as useAlertModal,
3801
+ sn as useConfirmModal,
3802
+ En as useErrorReportModal,
3803
+ tt as useEvent,
3804
+ rt as useForm,
3805
+ Ie as useInputAttrs,
3806
+ On as useLoadingModal,
3807
+ Yn as usePromptModal,
3808
+ Zs as validate,
3809
+ Js as validateType,
3810
+ de as validators,
3811
+ et as variantClasses
3812
+ };
3813
+ //# sourceMappingURL=aerogel-core.js.map