@wssto2/vue-core 0.17.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,59 +1,58 @@
1
- import { a as rt, _ as Je, c as it, f as ut } from "../FormGroup.vue_vue_type_script_setup_true_lang-lvAuBG-0.js";
2
- import { E as Oo, b as jo, d as Eo, p as Ao, r as Go, u as Ko, e as Po, g as Ho } from "../FormGroup.vue_vue_type_script_setup_true_lang-lvAuBG-0.js";
3
- import { f as Le } from "../useCommand-DQKvro1n.js";
4
- import { _ as Yo, a as Wo, u as Jo } from "../useCommand-DQKvro1n.js";
5
- import { ref as P, computed as h, defineComponent as G, openBlock as d, createBlock as M, mergeProps as J, unref as s, createSlots as Z, withCtx as f, createElementVNode as p, normalizeClass as I, createElementBlock as y, Fragment as de, renderList as $e, createVNode as N, createCommentVNode as L, toDisplayString as C, renderSlot as S, mergeDefaults as ce, useModel as re, useId as Me, withKeys as Se, withModifiers as pe, createTextVNode as H, mergeModels as le, useTemplateRef as U, shallowRef as Ee, watch as ge, normalizeProps as qe, guardReactiveProps as Ve, nextTick as xe, provide as dt, inject as Ze, onBeforeUnmount as Xe, getCurrentScope as ct, onScopeDispose as ft, toValue as mt, shallowReactive as Ae, normalizeStyle as vt, resolveDynamicComponent as pt } from "vue";
6
- import { a as Qe } from "../leaveGuard-Cc8yeLxM.js";
7
- import { M as Xo, c as Qo, i as en, l as tn, u as an } from "../leaveGuard-Cc8yeLxM.js";
8
- import { _ as on } from "../LeaveGuardRoot.vue_vue_type_script_setup_true_lang-CrGrjrlO.js";
1
+ import { a as St, _ as it, c as Ft, f as qt, E as Bt } from "../FormGroup.vue_vue_type_script_setup_true_lang-lvAuBG-0.js";
2
+ import { b as Ir, d as Ar, p as Nr, r as Pr, u as Kr, e as Gr, g as Hr } from "../FormGroup.vue_vue_type_script_setup_true_lang-lvAuBG-0.js";
3
+ import { f as Me } from "../useCommand-DQKvro1n.js";
4
+ import { _ as Yr, a as Jr, u as Zr } from "../useCommand-DQKvro1n.js";
5
+ import { ref as H, computed as q, defineComponent as J, openBlock as d, createBlock as z, mergeProps as N, unref as s, createSlots as ie, withCtx as k, createElementVNode as x, normalizeClass as W, createElementBlock as g, Fragment as ee, renderList as ce, createVNode as U, createCommentVNode as j, toDisplayString as B, renderSlot as R, mergeDefaults as me, useModel as ke, useId as Ie, withKeys as Fe, withModifiers as he, createTextVNode as Z, mergeModels as ve, useTemplateRef as oe, shallowRef as We, watch as be, normalizeProps as Re, guardReactiveProps as Ue, nextTick as we, provide as ut, inject as De, onBeforeUnmount as ze, getCurrentScope as Lt, onScopeDispose as Tt, toValue as Dt, shallowReactive as Ye, normalizeStyle as zt, resolveDynamicComponent as jt, onMounted as dt, withDirectives as ct, vModelText as mt } from "vue";
6
+ import { a as ft } from "../leaveGuard-Cc8yeLxM.js";
7
+ import { M as Qr, c as en, i as tn, l as an, u as ln } from "../leaveGuard-Cc8yeLxM.js";
8
+ import { _ as rn } from "../LeaveGuardRoot.vue_vue_type_script_setup_true_lang-CrGrjrlO.js";
9
9
  import { u as sn } from "../useResourceForm-zVuWerSn.js";
10
- import { _ as X } from "../Icon.vue_vue_type_script_lang-BhhsFYwp.js";
11
- import { _ as ye, u as Re } from "../options-mOOX6JSS.js";
12
- import { g as un, m as dn } from "../options-mOOX6JSS.js";
13
- import { u as et, f as fe, b as me, a as tt, _ as bt, e as gt, g as yt } from "../FormRow.vue_vue_type_script_setup_true_lang-CpgNVQF4.js";
10
+ import { _ as ue } from "../Icon.vue_vue_type_script_lang-BhhsFYwp.js";
11
+ import { _ as ye, u as Ae } from "../options-mOOX6JSS.js";
12
+ import { g as dn, m as cn } from "../options-mOOX6JSS.js";
13
+ import { u as qe, f as fe, b as pe, a as pt, _ as Ot, e as Mt, g as Rt } from "../FormRow.vue_vue_type_script_setup_true_lang-CpgNVQF4.js";
14
14
  import { c as fn } from "../FormRow.vue_vue_type_script_setup_true_lang-CpgNVQF4.js";
15
- import { useI18n as oe } from "vue-i18n";
16
- import { b as ht } from "../controlSurface-t7OEFESJ.js";
17
- import { a as kt } from "../TextField.vue_vue_type_script_setup_true_lang-CVGh-p3J.js";
18
- import { _ as vn } from "../TextField.vue_vue_type_script_setup_true_lang-CVGh-p3J.js";
19
- import { u as xt, l as wt } from "../suggestions-DeMgs_ki.js";
20
- import { r as bn } from "../suggestions-DeMgs_ki.js";
21
- import { o as _e, q as $t, m as _t, s as Ce, u as Ge, i as Ct, e as Fe, k as St, _ as Ft, l as Bt, c as Tt, b as Dt, t as De, g as Lt, v as qt } from "../useTypedEntry-BsMV66Yc.js";
22
- import { u as Vt, a as zt, s as Mt } from "../DateField.vue_vue_type_script_setup_true_lang-D0KcfW8R.js";
23
- import { _ as yn } from "../DateField.vue_vue_type_script_setup_true_lang-D0KcfW8R.js";
24
- import { _ as at } from "../DateButton.vue_vue_type_script_setup_true_lang-CovKG5lN.js";
25
- import { u as lt } from "../format-C_HXlOYQ.js";
15
+ import { useI18n as re } from "vue-i18n";
16
+ import { b as Ut } from "../controlSurface-t7OEFESJ.js";
17
+ import { a as Et, _ as Je } from "../TextField.vue_vue_type_script_setup_true_lang-CVGh-p3J.js";
18
+ import { u as It, l as At } from "../suggestions-DeMgs_ki.js";
19
+ import { r as vn } from "../suggestions-DeMgs_ki.js";
20
+ import { o as Ce, q as Nt, m as Pt, s as Se, u as Ze, i as Kt, e as Be, k as Gt, _ as Ht, l as Wt, c as Yt, b as Jt, t as Oe, g as Zt, v as Xt } from "../useTypedEntry-BsMV66Yc.js";
21
+ import { u as Qt, a as ea, s as ta, _ as aa } from "../DateField.vue_vue_type_script_setup_true_lang-D0KcfW8R.js";
22
+ import { _ as vt } from "../DateButton.vue_vue_type_script_setup_true_lang-CovKG5lN.js";
23
+ import { u as bt } from "../format-C_HXlOYQ.js";
26
24
  import { u as Ne } from "../mediaQuery-CygcXmFW.js";
