@speckle/ui-components 2.12.666

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 (40) hide show
  1. package/.eslintrc.cjs +118 -0
  2. package/README.md +60 -0
  3. package/dist/components/SourceAppBadge.vue.d.ts +14 -0
  4. package/dist/components/common/Badge.vue.d.ts +65 -0
  5. package/dist/components/common/loading/Bar.vue.d.ts +13 -0
  6. package/dist/components/common/steps/Bullet.vue.d.ts +65 -0
  7. package/dist/components/common/steps/Number.vue.d.ts +57 -0
  8. package/dist/components/common/text/Link.vue.d.ts +106 -0
  9. package/dist/components/form/Button.vue.d.ts +256 -0
  10. package/dist/components/form/CardButton.vue.d.ts +24 -0
  11. package/dist/components/form/Checkbox.vue.d.ts +194 -0
  12. package/dist/components/form/TextArea.vue.d.ts +152 -0
  13. package/dist/components/form/TextInput.vue.d.ts +301 -0
  14. package/dist/components/form/select/Base.vue.d.ts +283 -0
  15. package/dist/components/form/select/SourceApps.vue.d.ts +126 -0
  16. package/dist/components/global/ToastRenderer.vue.d.ts +17 -0
  17. package/dist/composables/common/steps.d.ts +24 -0
  18. package/dist/composables/form/input.d.ts +6 -0
  19. package/dist/composables/form/select.d.ts +29 -0
  20. package/dist/composables/form/textInput.d.ts +44 -0
  21. package/dist/composables/layout/resize.d.ts +36 -0
  22. package/dist/helpers/common/components.d.ts +11 -0
  23. package/dist/helpers/common/validation.d.ts +23 -0
  24. package/dist/helpers/form/input.d.ts +9 -0
  25. package/dist/helpers/global/toast.d.ts +22 -0
  26. package/dist/helpers/tailwind.d.ts +19 -0
  27. package/dist/lib.cjs +1 -0
  28. package/dist/lib.d.ts +24 -0
  29. package/dist/lib.js +2155 -0
  30. package/dist/style.css +1 -0
  31. package/index.html +12 -0
  32. package/package.json +99 -0
  33. package/postcss.config.js +7 -0
  34. package/tailwind.config.cjs +14 -0
  35. package/tsconfig.json +31 -0
  36. package/tsconfig.node.json +10 -0
  37. package/utils/tailwind-configure.cjs +15 -0
  38. package/utils/tailwind-configure.d.ts +1 -0
  39. package/utils/tailwind-configure.js +13 -0
  40. package/vite.config.ts +48 -0