27
- import { _ as Ie } from "../Popover.vue_vue_type_script_setup_true_lang-BK8HL_V0.js";
28
- import { u as Rt } from "../TimeField.vue_vue_type_script_setup_true_lang-DHNC_MLt.js";
29
- import { _ as kn } from "../TimeField.vue_vue_type_script_setup_true_lang-DHNC_MLt.js";
30
- import { _ as be } from "../Button.vue_vue_type_script_setup_true_lang-JrqhO99l.js";
31
- import { _ as wn } from "../FormView.vue_vue_type_script_setup_true_lang-D01Jr4UU.js";
32
- import { a as Nt } from "../environment-Dva-SG8D.js";
33
- import { _ as It } from "../NumberField.vue_vue_type_script_setup_true_lang-BhNZgEW6.js";
34
- import { _ as Ot } from "../Sheet.vue_vue_type_script_setup_true_lang-BG8HUNfs.js";
35
- import { b as jt, a as Ke } from "../SelectField.vue_vue_type_script_setup_true_lang-D5xYofdb.js";
36
- import { _ as _n, u as Cn } from "../SelectField.vue_vue_type_script_setup_true_lang-D5xYofdb.js";
37
- import { _ as Fn, b as Bn, a as Tn, u as Dn } from "../useGroupSheet-CRw3MUmX.js";
38
- import { _ as Pe } from "../PhotoViewer.vue_vue_type_script_setup_true_lang-DmMg1T_V.js";
39
- import { _ as qn } from "../SegmentedField.vue_vue_type_script_setup_true_lang-CLR6EvzO.js";
40
- import { _ as zn } from "../SwitchField.vue_vue_type_script_setup_true_lang-CLtcuofe.js";
41
- import { _ as Rn } from "../TextareaField.vue_vue_type_script_setup_true_lang-YxUlNHSk.js";
42
- import { _ as Et } from "../AdaptivePageShell.vue_vue_type_script_setup_true_lang-oXWQTfBs.js";
43
- import { _ as At, a as Gt } from "../SectionList.vue_vue_type_script_setup_true_lang-CodyVezo.js";
44
- import { p as Kt } from "../sectionIndex-BS0ic5W7.js";
45
- import { u as Pt } from "../useSaveChrome-DB9OwIjT.js";
46
- import { u as In } from "../useRecordDialog-0azHxxvm.js";
47
- import { matchedRouteKey as Ht, onBeforeRouteLeave as Ut } from "vue-router";
48
- function Yt(l) {
49
- const t = P(null);
25
+ import { _ as Pe } from "../Popover.vue_vue_type_script_setup_true_lang-BK8HL_V0.js";
26
+ import { u as la } from "../TimeField.vue_vue_type_script_setup_true_lang-DHNC_MLt.js";
27
+ import { _ as yn } from "../TimeField.vue_vue_type_script_setup_true_lang-DHNC_MLt.js";
28
+ import { _ as ae } from "../Button.vue_vue_type_script_setup_true_lang-JrqhO99l.js";
29
+ import { _ as hn } from "../FormView.vue_vue_type_script_setup_true_lang-D01Jr4UU.js";
30
+ import { a as yt } from "../environment-Dva-SG8D.js";
31
+ import { _ as gt } from "../NumberField.vue_vue_type_script_setup_true_lang-BhNZgEW6.js";
32
+ import { _ as oa } from "../Sheet.vue_vue_type_script_setup_true_lang-BG8HUNfs.js";
33
+ import { b as ra, a as Xe, _ as na } from "../SelectField.vue_vue_type_script_setup_true_lang-D5xYofdb.js";
34
+ import { u as _n } from "../SelectField.vue_vue_type_script_setup_true_lang-D5xYofdb.js";
35
+ import { _ as wn, b as $n, a as Vn, u as Cn } from "../useGroupSheet-CRw3MUmX.js";
36
+ import { _ as Qe } from "../PhotoViewer.vue_vue_type_script_setup_true_lang-DmMg1T_V.js";
37
+ import { _ as Fn } from "../SegmentedField.vue_vue_type_script_setup_true_lang-CLR6EvzO.js";
38
+ import { _ as sa } from "../SwitchField.vue_vue_type_script_setup_true_lang-CLtcuofe.js";
39
+ import { _ as et } from "../TextareaField.vue_vue_type_script_setup_true_lang-YxUlNHSk.js";
40
+ import { _ as ia } from "../AdaptivePageShell.vue_vue_type_script_setup_true_lang-oXWQTfBs.js";
41
+ import { _ as ua, a as da } from "../SectionList.vue_vue_type_script_setup_true_lang-CodyVezo.js";
42
+ import { p as ca } from "../sectionIndex-BS0ic5W7.js";
43
+ import { u as ma } from "../useSaveChrome-DB9OwIjT.js";
44
+ import { u as Bn } from "../useRecordDialog-0azHxxvm.js";
45
+ import { matchedRouteKey as fa, onBeforeRouteLeave as pa } from "vue-router";
46
+ import { t as Ke, c as ht, _ as kt } from "../resources-BZLlAtoS.js";
47
+ function va(l) {
48
+ const t = H(null);
50
49
  return {
51
- isDirty: h(() => t.value !== null && JSON.stringify(l()) !== t.value),
50
+ isDirty: q(() => t.value !== null && JSON.stringify(l()) !== t.value),
52
51
  markClean: () => t.value = JSON.stringify(l())
53
52
  };
54
53
  }
55
- function po(l) {
56
- const t = P(!1), e = Yt(l), { confirmDiscard: a } = Qe(() => t.value && e.isDirty.value);
54
+ function kr(l) {
55
+ const t = H(!1), e = va(l), { confirmDiscard: a } = ft(() => t.value && e.isDirty.value);
57
56
  return {
58
57
  /** The sheet was just filled: its current values are the baseline. */
59
58
  opened: () => {
@@ -66,46 +65,46 @@ function po(l) {
66
65
  beforeDismiss: a
67
66
  };
68
67
  }
69
- const He = (l, t) => {
68
+ const tt = (l, t) => {
70
69
  const e = Number(t);
71
70
  if (Number.isInteger(e) && Math.abs(e) < 1e4) return String(e);
72
71
  const a = Number.isInteger(e) ? 0 : 2;
73
72
  return l.number(e, { minimumFractionDigits: a, maximumFractionDigits: a });
74
73
  };
75
- function bo({ i18n: l, format: t }) {
76
- const { t: e, te: a } = l.global, o = (r) => `validation_errors.${r}`, n = (r) => `core.validation_errors.${r}`, u = (r, m) => ({ message: e(a(o(r)) ? o(r) : n(r), m) });
77
- return (r) => {
78
- switch (r.code) {
74
+ function _r({ i18n: l, format: t }) {
75
+ const { t: e, te: a } = l.global, r = (u) => `validation_errors.${u}`, i = (u) => `core.validation_errors.${u}`, p = (u, b) => ({ message: e(a(r(u)) ? r(u) : i(u), b) });
76
+ return (u) => {
77
+ switch (u.code) {
79
78
  case "invalid_type":
80
- return u("required");
79
+ return p("required");
81
80
  case "too_small":
82
- return r.origin === "string" ? Number(r.minimum) === 1 ? u("required") : u("min", { min: Number(r.minimum) }) : r.origin === "number" ? u("min_value", { min: He(t, r.minimum) }) : void 0;
81
+ return u.origin === "string" ? Number(u.minimum) === 1 ? p("required") : p("min", { min: Number(u.minimum) }) : u.origin === "number" ? p("min_value", { min: tt(t, u.minimum) }) : void 0;
83
82
  case "too_big":
84
- return r.origin === "string" ? u("max", { max: Number(r.maximum) }) : r.origin === "number" ? u("max_value", { max: He(t, r.maximum) }) : void 0;
83
+ return u.origin === "string" ? p("max", { max: Number(u.maximum) }) : u.origin === "number" ? p("max_value", { max: tt(t, u.maximum) }) : void 0;
85
84
  case "invalid_format":
86
- return r.format !== void 0 && ["email", "url", "date", "datetime"].includes(r.format) ? u(r.format) : void 0;
85
+ return u.format !== void 0 && ["email", "url", "date", "datetime"].includes(u.format) ? p(u.format) : void 0;
87
86
  case "custom": {
88
- const m = r.params?.code;
89
- if (typeof m != "string") return;
90
- if (m === "required") return u("required");
91
- const k = a(o(m)) ? o(m) : a(n(m)) ? n(m) : null;
92
- return k === null ? void 0 : { message: e(k) };
87
+ const b = u.params?.code;
88
+ if (typeof b != "string") return;
89
+ if (b === "required") return p("required");
90
+ const _ = a(r(b)) ? r(b) : a(i(b)) ? i(b) : null;
91
+ return _ === null ? void 0 : { message: e(_) };
93
92
  }
94
93
  default:
95
94
  return;
96
95
  }
97
96
  };
98
97
  }
99
- const Wt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Jt = ["name", "value", "checked", "disabled", "onChange"], Zt = { class: "min-w-0 flex-1" }, Xt = { class: "block text-body font-semibold text-content-strong" }, Qt = {
98
+ const ba = ["id", "aria-label", "aria-describedby", "aria-invalid"], ya = ["name", "value", "checked", "disabled", "onChange"], ga = { class: "min-w-0 flex-1" }, ha = { class: "block text-body font-semibold text-content-strong" }, ka = {
100
99
  key: 0,
101
100
  class: "mt-0.5 block text-footnote text-content-muted"
102
- }, ea = {
101
+ }, _a = {
103
102
  key: 1,
104
103
  class: "flex size-5 shrink-0 items-center justify-center rounded-full bg-control-on text-white",
105
104
  "aria-hidden": "true"
106
- }, go = /* @__PURE__ */ G({
105
+ }, xr = /* @__PURE__ */ J({
107
106
  __name: "CardSelectField",
108
- props: /* @__PURE__ */ ce({
107
+ props: /* @__PURE__ */ me({
109
108
  label: {},
110
109
  labelHidden: { type: Boolean },
111
110
  hint: {},
@@ -119,90 +118,90 @@ const Wt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Jt = ["name
119
118
  modelValue: {},
120
119
  options: {},
121
120
  columns: {}
122
- }, { ...me, modelValue: null, columns: 2 }),
121
+ }, { ...pe, modelValue: null, columns: 2 }),
123
122
  emits: ["update:modelValue"],
124
123
  setup(l, { emit: t }) {
125
- const e = l, a = t, { editable: o } = et(e), n = { 1: "grid-cols-1", 2: "grid-cols-2", 3: "grid-cols-3", 4: "grid-cols-4" }, u = h(() => n[e.columns]);
126
- return (r, m) => (d(), M(ye, J(s(fe)(e), {
127
- value: e.options.find((k) => k.value === e.modelValue)?.label ?? null,
124
+ const e = l, a = t, { editable: r } = qe(e), i = { 1: "grid-cols-1", 2: "grid-cols-2", 3: "grid-cols-3", 4: "grid-cols-4" }, p = q(() => i[e.columns]);
125
+ return (u, b) => (d(), z(ye, N(s(fe)(e), {
126
+ value: e.options.find((_) => _.value === e.modelValue)?.label ?? null,
128
127
  "row-layout": "stacked"
129
- }), Z({
130
- default: f(({ id: k, describedby: x, invalid: $ }) => [
131
- p("div", {
132
- id: k,
128
+ }), ie({
129
+ default: k(({ id: _, describedby: V, invalid: $ }) => [
130
+ x("div", {
131
+ id: _,
133
132
  role: "radiogroup",
134
133
  "aria-label": e.label,
135
- "aria-describedby": x,
134
+ "aria-describedby": V,
136
135
  "aria-invalid": $ || void 0,
137
- class: I(["grid w-full gap-2.5", u.value]),
136
+ class: W(["grid w-full gap-2.5", p.value]),
138
137
  "data-test": "card-select"
139
138
  }, [
140
- (d(!0), y(de, null, $e(e.options, (i) => (d(), y("label", {
141
- key: i.value,
142
- class: I(["relative flex items-center gap-3 rounded-group bg-fill p-3.5 transition-colors duration-motion-fast focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-border-focus", [i.value === e.modelValue ? "bg-tint-soft ring-[1.5px] ring-inset ring-border-selected" : "hover:bg-fill-strong", e.disabled || !s(o) || i.disabled ? "cursor-not-allowed opacity-60" : "cursor-pointer"]])
139
+ (d(!0), g(ee, null, ce(e.options, (n) => (d(), g("label", {
140
+ key: n.value,
141
+ class: W(["relative flex items-center gap-3 rounded-group bg-fill p-3.5 transition-colors duration-motion-fast focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-border-focus", [n.value === e.modelValue ? "bg-tint-soft ring-[1.5px] ring-inset ring-border-selected" : "hover:bg-fill-strong", e.disabled || !s(r) || n.disabled ? "cursor-not-allowed opacity-60" : "cursor-pointer"]])
143
142
  }, [
144
- p("input", {
143
+ x("input", {
145
144
  type: "radio",
146
145
  class: "sr-only",
147
- name: e.name ?? k,
148
- value: i.value,
149
- checked: i.value === e.modelValue,
150
- disabled: e.disabled || !s(o) || i.disabled,
151
- onChange: (v) => a("update:modelValue", i.value)
152
- }, null, 40, Jt),
153
- i.icon ? (d(), y("span", {
146
+ name: e.name ?? _,
147
+ value: n.value,
148
+ checked: n.value === e.modelValue,
149
+ disabled: e.disabled || !s(r) || n.disabled,
150
+ onChange: (c) => a("update:modelValue", n.value)
151
+ }, null, 40, ya),
152
+ n.icon ? (d(), g("span", {
154
153
  key: 0,
155
- class: I(["flex size-9 shrink-0 items-center justify-center rounded-control", i.value === e.modelValue ? "bg-control-on text-white" : "bg-fill-strong text-content-muted"])
154
+ class: W(["flex size-9 shrink-0 items-center justify-center rounded-control", n.value === e.modelValue ? "bg-control-on text-white" : "bg-fill-strong text-content-muted"])
156
155
  }, [
157
- N(s(X), {
158
- name: i.icon,
156
+ U(s(ue), {
157
+ name: n.icon,
159
158
  size: 18
160
159
  }, null, 8, ["name"])
161
- ], 2)) : L("", !0),
162
- p("span", Zt, [
163
- p("span", Xt, C(i.label), 1),
164
- i.description ? (d(), y("span", Qt, C(i.description), 1)) : L("", !0)
160
+ ], 2)) : j("", !0),
161
+ x("span", ga, [
162
+ x("span", ha, B(n.label), 1),
163
+ n.description ? (d(), g("span", ka, B(n.description), 1)) : j("", !0)
165
164
  ]),
166
- i.value === e.modelValue ? (d(), y("span", ea, [
167
- N(s(X), {
165
+ n.value === e.modelValue ? (d(), g("span", _a, [
166
+ U(s(ue), {
168
167
  name: "checkCustom",
169
168
  size: 12
170
169
  })
171
- ])) : L("", !0)
170
+ ])) : j("", !0)
172
171
  ], 2))), 128))
173
- ], 10, Wt)
172
+ ], 10, ba)
174
173
  ]),
175
174
  _: 2
176
175
  }, [
177
- r.$slots.trailing ? {
176
+ u.$slots.trailing ? {
178
177
  name: "trailing",
179
- fn: f(() => [
180
- S(r.$slots, "trailing")
178
+ fn: k(() => [
179
+ R(u.$slots, "trailing")
181
180
  ]),
182
181
  key: "0"
183
182
  } : void 0,
184
- r.$slots.labelTrailing ? {
183
+ u.$slots.labelTrailing ? {
185
184
  name: "labelTrailing",
186
- fn: f(() => [
187
- S(r.$slots, "labelTrailing")
185
+ fn: k(() => [
186
+ R(u.$slots, "labelTrailing")
188
187
  ]),
189
188
  key: "1"
190
189
  } : void 0,
191
- r.$slots.readonly ? {
190
+ u.$slots.readonly ? {
192
191
  name: "readonly",
193
- fn: f(() => [
194
- S(r.$slots, "readonly")
192
+ fn: k(() => [
193
+ R(u.$slots, "readonly")
195
194
  ]),
196
195
  key: "2"
197
196
  } : void 0
198
197
  ]), 1040, ["value"]));
199
198
  }
200
- }), ta = ["data-field-error"], aa = ["aria-checked", "aria-disabled", "aria-describedby", "aria-invalid", "tabindex", "onKeydown"], la = { class: "flex min-w-0 flex-1 flex-col items-start" }, oa = {
199
+ }), xa = ["data-field-error"], wa = ["aria-checked", "aria-disabled", "aria-describedby", "aria-invalid", "tabindex", "onKeydown"], $a = { class: "flex min-w-0 flex-1 flex-col items-start" }, Va = {
201
200
  key: 0,
202
201
  class: "flex shrink-0 items-center gap-2.5"
203
- }, na = ["id"], yo = /* @__PURE__ */ G({
202
+ }, Ca = ["id"], wr = /* @__PURE__ */ J({
204
203
  __name: "CheckboxField",
205
- props: /* @__PURE__ */ le({
204
+ props: /* @__PURE__ */ ve({
206
205
  label: {},
207
206
  description: { default: void 0 },
208
207
  disabled: { type: Boolean, default: !1 },
@@ -214,77 +213,77 @@ const Wt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Jt = ["name
214
213
  }),
215
214
  emits: ["update:modelValue"],
216
215
  setup(l) {
217
- const t = l, e = re(l, "modelValue"), a = !!tt(), o = Me(), n = () => {
216
+ const t = l, e = ke(l, "modelValue"), a = !!pt(), r = Ie(), i = () => {
218
217
  t.disabled || (e.value = !e.value);
219
218
  };
220
- return (u, r) => (d(), y("div", {
219
+ return (p, u) => (d(), g("div", {
221
220
  class: "group/check",
222
221
  "data-field-error": t.error ? "true" : void 0
223
222
  }, [
224
- p("div", {
223
+ x("div", {
225
224
  role: "checkbox",
226
225
  "aria-checked": e.value,
227
226
  "aria-disabled": t.disabled || void 0,
228
- "aria-describedby": t.error ? `${s(o)}-error` : void 0,
227
+ "aria-describedby": t.error ? `${s(r)}-error` : void 0,
229
228
  "aria-invalid": t.error ? !0 : void 0,
230
229
  tabindex: t.disabled ? -1 : 0,
231
230
  "data-test": "checkbox",
232
- class: I(["flex items-center transition-colors duration-motion-fast focus-visible:outline-2 focus-visible:outline-border-focus", [t.variant === "row" ? "gap-3 pl-row-inset focus-visible:-outline-offset-2" : "gap-2.5 rounded-control px-2 py-1.5 focus-visible:outline-offset-1", a && t.variant === "row" ? "group-first/check:rounded-t-group group-last/check:rounded-b-group" : "", t.disabled ? "cursor-not-allowed" : t.variant === "row" ? "cursor-pointer hover:bg-fill/60 active:bg-fill" : "cursor-pointer hover:bg-fill"]]),
233
- onClick: n,
231
+ class: W(["flex items-center transition-colors duration-motion-fast focus-visible:outline-2 focus-visible:outline-border-focus", [t.variant === "row" ? "gap-3 pl-row-inset focus-visible:-outline-offset-2" : "gap-2.5 rounded-control px-2 py-1.5 focus-visible:outline-offset-1", a && t.variant === "row" ? "group-first/check:rounded-t-group group-last/check:rounded-b-group" : "", t.disabled ? "cursor-not-allowed" : t.variant === "row" ? "cursor-pointer hover:bg-fill/60 active:bg-fill" : "cursor-pointer hover:bg-fill"]]),
232
+ onClick: i,
234
233
  onKeydown: [
235
- Se(pe(n, ["prevent"]), ["space"]),
236
- Se(pe(n, ["prevent"]), ["enter"])
234
+ Fe(he(i, ["prevent"]), ["space"]),
235
+ Fe(he(i, ["prevent"]), ["enter"])
237
236
  ]
238
237
  }, [
239
- p("span", {
240
- class: I(["flex shrink-0 items-center justify-center rounded-full border-2", [t.variant === "row" ? "size-5.5" : "size-5", e.value ? t.disabled ? "border-content-disabled bg-content-disabled text-white" : "border-control-on bg-control-on text-white" : "border-border-control"]]),
238
+ x("span", {
239
+ class: W(["flex shrink-0 items-center justify-center rounded-full border-2", [t.variant === "row" ? "size-5.5" : "size-5", e.value ? t.disabled ? "border-content-disabled bg-content-disabled text-white" : "border-control-on bg-control-on text-white" : "border-border-control"]]),
241
240
  "aria-hidden": "true"
242
241
  }, [
243
- e.value ? (d(), M(s(X), {
242
+ e.value ? (d(), z(s(ue), {
244
243
  key: 0,
245
244
  name: "checkCustom",
246
245
  size: 12
247
- })) : L("", !0)
246
+ })) : j("", !0)
248
247
  ], 2),
249
- p("div", {
250
- class: I(["flex min-w-0 flex-1 items-center gap-3", t.variant === "row" ? "min-h-row border-t border-border-separator py-2 pr-row-inset group-first/check:border-t-0" : ""])
248
+ x("div", {
249
+ class: W(["flex min-w-0 flex-1 items-center gap-3", t.variant === "row" ? "min-h-row border-t border-border-separator py-2 pr-row-inset group-first/check:border-t-0" : ""])
251
250
  }, [
252
- p("div", la, [
253
- p("p", {
254
- class: I(["w-full text-body", [t.variant === "row" ? "break-words" : "truncate", t.disabled ? "text-content-muted" : e.value ? "text-content-strong" : "text-content"]])
255
- }, C(t.label), 3),
256
- t.description ? (d(), y("p", {
251
+ x("div", $a, [
252
+ x("p", {
253
+ class: W(["w-full text-body", [t.variant === "row" ? "break-words" : "truncate", t.disabled ? "text-content-muted" : e.value ? "text-content-strong" : "text-content"]])
254
+ }, B(t.label), 3),
255
+ t.description ? (d(), g("p", {
257
256
  key: 0,
258
- class: I(["tabular-nums text-content-muted", t.variant === "row" ? "text-footnote" : "text-xs"])
259
- }, C(t.description), 3)) : L("", !0),
260
- S(u.$slots, "default")
257
+ class: W(["tabular-nums text-content-muted", t.variant === "row" ? "text-footnote" : "text-xs"])
258
+ }, B(t.description), 3)) : j("", !0),
259
+ R(p.$slots, "default")
261
260
  ]),
262
- u.$slots.trailing ? (d(), y("div", oa, [
263
- S(u.$slots, "trailing")
264
- ])) : L("", !0)
261
+ p.$slots.trailing ? (d(), g("div", Va, [
262
+ R(p.$slots, "trailing")
263
+ ])) : j("", !0)
265
264
  ], 2)
266
- ], 42, aa),
267
- t.error ? (d(), y("p", {
265
+ ], 42, wa),
266
+ t.error ? (d(), g("p", {
268
267
  key: 0,
269
- id: `${s(o)}-error`,
268
+ id: `${s(r)}-error`,
270
269
  role: "alert",
271
270
  class: "flex items-start gap-1.5 px-2 pt-1 text-footnote text-content-destructive"
272
271
  }, [
273
- N(s(X), {
272
+ U(s(ue), {
274
273
  name: "alertTriangle",
275
274
  size: 14,
276
275
  class: "mt-px shrink-0"
277
276
  }),
278
- H(" " + C(t.error), 1)
279
- ], 8, na)) : L("", !0)
280
- ], 8, ta));
277
+ Z(" " + B(t.error), 1)
278
+ ], 8, Ca)) : j("", !0)
279
+ ], 8, xa));
281
280
  }
282
- }), sa = {
281
+ }), Sa = {
283
282
  key: 0,
284
283
  class: "text-body text-content-muted"
285
- }, ra = ["id", "aria-label", "aria-describedby", "aria-invalid"], ia = ["aria-pressed", "disabled", "onClick"], ho = /* @__PURE__ */ G({
284
+ }, Fa = ["id", "aria-label", "aria-describedby", "aria-invalid"], qa = ["aria-pressed", "disabled", "onClick"], $r = /* @__PURE__ */ J({
286
285
  __name: "ChoiceChips",
287
- props: /* @__PURE__ */ le(/* @__PURE__ */ ce({
286
+ props: /* @__PURE__ */ ve(/* @__PURE__ */ me({
288
287
  label: {},
289
288
  labelHidden: { type: Boolean },
290
289
  hint: {},
@@ -296,77 +295,77 @@ const Wt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Jt = ["name
296
295
  presentation: {},
297
296
  name: {},
298
297
  options: {}
299
- }, { ...me }), {
298
+ }, { ...pe }), {
300
299
  modelValue: { default: () => [] },
301
300
  modelModifiers: {}
302
301
  }),
303
302
  emits: ["update:modelValue"],
304
303
  setup(l) {
305
- const t = l, e = re(l, "modelValue"), a = (o) => e.value = e.value.includes(o) ? e.value.filter((n) => n !== o) : [...e.value, o];
306
- return (o, n) => (d(), M(ye, J(s(fe)(t), {
307
- value: t.options.filter((u) => e.value.includes(u.value)).map((u) => u.label).join(", ") || null,
304
+ const t = l, e = ke(l, "modelValue"), a = (r) => e.value = e.value.includes(r) ? e.value.filter((i) => i !== r) : [...e.value, r];
305
+ return (r, i) => (d(), z(ye, N(s(fe)(t), {
306
+ value: t.options.filter((p) => e.value.includes(p.value)).map((p) => p.label).join(", ") || null,
308
307
  "row-layout": "stacked"
309
- }), Z({
310
- default: f(({ id: u, describedby: r, invalid: m }) => [
311
- t.options.length === 0 ? (d(), y("span", sa, "—")) : (d(), y("div", {
308
+ }), ie({
309
+ default: k(({ id: p, describedby: u, invalid: b }) => [
310
+ t.options.length === 0 ? (d(), g("span", Sa, "—")) : (d(), g("div", {
312
311
  key: 1,
313
- id: u,
312
+ id: p,
314
313
  role: "group",
315
314
  "aria-label": t.label,
316
- "aria-describedby": r,
317
- "aria-invalid": m || void 0,
315
+ "aria-describedby": u,
316
+ "aria-invalid": b || void 0,
318
317
  class: "flex flex-wrap gap-1.5 py-1",
319
318
  "data-test": "choice-chips"
320
319
  }, [
321
- (d(!0), y(de, null, $e(t.options, (k) => (d(), y("button", {
322
- key: k.value,
320
+ (d(!0), g(ee, null, ce(t.options, (_) => (d(), g("button", {
321
+ key: _.value,
323
322
  type: "button",
324
- "aria-pressed": e.value.includes(k.value),
325
- disabled: t.disabled || k.disabled,
326
- class: I(["inline-flex min-h-8 cursor-pointer items-center gap-1.5 rounded-full px-3 text-subheadline transition-colors duration-motion-fast focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus disabled:cursor-not-allowed disabled:opacity-60", e.value.includes(k.value) ? "bg-tint-soft font-semibold text-content-link" : "bg-fill font-medium text-content-strong hover:bg-fill-strong"]),
327
- onClick: (x) => a(k.value)
323
+ "aria-pressed": e.value.includes(_.value),
324
+ disabled: t.disabled || _.disabled,
325
+ class: W(["inline-flex min-h-8 cursor-pointer items-center gap-1.5 rounded-full px-3 text-subheadline transition-colors duration-motion-fast focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus disabled:cursor-not-allowed disabled:opacity-60", e.value.includes(_.value) ? "bg-tint-soft font-semibold text-content-link" : "bg-fill font-medium text-content-strong hover:bg-fill-strong"]),
326
+ onClick: (V) => a(_.value)
328
327
  }, [
329
- e.value.includes(k.value) ? (d(), M(s(X), {
328
+ e.value.includes(_.value) ? (d(), z(s(ue), {
330
329
  key: 0,
331
330
  name: "checkCustom",
332
331
  size: 12
333
- })) : L("", !0),
334
- H(" " + C(k.label), 1)
335
- ], 10, ia))), 128))
336
- ], 8, ra))
332
+ })) : j("", !0),
333
+ Z(" " + B(_.label), 1)
334
+ ], 10, qa))), 128))
335
+ ], 8, Fa))
337
336
  ]),
338
337
  _: 2
339
338
  }, [
340
- o.$slots.trailing ? {
339
+ r.$slots.trailing ? {
341
340
  name: "trailing",
342
- fn: f(() => [
343
- S(o.$slots, "trailing")
341
+ fn: k(() => [
342
+ R(r.$slots, "trailing")
344
343
  ]),
345
344
  key: "0"
346
345
  } : void 0,
347
- o.$slots.labelTrailing ? {
346
+ r.$slots.labelTrailing ? {
348
347
  name: "labelTrailing",
349
- fn: f(() => [
350
- S(o.$slots, "labelTrailing")
348
+ fn: k(() => [
349
+ R(r.$slots, "labelTrailing")
351
350
  ]),
352
351
  key: "1"
353
352
  } : void 0,
354
- o.$slots.readonly ? {
353
+ r.$slots.readonly ? {
355
354
  name: "readonly",
356
- fn: f(() => [
357
- S(o.$slots, "readonly")
355
+ fn: k(() => [
356
+ R(r.$slots, "readonly")
358
357
  ]),
359
358
  key: "2"
360
359
  } : void 0
361
360
  ]), 1040, ["value"]));
362
361
  }
363
- }), ua = {
362
+ }), Ba = {
364
363
  key: 0,
365
364
  class: "flex shrink-0 items-center",
366
365
  "data-test": "field-value"
367
- }, da = ["id", "value", "name", "placeholder", "disabled", "required", "aria-expanded", "aria-controls", "aria-activedescendant", "aria-required", "aria-invalid", "aria-describedby"], ca = { class: "block break-words text-body text-content-strong" }, ko = /* @__PURE__ */ G({
366
+ }, La = ["id", "value", "name", "placeholder", "disabled", "required", "aria-expanded", "aria-controls", "aria-activedescendant", "aria-required", "aria-invalid", "aria-describedby"], Ta = { class: "block break-words text-body text-content-strong" }, Vr = /* @__PURE__ */ J({
368
367
  __name: "ComboField",
369
- props: /* @__PURE__ */ le(/* @__PURE__ */ ce({
368
+ props: /* @__PURE__ */ ve(/* @__PURE__ */ me({
370
369
  label: {},
371
370
  labelHidden: { type: Boolean },
372
371
  hint: {},
@@ -387,104 +386,104 @@ const Wt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Jt = ["name
387
386
  recents: {},
388
387
  width: {},
389
388
  rowLayout: {}
390
- }, { ...me, options: void 0, search: void 0, selected: null, placeholder: void 0, minLength: 1, debounce: 300, limit: 30, recents: void 0, width: "md", rowLayout: void 0 }), {
389
+ }, { ...pe, options: void 0, search: void 0, selected: null, placeholder: void 0, minLength: 1, debounce: 300, limit: 30, recents: void 0, width: "md", rowLayout: void 0 }), {
391
390
  modelValue: { default: null },
392
391
  modelModifiers: {}
393
392
  }),
394
- emits: /* @__PURE__ */ le(["picked", "focus", "blur"], ["update:modelValue"]),
393
+ emits: /* @__PURE__ */ ve(["picked", "focus", "blur"], ["update:modelValue"]),
395
394
  setup(l, { expose: t, emit: e }) {
396
- const a = l, o = re(l, "modelValue"), n = e, { t: u } = oe(), r = !!tt(), m = Re("text", () => a.error ? "error" : a.disabled ? "locked" : "rest"), k = h(() => a.rowLayout === "stacked"), x = h(() => r && !k.value ? ht(a.width) : "w-full"), $ = U("input"), i = U("anchor"), v = Ee(null), g = Ee(""), D = xt({
395
+ const a = l, r = ke(l, "modelValue"), i = e, { t: p } = re(), u = !!pt(), b = Ae("text", () => a.error ? "error" : a.disabled ? "locked" : "rest"), _ = q(() => a.rowLayout === "stacked"), V = q(() => u && !_.value ? Ut(a.width) : "w-full"), $ = oe("input"), n = oe("anchor"), c = We(null), m = We(""), h = It({
397
396
  source: () => a.search ?? a.options,
398
397
  minLength: () => a.minLength,
399
398
  debounce: () => a.debounce,
400
399
  limit: () => a.limit,
401
400
  listAllWhenEmpty: !0,
402
401
  recents: () => a.recents
403
- }), { items: w, open: F, status: O, highlighted: j, showingRecent: E } = D, V = h(() => {
404
- const q = o.value;
405
- return q === null ? null : [v.value, a.selected, ...a.options ?? []].find((A) => A?.value === q) ?? null;
402
+ }), { items: v, open: y, status: S, highlighted: L, showingRecent: T } = h, C = q(() => {
403
+ const D = r.value;
404
+ return D === null ? null : [c.value, a.selected, ...a.options ?? []].find((Q) => Q?.value === D) ?? null;
406
405
  });
407
- ge(V, (q) => {
408
- F.value || (g.value = q?.label ?? "");
406
+ be(C, (D) => {
407
+ y.value || (m.value = D?.label ?? "");
409
408
  }, { immediate: !0 });
410
- function Q(q) {
411
- g.value = q.target.value, D.ask(g.value), g.value === "" && (o.value = null, v.value = null);
409
+ function P(D) {
410
+ m.value = D.target.value, h.ask(m.value), m.value === "" && (r.value = null, c.value = null);
412
411
  }
413
- function ee(q) {
414
- n("focus", q), a.disabled || D.show("");
412
+ function Y(D) {
413
+ i("focus", D), a.disabled || h.show("");
415
414
  }
416
- function ne(q) {
417
- D.close(), D.remember(q), v.value = q, o.value = q.value, g.value = q.label, n("picked", q);
415
+ function M(D) {
416
+ h.close(), h.remember(D), c.value = D, r.value = D.value, m.value = D.label, i("picked", D);
418
417
  }
419
- function ie(q) {
420
- D.close(), g.value = V.value?.label ?? "", n("blur", q);
418
+ function O(D) {
419
+ h.close(), m.value = C.value?.label ?? "", i("blur", D);
421
420
  }
422
- const ue = h(() => wt(F.value, w.value.length, O.value, !0));
423
- return t({ focus: () => $.value?.focus() }), (q, A) => (d(), M(ye, J(s(fe)(a), {
424
- value: V.value?.label ?? null,
421
+ const X = q(() => At(y.value, v.value.length, S.value, !0));
422
+ return t({ focus: () => $.value?.focus() }), (D, Q) => (d(), z(ye, N(s(fe)(a), {
423
+ value: C.value?.label ?? null,
425
424
  "row-layout": a.rowLayout
426
- }), Z({
427
- default: f(({ id: K, describedby: te, invalid: Y }) => [
428
- p("div", {
425
+ }), ie({
426
+ default: k(({ id: te, describedby: ne, invalid: le }) => [
427
+ x("div", {
429
428
  ref_key: "anchor",
430
- ref: i,
431
- class: I(["flex items-center gap-1.5", [s(m), x.value]])
429
+ ref: n,
430
+ class: W(["flex items-center gap-1.5", [s(b), V.value]])
432
431
  }, [
433
- q.$slots.value && V.value ? (d(), y("span", ua, [
434
- S(q.$slots, "value", {
435
- option: V.value
432
+ D.$slots.value && C.value ? (d(), g("span", Ba, [
433
+ R(D.$slots, "value", {
434
+ option: C.value
436
435
  })
437
- ])) : L("", !0),
438
- p("input", {
439
- id: K,
436
+ ])) : j("", !0),
437
+ x("input", {
438
+ id: te,
440
439
  ref_key: "input",
441
440
  ref: $,
442
441
  role: "combobox",
443
442
  type: "text",
444
443
  autocomplete: "off",
445
- value: g.value,
444
+ value: m.value,
446
445
  name: a.name,
447
446
  placeholder: a.placeholder,
448
447
  disabled: a.disabled,
449
448
  required: a.required,
450
449
  "aria-autocomplete": "list",
451
- "aria-expanded": ue.value,
452
- "aria-controls": `${K}-list`,
453
- "aria-activedescendant": ue.value && s(w).length > 0 ? `${K}-option-${s(j)}` : void 0,
450
+ "aria-expanded": X.value,
451
+ "aria-controls": `${te}-list`,
452
+ "aria-activedescendant": X.value && s(v).length > 0 ? `${te}-option-${s(L)}` : void 0,
454
453
  "aria-required": a.required || void 0,
455
- "aria-invalid": Y || void 0,
456
- "aria-describedby": te,
457
- class: I(["block w-full min-w-0 border-0 bg-transparent px-0 py-1 text-body text-content-strong placeholder:text-content-disabled focus:outline-none focus:ring-0 disabled:cursor-not-allowed", r && !k.value ? "compact:text-right" : ""]),
458
- onInput: Q,
459
- onFocus: ee,
460
- onBlur: ie,
461
- onKeydown: A[0] || (A[0] = (se) => s(D).keydown(se, { pick: ne, enterNeedsMove: !1 }))
462
- }, null, 42, da),
463
- N(s(X), {
454
+ "aria-invalid": le || void 0,
455
+ "aria-describedby": ne,
456
+ class: W(["block w-full min-w-0 border-0 bg-transparent px-0 py-1 text-body text-content-strong placeholder:text-content-disabled focus:outline-none focus:ring-0 disabled:cursor-not-allowed", u && !_.value ? "compact:text-right" : ""]),
457
+ onInput: P,
458
+ onFocus: Y,
459
+ onBlur: O,
460
+ onKeydown: Q[0] || (Q[0] = (de) => s(h).keydown(de, { pick: M, enterNeedsMove: !1 }))
461
+ }, null, 42, La),
462
+ U(s(ue), {
464
463
  name: "search",
465
464
  size: 14,
466
465
  class: "shrink-0 text-content-muted"
467
466
  })
468
467
  ], 2),
469
- N(kt, {
470
- id: K,
471
- anchor: i.value,
472
- open: s(F),
473
- items: s(w),
474
- highlighted: s(j),
475
- query: g.value,
476
- status: s(O),
477
- recent: s(E),
468
+ U(Et, {
469
+ id: te,
470
+ anchor: n.value,
471
+ open: s(y),
472
+ items: s(v),
473
+ highlighted: s(L),
474
+ query: m.value,
475
+ status: s(S),
476
+ recent: s(T),
478
477
  "empty-message": !0,
479
- selected: o.value,
480
- hint: s(u)("core.form.suggestions.keys_pick"),
481
- onPick: ne,
482
- onHover: A[1] || (A[1] = (se) => s(D).highlight(se))
483
- }, Z({ _: 2 }, [
484
- q.$slots.option ? {
478
+ selected: r.value,
479
+ hint: s(p)("core.form.suggestions.keys_pick"),
480
+ onPick: M,
481
+ onHover: Q[1] || (Q[1] = (de) => s(h).highlight(de))
482
+ }, ie({ _: 2 }, [
483
+ D.$slots.option ? {
485
484
  name: "option",
486
- fn: f((se) => [
487
- S(q.$slots, "option", qe(Ve(se)))
485
+ fn: k((de) => [
486
+ R(D.$slots, "option", Re(Ue(de)))
488
487
  ]),
489
488
  key: "0"
490
489
  } : void 0
@@ -492,32 +491,32 @@ const Wt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Jt = ["name
492
491
  ]),
493
492
  _: 2
494
493
  }, [
495
- q.$slots.trailing ? {
494
+ D.$slots.trailing ? {
496
495
  name: "trailing",
497
- fn: f(() => [
498
- S(q.$slots, "trailing")
496
+ fn: k(() => [
497
+ R(D.$slots, "trailing")
499
498
  ]),
500
499
  key: "0"
501
500
  } : void 0,
502
- q.$slots.labelTrailing ? {
501
+ D.$slots.labelTrailing ? {
503
502
  name: "labelTrailing",
504
- fn: f(() => [
505
- S(q.$slots, "labelTrailing")
503
+ fn: k(() => [
504
+ R(D.$slots, "labelTrailing")
506
505
  ]),
507
506
  key: "1"
508
507
  } : void 0,
509
- q.$slots.readonly ? {
508
+ D.$slots.readonly ? {
510
509
  name: "readonly",
511
- fn: f(() => [
512
- S(q.$slots, "readonly")
510
+ fn: k(() => [
511
+ R(D.$slots, "readonly")
513
512
  ]),
514
513
  key: "2"
515
- } : q.$slots.value && V.value ? {
514
+ } : D.$slots.value && C.value ? {
516
515
  name: "readonly",
517
- fn: f(() => [
518
- p("span", ca, [
519
- S(q.$slots, "value", {
520
- option: V.value
516
+ fn: k(() => [
517
+ x("span", Ta, [
518
+ R(D.$slots, "value", {
519
+ option: C.value
521
520
  })
522
521
  ])
523
522
  ]),
@@ -525,40 +524,40 @@ const Wt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Jt = ["name
525
524
  } : void 0
526
525
  ]), 1040, ["value", "row-layout"]));
527
526
  }
528
- }), ot = /^(0000-00-00|1970-01-01|0001-01-01)/, Ue = (l) => String(l).padStart(2, "0"), nt = (l) => _t(l.getFullYear(), l.getMonth() + 1, l.getDate()), fa = (l) => `${Ue(l.getHours())}:${Ue(l.getMinutes())}`;
529
- function xo(l) {
527
+ }), _t = /^(0000-00-00|1970-01-01|0001-01-01)/, at = (l) => String(l).padStart(2, "0"), xt = (l) => Pt(l.getFullYear(), l.getMonth() + 1, l.getDate()), Da = (l) => `${at(l.getHours())}:${at(l.getMinutes())}`;
528
+ function za(l) {
530
529
  if (l == null || l === "") return null;
531
- if (l instanceof Date) return Number.isNaN(l.getTime()) ? null : nt(l);
532
- if (ot.test(l)) return null;
530
+ if (l instanceof Date) return Number.isNaN(l.getTime()) ? null : xt(l);
531
+ if (_t.test(l)) return null;
533
532
  const t = /^(\d{4}-\d{2}-\d{2})/.exec(l);
534
- return t && $t(t[1]) ? t[1] : null;
533
+ return t && Nt(t[1]) ? t[1] : null;
535
534
  }
536
- function ma(l) {
537
- if (l == null || l === "" || typeof l == "string" && ot.test(l)) return null;
538
- const t = l instanceof Date ? l : va(l);
535
+ function wt(l) {
536
+ if (l == null || l === "" || typeof l == "string" && _t.test(l)) return null;
537
+ const t = l instanceof Date ? l : ja(l);
539
538
  if (Number.isNaN(t.getTime())) return null;
540
- const e = nt(t);
541
- return e ? _e(e, fa(t)) : null;
539
+ const e = xt(t);
540
+ return e ? Ce(e, Da(t)) : null;
542
541
  }
543
- function va(l) {
542
+ function ja(l) {
544
543
  const t = /^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2}))?)?$/.exec(l);
545
544
  return t ? new Date(Number(t[1]), Number(t[2]) - 1, Number(t[3]), Number(t[4] ?? 0), Number(t[5] ?? 0), Number(t[6] ?? 0)) : new Date(l);
546
545
  }
547
- function wo(l = /* @__PURE__ */ new Date()) {
548
- return ma(l) ?? "";
546
+ function Cr(l = /* @__PURE__ */ new Date()) {
547
+ return wt(l) ?? "";
549
548
  }
550
- const pa = {
549
+ const Oa = {
551
550
  key: 0,
552
551
  class: "whitespace-normal"
553
- }, ba = { class: "whitespace-nowrap" }, ga = { class: "whitespace-nowrap" }, ya = ["id", "name", "value", "placeholder", "disabled", "required", "aria-required", "aria-invalid", "aria-describedby"], ha = ["aria-label", "onClick"], ka = {
552
+ }, Ma = { class: "whitespace-nowrap" }, Ra = { class: "whitespace-nowrap" }, Ua = ["id", "name", "value", "placeholder", "disabled", "required", "aria-required", "aria-invalid", "aria-describedby"], Ea = ["aria-label", "onClick"], Ia = {
554
553
  class: "-m-3 flex",
555
554
  "data-test": "date-time-popover"
556
- }, xa = { class: "flex w-75 flex-col gap-2.5 border-r border-border-separator p-3.5" }, wa = {
555
+ }, Aa = { class: "flex w-75 flex-col gap-2.5 border-r border-border-separator p-3.5" }, Na = {
557
556
  key: 0,
558
557
  class: "border-t border-border-separator pt-2.5"
559
- }, $a = { class: "flex w-48 flex-col gap-2.5 px-3 py-3.5" }, _a = ["for"], Ca = ["id", "value", "placeholder", "aria-invalid"], Sa = ["onClick"], $o = /* @__PURE__ */ G({
558
+ }, Pa = { class: "flex w-48 flex-col gap-2.5 px-3 py-3.5" }, Ka = ["for"], Ga = ["id", "value", "placeholder", "aria-invalid"], Ha = ["onClick"], Wa = /* @__PURE__ */ J({
560
559
  __name: "DateTimeField",
561
- props: /* @__PURE__ */ le(/* @__PURE__ */ ce({
560
+ props: /* @__PURE__ */ ve(/* @__PURE__ */ me({
562
561
  label: {},
563
562
  labelHidden: { type: Boolean },
564
563
  hint: {},
@@ -575,190 +574,190 @@ const pa = {
575
574
  openOn: {},
576
575
  minuteStep: {},
577
576
  quickPicks: {}
578
- }, { ...me, min: void 0, max: void 0, disabledDates: void 0, openOn: void 0, minuteStep: 1, quickPicks: void 0 }), {
577
+ }, { ...pe, min: void 0, max: void 0, disabledDates: void 0, openOn: void 0, minuteStep: 1, quickPicks: void 0 }), {
579
578
  modelValue: { default: null },
580
579
  modelModifiers: {}
581
580
  }),
582
- emits: /* @__PURE__ */ le(["focus", "blur"], ["update:modelValue"]),
581
+ emits: /* @__PURE__ */ ve(["focus", "blur"], ["update:modelValue"]),
583
582
  setup(l, { expose: t, emit: e }) {
584
- const a = l, o = re(l, "modelValue"), n = e, { t: u } = oe(), r = lt(), m = Ne(), k = U("input"), x = U("popover"), $ = U("calendar"), i = U("sheet"), v = h(() => ({ min: a.min?.slice(0, 10), max: a.max?.slice(0, 10), disabled: a.disabledDates })), g = h(() => a.min && a.min.length === 10 ? `${a.min}T00:00` : a.min), D = h(() => a.max && a.max.length === 10 ? `${a.max}T23:59` : a.max), w = (_, c) => !Lt(c, { disabled: a.disabledDates }) && (!g.value || _ >= g.value) && (!D.value || _ <= D.value), F = Vt(() => v.value), O = Rt(() => a.minuteStep), j = h(() => Ce(o.value));
585
- function E(_) {
586
- const { date: c, time: B } = Mt(_), R = c === null ? j.value.day ?? Fe() : F.parse(c);
587
- if (!R) return { error: F.invalidMessage() };
588
- let b = j.value.time ?? De(a.minuteStep);
589
- if (B !== null) {
590
- const T = O.parse(B);
591
- if ("error" in T) return T;
592
- b = T.value;
583
+ const a = l, r = ke(l, "modelValue"), i = e, { t: p } = re(), u = bt(), b = Ne(), _ = oe("input"), V = oe("popover"), $ = oe("calendar"), n = oe("sheet"), c = q(() => ({ min: a.min?.slice(0, 10), max: a.max?.slice(0, 10), disabled: a.disabledDates })), m = q(() => a.min && a.min.length === 10 ? `${a.min}T00:00` : a.min), h = q(() => a.max && a.max.length === 10 ? `${a.max}T23:59` : a.max), v = (o, f) => !Zt(f, { disabled: a.disabledDates }) && (!m.value || o >= m.value) && (!h.value || o <= h.value), y = Qt(() => c.value), S = la(() => a.minuteStep), L = q(() => Se(r.value));
584
+ function T(o) {
585
+ const { date: f, time: E } = ta(o), G = f === null ? L.value.day ?? Be() : y.parse(f);
586
+ if (!G) return { error: y.invalidMessage() };
587
+ let F = L.value.time ?? Oe(a.minuteStep);
588
+ if (E !== null) {
589
+ const I = S.parse(E);
590
+ if ("error" in I) return I;
591
+ F = I.value;
593
592
  }
594
- const z = _e(R, b);
595
- return w(z, R) ? { value: z } : { error: F.unavailableMessage() };
593
+ const K = Ce(G, F);
594
+ return v(K, G) ? { value: K } : { error: y.unavailableMessage() };
596
595
  }
597
- const V = Ge({ model: o, display: (_) => `${r.date(Ce(_).day)} ${Ce(_).time ?? ""}`.trim(), parse: E }), Q = h({
598
- get: () => j.value.time,
599
- set: (_) => {
600
- _ && Ct(_) && (o.value = _e(j.value.day ?? Fe(), _));
596
+ const C = Ze({ model: r, display: (o) => `${u.date(Se(o).day)} ${Se(o).time ?? ""}`.trim(), parse: T }), P = q({
597
+ get: () => L.value.time,
598
+ set: (o) => {
599
+ o && Kt(o) && (r.value = Ce(L.value.day ?? Be(), o));
601
600
  }
602
- }), ee = Ge({ model: Q, display: (_) => _, parse: O.parse }), ne = zt(() => a.quickPicks ?? (m.value ? void 0 : []), () => m.value, () => v.value), ie = h(() => a.error || V.message.value || ee.message.value), ue = h(() => o.value ? r.dateTime(o.value) : null), q = Re("date", () => ie.value ? "error" : a.disabled ? "locked" : "rest"), A = h(() => {
603
- const _ = V.typed.value;
604
- return _ ? Ce(_).day ?? null : null;
605
- }), K = h(() => A.value ?? (St(j.value.day) ? j.value.day : null)), te = h(() => V.typed.value ? Ce(V.typed.value).time : j.value.time);
606
- function Y(_) {
607
- _ && V.set(_e(_, j.value.time ?? De(a.minuteStep)));
601
+ }), Y = Ze({ model: P, display: (o) => o, parse: S.parse }), M = ea(() => a.quickPicks ?? (b.value ? void 0 : []), () => b.value, () => c.value), O = q(() => a.error || C.message.value || Y.message.value), X = q(() => r.value ? u.dateTime(r.value) : null), D = Ae("date", () => O.value ? "error" : a.disabled ? "locked" : "rest"), Q = q(() => {
602
+ const o = C.typed.value;
603
+ return o ? Se(o).day ?? null : null;
604
+ }), te = q(() => Q.value ?? (Gt(L.value.day) ? L.value.day : null)), ne = q(() => C.typed.value ? Se(C.typed.value).time : L.value.time);
605
+ function le(o) {
606
+ o && C.set(Ce(o, L.value.time ?? Oe(a.minuteStep)));
608
607
  }
609
- function se(_) {
610
- _ && V.set(_e(j.value.day ?? Fe(), _));
608
+ function de(o) {
609
+ o && C.set(Ce(L.value.day ?? Be(), o));
611
610
  }
612
- function he(_) {
613
- V.set(_e(Fe(), De(a.minuteStep))), _();
611
+ function _e(o) {
612
+ C.set(Ce(Be(), Oe(a.minuteStep))), o();
614
613
  }
615
- const we = Me();
616
- async function ke(_) {
617
- a.disabled || (x.value?.present(), _ && (await xe(), await xe(), $.value?.focus()));
614
+ const ge = Ie();
615
+ async function w(o) {
616
+ a.disabled || (V.value?.present(), o && (await we(), await we(), $.value?.focus()));
618
617
  }
619
- function ae(_) {
620
- _.key === "Enter" ? (V.commit(), x.value?.dismiss()) : _.key === "ArrowDown" && (_.preventDefault(), ke(!0));
618
+ function A(o) {
619
+ o.key === "Enter" ? (C.commit(), V.value?.dismiss()) : o.key === "ArrowDown" && (o.preventDefault(), w(!0));
621
620
  }
622
- return t({ focus: () => k.value?.focus() }), (_, c) => (d(), M(ye, J({ ...s(fe)(a), error: ie.value }, {
623
- value: ue.value,
621
+ return t({ focus: () => _.value?.focus() }), (o, f) => (d(), z(ye, N({ ...s(fe)(a), error: O.value }, {
622
+ value: X.value,
624
623
  "value-style": "numeric"
625
- }), Z({
626
- default: f(({ id: B, describedby: R, invalid: b }) => [
627
- s(m) ? (d(), y(de, { key: 0 }, [
628
- N(at, J({ id: B, "aria-describedby": R }, {
624
+ }), ie({
625
+ default: k(({ id: E, describedby: G, invalid: F }) => [
626
+ s(b) ? (d(), g(ee, { key: 0 }, [
627
+ U(vt, N({ id: E, "aria-describedby": G }, {
629
628
  disabled: a.disabled,
630
- invalid: b,
631
- placeholder: s(u)("core.form.select.choose"),
632
- onClick: c[0] || (c[0] = (z) => i.value?.present())
629
+ invalid: F,
630
+ placeholder: s(p)("core.form.select.choose"),
631
+ onClick: f[0] || (f[0] = (K) => n.value?.present())
633
632
  }), {
634
- default: f(() => [
635
- o.value ? (d(), y("span", pa, [
636
- p("span", ba, C(s(r).date(j.value.day)), 1),
637
- c[8] || (c[8] = H(C(" "), -1)),
638
- p("span", ga, C(j.value.time), 1)
639
- ])) : L("", !0)
633
+ default: k(() => [
634
+ r.value ? (d(), g("span", Oa, [
635
+ x("span", Ma, B(s(u).date(L.value.day)), 1),
636
+ f[8] || (f[8] = Z(B(" "), -1)),
637
+ x("span", Ra, B(L.value.time), 1)
638
+ ])) : j("", !0)
640
639
  ]),
641
640
  _: 1
642
641
  }, 16, ["disabled", "invalid", "placeholder"]),
643
- N(Ft, {
642
+ U(Ht, {
644
643
  ref_key: "sheet",
645
- ref: i,
646
- title: a.label ?? s(u)("core.form.date.calendar"),
644
+ ref: n,
645
+ title: a.label ?? s(p)("core.form.date.calendar"),
647
646
  mode: "datetime",
648
- "model-value": o.value,
649
- min: v.value.min,
650
- max: v.value.max,
647
+ "model-value": r.value,
648
+ min: c.value.min,
649
+ max: c.value.max,
651
650
  "disabled-dates": a.disabledDates,
652
651
  "open-on": a.openOn,
653
- shortcuts: s(ne),
652
+ shortcuts: s(M),
654
653
  step: a.minuteStep,
655
654
  clearable: !a.required,
656
- "onUpdate:modelValue": s(V).set
655
+ "onUpdate:modelValue": s(C).set
657
656
  }, null, 8, ["title", "model-value", "min", "max", "disabled-dates", "open-on", "shortcuts", "step", "clearable", "onUpdate:modelValue"])
658
- ], 64)) : (d(), M(Ie, {
657
+ ], 64)) : (d(), z(Pe, {
659
658
  key: 1,
660
659
  ref_key: "popover",
661
- ref: x,
662
- label: a.label ?? s(u)("core.form.date.calendar"),
660
+ ref: V,
661
+ label: a.label ?? s(p)("core.form.date.calendar"),
663
662
  width: "auto",
664
663
  placement: "bottom-start",
665
664
  arrow: !1,
666
665
  autofocus: !1
667
666
  }, {
668
- trigger: f(({ attrs: z, presented: T }) => [
669
- p("div", {
670
- class: I(["inline-flex max-w-full items-center gap-2", s(q)])
667
+ trigger: k(({ attrs: K, presented: I }) => [
668
+ x("div", {
669
+ class: W(["inline-flex max-w-full items-center gap-2", s(D)])
671
670
  }, [
672
- p("input", J({
673
- id: B,
671
+ x("input", N({
672
+ id: E,
674
673
  ref_key: "input",
675
- ref: k
676
- }, z, {
674
+ ref: _
675
+ }, K, {
677
676
  type: "text",
678
677
  role: "combobox",
679
678
  autocomplete: "off",
680
679
  size: "20",
681
680
  name: a.name,
682
- value: s(V).text.value,
683
- placeholder: s(F).placeholder.value,
681
+ value: s(C).text.value,
682
+ placeholder: s(y).placeholder.value,
684
683
  disabled: a.disabled,
685
684
  required: a.required,
686
685
  "aria-required": a.required || void 0,
687
- "aria-invalid": b || void 0,
688
- "aria-describedby": R,
686
+ "aria-invalid": F || void 0,
687
+ "aria-describedby": G,
689
688
  class: "block min-h-7 min-w-0 border-0 bg-transparent py-1 pl-2.5 text-body tabular-nums text-content-strong placeholder:text-content-disabled focus:outline-none focus:ring-0 disabled:cursor-not-allowed",
690
- onInput: c[1] || (c[1] = (W) => s(V).input(W.target.value)),
691
- onFocus: c[2] || (c[2] = (W) => n("focus", W)),
692
- onBlur: c[3] || (c[3] = (W) => {
693
- s(V).commit(), n("blur", W);
689
+ onInput: f[1] || (f[1] = (se) => s(C).input(se.target.value)),
690
+ onFocus: f[2] || (f[2] = (se) => i("focus", se)),
691
+ onBlur: f[3] || (f[3] = (se) => {
692
+ s(C).commit(), i("blur", se);
694
693
  }),
695
- onKeydown: ae,
696
- onClick: c[4] || (c[4] = (W) => ke(!1))
697
- }), null, 16, ya),
698
- a.disabled ? L("", !0) : (d(), y("button", {
694
+ onKeydown: A,
695
+ onClick: f[4] || (f[4] = (se) => w(!1))
696
+ }), null, 16, Ua),
697
+ a.disabled ? j("", !0) : (d(), g("button", {
699
698
  key: 0,
700
699
  type: "button",
701
700
  tabindex: "-1",
702
- "aria-label": s(u)("core.form.date.open"),
701
+ "aria-label": s(p)("core.form.date.open"),
703
702
  class: "mr-2 flex shrink-0 cursor-pointer items-center text-content-link",
704
- onClick: (W) => T ? x.value?.dismiss() : ke(!0)
703
+ onClick: (se) => I ? V.value?.dismiss() : w(!0)
705
704
  }, [
706
- N(s(X), {
705
+ U(s(ue), {
707
706
  name: "calendarLine",
708
707
  size: 18
709
708
  })
710
- ], 8, ha))
709
+ ], 8, Ea))
711
710
  ], 2)
712
711
  ]),
713
- default: f(({ dismiss: z }) => [
714
- p("div", ka, [
715
- p("div", xa, [
716
- N(Bt, {
712
+ default: k(({ dismiss: K }) => [
713
+ x("div", Ia, [
714
+ x("div", Aa, [
715
+ U(Wt, {
717
716
  ref_key: "calendar",
718
717
  ref: $,
719
- "model-value": K.value,
720
- min: v.value.min,
721
- max: v.value.max,
718
+ "model-value": te.value,
719
+ min: c.value.min,
720
+ max: c.value.max,
722
721
  "disabled-dates": a.disabledDates,
723
722
  "open-on": a.openOn,
724
- "onUpdate:modelValue": Y
723
+ "onUpdate:modelValue": le
725
724
  }, null, 8, ["model-value", "min", "max", "disabled-dates", "open-on"]),
726
- s(ne).length > 0 ? (d(), y("div", wa, [
727
- N(Tt, {
728
- items: s(ne),
729
- selected: K.value,
730
- onPick: Y
725
+ s(M).length > 0 ? (d(), g("div", Na, [
726
+ U(Yt, {
727
+ items: s(M),
728
+ selected: te.value,
729
+ onPick: le
731
730
  }, null, 8, ["items", "selected"])
732
- ])) : L("", !0)
731
+ ])) : j("", !0)
733
732
  ]),
734
- p("div", $a, [
735
- p("label", {
736
- for: s(we),
733
+ x("div", Pa, [
734
+ x("label", {
735
+ for: s(ge),
737
736
  class: "text-footnote font-semibold text-content-muted"
738
- }, C(s(u)("core.form.time.label")), 9, _a),
739
- p("input", {
740
- id: s(we),
737
+ }, B(s(p)("core.form.time.label")), 9, Ka),
738
+ x("input", {
739
+ id: s(ge),
741
740
  type: "text",
742
741
  autocomplete: "off",
743
742
  inputmode: "numeric",
744
- value: s(ee).text.value,
745
- placeholder: s(O).placeholder.value,
746
- "aria-invalid": s(ee).message.value ? !0 : void 0,
743
+ value: s(Y).text.value,
744
+ placeholder: s(S).placeholder.value,
745
+ "aria-invalid": s(Y).message.value ? !0 : void 0,
747
746
  class: "rounded-control bg-fill p-1.5 text-center text-[20px] font-semibold tabular-nums text-content-strong placeholder:text-base placeholder:font-normal placeholder:text-content-disabled focus:outline-2 focus:outline-border-focus",
748
- onInput: c[5] || (c[5] = (T) => s(ee).input(T.target.value)),
749
- onBlur: c[6] || (c[6] = (T) => s(ee).commit()),
750
- onKeydown: c[7] || (c[7] = Se(pe((T) => s(ee).commit(), ["prevent"]), ["enter"]))
751
- }, null, 40, Ca),
752
- N(Dt, {
753
- "model-value": te.value,
747
+ onInput: f[5] || (f[5] = (I) => s(Y).input(I.target.value)),
748
+ onBlur: f[6] || (f[6] = (I) => s(Y).commit()),
749
+ onKeydown: f[7] || (f[7] = Fe(he((I) => s(Y).commit(), ["prevent"]), ["enter"]))
750
+ }, null, 40, Ga),
751
+ U(Jt, {
752
+ "model-value": ne.value,
754
753
  step: a.minuteStep,
755
- "onUpdate:modelValue": se
754
+ "onUpdate:modelValue": de
756
755
  }, null, 8, ["model-value", "step"]),
757
- p("button", {
756
+ x("button", {
758
757
  type: "button",
759
758
  class: "cursor-pointer self-start rounded-full bg-tint-soft px-2.5 py-1.5 text-footnote font-medium text-content-link focus-visible:outline-2 focus-visible:outline-border-focus",
760
- onClick: (T) => he(z)
761
- }, C(s(u)("core.form.time.now")), 9, Sa)
759
+ onClick: (I) => _e(K)
760
+ }, B(s(p)("core.form.time.now")), 9, Ha)
762
761
  ])
763
762
  ])
764
763
  ]),
@@ -767,51 +766,51 @@ const pa = {
767
766
  ]),
768
767
  _: 2
769
768
  }, [
770
- _.$slots.trailing ? {
769
+ o.$slots.trailing ? {
771
770
  name: "trailing",
772
- fn: f(() => [
773
- S(_.$slots, "trailing")
771
+ fn: k(() => [
772
+ R(o.$slots, "trailing")
774
773
  ]),
775
774
  key: "0"
776
775
  } : void 0,
777
- _.$slots.labelTrailing ? {
776
+ o.$slots.labelTrailing ? {
778
777
  name: "labelTrailing",
779
- fn: f(() => [
780
- S(_.$slots, "labelTrailing")
778
+ fn: k(() => [
779
+ R(o.$slots, "labelTrailing")
781
780
  ]),
782
781
  key: "1"
783
782
  } : void 0,
784
- _.$slots.readonly ? {
783
+ o.$slots.readonly ? {
785
784
  name: "readonly",
786
- fn: f(() => [
787
- S(_.$slots, "readonly")
785
+ fn: k(() => [
786
+ R(o.$slots, "readonly")
788
787
  ]),
789
788
  key: "2"
790
789
  } : void 0
791
790
  ]), 1040, ["value"]));
792
791
  }
793
792
  });
794
- function st(l, t = {}) {
793
+ function $t(l, t = {}) {
795
794
  const e = t.accept ?? [];
796
795
  if (e.length > 0) {
797
- const a = l.name.lastIndexOf("."), o = a === -1 ? "" : l.name.slice(a).toLowerCase(), n = l.type.toLowerCase();
798
- if (!e.some((r) => {
799
- const m = r.trim().toLowerCase();
800
- return m.startsWith(".") ? m === o : m.endsWith("/*") ? n.startsWith(m.slice(0, -1)) : m === n;
796
+ const a = l.name.lastIndexOf("."), r = a === -1 ? "" : l.name.slice(a).toLowerCase(), i = l.type.toLowerCase();
797
+ if (!e.some((u) => {
798
+ const b = u.trim().toLowerCase();
799
+ return b.startsWith(".") ? b === r : b.endsWith("/*") ? i.startsWith(b.slice(0, -1)) : b === i;
801
800
  })) return "invalid_type";
802
801
  }
803
802
  return (t.maxSize ?? 0) > 0 && l.size > (t.maxSize ?? 0) ? "too_large" : null;
804
803
  }
805
- function Be(l) {
804
+ function Le(l) {
806
805
  return l < 1024 ? `${l} B` : l < 1024 * 1024 ? `${Math.round(l / 1024)} KB` : `${(l / (1024 * 1024)).toFixed(l % (1024 * 1024) === 0 ? 0 : 1)} MB`;
807
806
  }
808
- const Fa = { class: "w-full" }, Ba = ["id", "accept", "disabled", "aria-describedby", "aria-invalid"], Ta = {
807
+ const Ya = { class: "w-full" }, Ja = ["id", "accept", "disabled", "aria-describedby", "aria-invalid"], Za = {
809
808
  key: 0,
810
809
  class: "flex items-center gap-3 rounded-group bg-fill p-3",
811
810
  "data-test": "file-selected"
812
- }, Da = { class: "min-w-0 flex-1" }, La = { class: "truncate text-body font-medium text-content-strong" }, qa = { class: "text-footnote text-content-muted" }, Va = ["disabled", "aria-label", "title"], za = ["aria-disabled"], Ma = { class: "font-semibold text-content-link" }, Ra = { class: "text-content-muted" }, _o = /* @__PURE__ */ G({
811
+ }, Xa = { class: "min-w-0 flex-1" }, Qa = { class: "truncate text-body font-medium text-content-strong" }, el = { class: "text-footnote text-content-muted" }, tl = ["disabled", "aria-label", "title"], al = ["aria-disabled"], ll = { class: "font-semibold text-content-link" }, ol = { class: "text-content-muted" }, Sr = /* @__PURE__ */ J({
813
812
  __name: "FileField",
814
- props: /* @__PURE__ */ le(/* @__PURE__ */ ce({
813
+ props: /* @__PURE__ */ ve(/* @__PURE__ */ me({
815
814
  label: {},
816
815
  labelHidden: { type: Boolean },
817
816
  hint: {},
@@ -825,91 +824,91 @@ const Fa = { class: "w-full" }, Ba = ["id", "accept", "disabled", "aria-describe
825
824
  variant: {},
826
825
  accept: {},
827
826
  maxSize: {}
828
- }, { ...me, variant: "button", accept: () => [], maxSize: 0 }), {
827
+ }, { ...pe, variant: "button", accept: () => [], maxSize: 0 }), {
829
828
  modelValue: { default: null },
830
829
  modelModifiers: {}
831
830
  }),
832
831
  emits: ["update:modelValue"],
833
832
  setup(l, { expose: t }) {
834
- const e = l, a = re(l, "modelValue"), { t: o } = oe(), n = U("chooser"), u = P(!1), r = P(null), m = h(() => {
833
+ const e = l, a = ke(l, "modelValue"), { t: r } = re(), i = oe("chooser"), p = H(!1), u = H(null), b = q(() => {
835
834
  if (e.hint) return e.hint;
836
835
  const $ = [];
837
- return e.accept.length && $.push(o("core.form.file.allowed", { formats: e.accept.map((i) => i.replace(/^\./, "").toUpperCase()).join(", ") })), e.maxSize > 0 && $.push(o("core.form.file.max_size", { size: Be(e.maxSize) })), $.join(" · ") || void 0;
836
+ return e.accept.length && $.push(r("core.form.file.allowed", { formats: e.accept.map((n) => n.replace(/^\./, "").toUpperCase()).join(", ") })), e.maxSize > 0 && $.push(r("core.form.file.max_size", { size: Le(e.maxSize) })), $.join(" · ") || void 0;
838
837
  });
839
- function k($) {
838
+ function _($) {
840
839
  if (!$) return;
841
- const i = st($, { accept: e.accept, maxSize: e.maxSize });
842
- i ? (r.value = i === "invalid_type" ? o("core.form.file.invalid_type") : o("core.form.file.too_large", { size: Be(e.maxSize) }), a.value = null) : (r.value = null, a.value = $);
840
+ const n = $t($, { accept: e.accept, maxSize: e.maxSize });
841
+ n ? (u.value = n === "invalid_type" ? r("core.form.file.invalid_type") : r("core.form.file.too_large", { size: Le(e.maxSize) }), a.value = null) : (u.value = null, a.value = $);
843
842
  }
844
- function x() {
845
- a.value = null, r.value = null;
843
+ function V() {
844
+ a.value = null, u.value = null;
846
845
  }
847
- return ge(a, ($) => {
848
- !$ && n.value && (n.value.value = "");
849
- }), t({ clear: x }), ($, i) => (d(), M(ye, J({ ...s(fe)(e), hint: m.value, error: r.value ?? e.error }, {
846
+ return be(a, ($) => {
847
+ !$ && i.value && (i.value.value = "");
848
+ }), t({ clear: V }), ($, n) => (d(), z(ye, N({ ...s(fe)(e), hint: b.value, error: u.value ?? e.error }, {
850
849
  value: a.value?.name ?? null,
851
850
  "row-layout": "stacked"
852
- }), Z({
853
- default: f(({ id: v, describedby: g, invalid: D }) => [
854
- p("div", Fa, [
855
- p("input", {
856
- id: v,
851
+ }), ie({
852
+ default: k(({ id: c, describedby: m, invalid: h }) => [
853
+ x("div", Ya, [
854
+ x("input", {
855
+ id: c,
857
856
  ref_key: "chooser",
858
- ref: n,
857
+ ref: i,
859
858
  type: "file",
860
859
  class: "sr-only",
861
860
  tabindex: "-1",
862
861
  accept: e.accept.join(",") || void 0,
863
862
  disabled: e.disabled,
864
- "aria-describedby": g,
865
- "aria-invalid": D || void 0,
866
- onChange: i[0] || (i[0] = (w) => k(w.target.files?.[0]))
867
- }, null, 40, Ba),
868
- a.value ? (d(), y("div", Ta, [
869
- p("div", Da, [
870
- p("p", La, C(a.value.name), 1),
871
- p("p", qa, C(s(Be)(a.value.size)), 1)
863
+ "aria-describedby": m,
864
+ "aria-invalid": h || void 0,
865
+ onChange: n[0] || (n[0] = (v) => _(v.target.files?.[0]))
866
+ }, null, 40, Ja),
867
+ a.value ? (d(), g("div", Za, [
868
+ x("div", Xa, [
869
+ x("p", Qa, B(a.value.name), 1),
870
+ x("p", el, B(s(Le)(a.value.size)), 1)
872
871
  ]),
873
- p("button", {
872
+ x("button", {
874
873
  type: "button",
875
874
  disabled: e.disabled,
876
- "aria-label": s(o)("core.form.file.remove"),
877
- title: s(o)("core.form.file.remove"),
875
+ "aria-label": s(r)("core.form.file.remove"),
876
+ title: s(r)("core.form.file.remove"),
878
877
  class: "flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-full text-content-muted hover:bg-fill-strong focus-visible:outline-2 focus-visible:outline-border-focus disabled:cursor-not-allowed",
879
- onClick: x
878
+ onClick: V
880
879
  }, [
881
- N(s(X), {
880
+ U(s(ue), {
882
881
  name: "close",
883
882
  size: 14
884
883
  })
885
- ], 8, Va)
886
- ])) : e.variant === "dropzone" ? (d(), y("div", {
884
+ ], 8, tl)
885
+ ])) : e.variant === "dropzone" ? (d(), g("div", {
887
886
  key: 1,
888
887
  role: "button",
889
888
  tabindex: "0",
890
889
  "data-test": "file-dropzone",
891
890
  "aria-disabled": e.disabled || void 0,
892
- class: I(["cursor-pointer rounded-group border-2 border-dashed p-6 text-center text-body transition-colors duration-motion-fast focus-visible:outline-2 focus-visible:outline-border-focus", u.value ? "border-border-focus bg-tint-soft" : "border-border-control hover:bg-fill"]),
893
- onClick: i[1] || (i[1] = (w) => !e.disabled && n.value?.click()),
891
+ class: W(["cursor-pointer rounded-group border-2 border-dashed p-6 text-center text-body transition-colors duration-motion-fast focus-visible:outline-2 focus-visible:outline-border-focus", p.value ? "border-border-focus bg-tint-soft" : "border-border-control hover:bg-fill"]),
892
+ onClick: n[1] || (n[1] = (v) => !e.disabled && i.value?.click()),
894
893
  onKeydown: [
895
- i[2] || (i[2] = Se(pe((w) => !e.disabled && n.value?.click(), ["prevent"]), ["enter"])),
896
- i[3] || (i[3] = Se(pe((w) => !e.disabled && n.value?.click(), ["prevent"]), ["space"]))
894
+ n[2] || (n[2] = Fe(he((v) => !e.disabled && i.value?.click(), ["prevent"]), ["enter"])),
895
+ n[3] || (n[3] = Fe(he((v) => !e.disabled && i.value?.click(), ["prevent"]), ["space"]))
897
896
  ],
898
- onDragover: i[4] || (i[4] = pe((w) => u.value = !0, ["prevent"])),
899
- onDragleave: i[5] || (i[5] = pe((w) => u.value = !1, ["prevent"])),
900
- onDrop: i[6] || (i[6] = pe((w) => {
901
- u.value = !1, e.disabled || k(w.dataTransfer?.files?.[0]);
897
+ onDragover: n[4] || (n[4] = he((v) => p.value = !0, ["prevent"])),
898
+ onDragleave: n[5] || (n[5] = he((v) => p.value = !1, ["prevent"])),
899
+ onDrop: n[6] || (n[6] = he((v) => {
900
+ p.value = !1, e.disabled || _(v.dataTransfer?.files?.[0]);
902
901
  }, ["prevent"]))
903
902
  }, [
904
- p("span", Ma, C(s(o)("core.form.file.choose")), 1),
905
- p("span", Ra, C(" " + s(o)("core.form.file.drop")), 1)
906
- ], 42, za)) : (d(), M(be, {
903
+ x("span", ll, B(s(r)("core.form.file.choose")), 1),
904
+ x("span", ol, B(" " + s(r)("core.form.file.drop")), 1)
905
+ ], 42, al)) : (d(), z(ae, {
907
906
  key: 2,
908
907
  disabled: e.disabled,
909
- onClick: i[7] || (i[7] = (w) => n.value?.click())
908
+ onClick: n[7] || (n[7] = (v) => i.value?.click())
910
909
  }, {
911
- default: f(() => [
912
- H(C(s(o)("core.form.file.choose")), 1)
910
+ default: k(() => [
911
+ Z(B(s(r)("core.form.file.choose")), 1)
913
912
  ]),
914
913
  _: 1
915
914
  }, 8, ["disabled"]))
@@ -919,28 +918,28 @@ const Fa = { class: "w-full" }, Ba = ["id", "accept", "disabled", "aria-describe
919
918
  }, [
920
919
  $.$slots.trailing ? {
921
920
  name: "trailing",
922
- fn: f(() => [
923
- S($.$slots, "trailing")
921
+ fn: k(() => [
922
+ R($.$slots, "trailing")
924
923
  ]),
925
924
  key: "0"
926
925
  } : void 0,
927
926
  $.$slots.labelTrailing ? {
928
927
  name: "labelTrailing",
929
- fn: f(() => [
930
- S($.$slots, "labelTrailing")
928
+ fn: k(() => [
929
+ R($.$slots, "labelTrailing")
931
930
  ]),
932
931
  key: "1"
933
932
  } : void 0,
934
933
  $.$slots.readonly ? {
935
934
  name: "readonly",
936
- fn: f(() => [
937
- S($.$slots, "readonly")
935
+ fn: k(() => [
936
+ R($.$slots, "readonly")
938
937
  ]),
939
938
  key: "2"
940
939
  } : void 0
941
940
  ]), 1040, ["value"]));
942
941
  }
943
- }), Na = ["disabled"], Co = /* @__PURE__ */ G({
942
+ }), rl = ["disabled"], Fr = /* @__PURE__ */ J({
944
943
  __name: "FormGroupButton",
945
944
  props: {
946
945
  label: {},
@@ -950,16 +949,16 @@ const Fa = { class: "w-full" }, Ba = ["id", "accept", "disabled", "aria-describe
950
949
  emits: ["click"],
951
950
  setup(l, { emit: t }) {
952
951
  const e = l, a = t;
953
- return (o, n) => (d(), M(rt, null, {
954
- default: f(() => [
955
- N(bt, { layout: "stacked" }, {
956
- default: f(() => [
957
- p("button", {
952
+ return (r, i) => (d(), z(St, null, {
953
+ default: k(() => [
954
+ U(Ot, { layout: "stacked" }, {
955
+ default: k(() => [
956
+ x("button", {
958
957
  type: "button",
959
958
  disabled: e.disabled,
960
- class: I(["w-full py-1 text-center text-body focus-visible:outline-2 focus-visible:outline-border-focus disabled:text-content-disabled", e.tone === "critical" ? "text-content-destructive" : "text-content-link"]),
961
- onClick: n[0] || (n[0] = (u) => a("click"))
962
- }, C(e.label), 11, Na)
959
+ class: W(["w-full py-1 text-center text-body focus-visible:outline-2 focus-visible:outline-border-focus disabled:text-content-disabled", e.tone === "critical" ? "text-content-destructive" : "text-content-link"]),
960
+ onClick: i[0] || (i[0] = (p) => a("click"))
961
+ }, B(e.label), 11, rl)
963
962
  ]),
964
963
  _: 1
965
964
  })
@@ -967,31 +966,31 @@ const Fa = { class: "w-full" }, Ba = ["id", "accept", "disabled", "aria-describe
967
966
  _: 1
968
967
  }));
969
968
  }
970
- }), So = /* @__PURE__ */ G({
969
+ }), qr = /* @__PURE__ */ J({
971
970
  __name: "FormIndent",
972
971
  setup(l) {
973
- return dt(gt, yt() + 1), (t, e) => S(t.$slots, "default");
972
+ return ut(Mt, Rt() + 1), (t, e) => R(t.$slots, "default");
974
973
  }
975
974
  });
976
- function Ia(l, t) {
975
+ function nl(l, t) {
977
976
  return t.filter((e) => (l?.[e] ?? "").trim() === "");
978
977
  }
979
- const Oa = ["id", "aria-labelledby"], ja = ["id", "value", "lang", "name", "rows", "placeholder", "maxlength", "disabled", "aria-required", "aria-invalid", "aria-describedby"], Ea = ["id", "value", "lang", "name", "placeholder", "maxlength", "disabled", "aria-required", "aria-invalid", "aria-describedby"], Aa = {
978
+ const sl = ["id", "aria-labelledby"], il = ["id", "value", "lang", "name", "rows", "placeholder", "maxlength", "disabled", "aria-required", "aria-invalid", "aria-describedby"], ul = ["id", "value", "lang", "name", "placeholder", "maxlength", "disabled", "aria-required", "aria-invalid", "aria-describedby"], dl = {
980
979
  key: 0,
981
980
  class: "mt-1.5 flex items-center gap-2"
982
- }, Ga = {
981
+ }, cl = {
983
982
  key: 0,
984
983
  class: "flex-1 text-footnote text-status-warning-content",
985
984
  "data-test": "i18n-missing"
986
- }, Ka = {
985
+ }, ml = {
987
986
  key: 1,
988
987
  class: "flex-1"
989
- }, Pa = ["aria-label"], Ha = ["id", "aria-selected", "tabindex", "aria-controls", "aria-label", "title", "onClick", "onKeydown"], Ua = ["data-state"], Ya = { class: "w-full" }, Wa = { class: "whitespace-pre-line break-words text-body text-content-strong" }, Ja = ["aria-expanded"], Za = { class: "flex-1" }, Xa = {
988
+ }, fl = ["aria-label"], pl = ["id", "aria-selected", "tabindex", "aria-controls", "aria-label", "title", "onClick", "onKeydown"], vl = ["data-state"], bl = { class: "w-full" }, yl = { class: "whitespace-pre-line break-words text-body text-content-strong" }, gl = ["aria-expanded"], hl = { class: "flex-1" }, kl = {
990
989
  key: 0,
991
990
  class: "mt-1 flex flex-col gap-1.5"
992
- }, Qa = ["title"], Fo = /* @__PURE__ */ G({
991
+ }, _l = ["title"], xl = /* @__PURE__ */ J({
993
992
  __name: "I18nField",
994
- props: /* @__PURE__ */ le(/* @__PURE__ */ ce({
993
+ props: /* @__PURE__ */ ve(/* @__PURE__ */ me({
995
994
  label: {},
996
995
  labelHidden: { type: Boolean },
997
996
  hint: {},
@@ -1009,213 +1008,213 @@ const Oa = ["id", "aria-labelledby"], ja = ["id", "value", "lang", "name", "rows
1009
1008
  rows: {},
1010
1009
  placeholder: {},
1011
1010
  maxLength: {}
1012
- }, { ...me, locales: void 0, defaultLocale: void 0, requiredLocales: () => [], multiline: !1, rows: 3, placeholder: void 0, maxLength: void 0 }), {
1011
+ }, { ...pe, locales: void 0, defaultLocale: void 0, requiredLocales: () => [], multiline: !1, rows: 3, placeholder: void 0, maxLength: void 0 }), {
1013
1012
  modelValue: { default: () => ({}) },
1014
1013
  modelModifiers: {}
1015
1014
  }),
1016
1015
  emits: ["update:modelValue"],
1017
1016
  setup(l, { expose: t }) {
1018
- const e = l, a = re(l, "modelValue"), { t: o, locale: n, availableLocales: u } = oe(), r = lt(), m = Ze(Nt, null), k = Me(), x = U("field"), $ = U("root"), { editable: i } = et(e), v = Re(e.multiline ? "area" : "text", () => e.error || Y.value ? "error" : e.disabled ? "locked" : "rest"), g = h(() => e.locales ?? m?.locales ?? u), D = h(() => e.defaultLocale ?? g.value[0] ?? ""), w = h(() => g.value.includes(D.value) ? [D.value, ...g.value.filter((b) => b !== D.value)] : g.value), F = P(null), O = h(() => F.value !== null && w.value.includes(F.value) ? F.value : w.value.includes(n.value) ? n.value : D.value), j = (b) => a.value[b] ?? "", E = (b) => j(b).trim() !== "", V = (b) => b.toUpperCase();
1019
- function Q(b) {
1017
+ const e = l, a = ke(l, "modelValue"), { t: r, locale: i, availableLocales: p } = re(), u = bt(), b = De(yt, null), _ = Ie(), V = oe("field"), $ = oe("root"), { editable: n } = qe(e), c = Ae(e.multiline ? "area" : "text", () => e.error || le.value ? "error" : e.disabled ? "locked" : "rest"), m = q(() => e.locales ?? b?.locales ?? p), h = q(() => e.defaultLocale ?? m.value[0] ?? ""), v = q(() => m.value.includes(h.value) ? [h.value, ...m.value.filter((F) => F !== h.value)] : m.value), y = H(null), S = q(() => y.value !== null && v.value.includes(y.value) ? y.value : v.value.includes(i.value) ? i.value : h.value), L = (F) => a.value[F] ?? "", T = (F) => L(F).trim() !== "", C = (F) => F.toUpperCase();
1018
+ function P(F) {
1020
1019
  try {
1021
- return new Intl.DisplayNames([r.intlLocale], { type: "language" }).of(b) ?? V(b);
1020
+ return new Intl.DisplayNames([u.intlLocale], { type: "language" }).of(F) ?? C(F);
1022
1021
  } catch {
1023
- return V(b);
1022
+ return C(F);
1024
1023
  }
1025
1024
  }
1026
- const ee = (b) => b.map(Q).join(", ");
1027
- function ne(b, z) {
1028
- a.value = { ...a.value, [b]: z };
1025
+ const Y = (F) => F.map(P).join(", ");
1026
+ function M(F, K) {
1027
+ a.value = { ...a.value, [F]: K };
1029
1028
  }
1030
- const ie = (b) => `${k}-tab-${b}`;
1031
- function ue(b, z) {
1032
- F.value = b, z && xe(() => x.value?.focus());
1029
+ const O = (F) => `${_}-tab-${F}`;
1030
+ function X(F, K) {
1031
+ y.value = F, K && we(() => V.value?.focus());
1033
1032
  }
1034
- function q(b, z) {
1035
- const T = w.value.length - 1, W = { ArrowRight: z + 1, ArrowLeft: z - 1, Home: 0, End: T }[b.key];
1036
- if (W === void 0) return;
1037
- b.preventDefault();
1038
- const ve = w.value[(W + w.value.length) % w.value.length];
1039
- ve !== void 0 && (ue(ve, !1), xe(() => document.getElementById(ie(ve))?.focus()));
1033
+ function D(F, K) {
1034
+ const I = v.value.length - 1, se = { ArrowRight: K + 1, ArrowLeft: K - 1, Home: 0, End: I }[F.key];
1035
+ if (se === void 0) return;
1036
+ F.preventDefault();
1037
+ const xe = v.value[(se + v.value.length) % v.value.length];
1038
+ xe !== void 0 && (X(xe, !1), we(() => document.getElementById(O(xe))?.focus()));
1040
1039
  }
1041
- const A = P(!1);
1042
- function K(b) {
1043
- $.value?.contains(b.relatedTarget) || (A.value = !0);
1040
+ const Q = H(!1);
1041
+ function te(F) {
1042
+ $.value?.contains(F.relatedTarget) || (Q.value = !0);
1044
1043
  }
1045
- const te = h(() => Ia(a.value, e.requiredLocales)), Y = h(() => A.value && te.value.length > 0 ? o("core.form.i18n.required", { languages: ee(te.value) }) : void 0), se = h(() => e.requiredLocales.length > 0 ? te.value.length === 0 : w.value.some(E)), he = h(() => w.value.filter((b) => !E(b) && !(Y.value && te.value.includes(b)))), we = h(() => E(D.value) && w.value.some((b) => b !== D.value && !E(b)));
1046
- function ke() {
1047
- const b = j(D.value);
1048
- a.value = { ...a.value, ...Object.fromEntries(w.value.filter((z) => !E(z)).map((z) => [z, b])) };
1044
+ const ne = q(() => nl(a.value, e.requiredLocales)), le = q(() => Q.value && ne.value.length > 0 ? r("core.form.i18n.required", { languages: Y(ne.value) }) : void 0), de = q(() => e.requiredLocales.length > 0 ? ne.value.length === 0 : v.value.some(T)), _e = q(() => v.value.filter((F) => !T(F) && !(le.value && ne.value.includes(F)))), ge = q(() => T(h.value) && v.value.some((F) => F !== h.value && !T(F)));
1045
+ function w() {
1046
+ const F = L(h.value);
1047
+ a.value = { ...a.value, ...Object.fromEntries(v.value.filter((K) => !T(K)).map((K) => [K, F])) };
1049
1048
  }
1050
- const ae = h(() => [n.value, D.value, ...w.value].find((b) => w.value.includes(b) && E(b))), _ = h(() => w.value.filter((b) => b !== ae.value)), c = h(() => _.value.filter(E).length), B = P(!1), R = h(() => e.label && !i.value && ae.value ? `${e.label} · ${V(ae.value)}` : e.label);
1051
- return t({ focus: () => x.value?.focus() }), (b, z) => (d(), M(ye, J({ ...s(fe)(e), label: R.value, error: e.error ?? Y.value, required: e.required || e.requiredLocales.length > 0 }, {
1052
- value: s(i) ? se.value ? "written" : null : ae.value ? j(ae.value) : null,
1049
+ const A = q(() => [i.value, h.value, ...v.value].find((F) => v.value.includes(F) && T(F))), o = q(() => v.value.filter((F) => F !== A.value)), f = q(() => o.value.filter(T).length), E = H(!1), G = q(() => e.label && !n.value && A.value ? `${e.label} · ${C(A.value)}` : e.label);
1050
+ return t({ focus: () => V.value?.focus() }), (F, K) => (d(), z(ye, N({ ...s(fe)(e), label: G.value, error: e.error ?? le.value, required: e.required || e.requiredLocales.length > 0 }, {
1051
+ value: s(n) ? de.value ? "written" : null : A.value ? L(A.value) : null,
1053
1052
  "row-layout": "stacked"
1054
- }), Z({
1055
- default: f(({ id: T, describedby: W, invalid: ve }) => [
1056
- p("div", {
1053
+ }), ie({
1054
+ default: k(({ id: I, describedby: se, invalid: xe }) => [
1055
+ x("div", {
1057
1056
  ref_key: "root",
1058
1057
  ref: $,
1059
1058
  class: "w-full",
1060
- onFocusout: K
1059
+ onFocusout: te
1061
1060
  }, [
1062
- p("div", {
1063
- id: `${s(k)}-panel`,
1061
+ x("div", {
1062
+ id: `${s(_)}-panel`,
1064
1063
  role: "tabpanel",
1065
- "aria-labelledby": ie(O.value)
1064
+ "aria-labelledby": O(S.value)
1066
1065
  }, [
1067
- p("div", {
1068
- class: I(["w-full", s(v)])
1066
+ x("div", {
1067
+ class: W(["w-full", s(c)])
1069
1068
  }, [
1070
- e.multiline ? (d(), y("textarea", {
1069
+ e.multiline ? (d(), g("textarea", {
1071
1070
  key: 0,
1072
- id: T,
1071
+ id: I,
1073
1072
  ref_key: "field",
1074
- ref: x,
1075
- value: j(O.value),
1076
- lang: O.value,
1073
+ ref: V,
1074
+ value: L(S.value),
1075
+ lang: S.value,
1077
1076
  name: e.name,
1078
1077
  rows: e.rows,
1079
1078
  placeholder: e.placeholder,
1080
1079
  maxlength: e.maxLength,
1081
1080
  disabled: e.disabled,
1082
1081
  "aria-required": e.required || void 0,
1083
- "aria-invalid": ve || void 0,
1084
- "aria-describedby": W,
1082
+ "aria-invalid": xe || void 0,
1083
+ "aria-describedby": se,
1085
1084
  "data-test": "i18n-input",
1086
1085
  class: "block w-full resize-y border-0 bg-transparent px-0 py-1 text-body text-content-strong placeholder:text-content-disabled focus:outline-none focus:ring-0 disabled:cursor-not-allowed",
1087
- onInput: z[0] || (z[0] = (Te) => ne(O.value, Te.target.value))
1088
- }, null, 40, ja)) : (d(), y("input", {
1086
+ onInput: K[0] || (K[0] = (je) => M(S.value, je.target.value))
1087
+ }, null, 40, il)) : (d(), g("input", {
1089
1088
  key: 1,
1090
- id: T,
1089
+ id: I,
1091
1090
  ref_key: "field",
1092
- ref: x,
1093
- value: j(O.value),
1094
- lang: O.value,
1091
+ ref: V,
1092
+ value: L(S.value),
1093
+ lang: S.value,
1095
1094
  type: "text",
1096
1095
  name: e.name,
1097
1096
  placeholder: e.placeholder,
1098
1097
  maxlength: e.maxLength,
1099
1098
  disabled: e.disabled,
1100
1099
  "aria-required": e.required || void 0,
1101
- "aria-invalid": ve || void 0,
1102
- "aria-describedby": W,
1100
+ "aria-invalid": xe || void 0,
1101
+ "aria-describedby": se,
1103
1102
  "data-test": "i18n-input",
1104
1103
  class: "block w-full min-w-0 border-0 bg-transparent px-0 py-1 text-body text-content-strong placeholder:text-content-disabled focus:outline-none focus:ring-0 disabled:cursor-not-allowed",
1105
- onInput: z[1] || (z[1] = (Te) => ne(O.value, Te.target.value))
1106
- }, null, 40, Ea))
1104
+ onInput: K[1] || (K[1] = (je) => M(S.value, je.target.value))
1105
+ }, null, 40, ul))
1107
1106
  ], 2)
1108
- ], 8, Oa),
1109
- he.value.length > 0 || we.value ? (d(), y("div", Aa, [
1110
- he.value.length > 0 ? (d(), y("p", Ga, C(s(o)("core.form.i18n.missing", { languages: ee(he.value) })), 1)) : (d(), y("span", Ka)),
1111
- we.value && !e.disabled ? (d(), y("button", {
1107
+ ], 8, sl),
1108
+ _e.value.length > 0 || ge.value ? (d(), g("div", dl, [
1109
+ _e.value.length > 0 ? (d(), g("p", cl, B(s(r)("core.form.i18n.missing", { languages: Y(_e.value) })), 1)) : (d(), g("span", ml)),
1110
+ ge.value && !e.disabled ? (d(), g("button", {
1112
1111
  key: 2,
1113
1112
  type: "button",
1114
1113
  "data-test": "i18n-copy",
1115
1114
  class: "shrink-0 cursor-pointer rounded-control bg-tint-soft px-2.5 py-1.5 text-footnote font-medium text-content-link transition-colors duration-motion-fast hover:bg-fill focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
1116
- onClick: ke
1117
- }, C(s(o)("core.form.i18n.copy", { language: V(D.value) })), 1)) : L("", !0)
1118
- ])) : L("", !0)
1115
+ onClick: w
1116
+ }, B(s(r)("core.form.i18n.copy", { language: C(h.value) })), 1)) : j("", !0)
1117
+ ])) : j("", !0)
1119
1118
  ], 544)
1120
1119
  ]),
1121
- labelTrailing: f(() => [
1122
- p("div", {
1120
+ labelTrailing: k(() => [
1121
+ x("div", {
1123
1122
  role: "tablist",
1124
- "aria-label": s(o)("core.form.i18n.languages"),
1123
+ "aria-label": s(r)("core.form.i18n.languages"),
1125
1124
  class: "flex shrink-0 gap-0.5 rounded-control bg-fill p-0.5",
1126
1125
  "data-test": "i18n-tabs"
1127
1126
  }, [
1128
- (d(!0), y(de, null, $e(w.value, (T, W) => (d(), y("button", {
1129
- id: ie(T),
1130
- key: T,
1127
+ (d(!0), g(ee, null, ce(v.value, (I, se) => (d(), g("button", {
1128
+ id: O(I),
1129
+ key: I,
1131
1130
  type: "button",
1132
1131
  role: "tab",
1133
- "aria-selected": T === O.value,
1134
- tabindex: T === O.value ? 0 : -1,
1135
- "aria-controls": `${s(k)}-panel`,
1136
- "aria-label": s(o)(E(T) ? "core.form.i18n.tab_written" : "core.form.i18n.tab_empty", { language: Q(T) }),
1137
- title: Q(T),
1138
- class: I(["flex min-h-7 cursor-pointer items-center gap-1.5 rounded-control px-2.5 py-1 text-footnote font-semibold transition-colors duration-motion-fast focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus", T === O.value ? "bg-segment-selected text-content-strong shadow-sm" : "text-content-muted hover:text-content-strong"]),
1139
- onClick: (ve) => ue(T, !0),
1140
- onKeydown: (ve) => q(ve, W)
1132
+ "aria-selected": I === S.value,
1133
+ tabindex: I === S.value ? 0 : -1,
1134
+ "aria-controls": `${s(_)}-panel`,
1135
+ "aria-label": s(r)(T(I) ? "core.form.i18n.tab_written" : "core.form.i18n.tab_empty", { language: P(I) }),
1136
+ title: P(I),
1137
+ class: W(["flex min-h-7 cursor-pointer items-center gap-1.5 rounded-control px-2.5 py-1 text-footnote font-semibold transition-colors duration-motion-fast focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus", I === S.value ? "bg-segment-selected text-content-strong shadow-sm" : "text-content-muted hover:text-content-strong"]),
1138
+ onClick: (xe) => X(I, !0),
1139
+ onKeydown: (xe) => D(xe, se)
1141
1140
  }, [
1142
- H(C(V(T)) + " ", 1),
1143
- p("span", {
1141
+ Z(B(C(I)) + " ", 1),
1142
+ x("span", {
1144
1143
  "aria-hidden": "true",
1145
- class: I(["size-1.5 rounded-full", E(T) ? "bg-status-success-solid" : Y.value && te.value.includes(T) ? "bg-content-destructive" : "bg-content-disabled"]),
1144
+ class: W(["size-1.5 rounded-full", T(I) ? "bg-status-success-solid" : le.value && ne.value.includes(I) ? "bg-content-destructive" : "bg-content-disabled"]),
1146
1145
  "data-test": "i18n-dot",
1147
- "data-state": E(T) ? "written" : Y.value && te.value.includes(T) ? "required" : "empty"
1148
- }, null, 10, Ua)
1149
- ], 42, Ha))), 128))
1150
- ], 8, Pa)
1146
+ "data-state": T(I) ? "written" : le.value && ne.value.includes(I) ? "required" : "empty"
1147
+ }, null, 10, vl)
1148
+ ], 42, pl))), 128))
1149
+ ], 8, fl)
1151
1150
  ]),
1152
1151
  _: 2
1153
1152
  }, [
1154
- ae.value ? {
1153
+ A.value ? {
1155
1154
  name: "readonly",
1156
- fn: f(() => [
1157
- p("div", Ya, [
1158
- p("p", Wa, C(j(ae.value)), 1),
1159
- _.value.length > 0 ? (d(), y(de, { key: 0 }, [
1160
- p("button", {
1155
+ fn: k(() => [
1156
+ x("div", bl, [
1157
+ x("p", yl, B(L(A.value)), 1),
1158
+ o.value.length > 0 ? (d(), g(ee, { key: 0 }, [
1159
+ x("button", {
1161
1160
  type: "button",
1162
- "aria-expanded": B.value,
1161
+ "aria-expanded": E.value,
1163
1162
  class: "mt-1.5 flex w-full cursor-pointer items-center gap-2 text-left text-footnote text-content-muted focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
1164
- onClick: z[2] || (z[2] = (T) => B.value = !B.value)
1163
+ onClick: K[2] || (K[2] = (I) => E.value = !E.value)
1165
1164
  }, [
1166
- p("span", Za, C(s(o)("core.form.i18n.more", { count: _.value.length, filled: c.value })), 1),
1167
- N(s(X), {
1165
+ x("span", hl, B(s(r)("core.form.i18n.more", { count: o.value.length, filled: f.value })), 1),
1166
+ U(s(ue), {
1168
1167
  name: "arrowRightSLine",
1169
1168
  size: 16,
1170
- class: I(["shrink-0 transition-transform duration-motion-fast", B.value ? "rotate-90" : ""])
1169
+ class: W(["shrink-0 transition-transform duration-motion-fast", E.value ? "rotate-90" : ""])
1171
1170
  }, null, 8, ["class"])
1172
- ], 8, Ja),
1173
- B.value ? (d(), y("dl", Xa, [
1174
- (d(!0), y(de, null, $e(_.value, (T) => (d(), y("div", {
1175
- key: T,
1171
+ ], 8, gl),
1172
+ E.value ? (d(), g("dl", kl, [
1173
+ (d(!0), g(ee, null, ce(o.value, (I) => (d(), g("div", {
1174
+ key: I,
1176
1175
  class: "flex gap-2 text-body"
1177
1176
  }, [
1178
- p("dt", {
1177
+ x("dt", {
1179
1178
  class: "w-8 shrink-0 text-footnote font-semibold leading-6 text-content-muted",
1180
- title: Q(T)
1181
- }, C(V(T)), 9, Qa),
1182
- p("dd", {
1183
- class: I(["min-w-0 flex-1 whitespace-pre-line break-words", E(T) ? "text-content-strong" : "text-content-disabled"])
1184
- }, C(E(T) ? j(T) : s(o)("core.state.no_value")), 3)
1179
+ title: P(I)
1180
+ }, B(C(I)), 9, _l),
1181
+ x("dd", {
1182
+ class: W(["min-w-0 flex-1 whitespace-pre-line break-words", T(I) ? "text-content-strong" : "text-content-disabled"])
1183
+ }, B(T(I) ? L(I) : s(r)("core.state.no_value")), 3)
1185
1184
  ]))), 128))
1186
- ])) : L("", !0)
1187
- ], 64)) : L("", !0)
1185
+ ])) : j("", !0)
1186
+ ], 64)) : j("", !0)
1188
1187
  ])
1189
1188
  ]),
1190
1189
  key: "0"
1191
1190
  } : void 0,
1192
- b.$slots.trailing ? {
1191
+ F.$slots.trailing ? {
1193
1192
  name: "trailing",
1194
- fn: f(() => [
1195
- S(b.$slots, "trailing")
1193
+ fn: k(() => [
1194
+ R(F.$slots, "trailing")
1196
1195
  ]),
1197
1196
  key: "1"
1198
1197
  } : void 0
1199
1198
  ]), 1040, ["value"]));
1200
1199
  }
1201
- }), el = "unsupported_characters", tl = /[\u{10000}-\u{10FFFF}]/u;
1202
- function al(l) {
1203
- return tl.test(l);
1200
+ }), wl = "unsupported_characters", $l = /[\u{10000}-\u{10FFFF}]/u;
1201
+ function Vl(l) {
1202
+ return $l.test(l);
1204
1203
  }
1205
- function ze(l, t, e) {
1204
+ function Ee(l, t, e) {
1206
1205
  if (typeof l == "string")
1207
- al(l) && e.addIssue({ code: "custom", path: t, params: { code: el } });
1206
+ Vl(l) && e.addIssue({ code: "custom", path: t, params: { code: wl } });
1208
1207
  else if (Array.isArray(l))
1209
- l.forEach((a, o) => ze(a, [...t, o], e));
1208
+ l.forEach((a, r) => Ee(a, [...t, r], e));
1210
1209
  else if (l && typeof l == "object")
1211
- for (const [a, o] of Object.entries(l)) ze(o, [...t, a], e);
1210
+ for (const [a, r] of Object.entries(l)) Ee(r, [...t, a], e);
1212
1211
  }
1213
- function Bo(l, t) {
1214
- ze(l, [], t);
1212
+ function Br(l, t) {
1213
+ Ee(l, [], t);
1215
1214
  }
1216
- const To = /* @__PURE__ */ G({
1215
+ const Lr = /* @__PURE__ */ J({
1217
1216
  __name: "MoneyField",
1218
- props: /* @__PURE__ */ ce({
1217
+ props: /* @__PURE__ */ me({
1219
1218
  label: {},
1220
1219
  labelHidden: { type: Boolean },
1221
1220
  hint: {},
@@ -1232,50 +1231,50 @@ const To = /* @__PURE__ */ G({
1232
1231
  blankZero: { type: Boolean },
1233
1232
  negative: { type: Boolean },
1234
1233
  width: {}
1235
- }, { ...me, modelValue: void 0, decimals: 2, blankZero: !1, negative: !1, width: "sm" }),
1234
+ }, { ...pe, modelValue: void 0, decimals: 2, blankZero: !1, negative: !1, width: "sm" }),
1236
1235
  emits: ["update:modelValue", "focus", "blur"],
1237
1236
  setup(l, { expose: t, emit: e }) {
1238
- const a = l, o = e, n = U("field");
1239
- return t({ focus: () => n.value?.focus() }), (u, r) => (d(), M(It, J({
1237
+ const a = l, r = e, i = oe("field");
1238
+ return t({ focus: () => i.value?.focus() }), (p, u) => (d(), z(gt, N({
1240
1239
  ref_key: "field",
1241
- ref: n,
1240
+ ref: i,
1242
1241
  "model-value": a.modelValue,
1243
- "onUpdate:modelValue": r[0] || (r[0] = (m) => o("update:modelValue", m))
1242
+ "onUpdate:modelValue": u[0] || (u[0] = (b) => r("update:modelValue", b))
1244
1243
  }, s(fe)(a), {
1245
1244
  decimals: a.decimals,
1246
1245
  negative: a.negative,
1247
1246
  "blank-zero": a.blankZero,
1248
1247
  suffix: a.currency,
1249
1248
  width: a.width,
1250
- onFocus: r[1] || (r[1] = (m) => o("focus", m)),
1251
- onBlur: r[2] || (r[2] = (m) => o("blur", m))
1252
- }), Z({ _: 2 }, [
1253
- u.$slots.trailing ? {
1249
+ onFocus: u[1] || (u[1] = (b) => r("focus", b)),
1250
+ onBlur: u[2] || (u[2] = (b) => r("blur", b))
1251
+ }), ie({ _: 2 }, [
1252
+ p.$slots.trailing ? {
1254
1253
  name: "trailing",
1255
- fn: f(() => [
1256
- S(u.$slots, "trailing")
1254
+ fn: k(() => [
1255
+ R(p.$slots, "trailing")
1257
1256
  ]),
1258
1257
  key: "0"
1259
1258
  } : void 0,
1260
- u.$slots.labelTrailing ? {
1259
+ p.$slots.labelTrailing ? {
1261
1260
  name: "labelTrailing",
1262
- fn: f(() => [
1263
- S(u.$slots, "labelTrailing")
1261
+ fn: k(() => [
1262
+ R(p.$slots, "labelTrailing")
1264
1263
  ]),
1265
1264
  key: "1"
1266
1265
  } : void 0,
1267
- u.$slots.readonly ? {
1266
+ p.$slots.readonly ? {
1268
1267
  name: "readonly",
1269
- fn: f(() => [
1270
- S(u.$slots, "readonly")
1268
+ fn: k(() => [
1269
+ R(p.$slots, "readonly")
1271
1270
  ]),
1272
1271
  key: "2"
1273
1272
  } : void 0
1274
1273
  ]), 1040, ["model-value", "decimals", "negative", "blank-zero", "suffix", "width"]));
1275
1274
  }
1276
- }), ll = { class: "flex flex-col gap-2" }, ol = ["onClick"], Do = /* @__PURE__ */ G({
1275
+ }), Cl = { class: "flex flex-col gap-2" }, Sl = ["onClick"], Tr = /* @__PURE__ */ J({
1277
1276
  __name: "MonthYearField",
1278
- props: /* @__PURE__ */ le(/* @__PURE__ */ ce({
1277
+ props: /* @__PURE__ */ ve(/* @__PURE__ */ me({
1279
1278
  label: {},
1280
1279
  labelHidden: { type: Boolean },
1281
1280
  hint: {},
@@ -1289,7 +1288,7 @@ const To = /* @__PURE__ */ G({
1289
1288
  minYear: {},
1290
1289
  maxYear: {},
1291
1290
  placeholder: {}
1292
- }, { ...me, placeholder: void 0, minYear: 1970, maxYear: () => (/* @__PURE__ */ new Date()).getFullYear() + 1 }), {
1291
+ }, { ...pe, placeholder: void 0, minYear: 1970, maxYear: () => (/* @__PURE__ */ new Date()).getFullYear() + 1 }), {
1293
1292
  month: { default: null },
1294
1293
  monthModifiers: {},
1295
1294
  year: { default: null },
@@ -1297,59 +1296,59 @@ const To = /* @__PURE__ */ G({
1297
1296
  }),
1298
1297
  emits: ["update:month", "update:year"],
1299
1298
  setup(l) {
1300
- const t = l, e = re(l, "month"), a = re(l, "year"), { t: o } = oe(), n = h(() => e.value !== null && e.value >= 1 && e.value <= 12), u = (x, $) => o(`core.form.months.${$}.${x}`), r = h(() => n.value && a.value !== null ? o("core.form.months.with_year", { month: u(e.value, "long"), year: a.value }) : a.value !== null ? String(a.value) : n.value ? u(e.value, "long") : "");
1301
- function m(x, $) {
1302
- e.value = x.month, a.value = x.year, $();
1299
+ const t = l, e = ke(l, "month"), a = ke(l, "year"), { t: r } = re(), i = q(() => e.value !== null && e.value >= 1 && e.value <= 12), p = (V, $) => r(`core.form.months.${$}.${V}`), u = q(() => i.value && a.value !== null ? r("core.form.months.with_year", { month: p(e.value, "long"), year: a.value }) : a.value !== null ? String(a.value) : i.value ? p(e.value, "long") : "");
1300
+ function b(V, $) {
1301
+ e.value = V.month, a.value = V.year, $();
1303
1302
  }
1304
- function k(x) {
1305
- e.value = null, a.value = null, x();
1303
+ function _(V) {
1304
+ e.value = null, a.value = null, V();
1306
1305
  }
1307
- return (x, $) => (d(), M(ye, J(s(fe)(t), {
1308
- value: r.value || null
1309
- }), Z({
1310
- default: f(({ id: i, describedby: v, invalid: g }) => [
1311
- N(Ie, {
1312
- label: t.label ?? r.value,
1306
+ return (V, $) => (d(), z(ye, N(s(fe)(t), {
1307
+ value: u.value || null
1308
+ }), ie({
1309
+ default: k(({ id: n, describedby: c, invalid: m }) => [
1310
+ U(Pe, {
1311
+ label: t.label ?? u.value,
1313
1312
  width: "sm",
1314
1313
  placement: "bottom-start",
1315
1314
  arrow: !1
1316
1315
  }, {
1317
- trigger: f(({ toggle: D, presented: w }) => [
1318
- N(at, J({ id: i, "aria-describedby": v }, {
1319
- expanded: w,
1316
+ trigger: k(({ toggle: h, presented: v }) => [
1317
+ U(vt, N({ id: n, "aria-describedby": c }, {
1318
+ expanded: v,
1320
1319
  disabled: t.disabled,
1321
- invalid: g,
1322
- placeholder: t.placeholder ?? s(o)("core.form.select.choose"),
1323
- onClick: D
1320
+ invalid: m,
1321
+ placeholder: t.placeholder ?? s(r)("core.form.select.choose"),
1322
+ onClick: h
1324
1323
  }), {
1325
- default: f(() => [
1326
- r.value ? (d(), y(de, { key: 0 }, [
1327
- H(C(r.value), 1),
1328
- N(s(X), {
1324
+ default: k(() => [
1325
+ u.value ? (d(), g(ee, { key: 0 }, [
1326
+ Z(B(u.value), 1),
1327
+ U(s(ue), {
1329
1328
  name: "calendarLine",
1330
1329
  size: 16,
1331
1330
  class: "ml-2 shrink-0 text-content-muted"
1332
1331
  })
1333
- ], 64)) : L("", !0)
1332
+ ], 64)) : j("", !0)
1334
1333
  ]),
1335
1334
  _: 1
1336
1335
  }, 16, ["expanded", "disabled", "invalid", "placeholder", "onClick"])
1337
1336
  ]),
1338
- default: f(({ dismiss: D }) => [
1339
- p("div", ll, [
1340
- N(qt, {
1337
+ default: k(({ dismiss: h }) => [
1338
+ x("div", Cl, [
1339
+ U(Xt, {
1341
1340
  month: e.value,
1342
1341
  year: a.value,
1343
1342
  "min-year": t.minYear,
1344
1343
  "max-year": t.maxYear,
1345
- onPick: (w) => m(w, D)
1344
+ onPick: (v) => b(v, h)
1346
1345
  }, null, 8, ["month", "year", "min-year", "max-year", "onPick"]),
1347
- n.value || a.value !== null ? (d(), y("button", {
1346
+ i.value || a.value !== null ? (d(), g("button", {
1348
1347
  key: 0,
1349
1348
  type: "button",
1350
1349
  class: "cursor-pointer self-start rounded-control px-1 text-footnote text-content-link",
1351
- onClick: (w) => k(D)
1352
- }, C(s(o)("core.form.select.clear")), 9, ol)) : L("", !0)
1350
+ onClick: (v) => _(h)
1351
+ }, B(s(r)("core.form.select.clear")), 9, Sl)) : j("", !0)
1353
1352
  ])
1354
1353
  ]),
1355
1354
  _: 2
@@ -1357,32 +1356,32 @@ const To = /* @__PURE__ */ G({
1357
1356
  ]),
1358
1357
  _: 2
1359
1358
  }, [
1360
- x.$slots.trailing ? {
1359
+ V.$slots.trailing ? {
1361
1360
  name: "trailing",
1362
- fn: f(() => [
1363
- S(x.$slots, "trailing")
1361
+ fn: k(() => [
1362
+ R(V.$slots, "trailing")
1364
1363
  ]),
1365
1364
  key: "0"
1366
1365
  } : void 0,
1367
- x.$slots.labelTrailing ? {
1366
+ V.$slots.labelTrailing ? {
1368
1367
  name: "labelTrailing",
1369
- fn: f(() => [
1370
- S(x.$slots, "labelTrailing")
1368
+ fn: k(() => [
1369
+ R(V.$slots, "labelTrailing")
1371
1370
  ]),
1372
1371
  key: "1"
1373
1372
  } : void 0,
1374
- x.$slots.readonly ? {
1373
+ V.$slots.readonly ? {
1375
1374
  name: "readonly",
1376
- fn: f(() => [
1377
- S(x.$slots, "readonly")
1375
+ fn: k(() => [
1376
+ R(V.$slots, "readonly")
1378
1377
  ]),
1379
1378
  key: "2"
1380
1379
  } : void 0
1381
1380
  ]), 1040, ["value"]));
1382
1381
  }
1383
- }), nl = { class: "flex min-w-0 flex-wrap items-center gap-1.5 py-0.5" }, sl = { class: "truncate" }, rl = ["disabled", "aria-label", "onClick"], il = ["id", "disabled", "aria-expanded", "aria-invalid", "aria-describedby", "aria-busy"], ul = ["id", "disabled", "aria-invalid", "aria-describedby", "aria-busy", "onClick"], dl = { class: "max-h-72 overflow-y-auto" }, cl = { class: "flex items-center justify-between gap-2" }, Ye = "inline-flex min-h-7 cursor-pointer items-center gap-1 rounded-control bg-fill px-2.5 py-1 text-body text-content-muted hover:bg-fill-strong focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus disabled:cursor-not-allowed disabled:opacity-45", Lo = /* @__PURE__ */ G({
1382
+ }), Fl = { class: "flex min-w-0 flex-wrap items-center gap-1.5 py-0.5" }, ql = { class: "truncate" }, Bl = ["disabled", "aria-label", "onClick"], Ll = ["id", "disabled", "aria-expanded", "aria-invalid", "aria-describedby", "aria-busy"], Tl = ["id", "disabled", "aria-invalid", "aria-describedby", "aria-busy", "onClick"], Dl = { class: "max-h-72 overflow-y-auto" }, zl = { class: "flex items-center justify-between gap-2" }, lt = "inline-flex min-h-7 cursor-pointer items-center gap-1 rounded-control bg-fill px-2.5 py-1 text-body text-content-muted hover:bg-fill-strong focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus disabled:cursor-not-allowed disabled:opacity-45", jl = /* @__PURE__ */ J({
1384
1383
  __name: "MultiSelectField",
1385
- props: /* @__PURE__ */ le(/* @__PURE__ */ ce({
1384
+ props: /* @__PURE__ */ ve(/* @__PURE__ */ me({
1386
1385
  label: {},
1387
1386
  labelHidden: { type: Boolean },
1388
1387
  hint: {},
@@ -1397,114 +1396,114 @@ const To = /* @__PURE__ */ G({
1397
1396
  selected: {},
1398
1397
  placeholder: {},
1399
1398
  searchFrom: {}
1400
- }, { ...me, selected: () => [], placeholder: void 0, searchFrom: 9 }), {
1399
+ }, { ...pe, selected: () => [], placeholder: void 0, searchFrom: 9 }), {
1401
1400
  modelValue: { default: () => [] },
1402
1401
  modelModifiers: {}
1403
1402
  }),
1404
1403
  emits: ["update:modelValue"],
1405
1404
  setup(l) {
1406
- const t = l, e = re(l, "modelValue"), { t: a } = oe(), o = Ne(), n = U("sheet"), u = P(!1), r = jt(() => t.options, (i) => {
1407
- const v = e.value.filter((g) => i.some((D) => D.value === g));
1408
- v.length !== e.value.length && (e.value = v);
1409
- }), m = h(() => e.value.flatMap((i) => {
1410
- const v = r.known.value.find((g) => g.value === i) ?? t.selected.find((g) => g.value === i);
1411
- return v ? [v] : [];
1412
- })), k = h(() => t.placeholder ?? a("core.form.select.choose"));
1413
- function x(i) {
1414
- i !== null && (e.value = e.value.includes(i) ? e.value.filter((v) => v !== i) : [...e.value, i]);
1405
+ const t = l, e = ke(l, "modelValue"), { t: a } = re(), r = Ne(), i = oe("sheet"), p = H(!1), u = ra(() => t.options, (n) => {
1406
+ const c = e.value.filter((m) => n.some((h) => h.value === m));
1407
+ c.length !== e.value.length && (e.value = c);
1408
+ }), b = q(() => e.value.flatMap((n) => {
1409
+ const c = u.known.value.find((m) => m.value === n) ?? t.selected.find((m) => m.value === n);
1410
+ return c ? [c] : [];
1411
+ })), _ = q(() => t.placeholder ?? a("core.form.select.choose"));
1412
+ function V(n) {
1413
+ n !== null && (e.value = e.value.includes(n) ? e.value.filter((c) => c !== n) : [...e.value, n]);
1415
1414
  }
1416
- const $ = (i) => e.value = e.value.filter((v) => v !== i);
1417
- return (i, v) => (d(), M(ye, J(s(fe)(t), {
1418
- value: m.value.length ? m.value.map((g) => g.label).join(", ") : null,
1415
+ const $ = (n) => e.value = e.value.filter((c) => c !== n);
1416
+ return (n, c) => (d(), z(ye, N(s(fe)(t), {
1417
+ value: b.value.length ? b.value.map((m) => m.label).join(", ") : null,
1419
1418
  "row-layout": "stacked"
1420
- }), Z({
1421
- default: f(({ id: g, describedby: D, invalid: w }) => [
1422
- p("div", nl, [
1423
- (d(!0), y(de, null, $e(m.value, (F) => (d(), y("span", {
1424
- key: String(F.value),
1419
+ }), ie({
1420
+ default: k(({ id: m, describedby: h, invalid: v }) => [
1421
+ x("div", Fl, [
1422
+ (d(!0), g(ee, null, ce(b.value, (y) => (d(), g("span", {
1423
+ key: String(y.value),
1425
1424
  "data-test": "chip",
1426
1425
  class: "inline-flex min-h-7 max-w-full items-center gap-1 rounded-full bg-tint-soft pl-3 pr-1 text-subheadline font-medium text-content-link"
1427
1426
  }, [
1428
- p("span", sl, C(F.label), 1),
1429
- p("button", {
1427
+ x("span", ql, B(y.label), 1),
1428
+ x("button", {
1430
1429
  type: "button",
1431
1430
  disabled: t.disabled,
1432
- "aria-label": `${s(a)("core.form.select.clear")}: ${F.label}`,
1431
+ "aria-label": `${s(a)("core.form.select.clear")}: ${y.label}`,
1433
1432
  class: "flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-full hover:bg-fill focus-visible:outline-2 focus-visible:outline-border-focus disabled:cursor-not-allowed",
1434
- onClick: (O) => $(F.value)
1433
+ onClick: (S) => $(y.value)
1435
1434
  }, [
1436
- N(s(X), {
1435
+ U(s(ue), {
1437
1436
  name: "close",
1438
1437
  size: 12
1439
1438
  })
1440
- ], 8, rl)
1439
+ ], 8, Bl)
1441
1440
  ]))), 128)),
1442
- s(o) ? (d(), y("button", {
1441
+ s(r) ? (d(), g("button", {
1443
1442
  key: 0,
1444
- id: g,
1443
+ id: m,
1445
1444
  type: "button",
1446
1445
  disabled: t.disabled,
1447
1446
  "aria-haspopup": "dialog",
1448
- "aria-expanded": u.value,
1449
- "aria-invalid": w || void 0,
1450
- "aria-describedby": D,
1451
- "aria-busy": s(r).loading.value || void 0,
1452
- class: I(Ye),
1453
- onClick: v[0] || (v[0] = (F) => n.value?.present())
1447
+ "aria-expanded": p.value,
1448
+ "aria-invalid": v || void 0,
1449
+ "aria-describedby": h,
1450
+ "aria-busy": s(u).loading.value || void 0,
1451
+ class: W(lt),
1452
+ onClick: c[0] || (c[0] = (y) => i.value?.present())
1454
1453
  }, [
1455
- s(r).loading.value ? (d(), M(s(X), {
1454
+ s(u).loading.value ? (d(), z(s(ue), {
1456
1455
  key: 0,
1457
1456
  name: "loader4Line",
1458
1457
  size: 14,
1459
1458
  class: "shrink-0 animate-spin"
1460
- })) : L("", !0),
1461
- H(" " + C(m.value.length ? s(a)("core.actions.edit") : k.value), 1)
1462
- ], 8, il)) : (d(), M(Ie, {
1459
+ })) : j("", !0),
1460
+ Z(" " + B(b.value.length ? s(a)("core.actions.edit") : _.value), 1)
1461
+ ], 8, Ll)) : (d(), z(Pe, {
1463
1462
  key: 1,
1464
- label: t.label ?? k.value,
1463
+ label: t.label ?? _.value,
1465
1464
  width: "lg",
1466
1465
  "match-trigger-width": "",
1467
1466
  placement: "bottom-start",
1468
1467
  arrow: !1
1469
1468
  }, {
1470
- trigger: f(({ toggle: F, attrs: O }) => [
1471
- p("button", J({
1472
- id: g,
1469
+ trigger: k(({ toggle: y, attrs: S }) => [
1470
+ x("button", N({
1471
+ id: m,
1473
1472
  type: "button"
1474
- }, O, {
1473
+ }, S, {
1475
1474
  "aria-haspopup": "listbox",
1476
1475
  disabled: t.disabled,
1477
- "aria-invalid": w || void 0,
1478
- "aria-describedby": D,
1479
- "aria-busy": s(r).loading.value || void 0,
1480
- class: Ye,
1481
- onClick: F
1476
+ "aria-invalid": v || void 0,
1477
+ "aria-describedby": h,
1478
+ "aria-busy": s(u).loading.value || void 0,
1479
+ class: lt,
1480
+ onClick: y
1482
1481
  }), [
1483
- s(r).loading.value ? (d(), M(s(X), {
1482
+ s(u).loading.value ? (d(), z(s(ue), {
1484
1483
  key: 0,
1485
1484
  name: "loader4Line",
1486
1485
  size: 14,
1487
1486
  class: "shrink-0 animate-spin"
1488
- })) : L("", !0),
1489
- H(" " + C(m.value.length ? s(a)("core.actions.edit") : k.value), 1)
1490
- ], 16, ul)
1487
+ })) : j("", !0),
1488
+ Z(" " + B(b.value.length ? s(a)("core.actions.edit") : _.value), 1)
1489
+ ], 16, Tl)
1491
1490
  ]),
1492
- default: f(() => [
1493
- p("div", dl, [
1494
- N(Ke, {
1495
- options: s(r).rows.value,
1496
- status: s(r).status.value,
1491
+ default: k(() => [
1492
+ x("div", Dl, [
1493
+ U(Xe, {
1494
+ options: s(u).rows.value,
1495
+ status: s(u).status.value,
1497
1496
  "model-value": e.value,
1498
1497
  multiple: "",
1499
1498
  "search-from": t.searchFrom,
1500
1499
  presentation: "plain",
1501
- onSelect: x,
1502
- onRetry: v[1] || (v[1] = (F) => s(r).reload())
1503
- }, Z({ _: 2 }, [
1504
- i.$slots.option ? {
1500
+ onSelect: V,
1501
+ onRetry: c[1] || (c[1] = (y) => s(u).reload())
1502
+ }, ie({ _: 2 }, [
1503
+ n.$slots.option ? {
1505
1504
  name: "option",
1506
- fn: f((F) => [
1507
- S(i.$slots, "option", qe(Ve(F)))
1505
+ fn: k((y) => [
1506
+ R(n.$slots, "option", Re(Ue(y)))
1508
1507
  ]),
1509
1508
  key: "0"
1510
1509
  } : void 0
@@ -1514,88 +1513,88 @@ const To = /* @__PURE__ */ G({
1514
1513
  _: 2
1515
1514
  }, 1032, ["label"]))
1516
1515
  ]),
1517
- s(o) ? (d(), M(Ot, {
1516
+ s(r) ? (d(), z(oa, {
1518
1517
  key: 0,
1519
1518
  ref_key: "sheet",
1520
- ref: n,
1521
- title: t.label ?? k.value,
1519
+ ref: i,
1520
+ title: t.label ?? _.value,
1522
1521
  grouped: "",
1523
- onPresented: v[5] || (v[5] = (F) => u.value = !0),
1524
- onDismissed: v[6] || (v[6] = (F) => u.value = !1)
1522
+ onPresented: c[5] || (c[5] = (y) => p.value = !0),
1523
+ onDismissed: c[6] || (c[6] = (y) => p.value = !1)
1525
1524
  }, {
1526
- footer: f(() => [
1527
- p("div", cl, [
1528
- N(be, {
1525
+ footer: k(() => [
1526
+ x("div", zl, [
1527
+ U(ae, {
1529
1528
  prominence: "plain",
1530
1529
  disabled: e.value.length === 0,
1531
- onClick: v[3] || (v[3] = (F) => e.value = [])
1530
+ onClick: c[3] || (c[3] = (y) => e.value = [])
1532
1531
  }, {
1533
- default: f(() => [
1534
- H(C(s(a)("core.form.select.clear")), 1)
1532
+ default: k(() => [
1533
+ Z(B(s(a)("core.form.select.clear")), 1)
1535
1534
  ]),
1536
1535
  _: 1
1537
1536
  }, 8, ["disabled"]),
1538
- N(be, {
1537
+ U(ae, {
1539
1538
  prominence: "primary",
1540
- onClick: v[4] || (v[4] = (F) => n.value?.dismiss())
1539
+ onClick: c[4] || (c[4] = (y) => i.value?.dismiss())
1541
1540
  }, {
1542
- default: f(() => [
1543
- H(C(s(a)("core.form.select.done")), 1)
1541
+ default: k(() => [
1542
+ Z(B(s(a)("core.form.select.done")), 1)
1544
1543
  ]),
1545
1544
  _: 1
1546
1545
  })
1547
1546
  ])
1548
1547
  ]),
1549
- default: f(() => [
1550
- N(Ke, {
1551
- options: s(r).rows.value,
1552
- status: s(r).status.value,
1548
+ default: k(() => [
1549
+ U(Xe, {
1550
+ options: s(u).rows.value,
1551
+ status: s(u).status.value,
1553
1552
  "model-value": e.value,
1554
1553
  multiple: "",
1555
1554
  "search-from": t.searchFrom,
1556
- onSelect: x,
1557
- onRetry: v[2] || (v[2] = (F) => s(r).reload())
1558
- }, Z({ _: 2 }, [
1559
- i.$slots.option ? {
1555
+ onSelect: V,
1556
+ onRetry: c[2] || (c[2] = (y) => s(u).reload())
1557
+ }, ie({ _: 2 }, [
1558
+ n.$slots.option ? {
1560
1559
  name: "option",
1561
- fn: f((F) => [
1562
- S(i.$slots, "option", qe(Ve(F)))
1560
+ fn: k((y) => [
1561
+ R(n.$slots, "option", Re(Ue(y)))
1563
1562
  ]),
1564
1563
  key: "0"
1565
1564
  } : void 0
1566
1565
  ]), 1032, ["options", "status", "model-value", "search-from"])
1567
1566
  ]),
1568
1567
  _: 3
1569
- }, 8, ["title"])) : L("", !0)
1568
+ }, 8, ["title"])) : j("", !0)
1570
1569
  ]),
1571
1570
  _: 2
1572
1571
  }, [
1573
- i.$slots.trailing ? {
1572
+ n.$slots.trailing ? {
1574
1573
  name: "trailing",
1575
- fn: f(() => [
1576
- S(i.$slots, "trailing")
1574
+ fn: k(() => [
1575
+ R(n.$slots, "trailing")
1577
1576
  ]),
1578
1577
  key: "0"
1579
1578
  } : void 0,
1580
- i.$slots.labelTrailing ? {
1579
+ n.$slots.labelTrailing ? {
1581
1580
  name: "labelTrailing",
1582
- fn: f(() => [
1583
- S(i.$slots, "labelTrailing")
1581
+ fn: k(() => [
1582
+ R(n.$slots, "labelTrailing")
1584
1583
  ]),
1585
1584
  key: "1"
1586
1585
  } : void 0,
1587
- i.$slots.readonly ? {
1586
+ n.$slots.readonly ? {
1588
1587
  name: "readonly",
1589
- fn: f(() => [
1590
- S(i.$slots, "readonly")
1588
+ fn: k(() => [
1589
+ R(n.$slots, "readonly")
1591
1590
  ]),
1592
1591
  key: "2"
1593
1592
  } : void 0
1594
1593
  ]), 1040, ["value"]));
1595
1594
  }
1596
- }), fl = ["aria-label"], ml = ["src"], vl = { class: "flex flex-wrap items-center gap-3" }, pl = ["id", "accept", "disabled", "aria-describedby", "aria-invalid"], bl = ["aria-label"], gl = ["src"], qo = /* @__PURE__ */ G({
1595
+ }), Ol = ["aria-label"], Ml = ["src"], Rl = { class: "flex flex-wrap items-center gap-3" }, Ul = ["id", "accept", "disabled", "aria-describedby", "aria-invalid"], El = ["aria-label"], Il = ["src"], Dr = /* @__PURE__ */ J({
1597
1596
  __name: "PhotoField",
1598
- props: /* @__PURE__ */ le(/* @__PURE__ */ ce({
1597
+ props: /* @__PURE__ */ ve(/* @__PURE__ */ me({
1599
1598
  label: {},
1600
1599
  labelHidden: { type: Boolean },
1601
1600
  hint: {},
@@ -1608,181 +1607,181 @@ const To = /* @__PURE__ */ G({
1608
1607
  name: {},
1609
1608
  accept: {},
1610
1609
  maxSize: {}
1611
- }, { ...me, accept: () => ["image/jpeg", "image/png", "image/webp", "image/gif"], maxSize: 5 * 1024 * 1024 }), {
1610
+ }, { ...pe, accept: () => ["image/jpeg", "image/png", "image/webp", "image/gif"], maxSize: 5 * 1024 * 1024 }), {
1612
1611
  modelValue: { default: null },
1613
1612
  modelModifiers: {}
1614
1613
  }),
1615
1614
  emits: ["update:modelValue"],
1616
1615
  setup(l) {
1617
- const t = l, e = re(l, "modelValue"), { t: a } = oe(), o = U("chooser"), n = P(null), u = P(null);
1618
- function r() {
1619
- u.value && URL.revokeObjectURL(u.value), u.value = null;
1616
+ const t = l, e = ke(l, "modelValue"), { t: a } = re(), r = oe("chooser"), i = H(null), p = H(null);
1617
+ function u() {
1618
+ p.value && URL.revokeObjectURL(p.value), p.value = null;
1620
1619
  }
1621
- ge(
1620
+ be(
1622
1621
  e,
1623
- (i) => {
1624
- r(), i instanceof File && (u.value = URL.createObjectURL(i)), i === null && o.value && (o.value.value = "");
1622
+ (n) => {
1623
+ u(), n instanceof File && (p.value = URL.createObjectURL(n)), n === null && r.value && (r.value.value = "");
1625
1624
  },
1626
1625
  { immediate: !0 }
1627
- ), Xe(r);
1628
- const m = h(() => e.value instanceof File ? u.value : e.value), k = U("viewer"), x = h(() => m.value ? [{ src: m.value, alt: t.label ?? a("core.viewer.label"), downloadName: e.value instanceof File ? e.value.name : void 0 }] : []);
1629
- function $(i) {
1630
- if (!i) return;
1631
- const v = st(i, { accept: t.accept, maxSize: t.maxSize });
1632
- v ? n.value = v === "invalid_type" ? a("core.form.file.invalid_type") : a("core.form.file.too_large", { size: Be(t.maxSize) }) : (n.value = null, e.value = i);
1626
+ ), ze(u);
1627
+ const b = q(() => e.value instanceof File ? p.value : e.value), _ = oe("viewer"), V = q(() => b.value ? [{ src: b.value, alt: t.label ?? a("core.viewer.label"), downloadName: e.value instanceof File ? e.value.name : void 0 }] : []);
1628
+ function $(n) {
1629
+ if (!n) return;
1630
+ const c = $t(n, { accept: t.accept, maxSize: t.maxSize });
1631
+ c ? i.value = c === "invalid_type" ? a("core.form.file.invalid_type") : a("core.form.file.too_large", { size: Le(t.maxSize) }) : (i.value = null, e.value = n);
1633
1632
  }
1634
- return (i, v) => (d(), M(ye, J({ ...s(fe)(t), error: n.value ?? t.error }, {
1635
- value: m.value ? s(a)("core.form.file.choose") : null,
1633
+ return (n, c) => (d(), z(ye, N({ ...s(fe)(t), error: i.value ?? t.error }, {
1634
+ value: b.value ? s(a)("core.form.file.choose") : null,
1636
1635
  "row-layout": "stacked"
1637
- }), Z({
1638
- readonly: f(() => [
1639
- m.value ? (d(), y("button", {
1636
+ }), ie({
1637
+ readonly: k(() => [
1638
+ b.value ? (d(), g("button", {
1640
1639
  key: 0,
1641
1640
  type: "button",
1642
1641
  "aria-label": s(a)("core.viewer.open"),
1643
1642
  "data-test": "photo-open",
1644
1643
  class: "block cursor-zoom-in rounded-group focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus",
1645
- onClick: v[0] || (v[0] = (g) => k.value?.present(0))
1644
+ onClick: c[0] || (c[0] = (m) => _.value?.present(0))
1646
1645
  }, [
1647
- p("img", {
1648
- src: m.value,
1646
+ x("img", {
1647
+ src: b.value,
1649
1648
  alt: "",
1650
1649
  class: "size-40 rounded-group object-cover"
1651
- }, null, 8, ml)
1652
- ], 8, fl)) : L("", !0),
1653
- m.value ? (d(), M(Pe, {
1650
+ }, null, 8, Ml)
1651
+ ], 8, Ol)) : j("", !0),
1652
+ b.value ? (d(), z(Qe, {
1654
1653
  key: 1,
1655
1654
  ref_key: "viewer",
1656
- ref: k,
1657
- items: x.value
1658
- }, null, 8, ["items"])) : L("", !0)
1655
+ ref: _,
1656
+ items: V.value
1657
+ }, null, 8, ["items"])) : j("", !0)
1659
1658
  ]),
1660
- default: f(({ id: g, describedby: D, invalid: w }) => [
1661
- p("div", vl, [
1662
- p("input", {
1663
- id: g,
1659
+ default: k(({ id: m, describedby: h, invalid: v }) => [
1660
+ x("div", Rl, [
1661
+ x("input", {
1662
+ id: m,
1664
1663
  ref_key: "chooser",
1665
- ref: o,
1664
+ ref: r,
1666
1665
  type: "file",
1667
1666
  class: "sr-only",
1668
1667
  tabindex: "-1",
1669
1668
  accept: t.accept.join(","),
1670
1669
  disabled: t.disabled,
1671
- "aria-describedby": D,
1672
- "aria-invalid": w || void 0,
1673
- onChange: v[1] || (v[1] = (F) => $(F.target.files?.[0]))
1674
- }, null, 40, pl),
1675
- m.value ? (d(), y("button", {
1670
+ "aria-describedby": h,
1671
+ "aria-invalid": v || void 0,
1672
+ onChange: c[1] || (c[1] = (y) => $(y.target.files?.[0]))
1673
+ }, null, 40, Ul),
1674
+ b.value ? (d(), g("button", {
1676
1675
  key: 0,
1677
1676
  type: "button",
1678
1677
  "aria-label": s(a)("core.viewer.open"),
1679
1678
  "data-test": "photo-open",
1680
1679
  class: "block cursor-zoom-in rounded-group focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus",
1681
- onClick: v[2] || (v[2] = (F) => k.value?.present(0))
1680
+ onClick: c[2] || (c[2] = (y) => _.value?.present(0))
1682
1681
  }, [
1683
- p("img", {
1684
- src: m.value,
1682
+ x("img", {
1683
+ src: b.value,
1685
1684
  alt: "",
1686
1685
  "data-test": "photo-preview",
1687
1686
  class: "size-28 rounded-group object-cover"
1688
- }, null, 8, gl)
1689
- ], 8, bl)) : L("", !0),
1690
- N(be, {
1687
+ }, null, 8, Il)
1688
+ ], 8, El)) : j("", !0),
1689
+ U(ae, {
1691
1690
  disabled: t.disabled,
1692
- onClick: v[3] || (v[3] = (F) => o.value?.click())
1691
+ onClick: c[3] || (c[3] = (y) => r.value?.click())
1693
1692
  }, {
1694
- default: f(() => [
1695
- H(C(s(a)("core.form.file.choose")), 1)
1693
+ default: k(() => [
1694
+ Z(B(s(a)("core.form.file.choose")), 1)
1696
1695
  ]),
1697
1696
  _: 1
1698
1697
  }, 8, ["disabled"]),
1699
- m.value ? (d(), M(be, {
1698
+ b.value ? (d(), z(ae, {
1700
1699
  key: 1,
1701
1700
  prominence: "plain",
1702
1701
  tone: "critical",
1703
1702
  disabled: t.disabled,
1704
- onClick: v[4] || (v[4] = (F) => {
1705
- e.value = null, n.value = null;
1703
+ onClick: c[4] || (c[4] = (y) => {
1704
+ e.value = null, i.value = null;
1706
1705
  })
1707
1706
  }, {
1708
- default: f(() => [
1709
- H(C(s(a)("core.form.file.remove")), 1)
1707
+ default: k(() => [
1708
+ Z(B(s(a)("core.form.file.remove")), 1)
1710
1709
  ]),
1711
1710
  _: 1
1712
- }, 8, ["disabled"])) : L("", !0)
1711
+ }, 8, ["disabled"])) : j("", !0)
1713
1712
  ]),
1714
- m.value ? (d(), M(Pe, {
1713
+ b.value ? (d(), z(Qe, {
1715
1714
  key: 0,
1716
1715
  ref_key: "viewer",
1717
- ref: k,
1718
- items: x.value
1719
- }, null, 8, ["items"])) : L("", !0)
1716
+ ref: _,
1717
+ items: V.value
1718
+ }, null, 8, ["items"])) : j("", !0)
1720
1719
  ]),
1721
1720
  _: 2
1722
1721
  }, [
1723
- i.$slots.trailing ? {
1722
+ n.$slots.trailing ? {
1724
1723
  name: "trailing",
1725
- fn: f(() => [
1726
- S(i.$slots, "trailing")
1724
+ fn: k(() => [
1725
+ R(n.$slots, "trailing")
1727
1726
  ]),
1728
1727
  key: "0"
1729
1728
  } : void 0,
1730
- i.$slots.labelTrailing ? {
1729
+ n.$slots.labelTrailing ? {
1731
1730
  name: "labelTrailing",
1732
- fn: f(() => [
1733
- S(i.$slots, "labelTrailing")
1731
+ fn: k(() => [
1732
+ R(n.$slots, "labelTrailing")
1734
1733
  ]),
1735
1734
  key: "1"
1736
1735
  } : void 0
1737
1736
  ]), 1040, ["value"]));
1738
1737
  }
1739
- }), yl = { hidden: "" }, hl = /* @__PURE__ */ G({
1738
+ }), Al = { hidden: "" }, Nl = /* @__PURE__ */ J({
1740
1739
  __name: "EditorChrome",
1741
1740
  props: {
1742
1741
  options: {}
1743
1742
  },
1744
1743
  setup(l) {
1745
- return Pt(l.options), (e, a) => (d(), y("span", yl));
1744
+ return ma(l.options), (e, a) => (d(), g("span", Al));
1746
1745
  }
1747
1746
  });
1748
- function kl(l) {
1749
- const t = P(0);
1747
+ function Pl(l) {
1748
+ const t = H(0);
1750
1749
  let e = 0;
1751
1750
  const a = () => {
1752
1751
  e || (e = requestAnimationFrame(() => {
1753
1752
  e = 0, t.value++;
1754
1753
  }));
1755
- }, o = typeof MutationObserver > "u" ? null : new MutationObserver(a);
1756
- ge(
1754
+ }, r = typeof MutationObserver > "u" ? null : new MutationObserver(a);
1755
+ be(
1757
1756
  () => l.sections.value,
1758
- (r) => {
1759
- o?.disconnect();
1760
- for (const m of r)
1761
- o?.observe(m.element, { subtree: !0, childList: !0, attributes: !0, attributeFilter: ["data-field-error", "data-field-required", "data-field-filled"] });
1757
+ (u) => {
1758
+ r?.disconnect();
1759
+ for (const b of u)
1760
+ r?.observe(b.element, { subtree: !0, childList: !0, attributes: !0, attributeFilter: ["data-field-error", "data-field-required", "data-field-filled"] });
1762
1761
  a();
1763
1762
  },
1764
1763
  { immediate: !0 }
1765
- ), ct() && ft(() => {
1766
- o?.disconnect(), e && cancelAnimationFrame(e);
1764
+ ), Lt() && Tt(() => {
1765
+ r?.disconnect(), e && cancelAnimationFrame(e);
1767
1766
  });
1768
- const n = h(() => (t.value, Object.fromEntries(
1769
- l.sections.value.map((r) => [
1770
- r.id,
1767
+ const i = q(() => (t.value, Object.fromEntries(
1768
+ l.sections.value.map((u) => [
1769
+ u.id,
1771
1770
  {
1772
- errors: r.element.querySelectorAll("[data-field-error]").length,
1773
- required: { total: r.element.querySelectorAll("[data-field-required]").length, filled: r.element.querySelectorAll("[data-field-required][data-field-filled]").length }
1771
+ errors: u.element.querySelectorAll("[data-field-error]").length,
1772
+ required: { total: u.element.querySelectorAll("[data-field-required]").length, filled: u.element.querySelectorAll("[data-field-required][data-field-filled]").length }
1774
1773
  }
1775
1774
  ])
1776
- ))), u = h(() => Object.values(n.value).reduce((r, m) => ({ filled: r.filled + m.required.filled, total: r.total + m.required.total }), { filled: 0, total: 0 }));
1777
- return { states: n, totals: u };
1775
+ ))), p = q(() => Object.values(i.value).reduce((u, b) => ({ filled: u.filled + b.required.filled, total: u.total + b.required.total }), { filled: 0, total: 0 }));
1776
+ return { states: i, totals: p };
1778
1777
  }
1779
- const xl = {
1778
+ const Kl = {
1780
1779
  class: "grid min-w-0 grid-cols-1 items-start gap-8 lg:grid-cols-[12.5rem_minmax(0,1fr)]",
1781
1780
  "data-test": "editor-page"
1782
- }, wl = {
1781
+ }, Gl = {
1783
1782
  key: 0,
1784
1783
  class: "sticky top-[calc(var(--app-bar-height)+1.5rem+var(--shell-banner-h,0px))] hidden min-w-0 flex-col gap-4 self-start lg:flex"
1785
- }, Vo = /* @__PURE__ */ G({
1784
+ }, zr = /* @__PURE__ */ J({
1786
1785
  __name: "EditorPage",
1787
1786
  props: {
1788
1787
  title: {},
@@ -1795,10 +1794,10 @@ const xl = {
1795
1794
  },
1796
1795
  emits: ["save", "cancel"],
1797
1796
  setup(l, { emit: t }) {
1798
- const e = l, a = t, { t: o } = oe(), n = Ne(), u = Kt(), { states: r, totals: m } = kl(u), k = U("content"), x = h(
1797
+ const e = l, a = t, { t: r } = re(), i = Ne(), p = ca(), { states: u, totals: b } = Pl(p), _ = oe("content"), V = q(
1799
1798
  () => e.form ? {
1800
1799
  form: e.form,
1801
- label: () => e.saveLabel ?? o("core.actions.save"),
1800
+ label: () => e.saveLabel ?? r("core.actions.save"),
1802
1801
  allowed: () => e.canSave,
1803
1802
  disabledWhileClean: () => e.disabledWhileClean,
1804
1803
  save: () => {
@@ -1809,90 +1808,90 @@ const xl = {
1809
1808
  }
1810
1809
  } : null
1811
1810
  );
1812
- ge(
1811
+ be(
1813
1812
  () => e.form?.failure.value,
1814
- async (i) => {
1815
- i?.kind === "invalid" && (await xe(), await Le(k.value ?? document, u));
1813
+ async (n) => {
1814
+ n?.kind === "invalid" && (await we(), await Me(_.value ?? document, p));
1816
1815
  }
1817
1816
  );
1818
- function $(i) {
1819
- const v = u.sections.value.find((g) => g.id === i)?.element;
1820
- v && xe(() => Le(v));
1817
+ function $(n) {
1818
+ const c = p.sections.value.find((m) => m.id === n)?.element;
1819
+ c && we(() => Me(c));
1821
1820
  }
1822
- return (i, v) => (d(), M(Et, {
1821
+ return (n, c) => (d(), z(ia, {
1823
1822
  title: e.title,
1824
1823
  back: e.back,
1825
1824
  width: "content"
1826
- }, Z({
1827
- default: f(() => [
1828
- x.value ? (d(), M(hl, {
1825
+ }, ie({
1826
+ default: k(() => [
1827
+ V.value ? (d(), z(Nl, {
1829
1828
  key: 0,
1830
- options: x.value
1831
- }, null, 8, ["options"])) : L("", !0),
1832
- p("div", xl, [
1833
- s(n) ? L("", !0) : (d(), y("aside", wl, [
1834
- N(At, {
1829
+ options: V.value
1830
+ }, null, 8, ["options"])) : j("", !0),
1831
+ x("div", Kl, [
1832
+ s(i) ? j("", !0) : (d(), g("aside", Gl, [
1833
+ U(ua, {
1835
1834
  standalone: "",
1836
- states: s(r),
1837
- progress: s(m),
1835
+ states: s(u),
1836
+ progress: s(b),
1838
1837
  onSelect: $
1839
1838
  }, null, 8, ["states", "progress"]),
1840
- S(i.$slots, "aside")
1839
+ R(n.$slots, "aside")
1841
1840
  ])),
1842
- p("div", {
1841
+ x("div", {
1843
1842
  ref_key: "content",
1844
- ref: k,
1843
+ ref: _,
1845
1844
  class: "flex min-w-0 flex-col gap-section-gap"
1846
1845
  }, [
1847
- e.form ? (d(), M(Je, {
1846
+ e.form ? (d(), z(it, {
1848
1847
  key: 0,
1849
1848
  form: e.form,
1850
1849
  label: e.fieldLabel,
1851
- scope: k.value
1852
- }, null, 8, ["form", "label", "scope"])) : L("", !0),
1853
- S(i.$slots, "default")
1850
+ scope: _.value
1851
+ }, null, 8, ["form", "label", "scope"])) : j("", !0),
1852
+ R(n.$slots, "default")
1854
1853
  ], 512)
1855
1854
  ]),
1856
- s(n) ? (d(), M(Gt, {
1855
+ s(i) ? (d(), z(da, {
1857
1856
  key: 1,
1858
- states: s(r)
1859
- }, null, 8, ["states"])) : L("", !0)
1857
+ states: s(u)
1858
+ }, null, 8, ["states"])) : j("", !0)
1860
1859
  ]),
1861
1860
  _: 2
1862
1861
  }, [
1863
- i.$slots.header ? {
1862
+ n.$slots.header ? {
1864
1863
  name: "header",
1865
- fn: f(() => [
1866
- S(i.$slots, "header")
1864
+ fn: k(() => [
1865
+ R(n.$slots, "header")
1867
1866
  ]),
1868
1867
  key: "0"
1869
1868
  } : void 0,
1870
- i.$slots.pager ? {
1869
+ n.$slots.pager ? {
1871
1870
  name: "pager",
1872
- fn: f(() => [
1873
- S(i.$slots, "pager")
1871
+ fn: k(() => [
1872
+ R(n.$slots, "pager")
1874
1873
  ]),
1875
1874
  key: "1"
1876
1875
  } : void 0,
1877
- i.$slots.notices ? {
1876
+ n.$slots.notices ? {
1878
1877
  name: "notices",
1879
- fn: f(() => [
1880
- S(i.$slots, "notices")
1878
+ fn: k(() => [
1879
+ R(n.$slots, "notices")
1881
1880
  ]),
1882
1881
  key: "2"
1883
1882
  } : void 0,
1884
- i.$slots.bottom ? {
1883
+ n.$slots.bottom ? {
1885
1884
  name: "bottom",
1886
- fn: f(() => [
1887
- S(i.$slots, "bottom")
1885
+ fn: k(() => [
1886
+ R(n.$slots, "bottom")
1888
1887
  ]),
1889
1888
  key: "3"
1890
1889
  } : void 0
1891
1890
  ]), 1032, ["title", "back"]));
1892
1891
  }
1893
- }), $l = ["value", "aria-label", "disabled", "aria-invalid", "placeholder"], zo = /* @__PURE__ */ G({
1892
+ }), Hl = ["value", "aria-label", "disabled", "aria-invalid", "placeholder"], jr = /* @__PURE__ */ J({
1894
1893
  __name: "NumberCell",
1895
- props: /* @__PURE__ */ le({
1894
+ props: /* @__PURE__ */ ve({
1896
1895
  label: {},
1897
1896
  min: { default: 0 },
1898
1897
  max: { default: 9999 },
@@ -1906,13 +1905,13 @@ const xl = {
1906
1905
  }),
1907
1906
  emits: ["update:modelValue"],
1908
1907
  setup(l) {
1909
- const t = l, e = re(l, "modelValue");
1910
- function a(n) {
1911
- const u = n.target.value.replace(/\D/g, "");
1912
- e.value = u === "" ? null : Math.min(t.max, Math.max(t.min, Number(u)));
1908
+ const t = l, e = ke(l, "modelValue");
1909
+ function a(i) {
1910
+ const p = i.target.value.replace(/\D/g, "");
1911
+ e.value = p === "" ? null : Math.min(t.max, Math.max(t.min, Number(p)));
1913
1912
  }
1914
- const o = (n) => n.target.value = e.value === null ? "" : String(e.value);
1915
- return (n, u) => (d(), y("input", {
1913
+ const r = (i) => i.target.value = e.value === null ? "" : String(e.value);
1914
+ return (i, p) => (d(), g("input", {
1916
1915
  value: e.value ?? "",
1917
1916
  type: "text",
1918
1917
  inputmode: "numeric",
@@ -1921,22 +1920,22 @@ const xl = {
1921
1920
  disabled: t.disabled,
1922
1921
  "aria-invalid": t.invalid || void 0,
1923
1922
  placeholder: t.placeholder,
1924
- class: I(["rounded-control bg-fill px-2 py-1 text-right text-body tabular-nums text-content-strong transition-[background-color,box-shadow] duration-motion-fast ease-motion-standard placeholder:text-content-disabled focus:bg-surface-cell focus:outline-none focus:ring-[1.5px] focus:ring-inset focus:ring-border-focus disabled:opacity-45", [t.wide ? "w-28" : "w-16", t.invalid ? "bg-status-danger-surface ring-[1.5px] ring-inset ring-border-destructive" : ""]]),
1923
+ class: W(["rounded-control bg-fill px-2 py-1 text-right text-body tabular-nums text-content-strong transition-[background-color,box-shadow] duration-motion-fast ease-motion-standard placeholder:text-content-disabled focus:bg-surface-cell focus:outline-none focus:ring-[1.5px] focus:ring-inset focus:ring-border-focus disabled:opacity-45", [t.wide ? "w-28" : "w-16", t.invalid ? "bg-status-danger-surface ring-[1.5px] ring-inset ring-border-destructive" : ""]]),
1925
1924
  onInput: a,
1926
- onBlur: o
1927
- }, null, 42, $l));
1925
+ onBlur: r
1926
+ }, null, 42, Hl));
1928
1927
  }
1929
- }), Oe = "vue-core:step-draft:";
1930
- function je(l) {
1928
+ }), Ge = "vue-core:step-draft:";
1929
+ function He(l) {
1931
1930
  try {
1932
1931
  return (l.storage === "local" ? window.localStorage : window.sessionStorage) ?? null;
1933
1932
  } catch {
1934
1933
  return null;
1935
1934
  }
1936
1935
  }
1937
- function _l(l) {
1936
+ function Wl(l) {
1938
1937
  try {
1939
- const t = je(l)?.getItem(Oe + l.key);
1938
+ const t = He(l)?.getItem(Ge + l.key);
1940
1939
  if (!t) return null;
1941
1940
  const e = JSON.parse(t);
1942
1941
  return !e || e.version !== (l.version ?? 1) || typeof e.values != "object" || e.values === null || typeof e.step != "string" || !Array.isArray(e.passed) ? null : e;
@@ -1944,308 +1943,308 @@ function _l(l) {
1944
1943
  return null;
1945
1944
  }
1946
1945
  }
1947
- function Cl(l, t) {
1946
+ function Yl(l, t) {
1948
1947
  try {
1949
- const e = je(l);
1948
+ const e = He(l);
1950
1949
  if (!e) return !1;
1951
- const a = (o, n) => typeof Blob < "u" && n instanceof Blob ? null : n;
1952
- return e.setItem(Oe + l.key, JSON.stringify({ version: l.version ?? 1, ...t }, a)), !0;
1950
+ const a = (r, i) => typeof Blob < "u" && i instanceof Blob ? null : i;
1951
+ return e.setItem(Ge + l.key, JSON.stringify({ version: l.version ?? 1, ...t }, a)), !0;
1953
1952
  } catch {
1954
1953
  return !1;
1955
1954
  }
1956
1955
  }
1957
- function We(l) {
1956
+ function ot(l) {
1958
1957
  try {
1959
- je(l)?.removeItem(Oe + l.key);
1958
+ He(l)?.removeItem(Ge + l.key);
1960
1959
  } catch {
1961
1960
  }
1962
1961
  }
1963
- function Sl(l, t) {
1962
+ function Jl(l, t) {
1964
1963
  for (const [e, a] of Object.entries(l)) {
1965
1964
  if (!(e in t)) continue;
1966
- const o = t[e];
1967
- (o === null || a === null || a === void 0 || typeof o == typeof a && Array.isArray(o) === Array.isArray(a)) && (l[e] = o);
1965
+ const r = t[e];
1966
+ (r === null || a === null || a === void 0 || typeof r == typeof a && Array.isArray(r) === Array.isArray(a)) && (l[e] = r);
1968
1967
  }
1969
1968
  }
1970
- function Mo(l, t) {
1971
- const { t: e } = oe(), a = h(() => mt(t.steps));
1969
+ function Or(l, t) {
1970
+ const { t: e } = re(), a = q(() => Dt(t.steps));
1972
1971
  if (a.value.length === 0) throw new Error("useStepForm: a flow needs at least one step.");
1973
- const o = P(a.value[0].name), n = Ae(/* @__PURE__ */ new Set()), u = Ae(/* @__PURE__ */ new Set([a.value[0].name])), r = P(null), m = P(!1), k = P(0), x = P(!1), $ = P(!1);
1974
- let i = !1, v = 0;
1975
- const g = h(() => Math.max(0, a.value.findIndex((c) => c.name === o.value))), D = (c) => c.fields?.filter((B) => l.errors.has(B)).length ?? 0, w = h(
1976
- () => a.value.map((c, B) => {
1977
- const R = D(c), b = B === g.value;
1972
+ const r = H(a.value[0].name), i = Ye(/* @__PURE__ */ new Set()), p = Ye(/* @__PURE__ */ new Set([a.value[0].name])), u = H(null), b = H(!1), _ = H(0), V = H(!1), $ = H(!1);
1973
+ let n = !1, c = 0;
1974
+ const m = q(() => Math.max(0, a.value.findIndex((f) => f.name === r.value))), h = (f) => f.fields?.filter((E) => l.errors.has(E)).length ?? 0, v = q(
1975
+ () => a.value.map((f, E) => {
1976
+ const G = h(f), F = E === m.value;
1978
1977
  return {
1979
- name: c.name,
1980
- label: c.label,
1981
- position: B + 1,
1982
- state: b ? "current" : n.has(c.name) && R === 0 ? "done" : "todo",
1983
- errors: R,
1984
- reachable: !b && (u.has(c.name) || B < g.value)
1978
+ name: f.name,
1979
+ label: f.label,
1980
+ position: E + 1,
1981
+ state: F ? "current" : i.has(f.name) && G === 0 ? "done" : "todo",
1982
+ errors: G,
1983
+ reachable: !F && (p.has(f.name) || E < m.value)
1985
1984
  };
1986
1985
  })
1987
- ), F = h(() => w.value[g.value]), O = h(() => w.value.length), j = h(() => g.value === 0), E = h(() => g.value === O.value - 1), V = h(() => m.value || l.submitting.value);
1988
- function Q(c) {
1989
- const B = a.value[c];
1990
- B && (r.value = c > g.value ? "forward" : "back", o.value = B.name, u.add(B.name), v = c, x.value = !1);
1986
+ ), y = q(() => v.value[m.value]), S = q(() => v.value.length), L = q(() => m.value === 0), T = q(() => m.value === S.value - 1), C = q(() => b.value || l.submitting.value);
1987
+ function P(f) {
1988
+ const E = a.value[f];
1989
+ E && (u.value = f > m.value ? "forward" : "back", r.value = E.name, p.add(E.name), c = f, V.value = !1);
1991
1990
  }
1992
- ge(
1993
- () => a.value.map((c) => c.name).join("\0"),
1991
+ be(
1992
+ () => a.value.map((f) => f.name).join("\0"),
1994
1993
  () => {
1995
- const c = a.value, B = c.findIndex((b) => b.name === o.value), R = B === -1 ? Math.min(v, c.length - 1) : B;
1996
- o.value = c[R].name, v = R, c.forEach((b, z) => {
1997
- z > R && (n.delete(b.name), u.delete(b.name));
1998
- }), u.add(o.value);
1999
- for (const b of [n, u]) for (const z of [...b]) c.some((T) => T.name === z) || b.delete(z);
1994
+ const f = a.value, E = f.findIndex((F) => F.name === r.value), G = E === -1 ? Math.min(c, f.length - 1) : E;
1995
+ r.value = f[G].name, c = G, f.forEach((F, K) => {
1996
+ K > G && (i.delete(F.name), p.delete(F.name));
1997
+ }), p.add(r.value);
1998
+ for (const F of [i, p]) for (const K of [...F]) f.some((I) => I.name === K) || F.delete(K);
2000
1999
  }
2001
2000
  );
2002
- function ee(c) {
2003
- const B = c.fields;
2004
- if (!B?.length) return !0;
2005
- const R = Object.entries(l.errors.all()).filter(([z]) => !B.includes(ut(z))), b = l.check(c.fields);
2006
- return R.length > 0 && l.errors.set({ ...Object.fromEntries(R), ...l.errors.all() }), b;
2001
+ function Y(f) {
2002
+ const E = f.fields;
2003
+ if (!E?.length) return !0;
2004
+ const G = Object.entries(l.errors.all()).filter(([K]) => !E.includes(qt(K))), F = l.check(f.fields);
2005
+ return G.length > 0 && l.errors.set({ ...Object.fromEntries(G), ...l.errors.all() }), F;
2007
2006
  }
2008
- async function ne(c) {
2009
- if (!ee(c))
2010
- return k.value++, !1;
2011
- if (!c.beforeNext) return !0;
2012
- m.value = !0;
2007
+ async function M(f) {
2008
+ if (!Y(f))
2009
+ return _.value++, !1;
2010
+ if (!f.beforeNext) return !0;
2011
+ b.value = !0;
2013
2012
  try {
2014
- if (await c.beforeNext()) return !0;
2013
+ if (await f.beforeNext()) return !0;
2015
2014
  } finally {
2016
- m.value = !1;
2015
+ b.value = !1;
2017
2016
  }
2018
- return k.value++, !1;
2017
+ return _.value++, !1;
2019
2018
  }
2020
- async function ie() {
2021
- const c = await l.submit(t.submit, t.submitOptions);
2022
- if (c.status === "saved" || c.status === "saved-refresh-failed")
2023
- return i = !0, Y(), t.onSaved?.(c.value), !0;
2024
- if (c.status === "failed" && (k.value++, F.value.errors === 0)) {
2025
- const B = w.value.findIndex((R) => R.errors > 0);
2026
- B !== -1 && Q(B);
2019
+ async function O() {
2020
+ const f = await l.submit(t.submit, t.submitOptions);
2021
+ if (f.status === "saved" || f.status === "saved-refresh-failed")
2022
+ return n = !0, le(), t.onSaved?.(f.value), !0;
2023
+ if (f.status === "failed" && (_.value++, y.value.errors === 0)) {
2024
+ const E = v.value.findIndex((G) => G.errors > 0);
2025
+ E !== -1 && P(E);
2027
2026
  }
2028
2027
  return !1;
2029
2028
  }
2030
- async function ue() {
2031
- if (V.value) return !1;
2032
- const c = a.value[g.value];
2033
- return await ne(c) ? (n.add(c.name), g.value < O.value - 1 ? (Q(g.value + 1), !0) : ie()) : !1;
2029
+ async function X() {
2030
+ if (C.value) return !1;
2031
+ const f = a.value[m.value];
2032
+ return await M(f) ? (i.add(f.name), m.value < S.value - 1 ? (P(m.value + 1), !0) : O()) : !1;
2034
2033
  }
2035
- async function q(c) {
2036
- if (V.value) return !1;
2037
- const B = a.value.findIndex((R) => R.name === c);
2038
- if (B === -1) return !1;
2039
- if (B <= g.value)
2040
- return B < g.value && Q(B), !0;
2041
- if (!u.has(c)) return !1;
2042
- for (; g.value < B; ) if (!await ue()) return !1;
2043
- return g.value === B;
2034
+ async function D(f) {
2035
+ if (C.value) return !1;
2036
+ const E = a.value.findIndex((G) => G.name === f);
2037
+ if (E === -1) return !1;
2038
+ if (E <= m.value)
2039
+ return E < m.value && P(E), !0;
2040
+ if (!p.has(f)) return !1;
2041
+ for (; m.value < E; ) if (!await X()) return !1;
2042
+ return m.value === E;
2044
2043
  }
2045
- const A = t.draft;
2046
- let K;
2047
- function te() {
2048
- if (K = void 0, !(!A || i)) {
2044
+ const Q = t.draft;
2045
+ let te;
2046
+ function ne() {
2047
+ if (te = void 0, !(!Q || n)) {
2049
2048
  if (!l.dirty.value) {
2050
- We(A), $.value = !1;
2049
+ ot(Q), $.value = !1;
2051
2050
  return;
2052
2051
  }
2053
- $.value = Cl(A, { values: it(l.values), step: o.value, passed: [...n] });
2052
+ $.value = Yl(Q, { values: Ft(l.values), step: r.value, passed: [...i] });
2054
2053
  }
2055
2054
  }
2056
- function Y() {
2057
- i = !0, clearTimeout(K), K = void 0, $.value = !1, A && We(A);
2055
+ function le() {
2056
+ n = !0, clearTimeout(te), te = void 0, $.value = !1, Q && ot(Q);
2058
2057
  }
2059
- if (A) {
2060
- const c = _l(A);
2061
- if (c) {
2062
- Sl(l.values, c.values);
2063
- const B = a.value.map((R) => R.name);
2064
- B.includes(c.step) && (o.value = c.step);
2065
- for (const R of c.passed) B.includes(R) && n.add(R);
2066
- for (const R of [...n, o.value]) u.add(R);
2067
- v = g.value, x.value = l.dirty.value, $.value = x.value;
2058
+ if (Q) {
2059
+ const f = Wl(Q);
2060
+ if (f) {
2061
+ Jl(l.values, f.values);
2062
+ const E = a.value.map((G) => G.name);
2063
+ E.includes(f.step) && (r.value = f.step);
2064
+ for (const G of f.passed) E.includes(G) && i.add(G);
2065
+ for (const G of [...i, r.value]) p.add(G);
2066
+ c = m.value, V.value = l.dirty.value, $.value = V.value;
2068
2067
  }
2069
- ge(
2070
- [() => l.values, o, () => [...n].join("\0")],
2068
+ be(
2069
+ [() => l.values, r, () => [...i].join("\0")],
2071
2070
  () => {
2072
- i || (clearTimeout(K), K = setTimeout(te, 400));
2071
+ n || (clearTimeout(te), te = setTimeout(ne, 400));
2073
2072
  },
2074
2073
  { deep: !0 }
2075
- ), Xe(() => {
2076
- K !== void 0 && (clearTimeout(K), te());
2074
+ ), ze(() => {
2075
+ te !== void 0 && (clearTimeout(te), ne());
2077
2076
  });
2078
2077
  }
2079
- const { confirmDiscard: se } = Qe(() => !i && l.dirty.value);
2080
- Ze(Ht, null) && Ut(() => (i || Y(), !0));
2081
- async function he() {
2082
- const c = await se();
2083
- return c && Y(), c;
2078
+ const { confirmDiscard: de } = ft(() => !n && l.dirty.value);
2079
+ De(fa, null) && pa(() => (n || le(), !0));
2080
+ async function _e() {
2081
+ const f = await de();
2082
+ return f && le(), f;
2084
2083
  }
2085
- function we() {
2086
- l.reset(), n.clear(), u.clear(), r.value = null, o.value = a.value[0].name, u.add(o.value), v = 0, x.value = !1, Y(), i = !1;
2084
+ function ge() {
2085
+ l.reset(), i.clear(), p.clear(), u.value = null, r.value = a.value[0].name, p.add(r.value), c = 0, V.value = !1, le(), n = !1;
2087
2086
  }
2088
- const ke = h(() => {
2089
- const c = [e("core.steps.position", { current: g.value + 1, total: O.value }), F.value.label];
2090
- return $.value && c.push(e("core.steps.draft_saved")), c.join(" · ");
2091
- }), ae = h(() => {
2092
- const c = a.value[g.value];
2093
- return c.nextLabel ? c.nextLabel : E.value ? t.submitLabel ?? e("core.actions.save") : e("core.steps.next_named", { step: a.value[g.value + 1].label });
2094
- }), _ = h(() => j.value ? null : a.value[g.value - 1].label);
2087
+ const w = q(() => {
2088
+ const f = [e("core.steps.position", { current: m.value + 1, total: S.value }), y.value.label];
2089
+ return $.value && f.push(e("core.steps.draft_saved")), f.join(" · ");
2090
+ }), A = q(() => {
2091
+ const f = a.value[m.value];
2092
+ return f.nextLabel ? f.nextLabel : T.value ? t.submitLabel ?? e("core.actions.save") : e("core.steps.next_named", { step: a.value[m.value + 1].label });
2093
+ }), o = q(() => L.value ? null : a.value[m.value - 1].label);
2095
2094
  return {
2096
- steps: w,
2097
- current: F,
2098
- index: g,
2099
- count: O,
2100
- isFirst: j,
2101
- isLast: E,
2102
- busy: V,
2103
- direction: r,
2104
- subtitle: ke,
2105
- nextLabel: ae,
2106
- backLabel: _,
2107
- restored: x,
2108
- refusals: k,
2095
+ steps: v,
2096
+ current: y,
2097
+ index: m,
2098
+ count: S,
2099
+ isFirst: L,
2100
+ isLast: T,
2101
+ busy: C,
2102
+ direction: u,
2103
+ subtitle: w,
2104
+ nextLabel: A,
2105
+ backLabel: o,
2106
+ restored: V,
2107
+ refusals: _,
2109
2108
  errors: l.errors,
2110
2109
  failure: l.failure,
2111
- next: ue,
2112
- back: () => Q(g.value - 1),
2113
- goTo: q,
2114
- restart: we,
2115
- confirmDiscard: he,
2116
- bindDialog: () => ({ subtitle: ke.value, primaryLabel: ae.value, status: V.value ? "processing" : "idle", beforeDismiss: he })
2110
+ next: X,
2111
+ back: () => P(m.value - 1),
2112
+ goTo: D,
2113
+ restart: ge,
2114
+ confirmDiscard: _e,
2115
+ bindDialog: () => ({ subtitle: w.value, primaryLabel: A.value, status: C.value ? "processing" : "idle", beforeDismiss: _e })
2117
2116
  };
2118
2117
  }
2119
- const Fl = {
2118
+ const Zl = {
2120
2119
  class: "flex flex-wrap items-center gap-2.5 border-t border-border-separator pt-3.5",
2121
2120
  "data-test": "step-navigation"
2122
- }, Bl = /* @__PURE__ */ G({
2121
+ }, Xl = /* @__PURE__ */ J({
2123
2122
  __name: "StepNavigation",
2124
2123
  props: {
2125
2124
  flow: {}
2126
2125
  },
2127
2126
  emits: ["cancel"],
2128
2127
  setup(l) {
2129
- const t = l, { t: e } = oe();
2130
- return (a, o) => (d(), y("div", Fl, [
2131
- t.flow.backLabel.value ? (d(), M(be, {
2128
+ const t = l, { t: e } = re();
2129
+ return (a, r) => (d(), g("div", Zl, [
2130
+ t.flow.backLabel.value ? (d(), z(ae, {
2132
2131
  key: 0,
2133
2132
  prominence: "plain",
2134
2133
  icon: "arrowLeftSLine",
2135
2134
  disabled: t.flow.busy.value,
2136
2135
  "data-test": "step-back",
2137
- onClick: o[0] || (o[0] = (n) => t.flow.back())
2136
+ onClick: r[0] || (r[0] = (i) => t.flow.back())
2138
2137
  }, {
2139
- default: f(() => [
2140
- H(C(t.flow.backLabel.value), 1)
2138
+ default: k(() => [
2139
+ Z(B(t.flow.backLabel.value), 1)
2141
2140
  ]),
2142
2141
  _: 1
2143
- }, 8, ["disabled"])) : L("", !0),
2144
- o[3] || (o[3] = p("div", { class: "grow" }, null, -1)),
2145
- N(be, {
2142
+ }, 8, ["disabled"])) : j("", !0),
2143
+ r[3] || (r[3] = x("div", { class: "grow" }, null, -1)),
2144
+ U(ae, {
2146
2145
  prominence: "plain",
2147
2146
  "data-test": "step-cancel",
2148
- onClick: o[1] || (o[1] = (n) => a.$emit("cancel"))
2147
+ onClick: r[1] || (r[1] = (i) => a.$emit("cancel"))
2149
2148
  }, {
2150
- default: f(() => [
2151
- H(C(s(e)("core.actions.cancel")), 1)
2149
+ default: k(() => [
2150
+ Z(B(s(e)("core.actions.cancel")), 1)
2152
2151
  ]),
2153
2152
  _: 1
2154
2153
  }),
2155
- N(be, {
2154
+ U(ae, {
2156
2155
  prominence: "primary",
2157
2156
  processing: t.flow.busy.value,
2158
2157
  "data-test": "step-next",
2159
- onClick: o[2] || (o[2] = (n) => t.flow.next())
2158
+ onClick: r[2] || (r[2] = (i) => t.flow.next())
2160
2159
  }, {
2161
- default: f(() => [
2162
- H(C(t.flow.nextLabel.value), 1)
2160
+ default: k(() => [
2161
+ Z(B(t.flow.nextLabel.value), 1)
2163
2162
  ]),
2164
2163
  _: 1
2165
2164
  }, 8, ["processing"])
2166
2165
  ]));
2167
2166
  }
2168
- }), Tl = ["aria-label"], Dl = ["aria-current"], Ll = ["aria-label"], ql = {
2167
+ }), Ql = ["aria-label"], eo = ["aria-current"], to = ["aria-label"], ao = {
2169
2168
  key: 2,
2170
2169
  class: "sr-only"
2171
- }, Vl = {
2170
+ }, lo = {
2172
2171
  key: 1,
2173
2172
  "data-test": "step-dots",
2174
2173
  class: "flex justify-center gap-1.5",
2175
2174
  "aria-hidden": "true"
2176
- }, zl = ["data-state"], Ml = /* @__PURE__ */ G({
2175
+ }, oo = ["data-state"], ro = /* @__PURE__ */ J({
2177
2176
  __name: "StepProgress",
2178
2177
  props: {
2179
2178
  flow: {},
2180
2179
  progress: { default: "bar" }
2181
2180
  },
2182
2181
  setup(l) {
2183
- const t = l, { t: e } = oe();
2184
- return (a, o) => t.progress === "bar" ? (d(), y("ol", {
2182
+ const t = l, { t: e } = re();
2183
+ return (a, r) => t.progress === "bar" ? (d(), g("ol", {
2185
2184
  key: 0,
2186
2185
  "aria-label": s(e)("core.steps.label"),
2187
2186
  "data-test": "step-bar",
2188
2187
  class: "grid min-w-0 gap-2",
2189
- style: vt({ gridTemplateColumns: `repeat(${t.flow.count.value}, minmax(0, 1fr))` })
2188
+ style: zt({ gridTemplateColumns: `repeat(${t.flow.count.value}, minmax(0, 1fr))` })
2190
2189
  }, [
2191
- (d(!0), y(de, null, $e(t.flow.steps.value, (n) => (d(), y("li", {
2192
- key: n.name,
2190
+ (d(!0), g(ee, null, ce(t.flow.steps.value, (i) => (d(), g("li", {
2191
+ key: i.name,
2193
2192
  class: "flex min-w-0",
2194
- "aria-current": n.state === "current" ? "step" : void 0
2193
+ "aria-current": i.state === "current" ? "step" : void 0
2195
2194
  }, [
2196
- (d(), M(pt(n.reachable ? "button" : "div"), {
2197
- type: n.reachable ? "button" : void 0,
2198
- disabled: n.reachable ? t.flow.busy.value : void 0,
2199
- "data-test": `step-${n.name}`,
2200
- "data-state": n.errors > 0 ? "error" : n.state,
2201
- class: I(["group flex min-w-0 flex-1 flex-col gap-1.5 text-left", n.reachable ? "cursor-pointer rounded-control focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus disabled:cursor-default" : ""]),
2202
- onClick: (u) => n.reachable ? t.flow.goTo(n.name) : void 0
2195
+ (d(), z(jt(i.reachable ? "button" : "div"), {
2196
+ type: i.reachable ? "button" : void 0,
2197
+ disabled: i.reachable ? t.flow.busy.value : void 0,
2198
+ "data-test": `step-${i.name}`,
2199
+ "data-state": i.errors > 0 ? "error" : i.state,
2200
+ class: W(["group flex min-w-0 flex-1 flex-col gap-1.5 text-left", i.reachable ? "cursor-pointer rounded-control focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus disabled:cursor-default" : ""]),
2201
+ onClick: (p) => i.reachable ? t.flow.goTo(i.name) : void 0
2203
2202
  }, {
2204
- default: f(() => [
2205
- p("span", {
2206
- class: I(["h-1 rounded-full transition-colors duration-motion-normal", n.errors > 0 ? "bg-status-danger-solid" : n.state === "current" ? "bg-tint" : n.state === "done" ? "bg-control-on" : "bg-fill-strong"]),
2203
+ default: k(() => [
2204
+ x("span", {
2205
+ class: W(["h-1 rounded-full transition-colors duration-motion-normal", i.errors > 0 ? "bg-status-danger-solid" : i.state === "current" ? "bg-tint" : i.state === "done" ? "bg-control-on" : "bg-fill-strong"]),
2207
2206
  "aria-hidden": "true"
2208
2207
  }, null, 2),
2209
- p("span", {
2210
- class: I(["flex min-w-0 items-center gap-1.5 text-footnote", n.state === "current" ? "font-bold text-content-strong" : n.state === "done" ? "font-medium text-content-link" : "font-medium text-content-muted"])
2208
+ x("span", {
2209
+ class: W(["flex min-w-0 items-center gap-1.5 text-footnote", i.state === "current" ? "font-bold text-content-strong" : i.state === "done" ? "font-medium text-content-link" : "font-medium text-content-muted"])
2211
2210
  }, [
2212
- n.state === "done" ? (d(), M(s(X), {
2211
+ i.state === "done" ? (d(), z(s(ue), {
2213
2212
  key: 0,
2214
2213
  name: "checkCustom",
2215
2214
  size: 12,
2216
2215
  class: "shrink-0"
2217
- })) : L("", !0),
2218
- p("span", {
2219
- class: I(["truncate", n.reachable ? "group-hover:text-content-link" : ""])
2220
- }, C(n.position) + ". " + C(n.label), 3),
2221
- n.errors > 0 ? (d(), y("span", {
2216
+ })) : j("", !0),
2217
+ x("span", {
2218
+ class: W(["truncate", i.reachable ? "group-hover:text-content-link" : ""])
2219
+ }, B(i.position) + ". " + B(i.label), 3),
2220
+ i.errors > 0 ? (d(), g("span", {
2222
2221
  key: 1,
2223
2222
  "data-test": "step-errors",
2224
- "aria-label": s(e)("core.form.sections.errors", { count: n.errors }),
2223
+ "aria-label": s(e)("core.form.sections.errors", { count: i.errors }),
2225
2224
  class: "min-w-4.5 shrink-0 rounded-full bg-status-danger-solid px-1.5 text-center text-caption font-semibold text-white"
2226
- }, C(n.errors), 9, Ll)) : L("", !0),
2227
- n.state === "done" ? (d(), y("span", ql, C(s(e)("core.steps.done")), 1)) : L("", !0)
2225
+ }, B(i.errors), 9, to)) : j("", !0),
2226
+ i.state === "done" ? (d(), g("span", ao, B(s(e)("core.steps.done")), 1)) : j("", !0)
2228
2227
  ], 2)
2229
2228
  ]),
2230
2229
  _: 2
2231
2230
  }, 1032, ["type", "disabled", "data-test", "data-state", "class", "onClick"]))
2232
- ], 8, Dl))), 128))
2233
- ], 12, Tl)) : (d(), y("div", Vl, [
2234
- (d(!0), y(de, null, $e(t.flow.steps.value, (n) => (d(), y("span", {
2235
- key: n.name,
2236
- class: I(["h-1.5 rounded-full transition-all duration-motion-fast", [n.state === "current" ? "w-4.5" : "w-1.5", n.errors > 0 ? "bg-status-danger-solid" : n.state === "todo" && n.position > t.flow.index.value ? "bg-fill-strong" : "bg-tint"]]),
2237
- "data-state": n.errors > 0 ? "error" : n.state
2238
- }, null, 10, zl))), 128))
2231
+ ], 8, eo))), 128))
2232
+ ], 12, Ql)) : (d(), g("div", lo, [
2233
+ (d(!0), g(ee, null, ce(t.flow.steps.value, (i) => (d(), g("span", {
2234
+ key: i.name,
2235
+ class: W(["h-1.5 rounded-full transition-all duration-motion-fast", [i.state === "current" ? "w-4.5" : "w-1.5", i.errors > 0 ? "bg-status-danger-solid" : i.state === "todo" && i.position > t.flow.index.value ? "bg-fill-strong" : "bg-tint"]]),
2236
+ "data-state": i.errors > 0 ? "error" : i.state
2237
+ }, null, 10, oo))), 128))
2239
2238
  ]));
2240
2239
  }
2241
- }), Rl = ["data-step"], Nl = {
2240
+ }), no = ["data-step"], so = {
2242
2241
  class: "sr-only",
2243
2242
  "aria-live": "polite"
2244
- }, Il = {
2243
+ }, io = {
2245
2244
  key: 1,
2246
2245
  "data-test": "step-restored",
2247
2246
  class: "flex items-center gap-2 text-footnote text-content-muted"
2248
- }, Ro = /* @__PURE__ */ G({
2247
+ }, Mr = /* @__PURE__ */ J({
2249
2248
  __name: "StepForm",
2250
2249
  props: {
2251
2250
  flow: {},
@@ -2254,156 +2253,967 @@ const Fl = {
2254
2253
  },
2255
2254
  emits: ["cancel"],
2256
2255
  setup(l) {
2257
- const t = l, { t: e } = oe(), a = U("body"), o = U("root");
2258
- function n(u) {
2259
- for (let r = u.parentElement; r; r = r.parentElement) {
2260
- const m = getComputedStyle(r).overflowY;
2261
- if ((m === "auto" || m === "scroll") && r.scrollHeight > r.clientHeight) return u.getBoundingClientRect().top < r.getBoundingClientRect().top;
2256
+ const t = l, { t: e } = re(), a = oe("body"), r = oe("root");
2257
+ function i(p) {
2258
+ for (let u = p.parentElement; u; u = u.parentElement) {
2259
+ const b = getComputedStyle(u).overflowY;
2260
+ if ((b === "auto" || b === "scroll") && u.scrollHeight > u.clientHeight) return p.getBoundingClientRect().top < u.getBoundingClientRect().top;
2262
2261
  }
2263
- return u.getBoundingClientRect().top < 0;
2262
+ return p.getBoundingClientRect().top < 0;
2264
2263
  }
2265
- return ge(() => t.flow.current.value.name, async () => {
2266
- await xe(), o.value && n(o.value) && o.value.scrollIntoView?.({ block: "start" }), a.value?.focus({ preventScroll: !0 });
2267
- }), ge(() => t.flow.refusals.value, async () => {
2268
- await xe(), a.value && await Le(a.value);
2269
- }), (u, r) => (d(), y("div", {
2264
+ return be(() => t.flow.current.value.name, async () => {
2265
+ await we(), r.value && i(r.value) && r.value.scrollIntoView?.({ block: "start" }), a.value?.focus({ preventScroll: !0 });
2266
+ }), be(() => t.flow.refusals.value, async () => {
2267
+ await we(), a.value && await Me(a.value);
2268
+ }), (p, u) => (d(), g("div", {
2270
2269
  ref_key: "root",
2271
- ref: o,
2270
+ ref: r,
2272
2271
  class: "flex min-w-0 flex-col gap-group-gap",
2273
2272
  "data-test": "step-form",
2274
2273
  "data-step": t.flow.current.value.name
2275
2274
  }, [
2276
- t.progress !== "none" ? (d(), M(Ml, {
2275
+ t.progress !== "none" ? (d(), z(ro, {
2277
2276
  key: 0,
2278
2277
  flow: t.flow,
2279
2278
  progress: t.progress
2280
- }, null, 8, ["flow", "progress"])) : L("", !0),
2281
- p("p", Nl, C(t.flow.subtitle.value), 1),
2282
- t.flow.restored.value ? (d(), y("div", Il, [
2283
- p("span", null, C(s(e)("core.steps.restored")), 1),
2284
- N(be, {
2279
+ }, null, 8, ["flow", "progress"])) : j("", !0),
2280
+ x("p", so, B(t.flow.subtitle.value), 1),
2281
+ t.flow.restored.value ? (d(), g("div", io, [
2282
+ x("span", null, B(s(e)("core.steps.restored")), 1),
2283
+ U(ae, {
2285
2284
  prominence: "link",
2286
2285
  size: "sm",
2287
- onClick: r[0] || (r[0] = (m) => t.flow.restart())
2286
+ onClick: u[0] || (u[0] = (b) => t.flow.restart())
2288
2287
  }, {
2289
- default: f(() => [
2290
- H(C(s(e)("core.steps.start_over")), 1)
2288
+ default: k(() => [
2289
+ Z(B(s(e)("core.steps.start_over")), 1)
2291
2290
  ]),
2292
2291
  _: 1
2293
2292
  })
2294
- ])) : L("", !0),
2295
- (d(), M(Je, {
2293
+ ])) : j("", !0),
2294
+ (d(), z(it, {
2296
2295
  key: t.flow.current.value.name,
2297
2296
  form: t.flow
2298
2297
  }, null, 8, ["form"])),
2299
- (d(), y("form", {
2298
+ (d(), g("form", {
2300
2299
  key: t.flow.current.value.name,
2301
2300
  ref_key: "body",
2302
2301
  ref: a,
2303
2302
  tabindex: "-1",
2304
2303
  novalidate: "",
2305
2304
  "data-test": "step-body",
2306
- class: I(["flex min-w-0 flex-col gap-group-gap outline-none", t.flow.direction.value === "back" ? "animate-step-back" : t.flow.direction.value === "forward" ? "animate-step-in" : ""]),
2307
- onSubmit: r[1] || (r[1] = pe((m) => t.flow.next(), ["prevent"]))
2305
+ class: W(["flex min-w-0 flex-col gap-group-gap outline-none", t.flow.direction.value === "back" ? "animate-step-back" : t.flow.direction.value === "forward" ? "animate-step-in" : ""]),
2306
+ onSubmit: u[1] || (u[1] = he((b) => t.flow.next(), ["prevent"]))
2308
2307
  }, [
2309
- S(u.$slots, t.flow.current.value.name),
2310
- r[3] || (r[3] = p("button", {
2308
+ R(p.$slots, t.flow.current.value.name),
2309
+ u[3] || (u[3] = x("button", {
2311
2310
  type: "submit",
2312
2311
  class: "sr-only",
2313
2312
  tabindex: "-1",
2314
2313
  "aria-hidden": "true"
2315
2314
  }, null, -1))
2316
2315
  ], 34)),
2317
- t.navigation === "inline" ? (d(), M(Bl, {
2316
+ t.navigation === "inline" ? (d(), z(Xl, {
2318
2317
  key: 2,
2319
2318
  flow: t.flow,
2320
- onCancel: r[2] || (r[2] = (m) => u.$emit("cancel"))
2321
- }, null, 8, ["flow"])) : L("", !0)
2322
- ], 8, Rl));
2319
+ onCancel: u[2] || (u[2] = (b) => p.$emit("cancel"))
2320
+ }, null, 8, ["flow"])) : j("", !0)
2321
+ ], 8, no));
2322
+ }
2323
+ }), rt = Symbol("vue-core.dynamicForm.locale"), uo = { class: "flex w-full flex-col gap-3" }, co = { class: "mb-2 flex items-center justify-between" }, mo = { class: "text-sm font-medium text-muted" }, fo = {
2324
+ key: 0,
2325
+ class: "flex gap-1"
2326
+ }, po = { key: 0 }, vo = /* @__PURE__ */ J({
2327
+ __name: "RepeatField",
2328
+ props: /* @__PURE__ */ me({
2329
+ label: {},
2330
+ labelHidden: { type: Boolean },
2331
+ hint: {},
2332
+ error: {},
2333
+ required: { type: Boolean },
2334
+ editable: { type: Boolean },
2335
+ disabled: { type: Boolean },
2336
+ lockedReason: {},
2337
+ presentation: {},
2338
+ name: {},
2339
+ fields: {},
2340
+ modelValue: {},
2341
+ locales: {},
2342
+ defaultLocale: {},
2343
+ errors: {},
2344
+ resources: {},
2345
+ addLabel: {},
2346
+ localeMode: {}
2347
+ }, { ...pe, modelValue: () => [], locales: void 0, defaultLocale: void 0, errors: () => ({}), resources: void 0, addLabel: void 0, localeMode: "perField" }),
2348
+ emits: ["update:modelValue"],
2349
+ setup(l, { emit: t }) {
2350
+ const e = l, a = t, { t: r } = re(), { editable: i } = qe(e);
2351
+ let p = 0;
2352
+ const u = H([]);
2353
+ be(() => e.modelValue.length, (m) => {
2354
+ for (; u.value.length < m; ) u.value.push(p++);
2355
+ u.value.length = m;
2356
+ }, { immediate: !0 });
2357
+ const b = (m) => a("update:modelValue", m), _ = () => {
2358
+ u.value.push(p++), b([...e.modelValue, {}]);
2359
+ }, V = (m) => {
2360
+ u.value.splice(m, 1), b(e.modelValue.filter((h, v) => v !== m));
2361
+ };
2362
+ function $(m, h) {
2363
+ const v = m + h;
2364
+ if (v < 0 || v >= e.modelValue.length) return;
2365
+ const y = [...e.modelValue];
2366
+ [y[m], y[v]] = [y[v], y[m]], [u.value[m], u.value[v]] = [u.value[v], u.value[m]], b(y);
2367
+ }
2368
+ const n = (m, h) => b(e.modelValue.map((v, y) => y === m ? h : { ...v }));
2369
+ function c(m) {
2370
+ const h = `${m}.`;
2371
+ return Object.fromEntries(Object.entries(e.errors).filter(([v]) => v.startsWith(h)).map(([v, y]) => [v.slice(h.length), y]));
2372
+ }
2373
+ return (m, h) => (d(), z(ye, N(s(fe)(e), {
2374
+ "row-layout": "stacked",
2375
+ value: null,
2376
+ error: e.error ?? e.errors[""]?.[0]
2377
+ }), {
2378
+ default: k(() => [
2379
+ x("div", uo, [
2380
+ (d(!0), g(ee, null, ce(e.modelValue, (v, y) => (d(), g("div", {
2381
+ key: u.value[y],
2382
+ class: "rounded-md border border-border p-3",
2383
+ "data-repeat-row": ""
2384
+ }, [
2385
+ x("div", co, [
2386
+ x("span", mo, B(s(r)("core.form.dynamic.repeat.row", { n: y + 1 })), 1),
2387
+ s(i) && !e.disabled ? (d(), g("div", fo, [
2388
+ U(ae, N({
2389
+ size: "xs",
2390
+ prominence: "plain",
2391
+ icon: "arrowUpSLine",
2392
+ disabled: y === 0
2393
+ }, { ref_for: !0 }, { "aria-label": s(r)("core.form.dynamic.repeat.up", { n: y + 1 }) }, {
2394
+ "data-move": "up",
2395
+ onClick: (S) => $(y, -1)
2396
+ }), null, 16, ["disabled", "onClick"]),
2397
+ U(ae, N({
2398
+ size: "xs",
2399
+ prominence: "plain",
2400
+ icon: "arrowDownSLine",
2401
+ disabled: y === e.modelValue.length - 1
2402
+ }, { ref_for: !0 }, { "aria-label": s(r)("core.form.dynamic.repeat.down", { n: y + 1 }) }, {
2403
+ "data-move": "down",
2404
+ onClick: (S) => $(y, 1)
2405
+ }), null, 16, ["disabled", "onClick"]),
2406
+ U(ae, N({
2407
+ size: "xs",
2408
+ prominence: "plain",
2409
+ tone: "critical",
2410
+ icon: "deleteBin2Line"
2411
+ }, { ref_for: !0 }, { "aria-label": s(r)("core.form.dynamic.repeat.remove", { n: y + 1 }) }, {
2412
+ "data-remove": "",
2413
+ onClick: (S) => V(y)
2414
+ }), null, 16, ["onClick"])
2415
+ ])) : j("", !0)
2416
+ ]),
2417
+ U(Io, {
2418
+ schema: { fields: e.fields },
2419
+ "model-value": v,
2420
+ locales: e.locales,
2421
+ "default-locale": e.defaultLocale,
2422
+ errors: c(y),
2423
+ resources: e.resources,
2424
+ readonly: !s(i) || e.disabled,
2425
+ "locale-mode": e.localeMode,
2426
+ "onUpdate:modelValue": (S) => n(y, S)
2427
+ }, null, 8, ["schema", "model-value", "locales", "default-locale", "errors", "resources", "readonly", "locale-mode", "onUpdate:modelValue"])
2428
+ ]))), 128)),
2429
+ s(i) && !e.disabled ? (d(), g("div", po, [
2430
+ U(ae, {
2431
+ icon: "addLine",
2432
+ "data-add": "",
2433
+ onClick: _
2434
+ }, {
2435
+ default: k(() => [
2436
+ Z(B(e.addLabel ?? s(r)("core.form.dynamic.repeat.add")), 1)
2437
+ ]),
2438
+ _: 1
2439
+ })
2440
+ ])) : j("", !0)
2441
+ ])
2442
+ ]),
2443
+ _: 1
2444
+ }, 16, ["error"]));
2445
+ }
2446
+ }), bo = { class: "flex flex-col gap-3 p-4" }, yo = ["placeholder", "aria-label"], go = {
2447
+ key: 0,
2448
+ role: "alert",
2449
+ class: "text-sm text-critical"
2450
+ }, ho = {
2451
+ key: 1,
2452
+ class: "text-sm text-muted"
2453
+ }, ko = {
2454
+ key: 2,
2455
+ class: "text-sm text-muted"
2456
+ }, _o = {
2457
+ key: 3,
2458
+ class: "grid grid-cols-3 gap-2 sm:grid-cols-4"
2459
+ }, xo = ["onClick"], wo = ["src", "alt"], $o = {
2460
+ key: 0,
2461
+ class: "truncate text-xs"
2462
+ }, Vo = { class: "flex justify-between" }, Vt = /* @__PURE__ */ J({
2463
+ __name: "ResourcePickerList",
2464
+ props: {
2465
+ source: {},
2466
+ accept: {}
2467
+ },
2468
+ emits: ["select"],
2469
+ setup(l, { emit: t }) {
2470
+ const e = l, a = t, { t: r } = re(), i = H(""), p = H(1), u = H(1), b = H([]), _ = H("loading");
2471
+ let V = null, $;
2472
+ async function n() {
2473
+ V?.abort();
2474
+ const h = V = new AbortController();
2475
+ _.value = "loading";
2476
+ try {
2477
+ const v = await e.source.list({ search: i.value.trim(), page: p.value, pageSize: 24, ...e.accept !== void 0 ? { accept: e.accept } : {} }, { signal: h.signal });
2478
+ if (h.signal.aborted) return;
2479
+ b.value = v.rows, u.value = Math.max(1, v.lastPage), _.value = "loaded";
2480
+ } catch {
2481
+ h.signal.aborted || (_.value = "failed");
2482
+ }
2483
+ }
2484
+ function c() {
2485
+ clearTimeout($), $ = setTimeout(() => {
2486
+ p.value = 1, n();
2487
+ }, 250);
2488
+ }
2489
+ function m(h) {
2490
+ p.value += h, n();
2491
+ }
2492
+ return dt(() => void n()), ze(() => {
2493
+ clearTimeout($), V?.abort();
2494
+ }), (h, v) => (d(), g("div", bo, [
2495
+ ct(x("input", {
2496
+ "onUpdate:modelValue": v[0] || (v[0] = (y) => i.value = y),
2497
+ type: "search",
2498
+ class: "w-full rounded-md border border-border bg-surface px-3 py-2 text-sm",
2499
+ placeholder: s(r)("core.form.dynamic.resource.search"),
2500
+ "aria-label": s(r)("core.form.dynamic.resource.search"),
2501
+ onInput: c
2502
+ }, null, 40, yo), [
2503
+ [mt, i.value]
2504
+ ]),
2505
+ _.value === "failed" ? (d(), g("p", go, B(s(r)("core.form.dynamic.resource.failed")), 1)) : _.value === "loading" && b.value.length === 0 ? (d(), g("p", ho, B(s(r)("core.form.dynamic.resource.loading")), 1)) : b.value.length === 0 ? (d(), g("p", ko, B(s(r)("core.form.dynamic.resource.empty")), 1)) : (d(), g("ul", _o, [
2506
+ (d(!0), g(ee, null, ce(b.value, (y) => (d(), g("li", {
2507
+ key: y.id
2508
+ }, [
2509
+ x("button", {
2510
+ type: "button",
2511
+ class: "flex w-full flex-col gap-1 rounded-md border border-border p-1 text-left hover:border-accent focus-visible:outline-2",
2512
+ onClick: (S) => a("select", y)
2513
+ }, [
2514
+ x("img", {
2515
+ src: s(Ke)(e.source, y.id),
2516
+ alt: y.name ?? "",
2517
+ class: "aspect-square w-full rounded object-cover",
2518
+ loading: "lazy"
2519
+ }, null, 8, wo),
2520
+ y.name ? (d(), g("span", $o, B(y.name), 1)) : j("", !0)
2521
+ ], 8, xo)
2522
+ ]))), 128))
2523
+ ])),
2524
+ x("div", Vo, [
2525
+ U(ae, {
2526
+ prominence: "plain",
2527
+ disabled: p.value <= 1,
2528
+ onClick: v[1] || (v[1] = (y) => m(-1))
2529
+ }, {
2530
+ default: k(() => [
2531
+ Z(B(s(r)("core.form.dynamic.resource.previous")), 1)
2532
+ ]),
2533
+ _: 1
2534
+ }, 8, ["disabled"]),
2535
+ U(ae, {
2536
+ prominence: "plain",
2537
+ disabled: p.value >= u.value,
2538
+ onClick: v[2] || (v[2] = (y) => m(1))
2539
+ }, {
2540
+ default: k(() => [
2541
+ Z(B(s(r)("core.form.dynamic.resource.next")), 1)
2542
+ ]),
2543
+ _: 1
2544
+ }, 8, ["disabled"])
2545
+ ])
2546
+ ]));
2547
+ }
2548
+ }), Co = ["id"], So = ["src"], Fo = {
2549
+ key: 0,
2550
+ class: "mt-1 flex justify-between"
2551
+ }, qo = {
2552
+ key: 0,
2553
+ class: "text-sm text-muted"
2554
+ }, Bo = /* @__PURE__ */ J({
2555
+ __name: "ResourceField",
2556
+ props: /* @__PURE__ */ me({
2557
+ label: {},
2558
+ labelHidden: { type: Boolean },
2559
+ hint: {},
2560
+ error: {},
2561
+ required: { type: Boolean },
2562
+ editable: { type: Boolean },
2563
+ disabled: { type: Boolean },
2564
+ lockedReason: {},
2565
+ presentation: {},
2566
+ name: {},
2567
+ source: {},
2568
+ multiple: { type: Boolean },
2569
+ accept: {},
2570
+ modelValue: {}
2571
+ }, { ...pe, multiple: !1, accept: void 0, modelValue: void 0 }),
2572
+ emits: ["update:modelValue"],
2573
+ setup(l, { emit: t }) {
2574
+ const e = l, a = t, { t: r } = re(), { editable: i } = qe(e), p = ht(), u = q(() => Array.isArray(e.modelValue) ? [...e.modelValue] : e.modelValue === null || e.modelValue === void 0 || e.modelValue === "" ? [] : [e.modelValue]);
2575
+ function b($) {
2576
+ a("update:modelValue", e.multiple ? $ : $[0] ?? null);
2577
+ }
2578
+ async function _($) {
2579
+ const n = await p.pick({ title: e.label ?? r("core.form.dynamic.resource.title") });
2580
+ if (!n) return;
2581
+ const c = [...u.value];
2582
+ e.multiple && $ === void 0 ? c.push(n.id) : c[$ ?? 0] = n.id, b(c);
2583
+ }
2584
+ const V = ($) => b(u.value.filter((n, c) => c !== $));
2585
+ return ($, n) => (d(), z(ye, N(s(fe)(e), {
2586
+ "row-layout": "stacked",
2587
+ value: u.value.length > 0 ? u.value.join(", ") : null
2588
+ }), {
2589
+ default: k(({ id: c }) => [
2590
+ x("div", {
2591
+ id: c,
2592
+ class: "flex flex-wrap items-start gap-2"
2593
+ }, [
2594
+ (d(!0), g(ee, null, ce(u.value, (m, h) => (d(), g("div", {
2595
+ key: `${m}-${h}`,
2596
+ class: "relative w-24",
2597
+ "data-resource": ""
2598
+ }, [
2599
+ x("img", {
2600
+ src: s(Ke)(e.source, m),
2601
+ alt: "",
2602
+ class: "aspect-square w-full rounded-md border border-border object-cover"
2603
+ }, null, 8, So),
2604
+ s(i) && !e.disabled ? (d(), g("div", Fo, [
2605
+ U(ae, {
2606
+ size: "xs",
2607
+ prominence: "plain",
2608
+ onClick: (v) => _(h)
2609
+ }, {
2610
+ default: k(() => [
2611
+ Z(B(s(r)("core.form.dynamic.resource.change")), 1)
2612
+ ]),
2613
+ _: 1
2614
+ }, 8, ["onClick"]),
2615
+ U(ae, N({
2616
+ size: "xs",
2617
+ prominence: "plain",
2618
+ tone: "critical",
2619
+ icon: "close"
2620
+ }, { ref_for: !0 }, { "aria-label": s(r)("core.form.dynamic.resource.remove") }, {
2621
+ onClick: (v) => V(h)
2622
+ }), null, 16, ["onClick"])
2623
+ ])) : j("", !0)
2624
+ ]))), 128)),
2625
+ u.value.length === 0 && !s(i) ? (d(), g("p", qo, B(s(r)("core.form.dynamic.resource.none")), 1)) : j("", !0),
2626
+ s(i) && !e.disabled && (e.multiple || u.value.length === 0) ? (d(), z(ae, {
2627
+ key: 1,
2628
+ icon: "addLine",
2629
+ onClick: n[0] || (n[0] = (m) => _())
2630
+ }, {
2631
+ default: k(() => [
2632
+ Z(B(s(r)("core.form.dynamic.resource.choose")), 1)
2633
+ ]),
2634
+ _: 1
2635
+ })) : j("", !0)
2636
+ ], 8, Co),
2637
+ U(kt, { picker: s(p) }, {
2638
+ default: k(({ select: m }) => [
2639
+ U(Vt, {
2640
+ source: e.source,
2641
+ accept: e.accept,
2642
+ onSelect: m
2643
+ }, null, 8, ["source", "accept", "onSelect"])
2644
+ ]),
2645
+ _: 1
2646
+ }, 8, ["picker"])
2647
+ ]),
2648
+ _: 1
2649
+ }, 16, ["value"]));
2650
+ }
2651
+ }), Lo = { class: "w-full rounded-md border border-border bg-surface" }, To = ["aria-label"], Do = ["data-tool", "aria-label", "title", "aria-pressed", "disabled", "onClick"], zo = ["aria-label", "placeholder"], jo = {
2652
+ key: 2,
2653
+ role: "alert",
2654
+ class: "p-3 text-sm text-critical"
2655
+ }, Oo = ["id"], nt = /* @__PURE__ */ J({
2656
+ __name: "RichTextField",
2657
+ props: /* @__PURE__ */ me({
2658
+ label: {},
2659
+ labelHidden: { type: Boolean },
2660
+ hint: {},
2661
+ error: {},
2662
+ required: { type: Boolean },
2663
+ editable: { type: Boolean },
2664
+ disabled: { type: Boolean },
2665
+ lockedReason: {},
2666
+ presentation: {},
2667
+ name: {},
2668
+ modelValue: {},
2669
+ images: {},
2670
+ video: { type: Boolean },
2671
+ placeholder: {}
2672
+ }, { ...pe, modelValue: "", images: void 0, video: !1, placeholder: void 0 }),
2673
+ emits: ["update:modelValue"],
2674
+ setup(l, { emit: t }) {
2675
+ const e = l, a = t, { t: r } = re(), { editable: i } = qe(e), p = oe("host"), u = H(!1), b = H(!1), _ = ht(), V = H(null), $ = H("");
2676
+ let n = null, c = "", m = null;
2677
+ const h = H({}), v = () => n ? n.getText().trim() === "" && !n.root.querySelector("img, iframe") ? "" : n.getSemanticHTML() : "";
2678
+ function y(M) {
2679
+ n && (n.setContents(n.clipboard.convert({ html: M }), "silent"), c = v());
2680
+ }
2681
+ dt(async () => {
2682
+ try {
2683
+ const { default: M } = await import("quill");
2684
+ if (!p.value) return;
2685
+ n = new M(p.value, { modules: { toolbar: !1 }, placeholder: e.placeholder, readOnly: !i.value || e.disabled });
2686
+ } catch {
2687
+ u.value = !0;
2688
+ return;
2689
+ }
2690
+ y(e.modelValue), n.on("text-change", (M, O, X) => {
2691
+ c = v(), X === "user" && a("update:modelValue", c);
2692
+ }), n.on("selection-change", (M) => {
2693
+ M && (m = M, h.value = n?.getFormat(M) ?? {});
2694
+ }), b.value = !0;
2695
+ }), ze(() => n?.disable()), be(() => e.modelValue, (M) => {
2696
+ M !== c && y(M);
2697
+ }), be(() => !i.value || e.disabled, (M) => n?.enable(!M));
2698
+ const S = (M, O) => {
2699
+ if (!n) return;
2700
+ n.focus();
2701
+ const X = n.getFormat();
2702
+ n.format(M, X[M] === O ? !1 : O, "user"), h.value = n.getFormat();
2703
+ }, L = (M, O = !0) => h.value[M] === O;
2704
+ function T(M) {
2705
+ m = n?.getSelection() ?? m, $.value = "", V.value = M;
2706
+ }
2707
+ async function C() {
2708
+ const M = $.value.trim(), O = V.value;
2709
+ if (V.value = null, !n || M === "" || !O) return;
2710
+ n.focus(), m && n.setSelection(m);
2711
+ const X = m ?? { index: n.getLength() };
2712
+ O === "link" ? n.format("link", M, "user") : n.insertEmbed(X.index, "video", M, "user");
2713
+ }
2714
+ async function P() {
2715
+ m = n?.getSelection() ?? m;
2716
+ const M = await _.pick({ title: r("core.form.dynamic.rich_text.image") });
2717
+ if (!M || !n || !e.images) return;
2718
+ const O = { thumbnail: e.images.image ?? e.images.thumbnail };
2719
+ n.insertEmbed(m?.index ?? n.getLength(), "image", Ke(O, M.id), "user");
2720
+ }
2721
+ const Y = q(() => [
2722
+ { key: "heading", label: r("core.form.dynamic.rich_text.heading"), text: "H", on: L("header", 2), run: () => S("header", 2) },
2723
+ { key: "bold", label: r("core.form.dynamic.rich_text.bold"), text: "B", on: L("bold"), run: () => S("bold", !0) },
2724
+ { key: "italic", label: r("core.form.dynamic.rich_text.italic"), text: "I", on: L("italic"), run: () => S("italic", !0) },
2725
+ { key: "bullets", label: r("core.form.dynamic.rich_text.bullets"), text: "•", on: L("list", "bullet"), run: () => S("list", "bullet") },
2726
+ { key: "numbers", label: r("core.form.dynamic.rich_text.numbers"), text: "1.", on: L("list", "ordered"), run: () => S("list", "ordered") },
2727
+ { key: "link", label: r("core.form.dynamic.rich_text.link"), text: "↗", on: typeof h.value.link == "string", run: () => T("link") },
2728
+ ...e.images ? [{ key: "image", label: r("core.form.dynamic.rich_text.image"), text: "▣", on: !1, run: () => void P() }] : [],
2729
+ ...e.video ? [{ key: "video", label: r("core.form.dynamic.rich_text.video"), text: "▶", on: !1, run: () => T("video") }] : []
2730
+ ]);
2731
+ return (M, O) => (d(), z(ye, N(s(fe)(e), {
2732
+ "row-layout": "stacked",
2733
+ value: null
2734
+ }), {
2735
+ default: k(({ id: X }) => [
2736
+ x("div", Lo, [
2737
+ s(i) && !e.disabled ? (d(), g("div", {
2738
+ key: 0,
2739
+ class: "flex flex-wrap gap-1 border-b border-border p-1",
2740
+ role: "toolbar",
2741
+ "aria-label": e.label
2742
+ }, [
2743
+ (d(!0), g(ee, null, ce(Y.value, (D) => (d(), g("button", {
2744
+ key: D.key,
2745
+ type: "button",
2746
+ "data-tool": D.key,
2747
+ "aria-label": D.label,
2748
+ title: D.label,
2749
+ "aria-pressed": D.on,
2750
+ disabled: !b.value,
2751
+ class: "min-w-8 rounded px-2 py-1 text-sm font-medium hover:bg-surface-muted aria-pressed:bg-surface-muted",
2752
+ onMousedown: O[0] || (O[0] = he(() => {
2753
+ }, ["prevent"])),
2754
+ onClick: D.run
2755
+ }, B(D.text), 41, Do))), 128))
2756
+ ], 8, To)) : j("", !0),
2757
+ V.value ? (d(), g("form", {
2758
+ key: 1,
2759
+ class: "flex gap-2 border-b border-border p-2",
2760
+ onSubmit: he(C, ["prevent"])
2761
+ }, [
2762
+ ct(x("input", {
2763
+ "onUpdate:modelValue": O[1] || (O[1] = (D) => $.value = D),
2764
+ type: "url",
2765
+ class: "w-full rounded-md border border-border bg-surface px-2 py-1 text-sm",
2766
+ "aria-label": V.value === "link" ? s(r)("core.form.dynamic.rich_text.link_prompt") : s(r)("core.form.dynamic.rich_text.video_prompt"),
2767
+ placeholder: V.value === "link" ? s(r)("core.form.dynamic.rich_text.link_prompt") : s(r)("core.form.dynamic.rich_text.video_prompt")
2768
+ }, null, 8, zo), [
2769
+ [mt, $.value]
2770
+ ]),
2771
+ U(ae, {
2772
+ type: "submit",
2773
+ size: "sm"
2774
+ }, {
2775
+ default: k(() => [...O[2] || (O[2] = [
2776
+ Z("OK", -1)
2777
+ ])]),
2778
+ _: 1
2779
+ })
2780
+ ], 32)) : j("", !0),
2781
+ u.value ? (d(), g("p", jo, B(s(r)("core.form.dynamic.rich_text.failed")), 1)) : j("", !0),
2782
+ x("div", {
2783
+ id: X,
2784
+ ref_key: "host",
2785
+ ref: p,
2786
+ class: W(["min-h-32 px-3 py-2 text-sm [&_.ql-clipboard]:absolute [&_.ql-clipboard]:-left-[100000px] [&_.ql-editor]:min-h-28 [&_.ql-editor]:outline-none [&_.ql-editor_h2]:text-lg [&_.ql-editor_h2]:font-semibold [&_.ql-editor_img]:max-w-full [&_.ql-editor_ol]:pl-6 [&_.ql-editor_li[data-list=bullet]]:list-disc [&_.ql-editor_li[data-list=ordered]]:list-decimal [&_.ql-editor_a]:text-accent [&_.ql-editor_a]:underline [&_.ql-ui]:hidden [&_.ql-editor.ql-blank::before]:text-muted [&_.ql-editor.ql-blank::before]:content-[attr(data-placeholder)]", { hidden: u.value }])
2787
+ }, null, 10, Oo)
2788
+ ]),
2789
+ e.images ? (d(), z(kt, {
2790
+ key: 0,
2791
+ picker: s(_)
2792
+ }, {
2793
+ default: k(({ select: D }) => [
2794
+ U(Vt, {
2795
+ source: e.images,
2796
+ accept: "image/*",
2797
+ onSelect: D
2798
+ }, null, 8, ["source", "onSelect"])
2799
+ ]),
2800
+ _: 1
2801
+ }, 8, ["picker"])) : j("", !0)
2802
+ ]),
2803
+ _: 1
2804
+ }, 16));
2323
2805
  }
2324
2806
  });
2807
+ function $e(l) {
2808
+ return l == null ? !0 : typeof l == "string" ? l.trim() === "" : Array.isArray(l) ? l.length === 0 : typeof l == "object" ? Object.values(l).every($e) : !1;
2809
+ }
2810
+ function Te(l, t) {
2811
+ if (l === t) return !0;
2812
+ if (typeof l != "object" || typeof t != "object" || l === null || t === null || Array.isArray(l) !== Array.isArray(t)) return !1;
2813
+ const e = l, a = t, r = Object.keys(e);
2814
+ return r.length === Object.keys(a).length && r.every((i) => i in a && Te(e[i], a[i]));
2815
+ }
2816
+ function Mo(l, t) {
2817
+ const e = t[l.field];
2818
+ return "eq" in l ? Te(e, l.eq) : "ne" in l ? !Te(e, l.ne) : "in" in l ? Array.isArray(l.in) ? l.in.some((a) => Te(e, a)) : null : "empty" in l ? $e(e) : "not_empty" in l ? !$e(e) : null;
2819
+ }
2820
+ function Ct(l, t) {
2821
+ if (!l) return !0;
2822
+ const e = (l.all ?? l.any ?? []).map((a) => Mo(a, t)).filter((a) => a !== null);
2823
+ return e.length === 0 ? !0 : l.all ? e.every(Boolean) : e.some(Boolean);
2824
+ }
2825
+ const Ro = {
2826
+ class: "flex w-full flex-col gap-4",
2827
+ "data-dynamic-form": ""
2828
+ }, Uo = ["aria-label"], Eo = ["id", "aria-selected", "data-locale", "data-error", "onClick"], Io = /* @__PURE__ */ J({
2829
+ __name: "DynamicForm",
2830
+ props: {
2831
+ schema: {},
2832
+ modelValue: { default: () => ({}) },
2833
+ locales: { default: void 0 },
2834
+ defaultLocale: { default: void 0 },
2835
+ errors: { default: () => ({}) },
2836
+ readonly: { type: Boolean, default: !1 },
2837
+ localeMode: { default: "perField" },
2838
+ resources: { default: void 0 }
2839
+ },
2840
+ emits: ["update:modelValue"],
2841
+ setup(l, { emit: t }) {
2842
+ const e = l, a = t, { t: r, availableLocales: i } = re(), p = De(yt, null), u = q(() => e.locales ?? p?.locales ?? i), b = q(() => e.defaultLocale ?? u.value[0] ?? ""), _ = q(() => e.errors instanceof Bt ? e.errors.all() : e.errors);
2843
+ function V(w) {
2844
+ const A = _.value[w]?.[0];
2845
+ if (A !== void 0) return A;
2846
+ const o = Object.keys(_.value).find((f) => f.startsWith(`${w}.`));
2847
+ return o === void 0 ? void 0 : _.value[o]?.[0];
2848
+ }
2849
+ const $ = (w) => Object.fromEntries(Object.entries(_.value).filter(([A]) => A.startsWith(`${w}.`)).map(([A, o]) => [A.slice(w.length + 1), o])), n = q(() => e.schema.fields.filter((w) => Ct(w.visible_when, e.modelValue)));
2850
+ function c(w, A) {
2851
+ a("update:modelValue", { ...e.modelValue, [w]: A });
2852
+ }
2853
+ const m = (w) => !!w.translatable && (w.kind === "text" || w.kind === "textarea" || w.kind === "rich_text"), h = (w) => m(w) && (e.localeMode === "form" || w.kind === "rich_text"), v = De(rt, null), y = q(() => e.localeMode === "form" && v !== null), S = H(null), L = q(() => y.value && v ? v.value : S.value !== null && u.value.includes(S.value) ? S.value : b.value), T = q(() => !y.value && n.value.some(h));
2854
+ ut(rt, L);
2855
+ const C = (w) => typeof e.modelValue[w.key] == "object" && e.modelValue[w.key] !== null ? e.modelValue[w.key] : {}, P = (w) => _.value[`${w.key}.${L.value}`]?.[0] ?? _.value[w.key]?.[0], Y = (w) => n.value.some((A) => m(A) && _.value[`${A.key}.${w}`] !== void 0);
2856
+ function M(w, A, o) {
2857
+ c(w.key, { ...C(w), [A]: o });
2858
+ }
2859
+ const O = (w, A = w.key) => ({
2860
+ label: w.label,
2861
+ hint: w.props?.hint,
2862
+ required: w.required === !0,
2863
+ error: w.kind === "collection" ? _.value[w.key]?.[0] : V(w.key),
2864
+ editable: !e.readonly,
2865
+ name: w.key,
2866
+ "data-field-key": A
2867
+ }), X = (w, A) => w.validation?.some((o) => o.rule === A) === !0, D = (w) => {
2868
+ const A = w.validation?.find((o) => o.rule === "max")?.args?.[0];
2869
+ return typeof A == "number" ? A : void 0;
2870
+ }, Q = (w) => Array.isArray(e.modelValue[w.key]) ? e.modelValue[w.key] : [], te = (w) => typeof e.modelValue[w.key] == "number" ? e.modelValue[w.key] : null, ne = (w) => typeof e.modelValue[w.key] == "string" && e.modelValue[w.key] !== "" ? e.modelValue[w.key] : null, le = (w) => {
2871
+ const A = e.modelValue[w.key];
2872
+ return typeof A == "string" || typeof A == "number" ? A : null;
2873
+ }, de = (w) => Array.isArray(e.modelValue[w.key]) ? e.modelValue[w.key] : [], _e = (w) => Array.isArray(e.modelValue[w.key]) ? e.modelValue[w.key] : [], ge = (w) => typeof e.modelValue[w.key] == "string" ? e.modelValue[w.key] : "";
2874
+ return (w, A) => (d(), g("div", Ro, [
2875
+ T.value ? (d(), g("div", {
2876
+ key: 0,
2877
+ role: "tablist",
2878
+ "aria-label": s(r)("core.form.dynamic.language"),
2879
+ class: "flex gap-1"
2880
+ }, [
2881
+ (d(!0), g(ee, null, ce(u.value, (o) => (d(), g("button", {
2882
+ id: `dynamic-locale-${o}`,
2883
+ key: o,
2884
+ type: "button",
2885
+ role: "tab",
2886
+ "aria-selected": o === L.value,
2887
+ "data-locale": o,
2888
+ "data-error": Y(o) || void 0,
2889
+ class: "rounded-md px-3 py-1 text-sm font-medium uppercase aria-selected:bg-surface-muted data-[error]:text-critical",
2890
+ onClick: (f) => S.value = o
2891
+ }, B(o), 9, Eo))), 128))
2892
+ ], 8, Uo)) : j("", !0),
2893
+ (d(!0), g(ee, null, ce(n.value, (o) => (d(), g(ee, {
2894
+ key: o.key
2895
+ }, [
2896
+ m(o) ? (d(), g(ee, { key: 0 }, [
2897
+ h(o) ? (d(), g(ee, { key: 0 }, [
2898
+ o.kind === "rich_text" ? (d(), z(nt, N({
2899
+ key: 0,
2900
+ ref_for: !0
2901
+ }, O(o), {
2902
+ error: P(o),
2903
+ "model-value": C(o)[L.value] ?? "",
2904
+ images: e.resources,
2905
+ video: o.props?.video,
2906
+ "onUpdate:modelValue": (f) => M(o, L.value, f)
2907
+ }), null, 16, ["error", "model-value", "images", "video", "onUpdate:modelValue"])) : o.kind === "textarea" ? (d(), z(et, N({
2908
+ key: 1,
2909
+ ref_for: !0
2910
+ }, O(o), {
2911
+ error: P(o),
2912
+ "model-value": C(o)[L.value] ?? "",
2913
+ rows: o.props?.rows,
2914
+ placeholder: o.props?.placeholder,
2915
+ "max-length": D(o),
2916
+ "onUpdate:modelValue": (f) => M(o, L.value, f)
2917
+ }), null, 16, ["error", "model-value", "rows", "placeholder", "max-length", "onUpdate:modelValue"])) : (d(), z(Je, N({
2918
+ key: 2,
2919
+ ref_for: !0
2920
+ }, O(o), {
2921
+ error: P(o),
2922
+ "model-value": C(o)[L.value] ?? "",
2923
+ placeholder: o.props?.placeholder,
2924
+ "max-length": D(o),
2925
+ "onUpdate:modelValue": (f) => M(o, L.value, f)
2926
+ }), null, 16, ["error", "model-value", "placeholder", "max-length", "onUpdate:modelValue"]))
2927
+ ], 64)) : (d(), z(xl, N({
2928
+ key: 1,
2929
+ ref_for: !0
2930
+ }, O(o), {
2931
+ "model-value": C(o),
2932
+ locales: u.value,
2933
+ "default-locale": b.value,
2934
+ "required-locales": o.required ? [b.value] : [],
2935
+ multiline: o.kind === "textarea",
2936
+ rows: o.props?.rows,
2937
+ placeholder: o.props?.placeholder,
2938
+ "max-length": D(o),
2939
+ "onUpdate:modelValue": (f) => c(o.key, f)
2940
+ }), null, 16, ["model-value", "locales", "default-locale", "required-locales", "multiline", "rows", "placeholder", "max-length", "onUpdate:modelValue"]))
2941
+ ], 64)) : o.kind === "text" ? (d(), z(Je, N({
2942
+ key: 1,
2943
+ ref_for: !0
2944
+ }, O(o), {
2945
+ type: X(o, "email") ? "email" : X(o, "url") ? "url" : "text",
2946
+ "model-value": ge(o),
2947
+ placeholder: o.props?.placeholder,
2948
+ "max-length": D(o),
2949
+ "onUpdate:modelValue": (f) => c(o.key, f)
2950
+ }), null, 16, ["type", "model-value", "placeholder", "max-length", "onUpdate:modelValue"])) : o.kind === "textarea" ? (d(), z(et, N({
2951
+ key: 2,
2952
+ ref_for: !0
2953
+ }, O(o), {
2954
+ "model-value": ge(o),
2955
+ rows: o.props?.rows,
2956
+ placeholder: o.props?.placeholder,
2957
+ "max-length": D(o),
2958
+ "onUpdate:modelValue": (f) => c(o.key, f)
2959
+ }), null, 16, ["model-value", "rows", "placeholder", "max-length", "onUpdate:modelValue"])) : o.kind === "rich_text" ? (d(), z(nt, N({
2960
+ key: 3,
2961
+ ref_for: !0
2962
+ }, O(o), {
2963
+ "model-value": ge(o),
2964
+ images: e.resources,
2965
+ video: o.props?.video,
2966
+ "onUpdate:modelValue": (f) => c(o.key, f)
2967
+ }), null, 16, ["model-value", "images", "video", "onUpdate:modelValue"])) : o.kind === "number" ? (d(), z(gt, N({
2968
+ key: 4,
2969
+ ref_for: !0
2970
+ }, O(o), {
2971
+ "model-value": te(o),
2972
+ placeholder: o.props?.placeholder,
2973
+ "onUpdate:modelValue": (f) => c(o.key, f)
2974
+ }), null, 16, ["model-value", "placeholder", "onUpdate:modelValue"])) : o.kind === "boolean" ? (d(), z(sa, N({
2975
+ key: 5,
2976
+ ref_for: !0
2977
+ }, O(o), {
2978
+ "model-value": e.modelValue[o.key] === !0,
2979
+ "onUpdate:modelValue": (f) => c(o.key, f)
2980
+ }), null, 16, ["model-value", "onUpdate:modelValue"])) : o.kind === "select" ? (d(), z(na, N({
2981
+ key: 6,
2982
+ ref_for: !0
2983
+ }, O(o), {
2984
+ options: o.options ?? [],
2985
+ "model-value": le(o),
2986
+ clearable: !o.required,
2987
+ placeholder: o.props?.placeholder,
2988
+ "onUpdate:modelValue": (f) => c(o.key, f)
2989
+ }), null, 16, ["options", "model-value", "clearable", "placeholder", "onUpdate:modelValue"])) : o.kind === "multi_select" ? (d(), z(jl, N({
2990
+ key: 7,
2991
+ ref_for: !0
2992
+ }, O(o), {
2993
+ options: o.options ?? [],
2994
+ "model-value": de(o),
2995
+ placeholder: o.props?.placeholder,
2996
+ "onUpdate:modelValue": (f) => c(o.key, f)
2997
+ }), null, 16, ["options", "model-value", "placeholder", "onUpdate:modelValue"])) : o.kind === "date" ? (d(), z(aa, N({
2998
+ key: 8,
2999
+ ref_for: !0
3000
+ }, O(o), {
3001
+ "model-value": ne(o),
3002
+ "onUpdate:modelValue": (f) => c(o.key, f)
3003
+ }), null, 16, ["model-value", "onUpdate:modelValue"])) : o.kind === "datetime" ? (d(), z(Wa, N({
3004
+ key: 9,
3005
+ ref_for: !0
3006
+ }, O(o), {
3007
+ "model-value": ne(o),
3008
+ "onUpdate:modelValue": (f) => c(o.key, f)
3009
+ }), null, 16, ["model-value", "onUpdate:modelValue"])) : o.kind === "image" || o.kind === "document" || o.kind === "gallery" ? (d(), g(ee, { key: 10 }, [
3010
+ e.resources ? (d(), z(Bo, N({
3011
+ key: 0,
3012
+ ref_for: !0
3013
+ }, O(o), {
3014
+ source: e.resources,
3015
+ multiple: o.kind === "gallery",
3016
+ accept: o.props?.accept ?? (o.kind === "image" ? "image/*" : void 0),
3017
+ "model-value": o.kind === "gallery" ? Q(o) : e.modelValue[o.key],
3018
+ "onUpdate:modelValue": (f) => c(o.key, f)
3019
+ }), null, 16, ["source", "multiple", "accept", "model-value", "onUpdate:modelValue"])) : j("", !0)
3020
+ ], 64)) : o.kind === "collection" ? (d(), z(vo, N({
3021
+ key: 11,
3022
+ ref_for: !0
3023
+ }, O(o), {
3024
+ fields: o.children ?? [],
3025
+ "model-value": _e(o),
3026
+ locales: u.value,
3027
+ "default-locale": b.value,
3028
+ errors: $(o.key),
3029
+ resources: e.resources,
3030
+ "add-label": o.props?.addLabel,
3031
+ "locale-mode": e.localeMode,
3032
+ "onUpdate:modelValue": (f) => c(o.key, f)
3033
+ }), null, 16, ["fields", "model-value", "locales", "default-locale", "errors", "resources", "add-label", "locale-mode", "onUpdate:modelValue"])) : j("", !0)
3034
+ ], 64))), 128))
3035
+ ]));
3036
+ }
3037
+ }), Ve = (l) => {
3038
+ const [t] = l.args ?? [];
3039
+ if (typeof t != "number" || !Number.isFinite(t)) throw new Error(`buildValidator: the "${l.rule}" rule needs a number argument.`);
3040
+ return t;
3041
+ }, st = (l) => typeof l == "string" || typeof l == "number";
3042
+ function Rr(l, t) {
3043
+ const e = t.zod, { messages: a = {} } = t, r = e.any().refine(() => !1, { params: { code: "required" }, ...a.required !== void 0 ? { error: a.required } : {} }), i = (c) => c !== void 0 ? { error: c } : {};
3044
+ function p(c) {
3045
+ const m = c.validation ?? [], h = (T) => m.find((C) => C.rule === T), v = h("min"), y = h("max"), S = () => {
3046
+ let T = e.string(i(a.type));
3047
+ v && (T = T.min(Ve(v))), y && (T = T.max(Ve(y)));
3048
+ const C = [T];
3049
+ h("email") && C.push(e.email(i(a.email))), h("url") && C.push(e.url(i(a.url)));
3050
+ const P = h("regex")?.args?.[0];
3051
+ if (typeof P == "string") C.push(e.string().regex(new RegExp(P), i(a.regex)));
3052
+ else if (h("regex")) throw new Error(`buildValidator: the "regex" rule of "${c.key}" needs a pattern string.`);
3053
+ return C;
3054
+ }, L = (T) => {
3055
+ let C = e.array(T);
3056
+ return v && (C = C.min(Ve(v))), y && (C = C.max(Ve(y))), C;
3057
+ };
3058
+ switch (c.kind) {
3059
+ case "text":
3060
+ case "textarea":
3061
+ case "rich_text":
3062
+ return c.translatable ? [e.record(e.string(), e.unknown()).superRefine((T, C) => {
3063
+ for (const [P, Y] of Object.entries(T))
3064
+ if (!$e(Y))
3065
+ for (const M of S()) for (const O of M.safeParse(Y).error?.issues ?? []) C.addIssue({ ...O, path: [P, ...O.path] });
3066
+ })] : S();
3067
+ case "number": {
3068
+ let T = e.number(i(a.type));
3069
+ return v && (T = T.min(Ve(v))), y && (T = T.max(Ve(y))), [T];
3070
+ }
3071
+ case "boolean":
3072
+ return [e.boolean(i(a.type))];
3073
+ case "select": {
3074
+ const T = (c.options ?? []).map((C) => C.value);
3075
+ return [e.union([e.string(), e.number()], i(a.type)).refine((C) => T.includes(C), { params: { code: "invalid_choice" } })];
3076
+ }
3077
+ case "multi_select": {
3078
+ const T = (c.options ?? []).map((C) => C.value);
3079
+ return [L(e.union([e.string(), e.number()])), e.array(e.unknown()).refine((C) => C.every((P) => T.includes(P)), { params: { code: "invalid_choice" } })];
3080
+ }
3081
+ case "date":
3082
+ return [e.string(i(a.type)).refine((T) => za(T) !== null, { params: { code: "date" } })];
3083
+ case "datetime":
3084
+ return [e.string(i(a.type)).refine((T) => wt(T) !== null, { params: { code: "datetime" } })];
3085
+ case "image":
3086
+ case "document":
3087
+ return [e.custom(st, i(a.type))];
3088
+ case "gallery":
3089
+ return [L(e.custom(st))];
3090
+ case "collection":
3091
+ return [L(e.record(e.string(), e.unknown()))];
3092
+ }
3093
+ }
3094
+ const u = /* @__PURE__ */ new Map(), b = (c) => {
3095
+ for (const m of c)
3096
+ u.set(m, p(m)), m.children && b(m.children);
3097
+ };
3098
+ b(l.fields);
3099
+ const _ = (c, m) => c.kind === "boolean" ? m == null : $e(m), V = (c) => c.required === !0 || c.validation?.some((m) => m.rule === "required") === !0, $ = (c, m) => {
3100
+ if (!c.translatable || typeof m != "object" || m === null) return _(c, m);
3101
+ const h = m;
3102
+ return t.defaultLocale !== void 0 ? $e(h[t.defaultLocale]) : $e(h);
3103
+ };
3104
+ function n(c, m, h, v) {
3105
+ const y = {};
3106
+ for (const S of c) {
3107
+ if (!Ct(S.visible_when, m)) continue;
3108
+ const L = m[S.key], T = [...h, S.key];
3109
+ if (y[S.key] = L, S.kind === "text" || S.kind === "textarea" || S.kind === "rich_text" ? $(S, L) : _(S, L)) {
3110
+ if (V(S)) for (const P of r.safeParse(L).error?.issues ?? []) v.push({ path: T, message: P.message });
3111
+ continue;
3112
+ }
3113
+ for (const P of u.get(S) ?? [])
3114
+ for (const Y of P.safeParse(L).error?.issues ?? [])
3115
+ v.push({ path: [...T, ...Y.path], message: Y.message });
3116
+ S.kind === "collection" && S.children && Array.isArray(L) && L.every((P) => typeof P == "object" && P !== null) && (y[S.key] = L.map((P, Y) => n(S.children, P, [...T, Y], v)));
3117
+ }
3118
+ return y;
3119
+ }
3120
+ return {
3121
+ safeParse(c) {
3122
+ const m = typeof c == "object" && c !== null ? c : {}, h = [], v = n(l.fields, m, [], h);
3123
+ return h.length > 0 ? { success: !1, error: { issues: h } } : { success: !0, data: v };
3124
+ }
3125
+ };
3126
+ }
2325
3127
  export {
2326
- Bt as Calendar,
2327
- go as CardSelectField,
2328
- yo as CheckboxField,
2329
- ho as ChoiceChips,
2330
- ko as ComboField,
2331
- Yo as CommandDialog,
2332
- yn as DateField,
2333
- $o as DateTimeField,
2334
- Vo as EditorPage,
2335
- Oo as ErrorBag,
3128
+ Wt as Calendar,
3129
+ xr as CardSelectField,
3130
+ wr as CheckboxField,
3131
+ $r as ChoiceChips,
3132
+ Vr as ComboField,
3133
+ Yr as CommandDialog,
3134
+ aa as DateField,
3135
+ Wa as DateTimeField,
3136
+ Io as DynamicForm,
3137
+ zr as EditorPage,
3138
+ Bt as ErrorBag,
2336
3139
  ye as Field,
2337
- _o as FileField,
2338
- Je as FormErrors,
2339
- rt as FormGroup,
2340
- Co as FormGroupButton,
2341
- So as FormIndent,
2342
- bt as FormRow,
2343
- wn as FormView,
2344
- jo as GroupEditAction,
2345
- Fn as GroupSheet,
2346
- Fo as I18nField,
2347
- on as LeaveGuardRoot,
2348
- Xo as MissingLeaveGuardRootError,
2349
- To as MoneyField,
2350
- Do as MonthYearField,
2351
- Lo as MultiSelectField,
2352
- zo as NumberCell,
2353
- It as NumberField,
2354
- Ke as OptionList,
2355
- Bn as OtpInput,
2356
- qo as PhotoField,
2357
- Tn as RecordGroupScope,
2358
- qn as SegmentedField,
2359
- _n as SelectField,
2360
- Ro as StepForm,
2361
- Bl as StepNavigation,
2362
- Ml as StepProgress,
2363
- zn as SwitchField,
2364
- vn as TextField,
2365
- Rn as TextareaField,
2366
- kn as TimeField,
2367
- st as checkFile,
2368
- Eo as createFieldGroups,
2369
- Qo as createLeaveGuard,
2370
- ma as dateTimeValue,
2371
- xo as dateValue,
2372
- me as fieldDefaults,
2373
- Wo as fieldKey,
3140
+ Sr as FileField,
3141
+ it as FormErrors,
3142
+ St as FormGroup,
3143
+ Fr as FormGroupButton,
3144
+ qr as FormIndent,
3145
+ Ot as FormRow,
3146
+ hn as FormView,
3147
+ Ir as GroupEditAction,
3148
+ wn as GroupSheet,
3149
+ xl as I18nField,
3150
+ rn as LeaveGuardRoot,
3151
+ Qr as MissingLeaveGuardRootError,
3152
+ Lr as MoneyField,
3153
+ Tr as MonthYearField,
3154
+ jl as MultiSelectField,
3155
+ jr as NumberCell,
3156
+ gt as NumberField,
3157
+ Xe as OptionList,
3158
+ $n as OtpInput,
3159
+ Dr as PhotoField,
3160
+ Vn as RecordGroupScope,
3161
+ vo as RepeatField,
3162
+ Bo as ResourceField,
3163
+ nt as RichTextField,
3164
+ Fn as SegmentedField,
3165
+ na as SelectField,
3166
+ Mr as StepForm,
3167
+ Xl as StepNavigation,
3168
+ ro as StepProgress,
3169
+ sa as SwitchField,
3170
+ Je as TextField,
3171
+ et as TextareaField,
3172
+ yn as TimeField,
3173
+ Rr as buildValidator,
3174
+ $t as checkFile,
3175
+ Ar as createFieldGroups,
3176
+ en as createLeaveGuard,
3177
+ wt as dateTimeValue,
3178
+ za as dateValue,
3179
+ Ct as evaluateVisibility,
3180
+ pe as fieldDefaults,
3181
+ Jr as fieldKey,
2374
3182
  fe as fieldProps,
2375
- Le as focusFirstError,
3183
+ Me as focusFirstError,
2376
3184
  fn as formEditableKey,
2377
- Be as formatBytes,
2378
- un as groupOptions,
2379
- al as hasUnsupportedCharacters,
2380
- en as installLeaveGuard,
2381
- tn as leaveGuardKey,
2382
- dn as matchOptions,
2383
- Ia as missingLocales,
2384
- wo as now,
2385
- va as parseDateValue,
2386
- Ao as provideRecordGroups,
2387
- bn as recentChoicesKey,
2388
- Go as recordGroupsKey,
2389
- Bo as refineStorableText,
2390
- Fe as today,
2391
- el as unsupportedCharactersCode,
2392
- Jo as useCommand,
2393
- Yt as useDirtySnapshot,
2394
- et as useFieldMode,
2395
- Ko as useForm,
2396
- Dn as useGroupSheet,
2397
- Po as useHiddenFieldErrors,
2398
- Qe as useLeaveGuard,
2399
- an as useLeaveGuardContext,
2400
- Cn as useOptions,
2401
- In as useRecordDialog,
2402
- Ho as useRecordGroups,
3185
+ Le as formatBytes,
3186
+ dn as groupOptions,
3187
+ Vl as hasUnsupportedCharacters,
3188
+ tn as installLeaveGuard,
3189
+ $e as isEmptyValue,
3190
+ an as leaveGuardKey,
3191
+ cn as matchOptions,
3192
+ nl as missingLocales,
3193
+ Cr as now,
3194
+ ja as parseDateValue,
3195
+ Nr as provideRecordGroups,
3196
+ vn as recentChoicesKey,
3197
+ Pr as recordGroupsKey,
3198
+ Br as refineStorableText,
3199
+ Ke as thumbnailUrl,
3200
+ Be as today,
3201
+ wl as unsupportedCharactersCode,
3202
+ Zr as useCommand,
3203
+ va as useDirtySnapshot,
3204
+ qe as useFieldMode,
3205
+ Kr as useForm,
3206
+ Cn as useGroupSheet,
3207
+ Gr as useHiddenFieldErrors,
3208
+ ft as useLeaveGuard,
3209
+ ln as useLeaveGuardContext,
3210
+ _n as useOptions,
3211
+ Bn as useRecordDialog,
3212
+ Hr as useRecordGroups,
2403
3213
  sn as useResourceForm,
2404
- Pt as useSaveChrome,
2405
- kl as useSectionStates,
2406
- po as useSheetDiscardGuard,
2407
- Mo as useStepForm,
2408
- bo as zodErrorMap
3214
+ ma as useSaveChrome,
3215
+ Pl as useSectionStates,
3216
+ kr as useSheetDiscardGuard,
3217
+ Or as useStepForm,
3218
+ _r as zodErrorMap
2409
3219
  };