package/dist/lib.js ADDED
@@ -0,0 +1,2155 @@
1
+ import { defineComponent as M, resolveDynamicComponent as D, computed as i, openBlock as a, createBlock as L, unref as t, normalizeClass as v, withCtx as F, createCommentVNode as $, renderSlot as E, createTextVNode as R, createElementBlock as f, createElementVNode as r, createVNode as O, Transition as ye, toDisplayString as w, toRefs as G, Fragment as q, renderList as Y, pushScopeId as ve, popScopeId as xe, ref as T, mergeProps as ae, onMounted as ke, withDirectives as J, isRef as Z, vModelText as Ce, useSlots as Le, vModelDynamic as je, watch as me, withModifiers as Oe, normalizeStyle as te } from "vue";
2
+ import { isObjectLike as ge, clamp as be, isString as Q, isUndefined as se, isArray as z, debounce as Pe } from "lodash";
3
+ import { CheckCircleIcon as Me, XCircleIcon as Ae, ExclamationCircleIcon as Fe, InformationCircleIcon as Te } from "@heroicons/vue/24/outline";
4
+ import { XMarkIcon as oe, CheckIcon as Re, CheckCircleIcon as ze, ExclamationCircleIcon as we, EnvelopeIcon as Ee, KeyIcon as De } from "@heroicons/vue/20/solid";
5
+ import { useField as re } from "vee-validate";
6
+ import { nanoid as ie } from "nanoid";
7
+ import { isNullOrUndefined as qe, SourceApps as Ue, getClientOperatingSystem as We, OperatingSystem as le } from "@speckle/shared";
8
+ import { useResizeObserver as He, useMutationObserver as Ke, onKeyDown as Xe } from "@vueuse/core";
9
+ import { Listbox as Ne, ListboxLabel as Ge, ListboxButton as Je, ListboxOptions as Qe, ListboxOption as Ye } from "@headlessui/vue";
10
+ import { ChevronUpIcon as Ze, ChevronDownIcon as et, XMarkIcon as tt, MagnifyingGlassIcon as st, CheckIcon as lt } from "@heroicons/vue/24/solid";
11
+ import { directive as nt } from "vue-tippy";
12
+ const at = {
13
+ key: 2,
14
+ style: { margin: "0 !important", width: "0.01px" }
15
+ }, ot = /* @__PURE__ */ M({
16
+ __name: "Button",
17
+ props: {
18
+ /**
19
+ * URL to which to navigate - can be a relative (app) path or an absolute link for an external URL
20
+ */
21
+ to: {
22
+ type: String,
23
+ required: !1,
24
+ default: void 0
25
+ },
26
+ /**
27
+ * Choose from one of many button sizes
28
+ */
29
+ size: {
30
+ type: String,
31
+ default: "base"
32
+ },
33
+ /**
34
+ * If set, will make the button take up all available space horizontally
35
+ */
36
+ fullWidth: {
37
+ type: Boolean,
38
+ default: !1
39
+ },
40
+ /**
41
+ * Will outline the button.
42
+ */
43
+ outlined: {
44
+ type: Boolean,
45
+ default: !1
46
+ },
47
+ /**
48
+ * Will apply a rounded class.
49
+ */
50
+ rounded: {
51
+ type: Boolean,
52
+ default: !1
53
+ },
54
+ /**
55
+ * Similar to "link", but without an underline and possibly in different colors
56
+ */
57
+ text: {
58
+ type: Boolean,
59
+ default: !1
60
+ },
61
+ /**
62
+ * Will remove paddings and background. Use for links.
63
+ */
64
+ link: {
65
+ type: Boolean,
66
+ default: !1
67
+ },
68
+ /**
69
+ * Colors:
70
+ * default: the default primary blue.
71
+ * invert: for when you want to use this button on a primary background.
72
+ * danger: for dangerous actions (e.g. deletions).
73
+ * warning: for less dangerous actions (e.g. archival).
74
+ */
75
+ color: {
76
+ type: String,
77
+ default: "default"
78
+ },
79
+ /**
80
+ * Whether the target location should be forcefully treated as an external URL
81
+ * (for relative paths this will likely cause a redirect)
82
+ */
83
+ external: {
84
+ type: Boolean,
85
+ required: !1,
86
+ default: void 0
87
+ },
88
+ /**
89
+ * Whether to disable the button so that it can't be pressed
90
+ */
91
+ disabled: {
92
+ type: Boolean,
93
+ required: !1,
94
+ default: void 0
95
+ },
96
+ /**
97
+ * If set, will have type set to "submit" to enable it to submit any parent forms
98
+ */
99
+ submit: {
100
+ type: Boolean,
101
+ default: !1
102
+ },
103
+ /**
104
+ * Add icon to the left from the text
105
+ */
106
+ iconLeft: {
107
+ type: [Object, Function],
108
+ default: null
109
+ },
110
+ /**
111
+ * Add icon to the right from the text
112
+ */
113
+ iconRight: {
114
+ type: [Object, Function],
115
+ default: null
116
+ },
117
+ /**
118
+ * Hide default slot (when you want to show icons only)
119
+ */
120
+ hideText: {
121
+ type: Boolean,
122
+ default: !1
123
+ },
124
+ /**
125
+ * Customize component to be used when rendering links.
126
+ *
127
+ * The component will try to dynamically resolve NuxtLink and RouterLink and use those, if this is set to null.
128
+ */
129
+ linkComponent: {
130
+ type: [Object, Function],
131
+ default: null
132
+ }
133
+ },
134
+ emits: ["click"],
135
+ setup(e, { emit: s }) {
136
+ const l = e, u = D("NuxtLink"), d = D("RouterLink"), c = i(() => l.linkComponent ? l.linkComponent : ge(u) ? u : ge(d) ? d : "a"), y = i(() => {
137
+ if (!l.to)
138
+ return l.submit ? "submit" : "button";
139
+ }), x = i(() => {
140
+ const n = [];
141
+ if (n.push("border-2"), l.disabled)
142
+ n.push(
143
+ l.outlined ? "border-foreground-disabled" : "bg-foundation-disabled border-transparent"
144
+ );
145
+ else
146
+ switch (l.color) {
147
+ case "invert":
148
+ n.push(
149
+ l.outlined ? "border-foundation dark:border-foreground" : "bg-foundation dark:bg-foreground border-transparent"
150
+ );
151
+ break;
152
+ case "card":
153
+ n.push(
154
+ l.outlined ? "border-foundation-2 shadow" : "bg-foundation-2 dark:bg-foundation-2 border-foundation shadow"
155
+ );
156
+ break;
157
+ case "danger":
158
+ n.push(l.outlined ? "border-danger" : "bg-danger border-danger");
159
+ break;
160
+ case "secondary":
161
+ n.push(
162
+ l.outlined ? "border-foundation" : "bg-foundation border-foundation-2"
163
+ );
164
+ break;
165
+ case "warning":
166
+ n.push(l.outlined ? "border-warning" : "bg-warning border-warning");
167
+ break;
168
+ case "success":
169
+ n.push(l.outlined ? "border-success" : "bg-success border-success");
170
+ break;
171
+ case "default":
172
+ default:
173
+ n.push(
174
+ l.outlined ? "border-primary hover:border-primary-focus" : "bg-primary hover:bg-primary-focus border-transparent"
175
+ );
176
+ break;
177
+ }
178
+ return n.join(" ");
179
+ }), g = i(() => {
180
+ const n = [];
181
+ if (!l.text && !l.link)
182
+ if (l.disabled)
183
+ n.push(
184
+ (l.outlined, "text-foreground-disabled")
185
+ );
186
+ else
187
+ switch (l.color) {
188
+ case "invert":
189
+ n.push(
190
+ l.outlined ? "text-foundation dark:text-foreground" : "text-primary"
191
+ );
192
+ break;
193
+ case "card":
194
+ n.push((l.outlined, "text-foreground"));
195
+ break;
196
+ case "danger":
197
+ n.push(
198
+ l.outlined ? "text-danger" : "text-foundation dark:text-foreground"
199
+ );
200
+ break;
201
+ case "warning":
202
+ n.push(
203
+ l.outlined ? "text-warning" : "text-foundation dark:text-foreground"
204
+ );
205
+ break;
206
+ case "success":
207
+ n.push(
208
+ l.outlined ? "text-success" : "text-foundation dark:text-foreground"
209
+ );
210
+ break;
211
+ case "secondary":
212
+ n.push(
213
+ (l.outlined, "text-foreground hover:text-primary")
214
+ );
215
+ break;
216
+ case "default":
217
+ default:
218
+ n.push(
219
+ l.outlined ? "text-primary hover:text-primary-focus" : "text-foundation dark:text-foreground"
220
+ );
221
+ break;
222
+ }
223
+ else
224
+ l.disabled ? n.push("text-foreground-disabled") : l.color === "invert" ? n.push(
225
+ "text-foundation hover:text-foundation-2 dark:text-foreground dark:hover:text-foreground"
226
+ ) : l.color === "secondary" ? n.push("text-foreground-2 hover:text-primary-focus") : l.color === "success" ? n.push("text-success") : l.color === "warning" ? n.push("text-warning") : l.color === "danger" ? n.push("text-danger") : n.push("text-primary hover:text-primary-focus");
227
+ return n.join(" ");
228
+ }), o = i(() => {
229
+ const n = [];
230
+ return n.push(l.rounded ? "rounded-full" : "rounded-md"), n.join(" ");
231
+ }), C = i(() => {
232
+ const n = [];
233
+ if (!l.disabled)
234
+ switch (l.color) {
235
+ case "invert":
236
+ n.push("hover:ring-4 ring-white/50");
237
+ break;
238
+ case "danger":
239
+ n.push("hover:ring-4 ring-danger-lighter dark:ring-danger-darker");
240
+ break;
241
+ case "warning":
242
+ n.push("hover:ring-4 ring-warning-lighter dark:ring-warning-darker");
243
+ break;
244
+ case "success":
245
+ n.push("hover:ring-4 ring-success-lighter dark:ring-success-darker");
246
+ break;
247
+ case "default":
248
+ default:
249
+ n.push("hover:ring-2");
250
+ break;
251
+ }
252
+ return n.join(" ");
253
+ }), p = i(() => {
254
+ switch (l.size) {
255
+ case "xs":
256
+ return "h-5 text-xs font-medium xxx-tracking-wide";
257
+ case "sm":
258
+ return "h-6 text-sm font-medium xxx-tracking-wide";
259
+ case "lg":
260
+ return "h-10 text-lg font-semibold xxx-tracking-wide";
261
+ case "xl":
262
+ return "h-14 text-xl font-bold xxx-tracking-wide";
263
+ default:
264
+ case "base":
265
+ return "h-8 text-base font-medium xxx-tracking-wide";
266
+ }
267
+ }), m = i(() => {
268
+ switch (l.size) {
269
+ case "xs":
270
+ return "px-1";
271
+ case "sm":
272
+ return "px-2";
273
+ case "lg":
274
+ return "px-4";
275
+ case "xl":
276
+ return "px-5";
277
+ default:
278
+ case "base":
279
+ return "px-3";
280
+ }
281
+ }), k = i(() => {
282
+ const n = [];
283
+ return l.fullWidth && n.push("w-full"), l.disabled && n.push("cursor-not-allowed"), n.join(" ");
284
+ }), V = i(() => {
285
+ const n = [];
286
+ return !l.disabled && !l.link && !l.text && n.push("active:scale-[0.97]"), !l.disabled && l.link && n.push(
287
+ "underline decoration-transparent decoration-2 underline-offset-4 hover:decoration-inherit"
288
+ ), n.join(" ");
289
+ }), b = i(() => {
290
+ const n = l.link || l.text;
291
+ return [
292
+ "transition inline-flex justify-center items-center space-x-2 outline-none select-none",
293
+ k.value,
294
+ p.value,
295
+ g.value,
296
+ n ? "" : x.value,
297
+ n ? "" : o.value,
298
+ n ? "" : C.value,
299
+ l.link ? "" : m.value,
300
+ V.value
301
+ ].join(" ");
302
+ }), S = i(() => {
303
+ const n = [""];
304
+ switch (l.size) {
305
+ case "xs":
306
+ n.push("h-3 w-3");
307
+ break;
308
+ case "sm":
309
+ n.push("h-4 w-4");
310
+ break;
311
+ case "lg":
312
+ n.push("h-6 w-6");
313
+ break;
314
+ case "xl":
315
+ n.push("h-8 w-8");
316
+ break;
317
+ case "base":
318
+ default:
319
+ n.push("h-5 w-5");
320
+ break;
321
+ }
322
+ return n.join(" ");
323
+ }), _ = (n) => {
324
+ if (l.disabled) {
325
+ n.preventDefault(), n.stopPropagation(), n.stopImmediatePropagation();
326
+ return;
327
+ }
328
+ s("click", n);
329
+ };
330
+ return (n, H) => (a(), L(D(e.to ? t(c) : "button"), {
331
+ href: e.to,
332
+ to: e.to,
333
+ type: t(y),
334
+ external: e.external,
335
+ class: v(t(b)),
336
+ disabled: e.disabled,
337
+ role: "button",
338
+ onClick: _
339
+ }, {
340
+ default: F(() => [
341
+ e.iconLeft ? (a(), L(D(e.iconLeft), {
342
+ key: 0,
343
+ class: v(`${t(S)} ${e.hideText ? "" : "mr-2"}`)
344
+ }, null, 8, ["class"])) : $("", !0),
345
+ e.hideText ? (a(), f("div", at, "   ")) : E(n.$slots, "default", { key: 1 }, () => [
346
+ R("Button")
347
+ ], !0),
348
+ e.iconRight ? (a(), L(D(e.iconRight), {
349
+ key: 3,
350
+ class: v(`${t(S)} ${e.hideText ? "" : "ml-2"}`)
351
+ }, null, 8, ["class"])) : $("", !0)
352
+ ]),
353
+ _: 3
354
+ }, 8, ["href", "to", "type", "external", "class", "disabled"]));
355
+ }
356
+ });
357
+ const ue = (e, s) => {
358
+ const l = e.__vccOpts || e;
359
+ for (const [u, d] of s)
360
+ l[u] = d;
361
+ return l;
362
+ }, rt = /* @__PURE__ */ ue(ot, [["__scopeId", "data-v-c331f2ef"]]), it = /* @__PURE__ */ M({
363
+ __name: "Link",
364
+ props: {
365
+ to: {
366
+ type: String,
367
+ required: !1,
368
+ default: void 0
369
+ },
370
+ external: {
371
+ type: Boolean,
372
+ required: !1,
373
+ default: void 0
374
+ },
375
+ disabled: {
376
+ type: Boolean,
377
+ required: !1,
378
+ default: void 0
379
+ },
380
+ size: {
381
+ type: String,
382
+ default: "base"
383
+ },
384
+ foregroundLink: {
385
+ type: Boolean,
386
+ default: !1
387
+ },
388
+ /**
389
+ * Add icon to the left from the text
390
+ */
391
+ iconLeft: {
392
+ type: [Object, Function],
393
+ default: null
394
+ },
395
+ /**
396
+ * Add icon to the right from the text
397
+ */
398
+ iconRight: {
399
+ type: [Object, Function],
400
+ default: null
401
+ },
402
+ /**
403
+ * Hide default slot (when you want to show icons only)
404
+ */
405
+ hideText: {
406
+ type: Boolean,
407
+ default: !1
408
+ }
409
+ },
410
+ emits: ["click"],
411
+ setup(e, { emit: s }) {
412
+ const l = e, u = (d) => {
413
+ if (l.disabled) {
414
+ d.preventDefault(), d.stopPropagation(), d.stopImmediatePropagation();
415
+ return;
416
+ }
417
+ s("click", d);
418
+ };
419
+ return (d, c) => (a(), L(rt, {
420
+ link: "",
421
+ to: e.to,
422
+ external: e.external,
423
+ disabled: e.disabled,
424
+ size: e.size,
425
+ "foreground-link": e.foregroundLink,
426
+ "icon-left": e.iconLeft,
427
+ "icon-right": e.iconRight,
428
+ "hide-text": e.hideText,
429
+ role: "link",
430
+ onClickCapture: u
431
+ }, {
432
+ default: F(() => [
433
+ E(d.$slots, "default", {}, () => [
434
+ R("Link")
435
+ ])
436
+ ]),
437
+ _: 3
438
+ }, 8, ["to", "external", "disabled", "size", "foreground-link", "icon-left", "icon-right", "hide-text"]));
439
+ }
440
+ });
441
+ var K = /* @__PURE__ */ ((e) => (e[e.Success = 0] = "Success", e[e.Warning = 1] = "Warning", e[e.Danger = 2] = "Danger", e[e.Info = 3] = "Info", e))(K || {});
442
+ const ut = {
443
+ "aria-live": "assertive",
444
+ class: "pointer-events-none fixed inset-0 flex items-end px-4 py-6 mt-10 sm:items-start sm:p-6 z-50"
445
+ }, dt = { class: "flex w-full flex-col items-center space-y-4 sm:items-end" }, ct = {
446
+ key: 0,
447
+ class: "pointer-events-auto w-full max-w-sm overflow-hidden rounded-lg bg-foundation text-foreground shadow-lg ring-1 ring-primary-muted ring-opacity-5"
448
+ }, ft = { class: "p-4" }, pt = { class: "flex items-start" }, ht = { class: "flex-shrink-0" }, mt = { class: "ml-2 w-0 flex-1 flex flex-col" }, gt = {
449
+ key: 0,
450
+ class: "text-foreground font-bold"
451
+ }, bt = {
452
+ key: 1,
453
+ class: "label label--light text-foreground-2"
454
+ }, yt = {
455
+ key: 2,
456
+ class: "flex justify-start mt-2"
457
+ }, vt = /* @__PURE__ */ r("span", { class: "sr-only" }, "Close", -1), ml = /* @__PURE__ */ M({
458
+ __name: "ToastRenderer",
459
+ props: {
460
+ notification: null
461
+ },
462
+ emits: ["update:notification"],
463
+ setup(e, { emit: s }) {
464
+ const l = e, u = i(
465
+ () => {
466
+ var y, x;
467
+ return !((y = l.notification) != null && y.description) && !((x = l.notification) != null && x.cta);
468
+ }
469
+ ), d = () => {
470
+ s("update:notification", null);
471
+ }, c = (y) => {
472
+ var x, g, o;
473
+ (o = (g = (x = l.notification) == null ? void 0 : x.cta) == null ? void 0 : g.onClick) == null || o.call(g, y), d();
474
+ };
475
+ return (y, x) => (a(), f("div", ut, [
476
+ r("div", dt, [
477
+ O(ye, {
478
+ "enter-active-class": "transform ease-out duration-300 transition",
479
+ "enter-from-class": "translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2",
480
+ "enter-to-class": "translate-y-0 opacity-100 sm:translate-x-0",
481
+ "leave-active-class": "transition ease-in duration-100",
482
+ "leave-from-class": "opacity-100",
483
+ "leave-to-class": "opacity-0"
484
+ }, {
485
+ default: F(() => [
486
+ e.notification ? (a(), f("div", ct, [
487
+ r("div", ft, [
488
+ r("div", pt, [
489
+ r("div", ht, [
490
+ e.notification.type === t(K).Success ? (a(), L(t(Me), {
491
+ key: 0,
492
+ class: "h-6 w-6 text-success",
493
+ "aria-hidden": "true"
494
+ })) : e.notification.type === t(K).Danger ? (a(), L(t(Ae), {
495
+ key: 1,
496
+ class: "h-6 w-6 text-danger",
497
+ "aria-hidden": "true"
498
+ })) : e.notification.type === t(K).Warning ? (a(), L(t(Fe), {
499
+ key: 2,
500
+ class: "h-6 w-6 text-warning",
501
+ "aria-hidden": "true"
502
+ })) : e.notification.type === t(K).Info ? (a(), L(t(Te), {
503
+ key: 3,
504
+ class: "h-6 w-6 text-info",
505
+ "aria-hidden": "true"
506
+ })) : $("", !0)
507
+ ]),
508
+ r("div", mt, [
509
+ e.notification.title ? (a(), f("p", gt, w(e.notification.title), 1)) : $("", !0),
510
+ e.notification.description ? (a(), f("p", bt, w(e.notification.description), 1)) : $("", !0),
511
+ e.notification.cta ? (a(), f("div", yt, [
512
+ O(it, {
513
+ to: e.notification.cta.url,
514
+ class: "label",
515
+ primary: "",
516
+ onClick: c
517
+ }, {
518
+ default: F(() => [
519
+ R(w(e.notification.cta.title), 1)
520
+ ]),
521
+ _: 1
522
+ }, 8, ["to"])
523
+ ])) : $("", !0)
524
+ ]),
525
+ r("div", {
526
+ class: v(["ml-4 flex flex-shrink-0", { "self-center": t(u) }])
527
+ }, [
528
+ r("button", {
529
+ type: "button",
530
+ class: "inline-flex rounded-md bg-foundation text-foreground-2 hover:text-foreground focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",
531
+ onClick: d
532
+ }, [
533
+ vt,
534
+ O(t(oe), {
535
+ class: "h-6 w-6",
536
+ "aria-hidden": "true"
537
+ })
538
+ ])
539
+ ], 2)
540
+ ])
541
+ ])
542
+ ])) : $("", !0)
543
+ ]),
544
+ _: 1
545
+ })
546
+ ])
547
+ ]));
548
+ }
549
+ }), xt = /* @__PURE__ */ r("circle", {
550
+ cx: "4",
551
+ cy: "4",
552
+ r: "3"
553
+ }, null, -1), kt = [
554
+ xt
555
+ ], Ct = /* @__PURE__ */ M({
556
+ __name: "Badge",
557
+ props: {
558
+ size: null,
559
+ colorClasses: null,
560
+ dot: { type: Boolean },
561
+ dotIconColorClasses: null,
562
+ iconLeft: null,
563
+ rounded: { type: Boolean },
564
+ clickableIcon: { type: Boolean }
565
+ },
566
+ emits: ["click-icon"],
567
+ setup(e, { emit: s }) {
568
+ const l = e, u = i(
569
+ () => l.colorClasses || "bg-blue-100 text-blue-800"
570
+ ), d = i(
571
+ () => l.dotIconColorClasses || "text-blue-400"
572
+ ), c = i(() => {
573
+ const o = [
574
+ "inline-flex items-center",
575
+ u.value,
576
+ l.size === "lg" ? "px-3 py-0.5 label" : "px-2.5 py-0.5 caption font-medium"
577
+ ];
578
+ return l.rounded ? (o.push("rounded"), o.push(
579
+ l.size === "lg" ? "px-2 py-0.5 label" : "px-2.5 py-0.5 caption font-medium"
580
+ )) : (o.push("rounded-full"), o.push(
581
+ l.size === "lg" ? "px-2.5 py-0.5 label" : "px-2.5 py-0.5 caption font-medium"
582
+ )), o.join(" ");
583
+ }), y = i(() => {
584
+ const o = [
585
+ "mt-0.5 ml-0.5 inline-flex h-4 w-4 flex-shrink-0 items-center justify-center rounded-full focus:outline-none"
586
+ ];
587
+ return l.clickableIcon ? o.push("cursor-pointer") : o.push("cursor-default"), o.join(" ");
588
+ }), x = i(() => [
589
+ "-ml-0.5 mr-1.5 h-2 w-2",
590
+ d.value
591
+ ].join(" ")), g = (o) => {
592
+ if (!l.clickableIcon) {
593
+ o.stopPropagation(), o.stopImmediatePropagation(), o.preventDefault();
594
+ return;
595
+ }
596
+ s("click-icon", o);
597
+ };
598
+ return (o, C) => (a(), f("span", {
599
+ class: v(t(c))
600
+ }, [
601
+ e.dot ? (a(), f("svg", {
602
+ key: 0,
603
+ class: v(t(x)),
604
+ fill: "currentColor",
605
+ viewBox: "0 0 8 8"
606
+ }, kt, 2)) : $("", !0),
607
+ E(o.$slots, "default", {}, () => [
608
+ R("Badge")
609
+ ]),
610
+ e.iconLeft ? (a(), f("button", {
611
+ key: 1,
612
+ class: v(t(y)),
613
+ onClick: C[0] || (C[0] = (p) => g(p))
614
+ }, [
615
+ (a(), L(D(e.iconLeft), {
616
+ class: v(["h-4 w-4", t(d)])
617
+ }, null, 8, ["class"]))
618
+ ], 2)) : $("", !0)
619
+ ], 2));
620
+ }
621
+ });
622
+ var X = /* @__PURE__ */ ((e) => (e[e.sm = 640] = "sm", e[e.md = 746] = "md", e[e.lg = 1024] = "lg", e[e.xl = 1280] = "xl", e[e["2xl"] = 1536] = "2xl", e))(X || {});
623
+ function $e(e) {
624
+ const {
625
+ props: { modelValue: s, steps: l, orientation: u, goVerticalBelow: d, nonInteractive: c },
626
+ emit: y
627
+ } = e, x = i(
628
+ () => (u == null ? void 0 : u.value) === "vertical" ? "vertical" : "horizontal"
629
+ ), g = i({
630
+ get: () => be((s == null ? void 0 : s.value) || 0, -1, l.value.length),
631
+ set: (b) => y("update:modelValue", be(b, 0, l.value.length))
632
+ }), o = (b) => `${b + 1}`, C = (b) => b === g.value, p = (b) => b < g.value, m = (b, S) => {
633
+ var n;
634
+ if (c != null && c.value) {
635
+ S == null || S.preventDefault(), S == null || S.stopPropagation(), S == null || S.stopImmediatePropagation();
636
+ return;
637
+ }
638
+ g.value = b;
639
+ const _ = l.value[g.value];
640
+ (n = _ == null ? void 0 : _.onClick) == null || n.call(_);
641
+ }, k = i(() => {
642
+ const b = ["flex"];
643
+ return b.push("flex"), x.value === "vertical" || d != null && d.value ? (b.push("flex-col space-y-4 justify-center"), (d == null ? void 0 : d.value) === X.sm ? b.push(
644
+ "sm:flex-row sm:space-y-0 sm:justify-start sm:space-x-8 sm:items-center"
645
+ ) : (d == null ? void 0 : d.value) === X.md ? b.push(
646
+ "md:flex-row md:space-y-0 md:justify-start md:space-x-8 md:items-center"
647
+ ) : (d == null ? void 0 : d.value) === X.lg ? b.push(
648
+ "lg:flex-row lg:space-y-0 lg:justify-start lg:space-x-8 lg:items-center"
649
+ ) : (d == null ? void 0 : d.value) === X.xl && b.push(
650
+ "xl:flex-row xl:space-y-0 xl:justify-start xl:space-x-8 xl:items-center"
651
+ )) : b.push("flex-row space-x-8 items-center"), b.join(" ");
652
+ }), V = i(() => {
653
+ const b = ["flex items-center"];
654
+ return c != null && c.value || b.push("cursor-pointer"), b.join(" ");
655
+ });
656
+ return {
657
+ value: g,
658
+ isCurrentStep: C,
659
+ isFinishedStep: p,
660
+ switchStep: m,
661
+ getStepDisplayValue: o,
662
+ listClasses: k,
663
+ linkClasses: V,
664
+ orientation: x
665
+ };
666
+ }
667
+ const wt = ["aria-label"], $t = ["href", "onClick"], St = { class: "flex space-x-3 items-center text-primary-focus normal font-medium leading-5" }, _t = { class: "shrink-0 h-8 w-8 rounded-full bg-primary-focus text-foreground-on-primary inline-flex items-center justify-center" }, It = { class: "flex flex-col" }, Bt = {
668
+ key: 0,
669
+ class: "label label--light text-foreground"
670
+ }, Vt = ["href", "onClick"], Lt = { class: "flex space-x-3 items-center text-primary-focus normal font-medium leading-5" }, jt = { class: "shrink-0 h-8 w-8 rounded-full border-2 border-primary-focus inline-flex items-center justify-center" }, Ot = { class: "flex flex-col" }, Pt = {
671
+ key: 0,
672
+ class: "label label--light text-foreground"
673
+ }, Mt = ["href", "onClick"], At = { class: "flex space-x-3 items-center text-foreground-disabled normal font-medium leading-5" }, Ft = { class: "shrink-0 h-8 w-8 rounded-full border-2 border-foreground-disabled inline-flex items-center justify-center" }, Tt = { class: "flex flex-col" }, Rt = {
674
+ key: 0,
675
+ class: "label label--light"
676
+ }, gl = /* @__PURE__ */ M({
677
+ __name: "Number",
678
+ props: {
679
+ ariaLabel: null,
680
+ orientation: null,
681
+ steps: null,
682
+ modelValue: null,
683
+ goVerticalBelow: null,
684
+ nonInteractive: { type: Boolean }
685
+ },
686
+ emits: ["update:modelValue"],
687
+ setup(e, { emit: s }) {
688
+ const l = e, {
689
+ isCurrentStep: u,
690
+ isFinishedStep: d,
691
+ switchStep: c,
692
+ getStepDisplayValue: y,
693
+ listClasses: x,
694
+ linkClasses: g
695
+ } = $e({
696
+ props: G(l),
697
+ emit: s
698
+ });
699
+ return (o, C) => (a(), f("nav", {
700
+ class: "flex justify-center",
701
+ "aria-label": e.ariaLabel || "Progress steps"
702
+ }, [
703
+ r("ol", {
704
+ class: v(t(x))
705
+ }, [
706
+ (a(!0), f(q, null, Y(e.steps, (p, m) => (a(), f("li", {
707
+ key: p.name
708
+ }, [
709
+ t(d)(m) ? (a(), f("a", {
710
+ key: 0,
711
+ href: p.href,
712
+ class: v(t(g)),
713
+ onClick: (k) => t(c)(m, k)
714
+ }, [
715
+ r("div", St, [
716
+ r("div", _t, [
717
+ O(t(Re), { class: "w-5 h-5" })
718
+ ]),
719
+ r("div", It, [
720
+ r("div", null, w(p.name), 1),
721
+ p.description ? (a(), f("div", Bt, w(p.description), 1)) : $("", !0)
722
+ ])
723
+ ])
724
+ ], 10, $t)) : t(u)(m) ? (a(), f("a", {
725
+ key: 1,
726
+ href: p.href,
727
+ class: v(t(g)),
728
+ "aria-current": "step",
729
+ onClick: (k) => t(c)(m, k)
730
+ }, [
731
+ r("div", Lt, [
732
+ r("div", jt, w(t(y)(m)), 1),
733
+ r("div", Ot, [
734
+ r("div", null, w(p.name), 1),
735
+ p.description ? (a(), f("div", Pt, w(p.description), 1)) : $("", !0)
736
+ ])
737
+ ])
738
+ ], 10, Vt)) : (a(), f("a", {
739
+ key: 2,
740
+ href: p.href,
741
+ class: v(t(g)),
742
+ onClick: (k) => t(c)(m, k)
743
+ }, [
744
+ r("div", At, [
745
+ r("div", Ft, w(t(y)(m)), 1),
746
+ r("div", Tt, [
747
+ r("div", null, w(p.name), 1),
748
+ p.description ? (a(), f("div", Rt, w(p.description), 1)) : $("", !0)
749
+ ])
750
+ ])
751
+ ], 10, Mt))
752
+ ]))), 128))
753
+ ], 2)
754
+ ], 8, wt));
755
+ }
756
+ }), Se = (e) => (ve("data-v-56fc6520"), e = e(), xe(), e), zt = ["aria-label"], Et = ["href", "onClick"], Dt = { class: "relative flex h-5 w-5 flex-shrink-0 items-center justify-center" }, qt = {
757
+ key: 0,
758
+ class: "h-3 w-3 rounded-full bg-foreground-2"
759
+ }, Ut = ["href", "onClick"], Wt = {
760
+ class: "relative flex h-5 w-5 flex-shrink-0 items-center justify-center",
761
+ "aria-hidden": "true"
762
+ }, Ht = {
763
+ key: 0,
764
+ class: "h-3 w-3 rounded-full bg-foreground"
765
+ }, Kt = /* @__PURE__ */ Se(() => /* @__PURE__ */ r("span", { class: "absolute h-4 w-4 rounded-full bg-outline-2" }, null, -1)), Xt = /* @__PURE__ */ Se(() => /* @__PURE__ */ r("span", { class: "relative block h-2 w-2 rounded-full bg-primary-focus" }, null, -1)), Nt = ["href", "onClick"], Gt = {
766
+ class: "relative flex h-5 w-5 flex-shrink-0 items-center justify-center",
767
+ "aria-hidden": "true"
768
+ }, Jt = {
769
+ key: 0,
770
+ class: "h-3 w-3 rounded-full bg-foreground-2"
771
+ }, Qt = {
772
+ key: 1,
773
+ class: "h-4 w-4 rounded-full bg-foreground-disabled"
774
+ }, Yt = /* @__PURE__ */ M({
775
+ __name: "Bullet",
776
+ props: {
777
+ ariaLabel: null,
778
+ basic: { type: Boolean },
779
+ orientation: null,
780
+ steps: null,
781
+ modelValue: null,
782
+ goVerticalBelow: null,
783
+ nonInteractive: { type: Boolean }
784
+ },
785
+ emits: ["update:modelValue"],
786
+ setup(e, { emit: s }) {
787
+ const l = e, { isCurrentStep: u, isFinishedStep: d, switchStep: c, listClasses: y, linkClasses: x } = $e({
788
+ props: G(l),
789
+ emit: s
790
+ }), g = i(() => {
791
+ const o = ["ml-3 h6 font-medium leading-7"];
792
+ return l.basic && o.push("sr-only"), o.join(" ");
793
+ });
794
+ return (o, C) => (a(), f("nav", {
795
+ class: "flex justify-center",
796
+ "aria-label": e.ariaLabel || "Progress steps"
797
+ }, [
798
+ r("ol", {
799
+ class: v([t(y), e.basic ? "basic" : ""])
800
+ }, [
801
+ (a(!0), f(q, null, Y(e.steps, (p, m) => (a(), f("li", {
802
+ key: p.name
803
+ }, [
804
+ t(d)(m) ? (a(), f("a", {
805
+ key: 0,
806
+ href: p.href,
807
+ class: v(t(x)),
808
+ onClick: (k) => t(c)(m, k)
809
+ }, [
810
+ r("span", Dt, [
811
+ e.basic ? (a(), f("span", qt)) : (a(), L(t(ze), {
812
+ key: 1,
813
+ class: "h-full w-full text-primary",
814
+ "aria-hidden": "true"
815
+ }))
816
+ ]),
817
+ r("span", {
818
+ class: v(["text-foreground", t(g)])
819
+ }, w(p.name), 3)
820
+ ], 10, Et)) : t(u)(m) ? (a(), f("a", {
821
+ key: 1,
822
+ href: p.href,
823
+ class: v(t(x)),
824
+ "aria-current": "step",
825
+ onClick: (k) => t(c)(m, k)
826
+ }, [
827
+ r("span", Wt, [
828
+ e.basic ? (a(), f("span", Ht)) : (a(), f(q, { key: 1 }, [
829
+ Kt,
830
+ Xt
831
+ ], 64))
832
+ ]),
833
+ r("span", {
834
+ class: v(["text-primary-focus", t(g)])
835
+ }, w(p.name), 3)
836
+ ], 10, Ut)) : (a(), f("a", {
837
+ key: 2,
838
+ href: p.href,
839
+ class: v(t(x)),
840
+ onClick: (k) => t(c)(m, k)
841
+ }, [
842
+ r("div", Gt, [
843
+ e.basic ? (a(), f("span", Jt)) : (a(), f("div", Qt))
844
+ ]),
845
+ r("p", {
846
+ class: v(["text-foreground-disabled", t(g)])
847
+ }, w(p.name), 3)
848
+ ], 10, Nt))
849
+ ]))), 128))
850
+ ], 2)
851
+ ], 8, zt));
852
+ }
853
+ });
854
+ const bl = /* @__PURE__ */ ue(Yt, [["__scopeId", "data-v-56fc6520"]]), Zt = ["disabled"], yl = /* @__PURE__ */ M({
855
+ __name: "CardButton",
856
+ props: {
857
+ disabled: { type: Boolean },
858
+ modelValue: { type: Boolean }
859
+ },
860
+ emits: ["update:modelValue", "click"],
861
+ setup(e, { emit: s }) {
862
+ const l = e, u = i(() => {
863
+ const c = [
864
+ "h-20 bg-foundation-2 inline-flex justify-center items-center outline-none",
865
+ "normal px-16 py-5 shadow rounded transition active:scale-95"
866
+ ];
867
+ return l.disabled ? c.push("bg-foundation-disabled text-foreground-2 cursor-not-allowed") : (c.push(
868
+ l.modelValue ? "bg-primary-focus text-foreground-on-primary" : "bg-foundation text-foreground"
869
+ ), c.push("ring-outline-2 hover:ring-4")), c.join(" ");
870
+ }), d = (c) => {
871
+ if (l.disabled) {
872
+ c.preventDefault(), c.stopPropagation(), c.stopImmediatePropagation();
873
+ return;
874
+ }
875
+ s("update:modelValue", !l.modelValue), s("click", c);
876
+ };
877
+ return (c, y) => (a(), f("button", {
878
+ class: v(t(u)),
879
+ disabled: e.disabled,
880
+ onClick: d
881
+ }, [
882
+ E(c.$slots, "default", {}, () => [
883
+ R("Text")
884
+ ])
885
+ ], 10, Zt));
886
+ }
887
+ }), es = { class: "relative flex items-start" }, ts = { class: "flex h-6 items-center" }, ss = ["id", "checked", "aria-describedby", "name", "value", "disabled"], ls = {
888
+ class: "ml-2 text-sm",
889
+ style: { "padding-top": "2px" }
890
+ }, ns = ["for"], as = {
891
+ key: 0,
892
+ class: "text-danger ml-1"
893
+ }, os = ["id"], rs = M({
894
+ inheritAttrs: !1
895
+ }), vl = /* @__PURE__ */ M({
896
+ ...rs,
897
+ __name: "Checkbox",
898
+ props: {
899
+ /**
900
+ * Input name/id. In a checkbox group, all checkboxes must have the same name and different values.
901
+ */
902
+ name: {
903
+ type: String,
904
+ required: !0
905
+ },
906
+ /**
907
+ * Whether the input is disabled
908
+ */
909
+ disabled: {
910
+ type: Boolean,
911
+ default: !1
912
+ },
913
+ /**
914
+ * Set label text
915
+ */
916
+ label: {
917
+ type: String,
918
+ default: void 0
919
+ },
920
+ /**
921
+ * Help text
922
+ */
923
+ description: {
924
+ type: String,
925
+ default: void 0
926
+ },
927
+ /**
928
+ * Whether to inline the help description
929
+ */
930
+ inlineDescription: {
931
+ type: Boolean,
932
+ default: !1
933
+ },
934
+ /**
935
+ * vee-validate validation rules
936
+ */
937
+ rules: {
938
+ type: [String, Object, Function, Array],
939
+ default: void 0
940
+ },
941
+ /**
942
+ * vee-validate validation() on component mount
943
+ */
944
+ validateOnMount: {
945
+ type: Boolean,
946
+ default: !1
947
+ },
948
+ /**
949
+ * Whether to show the red "required" asterisk
950
+ */
951
+ showRequired: {
952
+ type: Boolean,
953
+ default: !1
954
+ },
955
+ /**
956
+ * Checkbox group's value
957
+ */
958
+ modelValue: {
959
+ type: [String, Boolean],
960
+ default: void 0
961
+ },
962
+ /**
963
+ * Checkbox's own value. If it is checked, modelValue will include this value (amongst any other checked values from the same group).
964
+ * If not set will default to 'name' value.
965
+ */
966
+ value: {
967
+ type: [String, Boolean],
968
+ default: !0
969
+ },
970
+ /**
971
+ * HTML ID to use, must be globally unique. If not specified, a random ID will be generated. One is necessary to properly associate the label and checkbox.
972
+ */
973
+ id: {
974
+ type: String,
975
+ default: void 0
976
+ },
977
+ hideLabel: {
978
+ type: Boolean,
979
+ default: !1
980
+ }
981
+ },
982
+ emits: ["update:modelValue"],
983
+ setup(e) {
984
+ const s = e, l = (b) => `${b}-${ie()}`, u = i(() => s.value || s.name), {
985
+ checked: d,
986
+ errorMessage: c,
987
+ handleChange: y
988
+ } = re(s.name, s.rules, {
989
+ validateOnMount: s.validateOnMount,
990
+ type: "checkbox",
991
+ checkedValue: u,
992
+ initialValue: s.modelValue || void 0
993
+ }), x = (b) => {
994
+ s.disabled || y(b);
995
+ }, g = i(() => s.label || s.name), o = i(() => c.value ? "border-danger-lighter" : "border-foreground-4 "), C = i(() => s.description || c.value), p = i(() => `${s.name}-description`), m = i(() => {
996
+ const b = [];
997
+ return s.inlineDescription ? b.push("inline ml-2") : b.push("block"), c.value ? b.push("text-danger") : b.push("text-foreground-2"), b.join(" ");
998
+ }), k = T(l("checkbox")), V = i(() => s.id || k.value);
999
+ return (b, S) => (a(), f("div", es, [
1000
+ r("div", ts, [
1001
+ r("input", ae({
1002
+ id: t(V),
1003
+ checked: t(d),
1004
+ "aria-describedby": t(p),
1005
+ name: e.name,
1006
+ value: t(u),
1007
+ disabled: e.disabled,
1008
+ type: "checkbox",
1009
+ class: ["h-4 w-4 rounded text-primary focus:ring-primary bg-foundation disabled:cursor-not-allowed disabled:bg-disabled disabled:text-disabled-2", t(o)]
1010
+ }, b.$attrs, { onChange: x }), null, 16, ss)
1011
+ ]),
1012
+ r("div", ls, [
1013
+ r("label", {
1014
+ for: t(V),
1015
+ class: v(["font-medium text-foreground", { "sr-only": e.hideLabel }])
1016
+ }, [
1017
+ r("span", null, w(t(g)), 1),
1018
+ e.showRequired ? (a(), f("span", as, "*")) : $("", !0)
1019
+ ], 10, ns),
1020
+ t(C) ? (a(), f("p", {
1021
+ key: 0,
1022
+ id: t(p),
1023
+ class: v(t(m))
1024
+ }, w(t(C)), 11, os)) : $("", !0)
1025
+ ])
1026
+ ]));
1027
+ }
1028
+ });
1029
+ function _e(e) {
1030
+ const { props: s, inputEl: l, emit: u } = e, { value: d, errorMessage: c } = re(s.name, s.rules, {
1031
+ validateOnMount: t(s.validateOnMount),
1032
+ validateOnValueUpdate: t(s.validateOnValueUpdate),
1033
+ initialValue: t(s.modelValue) || void 0
1034
+ }), y = i(() => {
1035
+ const n = ["block label text-foreground-2 mb-2"];
1036
+ return t(s.showLabel) || n.push("sr-only"), n.join(" ");
1037
+ }), x = i(() => {
1038
+ const n = [
1039
+ "block w-full rounded focus:outline-none text-foreground transition-all",
1040
+ "disabled:cursor-not-allowed disabled:bg-foundation-disabled disabled:text-disabled-muted",
1041
+ "placeholder:text-foreground-2"
1042
+ ];
1043
+ return c.value ? n.push(
1044
+ "border-2 border-danger text-danger-darker focus:border-danger focus:ring-danger"
1045
+ ) : n.push("border-0 focus:ring-2 focus:ring-outline-2"), t(s.color) === "foundation" ? n.push("bg-foundation shadow-sm hover:shadow") : n.push("bg-foundation-page"), n.join(" ");
1046
+ }), g = T(ie()), o = i(() => t(s.label) || t(s.name)), C = i(() => {
1047
+ const n = c.value;
1048
+ return !n || !t(s.useLabelInErrors) ? n : n.replace("Value", o.value);
1049
+ }), p = i(
1050
+ () => C.value && t(s.hideErrorMessage)
1051
+ ), m = i(() => C.value || t(s.help)), k = i(() => !!m.value), V = i(
1052
+ () => k.value ? `${t(s.name)}-${g.value}` : void 0
1053
+ ), b = i(() => {
1054
+ const n = ["mt-2 text-sm"];
1055
+ return n.push(c.value ? "text-danger" : "text-foreground-2"), n.join(" ");
1056
+ }), S = () => {
1057
+ var n;
1058
+ (n = l.value) == null || n.focus();
1059
+ }, _ = () => {
1060
+ d.value = "", u("change", { value: "" }), u("clear");
1061
+ };
1062
+ return ke(() => {
1063
+ t(s.autoFocus) && S();
1064
+ }), {
1065
+ coreClasses: x,
1066
+ title: o,
1067
+ value: d,
1068
+ helpTipId: V,
1069
+ helpTipClasses: b,
1070
+ helpTip: m,
1071
+ hideHelpTip: p,
1072
+ errorMessage: C,
1073
+ clear: _,
1074
+ focus: S,
1075
+ labelClasses: y
1076
+ };
1077
+ }
1078
+ const is = ["for"], us = { class: "relative" }, ds = ["id", "name", "placeholder", "disabled", "aria-invalid", "aria-describedby"], cs = /* @__PURE__ */ r("span", { class: "text-xs sr-only" }, "Clear input", -1), fs = {
1079
+ key: 2,
1080
+ class: "pointer-events-none absolute inset-y-0 mt-3 text-4xl right-0 flex items-center pr-2 text-danger opacity-50"
1081
+ }, ps = ["id"], xl = /* @__PURE__ */ M({
1082
+ __name: "TextArea",
1083
+ props: {
1084
+ name: null,
1085
+ showLabel: { type: Boolean },
1086
+ help: null,
1087
+ placeholder: null,
1088
+ label: null,
1089
+ disabled: { type: Boolean },
1090
+ rules: null,
1091
+ validateOnMount: { type: Boolean },
1092
+ validateOnValueUpdate: { type: Boolean },
1093
+ useLabelInErrors: { type: Boolean, default: !0 },
1094
+ autoFocus: { type: Boolean },
1095
+ modelValue: { default: "" },
1096
+ showClear: { type: Boolean },
1097
+ fullWidth: { type: Boolean },
1098
+ showRequired: { type: Boolean },
1099
+ color: { default: "page" }
1100
+ },
1101
+ emits: ["update:modelValue", "change", "input", "clear"],
1102
+ setup(e, { expose: s, emit: l }) {
1103
+ const u = e, d = T(null), {
1104
+ coreClasses: c,
1105
+ title: y,
1106
+ value: x,
1107
+ helpTipId: g,
1108
+ helpTipClasses: o,
1109
+ helpTip: C,
1110
+ errorMessage: p,
1111
+ labelClasses: m,
1112
+ clear: k,
1113
+ focus: V
1114
+ } = _e({
1115
+ props: G(u),
1116
+ emit: l,
1117
+ inputEl: d
1118
+ }), b = i(() => {
1119
+ const S = ["pl-2"];
1120
+ return u.showClear && p.value ? S.push("pr-12") : (u.showClear || p.value) && S.push("pr-8"), S.join(" ");
1121
+ });
1122
+ return s({ focus: V }), (S, _) => (a(), f("div", {
1123
+ class: v([e.fullWidth ? "w-full" : ""])
1124
+ }, [
1125
+ r("label", {
1126
+ for: e.name,
1127
+ class: v(t(m))
1128
+ }, [
1129
+ r("span", null, w(t(y)), 1)
1130
+ ], 10, is),
1131
+ r("div", us, [
1132
+ J(r("textarea", ae({
1133
+ id: e.name,
1134
+ ref_key: "inputElement",
1135
+ ref: d,
1136
+ "onUpdate:modelValue": _[0] || (_[0] = (n) => Z(x) ? x.value = n : null),
1137
+ name: e.name,
1138
+ class: [t(c), t(b), "min-h-[4rem]"],
1139
+ placeholder: e.placeholder,
1140
+ disabled: e.disabled,
1141
+ "aria-invalid": t(p) ? "true" : "false",
1142
+ "aria-describedby": t(g)
1143
+ }, S.$attrs, {
1144
+ onChange: _[1] || (_[1] = (n) => S.$emit("change", { event: n, value: t(x) })),
1145
+ onInput: _[2] || (_[2] = (n) => S.$emit("input", { event: n, value: t(x) }))
1146
+ }), null, 16, ds), [
1147
+ [Ce, t(x)]
1148
+ ]),
1149
+ e.showClear ? (a(), f("a", {
1150
+ key: 0,
1151
+ title: "Clear input",
1152
+ class: "absolute top-2 right-0 flex items-center pr-2 cursor-pointer",
1153
+ onClick: _[3] || (_[3] = //@ts-ignore
1154
+ (...n) => t(k) && t(k)(...n)),
1155
+ onKeydown: _[4] || (_[4] = //@ts-ignore
1156
+ (...n) => t(k) && t(k)(...n))
1157
+ }, [
1158
+ cs,
1159
+ O(t(oe), {
1160
+ class: "h-5 w-5 text-foreground",
1161
+ "aria-hidden": "true"
1162
+ })
1163
+ ], 32)) : $("", !0),
1164
+ t(p) ? (a(), f("div", {
1165
+ key: 1,
1166
+ class: v([
1167
+ "pointer-events-none absolute inset-y-0 right-0 flex items-center",
1168
+ e.showClear ? "pr-8" : "pr-2"
1169
+ ])
1170
+ }, [
1171
+ O(t(we), {
1172
+ class: "h-4 w-4 text-danger",
1173
+ "aria-hidden": "true"
1174
+ })
1175
+ ], 2)) : $("", !0),
1176
+ e.showRequired && !t(p) ? (a(), f("div", fs, " * ")) : $("", !0)
1177
+ ]),
1178
+ t(g) ? (a(), f("p", {
1179
+ key: 0,
1180
+ id: t(g),
1181
+ class: v(t(o))
1182
+ }, w(t(C)), 11, ps)) : $("", !0)
1183
+ ], 2));
1184
+ }
1185
+ }), hs = ["for"], ms = { class: "relative" }, gs = {
1186
+ key: 0,
1187
+ class: "pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2"
1188
+ }, bs = ["id", "type", "name", "placeholder", "disabled", "aria-invalid", "aria-describedby"], ys = /* @__PURE__ */ r("span", { class: "text-xs sr-only" }, "Clear input", -1), vs = {
1189
+ key: 2,
1190
+ class: "pointer-events-none absolute inset-y-0 mt-3 text-4xl right-0 flex items-center pr-2 text-danger opacity-50"
1191
+ }, xs = ["id"], ks = M({
1192
+ inheritAttrs: !1
1193
+ }), kl = /* @__PURE__ */ M({
1194
+ ...ks,
1195
+ __name: "TextInput",
1196
+ props: {
1197
+ /**
1198
+ * Input "type" value (changes behaviour & look)
1199
+ */
1200
+ type: {
1201
+ type: String,
1202
+ default: "text"
1203
+ },
1204
+ /**
1205
+ * Unique ID for the input (must be unique page-wide)
1206
+ */
1207
+ name: {
1208
+ type: String,
1209
+ required: !0
1210
+ },
1211
+ /**
1212
+ * Whether to show label (label will always be shown to screen readers)
1213
+ */
1214
+ showLabel: {
1215
+ type: Boolean,
1216
+ required: !1
1217
+ },
1218
+ /**
1219
+ * Optional help text
1220
+ */
1221
+ help: {
1222
+ type: String,
1223
+ default: void 0
1224
+ },
1225
+ /**
1226
+ * Placeholder text
1227
+ */
1228
+ placeholder: {
1229
+ type: String,
1230
+ default: void 0
1231
+ },
1232
+ /**
1233
+ * Set label text explicitly
1234
+ */
1235
+ label: {
1236
+ type: String,
1237
+ default: void 0
1238
+ },
1239
+ /**
1240
+ * Whether to show the red "required" asterisk
1241
+ */
1242
+ showRequired: {
1243
+ type: Boolean,
1244
+ default: !1
1245
+ },
1246
+ /**
1247
+ * Whether to disable the component, blocking it from user input
1248
+ */
1249
+ disabled: {
1250
+ type: Boolean,
1251
+ default: !1
1252
+ },
1253
+ /**
1254
+ * vee-validate validation rules
1255
+ */
1256
+ rules: {
1257
+ type: [String, Object, Function, Array],
1258
+ default: void 0
1259
+ },
1260
+ /**
1261
+ * vee-validate validation() on component mount
1262
+ */
1263
+ validateOnMount: {
1264
+ type: Boolean,
1265
+ default: !1
1266
+ },
1267
+ /**
1268
+ * Whether to trigger validation whenever the value changes
1269
+ */
1270
+ validateOnValueUpdate: {
1271
+ type: Boolean,
1272
+ default: !1
1273
+ },
1274
+ /**
1275
+ * Will replace the generic "Value" text with the name of the input in error messages
1276
+ */
1277
+ useLabelInErrors: {
1278
+ type: Boolean,
1279
+ default: !0
1280
+ },
1281
+ /**
1282
+ * Set a custom icon to use inside the input
1283
+ */
1284
+ customIcon: {
1285
+ type: [Object, Function],
1286
+ default: void 0
1287
+ },
1288
+ /**
1289
+ * Whether to focus on the input when component is mounted
1290
+ */
1291
+ autoFocus: {
1292
+ type: Boolean,
1293
+ default: !1
1294
+ },
1295
+ modelValue: {
1296
+ type: String,
1297
+ default: ""
1298
+ },
1299
+ size: {
1300
+ type: String,
1301
+ default: "base"
1302
+ },
1303
+ showClear: {
1304
+ type: Boolean,
1305
+ default: !1
1306
+ },
1307
+ fullWidth: {
1308
+ type: Boolean,
1309
+ default: !1
1310
+ },
1311
+ inputClasses: {
1312
+ type: String,
1313
+ default: null
1314
+ },
1315
+ hideErrorMessage: {
1316
+ type: Boolean,
1317
+ default: !1
1318
+ },
1319
+ wrapperClasses: {
1320
+ type: String,
1321
+ default: () => ""
1322
+ },
1323
+ color: {
1324
+ type: String,
1325
+ default: "page"
1326
+ }
1327
+ },
1328
+ emits: ["update:modelValue", "change", "input", "clear", "focusin", "focusout"],
1329
+ setup(e, { expose: s, emit: l }) {
1330
+ const u = e, d = Le(), c = T(null), {
1331
+ coreClasses: y,
1332
+ title: x,
1333
+ value: g,
1334
+ helpTipId: o,
1335
+ helpTipClasses: C,
1336
+ helpTip: p,
1337
+ hideHelpTip: m,
1338
+ errorMessage: k,
1339
+ clear: V,
1340
+ focus: b,
1341
+ labelClasses: S
1342
+ } = _e({
1343
+ props: G(u),
1344
+ emit: l,
1345
+ inputEl: c
1346
+ }), _ = i(() => {
1347
+ const I = ["h-5 w-5"];
1348
+ return k.value ? I.push("text-danger") : I.push("text-foreground-2"), I.join(" ");
1349
+ }), n = i(
1350
+ () => ["email", "password"].includes(u.type) || u.customIcon
1351
+ ), H = i(() => {
1352
+ const I = [];
1353
+ return n.value ? I.push("pl-8") : I.push("pl-2"), d["input-right"] || (k.value || u.showClear) && (k.value && u.showClear ? I.push("pr-12") : I.push("pr-8")), I.join(" ");
1354
+ }), U = i(() => {
1355
+ switch (u.size) {
1356
+ case "sm":
1357
+ return "h-6";
1358
+ case "lg":
1359
+ return "h-10";
1360
+ case "xl":
1361
+ return "h-14";
1362
+ case "base":
1363
+ default:
1364
+ return "h-8";
1365
+ }
1366
+ });
1367
+ return s({ focus: b }), (I, P) => (a(), f("div", {
1368
+ class: v([e.fullWidth ? "w-full" : "", e.wrapperClasses])
1369
+ }, [
1370
+ r("label", {
1371
+ for: e.name,
1372
+ class: v(t(S))
1373
+ }, [
1374
+ r("span", null, w(t(x)), 1)
1375
+ ], 10, hs),
1376
+ r("div", ms, [
1377
+ t(n) ? (a(), f("div", gs, [
1378
+ e.customIcon ? (a(), L(D(e.customIcon), {
1379
+ key: 0,
1380
+ class: v(t(_)),
1381
+ "aria-hidden": "true"
1382
+ }, null, 8, ["class"])) : e.type === "email" ? (a(), L(t(Ee), {
1383
+ key: 1,
1384
+ class: v(t(_)),
1385
+ "aria-hidden": "true"
1386
+ }, null, 8, ["class"])) : e.type === "password" ? (a(), L(t(De), {
1387
+ key: 2,
1388
+ class: v(t(_)),
1389
+ "aria-hidden": "true"
1390
+ }, null, 8, ["class"])) : $("", !0)
1391
+ ])) : $("", !0),
1392
+ J(r("input", ae({
1393
+ id: e.name,
1394
+ ref_key: "inputElement",
1395
+ ref: c,
1396
+ "onUpdate:modelValue": P[0] || (P[0] = (B) => Z(g) ? g.value = B : null),
1397
+ type: e.type,
1398
+ name: e.name,
1399
+ class: [t(y), t(H), t(U), e.inputClasses || ""],
1400
+ placeholder: e.placeholder,
1401
+ disabled: e.disabled,
1402
+ "aria-invalid": t(k) ? "true" : "false",
1403
+ "aria-describedby": t(o),
1404
+ role: "textbox"
1405
+ }, I.$attrs, {
1406
+ onChange: P[1] || (P[1] = (B) => I.$emit("change", { event: B, value: t(g) })),
1407
+ onInput: P[2] || (P[2] = (B) => I.$emit("input", { event: B, value: t(g) }))
1408
+ }), null, 16, bs), [
1409
+ [je, t(g)]
1410
+ ]),
1411
+ E(I.$slots, "input-right", {}, () => [
1412
+ e.showClear ? (a(), f("a", {
1413
+ key: 0,
1414
+ title: "Clear input",
1415
+ class: "absolute inset-y-0 right-0 flex items-center pr-2 cursor-pointer",
1416
+ onClick: P[3] || (P[3] = //@ts-ignore
1417
+ (...B) => t(V) && t(V)(...B)),
1418
+ onKeydown: P[4] || (P[4] = //@ts-ignore
1419
+ (...B) => t(V) && t(V)(...B))
1420
+ }, [
1421
+ ys,
1422
+ O(t(oe), {
1423
+ class: "h-5 w-5 text-foreground",
1424
+ "aria-hidden": "true"
1425
+ })
1426
+ ], 32)) : $("", !0),
1427
+ t(k) ? (a(), f("div", {
1428
+ key: 1,
1429
+ class: v([
1430
+ "pointer-events-none absolute inset-y-0 right-0 flex items-center",
1431
+ e.showClear ? "pr-8" : "pr-2"
1432
+ ])
1433
+ }, [
1434
+ O(t(we), {
1435
+ class: "h-4 w-4 text-danger",
1436
+ "aria-hidden": "true"
1437
+ })
1438
+ ], 2)) : $("", !0),
1439
+ e.showRequired && !t(k) ? (a(), f("div", vs, " * ")) : $("", !0)
1440
+ ])
1441
+ ]),
1442
+ t(o) && !t(m) ? (a(), f("p", {
1443
+ key: 0,
1444
+ id: t(o),
1445
+ class: v(t(C))
1446
+ }, w(t(p)), 11, xs)) : $("", !0)
1447
+ ], 2));
1448
+ }
1449
+ }), Cs = /^https?:\/\//, de = /^[\w-_.+]+@[\w-_.+]+$/, ws = (e) => (e || "").match(de) ? !0 : "Value should be a valid e-mail address", $s = (e) => (e || "").split(",").map((u) => u.trim()).every((u) => u.match(de)) || "Value should be one or multiple comma-delimited e-mail addresses", Ss = (e) => (Q(e) && (e = e.trim()), e ? !0 : "Value is required"), _s = (e, s) => (l, u) => l === u.form[e] ? !0 : `Value must be the same as in field '${s || e}'`, Is = (e) => (s) => {
1450
+ const { minLength: l, maxLength: u } = e;
1451
+ return s = qe(s) ? "" : s, Q(s) ? !se(l) && s.length < l ? `Value needs to be at least ${l} characters long` : !se(u) && s.length > u ? `Value needs to be no more than ${u} characters long` : !0 : "Value should be a text string";
1452
+ }, Bs = (e) => (s) => {
1453
+ const { match: l, message: u } = e;
1454
+ return Q(s) ? l ? Q(l) ? s.includes(l) ? !0 : u : l.test(s) ? !0 : u : !0 : "Value should be a text string";
1455
+ }, Cl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1456
+ __proto__: null,
1457
+ VALID_EMAIL: de,
1458
+ VALID_HTTP_URL: Cs,
1459
+ isEmail: ws,
1460
+ isOneOrMultipleEmails: $s,
1461
+ isRequired: Ss,
1462
+ isSameAs: _s,
1463
+ isStringOfLength: Is,
1464
+ stringContains: Bs
1465
+ }, Symbol.toStringTag, { value: "Module" }));
1466
+ function Vs(e) {
1467
+ const {
1468
+ skipCalculation: s,
1469
+ elementToWatchForChanges: l,
1470
+ itemContainer: u,
1471
+ trackResize: d = !1,
1472
+ trackMutations: c = !0
1473
+ } = e || {}, y = T(0), x = () => {
1474
+ const g = u.value;
1475
+ if (s != null && s.value || !g)
1476
+ return;
1477
+ const o = g.children;
1478
+ let C = 0, p = 0, m;
1479
+ for (const k of o) {
1480
+ const V = k.offsetTop;
1481
+ se(m) ? (m = V, C += 1) : V === m && (C += 1), p += 1;
1482
+ }
1483
+ y.value = p - C;
1484
+ };
1485
+ return d && He(l, x), c && Ke(l, x, {
1486
+ childList: !0,
1487
+ subtree: !0
1488
+ }), {
1489
+ hiddenItemCount: y
1490
+ };
1491
+ }
1492
+ function Ls(e) {
1493
+ const { props: s, emit: l, dynamicVisibility: u } = e;
1494
+ let d;
1495
+ if (u) {
1496
+ const { elementToWatchForChanges: o, itemContainer: C } = u;
1497
+ d = Vs({
1498
+ skipCalculation: i(() => {
1499
+ var m;
1500
+ return !((m = s.multiple) != null && m.value);
1501
+ }),
1502
+ elementToWatchForChanges: o,
1503
+ itemContainer: C
1504
+ }).hiddenItemCount;
1505
+ } else
1506
+ d = T(0);
1507
+ const c = i({
1508
+ get: () => {
1509
+ var C, p;
1510
+ const o = (C = s.modelValue) == null ? void 0 : C.value;
1511
+ return (p = s.multiple) != null && p.value ? z(o) ? o : [] : z(o) ? void 0 : o;
1512
+ },
1513
+ set: (o) => {
1514
+ var C, p, m;
1515
+ if ((C = s.multiple) != null && C.value && !z(o)) {
1516
+ console.warn("Attempting to set non-array value in selector w/ multiple=true");
1517
+ return;
1518
+ } else if (!((p = s.multiple) != null && p.value) && z(o)) {
1519
+ console.warn("Attempting to set array value in selector w/ multiple=false");
1520
+ return;
1521
+ }
1522
+ l("update:modelValue", (m = s.multiple) != null && m.value ? o || [] : o);
1523
+ }
1524
+ }), y = (o) => z(o);
1525
+ return {
1526
+ selectedValue: c,
1527
+ hiddenSelectedItemCount: d,
1528
+ isArrayValue: y,
1529
+ isMultiItemArrayValue: (o) => z(o) && o.length > 1,
1530
+ firstItem: (o) => y(o) ? o[0] : o
1531
+ };
1532
+ }
1533
+ const js = (e) => (ve("data-v-60cf597b"), e = e(), xe(), e), Os = /* @__PURE__ */ js(() => /* @__PURE__ */ r("div", { class: "swoosher relative top-0 bg-blue-500/50" }, null, -1)), Ps = [
1534
+ Os
1535
+ ], Ms = /* @__PURE__ */ M({
1536
+ __name: "Bar",
1537
+ props: {
1538
+ loading: { type: Boolean }
1539
+ },
1540
+ setup(e) {
1541
+ return (s, l) => (a(), f("div", {
1542
+ class: v([
1543
+ "relative w-full h-1 bg-blue-500/30 text-xs text-foreground-on-primary overflow-hidden rounded-xl",
1544
+ e.loading ? "opacity-100" : "opacity-0"
1545
+ ])
1546
+ }, Ps, 2));
1547
+ }
1548
+ });
1549
+ const As = /* @__PURE__ */ ue(Ms, [["__scopeId", "data-v-60cf597b"]]), Fs = { class: "flex items-center justify-between w-full" }, Ts = { class: "block truncate grow text-left" }, Rs = { class: "pointer-events-none shrink-0 ml-1 flex items-center" }, zs = ["disabled"], Es = {
1550
+ key: 0,
1551
+ class: "flex flex-col mx-1 mb-1"
1552
+ }, Ds = /* @__PURE__ */ r("span", { class: "sr-only label text-foreground" }, "Search", -1), qs = { class: "relative" }, Us = { class: "pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2" }, Ws = ["placeholder"], Hs = {
1553
+ key: 0,
1554
+ class: "px-1"
1555
+ }, Ks = { key: 1 }, Xs = /* @__PURE__ */ r("div", { class: "text-foreground-2 text-center" }, "Nothing found 🤷‍♂️", -1), Ns = {
1556
+ class: /* @__PURE__ */ v(["block truncate"])
1557
+ }, Gs = ["id"], Js = /* @__PURE__ */ M({
1558
+ __name: "Base",
1559
+ props: {
1560
+ multiple: {
1561
+ type: Boolean,
1562
+ default: !1
1563
+ },
1564
+ items: {
1565
+ type: Array,
1566
+ default: () => []
1567
+ },
1568
+ modelValue: {
1569
+ type: [Object, Array, String],
1570
+ default: void 0
1571
+ },
1572
+ /**
1573
+ * Whether to enable the search bar. You must also set one of the following:
1574
+ * * filterPredicate - to allow filtering passed in `items` based on search bar
1575
+ * * getSearchResults - to allow asynchronously loading items from server (props.items no longer required in this case,
1576
+ * but can be used to prefill initial values)
1577
+ */
1578
+ search: {
1579
+ type: Boolean,
1580
+ default: !1
1581
+ },
1582
+ /**
1583
+ * If search=true and this is set, you can use this to filter passed in items based on whatever
1584
+ * the user enters in the search bar
1585
+ */
1586
+ filterPredicate: {
1587
+ type: Function,
1588
+ default: void 0
1589
+ },
1590
+ /**
1591
+ * If search=true and this is set, you can use this to load data asynchronously depending
1592
+ * on the search query
1593
+ */
1594
+ getSearchResults: {
1595
+ type: Function,
1596
+ default: void 0
1597
+ },
1598
+ searchPlaceholder: {
1599
+ type: String,
1600
+ default: "Search"
1601
+ },
1602
+ /**
1603
+ * Label is required at the very least for screen-readers
1604
+ */
1605
+ label: {
1606
+ type: String,
1607
+ required: !0
1608
+ },
1609
+ /**
1610
+ * Whether to show the label visually
1611
+ */
1612
+ showLabel: {
1613
+ type: Boolean,
1614
+ default: !1
1615
+ },
1616
+ name: {
1617
+ type: String,
1618
+ required: !0
1619
+ },
1620
+ /**
1621
+ * Objects will be compared by the values in the specified prop
1622
+ */
1623
+ by: {
1624
+ type: String,
1625
+ required: !1
1626
+ },
1627
+ disabled: {
1628
+ type: Boolean,
1629
+ default: !1
1630
+ },
1631
+ buttonStyle: {
1632
+ type: String,
1633
+ default: "base"
1634
+ },
1635
+ hideCheckmarks: {
1636
+ type: Boolean,
1637
+ default: !1
1638
+ },
1639
+ allowUnset: {
1640
+ type: Boolean,
1641
+ default: !0
1642
+ },
1643
+ clearable: {
1644
+ type: Boolean,
1645
+ default: !1
1646
+ },
1647
+ /**
1648
+ * Validation stuff
1649
+ */
1650
+ rules: {
1651
+ type: [String, Object, Function, Array],
1652
+ default: void 0
1653
+ },
1654
+ /**
1655
+ * vee-validate validation() on component mount
1656
+ */
1657
+ validateOnMount: {
1658
+ type: Boolean,
1659
+ default: !1
1660
+ },
1661
+ /**
1662
+ * Whether to trigger validation whenever the value changes
1663
+ */
1664
+ validateOnValueUpdate: {
1665
+ type: Boolean,
1666
+ default: !1
1667
+ },
1668
+ /**
1669
+ * Will replace the generic "Value" text with the name of the input in error messages
1670
+ */
1671
+ useLabelInErrors: {
1672
+ type: Boolean,
1673
+ default: !0
1674
+ },
1675
+ /**
1676
+ * Optional help text
1677
+ */
1678
+ help: {
1679
+ type: String,
1680
+ default: void 0
1681
+ },
1682
+ fixedHeight: {
1683
+ type: Boolean,
1684
+ default: !1
1685
+ }
1686
+ },
1687
+ emits: ["update:modelValue"],
1688
+ setup(e) {
1689
+ const s = e, { value: l, errorMessage: u } = re(s.name, s.rules, {
1690
+ validateOnMount: s.validateOnMount,
1691
+ validateOnValueUpdate: s.validateOnValueUpdate,
1692
+ initialValue: s.modelValue
1693
+ }), d = T(null), c = T(""), y = T([]), x = T(!1), g = T(ie()), o = i(() => t(s.label) || t(s.name)), C = i(() => {
1694
+ const h = u.value;
1695
+ return !h || !t(s.useLabelInErrors) ? h : h.replace("Value", o.value);
1696
+ }), p = i(() => C.value || t(s.help)), m = i(() => !!p.value), k = i(
1697
+ () => m.value ? `${t(s.name)}-${g.value}` : void 0
1698
+ ), V = i(
1699
+ () => u.value ? "text-danger" : "text-foreground-2"
1700
+ ), b = i(
1701
+ () => s.buttonStyle !== "simple" && s.clearable && !s.disabled
1702
+ ), S = i(() => {
1703
+ const h = ["relative flex group", s.showLabel ? "mt-1" : ""];
1704
+ return s.buttonStyle !== "simple" && (h.push("hover:shadow rounded-md"), h.push("outline outline-2 outline-primary-muted")), s.fixedHeight && h.push("h-8"), h.join(" ");
1705
+ }), _ = i(() => {
1706
+ const h = [];
1707
+ return s.buttonStyle !== "simple" && h.push(
1708
+ P.value ? "bg-foundation-disabled text-foreground-disabled" : ""
1709
+ ), P.value && h.push("cursor-not-allowed"), h.join(" ");
1710
+ }), n = i(() => {
1711
+ const h = [
1712
+ "relative z-[1]",
1713
+ "flex items-center justify-center text-center shrink-0",
1714
+ "rounded-r-md overflow-hidden transition-all",
1715
+ ce.value ? `w-6 ${_.value}` : "w-0"
1716
+ ];
1717
+ return P.value || h.push(
1718
+ "bg-primary-muted hover:bg-primary hover:text-foreground-on-primary"
1719
+ ), h.join(" ");
1720
+ }), H = i(() => {
1721
+ const h = [
1722
+ "relative z-[2]",
1723
+ "normal rounded-md cursor-pointer transition truncate flex-1",
1724
+ "flex items-center",
1725
+ _.value
1726
+ ];
1727
+ return s.buttonStyle !== "simple" && (h.push("py-2 px-3"), P.value || h.push("bg-foundation text-foreground")), b.value && ce.value && h.push("rounded-r-none"), h.join(" ");
1728
+ }), U = i(
1729
+ () => !!(s.search && (s.filterPredicate || s.getSearchResults))
1730
+ ), I = i(() => U.value && s.getSearchResults), P = i(
1731
+ () => s.disabled || !s.items.length && !I.value
1732
+ ), B = i({
1733
+ get: () => {
1734
+ const h = l.value;
1735
+ return s.multiple ? z(h) ? h : [] : z(h) ? void 0 : h;
1736
+ },
1737
+ set: (h) => {
1738
+ if (s.multiple && !z(h)) {
1739
+ console.warn("Attempting to set non-array value in selector w/ multiple=true");
1740
+ return;
1741
+ } else if (!s.multiple && z(h)) {
1742
+ console.warn("Attempting to set array value in selector w/ multiple=false");
1743
+ return;
1744
+ }
1745
+ if (s.multiple)
1746
+ l.value = h || [];
1747
+ else {
1748
+ const A = l.value, j = s.allowUnset && A && h && ee(A) === ee(h);
1749
+ l.value = j ? void 0 : h;
1750
+ }
1751
+ }
1752
+ }), ce = i(() => s.multiple ? B.value.length !== 0 : !!B.value), Ie = () => {
1753
+ s.multiple ? B.value = [] : B.value = void 0;
1754
+ }, Be = i(() => {
1755
+ const h = c.value;
1756
+ return !U.value || !(h != null && h.length) ? y.value : s.filterPredicate ? y.value.filter(
1757
+ (A) => {
1758
+ var j;
1759
+ return ((j = s.filterPredicate) == null ? void 0 : j.call(s, A, h)) || !1;
1760
+ }
1761
+ ) : y.value;
1762
+ }), fe = (h) => JSON.stringify(h), ee = (h) => s.by ? h[s.by] : h, pe = async () => {
1763
+ if (console.log("triggerSearch"), !(!I.value || !s.getSearchResults)) {
1764
+ x.value = !0;
1765
+ try {
1766
+ y.value = await s.getSearchResults(c.value);
1767
+ } finally {
1768
+ x.value = !1;
1769
+ }
1770
+ }
1771
+ }, Ve = Pe(pe, 1e3);
1772
+ return me(
1773
+ () => s.items,
1774
+ (h) => {
1775
+ y.value = h.slice();
1776
+ },
1777
+ { immediate: !0 }
1778
+ ), me(c, () => {
1779
+ I.value && Ve();
1780
+ }), ke(() => {
1781
+ I.value && !s.items.length && pe();
1782
+ }), (h, A) => (a(), f("div", null, [
1783
+ O(t(Ne), {
1784
+ modelValue: t(B),
1785
+ "onUpdate:modelValue": A[4] || (A[4] = (j) => Z(B) ? B.value = j : null),
1786
+ name: e.name,
1787
+ multiple: e.multiple,
1788
+ by: e.by,
1789
+ disabled: t(P),
1790
+ as: "div"
1791
+ }, {
1792
+ default: F(() => [
1793
+ O(t(Ge), {
1794
+ class: v(["block label text-foreground", { "sr-only": !e.showLabel }])
1795
+ }, {
1796
+ default: F(() => [
1797
+ R(w(e.label), 1)
1798
+ ]),
1799
+ _: 1
1800
+ }, 8, ["class"]),
1801
+ r("div", {
1802
+ class: v(t(S))
1803
+ }, [
1804
+ O(t(Je), {
1805
+ class: v(t(H))
1806
+ }, {
1807
+ default: F(({ open: j }) => [
1808
+ r("div", Fs, [
1809
+ r("div", Ts, [
1810
+ !t(B) || t(z)(t(B)) && !t(B).length ? E(h.$slots, "nothing-selected", { key: 0 }, () => [
1811
+ R(w(e.label), 1)
1812
+ ]) : E(h.$slots, "something-selected", {
1813
+ key: 1,
1814
+ value: t(B)
1815
+ }, () => [
1816
+ R(w(fe(t(B))), 1)
1817
+ ])
1818
+ ]),
1819
+ r("div", Rs, [
1820
+ j ? (a(), L(t(Ze), {
1821
+ key: 0,
1822
+ class: "h-4 w-4 text-foreground",
1823
+ "aria-hidden": "true"
1824
+ })) : (a(), L(t(et), {
1825
+ key: 1,
1826
+ class: "h-4 w-4 text-foreground",
1827
+ "aria-hidden": "true"
1828
+ }))
1829
+ ])
1830
+ ])
1831
+ ]),
1832
+ _: 3
1833
+ }, 8, ["class"]),
1834
+ t(b) ? J((a(), f("button", {
1835
+ key: 0,
1836
+ class: v(t(n)),
1837
+ disabled: e.disabled,
1838
+ onClick: A[0] || (A[0] = (j) => Ie())
1839
+ }, [
1840
+ O(t(tt), { class: "w-3 h-3" })
1841
+ ], 10, zs)), [
1842
+ [t(nt), "Clear"]
1843
+ ]) : $("", !0),
1844
+ O(ye, {
1845
+ "leave-active-class": "transition ease-in duration-100",
1846
+ "leave-from-class": "opacity-100",
1847
+ "leave-to-class": "opacity-0"
1848
+ }, {
1849
+ default: F(() => [
1850
+ O(t(Qe), {
1851
+ class: "absolute top-[100%] z-10 mt-1 w-full rounded-md bg-foundation-2 py-1 label label--light outline outline-2 outline-primary-muted focus:outline-none shadow",
1852
+ onFocus: A[3] || (A[3] = (j) => {
1853
+ var W;
1854
+ return (W = d.value) == null ? void 0 : W.focus();
1855
+ })
1856
+ }, {
1857
+ default: F(() => [
1858
+ t(U) ? (a(), f("label", Es, [
1859
+ Ds,
1860
+ r("div", qs, [
1861
+ r("div", Us, [
1862
+ O(t(st), { class: "h-5 w-5 text-foreground" })
1863
+ ]),
1864
+ J(r("input", {
1865
+ ref_key: "searchInput",
1866
+ ref: d,
1867
+ "onUpdate:modelValue": A[1] || (A[1] = (j) => c.value = j),
1868
+ type: "text",
1869
+ class: "pl-9 w-full border-0 bg-foundation-page rounded placeholder:font-normal normal placeholder:text-foreground-2 focus:outline-none focus:ring-1 focus:border-outline-1 focus:ring-outline-1",
1870
+ placeholder: e.searchPlaceholder,
1871
+ onKeydown: A[2] || (A[2] = Oe(() => {
1872
+ }, ["stop"]))
1873
+ }, null, 40, Ws), [
1874
+ [Ce, c.value]
1875
+ ])
1876
+ ])
1877
+ ])) : $("", !0),
1878
+ r("div", {
1879
+ class: v(["overflow-auto simple-scrollbar", [t(U) ? "max-h-52" : "max-h-60"]])
1880
+ }, [
1881
+ t(I) && x.value ? (a(), f("div", Hs, [
1882
+ O(As, { loading: !0 })
1883
+ ])) : t(I) && !y.value.length ? (a(), f("div", Ks, [
1884
+ E(h.$slots, "nothing-found", {}, () => [
1885
+ Xs
1886
+ ])
1887
+ ])) : $("", !0),
1888
+ !t(I) || !x.value ? (a(!0), f(q, { key: 2 }, Y(t(Be), (j) => (a(), L(t(Ye), {
1889
+ key: ee(j),
1890
+ value: j
1891
+ }, {
1892
+ default: F(({ active: W, selected: he }) => [
1893
+ r("li", {
1894
+ class: v([
1895
+ W ? "text-primary" : "text-foreground",
1896
+ "relative transition cursor-pointer select-none py-1.5 pl-3",
1897
+ e.hideCheckmarks ? "" : "pr-9"
1898
+ ])
1899
+ }, [
1900
+ r("span", Ns, [
1901
+ E(h.$slots, "option", {
1902
+ item: j,
1903
+ active: W,
1904
+ selected: he
1905
+ }, () => [
1906
+ R(w(fe(j)), 1)
1907
+ ])
1908
+ ]),
1909
+ !e.hideCheckmarks && he ? (a(), f("span", {
1910
+ key: 0,
1911
+ class: v([
1912
+ W ? "text-primary" : "text-foreground",
1913
+ "absolute inset-y-0 right-0 flex items-center pr-4"
1914
+ ])
1915
+ }, [
1916
+ O(t(lt), {
1917
+ class: "h-5 w-5",
1918
+ "aria-hidden": "true"
1919
+ })
1920
+ ], 2)) : $("", !0)
1921
+ ], 2)
1922
+ ]),
1923
+ _: 2
1924
+ }, 1032, ["value"]))), 128)) : $("", !0)
1925
+ ], 2)
1926
+ ]),
1927
+ _: 3
1928
+ })
1929
+ ]),
1930
+ _: 3
1931
+ })
1932
+ ], 2)
1933
+ ]),
1934
+ _: 3
1935
+ }, 8, ["modelValue", "name", "multiple", "by", "disabled"]),
1936
+ t(k) ? (a(), f("p", {
1937
+ key: 0,
1938
+ id: t(k),
1939
+ class: v(["mt-2 ml-3 text-sm", t(V)])
1940
+ }, w(t(p)), 11, Gs)) : $("", !0)
1941
+ ]));
1942
+ }
1943
+ }), Qs = /* @__PURE__ */ M({
1944
+ __name: "SourceAppBadge",
1945
+ props: {
1946
+ sourceApp: null
1947
+ },
1948
+ setup(e) {
1949
+ return (s, l) => (a(), L(Ct, {
1950
+ "color-classes": "text-foreground-on-primary",
1951
+ rounded: "",
1952
+ style: te({ backgroundColor: e.sourceApp.bgColor })
1953
+ }, {
1954
+ default: F(() => [
1955
+ R(w(e.sourceApp.short), 1)
1956
+ ]),
1957
+ _: 1
1958
+ }, 8, ["style"]));
1959
+ }
1960
+ }), Ys = {
1961
+ key: 0,
1962
+ class: "text-foreground-2 normal"
1963
+ }, Zs = {
1964
+ key: 1,
1965
+ class: "flex items-center"
1966
+ }, el = { class: "truncate" }, tl = { class: "flex items-center" }, sl = { class: "truncate" }, wl = /* @__PURE__ */ M({
1967
+ __name: "SourceApps",
1968
+ props: {
1969
+ /**
1970
+ * Whether to allow selecting multiple source apps
1971
+ */
1972
+ multiple: {
1973
+ type: Boolean,
1974
+ default: !1
1975
+ },
1976
+ modelValue: {
1977
+ type: [Object, Array],
1978
+ default: void 0
1979
+ },
1980
+ /**
1981
+ * Whether to allow filtering source apps through a search box
1982
+ */
1983
+ search: {
1984
+ type: Boolean,
1985
+ default: !1
1986
+ },
1987
+ /**
1988
+ * Search placeholder text
1989
+ */
1990
+ searchPlaceholder: {
1991
+ type: String,
1992
+ default: "Search apps"
1993
+ },
1994
+ selectorPlaceholder: {
1995
+ type: String,
1996
+ default: void 0
1997
+ },
1998
+ /**
1999
+ * Label is required at the very least for screen-readers
2000
+ */
2001
+ label: {
2002
+ type: String,
2003
+ required: !0
2004
+ },
2005
+ /**
2006
+ * Whether to show the label visually
2007
+ */
2008
+ showLabel: {
2009
+ type: Boolean,
2010
+ default: !1
2011
+ },
2012
+ name: {
2013
+ type: String,
2014
+ default: void 0
2015
+ },
2016
+ /**
2017
+ * Control source apps to show. If left undefined, will show all available options.
2018
+ */
2019
+ items: {
2020
+ type: Array,
2021
+ default: void 0
2022
+ }
2023
+ },
2024
+ emits: ["update:modelValue"],
2025
+ setup(e, { emit: s }) {
2026
+ const l = e, u = T(null), d = T(null), { selectedValue: c, hiddenSelectedItemCount: y, isMultiItemArrayValue: x, firstItem: g } = Ls({
2027
+ props: G(l),
2028
+ emit: s,
2029
+ dynamicVisibility: { elementToWatchForChanges: u, itemContainer: d }
2030
+ }), o = (C, p) => C.name.toLocaleLowerCase().includes(p.toLocaleLowerCase());
2031
+ return (C, p) => (a(), L(Js, {
2032
+ modelValue: t(c),
2033
+ "onUpdate:modelValue": p[0] || (p[0] = (m) => Z(c) ? c.value = m : null),
2034
+ multiple: e.multiple,
2035
+ items: e.items ?? t(Ue),
2036
+ search: e.search,
2037
+ "search-placeholder": e.searchPlaceholder,
2038
+ label: e.label,
2039
+ "show-label": e.showLabel,
2040
+ name: e.name || "sourceApps",
2041
+ "filter-predicate": o,
2042
+ by: "name"
2043
+ }, {
2044
+ "nothing-selected": F(() => [
2045
+ e.selectorPlaceholder ? (a(), f(q, { key: 0 }, [
2046
+ R(w(e.selectorPlaceholder), 1)
2047
+ ], 64)) : (a(), f(q, { key: 1 }, [
2048
+ R(w(e.multiple ? "Select apps" : "Select an app"), 1)
2049
+ ], 64))
2050
+ ]),
2051
+ "something-selected": F(({ value: m }) => [
2052
+ t(x)(m) ? (a(), f("div", {
2053
+ key: 0,
2054
+ ref_key: "elementToWatchForChanges",
2055
+ ref: u,
2056
+ class: "flex items-center space-x-0.5 h-5"
2057
+ }, [
2058
+ r("div", {
2059
+ ref_key: "itemContainer",
2060
+ ref: d,
2061
+ class: "flex flex-wrap overflow-hidden space-x-0.5 h-5"
2062
+ }, [
2063
+ (a(!0), f(q, null, Y(m, (k) => (a(), L(Qs, {
2064
+ key: k.name,
2065
+ "source-app": k
2066
+ }, null, 8, ["source-app"]))), 128))
2067
+ ], 512),
2068
+ t(y) > 0 ? (a(), f("div", Ys, " +" + w(t(y)), 1)) : $("", !0)
2069
+ ], 512)) : (a(), f("div", Zs, [
2070
+ r("div", {
2071
+ class: "h-2 w-2 rounded-full mr-2",
2072
+ style: te({ backgroundColor: t(g)(m).bgColor })
2073
+ }, null, 4),
2074
+ r("span", el, w(t(g)(m).name), 1)
2075
+ ]))
2076
+ ]),
2077
+ option: F(({ item: m }) => [
2078
+ r("div", tl, [
2079
+ r("div", {
2080
+ class: "h-2 w-2 rounded-full mr-2",
2081
+ style: te({ backgroundColor: m.bgColor })
2082
+ }, null, 4),
2083
+ r("span", sl, w(m.name), 1)
2084
+ ])
2085
+ ]),
2086
+ _: 1
2087
+ }, 8, ["modelValue", "multiple", "items", "search", "search-placeholder", "label", "show-label", "name"]));
2088
+ }
2089
+ });
2090
+ var N = /* @__PURE__ */ ((e) => (e.CtrlOrCmd = "cmd-or-ctrl", e.AltOrOpt = "alt-or-opt", e.Shift = "shift", e))(N || {});
2091
+ const ne = We(), ll = {
2092
+ [
2093
+ "cmd-or-ctrl"
2094
+ /* CtrlOrCmd */
2095
+ ]: ne === le.Mac ? "Cmd" : "Ctrl",
2096
+ [
2097
+ "alt-or-opt"
2098
+ /* AltOrOpt */
2099
+ ]: ne === le.Mac ? "Opt" : "Alt",
2100
+ shift: "Shift"
2101
+ };
2102
+ function $l(e) {
2103
+ const s = (l) => Object.values(N).includes(l);
2104
+ return e.map((l) => s(l) ? ll[l] : l).join("+");
2105
+ }
2106
+ function Sl(e, ...s) {
2107
+ Xe(
2108
+ s[0],
2109
+ (l) => {
2110
+ const u = l.getModifierState("Alt"), d = ne === le.Mac ? l.getModifierState("Meta") : l.getModifierState("Control"), c = l.getModifierState("Shift");
2111
+ for (const y of e)
2112
+ switch (y) {
2113
+ case N.CtrlOrCmd:
2114
+ if (!d)
2115
+ return;
2116
+ break;
2117
+ case N.AltOrOpt:
2118
+ if (!u)
2119
+ return;
2120
+ break;
2121
+ case N.Shift:
2122
+ if (!c)
2123
+ return;
2124
+ break;
2125
+ }
2126
+ s[1](l);
2127
+ },
2128
+ s[2]
2129
+ );
2130
+ }
2131
+ export {
2132
+ Ct as CommonBadge,
2133
+ As as CommonLoadingBar,
2134
+ bl as CommonStepsBullet,
2135
+ gl as CommonStepsNumber,
2136
+ it as CommonTextLink,
2137
+ rt as FormButton,
2138
+ yl as FormCardButton,
2139
+ vl as FormCheckbox,
2140
+ Js as FormSelectBase,
2141
+ wl as FormSelectSourceApps,
2142
+ xl as FormTextArea,
2143
+ kl as FormTextInput,
2144
+ ml as GlobalToastRenderer,
2145
+ N as ModifierKeys,
2146
+ Qs as SourceAppBadge,
2147
+ X as TailwindBreakpoints,
2148
+ K as ToastNotificationType,
2149
+ Cl as ValidationHelpers,
2150
+ ne as clientOs,
2151
+ $l as getKeyboardShortcutTitle,
2152
+ Sl as onKeyboardShortcut,
2153
+ Ls as useFormSelectChildInternals,
2154
+ Vs as useWrappingContainerHiddenCount
2155
+ };