@stonecrop/desktop 0.10.1 → 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/desktop.js CHANGED
@@ -1,40 +1,40 @@
1
- import { defineComponent as we, ref as C, onMounted as Ae, openBlock as P, createElementBlock as V, normalizeClass as Oe, createElementVNode as A, Fragment as de, renderList as me, toDisplayString as X, createCommentVNode as ue, withDirectives as Ne, vShow as Ue, useTemplateRef as ft, computed as I, watch as L, nextTick as ae, createBlock as Ze, Teleport as Rt, createVNode as ne, Transition as It, withCtx as ye, withModifiers as pt, vModelText as ht, renderSlot as Pe, createTextVNode as $e, toRaw as vt, isRef as fe, isReactive as xe, toRef as re, hasInjectionContext as ze, inject as be, getCurrentInstance as gt, reactive as mt, markRaw as he, effectScope as At, getCurrentScope as Qe, onScopeDispose as Xe, toRefs as tt, provide as Ge, shallowRef as Se, toValue as Q, readonly as Te, customRef as Ye, unref as De, useModel as xt, watchEffect as Tt, resolveComponent as yt, resolveDynamicComponent as Pt, mergeProps as Vt, mergeModels as ot, withKeys as pe, normalizeStyle as Ve } from "vue";
2
- const jt = { class: "action-menu-icon" }, Mt = ["disabled", "onClick"], Ft = { key: 1 }, Lt = ["onClick"], Bt = { class: "dropdown-container" }, Wt = { class: "dropdown" }, Ht = ["onClick"], Ut = ["href"], zt = { class: "dropdown-item" }, Gt = /* @__PURE__ */ we({
1
+ import { defineComponent as we, ref as C, onMounted as xe, openBlock as T, createElementBlock as j, normalizeClass as De, createElementVNode as x, Fragment as ue, renderList as ye, toDisplayString as X, createCommentVNode as ce, withDirectives as $e, vShow as ze, useTemplateRef as pt, computed as R, watch as H, nextTick as de, createBlock as Qe, Teleport as $t, createVNode as ne, Transition as At, withCtx as me, withModifiers as ft, vModelText as ht, renderSlot as Ve, createTextVNode as Ae, toRaw as vt, isRef as pe, isReactive as Pe, toRef as re, hasInjectionContext as Ge, inject as be, getCurrentInstance as gt, reactive as yt, markRaw as he, effectScope as Ct, getCurrentScope as Xe, onScopeDispose as Ye, toRefs as tt, provide as Je, shallowRef as Se, toValue as q, readonly as Te, customRef as et, unref as Ne, useModel as It, watchEffect as Rt, resolveComponent as mt, resolveDynamicComponent as xt, mergeProps as Pt, mergeModels as ot, withKeys as fe, normalizeStyle as je } from "vue";
2
+ const Tt = { class: "action-menu-icon" }, Vt = ["disabled", "onClick"], jt = { key: 1 }, Mt = ["onClick"], Ft = { class: "dropdown-container" }, Lt = { class: "dropdown" }, Bt = ["onClick"], Wt = ["href"], Ht = { class: "dropdown-item" }, Ut = /* @__PURE__ */ we({
3
3
  __name: "ActionSet",
4
4
  props: {
5
5
  elements: { default: () => [] }
6
6
  },
7
7
  emits: ["actionClick"],
8
- setup(t, { emit: e }) {
9
- const o = e, n = C({}), r = C(!1), i = C(-1), a = C(!1), u = C(!1);
10
- Ae(() => {
11
- c();
8
+ setup(o, { emit: e }) {
9
+ const t = e, n = C({}), r = C(!1), a = C(-1), s = C(!1), c = C(!1);
10
+ xe(() => {
11
+ d();
12
12
  });
13
- const c = () => {
13
+ const d = () => {
14
14
  n.value = {};
15
- }, f = () => {
16
- a.value = !0, i.value = setTimeout(() => {
17
- a.value && (r.value = !0);
15
+ }, u = () => {
16
+ s.value = !0, a.value = setTimeout(() => {
17
+ s.value && (r.value = !0);
18
18
  }, 500);
19
- }, p = () => {
20
- a.value = !1, u.value = !1, clearTimeout(i.value), r.value = !1;
21
- }, b = (_) => {
22
- const m = !n.value[_];
23
- c(), m && (n.value[_] = !0);
24
- }, h = (_, m) => {
25
- o("actionClick", m, _);
19
+ }, b = () => {
20
+ s.value = !1, c.value = !1, clearTimeout(a.value), r.value = !1;
21
+ }, v = (w) => {
22
+ const m = !n.value[w];
23
+ d(), m && (n.value[w] = !0);
24
+ }, h = (w, m) => {
25
+ t("actionClick", m, w);
26
26
  };
27
- return (_, m) => (P(), V("div", {
28
- class: Oe([{ "open-set": r.value, "hovered-and-closed": u.value }, "action-set collapse"]),
29
- onMouseover: f,
30
- onMouseleave: p
27
+ return (w, m) => (T(), j("div", {
28
+ class: De([{ "open-set": r.value, "hovered-and-closed": c.value }, "action-set collapse"]),
29
+ onMouseover: u,
30
+ onMouseleave: b
31
31
  }, [
32
- A("div", jt, [
33
- A("div", {
32
+ x("div", Tt, [
33
+ x("div", {
34
34
  id: "chevron",
35
- onClick: m[0] || (m[0] = (O) => u.value = !u.value)
35
+ onClick: m[0] || (m[0] = (k) => c.value = !c.value)
36
36
  }, [...m[1] || (m[1] = [
37
- A("svg", {
37
+ x("svg", {
38
38
  id: "Layer_1",
39
39
  class: "leftBar",
40
40
  version: "1.1",
@@ -47,9 +47,9 @@ const jt = { class: "action-menu-icon" }, Mt = ["disabled", "onClick"], Ft = { k
47
47
  width: "50",
48
48
  height: "50"
49
49
  }, [
50
- A("polygon", { points: "54.2,33.4 29.2,58.8 25,54.6 50,29.2 " })
50
+ x("polygon", { points: "54.2,33.4 29.2,58.8 25,54.6 50,29.2 " })
51
51
  ], -1),
52
- A("svg", {
52
+ x("svg", {
53
53
  id: "Layer_1",
54
54
  class: "rightBar",
55
55
  version: "1.1",
@@ -62,59 +62,59 @@ const jt = { class: "action-menu-icon" }, Mt = ["disabled", "onClick"], Ft = { k
62
62
  width: "50",
63
63
  height: "50"
64
64
  }, [
65
- A("polygon", { points: "70.8,58.8 45.8,33.4 50,29.2 75,54.6 " })
65
+ x("polygon", { points: "70.8,58.8 45.8,33.4 50,29.2 75,54.6 " })
66
66
  ], -1)
67
67
  ])])
68
68
  ]),
69
- m[2] || (m[2] = A("div", { style: { "margin-right": "30px" } }, null, -1)),
70
- (P(!0), V(de, null, me(t.elements, (O, R) => (P(), V("div", {
71
- key: O.label,
69
+ m[2] || (m[2] = x("div", { style: { "margin-right": "30px" } }, null, -1)),
70
+ (T(!0), j(ue, null, ye(o.elements, (k, I) => (T(), j("div", {
71
+ key: k.label,
72
72
  class: "action-element"
73
73
  }, [
74
- O.type == "button" ? (P(), V("button", {
74
+ k.type == "button" ? (T(), j("button", {
75
75
  key: 0,
76
- disabled: O.disabled,
76
+ disabled: k.disabled,
77
77
  class: "button-default",
78
- onClick: (x) => h(O.action, O.label)
79
- }, X(O.label), 9, Mt)) : ue("", !0),
80
- O.type == "dropdown" ? (P(), V("div", Ft, [
81
- A("button", {
78
+ onClick: (P) => h(k.action, k.label)
79
+ }, X(k.label), 9, Vt)) : ce("", !0),
80
+ k.type == "dropdown" ? (T(), j("div", jt, [
81
+ x("button", {
82
82
  class: "button-default",
83
- onClick: (x) => b(R)
84
- }, X(O.label), 9, Lt),
85
- Ne(A("div", Bt, [
86
- A("div", Wt, [
87
- (P(!0), V(de, null, me(O.actions, (x, H) => (P(), V("div", {
88
- key: x.label
83
+ onClick: (P) => v(I)
84
+ }, X(k.label), 9, Mt),
85
+ $e(x("div", Ft, [
86
+ x("div", Lt, [
87
+ (T(!0), j(ue, null, ye(k.actions, (P, Z) => (T(), j("div", {
88
+ key: P.label
89
89
  }, [
90
- x.action != null ? (P(), V("button", {
90
+ P.action != null ? (T(), j("button", {
91
91
  key: 0,
92
92
  class: "dropdown-item",
93
- onClick: (U) => h(x.action, x.label)
94
- }, X(x.label), 9, Ht)) : x.link != null ? (P(), V("a", {
93
+ onClick: (U) => h(P.action, P.label)
94
+ }, X(P.label), 9, Bt)) : P.link != null ? (T(), j("a", {
95
95
  key: 1,
96
- href: x.link
96
+ href: P.link
97
97
  }, [
98
- A("button", zt, X(x.label), 1)
99
- ], 8, Ut)) : ue("", !0)
98
+ x("button", Ht, X(P.label), 1)
99
+ ], 8, Wt)) : ce("", !0)
100
100
  ]))), 128))
101
101
  ])
102
102
  ], 512), [
103
- [Ue, n.value[R]]
103
+ [ze, n.value[I]]
104
104
  ])
105
- ])) : ue("", !0)
105
+ ])) : ce("", !0)
106
106
  ]))), 128))
107
107
  ], 34));
108
108
  }
109
- }), bt = (t, e) => {
110
- const o = t.__vccOpts || t;
109
+ }), bt = (o, e) => {
110
+ const t = o.__vccOpts || o;
111
111
  for (const [n, r] of e)
112
- o[n] = r;
113
- return o;
114
- }, wt = /* @__PURE__ */ bt(Gt, [["__scopeId", "data-v-eb01c863"]]), Jt = { class: "command-palette-header" }, Kt = ["placeholder"], qt = {
112
+ t[n] = r;
113
+ return t;
114
+ }, wt = /* @__PURE__ */ bt(Ut, [["__scopeId", "data-v-eb01c863"]]), zt = { class: "command-palette-header" }, Gt = ["placeholder"], Jt = {
115
115
  key: 0,
116
116
  class: "command-palette-results"
117
- }, Zt = ["onClick", "onMouseover"], Qt = { class: "result-title" }, Xt = { class: "result-content" }, Yt = {
117
+ }, Kt = ["onClick", "onMouseover"], qt = { class: "result-title" }, Zt = { class: "result-content" }, Qt = {
118
118
  key: 1,
119
119
  class: "command-palette-no-results"
120
120
  }, St = /* @__PURE__ */ we({
@@ -126,913 +126,913 @@ const jt = { class: "action-menu-icon" }, Mt = ["disabled", "onClick"], Ft = { k
126
126
  maxResults: { default: 10 }
127
127
  },
128
128
  emits: ["select", "close"],
129
- setup(t, { emit: e }) {
130
- const o = e, n = C(""), r = C(0), i = ft("input"), a = I(() => n.value ? t.search(n.value).slice(0, t.maxResults) : []);
131
- L(
132
- () => t.isOpen,
133
- async (p) => {
134
- p && (n.value = "", r.value = 0, await ae(), i.value?.focus());
129
+ setup(o, { emit: e }) {
130
+ const t = e, n = C(""), r = C(0), a = pt("input"), s = R(() => n.value ? o.search(n.value).slice(0, o.maxResults) : []);
131
+ H(
132
+ () => o.isOpen,
133
+ async (b) => {
134
+ b && (n.value = "", r.value = 0, await de(), a.value?.focus());
135
135
  }
136
- ), L(a, () => {
136
+ ), H(s, () => {
137
137
  r.value = 0;
138
138
  });
139
- const u = () => {
140
- o("close");
141
- }, c = (p) => {
142
- switch (p.key) {
139
+ const c = () => {
140
+ t("close");
141
+ }, d = (b) => {
142
+ switch (b.key) {
143
143
  case "Escape":
144
- u();
144
+ c();
145
145
  break;
146
146
  case "ArrowDown":
147
- p.preventDefault(), a.value.length && (r.value = (r.value + 1) % a.value.length);
147
+ b.preventDefault(), s.value.length && (r.value = (r.value + 1) % s.value.length);
148
148
  break;
149
149
  case "ArrowUp":
150
- p.preventDefault(), a.value.length && (r.value = (r.value - 1 + a.value.length) % a.value.length);
150
+ b.preventDefault(), s.value.length && (r.value = (r.value - 1 + s.value.length) % s.value.length);
151
151
  break;
152
152
  case "Enter":
153
- a.value.length && r.value >= 0 && f(a.value[r.value]);
153
+ s.value.length && r.value >= 0 && u(s.value[r.value]);
154
154
  break;
155
155
  }
156
- }, f = (p) => {
157
- o("select", p), u();
156
+ }, u = (b) => {
157
+ t("select", b), c();
158
158
  };
159
- return (p, b) => (P(), Ze(Rt, { to: "body" }, [
160
- ne(It, { name: "fade" }, {
161
- default: ye(() => [
162
- t.isOpen ? (P(), V("div", {
159
+ return (b, v) => (T(), Qe($t, { to: "body" }, [
160
+ ne(At, { name: "fade" }, {
161
+ default: me(() => [
162
+ o.isOpen ? (T(), j("div", {
163
163
  key: 0,
164
164
  class: "command-palette-overlay",
165
- onClick: u
165
+ onClick: c
166
166
  }, [
167
- A("div", {
167
+ x("div", {
168
168
  class: "command-palette",
169
- onClick: b[1] || (b[1] = pt(() => {
169
+ onClick: v[1] || (v[1] = ft(() => {
170
170
  }, ["stop"]))
171
171
  }, [
172
- A("div", Jt, [
173
- Ne(A("input", {
172
+ x("div", zt, [
173
+ $e(x("input", {
174
174
  ref: "input",
175
- "onUpdate:modelValue": b[0] || (b[0] = (h) => n.value = h),
175
+ "onUpdate:modelValue": v[0] || (v[0] = (h) => n.value = h),
176
176
  type: "text",
177
177
  class: "command-palette-input",
178
- placeholder: t.placeholder,
178
+ placeholder: o.placeholder,
179
179
  autofocus: "",
180
- onKeydown: c
181
- }, null, 40, Kt), [
180
+ onKeydown: d
181
+ }, null, 40, Gt), [
182
182
  [ht, n.value]
183
183
  ])
184
184
  ]),
185
- a.value.length ? (P(), V("div", qt, [
186
- (P(!0), V(de, null, me(a.value, (h, _) => (P(), V("div", {
187
- key: _,
188
- class: Oe(["command-palette-result", { selected: _ === r.value }]),
189
- onClick: (m) => f(h),
190
- onMouseover: (m) => r.value = _
185
+ s.value.length ? (T(), j("div", Jt, [
186
+ (T(!0), j(ue, null, ye(s.value, (h, w) => (T(), j("div", {
187
+ key: w,
188
+ class: De(["command-palette-result", { selected: w === r.value }]),
189
+ onClick: (m) => u(h),
190
+ onMouseover: (m) => r.value = w
191
191
  }, [
192
- A("div", Qt, [
193
- Pe(p.$slots, "title", { result: h })
192
+ x("div", qt, [
193
+ Ve(b.$slots, "title", { result: h })
194
194
  ]),
195
- A("div", Xt, [
196
- Pe(p.$slots, "content", { result: h })
195
+ x("div", Zt, [
196
+ Ve(b.$slots, "content", { result: h })
197
197
  ])
198
- ], 42, Zt))), 128))
199
- ])) : n.value && !a.value.length ? (P(), V("div", Yt, [
200
- Pe(p.$slots, "empty", {}, () => [
201
- $e(' No results found for "' + X(n.value) + '" ', 1)
198
+ ], 42, Kt))), 128))
199
+ ])) : n.value && !s.value.length ? (T(), j("div", Qt, [
200
+ Ve(b.$slots, "empty", {}, () => [
201
+ Ae(' No results found for "' + X(n.value) + '" ', 1)
202
202
  ])
203
- ])) : ue("", !0)
203
+ ])) : ce("", !0)
204
204
  ])
205
- ])) : ue("", !0)
205
+ ])) : ce("", !0)
206
206
  ]),
207
207
  _: 3
208
208
  })
209
209
  ]));
210
210
  }
211
211
  });
212
- const le = typeof window < "u";
212
+ const ie = typeof window < "u";
213
213
  let oe;
214
- const Ce = (t) => oe = t;
214
+ const Ce = (o) => oe = o;
215
215
  process.env.NODE_ENV;
216
- const Je = process.env.NODE_ENV !== "production" ? /* @__PURE__ */ Symbol("pinia") : (
216
+ const Ke = process.env.NODE_ENV !== "production" ? /* @__PURE__ */ Symbol("pinia") : (
217
217
  /* istanbul ignore next */
218
218
  /* @__PURE__ */ Symbol()
219
219
  );
220
- function se(t) {
221
- return t && typeof t == "object" && Object.prototype.toString.call(t) === "[object Object]" && typeof t.toJSON != "function";
220
+ function ae(o) {
221
+ return o && typeof o == "object" && Object.prototype.toString.call(o) === "[object Object]" && typeof o.toJSON != "function";
222
222
  }
223
223
  var ve;
224
- (function(t) {
225
- t.direct = "direct", t.patchObject = "patch object", t.patchFunction = "patch function";
224
+ (function(o) {
225
+ o.direct = "direct", o.patchObject = "patch object", o.patchFunction = "patch function";
226
226
  })(ve || (ve = {}));
227
- function Et(t, e) {
228
- for (const o in e) {
229
- const n = e[o];
230
- if (!(o in t))
227
+ function _t(o, e) {
228
+ for (const t in e) {
229
+ const n = e[t];
230
+ if (!(t in o))
231
231
  continue;
232
- const r = t[o];
233
- se(r) && se(n) && !fe(n) && !xe(n) ? t[o] = Et(r, n) : t[o] = n;
232
+ const r = o[t];
233
+ ae(r) && ae(n) && !pe(n) && !Pe(n) ? o[t] = _t(r, n) : o[t] = n;
234
234
  }
235
- return t;
235
+ return o;
236
236
  }
237
- const _t = () => {
237
+ const Et = () => {
238
238
  };
239
- function nt(t, e, o, n = _t) {
240
- t.add(e);
239
+ function nt(o, e, t, n = Et) {
240
+ o.add(e);
241
241
  const r = () => {
242
- t.delete(e) && n();
242
+ o.delete(e) && n();
243
243
  };
244
- return !o && Qe() && Xe(r), r;
244
+ return !t && Xe() && Ye(r), r;
245
245
  }
246
- function ie(t, ...e) {
247
- t.forEach((o) => {
248
- o(...e);
246
+ function se(o, ...e) {
247
+ o.forEach((t) => {
248
+ t(...e);
249
249
  });
250
250
  }
251
- const eo = (t) => t(), rt = /* @__PURE__ */ Symbol(), je = /* @__PURE__ */ Symbol();
252
- function Ke(t, e) {
253
- t instanceof Map && e instanceof Map ? e.forEach((o, n) => t.set(n, o)) : t instanceof Set && e instanceof Set && e.forEach(t.add, t);
254
- for (const o in e) {
255
- if (!e.hasOwnProperty(o))
251
+ const Xt = (o) => o(), rt = /* @__PURE__ */ Symbol(), Me = /* @__PURE__ */ Symbol();
252
+ function qe(o, e) {
253
+ o instanceof Map && e instanceof Map ? e.forEach((t, n) => o.set(n, t)) : o instanceof Set && e instanceof Set && e.forEach(o.add, o);
254
+ for (const t in e) {
255
+ if (!e.hasOwnProperty(t))
256
256
  continue;
257
- const n = e[o], r = t[o];
258
- se(r) && se(n) && t.hasOwnProperty(o) && !fe(n) && !xe(n) ? t[o] = Ke(r, n) : t[o] = n;
257
+ const n = e[t], r = o[t];
258
+ ae(r) && ae(n) && o.hasOwnProperty(t) && !pe(n) && !Pe(n) ? o[t] = qe(r, n) : o[t] = n;
259
259
  }
260
- return t;
260
+ return o;
261
261
  }
262
- const to = process.env.NODE_ENV !== "production" ? /* @__PURE__ */ Symbol("pinia:skipHydration") : (
262
+ const Yt = process.env.NODE_ENV !== "production" ? /* @__PURE__ */ Symbol("pinia:skipHydration") : (
263
263
  /* istanbul ignore next */
264
264
  /* @__PURE__ */ Symbol()
265
265
  );
266
- function oo(t) {
267
- return !se(t) || !Object.prototype.hasOwnProperty.call(t, to);
266
+ function eo(o) {
267
+ return !ae(o) || !Object.prototype.hasOwnProperty.call(o, Yt);
268
268
  }
269
- const { assign: Z } = Object;
270
- function at(t) {
271
- return !!(fe(t) && t.effect);
269
+ const { assign: K } = Object;
270
+ function at(o) {
271
+ return !!(pe(o) && o.effect);
272
272
  }
273
- function st(t, e, o, n) {
274
- const { state: r, actions: i, getters: a } = e, u = o.state.value[t];
275
- let c;
276
- function f() {
277
- !u && (process.env.NODE_ENV === "production" || !n) && (o.state.value[t] = r ? r() : {});
278
- const p = process.env.NODE_ENV !== "production" && n ? (
273
+ function st(o, e, t, n) {
274
+ const { state: r, actions: a, getters: s } = e, c = t.state.value[o];
275
+ let d;
276
+ function u() {
277
+ !c && (process.env.NODE_ENV === "production" || !n) && (t.state.value[o] = r ? r() : {});
278
+ const b = process.env.NODE_ENV !== "production" && n ? (
279
279
  // use ref() to unwrap refs inside state TODO: check if this is still necessary
280
280
  tt(C(r ? r() : {}).value)
281
- ) : tt(o.state.value[t]);
282
- return Z(p, i, Object.keys(a || {}).reduce((b, h) => (process.env.NODE_ENV !== "production" && h in p && console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${h}" in store "${t}".`), b[h] = he(I(() => {
283
- Ce(o);
284
- const _ = o._s.get(t);
285
- return a[h].call(_, _);
286
- })), b), {}));
287
- }
288
- return c = qe(t, f, e, o, n, !0), c;
281
+ ) : tt(t.state.value[o]);
282
+ return K(b, a, Object.keys(s || {}).reduce((v, h) => (process.env.NODE_ENV !== "production" && h in b && console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${h}" in store "${o}".`), v[h] = he(R(() => {
283
+ Ce(t);
284
+ const w = t._s.get(o);
285
+ return s[h].call(w, w);
286
+ })), v), {}));
287
+ }
288
+ return d = Ze(o, u, e, t, n, !0), d;
289
289
  }
290
- function qe(t, e, o = {}, n, r, i) {
291
- let a;
292
- const u = Z({ actions: {} }, o);
290
+ function Ze(o, e, t = {}, n, r, a) {
291
+ let s;
292
+ const c = K({ actions: {} }, t);
293
293
  if (process.env.NODE_ENV !== "production" && !n._e.active)
294
294
  throw new Error("Pinia destroyed");
295
- const c = { deep: !0 };
296
- process.env.NODE_ENV !== "production" && (c.onTrigger = (v) => {
297
- f ? _ = v : f == !1 && !E._hotUpdating && (Array.isArray(_) ? _.push(v) : console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug."));
295
+ const d = { deep: !0 };
296
+ process.env.NODE_ENV !== "production" && (d.onTrigger = (g) => {
297
+ u ? w = g : u == !1 && !E._hotUpdating && (Array.isArray(w) ? w.push(g) : console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug."));
298
298
  });
299
- let f, p, b = /* @__PURE__ */ new Set(), h = /* @__PURE__ */ new Set(), _;
300
- const m = n.state.value[t];
301
- !i && !m && (process.env.NODE_ENV === "production" || !r) && (n.state.value[t] = {});
302
- const O = C({});
303
- let R;
304
- function x(v) {
305
- let g;
306
- f = p = !1, process.env.NODE_ENV !== "production" && (_ = []), typeof v == "function" ? (v(n.state.value[t]), g = {
299
+ let u, b, v = /* @__PURE__ */ new Set(), h = /* @__PURE__ */ new Set(), w;
300
+ const m = n.state.value[o];
301
+ !a && !m && (process.env.NODE_ENV === "production" || !r) && (n.state.value[o] = {});
302
+ const k = C({});
303
+ let I;
304
+ function P(g) {
305
+ let y;
306
+ u = b = !1, process.env.NODE_ENV !== "production" && (w = []), typeof g == "function" ? (g(n.state.value[o]), y = {
307
307
  type: ve.patchFunction,
308
- storeId: t,
309
- events: _
310
- }) : (Ke(n.state.value[t], v), g = {
308
+ storeId: o,
309
+ events: w
310
+ }) : (qe(n.state.value[o], g), y = {
311
311
  type: ve.patchObject,
312
- payload: v,
313
- storeId: t,
314
- events: _
312
+ payload: g,
313
+ storeId: o,
314
+ events: w
315
315
  });
316
- const $ = R = /* @__PURE__ */ Symbol();
317
- ae().then(() => {
318
- R === $ && (f = !0);
319
- }), p = !0, ie(b, g, n.state.value[t]);
320
- }
321
- const H = i ? function() {
322
- const { state: g } = o, $ = g ? g() : {};
323
- this.$patch((M) => {
324
- Z(M, $);
316
+ const D = I = /* @__PURE__ */ Symbol();
317
+ de().then(() => {
318
+ I === D && (u = !0);
319
+ }), b = !0, se(v, y, n.state.value[o]);
320
+ }
321
+ const Z = a ? function() {
322
+ const { state: y } = t, D = y ? y() : {};
323
+ this.$patch((F) => {
324
+ K(F, D);
325
325
  });
326
326
  } : (
327
327
  /* istanbul ignore next */
328
328
  process.env.NODE_ENV !== "production" ? () => {
329
- throw new Error(`🍍: Store "${t}" is built using the setup syntax and does not implement $reset().`);
330
- } : _t
329
+ throw new Error(`🍍: Store "${o}" is built using the setup syntax and does not implement $reset().`);
330
+ } : Et
331
331
  );
332
332
  function U() {
333
- a.stop(), b.clear(), h.clear(), n._s.delete(t);
333
+ s.stop(), v.clear(), h.clear(), n._s.delete(o);
334
334
  }
335
- const K = (v, g = "") => {
336
- if (rt in v)
337
- return v[je] = g, v;
338
- const $ = function() {
335
+ const G = (g, y = "") => {
336
+ if (rt in g)
337
+ return g[Me] = y, g;
338
+ const D = function() {
339
339
  Ce(n);
340
- const M = Array.from(arguments), k = /* @__PURE__ */ new Set(), T = /* @__PURE__ */ new Set();
341
- function F(S) {
342
- k.add(S);
340
+ const F = Array.from(arguments), N = /* @__PURE__ */ new Set(), V = /* @__PURE__ */ new Set();
341
+ function M(S) {
342
+ N.add(S);
343
343
  }
344
- function w(S) {
345
- T.add(S);
344
+ function _(S) {
345
+ V.add(S);
346
346
  }
347
- ie(h, {
348
- args: M,
349
- name: $[je],
347
+ se(h, {
348
+ args: F,
349
+ name: D[Me],
350
350
  store: E,
351
- after: F,
352
- onError: w
351
+ after: M,
352
+ onError: _
353
353
  });
354
- let D;
354
+ let O;
355
355
  try {
356
- D = v.apply(this && this.$id === t ? this : E, M);
356
+ O = g.apply(this && this.$id === o ? this : E, F);
357
357
  } catch (S) {
358
- throw ie(T, S), S;
358
+ throw se(V, S), S;
359
359
  }
360
- return D instanceof Promise ? D.then((S) => (ie(k, S), S)).catch((S) => (ie(T, S), Promise.reject(S))) : (ie(k, D), D);
360
+ return O instanceof Promise ? O.then((S) => (se(N, S), S)).catch((S) => (se(V, S), Promise.reject(S))) : (se(N, O), O);
361
361
  };
362
- return $[rt] = !0, $[je] = g, $;
363
- }, G = /* @__PURE__ */ he({
362
+ return D[rt] = !0, D[Me] = y, D;
363
+ }, L = /* @__PURE__ */ he({
364
364
  actions: {},
365
365
  getters: {},
366
366
  state: [],
367
- hotState: O
368
- }), z = {
367
+ hotState: k
368
+ }), J = {
369
369
  _p: n,
370
370
  // _s: scope,
371
- $id: t,
371
+ $id: o,
372
372
  $onAction: nt.bind(null, h),
373
- $patch: x,
374
- $reset: H,
375
- $subscribe(v, g = {}) {
376
- const $ = nt(b, v, g.detached, () => M()), M = a.run(() => L(() => n.state.value[t], (k) => {
377
- (g.flush === "sync" ? p : f) && v({
378
- storeId: t,
373
+ $patch: P,
374
+ $reset: Z,
375
+ $subscribe(g, y = {}) {
376
+ const D = nt(v, g, y.detached, () => F()), F = s.run(() => H(() => n.state.value[o], (N) => {
377
+ (y.flush === "sync" ? b : u) && g({
378
+ storeId: o,
379
379
  type: ve.direct,
380
- events: _
381
- }, k);
382
- }, Z({}, c, g)));
383
- return $;
380
+ events: w
381
+ }, N);
382
+ }, K({}, d, y)));
383
+ return D;
384
384
  },
385
385
  $dispose: U
386
- }, E = mt(process.env.NODE_ENV !== "production" || process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && le ? Z(
386
+ }, E = yt(process.env.NODE_ENV !== "production" || process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && ie ? K(
387
387
  {
388
- _hmrPayload: G,
388
+ _hmrPayload: L,
389
389
  _customProperties: he(/* @__PURE__ */ new Set())
390
390
  // devtools custom properties
391
391
  },
392
- z
392
+ J
393
393
  // must be added later
394
394
  // setupStore
395
- ) : z);
396
- n._s.set(t, E);
397
- const B = (n._a && n._a.runWithContext || eo)(() => n._e.run(() => (a = At()).run(() => e({ action: K }))));
398
- for (const v in B) {
399
- const g = B[v];
400
- if (fe(g) && !at(g) || xe(g))
401
- process.env.NODE_ENV !== "production" && r ? O.value[v] = re(B, v) : i || (m && oo(g) && (fe(g) ? g.value = m[v] : Ke(g, m[v])), n.state.value[t][v] = g), process.env.NODE_ENV !== "production" && G.state.push(v);
402
- else if (typeof g == "function") {
403
- const $ = process.env.NODE_ENV !== "production" && r ? g : K(g, v);
404
- B[v] = $, process.env.NODE_ENV !== "production" && (G.actions[v] = g), u.actions[v] = g;
405
- } else process.env.NODE_ENV !== "production" && at(g) && (G.getters[v] = i ? (
395
+ ) : J);
396
+ n._s.set(o, E);
397
+ const B = (n._a && n._a.runWithContext || Xt)(() => n._e.run(() => (s = Ct()).run(() => e({ action: G }))));
398
+ for (const g in B) {
399
+ const y = B[g];
400
+ if (pe(y) && !at(y) || Pe(y))
401
+ process.env.NODE_ENV !== "production" && r ? k.value[g] = re(B, g) : a || (m && eo(y) && (pe(y) ? y.value = m[g] : qe(y, m[g])), n.state.value[o][g] = y), process.env.NODE_ENV !== "production" && L.state.push(g);
402
+ else if (typeof y == "function") {
403
+ const D = process.env.NODE_ENV !== "production" && r ? y : G(y, g);
404
+ B[g] = D, process.env.NODE_ENV !== "production" && (L.actions[g] = y), c.actions[g] = y;
405
+ } else process.env.NODE_ENV !== "production" && at(y) && (L.getters[g] = a ? (
406
406
  // @ts-expect-error
407
- o.getters[v]
408
- ) : g, le && (B._getters || // @ts-expect-error: same
409
- (B._getters = he([]))).push(v));
407
+ t.getters[g]
408
+ ) : y, ie && (B._getters || // @ts-expect-error: same
409
+ (B._getters = he([]))).push(g));
410
410
  }
411
- if (Z(E, B), Z(vt(E), B), Object.defineProperty(E, "$state", {
412
- get: () => process.env.NODE_ENV !== "production" && r ? O.value : n.state.value[t],
413
- set: (v) => {
411
+ if (K(E, B), K(vt(E), B), Object.defineProperty(E, "$state", {
412
+ get: () => process.env.NODE_ENV !== "production" && r ? k.value : n.state.value[o],
413
+ set: (g) => {
414
414
  if (process.env.NODE_ENV !== "production" && r)
415
415
  throw new Error("cannot set hotState");
416
- x((g) => {
417
- Z(g, v);
416
+ P((y) => {
417
+ K(y, g);
418
418
  });
419
419
  }
420
- }), process.env.NODE_ENV !== "production" && (E._hotUpdate = he((v) => {
421
- E._hotUpdating = !0, v._hmrPayload.state.forEach((g) => {
422
- if (g in E.$state) {
423
- const $ = v.$state[g], M = E.$state[g];
424
- typeof $ == "object" && se($) && se(M) ? Et($, M) : v.$state[g] = M;
420
+ }), process.env.NODE_ENV !== "production" && (E._hotUpdate = he((g) => {
421
+ E._hotUpdating = !0, g._hmrPayload.state.forEach((y) => {
422
+ if (y in E.$state) {
423
+ const D = g.$state[y], F = E.$state[y];
424
+ typeof D == "object" && ae(D) && ae(F) ? _t(D, F) : g.$state[y] = F;
425
425
  }
426
- E[g] = re(v.$state, g);
427
- }), Object.keys(E.$state).forEach((g) => {
428
- g in v.$state || delete E[g];
429
- }), f = !1, p = !1, n.state.value[t] = re(v._hmrPayload, "hotState"), p = !0, ae().then(() => {
430
- f = !0;
426
+ E[y] = re(g.$state, y);
427
+ }), Object.keys(E.$state).forEach((y) => {
428
+ y in g.$state || delete E[y];
429
+ }), u = !1, b = !1, n.state.value[o] = re(g._hmrPayload, "hotState"), b = !0, de().then(() => {
430
+ u = !0;
431
431
  });
432
- for (const g in v._hmrPayload.actions) {
433
- const $ = v[g];
434
- E[g] = //
435
- K($, g);
432
+ for (const y in g._hmrPayload.actions) {
433
+ const D = g[y];
434
+ E[y] = //
435
+ G(D, y);
436
436
  }
437
- for (const g in v._hmrPayload.getters) {
438
- const $ = v._hmrPayload.getters[g], M = i ? (
437
+ for (const y in g._hmrPayload.getters) {
438
+ const D = g._hmrPayload.getters[y], F = a ? (
439
439
  // special handling of options api
440
- I(() => (Ce(n), $.call(E, E)))
441
- ) : $;
442
- E[g] = //
443
- M;
440
+ R(() => (Ce(n), D.call(E, E)))
441
+ ) : D;
442
+ E[y] = //
443
+ F;
444
444
  }
445
- Object.keys(E._hmrPayload.getters).forEach((g) => {
446
- g in v._hmrPayload.getters || delete E[g];
447
- }), Object.keys(E._hmrPayload.actions).forEach((g) => {
448
- g in v._hmrPayload.actions || delete E[g];
449
- }), E._hmrPayload = v._hmrPayload, E._getters = v._getters, E._hotUpdating = !1;
450
- })), process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && le) {
451
- const v = {
445
+ Object.keys(E._hmrPayload.getters).forEach((y) => {
446
+ y in g._hmrPayload.getters || delete E[y];
447
+ }), Object.keys(E._hmrPayload.actions).forEach((y) => {
448
+ y in g._hmrPayload.actions || delete E[y];
449
+ }), E._hmrPayload = g._hmrPayload, E._getters = g._getters, E._hotUpdating = !1;
450
+ })), process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && ie) {
451
+ const g = {
452
452
  writable: !0,
453
453
  configurable: !0,
454
454
  // avoid warning on devtools trying to display this property
455
455
  enumerable: !1
456
456
  };
457
- ["_p", "_hmrPayload", "_getters", "_customProperties"].forEach((g) => {
458
- Object.defineProperty(E, g, Z({ value: E[g] }, v));
457
+ ["_p", "_hmrPayload", "_getters", "_customProperties"].forEach((y) => {
458
+ Object.defineProperty(E, y, K({ value: E[y] }, g));
459
459
  });
460
460
  }
461
- return n._p.forEach((v) => {
462
- if (process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && le) {
463
- const g = a.run(() => v({
461
+ return n._p.forEach((g) => {
462
+ if (process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && ie) {
463
+ const y = s.run(() => g({
464
464
  store: E,
465
465
  app: n._a,
466
466
  pinia: n,
467
- options: u
467
+ options: c
468
468
  }));
469
- Object.keys(g || {}).forEach(($) => E._customProperties.add($)), Z(E, g);
469
+ Object.keys(y || {}).forEach((D) => E._customProperties.add(D)), K(E, y);
470
470
  } else
471
- Z(E, a.run(() => v({
471
+ K(E, s.run(() => g({
472
472
  store: E,
473
473
  app: n._a,
474
474
  pinia: n,
475
- options: u
475
+ options: c
476
476
  })));
477
477
  }), process.env.NODE_ENV !== "production" && E.$state && typeof E.$state == "object" && typeof E.$state.constructor == "function" && !E.$state.constructor.toString().includes("[native code]") && console.warn(`[🍍]: The "state" must be a plain object. It cannot be
478
478
  state: () => new MyClass()
479
- Found in store "${E.$id}".`), m && i && o.hydrate && o.hydrate(E.$state, m), f = !0, p = !0, E;
479
+ Found in store "${E.$id}".`), m && a && t.hydrate && t.hydrate(E.$state, m), u = !0, b = !0, E;
480
480
  }
481
481
  // @__NO_SIDE_EFFECTS__
482
- function no(t, e, o) {
482
+ function to(o, e, t) {
483
483
  let n;
484
484
  const r = typeof e == "function";
485
- n = r ? o : e;
486
- function i(a, u) {
487
- const c = ze();
488
- if (a = // in test mode, ignore the argument provided as we can always retrieve a
485
+ n = r ? t : e;
486
+ function a(s, c) {
487
+ const d = Ge();
488
+ if (s = // in test mode, ignore the argument provided as we can always retrieve a
489
489
  // pinia instance with getActivePinia()
490
- (process.env.NODE_ENV === "test" && oe && oe._testing ? null : a) || (c ? be(Je, null) : null), a && Ce(a), process.env.NODE_ENV !== "production" && !oe)
490
+ (process.env.NODE_ENV === "test" && oe && oe._testing ? null : s) || (d ? be(Ke, null) : null), s && Ce(s), process.env.NODE_ENV !== "production" && !oe)
491
491
  throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
492
492
  See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
493
493
  This will fail in production.`);
494
- a = oe, a._s.has(t) || (r ? qe(t, e, n, a) : st(t, n, a), process.env.NODE_ENV !== "production" && (i._pinia = a));
495
- const f = a._s.get(t);
496
- if (process.env.NODE_ENV !== "production" && u) {
497
- const p = "__hot:" + t, b = r ? qe(p, e, n, a, !0) : st(p, Z({}, n), a, !0);
498
- u._hotUpdate(b), delete a.state.value[p], a._s.delete(p);
494
+ s = oe, s._s.has(o) || (r ? Ze(o, e, n, s) : st(o, n, s), process.env.NODE_ENV !== "production" && (a._pinia = s));
495
+ const u = s._s.get(o);
496
+ if (process.env.NODE_ENV !== "production" && c) {
497
+ const b = "__hot:" + o, v = r ? Ze(b, e, n, s, !0) : st(b, K({}, n), s, !0);
498
+ c._hotUpdate(v), delete s.state.value[b], s._s.delete(b);
499
499
  }
500
- if (process.env.NODE_ENV !== "production" && le) {
501
- const p = gt();
502
- if (p && p.proxy && // avoid adding stores that are just built for hot module replacement
503
- !u) {
504
- const b = p.proxy, h = "_pStores" in b ? b._pStores : b._pStores = {};
505
- h[t] = f;
500
+ if (process.env.NODE_ENV !== "production" && ie) {
501
+ const b = gt();
502
+ if (b && b.proxy && // avoid adding stores that are just built for hot module replacement
503
+ !c) {
504
+ const v = b.proxy, h = "_pStores" in v ? v._pStores : v._pStores = {};
505
+ h[o] = u;
506
506
  }
507
507
  }
508
- return f;
508
+ return u;
509
509
  }
510
- return i.$id = t, i;
510
+ return a.$id = o, a;
511
511
  }
512
- function ro(t) {
513
- const e = vt(t), o = {};
512
+ function oo(o) {
513
+ const e = vt(o), t = {};
514
514
  for (const n in e) {
515
515
  const r = e[n];
516
- r.effect ? o[n] = // ...
517
- I({
518
- get: () => t[n],
519
- set(i) {
520
- t[n] = i;
516
+ r.effect ? t[n] = // ...
517
+ R({
518
+ get: () => o[n],
519
+ set(a) {
520
+ o[n] = a;
521
521
  }
522
- }) : (fe(r) || xe(r)) && (o[n] = // ---
523
- re(t, n));
522
+ }) : (pe(r) || Pe(r)) && (t[n] = // ---
523
+ re(o, n));
524
524
  }
525
- return o;
525
+ return t;
526
526
  }
527
- const ao = typeof window < "u" && typeof document < "u";
527
+ const no = typeof window < "u" && typeof document < "u";
528
528
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
529
- const so = Object.prototype.toString, io = (t) => so.call(t) === "[object Object]", lo = () => {
529
+ const ro = Object.prototype.toString, ao = (o) => ro.call(o) === "[object Object]", so = () => {
530
530
  };
531
- function co(...t) {
532
- if (t.length !== 1) return re(...t);
533
- const e = t[0];
534
- return typeof e == "function" ? Te(Ye(() => ({
531
+ function io(...o) {
532
+ if (o.length !== 1) return re(...o);
533
+ const e = o[0];
534
+ return typeof e == "function" ? Te(et(() => ({
535
535
  get: e,
536
- set: lo
536
+ set: so
537
537
  }))) : C(e);
538
538
  }
539
- function uo(t, e) {
540
- function o(...n) {
541
- return new Promise((r, i) => {
542
- Promise.resolve(t(() => e.apply(this, n), {
539
+ function lo(o, e) {
540
+ function t(...n) {
541
+ return new Promise((r, a) => {
542
+ Promise.resolve(o(() => e.apply(this, n), {
543
543
  fn: e,
544
544
  thisArg: this,
545
545
  args: n
546
- })).then(r).catch(i);
546
+ })).then(r).catch(a);
547
547
  });
548
548
  }
549
- return o;
549
+ return t;
550
550
  }
551
- const kt = (t) => t();
552
- function fo(t = kt, e = {}) {
553
- const { initialState: o = "active" } = e, n = co(o === "active");
551
+ const kt = (o) => o();
552
+ function co(o = kt, e = {}) {
553
+ const { initialState: t = "active" } = e, n = io(t === "active");
554
554
  function r() {
555
555
  n.value = !1;
556
556
  }
557
- function i() {
557
+ function a() {
558
558
  n.value = !0;
559
559
  }
560
- const a = (...u) => {
561
- n.value && t(...u);
560
+ const s = (...c) => {
561
+ n.value && o(...c);
562
562
  };
563
563
  return {
564
564
  isActive: Te(n),
565
565
  pause: r,
566
- resume: i,
567
- eventFilter: a
566
+ resume: a,
567
+ eventFilter: s
568
568
  };
569
569
  }
570
- function Me(t) {
571
- return Array.isArray(t) ? t : [t];
570
+ function Fe(o) {
571
+ return Array.isArray(o) ? o : [o];
572
572
  }
573
- function po(t) {
573
+ function uo(o) {
574
574
  return gt();
575
575
  }
576
- function ho(t, e, o = {}) {
577
- const { eventFilter: n = kt, ...r } = o;
578
- return L(t, uo(n, e), r);
576
+ function po(o, e, t = {}) {
577
+ const { eventFilter: n = kt, ...r } = t;
578
+ return H(o, lo(n, e), r);
579
579
  }
580
- function vo(t, e, o = {}) {
581
- const { eventFilter: n, initialState: r = "active", ...i } = o, { eventFilter: a, pause: u, resume: c, isActive: f } = fo(n, { initialState: r });
580
+ function fo(o, e, t = {}) {
581
+ const { eventFilter: n, initialState: r = "active", ...a } = t, { eventFilter: s, pause: c, resume: d, isActive: u } = co(n, { initialState: r });
582
582
  return {
583
- stop: ho(t, e, {
584
- ...i,
585
- eventFilter: a
583
+ stop: po(o, e, {
584
+ ...a,
585
+ eventFilter: s
586
586
  }),
587
- pause: u,
588
- resume: c,
589
- isActive: f
587
+ pause: c,
588
+ resume: d,
589
+ isActive: u
590
590
  };
591
591
  }
592
- function go(t, e = !0, o) {
593
- po() ? Ae(t, o) : e ? t() : ae(t);
592
+ function ho(o, e = !0, t) {
593
+ uo() ? xe(o, t) : e ? o() : de(o);
594
594
  }
595
- function mo(t, e, o) {
596
- return L(t, e, {
597
- ...o,
595
+ function vo(o, e, t) {
596
+ return H(o, e, {
597
+ ...t,
598
598
  immediate: !0
599
599
  });
600
600
  }
601
- const Re = ao ? window : void 0;
602
- function yo(t) {
601
+ const Ie = no ? window : void 0;
602
+ function go(o) {
603
603
  var e;
604
- const o = Q(t);
605
- return (e = o?.$el) !== null && e !== void 0 ? e : o;
604
+ const t = q(o);
605
+ return (e = t?.$el) !== null && e !== void 0 ? e : t;
606
606
  }
607
- function it(...t) {
608
- const e = (n, r, i, a) => (n.addEventListener(r, i, a), () => n.removeEventListener(r, i, a)), o = I(() => {
609
- const n = Me(Q(t[0])).filter((r) => r != null);
607
+ function it(...o) {
608
+ const e = (n, r, a, s) => (n.addEventListener(r, a, s), () => n.removeEventListener(r, a, s)), t = R(() => {
609
+ const n = Fe(q(o[0])).filter((r) => r != null);
610
610
  return n.every((r) => typeof r != "string") ? n : void 0;
611
611
  });
612
- return mo(() => {
612
+ return vo(() => {
613
613
  var n, r;
614
614
  return [
615
- (n = (r = o.value) === null || r === void 0 ? void 0 : r.map((i) => yo(i))) !== null && n !== void 0 ? n : [Re].filter((i) => i != null),
616
- Me(Q(o.value ? t[1] : t[0])),
617
- Me(De(o.value ? t[2] : t[1])),
618
- Q(o.value ? t[3] : t[2])
615
+ (n = (r = t.value) === null || r === void 0 ? void 0 : r.map((a) => go(a))) !== null && n !== void 0 ? n : [Ie].filter((a) => a != null),
616
+ Fe(q(t.value ? o[1] : o[0])),
617
+ Fe(Ne(t.value ? o[2] : o[1])),
618
+ q(t.value ? o[3] : o[2])
619
619
  ];
620
- }, ([n, r, i, a], u, c) => {
621
- if (!n?.length || !r?.length || !i?.length) return;
622
- const f = io(a) ? { ...a } : a, p = n.flatMap((b) => r.flatMap((h) => i.map((_) => e(b, h, _, f))));
623
- c(() => {
624
- p.forEach((b) => b());
620
+ }, ([n, r, a, s], c, d) => {
621
+ if (!n?.length || !r?.length || !a?.length) return;
622
+ const u = ao(s) ? { ...s } : s, b = n.flatMap((v) => r.flatMap((h) => a.map((w) => e(v, h, w, u))));
623
+ d(() => {
624
+ b.forEach((v) => v());
625
625
  });
626
626
  }, { flush: "post" });
627
627
  }
628
- const Ee = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, _e = "__vueuse_ssr_handlers__", bo = /* @__PURE__ */ wo();
629
- function wo() {
630
- return _e in Ee || (Ee[_e] = Ee[_e] || {}), Ee[_e];
628
+ const Ee = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, ke = "__vueuse_ssr_handlers__", yo = /* @__PURE__ */ mo();
629
+ function mo() {
630
+ return ke in Ee || (Ee[ke] = Ee[ke] || {}), Ee[ke];
631
631
  }
632
- function So(t, e) {
633
- return bo[t] || e;
632
+ function bo(o, e) {
633
+ return yo[o] || e;
634
634
  }
635
- function Eo(t) {
636
- return t == null ? "any" : t instanceof Set ? "set" : t instanceof Map ? "map" : t instanceof Date ? "date" : typeof t == "boolean" ? "boolean" : typeof t == "string" ? "string" : typeof t == "object" ? "object" : Number.isNaN(t) ? "any" : "number";
635
+ function wo(o) {
636
+ return o == null ? "any" : o instanceof Set ? "set" : o instanceof Map ? "map" : o instanceof Date ? "date" : typeof o == "boolean" ? "boolean" : typeof o == "string" ? "string" : typeof o == "object" ? "object" : Number.isNaN(o) ? "any" : "number";
637
637
  }
638
- const _o = {
638
+ const So = {
639
639
  boolean: {
640
- read: (t) => t === "true",
641
- write: (t) => String(t)
640
+ read: (o) => o === "true",
641
+ write: (o) => String(o)
642
642
  },
643
643
  object: {
644
- read: (t) => JSON.parse(t),
645
- write: (t) => JSON.stringify(t)
644
+ read: (o) => JSON.parse(o),
645
+ write: (o) => JSON.stringify(o)
646
646
  },
647
647
  number: {
648
- read: (t) => Number.parseFloat(t),
649
- write: (t) => String(t)
648
+ read: (o) => Number.parseFloat(o),
649
+ write: (o) => String(o)
650
650
  },
651
651
  any: {
652
- read: (t) => t,
653
- write: (t) => String(t)
652
+ read: (o) => o,
653
+ write: (o) => String(o)
654
654
  },
655
655
  string: {
656
- read: (t) => t,
657
- write: (t) => String(t)
656
+ read: (o) => o,
657
+ write: (o) => String(o)
658
658
  },
659
659
  map: {
660
- read: (t) => new Map(JSON.parse(t)),
661
- write: (t) => JSON.stringify(Array.from(t.entries()))
660
+ read: (o) => new Map(JSON.parse(o)),
661
+ write: (o) => JSON.stringify(Array.from(o.entries()))
662
662
  },
663
663
  set: {
664
- read: (t) => new Set(JSON.parse(t)),
665
- write: (t) => JSON.stringify(Array.from(t))
664
+ read: (o) => new Set(JSON.parse(o)),
665
+ write: (o) => JSON.stringify(Array.from(o))
666
666
  },
667
667
  date: {
668
- read: (t) => new Date(t),
669
- write: (t) => t.toISOString()
668
+ read: (o) => new Date(o),
669
+ write: (o) => o.toISOString()
670
670
  }
671
671
  }, lt = "vueuse-storage";
672
- function ko(t, e, o, n = {}) {
672
+ function _o(o, e, t, n = {}) {
673
673
  var r;
674
- const { flush: i = "pre", deep: a = !0, listenToStorageChanges: u = !0, writeDefaults: c = !0, mergeDefaults: f = !1, shallow: p, window: b = Re, eventFilter: h, onError: _ = (k) => {
675
- console.error(k);
676
- }, initOnMounted: m } = n, O = (p ? Se : C)(e), R = I(() => Q(t));
677
- if (!o) try {
678
- o = So("getDefaultStorage", () => Re?.localStorage)();
679
- } catch (k) {
680
- _(k);
681
- }
682
- if (!o) return O;
683
- const x = Q(e), H = Eo(x), U = (r = n.serializer) !== null && r !== void 0 ? r : _o[H], { pause: K, resume: G } = vo(O, (k) => v(k), {
684
- flush: i,
685
- deep: a,
674
+ const { flush: a = "pre", deep: s = !0, listenToStorageChanges: c = !0, writeDefaults: d = !0, mergeDefaults: u = !1, shallow: b, window: v = Ie, eventFilter: h, onError: w = (N) => {
675
+ console.error(N);
676
+ }, initOnMounted: m } = n, k = (b ? Se : C)(e), I = R(() => q(o));
677
+ if (!t) try {
678
+ t = bo("getDefaultStorage", () => Ie?.localStorage)();
679
+ } catch (N) {
680
+ w(N);
681
+ }
682
+ if (!t) return k;
683
+ const P = q(e), Z = wo(P), U = (r = n.serializer) !== null && r !== void 0 ? r : So[Z], { pause: G, resume: L } = fo(k, (N) => g(N), {
684
+ flush: a,
685
+ deep: s,
686
686
  eventFilter: h
687
687
  });
688
- L(R, () => $(), { flush: i });
689
- let z = !1;
690
- const E = (k) => {
691
- m && !z || $(k);
692
- }, Y = (k) => {
693
- m && !z || M(k);
688
+ H(I, () => D(), { flush: a });
689
+ let J = !1;
690
+ const E = (N) => {
691
+ m && !J || D(N);
692
+ }, Y = (N) => {
693
+ m && !J || F(N);
694
694
  };
695
- b && u && (o instanceof Storage ? it(b, "storage", E, { passive: !0 }) : it(b, lt, Y)), m ? go(() => {
696
- z = !0, $();
697
- }) : $();
698
- function B(k, T) {
699
- if (b) {
700
- const F = {
701
- key: R.value,
702
- oldValue: k,
703
- newValue: T,
704
- storageArea: o
695
+ v && c && (t instanceof Storage ? it(v, "storage", E, { passive: !0 }) : it(v, lt, Y)), m ? ho(() => {
696
+ J = !0, D();
697
+ }) : D();
698
+ function B(N, V) {
699
+ if (v) {
700
+ const M = {
701
+ key: I.value,
702
+ oldValue: N,
703
+ newValue: V,
704
+ storageArea: t
705
705
  };
706
- b.dispatchEvent(o instanceof Storage ? new StorageEvent("storage", F) : new CustomEvent(lt, { detail: F }));
706
+ v.dispatchEvent(t instanceof Storage ? new StorageEvent("storage", M) : new CustomEvent(lt, { detail: M }));
707
707
  }
708
708
  }
709
- function v(k) {
709
+ function g(N) {
710
710
  try {
711
- const T = o.getItem(R.value);
712
- if (k == null)
713
- B(T, null), o.removeItem(R.value);
711
+ const V = t.getItem(I.value);
712
+ if (N == null)
713
+ B(V, null), t.removeItem(I.value);
714
714
  else {
715
- const F = U.write(k);
716
- T !== F && (o.setItem(R.value, F), B(T, F));
715
+ const M = U.write(N);
716
+ V !== M && (t.setItem(I.value, M), B(V, M));
717
717
  }
718
- } catch (T) {
719
- _(T);
718
+ } catch (V) {
719
+ w(V);
720
720
  }
721
721
  }
722
- function g(k) {
723
- const T = k ? k.newValue : o.getItem(R.value);
724
- if (T == null)
725
- return c && x != null && o.setItem(R.value, U.write(x)), x;
726
- if (!k && f) {
727
- const F = U.read(T);
728
- return typeof f == "function" ? f(F, x) : H === "object" && !Array.isArray(F) ? {
729
- ...x,
730
- ...F
731
- } : F;
732
- } else return typeof T != "string" ? T : U.read(T);
733
- }
734
- function $(k) {
735
- if (!(k && k.storageArea !== o)) {
736
- if (k && k.key == null) {
737
- O.value = x;
722
+ function y(N) {
723
+ const V = N ? N.newValue : t.getItem(I.value);
724
+ if (V == null)
725
+ return d && P != null && t.setItem(I.value, U.write(P)), P;
726
+ if (!N && u) {
727
+ const M = U.read(V);
728
+ return typeof u == "function" ? u(M, P) : Z === "object" && !Array.isArray(M) ? {
729
+ ...P,
730
+ ...M
731
+ } : M;
732
+ } else return typeof V != "string" ? V : U.read(V);
733
+ }
734
+ function D(N) {
735
+ if (!(N && N.storageArea !== t)) {
736
+ if (N && N.key == null) {
737
+ k.value = P;
738
738
  return;
739
739
  }
740
- if (!(k && k.key !== R.value)) {
741
- K();
740
+ if (!(N && N.key !== I.value)) {
741
+ G();
742
742
  try {
743
- const T = U.write(O.value);
744
- (k === void 0 || k?.newValue !== T) && (O.value = g(k));
745
- } catch (T) {
746
- _(T);
743
+ const V = U.write(k.value);
744
+ (N === void 0 || N?.newValue !== V) && (k.value = y(N));
745
+ } catch (V) {
746
+ w(V);
747
747
  } finally {
748
- k ? ae(G) : G();
748
+ N ? de(L) : L();
749
749
  }
750
750
  }
751
751
  }
752
752
  }
753
- function M(k) {
754
- $(k.detail);
753
+ function F(N) {
754
+ D(N.detail);
755
755
  }
756
- return O;
756
+ return k;
757
757
  }
758
- function Do(t, e, o = {}) {
759
- const { window: n = Re } = o;
760
- return ko(t, e, n?.localStorage, o);
758
+ function Eo(o, e, t = {}) {
759
+ const { window: n = Ie } = t;
760
+ return _o(o, e, n?.localStorage, t);
761
761
  }
762
- function Fe() {
762
+ function Le() {
763
763
  return typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
764
764
  }
765
- function ke(t) {
765
+ function Oe(o) {
766
766
  const e = {
767
- type: t.type,
768
- clientId: t.clientId,
769
- timestamp: t.timestamp.toISOString()
770
- };
771
- return t.operation && (e.operation = {
772
- ...t.operation,
773
- timestamp: t.operation.timestamp.toISOString()
774
- }), t.operations && (e.operations = t.operations.map((o) => ({
775
- ...o,
767
+ type: o.type,
768
+ clientId: o.clientId,
776
769
  timestamp: o.timestamp.toISOString()
770
+ };
771
+ return o.operation && (e.operation = {
772
+ ...o.operation,
773
+ timestamp: o.operation.timestamp.toISOString()
774
+ }), o.operations && (e.operations = o.operations.map((t) => ({
775
+ ...t,
776
+ timestamp: t.timestamp.toISOString()
777
777
  }))), e;
778
778
  }
779
- function Oo(t) {
779
+ function ko(o) {
780
780
  const e = {
781
- type: t.type,
782
- clientId: t.clientId,
783
- timestamp: new Date(t.timestamp)
784
- };
785
- return t.operation && (e.operation = {
786
- ...t.operation,
787
- timestamp: new Date(t.operation.timestamp)
788
- }), t.operations && (e.operations = t.operations.map((o) => ({
789
- ...o,
781
+ type: o.type,
782
+ clientId: o.clientId,
790
783
  timestamp: new Date(o.timestamp)
784
+ };
785
+ return o.operation && (e.operation = {
786
+ ...o.operation,
787
+ timestamp: new Date(o.operation.timestamp)
788
+ }), o.operations && (e.operations = o.operations.map((t) => ({
789
+ ...t,
790
+ timestamp: new Date(t.timestamp)
791
791
  }))), e;
792
792
  }
793
- const Dt = /* @__PURE__ */ no("hst-operation-log", () => {
794
- const t = C({
793
+ const Ot = /* @__PURE__ */ to("hst-operation-log", () => {
794
+ const o = C({
795
795
  maxOperations: 100,
796
796
  enableCrossTabSync: !0,
797
797
  autoSyncInterval: 3e4,
798
798
  enablePersistence: !1,
799
799
  persistenceKeyPrefix: "stonecrop-ops"
800
- }), e = C([]), o = C(-1), n = C(Fe()), r = C(!1), i = C([]), a = C(null), u = I(() => o.value < 0 ? !1 : e.value[o.value]?.reversible ?? !1), c = I(() => o.value < e.value.length - 1), f = I(() => {
801
- let d = 0;
802
- for (let s = o.value; s >= 0 && e.value[s]?.reversible; s--)
803
- d++;
804
- return d;
805
- }), p = I(() => e.value.length - 1 - o.value), b = I(() => ({
806
- canUndo: u.value,
807
- canRedo: c.value,
808
- undoCount: f.value,
809
- redoCount: p.value,
810
- currentIndex: o.value
800
+ }), e = C([]), t = C(-1), n = C(Le()), r = C(!1), a = C([]), s = C(null), c = R(() => t.value < 0 ? !1 : e.value[t.value]?.reversible ?? !1), d = R(() => t.value < e.value.length - 1), u = R(() => {
801
+ let p = 0;
802
+ for (let f = t.value; f >= 0 && e.value[f]?.reversible; f--)
803
+ p++;
804
+ return p;
805
+ }), b = R(() => e.value.length - 1 - t.value), v = R(() => ({
806
+ canUndo: c.value,
807
+ canRedo: d.value,
808
+ undoCount: u.value,
809
+ redoCount: b.value,
810
+ currentIndex: t.value
811
811
  }));
812
- function h(d) {
813
- t.value = { ...t.value, ...d }, t.value.enablePersistence && (w(), S()), t.value.enableCrossTabSync && g();
812
+ function h(p) {
813
+ o.value = { ...o.value, ...p }, o.value.enablePersistence && (_(), S()), o.value.enableCrossTabSync && y();
814
814
  }
815
- function _(d, s = "user") {
816
- const l = {
817
- ...d,
818
- id: Fe(),
815
+ function w(p, f = "user") {
816
+ const i = {
817
+ ...p,
818
+ id: Le(),
819
819
  timestamp: /* @__PURE__ */ new Date(),
820
- source: s,
821
- userId: t.value.userId
820
+ source: f,
821
+ userId: o.value.userId
822
822
  };
823
- if (t.value.operationFilter && !t.value.operationFilter(l))
824
- return l.id;
823
+ if (o.value.operationFilter && !o.value.operationFilter(i))
824
+ return i.id;
825
825
  if (r.value)
826
- return i.value.push(l), l.id;
827
- if (o.value < e.value.length - 1 && (e.value = e.value.slice(0, o.value + 1)), e.value.push(l), o.value++, t.value.maxOperations && e.value.length > t.value.maxOperations) {
828
- const y = e.value.length - t.value.maxOperations;
829
- e.value = e.value.slice(y), o.value -= y;
826
+ return a.value.push(i), i.id;
827
+ if (t.value < e.value.length - 1 && (e.value = e.value.slice(0, t.value + 1)), e.value.push(i), t.value++, o.value.maxOperations && e.value.length > o.value.maxOperations) {
828
+ const l = e.value.length - o.value.maxOperations;
829
+ e.value = e.value.slice(l), t.value -= l;
830
830
  }
831
- return t.value.enableCrossTabSync && $(l), l.id;
831
+ return o.value.enableCrossTabSync && D(i), i.id;
832
832
  }
833
833
  function m() {
834
- r.value = !0, i.value = [], a.value = Fe();
834
+ r.value = !0, a.value = [], s.value = Le();
835
835
  }
836
- function O(d) {
837
- if (!r.value || i.value.length === 0)
838
- return r.value = !1, i.value = [], a.value = null, null;
839
- const s = a.value, l = i.value.every((j) => j.reversible), y = {
840
- id: s,
836
+ function k(p) {
837
+ if (!r.value || a.value.length === 0)
838
+ return r.value = !1, a.value = [], s.value = null, null;
839
+ const f = s.value, i = a.value.every(($) => $.reversible), l = {
840
+ id: f,
841
841
  type: "batch",
842
842
  path: "",
843
843
  // Batch doesn't have a single path
844
844
  fieldname: "",
845
845
  beforeValue: null,
846
846
  afterValue: null,
847
- doctype: i.value[0]?.doctype || "",
847
+ doctype: a.value[0]?.doctype || "",
848
848
  timestamp: /* @__PURE__ */ new Date(),
849
849
  source: "user",
850
- reversible: l,
851
- irreversibleReason: l ? void 0 : "Contains irreversible operations",
852
- childOperationIds: i.value.map((j) => j.id),
853
- metadata: { description: d }
850
+ reversible: i,
851
+ irreversibleReason: i ? void 0 : "Contains irreversible operations",
852
+ childOperationIds: a.value.map(($) => $.id),
853
+ metadata: { description: p }
854
854
  };
855
- i.value.forEach((j) => {
856
- j.parentOperationId = s;
857
- }), e.value.push(...i.value, y), o.value = e.value.length - 1, t.value.enableCrossTabSync && M(i.value, y);
858
- const N = s;
859
- return r.value = !1, i.value = [], a.value = null, N;
860
- }
861
- function R() {
862
- r.value = !1, i.value = [], a.value = null;
863
- }
864
- function x(d) {
865
- if (!u.value) return !1;
866
- const s = e.value[o.value];
867
- if (!s.reversible)
868
- return typeof console < "u" && s.irreversibleReason && console.warn("Cannot undo irreversible operation:", s.irreversibleReason), !1;
855
+ a.value.forEach(($) => {
856
+ $.parentOperationId = f;
857
+ }), e.value.push(...a.value, l), t.value = e.value.length - 1, o.value.enableCrossTabSync && F(a.value, l);
858
+ const A = f;
859
+ return r.value = !1, a.value = [], s.value = null, A;
860
+ }
861
+ function I() {
862
+ r.value = !1, a.value = [], s.value = null;
863
+ }
864
+ function P(p) {
865
+ if (!c.value) return !1;
866
+ const f = e.value[t.value];
867
+ if (!f.reversible)
868
+ return typeof console < "u" && f.irreversibleReason && console.warn("Cannot undo irreversible operation:", f.irreversibleReason), !1;
869
869
  try {
870
- if (s.type === "batch" && s.childOperationIds)
871
- for (let l = s.childOperationIds.length - 1; l >= 0; l--) {
872
- const y = s.childOperationIds[l], N = e.value.find((j) => j.id === y);
873
- N && U(N, d);
870
+ if (f.type === "batch" && f.childOperationIds)
871
+ for (let i = f.childOperationIds.length - 1; i >= 0; i--) {
872
+ const l = f.childOperationIds[i], A = e.value.find(($) => $.id === l);
873
+ A && U(A, p);
874
874
  }
875
875
  else
876
- U(s, d);
877
- return o.value--, t.value.enableCrossTabSync && k(s), !0;
878
- } catch (l) {
879
- return typeof console < "u" && console.error("Undo failed:", l), !1;
876
+ U(f, p);
877
+ return t.value--, o.value.enableCrossTabSync && N(f), !0;
878
+ } catch (i) {
879
+ return typeof console < "u" && console.error("Undo failed:", i), !1;
880
880
  }
881
881
  }
882
- function H(d) {
883
- if (!c.value) return !1;
884
- const s = e.value[o.value + 1];
882
+ function Z(p) {
883
+ if (!d.value) return !1;
884
+ const f = e.value[t.value + 1];
885
885
  try {
886
- if (s.type === "batch" && s.childOperationIds)
887
- for (const l of s.childOperationIds) {
888
- const y = e.value.find((N) => N.id === l);
889
- y && K(y, d);
886
+ if (f.type === "batch" && f.childOperationIds)
887
+ for (const i of f.childOperationIds) {
888
+ const l = e.value.find((A) => A.id === i);
889
+ l && G(l, p);
890
890
  }
891
891
  else
892
- K(s, d);
893
- return o.value++, t.value.enableCrossTabSync && T(s), !0;
894
- } catch (l) {
895
- return typeof console < "u" && console.error("Redo failed:", l), !1;
892
+ G(f, p);
893
+ return t.value++, o.value.enableCrossTabSync && V(f), !0;
894
+ } catch (i) {
895
+ return typeof console < "u" && console.error("Redo failed:", i), !1;
896
896
  }
897
897
  }
898
- function U(d, s) {
899
- (d.type === "set" || d.type === "delete") && s && typeof s.set == "function" && s.set(d.path, d.beforeValue, "undo");
898
+ function U(p, f) {
899
+ (p.type === "set" || p.type === "delete") && f && typeof f.set == "function" && f.set(p.path, p.beforeValue, "undo");
900
900
  }
901
- function K(d, s) {
902
- (d.type === "set" || d.type === "delete") && s && typeof s.set == "function" && s.set(d.path, d.afterValue, "redo");
901
+ function G(p, f) {
902
+ (p.type === "set" || p.type === "delete") && f && typeof f.set == "function" && f.set(p.path, p.afterValue, "redo");
903
903
  }
904
- function G() {
905
- const d = e.value.filter((l) => l.reversible).length, s = e.value.map((l) => l.timestamp);
904
+ function L() {
905
+ const p = e.value.filter((i) => i.reversible).length, f = e.value.map((i) => i.timestamp);
906
906
  return {
907
907
  operations: [...e.value],
908
- currentIndex: o.value,
908
+ currentIndex: t.value,
909
909
  totalOperations: e.value.length,
910
- reversibleOperations: d,
911
- irreversibleOperations: e.value.length - d,
912
- oldestOperation: s.length > 0 ? new Date(Math.min(...s.map((l) => l.getTime()))) : void 0,
913
- newestOperation: s.length > 0 ? new Date(Math.max(...s.map((l) => l.getTime()))) : void 0
910
+ reversibleOperations: p,
911
+ irreversibleOperations: e.value.length - p,
912
+ oldestOperation: f.length > 0 ? new Date(Math.min(...f.map((i) => i.getTime()))) : void 0,
913
+ newestOperation: f.length > 0 ? new Date(Math.max(...f.map((i) => i.getTime()))) : void 0
914
914
  };
915
915
  }
916
- function z() {
917
- e.value = [], o.value = -1;
916
+ function J() {
917
+ e.value = [], t.value = -1;
918
918
  }
919
- function E(d, s) {
920
- return e.value.filter((l) => l.doctype === d && (s === void 0 || l.recordId === s));
919
+ function E(p, f) {
920
+ return e.value.filter((i) => i.doctype === p && (f === void 0 || i.recordId === f));
921
921
  }
922
- function Y(d, s) {
923
- const l = e.value.find((y) => y.id === d);
924
- l && (l.reversible = !1, l.irreversibleReason = s);
922
+ function Y(p, f) {
923
+ const i = e.value.find((l) => l.id === p);
924
+ i && (i.reversible = !1, i.irreversibleReason = f);
925
925
  }
926
- function B(d, s, l, y = "success", N) {
927
- const j = {
926
+ function B(p, f, i, l = "success", A) {
927
+ const $ = {
928
928
  type: "action",
929
- path: l && l.length > 0 ? `${d}.${l[0]}` : d,
929
+ path: i && i.length > 0 ? `${p}.${i[0]}` : p,
930
930
  fieldname: "",
931
931
  beforeValue: null,
932
932
  afterValue: null,
933
- doctype: d,
934
- recordId: l && l.length > 0 ? l[0] : void 0,
933
+ doctype: p,
934
+ recordId: i && i.length > 0 ? i[0] : void 0,
935
935
  reversible: !1,
936
936
  // Actions are typically not reversible
937
- actionName: s,
938
- actionRecordIds: l,
939
- actionResult: y,
940
- actionError: N
937
+ actionName: f,
938
+ actionRecordIds: i,
939
+ actionResult: l,
940
+ actionError: A
941
941
  };
942
- return _(j);
943
- }
944
- let v = null;
945
- function g() {
946
- typeof window > "u" || !window.BroadcastChannel || (v = new BroadcastChannel("stonecrop-operation-log"), v.addEventListener("message", (d) => {
947
- const s = d.data;
948
- if (!s || typeof s != "object") return;
949
- const l = Oo(s);
950
- l.clientId !== n.value && (l.type === "operation" && l.operation ? (e.value.push({ ...l.operation, source: "sync" }), o.value = e.value.length - 1) : l.type === "operation" && l.operations && (e.value.push(...l.operations.map((y) => ({ ...y, source: "sync" }))), o.value = e.value.length - 1));
942
+ return w($);
943
+ }
944
+ let g = null;
945
+ function y() {
946
+ typeof window > "u" || !window.BroadcastChannel || (g = new BroadcastChannel("stonecrop-operation-log"), g.addEventListener("message", (p) => {
947
+ const f = p.data;
948
+ if (!f || typeof f != "object") return;
949
+ const i = ko(f);
950
+ i.clientId !== n.value && (i.type === "operation" && i.operation ? (e.value.push({ ...i.operation, source: "sync" }), t.value = e.value.length - 1) : i.type === "operation" && i.operations && (e.value.push(...i.operations.map((l) => ({ ...l, source: "sync" }))), t.value = e.value.length - 1));
951
951
  }));
952
952
  }
953
- function $(d) {
954
- if (!v) return;
955
- const s = {
953
+ function D(p) {
954
+ if (!g) return;
955
+ const f = {
956
956
  type: "operation",
957
- operation: d,
957
+ operation: p,
958
958
  clientId: n.value,
959
959
  timestamp: /* @__PURE__ */ new Date()
960
960
  };
961
- v.postMessage(ke(s));
961
+ g.postMessage(Oe(f));
962
962
  }
963
- function M(d, s) {
964
- if (!v) return;
965
- const l = {
963
+ function F(p, f) {
964
+ if (!g) return;
965
+ const i = {
966
966
  type: "operation",
967
- operations: [...d, s],
967
+ operations: [...p, f],
968
968
  clientId: n.value,
969
969
  timestamp: /* @__PURE__ */ new Date()
970
970
  };
971
- v.postMessage(ke(l));
971
+ g.postMessage(Oe(i));
972
972
  }
973
- function k(d) {
974
- if (!v) return;
975
- const s = {
973
+ function N(p) {
974
+ if (!g) return;
975
+ const f = {
976
976
  type: "undo",
977
- operation: d,
977
+ operation: p,
978
978
  clientId: n.value,
979
979
  timestamp: /* @__PURE__ */ new Date()
980
980
  };
981
- v.postMessage(ke(s));
981
+ g.postMessage(Oe(f));
982
982
  }
983
- function T(d) {
984
- if (!v) return;
985
- const s = {
983
+ function V(p) {
984
+ if (!g) return;
985
+ const f = {
986
986
  type: "redo",
987
- operation: d,
987
+ operation: p,
988
988
  clientId: n.value,
989
989
  timestamp: /* @__PURE__ */ new Date()
990
990
  };
991
- v.postMessage(ke(s));
991
+ g.postMessage(Oe(f));
992
992
  }
993
- const F = Do("stonecrop-ops-operations", null, {
993
+ const M = Eo("stonecrop-ops-operations", null, {
994
994
  serializer: {
995
- read: (d) => {
995
+ read: (p) => {
996
996
  try {
997
- return JSON.parse(d);
997
+ return JSON.parse(p);
998
998
  } catch {
999
999
  return null;
1000
1000
  }
1001
1001
  },
1002
- write: (d) => d ? JSON.stringify(d) : ""
1002
+ write: (p) => p ? JSON.stringify(p) : ""
1003
1003
  }
1004
1004
  });
1005
- function w() {
1005
+ function _() {
1006
1006
  if (!(typeof window > "u"))
1007
1007
  try {
1008
- const d = F.value;
1009
- d && Array.isArray(d.operations) && (e.value = d.operations.map((s) => ({
1010
- ...s,
1011
- timestamp: new Date(s.timestamp)
1012
- })), o.value = d.currentIndex ?? -1);
1013
- } catch (d) {
1014
- typeof console < "u" && console.error("Failed to load operations from persistence:", d);
1008
+ const p = M.value;
1009
+ p && Array.isArray(p.operations) && (e.value = p.operations.map((f) => ({
1010
+ ...f,
1011
+ timestamp: new Date(f.timestamp)
1012
+ })), t.value = p.currentIndex ?? -1);
1013
+ } catch (p) {
1014
+ typeof console < "u" && console.error("Failed to load operations from persistence:", p);
1015
1015
  }
1016
1016
  }
1017
- function D() {
1017
+ function O() {
1018
1018
  if (!(typeof window > "u"))
1019
1019
  try {
1020
- F.value = {
1021
- operations: e.value.map((d) => ({
1022
- ...d,
1023
- timestamp: d.timestamp.toISOString()
1020
+ M.value = {
1021
+ operations: e.value.map((p) => ({
1022
+ ...p,
1023
+ timestamp: p.timestamp.toISOString()
1024
1024
  })),
1025
- currentIndex: o.value
1025
+ currentIndex: t.value
1026
1026
  };
1027
- } catch (d) {
1028
- typeof console < "u" && console.error("Failed to save operations to persistence:", d);
1027
+ } catch (p) {
1028
+ typeof console < "u" && console.error("Failed to save operations to persistence:", p);
1029
1029
  }
1030
1030
  }
1031
1031
  function S() {
1032
- L(
1033
- [e, o],
1032
+ H(
1033
+ [e, t],
1034
1034
  () => {
1035
- t.value.enablePersistence && D();
1035
+ o.value.enablePersistence && O();
1036
1036
  },
1037
1037
  { deep: !0 }
1038
1038
  );
@@ -1040,26 +1040,26 @@ const Dt = /* @__PURE__ */ no("hst-operation-log", () => {
1040
1040
  return {
1041
1041
  // State
1042
1042
  operations: e,
1043
- currentIndex: o,
1044
- config: t,
1043
+ currentIndex: t,
1044
+ config: o,
1045
1045
  clientId: n,
1046
- undoRedoState: b,
1046
+ undoRedoState: v,
1047
1047
  // Computed
1048
- canUndo: u,
1049
- canRedo: c,
1050
- undoCount: f,
1051
- redoCount: p,
1048
+ canUndo: c,
1049
+ canRedo: d,
1050
+ undoCount: u,
1051
+ redoCount: b,
1052
1052
  // Methods
1053
1053
  configure: h,
1054
- addOperation: _,
1054
+ addOperation: w,
1055
1055
  startBatch: m,
1056
- commitBatch: O,
1057
- cancelBatch: R,
1058
- undo: x,
1059
- redo: H,
1060
- clear: z,
1056
+ commitBatch: k,
1057
+ cancelBatch: I,
1058
+ undo: P,
1059
+ redo: Z,
1060
+ clear: J,
1061
1061
  getOperationsFor: E,
1062
- getSnapshot: G,
1062
+ getSnapshot: L,
1063
1063
  markIrreversible: Y,
1064
1064
  logAction: B
1065
1065
  };
@@ -1099,16 +1099,16 @@ class ge {
1099
1099
  * @param name - The name of the action
1100
1100
  * @param fn - The action function
1101
1101
  */
1102
- registerAction(e, o) {
1103
- this.globalActions.set(e, o);
1102
+ registerAction(e, t) {
1103
+ this.globalActions.set(e, t);
1104
1104
  }
1105
1105
  /**
1106
1106
  * Register a global XState transition action function
1107
1107
  * @param name - The name of the transition action
1108
1108
  * @param fn - The transition action function
1109
1109
  */
1110
- registerTransitionAction(e, o) {
1111
- this.globalTransitionActions.set(e, o);
1110
+ registerTransitionAction(e, t) {
1111
+ this.globalTransitionActions.set(e, t);
1112
1112
  }
1113
1113
  /**
1114
1114
  * Configure rollback behavior for a specific field trigger
@@ -1116,14 +1116,14 @@ class ge {
1116
1116
  * @param fieldname - The field name
1117
1117
  * @param enableRollback - Whether to enable rollback
1118
1118
  */
1119
- setFieldRollback(e, o, n) {
1120
- this.fieldRollbackConfig.has(e) || this.fieldRollbackConfig.set(e, /* @__PURE__ */ new Map()), this.fieldRollbackConfig.get(e).set(o, n);
1119
+ setFieldRollback(e, t, n) {
1120
+ this.fieldRollbackConfig.has(e) || this.fieldRollbackConfig.set(e, /* @__PURE__ */ new Map()), this.fieldRollbackConfig.get(e).set(t, n);
1121
1121
  }
1122
1122
  /**
1123
1123
  * Get rollback configuration for a specific field trigger
1124
1124
  */
1125
- getFieldRollback(e, o) {
1126
- return this.fieldRollbackConfig.get(e)?.get(o);
1125
+ getFieldRollback(e, t) {
1126
+ return this.fieldRollbackConfig.get(e)?.get(t);
1127
1127
  }
1128
1128
  /**
1129
1129
  * Register actions from a doctype - both regular actions and field triggers
@@ -1131,18 +1131,18 @@ class ge {
1131
1131
  * @param doctype - The doctype name
1132
1132
  * @param actions - The actions to register (supports Immutable Map, Map, or plain object)
1133
1133
  */
1134
- registerDoctypeActions(e, o) {
1135
- if (!o) return;
1134
+ registerDoctypeActions(e, t) {
1135
+ if (!t) return;
1136
1136
  const n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
1137
- if (typeof o.entrySeq == "function")
1138
- o.entrySeq().forEach(([i, a]) => {
1139
- this.categorizeAction(i, a, n, r);
1137
+ if (typeof t.entrySeq == "function")
1138
+ t.entrySeq().forEach(([a, s]) => {
1139
+ this.categorizeAction(a, s, n, r);
1140
1140
  });
1141
- else if (o instanceof Map)
1142
- for (const [i, a] of o)
1143
- this.categorizeAction(i, a, n, r);
1144
- else o && typeof o == "object" && Object.entries(o).forEach(([i, a]) => {
1145
- this.categorizeAction(i, a, n, r);
1141
+ else if (t instanceof Map)
1142
+ for (const [a, s] of t)
1143
+ this.categorizeAction(a, s, n, r);
1144
+ else t && typeof t == "object" && Object.entries(t).forEach(([a, s]) => {
1145
+ this.categorizeAction(a, s, n, r);
1146
1146
  });
1147
1147
  this.doctypeActions.set(e, n), this.doctypeTransitions.set(e, r);
1148
1148
  }
@@ -1150,8 +1150,8 @@ class ge {
1150
1150
  * Categorize an action as either a field trigger or XState transition
1151
1151
  * Uses uppercase convention: UPPERCASE = transition, lowercase/mixed = field trigger
1152
1152
  */
1153
- categorizeAction(e, o, n, r) {
1154
- this.isTransitionKey(e) ? r.set(e, o) : n.set(e, o);
1153
+ categorizeAction(e, t, n, r) {
1154
+ this.isTransitionKey(e) ? r.set(e, t) : n.set(e, t);
1155
1155
  }
1156
1156
  /**
1157
1157
  * Determine if a key represents an XState transition
@@ -1165,9 +1165,9 @@ class ge {
1165
1165
  * @param context - The field change context
1166
1166
  * @param options - Execution options (timeout and enableRollback)
1167
1167
  */
1168
- async executeFieldTriggers(e, o = {}) {
1169
- const { doctype: n, fieldname: r } = e, i = this.findFieldTriggers(n, r);
1170
- if (i.length === 0)
1168
+ async executeFieldTriggers(e, t = {}) {
1169
+ const { doctype: n, fieldname: r } = e, a = this.findFieldTriggers(n, r);
1170
+ if (a.length === 0)
1171
1171
  return {
1172
1172
  path: e.path,
1173
1173
  actionResults: [],
@@ -1176,49 +1176,49 @@ class ge {
1176
1176
  stoppedOnError: !1,
1177
1177
  rolledBack: !1
1178
1178
  };
1179
- const a = performance.now(), u = [];
1180
- let c = !1, f = !1, p;
1181
- const b = this.getFieldRollback(n, r), h = o.enableRollback ?? b ?? this.options.enableRollback;
1182
- h && e.store && (p = this.captureSnapshot(e));
1183
- for (const O of i)
1179
+ const s = performance.now(), c = [];
1180
+ let d = !1, u = !1, b;
1181
+ const v = this.getFieldRollback(n, r), h = t.enableRollback ?? v ?? this.options.enableRollback;
1182
+ h && e.store && (b = this.captureSnapshot(e));
1183
+ for (const k of a)
1184
1184
  try {
1185
- const R = await this.executeAction(O, e, o.timeout);
1186
- if (u.push(R), !R.success) {
1187
- c = !0;
1185
+ const I = await this.executeAction(k, e, t.timeout);
1186
+ if (c.push(I), !I.success) {
1187
+ d = !0;
1188
1188
  break;
1189
1189
  }
1190
- } catch (R) {
1191
- const x = {
1190
+ } catch (I) {
1191
+ const P = {
1192
1192
  success: !1,
1193
- error: R instanceof Error ? R : new Error(String(R)),
1193
+ error: I instanceof Error ? I : new Error(String(I)),
1194
1194
  executionTime: 0,
1195
- action: O
1195
+ action: k
1196
1196
  };
1197
- u.push(x), c = !0;
1197
+ c.push(P), d = !0;
1198
1198
  break;
1199
1199
  }
1200
- if (h && c && p && e.store)
1200
+ if (h && d && b && e.store)
1201
1201
  try {
1202
- this.restoreSnapshot(e, p), f = !0;
1203
- } catch (O) {
1204
- console.error("[FieldTriggers] Rollback failed:", O);
1202
+ this.restoreSnapshot(e, b), u = !0;
1203
+ } catch (k) {
1204
+ console.error("[FieldTriggers] Rollback failed:", k);
1205
1205
  }
1206
- const _ = performance.now() - a, m = u.filter((O) => !O.success);
1206
+ const w = performance.now() - s, m = c.filter((k) => !k.success);
1207
1207
  if (m.length > 0 && this.options.errorHandler)
1208
- for (const O of m)
1208
+ for (const k of m)
1209
1209
  try {
1210
- this.options.errorHandler(O.error, e, O.action);
1211
- } catch (R) {
1212
- console.error("[FieldTriggers] Error in global error handler:", R);
1210
+ this.options.errorHandler(k.error, e, k.action);
1211
+ } catch (I) {
1212
+ console.error("[FieldTriggers] Error in global error handler:", I);
1213
1213
  }
1214
1214
  return {
1215
1215
  path: e.path,
1216
- actionResults: u,
1217
- totalExecutionTime: _,
1218
- allSucceeded: u.every((O) => O.success),
1219
- stoppedOnError: c,
1220
- rolledBack: f,
1221
- snapshot: this.options.debug && h ? p : void 0
1216
+ actionResults: c,
1217
+ totalExecutionTime: w,
1218
+ allSucceeded: c.every((k) => k.success),
1219
+ stoppedOnError: d,
1220
+ rolledBack: u,
1221
+ snapshot: this.options.debug && h ? b : void 0
1222
1222
  // Only include snapshot in debug mode if rollback is enabled
1223
1223
  };
1224
1224
  }
@@ -1228,71 +1228,71 @@ class ge {
1228
1228
  * @param context - The transition change context
1229
1229
  * @param options - Execution options (timeout)
1230
1230
  */
1231
- async executeTransitionActions(e, o = {}) {
1232
- const { doctype: n, transition: r } = e, i = this.findTransitionActions(n, r);
1233
- if (i.length === 0)
1231
+ async executeTransitionActions(e, t = {}) {
1232
+ const { doctype: n, transition: r } = e, a = this.findTransitionActions(n, r);
1233
+ if (a.length === 0)
1234
1234
  return [];
1235
- const a = [];
1236
- for (const c of i)
1235
+ const s = [];
1236
+ for (const d of a)
1237
1237
  try {
1238
- const f = await this.executeTransitionAction(c, e, o.timeout);
1239
- if (a.push(f), !f.success)
1238
+ const u = await this.executeTransitionAction(d, e, t.timeout);
1239
+ if (s.push(u), !u.success)
1240
1240
  break;
1241
- } catch (f) {
1242
- const p = {
1241
+ } catch (u) {
1242
+ const b = {
1243
1243
  success: !1,
1244
- error: f instanceof Error ? f : new Error(String(f)),
1244
+ error: u instanceof Error ? u : new Error(String(u)),
1245
1245
  executionTime: 0,
1246
- action: c,
1246
+ action: d,
1247
1247
  transition: r
1248
1248
  };
1249
- a.push(p);
1249
+ s.push(b);
1250
1250
  break;
1251
1251
  }
1252
- const u = a.filter((c) => !c.success);
1253
- if (u.length > 0 && this.options.errorHandler)
1254
- for (const c of u)
1252
+ const c = s.filter((d) => !d.success);
1253
+ if (c.length > 0 && this.options.errorHandler)
1254
+ for (const d of c)
1255
1255
  try {
1256
- this.options.errorHandler(c.error, e, c.action);
1257
- } catch (f) {
1258
- console.error("[FieldTriggers] Error in global error handler:", f);
1256
+ this.options.errorHandler(d.error, e, d.action);
1257
+ } catch (u) {
1258
+ console.error("[FieldTriggers] Error in global error handler:", u);
1259
1259
  }
1260
- return a;
1260
+ return s;
1261
1261
  }
1262
1262
  /**
1263
1263
  * Find transition actions for a specific doctype and transition
1264
1264
  */
1265
- findTransitionActions(e, o) {
1265
+ findTransitionActions(e, t) {
1266
1266
  const n = this.doctypeTransitions.get(e);
1267
- return n ? n.get(o) || [] : [];
1267
+ return n ? n.get(t) || [] : [];
1268
1268
  }
1269
1269
  /**
1270
1270
  * Execute a single transition action by name
1271
1271
  */
1272
- async executeTransitionAction(e, o, n) {
1273
- const r = performance.now(), i = n ?? this.options.defaultTimeout;
1272
+ async executeTransitionAction(e, t, n) {
1273
+ const r = performance.now(), a = n ?? this.options.defaultTimeout;
1274
1274
  try {
1275
- let a = this.globalTransitionActions.get(e);
1276
- if (!a) {
1277
- const u = this.globalActions.get(e);
1278
- u && (a = u);
1275
+ let s = this.globalTransitionActions.get(e);
1276
+ if (!s) {
1277
+ const c = this.globalActions.get(e);
1278
+ c && (s = c);
1279
1279
  }
1280
- if (!a)
1280
+ if (!s)
1281
1281
  throw new Error(`Transition action "${e}" not found in registry`);
1282
- return await this.executeWithTimeout(a, o, i), {
1282
+ return await this.executeWithTimeout(s, t, a), {
1283
1283
  success: !0,
1284
1284
  executionTime: performance.now() - r,
1285
1285
  action: e,
1286
- transition: o.transition
1286
+ transition: t.transition
1287
1287
  };
1288
- } catch (a) {
1289
- const u = performance.now() - r;
1288
+ } catch (s) {
1289
+ const c = performance.now() - r;
1290
1290
  return {
1291
1291
  success: !1,
1292
- error: a instanceof Error ? a : new Error(String(a)),
1293
- executionTime: u,
1292
+ error: s instanceof Error ? s : new Error(String(s)),
1293
+ executionTime: c,
1294
1294
  action: e,
1295
- transition: o.transition
1295
+ transition: t.transition
1296
1296
  };
1297
1297
  }
1298
1298
  }
@@ -1300,12 +1300,12 @@ class ge {
1300
1300
  * Find field triggers for a specific doctype and field
1301
1301
  * Field triggers are identified by keys that look like field paths (contain dots or match field names)
1302
1302
  */
1303
- findFieldTriggers(e, o) {
1303
+ findFieldTriggers(e, t) {
1304
1304
  const n = this.doctypeActions.get(e);
1305
1305
  if (!n) return [];
1306
1306
  const r = [];
1307
- for (const [i, a] of n)
1308
- this.isFieldTriggerKey(i, o) && r.push(...a);
1307
+ for (const [a, s] of n)
1308
+ this.isFieldTriggerKey(a, t) && r.push(...s);
1309
1309
  return r;
1310
1310
  }
1311
1311
  /**
@@ -1315,20 +1315,20 @@ class ge {
1315
1315
  * - Wildcard patterns: "emailAddress.*", "*.is_primary"
1316
1316
  * - Nested field paths: "address.street", "contact.email"
1317
1317
  */
1318
- isFieldTriggerKey(e, o) {
1319
- return e === o ? !0 : e.includes(".") ? this.matchFieldPattern(e, o) : e.includes("*") ? this.matchFieldPattern(e, o) : !1;
1318
+ isFieldTriggerKey(e, t) {
1319
+ return e === t ? !0 : e.includes(".") ? this.matchFieldPattern(e, t) : e.includes("*") ? this.matchFieldPattern(e, t) : !1;
1320
1320
  }
1321
1321
  /**
1322
1322
  * Match a field pattern against a field name
1323
1323
  * Supports wildcards (*) for dynamic segments
1324
1324
  */
1325
- matchFieldPattern(e, o) {
1326
- const n = e.split("."), r = o.split(".");
1325
+ matchFieldPattern(e, t) {
1326
+ const n = e.split("."), r = t.split(".");
1327
1327
  if (n.length !== r.length)
1328
1328
  return !1;
1329
- for (let i = 0; i < n.length; i++) {
1330
- const a = n[i], u = r[i];
1331
- if (a !== "*" && a !== u)
1329
+ for (let a = 0; a < n.length; a++) {
1330
+ const s = n[a], c = r[a];
1331
+ if (s !== "*" && s !== c)
1332
1332
  return !1;
1333
1333
  }
1334
1334
  return !0;
@@ -1336,23 +1336,23 @@ class ge {
1336
1336
  /**
1337
1337
  * Execute a single action by name
1338
1338
  */
1339
- async executeAction(e, o, n) {
1340
- const r = performance.now(), i = n ?? this.options.defaultTimeout;
1339
+ async executeAction(e, t, n) {
1340
+ const r = performance.now(), a = n ?? this.options.defaultTimeout;
1341
1341
  try {
1342
- const a = this.globalActions.get(e);
1343
- if (!a)
1342
+ const s = this.globalActions.get(e);
1343
+ if (!s)
1344
1344
  throw new Error(`Action "${e}" not found in registry`);
1345
- return await this.executeWithTimeout(a, o, i), {
1345
+ return await this.executeWithTimeout(s, t, a), {
1346
1346
  success: !0,
1347
1347
  executionTime: performance.now() - r,
1348
1348
  action: e
1349
1349
  };
1350
- } catch (a) {
1351
- const u = performance.now() - r;
1350
+ } catch (s) {
1351
+ const c = performance.now() - r;
1352
1352
  return {
1353
1353
  success: !1,
1354
- error: a instanceof Error ? a : new Error(String(a)),
1355
- executionTime: u,
1354
+ error: s instanceof Error ? s : new Error(String(s)),
1355
+ executionTime: c,
1356
1356
  action: e
1357
1357
  };
1358
1358
  }
@@ -1360,15 +1360,15 @@ class ge {
1360
1360
  /**
1361
1361
  * Execute a function with timeout
1362
1362
  */
1363
- async executeWithTimeout(e, o, n) {
1364
- return new Promise((r, i) => {
1365
- const a = setTimeout(() => {
1366
- i(new Error(`Action timeout after ${n}ms`));
1363
+ async executeWithTimeout(e, t, n) {
1364
+ return new Promise((r, a) => {
1365
+ const s = setTimeout(() => {
1366
+ a(new Error(`Action timeout after ${n}ms`));
1367
1367
  }, n);
1368
- Promise.resolve(e(o)).then((u) => {
1369
- clearTimeout(a), r(u);
1370
- }).catch((u) => {
1371
- clearTimeout(a), i(u);
1368
+ Promise.resolve(e(t)).then((c) => {
1369
+ clearTimeout(s), r(c);
1370
+ }).catch((c) => {
1371
+ clearTimeout(s), a(c);
1372
1372
  });
1373
1373
  });
1374
1374
  }
@@ -1379,10 +1379,10 @@ class ge {
1379
1379
  captureSnapshot(e) {
1380
1380
  if (!(!e.store || !e.doctype || !e.recordId))
1381
1381
  try {
1382
- const o = `${e.doctype}.${e.recordId}`, n = e.store.get(o);
1382
+ const t = `${e.doctype}.${e.recordId}`, n = e.store.get(t);
1383
1383
  return !n || typeof n != "object" ? void 0 : JSON.parse(JSON.stringify(n));
1384
- } catch (o) {
1385
- this.options.debug && console.warn("[FieldTriggers] Failed to capture snapshot:", o);
1384
+ } catch (t) {
1385
+ this.options.debug && console.warn("[FieldTriggers] Failed to capture snapshot:", t);
1386
1386
  return;
1387
1387
  }
1388
1388
  }
@@ -1390,34 +1390,34 @@ class ge {
1390
1390
  * Restore a previously captured snapshot
1391
1391
  * This reverts the record to its state before actions were executed
1392
1392
  */
1393
- restoreSnapshot(e, o) {
1394
- if (!(!e.store || !e.doctype || !e.recordId || !o))
1393
+ restoreSnapshot(e, t) {
1394
+ if (!(!e.store || !e.doctype || !e.recordId || !t))
1395
1395
  try {
1396
1396
  const n = `${e.doctype}.${e.recordId}`;
1397
- e.store.set(n, o), this.options.debug && console.log(`[FieldTriggers] Rolled back ${n} to previous state`);
1397
+ e.store.set(n, t), this.options.debug && console.log(`[FieldTriggers] Rolled back ${n} to previous state`);
1398
1398
  } catch (n) {
1399
1399
  throw console.error("[FieldTriggers] Failed to restore snapshot:", n), n;
1400
1400
  }
1401
1401
  }
1402
1402
  }
1403
- function ct(t) {
1404
- return new ge(t);
1403
+ function ct(o) {
1404
+ return new ge(o);
1405
1405
  }
1406
1406
  function ut() {
1407
1407
  try {
1408
- return Dt();
1408
+ return Ot();
1409
1409
  } catch {
1410
1410
  return null;
1411
1411
  }
1412
1412
  }
1413
- class ce {
1413
+ class le {
1414
1414
  static instance;
1415
1415
  /**
1416
1416
  * Gets the singleton instance of HST
1417
1417
  * @returns The HST singleton instance
1418
1418
  */
1419
1419
  static getInstance() {
1420
- return ce.instance || (ce.instance = new ce()), ce.instance;
1420
+ return le.instance || (le.instance = new le()), le.instance;
1421
1421
  }
1422
1422
  /**
1423
1423
  * Gets the global registry instance
@@ -1446,28 +1446,28 @@ class ce {
1446
1446
  * @returns The doctype metadata object or undefined if not found
1447
1447
  */
1448
1448
  getDoctypeMeta(e) {
1449
- const o = this.getRegistry();
1450
- if (o && typeof o == "object" && "registry" in o)
1451
- return o.registry[e];
1449
+ const t = this.getRegistry();
1450
+ if (t && typeof t == "object" && "registry" in t)
1451
+ return t.registry[e];
1452
1452
  }
1453
1453
  }
1454
- class Ie {
1454
+ class Re {
1455
1455
  target;
1456
1456
  parentPath;
1457
1457
  rootNode;
1458
1458
  doctype;
1459
1459
  parentDoctype;
1460
1460
  hst;
1461
- constructor(e, o, n = "", r = null, i) {
1462
- return this.target = e, this.parentPath = n, this.rootNode = r || this, this.doctype = o, this.parentDoctype = i, this.hst = ce.getInstance(), new Proxy(this, {
1463
- get(a, u) {
1464
- if (u in a) return a[u];
1465
- const c = String(u);
1466
- return a.getNode(c);
1461
+ constructor(e, t, n = "", r = null, a) {
1462
+ return this.target = e, this.parentPath = n, this.rootNode = r || this, this.doctype = t, this.parentDoctype = a, this.hst = le.getInstance(), new Proxy(this, {
1463
+ get(s, c) {
1464
+ if (c in s) return s[c];
1465
+ const d = String(c);
1466
+ return s.getNode(d);
1467
1467
  },
1468
- set(a, u, c) {
1469
- const f = String(u);
1470
- return a.set(f, c), !0;
1468
+ set(s, c, d) {
1469
+ const u = String(c);
1470
+ return s.set(u, d), !0;
1471
1471
  }
1472
1472
  });
1473
1473
  }
@@ -1476,25 +1476,25 @@ class Ie {
1476
1476
  }
1477
1477
  // Method to get a tree-wrapped node for navigation
1478
1478
  getNode(e) {
1479
- const o = this.resolvePath(e), n = this.resolveValue(e), r = o.split(".");
1480
- let i = this.doctype;
1481
- return this.doctype === "StonecropStore" && r.length >= 1 && (i = r[0]), typeof n == "object" && n !== null && !this.isPrimitive(n) ? new Ie(n, i, o, this.rootNode, this.parentDoctype) : new Ie(n, i, o, this.rootNode, this.parentDoctype);
1479
+ const t = this.resolvePath(e), n = this.resolveValue(e), r = t.split(".");
1480
+ let a = this.doctype;
1481
+ return this.doctype === "StonecropStore" && r.length >= 1 && (a = r[0]), typeof n == "object" && n !== null && !this.isPrimitive(n) ? new Re(n, a, t, this.rootNode, this.parentDoctype) : new Re(n, a, t, this.rootNode, this.parentDoctype);
1482
1482
  }
1483
- set(e, o, n = "user") {
1484
- const r = this.resolvePath(e), i = this.has(e) ? this.get(e) : void 0;
1483
+ set(e, t, n = "user") {
1484
+ const r = this.resolvePath(e), a = this.has(e) ? this.get(e) : void 0;
1485
1485
  if (n !== "undo" && n !== "redo") {
1486
- const a = ut();
1487
- if (a && typeof a.addOperation == "function") {
1488
- const u = r.split("."), c = this.doctype === "StonecropStore" && u.length >= 1 ? u[0] : this.doctype, f = u.length >= 2 ? u[1] : void 0, p = u.slice(2).join(".") || u[u.length - 1], b = o === void 0 && i !== void 0 ? "delete" : "set";
1489
- a.addOperation(
1486
+ const s = ut();
1487
+ if (s && typeof s.addOperation == "function") {
1488
+ const c = r.split("."), d = this.doctype === "StonecropStore" && c.length >= 1 ? c[0] : this.doctype, u = c.length >= 2 ? c[1] : void 0, b = c.slice(2).join(".") || c[c.length - 1], v = t === void 0 && a !== void 0 ? "delete" : "set";
1489
+ s.addOperation(
1490
1490
  {
1491
- type: b,
1491
+ type: v,
1492
1492
  path: r,
1493
- fieldname: p,
1494
- beforeValue: i,
1495
- afterValue: o,
1496
- doctype: c,
1497
- recordId: f,
1493
+ fieldname: b,
1494
+ beforeValue: a,
1495
+ afterValue: t,
1496
+ doctype: d,
1497
+ recordId: u,
1498
1498
  reversible: !0
1499
1499
  // Default to reversible, can be changed by field triggers
1500
1500
  },
@@ -1502,21 +1502,21 @@ class Ie {
1502
1502
  );
1503
1503
  }
1504
1504
  }
1505
- this.updateValue(e, o), this.triggerFieldActions(r, i, o);
1505
+ this.updateValue(e, t), this.triggerFieldActions(r, a, t);
1506
1506
  }
1507
1507
  has(e) {
1508
1508
  try {
1509
1509
  if (e === "")
1510
1510
  return !0;
1511
- const o = this.parsePath(e);
1511
+ const t = this.parsePath(e);
1512
1512
  let n = this.target;
1513
- for (let r = 0; r < o.length; r++) {
1514
- const i = o[r];
1513
+ for (let r = 0; r < t.length; r++) {
1514
+ const a = t[r];
1515
1515
  if (n == null)
1516
1516
  return !1;
1517
- if (r === o.length - 1)
1518
- return this.isImmutable(n) ? n.has(i) : this.isPiniaStore(n) && n.$state && i in n.$state || i in n;
1519
- n = this.getProperty(n, i);
1517
+ if (r === t.length - 1)
1518
+ return this.isImmutable(n) ? n.has(a) : this.isPiniaStore(n) && n.$state && a in n.$state || a in n;
1519
+ n = this.getProperty(n, a);
1520
1520
  }
1521
1521
  return !1;
1522
1522
  } catch {
@@ -1544,46 +1544,46 @@ class Ie {
1544
1544
  /**
1545
1545
  * Trigger an XState transition with optional context data
1546
1546
  */
1547
- async triggerTransition(e, o) {
1547
+ async triggerTransition(e, t) {
1548
1548
  const n = ct(), r = this.parentPath.split(".");
1549
- let i = this.doctype, a;
1550
- this.doctype === "StonecropStore" && r.length >= 1 && (i = r[0]), r.length >= 2 && (a = r[1]);
1551
- const u = {
1549
+ let a = this.doctype, s;
1550
+ this.doctype === "StonecropStore" && r.length >= 1 && (a = r[0]), r.length >= 2 && (s = r[1]);
1551
+ const c = {
1552
1552
  path: this.parentPath,
1553
1553
  fieldname: "",
1554
1554
  // No specific field for transitions
1555
1555
  beforeValue: void 0,
1556
1556
  afterValue: void 0,
1557
1557
  operation: "set",
1558
- doctype: i,
1559
- recordId: a,
1558
+ doctype: a,
1559
+ recordId: s,
1560
1560
  timestamp: /* @__PURE__ */ new Date(),
1561
1561
  store: this.rootNode || void 0,
1562
1562
  transition: e,
1563
- currentState: o?.currentState,
1564
- targetState: o?.targetState,
1565
- fsmContext: o?.fsmContext
1566
- }, c = ut();
1567
- return c && typeof c.addOperation == "function" && c.addOperation(
1563
+ currentState: t?.currentState,
1564
+ targetState: t?.targetState,
1565
+ fsmContext: t?.fsmContext
1566
+ }, d = ut();
1567
+ return d && typeof d.addOperation == "function" && d.addOperation(
1568
1568
  {
1569
1569
  type: "transition",
1570
1570
  path: this.parentPath,
1571
1571
  fieldname: e,
1572
- beforeValue: o?.currentState,
1573
- afterValue: o?.targetState,
1574
- doctype: i,
1575
- recordId: a,
1572
+ beforeValue: t?.currentState,
1573
+ afterValue: t?.targetState,
1574
+ doctype: a,
1575
+ recordId: s,
1576
1576
  reversible: !1,
1577
1577
  // FSM transitions are generally not reversible
1578
1578
  metadata: {
1579
1579
  transition: e,
1580
- currentState: o?.currentState,
1581
- targetState: o?.targetState,
1582
- fsmContext: o?.fsmContext
1580
+ currentState: t?.currentState,
1581
+ targetState: t?.targetState,
1582
+ fsmContext: t?.fsmContext
1583
1583
  }
1584
1584
  },
1585
1585
  "user"
1586
- ), await n.executeTransitionActions(u);
1586
+ ), await n.executeTransitionActions(c);
1587
1587
  }
1588
1588
  // Private helper methods
1589
1589
  resolvePath(e) {
@@ -1592,62 +1592,62 @@ class Ie {
1592
1592
  resolveValue(e) {
1593
1593
  if (e === "")
1594
1594
  return this.target;
1595
- const o = this.parsePath(e);
1595
+ const t = this.parsePath(e);
1596
1596
  let n = this.target;
1597
- for (const r of o) {
1597
+ for (const r of t) {
1598
1598
  if (n == null)
1599
1599
  return;
1600
1600
  n = this.getProperty(n, r);
1601
1601
  }
1602
1602
  return n;
1603
1603
  }
1604
- updateValue(e, o) {
1604
+ updateValue(e, t) {
1605
1605
  if (e === "")
1606
1606
  throw new Error("Cannot set value on empty path");
1607
1607
  const n = this.parsePath(e), r = n.pop();
1608
- let i = this.target;
1609
- for (const a of n)
1610
- if (i = this.getProperty(i, a), i == null)
1608
+ let a = this.target;
1609
+ for (const s of n)
1610
+ if (a = this.getProperty(a, s), a == null)
1611
1611
  throw new Error(`Cannot set property on null/undefined path: ${e}`);
1612
- this.setProperty(i, r, o);
1612
+ this.setProperty(a, r, t);
1613
1613
  }
1614
- getProperty(e, o) {
1615
- return this.isImmutable(e) ? e.get(o) : this.isVueReactive(e) ? e[o] : this.isPiniaStore(e) ? e.$state?.[o] ?? e[o] : e[o];
1614
+ getProperty(e, t) {
1615
+ return this.isImmutable(e) ? e.get(t) : this.isVueReactive(e) ? e[t] : this.isPiniaStore(e) ? e.$state?.[t] ?? e[t] : e[t];
1616
1616
  }
1617
- setProperty(e, o, n) {
1617
+ setProperty(e, t, n) {
1618
1618
  if (this.isImmutable(e))
1619
1619
  throw new Error("Cannot directly mutate immutable objects. Use immutable update methods instead.");
1620
1620
  if (this.isPiniaStore(e)) {
1621
- e.$patch ? e.$patch({ [o]: n }) : e[o] = n;
1621
+ e.$patch ? e.$patch({ [t]: n }) : e[t] = n;
1622
1622
  return;
1623
1623
  }
1624
- e[o] = n;
1624
+ e[t] = n;
1625
1625
  }
1626
- async triggerFieldActions(e, o, n) {
1626
+ async triggerFieldActions(e, t, n) {
1627
1627
  try {
1628
- if (!e || typeof e != "string" || Object.is(o, n))
1628
+ if (!e || typeof e != "string" || Object.is(t, n))
1629
1629
  return;
1630
1630
  const r = e.split(".");
1631
1631
  if (r.length < 3)
1632
1632
  return;
1633
- const i = ct(), a = r.slice(2).join(".") || r[r.length - 1];
1634
- let u = this.doctype;
1635
- this.doctype === "StonecropStore" && r.length >= 1 && (u = r[0]);
1636
- let c;
1637
- r.length >= 2 && (c = r[1]);
1638
- const f = {
1633
+ const a = ct(), s = r.slice(2).join(".") || r[r.length - 1];
1634
+ let c = this.doctype;
1635
+ this.doctype === "StonecropStore" && r.length >= 1 && (c = r[0]);
1636
+ let d;
1637
+ r.length >= 2 && (d = r[1]);
1638
+ const u = {
1639
1639
  path: e,
1640
- fieldname: a,
1641
- beforeValue: o,
1640
+ fieldname: s,
1641
+ beforeValue: t,
1642
1642
  afterValue: n,
1643
1643
  operation: "set",
1644
- doctype: u,
1645
- recordId: c,
1644
+ doctype: c,
1645
+ recordId: d,
1646
1646
  timestamp: /* @__PURE__ */ new Date(),
1647
1647
  store: this.rootNode || void 0
1648
1648
  // Pass the root store for snapshot/rollback capabilities
1649
1649
  };
1650
- await i.executeFieldTriggers(f);
1650
+ await a.executeFieldTriggers(u);
1651
1651
  } catch (r) {
1652
1652
  r instanceof Error && console.warn("Field trigger error:", r.message);
1653
1653
  }
@@ -1661,19 +1661,19 @@ class Ie {
1661
1661
  isImmutable(e) {
1662
1662
  if (!e || typeof e != "object")
1663
1663
  return !1;
1664
- const o = "get" in e && typeof e.get == "function", n = "set" in e && typeof e.set == "function", r = "has" in e && typeof e.has == "function", i = "__ownerID" in e || "_map" in e || "_list" in e || "_origin" in e || "_capacity" in e || "_defaultValues" in e || "_tail" in e || "_root" in e || "size" in e && o && n;
1665
- let a;
1664
+ const t = "get" in e && typeof e.get == "function", n = "set" in e && typeof e.set == "function", r = "has" in e && typeof e.has == "function", a = "__ownerID" in e || "_map" in e || "_list" in e || "_origin" in e || "_capacity" in e || "_defaultValues" in e || "_tail" in e || "_root" in e || "size" in e && t && n;
1665
+ let s;
1666
1666
  try {
1667
- const c = e;
1668
- if ("constructor" in c && c.constructor && typeof c.constructor == "object" && "name" in c.constructor) {
1669
- const f = c.constructor.name;
1670
- a = typeof f == "string" ? f : void 0;
1667
+ const d = e;
1668
+ if ("constructor" in d && d.constructor && typeof d.constructor == "object" && "name" in d.constructor) {
1669
+ const u = d.constructor.name;
1670
+ s = typeof u == "string" ? u : void 0;
1671
1671
  }
1672
1672
  } catch {
1673
- a = void 0;
1673
+ s = void 0;
1674
1674
  }
1675
- const u = a && (a.includes("Map") || a.includes("List") || a.includes("Set") || a.includes("Stack") || a.includes("Seq")) && (o || n);
1676
- return !!(o && n && r && i || o && n && u);
1675
+ const c = s && (s.includes("Map") || s.includes("List") || s.includes("Set") || s.includes("Stack") || s.includes("Seq")) && (t || n);
1676
+ return !!(t && n && r && a || t && n && c);
1677
1677
  }
1678
1678
  isPrimitive(e) {
1679
1679
  return e == null || typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "function" || typeof e == "symbol" || typeof e == "bigint";
@@ -1684,13 +1684,13 @@ class Ie {
1684
1684
  * @returns Array of path segments (e.g., ['order', '456', 'line_items', '0', 'product'])
1685
1685
  */
1686
1686
  parsePath(e) {
1687
- return e ? e.replace(/\[(\d+)\]/g, ".$1").split(".").filter((o) => o.length > 0) : [];
1687
+ return e ? e.replace(/\[(\d+)\]/g, ".$1").split(".").filter((t) => t.length > 0) : [];
1688
1688
  }
1689
1689
  }
1690
- function No(t, e, o) {
1691
- return new Ie(t, e, "", null, o);
1690
+ function Oo(o, e, t) {
1691
+ return new Re(o, e, "", null, t);
1692
1692
  }
1693
- class $o {
1693
+ class No {
1694
1694
  hstStore;
1695
1695
  _operationLogStore;
1696
1696
  _operationLogConfig;
@@ -1701,32 +1701,32 @@ class $o {
1701
1701
  * @param registry - The Registry instance containing doctype definitions
1702
1702
  * @param operationLogConfig - Optional configuration for the operation log
1703
1703
  */
1704
- constructor(e, o) {
1705
- this.registry = e, this._operationLogConfig = o, this.initializeHSTStore(), this.setupRegistrySync();
1704
+ constructor(e, t) {
1705
+ this.registry = e, this._operationLogConfig = t, this.initializeHSTStore(), this.setupRegistrySync();
1706
1706
  }
1707
1707
  /**
1708
1708
  * Get the operation log store (lazy initialization)
1709
1709
  * @internal
1710
1710
  */
1711
1711
  getOperationLogStore() {
1712
- return this._operationLogStore || (this._operationLogStore = Dt(), this._operationLogConfig && this._operationLogStore.configure(this._operationLogConfig)), this._operationLogStore;
1712
+ return this._operationLogStore || (this._operationLogStore = Ot(), this._operationLogConfig && this._operationLogStore.configure(this._operationLogConfig)), this._operationLogStore;
1713
1713
  }
1714
1714
  /**
1715
1715
  * Initialize the HST store structure
1716
1716
  */
1717
1717
  initializeHSTStore() {
1718
1718
  const e = {};
1719
- Object.keys(this.registry.registry).forEach((o) => {
1720
- e[o] = {};
1721
- }), this.hstStore = No(mt(e), "StonecropStore");
1719
+ Object.keys(this.registry.registry).forEach((t) => {
1720
+ e[t] = {};
1721
+ }), this.hstStore = Oo(yt(e), "StonecropStore");
1722
1722
  }
1723
1723
  /**
1724
1724
  * Setup automatic sync with Registry when doctypes are added
1725
1725
  */
1726
1726
  setupRegistrySync() {
1727
1727
  const e = this.registry.addDoctype.bind(this.registry);
1728
- this.registry.addDoctype = (o) => {
1729
- e(o), this.hstStore.has(o.slug) || this.hstStore.set(o.slug, {});
1728
+ this.registry.addDoctype = (t) => {
1729
+ e(t), this.hstStore.has(t.slug) || this.hstStore.set(t.slug, {});
1730
1730
  };
1731
1731
  }
1732
1732
  /**
@@ -1735,8 +1735,8 @@ class $o {
1735
1735
  * @returns HST node containing records hash
1736
1736
  */
1737
1737
  records(e) {
1738
- const o = typeof e == "string" ? e : e.slug;
1739
- return this.ensureDoctypeExists(o), this.hstStore.getNode(o);
1738
+ const t = typeof e == "string" ? e : e.slug;
1739
+ return this.ensureDoctypeExists(t), this.hstStore.getNode(t);
1740
1740
  }
1741
1741
  /**
1742
1742
  * Add a record to the store
@@ -1744,9 +1744,9 @@ class $o {
1744
1744
  * @param recordId - The record ID
1745
1745
  * @param recordData - The record data
1746
1746
  */
1747
- addRecord(e, o, n) {
1747
+ addRecord(e, t, n) {
1748
1748
  const r = typeof e == "string" ? e : e.slug;
1749
- this.ensureDoctypeExists(r), this.hstStore.set(`${r}.${o}`, n);
1749
+ this.ensureDoctypeExists(r), this.hstStore.set(`${r}.${t}`, n);
1750
1750
  }
1751
1751
  /**
1752
1752
  * Get a specific record
@@ -1754,19 +1754,19 @@ class $o {
1754
1754
  * @param recordId - The record ID
1755
1755
  * @returns HST node for the record or undefined
1756
1756
  */
1757
- getRecordById(e, o) {
1757
+ getRecordById(e, t) {
1758
1758
  const n = typeof e == "string" ? e : e.slug;
1759
- if (this.ensureDoctypeExists(n), !(!this.hstStore.has(`${n}.${o}`) || this.hstStore.get(`${n}.${o}`) === void 0))
1760
- return this.hstStore.getNode(`${n}.${o}`);
1759
+ if (this.ensureDoctypeExists(n), !(!this.hstStore.has(`${n}.${t}`) || this.hstStore.get(`${n}.${t}`) === void 0))
1760
+ return this.hstStore.getNode(`${n}.${t}`);
1761
1761
  }
1762
1762
  /**
1763
1763
  * Remove a record from the store
1764
1764
  * @param doctype - The doctype
1765
1765
  * @param recordId - The record ID
1766
1766
  */
1767
- removeRecord(e, o) {
1767
+ removeRecord(e, t) {
1768
1768
  const n = typeof e == "string" ? e : e.slug;
1769
- this.ensureDoctypeExists(n), this.hstStore.has(`${n}.${o}`) && this.hstStore.set(`${n}.${o}`, void 0);
1769
+ this.ensureDoctypeExists(n), this.hstStore.has(`${n}.${t}`) && this.hstStore.set(`${n}.${t}`, void 0);
1770
1770
  }
1771
1771
  /**
1772
1772
  * Get all record IDs for a doctype
@@ -1774,9 +1774,9 @@ class $o {
1774
1774
  * @returns Array of record IDs
1775
1775
  */
1776
1776
  getRecordIds(e) {
1777
- const o = typeof e == "string" ? e : e.slug;
1778
- this.ensureDoctypeExists(o);
1779
- const n = this.hstStore.get(o);
1777
+ const t = typeof e == "string" ? e : e.slug;
1778
+ this.ensureDoctypeExists(t);
1779
+ const n = this.hstStore.get(t);
1780
1780
  return !n || typeof n != "object" ? [] : Object.keys(n).filter((r) => n[r] !== void 0);
1781
1781
  }
1782
1782
  /**
@@ -1784,9 +1784,9 @@ class $o {
1784
1784
  * @param doctype - The doctype
1785
1785
  */
1786
1786
  clearRecords(e) {
1787
- const o = typeof e == "string" ? e : e.slug;
1788
- this.ensureDoctypeExists(o), this.getRecordIds(o).forEach((n) => {
1789
- this.hstStore.set(`${o}.${n}`, void 0);
1787
+ const t = typeof e == "string" ? e : e.slug;
1788
+ this.ensureDoctypeExists(t), this.getRecordIds(t).forEach((n) => {
1789
+ this.hstStore.set(`${t}.${n}`, void 0);
1790
1790
  });
1791
1791
  }
1792
1792
  /**
@@ -1803,20 +1803,20 @@ class $o {
1803
1803
  * @param action - The action to run
1804
1804
  * @param args - Action arguments (typically record IDs)
1805
1805
  */
1806
- runAction(e, o, n) {
1807
- const r = this.registry.registry[e.slug]?.actions?.get(o), i = Array.isArray(n) ? n.filter((f) => typeof f == "string") : void 0, a = this.getOperationLogStore();
1808
- let u = "success", c;
1806
+ runAction(e, t, n) {
1807
+ const r = this.registry.registry[e.slug]?.actions?.get(t), a = Array.isArray(n) ? n.filter((u) => typeof u == "string") : void 0, s = this.getOperationLogStore();
1808
+ let c = "success", d;
1809
1809
  try {
1810
- r && r.length > 0 && r.forEach((f) => {
1810
+ r && r.length > 0 && r.forEach((u) => {
1811
1811
  try {
1812
- new Function("args", f)(n);
1813
- } catch (p) {
1814
- throw u = "failure", c = p instanceof Error ? p.message : "Unknown error", p;
1812
+ new Function("args", u)(n);
1813
+ } catch (b) {
1814
+ throw c = "failure", d = b instanceof Error ? b.message : "Unknown error", b;
1815
1815
  }
1816
1816
  });
1817
1817
  } catch {
1818
1818
  } finally {
1819
- a.logAction(e.doctype, o, i, u, c);
1819
+ s.logAction(e.doctype, t, a, c, d);
1820
1820
  }
1821
1821
  }
1822
1822
  /**
@@ -1824,8 +1824,8 @@ class $o {
1824
1824
  * @param doctype - The doctype
1825
1825
  */
1826
1826
  async getRecords(e) {
1827
- (await (await fetch(`/${e.slug}`)).json()).forEach((o) => {
1828
- o.id && this.addRecord(e, o.id, o);
1827
+ (await (await fetch(`/${e.slug}`)).json()).forEach((t) => {
1828
+ t.id && this.addRecord(e, t.id, t);
1829
1829
  });
1830
1830
  }
1831
1831
  /**
@@ -1833,9 +1833,9 @@ class $o {
1833
1833
  * @param doctype - The doctype
1834
1834
  * @param recordId - The record ID
1835
1835
  */
1836
- async getRecord(e, o) {
1837
- const n = await (await fetch(`/${e.slug}/${o}`)).json();
1838
- this.addRecord(e, o, n);
1836
+ async getRecord(e, t) {
1837
+ const n = await (await fetch(`/${e.slug}/${t}`)).json();
1838
+ this.addRecord(e, t, n);
1839
1839
  }
1840
1840
  /**
1841
1841
  * Ensure doctype section exists in HST store
@@ -1861,15 +1861,34 @@ class $o {
1861
1861
  getStore() {
1862
1862
  return this.hstStore;
1863
1863
  }
1864
+ /**
1865
+ * Determine the current workflow state for a record.
1866
+ *
1867
+ * Reads the record's `status` field from the HST store. If the field is absent or
1868
+ * empty the doctype's declared `workflow.initial` state is used as the fallback,
1869
+ * giving callers a reliable state name without having to duplicate that logic.
1870
+ *
1871
+ * @param doctype - The doctype slug or DoctypeMeta instance
1872
+ * @param recordId - The record identifier
1873
+ * @returns The current state name, or an empty string if the doctype has no workflow
1874
+ *
1875
+ * @public
1876
+ */
1877
+ getRecordState(e, t) {
1878
+ const n = typeof e == "string" ? e : e.slug, r = this.registry.getDoctype(n);
1879
+ if (!r?.workflow) return "";
1880
+ const a = this.getRecordById(n, t)?.get("status"), s = typeof r.workflow.initial == "string" ? r.workflow.initial : Object.keys(r.workflow.states ?? {})[0] ?? "";
1881
+ return a || s;
1882
+ }
1864
1883
  }
1865
- function Co(t) {
1866
- t || (t = {});
1867
- const e = t.registry || be("$registry"), o = be("$stonecrop"), n = C(), r = C(), i = C({}), a = C(), u = C(), c = C([]);
1868
- if (t.doctype && e) {
1869
- const w = t.doctype.schema ? Array.isArray(t.doctype.schema) ? t.doctype.schema : Array.from(t.doctype.schema) : [];
1870
- c.value = e.resolveSchema(w);
1871
- }
1872
- const f = C([]), p = C(-1), b = I(() => n.value?.getOperationLogStore().canUndo ?? !1), h = I(() => n.value?.getOperationLogStore().canRedo ?? !1), _ = I(() => n.value?.getOperationLogStore().undoCount ?? 0), m = I(() => n.value?.getOperationLogStore().redoCount ?? 0), O = I(
1884
+ function Do(o) {
1885
+ o || (o = {});
1886
+ const e = o.registry || be("$registry"), t = be("$stonecrop"), n = C(), r = C(), a = C({}), s = C(), c = C(), d = C([]);
1887
+ if (o.doctype && e) {
1888
+ const _ = o.doctype.schema ? Array.isArray(o.doctype.schema) ? o.doctype.schema : Array.from(o.doctype.schema) : [];
1889
+ d.value = e.resolveSchema(_);
1890
+ }
1891
+ const u = C([]), b = C(-1), v = R(() => n.value?.getOperationLogStore().canUndo ?? !1), h = R(() => n.value?.getOperationLogStore().canRedo ?? !1), w = R(() => n.value?.getOperationLogStore().undoCount ?? 0), m = R(() => n.value?.getOperationLogStore().redoCount ?? 0), k = R(
1873
1892
  () => n.value?.getOperationLogStore().undoRedoState ?? {
1874
1893
  canUndo: !1,
1875
1894
  canRedo: !1,
@@ -1877,236 +1896,236 @@ function Co(t) {
1877
1896
  redoCount: 0,
1878
1897
  currentIndex: -1
1879
1898
  }
1880
- ), R = (w) => n.value?.getOperationLogStore().undo(w) ?? !1, x = (w) => n.value?.getOperationLogStore().redo(w) ?? !1, H = () => {
1899
+ ), I = (_) => n.value?.getOperationLogStore().undo(_) ?? !1, P = (_) => n.value?.getOperationLogStore().redo(_) ?? !1, Z = () => {
1881
1900
  n.value?.getOperationLogStore().startBatch();
1882
- }, U = (w) => n.value?.getOperationLogStore().commitBatch(w) ?? null, K = () => {
1901
+ }, U = (_) => n.value?.getOperationLogStore().commitBatch(_) ?? null, G = () => {
1883
1902
  n.value?.getOperationLogStore().cancelBatch();
1884
- }, G = () => {
1903
+ }, L = () => {
1885
1904
  n.value?.getOperationLogStore().clear();
1886
- }, z = (w, D) => n.value?.getOperationLogStore().getOperationsFor(w, D) ?? [], E = () => n.value?.getOperationLogStore().getSnapshot() ?? {
1905
+ }, J = (_, O) => n.value?.getOperationLogStore().getOperationsFor(_, O) ?? [], E = () => n.value?.getOperationLogStore().getSnapshot() ?? {
1887
1906
  operations: [],
1888
1907
  currentIndex: -1,
1889
1908
  totalOperations: 0,
1890
1909
  reversibleOperations: 0,
1891
1910
  irreversibleOperations: 0
1892
- }, Y = (w, D) => {
1893
- n.value?.getOperationLogStore().markIrreversible(w, D);
1894
- }, B = (w, D, S, d = "success", s) => n.value?.getOperationLogStore().logAction(w, D, S, d, s) ?? "", v = (w) => {
1895
- n.value?.getOperationLogStore().configure(w);
1911
+ }, Y = (_, O) => {
1912
+ n.value?.getOperationLogStore().markIrreversible(_, O);
1913
+ }, B = (_, O, S, p = "success", f) => n.value?.getOperationLogStore().logAction(_, O, S, p, f) ?? "", g = (_) => {
1914
+ n.value?.getOperationLogStore().configure(_);
1896
1915
  };
1897
- Ae(async () => {
1916
+ xe(async () => {
1898
1917
  if (e) {
1899
- n.value = o || new $o(e);
1918
+ n.value = t || new No(e);
1900
1919
  try {
1901
- const w = n.value.getOperationLogStore(), D = ro(w);
1902
- f.value = D.operations.value, p.value = D.currentIndex.value, L(
1903
- () => D.operations.value,
1920
+ const _ = n.value.getOperationLogStore(), O = oo(_);
1921
+ u.value = O.operations.value, b.value = O.currentIndex.value, H(
1922
+ () => O.operations.value,
1904
1923
  (S) => {
1905
- f.value = S;
1924
+ u.value = S;
1906
1925
  }
1907
- ), L(
1908
- () => D.currentIndex.value,
1926
+ ), H(
1927
+ () => O.currentIndex.value,
1909
1928
  (S) => {
1910
- p.value = S;
1929
+ b.value = S;
1911
1930
  }
1912
1931
  );
1913
1932
  } catch {
1914
1933
  }
1915
- if (!t.doctype && e.router) {
1916
- const w = e.router.currentRoute.value;
1917
- if (!w.path) return;
1918
- const D = w.path.split("/").filter((d) => d.length > 0), S = D[1]?.toLowerCase();
1919
- if (D.length > 0) {
1920
- const d = {
1921
- path: w.path,
1922
- segments: D
1923
- }, s = await e.getMeta?.(d);
1924
- if (s) {
1925
- if (e.addDoctype(s), n.value.setup(s), a.value = s, u.value = S, r.value = n.value.getStore(), e) {
1926
- const l = s.schema ? Array.isArray(s.schema) ? s.schema : Array.from(s.schema) : [];
1927
- c.value = e.resolveSchema(l);
1934
+ if (!o.doctype && e.router) {
1935
+ const _ = e.router.currentRoute.value;
1936
+ if (!_.path) return;
1937
+ const O = _.path.split("/").filter((p) => p.length > 0), S = O[1]?.toLowerCase();
1938
+ if (O.length > 0) {
1939
+ const p = {
1940
+ path: _.path,
1941
+ segments: O
1942
+ }, f = await e.getMeta?.(p);
1943
+ if (f) {
1944
+ if (e.addDoctype(f), n.value.setup(f), s.value = f, c.value = S, r.value = n.value.getStore(), e) {
1945
+ const i = f.schema ? Array.isArray(f.schema) ? f.schema : Array.from(f.schema) : [];
1946
+ d.value = e.resolveSchema(i);
1928
1947
  }
1929
1948
  if (S && S !== "new") {
1930
- const l = n.value.getRecordById(s, S);
1931
- if (l)
1932
- i.value = l.get("") || {};
1949
+ const i = n.value.getRecordById(f, S);
1950
+ if (i)
1951
+ a.value = i.get("") || {};
1933
1952
  else
1934
1953
  try {
1935
- await n.value.getRecord(s, S);
1936
- const y = n.value.getRecordById(s, S);
1937
- y && (i.value = y.get("") || {});
1954
+ await n.value.getRecord(f, S);
1955
+ const l = n.value.getRecordById(f, S);
1956
+ l && (a.value = l.get("") || {});
1938
1957
  } catch {
1939
- i.value = ee(s);
1958
+ a.value = te(f);
1940
1959
  }
1941
1960
  } else
1942
- i.value = ee(s);
1943
- r.value && dt(s, S || "new", i, r.value), n.value.runAction(s, "load", S ? [S] : void 0);
1961
+ a.value = te(f);
1962
+ r.value && dt(f, S || "new", a, r.value), n.value.runAction(f, "load", S ? [S] : void 0);
1944
1963
  }
1945
1964
  }
1946
1965
  }
1947
- if (t.doctype) {
1966
+ if (o.doctype) {
1948
1967
  r.value = n.value.getStore();
1949
- const w = t.doctype, D = t.recordId;
1950
- if (D && D !== "new") {
1951
- const S = n.value.getRecordById(w, D);
1968
+ const _ = o.doctype, O = o.recordId;
1969
+ if (O && O !== "new") {
1970
+ const S = n.value.getRecordById(_, O);
1952
1971
  if (S)
1953
- i.value = S.get("") || {};
1972
+ a.value = S.get("") || {};
1954
1973
  else
1955
1974
  try {
1956
- await n.value.getRecord(w, D);
1957
- const d = n.value.getRecordById(w, D);
1958
- d && (i.value = d.get("") || {});
1975
+ await n.value.getRecord(_, O);
1976
+ const p = n.value.getRecordById(_, O);
1977
+ p && (a.value = p.get("") || {});
1959
1978
  } catch {
1960
- i.value = ee(w);
1979
+ a.value = te(_);
1961
1980
  }
1962
1981
  } else
1963
- i.value = ee(w);
1964
- r.value && dt(w, D || "new", i, r.value);
1982
+ a.value = te(_);
1983
+ r.value && dt(_, O || "new", a, r.value);
1965
1984
  }
1966
1985
  }
1967
1986
  });
1968
- const g = (w, D) => {
1969
- const S = t.doctype || a.value;
1987
+ const y = (_, O) => {
1988
+ const S = o.doctype || s.value;
1970
1989
  if (!S) return "";
1971
- const d = D || t.recordId || u.value || "new";
1972
- return `${S.slug}.${d}.${w}`;
1973
- }, $ = (w) => {
1974
- const D = t.doctype || a.value;
1975
- if (!(!r.value || !n.value || !D))
1990
+ const p = O || o.recordId || c.value || "new";
1991
+ return `${S.slug}.${p}.${_}`;
1992
+ }, D = (_) => {
1993
+ const O = o.doctype || s.value;
1994
+ if (!(!r.value || !n.value || !O))
1976
1995
  try {
1977
- const S = w.path.split(".");
1996
+ const S = _.path.split(".");
1978
1997
  if (S.length >= 2) {
1979
- const l = S[0], y = S[1];
1980
- if (r.value.has(`${l}.${y}`) || n.value.addRecord(D, y, { ...i.value }), S.length > 3) {
1981
- const N = `${l}.${y}`, j = S.slice(2);
1982
- let J = N;
1983
- for (let W = 0; W < j.length - 1; W++)
1984
- if (J += `.${j[W]}`, !r.value.has(J)) {
1985
- const te = j[W + 1], q = !isNaN(Number(te));
1986
- r.value.set(J, q ? [] : {});
1998
+ const i = S[0], l = S[1];
1999
+ if (r.value.has(`${i}.${l}`) || n.value.addRecord(O, l, { ...a.value }), S.length > 3) {
2000
+ const A = `${i}.${l}`, $ = S.slice(2);
2001
+ let W = A;
2002
+ for (let z = 0; z < $.length - 1; z++)
2003
+ if (W += `.${$[z]}`, !r.value.has(W)) {
2004
+ const Q = $[z + 1], _e = !isNaN(Number(Q));
2005
+ r.value.set(W, _e ? [] : {});
1987
2006
  }
1988
2007
  }
1989
2008
  }
1990
- r.value.set(w.path, w.value);
1991
- const d = w.fieldname.split("."), s = { ...i.value };
1992
- d.length === 1 ? s[d[0]] = w.value : Ro(s, d, w.value), i.value = s;
2009
+ r.value.set(_.path, _.value);
2010
+ const p = _.fieldname.split("."), f = { ...a.value };
2011
+ p.length === 1 ? f[p[0]] = _.value : $o(f, p, _.value), a.value = f;
1993
2012
  } catch {
1994
2013
  }
1995
2014
  };
1996
- (t.doctype || e?.router) && (Ge("hstPathProvider", g), Ge("hstChangeHandler", $));
1997
- const M = (w, D, S) => {
2015
+ (o.doctype || e?.router) && (Je("hstPathProvider", y), Je("hstChangeHandler", D));
2016
+ const F = (_, O, S) => {
1998
2017
  if (!n.value)
1999
- return ee(D);
2018
+ return te(O);
2000
2019
  if (S)
2001
2020
  try {
2002
- const d = r.value?.get(w);
2003
- return d && typeof d == "object" ? d : ee(D);
2021
+ const p = r.value?.get(_);
2022
+ return p && typeof p == "object" ? p : te(O);
2004
2023
  } catch {
2005
- return ee(D);
2024
+ return te(O);
2006
2025
  }
2007
- return ee(D);
2008
- }, k = async (w, D) => {
2026
+ return te(O);
2027
+ }, N = async (_, O) => {
2009
2028
  if (!r.value || !n.value)
2010
2029
  throw new Error("HST store not initialized");
2011
- const S = `${w.slug}.${D}`, d = { ...r.value.get(S) || {} }, s = w.schema ? Array.isArray(w.schema) ? w.schema : Array.from(w.schema) : [], l = (e ? e.resolveSchema(s) : s).filter(
2012
- (y) => "fieldtype" in y && y.fieldtype === "Doctype" && "schema" in y && Array.isArray(y.schema)
2030
+ const S = `${_.slug}.${O}`, p = { ...r.value.get(S) || {} }, f = _.schema ? Array.isArray(_.schema) ? _.schema : Array.from(_.schema) : [], i = (e ? e.resolveSchema(f) : f).filter(
2031
+ (l) => "fieldtype" in l && l.fieldtype === "Doctype" && "schema" in l && Array.isArray(l.schema)
2013
2032
  );
2014
- for (const y of l) {
2015
- const N = y, j = `${S}.${N.fieldname}`, J = Ot(N.schema, j, r.value);
2016
- d[N.fieldname] = J;
2033
+ for (const l of i) {
2034
+ const A = l, $ = `${S}.${A.fieldname}`, W = Nt(A.schema, $, r.value);
2035
+ p[A.fieldname] = W;
2017
2036
  }
2018
- return d;
2019
- }, T = (w, D) => ({
2020
- provideHSTPath: (S) => `${w}.${S}`,
2037
+ return p;
2038
+ }, V = (_, O) => ({
2039
+ provideHSTPath: (S) => `${_}.${S}`,
2021
2040
  handleHSTChange: (S) => {
2022
- const d = S.path.startsWith(w) ? S.path : `${w}.${S.fieldname}`;
2023
- $({
2041
+ const p = S.path.startsWith(_) ? S.path : `${_}.${S.fieldname}`;
2042
+ D({
2024
2043
  ...S,
2025
- path: d
2044
+ path: p
2026
2045
  });
2027
2046
  }
2028
- }), F = {
2029
- operations: f,
2030
- currentIndex: p,
2031
- undoRedoState: O,
2032
- canUndo: b,
2047
+ }), M = {
2048
+ operations: u,
2049
+ currentIndex: b,
2050
+ undoRedoState: k,
2051
+ canUndo: v,
2033
2052
  canRedo: h,
2034
- undoCount: _,
2053
+ undoCount: w,
2035
2054
  redoCount: m,
2036
- undo: R,
2037
- redo: x,
2038
- startBatch: H,
2055
+ undo: I,
2056
+ redo: P,
2057
+ startBatch: Z,
2039
2058
  commitBatch: U,
2040
- cancelBatch: K,
2041
- clear: G,
2042
- getOperationsFor: z,
2059
+ cancelBatch: G,
2060
+ clear: L,
2061
+ getOperationsFor: J,
2043
2062
  getSnapshot: E,
2044
2063
  markIrreversible: Y,
2045
2064
  logAction: B,
2046
- configure: v
2065
+ configure: g
2047
2066
  };
2048
- return t.doctype ? {
2067
+ return o.doctype ? {
2049
2068
  stonecrop: n,
2050
- operationLog: F,
2051
- provideHSTPath: g,
2052
- handleHSTChange: $,
2069
+ operationLog: M,
2070
+ provideHSTPath: y,
2071
+ handleHSTChange: D,
2053
2072
  hstStore: r,
2054
- formData: i,
2055
- resolvedSchema: c,
2056
- loadNestedData: M,
2057
- saveRecursive: k,
2058
- createNestedContext: T
2059
- } : !t.doctype && e?.router ? {
2073
+ formData: a,
2074
+ resolvedSchema: d,
2075
+ loadNestedData: F,
2076
+ saveRecursive: N,
2077
+ createNestedContext: V
2078
+ } : !o.doctype && e?.router ? {
2060
2079
  stonecrop: n,
2061
- operationLog: F,
2062
- provideHSTPath: g,
2063
- handleHSTChange: $,
2080
+ operationLog: M,
2081
+ provideHSTPath: y,
2082
+ handleHSTChange: D,
2064
2083
  hstStore: r,
2065
- formData: i,
2066
- resolvedSchema: c,
2067
- loadNestedData: M,
2068
- saveRecursive: k,
2069
- createNestedContext: T
2084
+ formData: a,
2085
+ resolvedSchema: d,
2086
+ loadNestedData: F,
2087
+ saveRecursive: N,
2088
+ createNestedContext: V
2070
2089
  } : {
2071
2090
  stonecrop: n,
2072
- operationLog: F
2091
+ operationLog: M
2073
2092
  };
2074
2093
  }
2075
- function ee(t) {
2094
+ function te(o) {
2076
2095
  const e = {};
2077
- return t.schema && t.schema.forEach((o) => {
2078
- switch ("fieldtype" in o ? o.fieldtype : "Data") {
2096
+ return o.schema && o.schema.forEach((t) => {
2097
+ switch ("fieldtype" in t ? t.fieldtype : "Data") {
2079
2098
  case "Data":
2080
2099
  case "Text":
2081
- e[o.fieldname] = "";
2100
+ e[t.fieldname] = "";
2082
2101
  break;
2083
2102
  case "Check":
2084
- e[o.fieldname] = !1;
2103
+ e[t.fieldname] = !1;
2085
2104
  break;
2086
2105
  case "Int":
2087
2106
  case "Float":
2088
- e[o.fieldname] = 0;
2107
+ e[t.fieldname] = 0;
2089
2108
  break;
2090
2109
  case "Table":
2091
- e[o.fieldname] = [];
2110
+ e[t.fieldname] = [];
2092
2111
  break;
2093
2112
  case "JSON":
2094
- e[o.fieldname] = {};
2113
+ e[t.fieldname] = {};
2095
2114
  break;
2096
2115
  default:
2097
- e[o.fieldname] = null;
2116
+ e[t.fieldname] = null;
2098
2117
  }
2099
2118
  }), e;
2100
2119
  }
2101
- function dt(t, e, o, n) {
2102
- L(
2103
- o,
2120
+ function dt(o, e, t, n) {
2121
+ H(
2122
+ t,
2104
2123
  (r) => {
2105
- const i = `${t.slug}.${e}`;
2106
- Object.keys(r).forEach((a) => {
2107
- const u = `${i}.${a}`;
2124
+ const a = `${o.slug}.${e}`;
2125
+ Object.keys(r).forEach((s) => {
2126
+ const c = `${a}.${s}`;
2108
2127
  try {
2109
- n.set(u, r[a]);
2128
+ n.set(c, r[s]);
2110
2129
  } catch {
2111
2130
  }
2112
2131
  });
@@ -2114,152 +2133,152 @@ function dt(t, e, o, n) {
2114
2133
  { deep: !0 }
2115
2134
  );
2116
2135
  }
2117
- function Ro(t, e, o) {
2118
- let n = t;
2119
- for (let i = 0; i < e.length - 1; i++) {
2120
- const a = e[i];
2121
- (!(a in n) || typeof n[a] != "object") && (n[a] = isNaN(Number(e[i + 1])) ? {} : []), n = n[a];
2136
+ function $o(o, e, t) {
2137
+ let n = o;
2138
+ for (let a = 0; a < e.length - 1; a++) {
2139
+ const s = e[a];
2140
+ (!(s in n) || typeof n[s] != "object") && (n[s] = isNaN(Number(e[a + 1])) ? {} : []), n = n[s];
2122
2141
  }
2123
2142
  const r = e[e.length - 1];
2124
- n[r] = o;
2143
+ n[r] = t;
2125
2144
  }
2126
- function Ot(t, e, o) {
2127
- const n = { ...o.get(e) || {} }, r = t.filter(
2128
- (i) => "fieldtype" in i && i.fieldtype === "Doctype" && "schema" in i && Array.isArray(i.schema)
2145
+ function Nt(o, e, t) {
2146
+ const n = { ...t.get(e) || {} }, r = o.filter(
2147
+ (a) => "fieldtype" in a && a.fieldtype === "Doctype" && "schema" in a && Array.isArray(a.schema)
2129
2148
  );
2130
- for (const i of r) {
2131
- const a = i, u = `${e}.${a.fieldname}`, c = Ot(a.schema, u, o);
2132
- n[a.fieldname] = c;
2149
+ for (const a of r) {
2150
+ const s = a, c = `${e}.${s.fieldname}`, d = Nt(s.schema, c, t);
2151
+ n[s.fieldname] = d;
2133
2152
  }
2134
2153
  return n;
2135
2154
  }
2136
2155
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
2137
- function Io(t, e) {
2138
- return Qe() ? (Xe(t, e), !0) : !1;
2156
+ function Ao(o, e) {
2157
+ return Xe() ? (Ye(o, e), !0) : !1;
2139
2158
  }
2140
2159
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
2141
- const Ao = () => {
2160
+ const Co = () => {
2142
2161
  };
2143
- function xo(...t) {
2144
- if (t.length !== 1) return re(...t);
2145
- const e = t[0];
2146
- return typeof e == "function" ? Te(Ye(() => ({
2162
+ function Io(...o) {
2163
+ if (o.length !== 1) return re(...o);
2164
+ const e = o[0];
2165
+ return typeof e == "function" ? Te(et(() => ({
2147
2166
  get: e,
2148
- set: Ao
2167
+ set: Co
2149
2168
  }))) : C(e);
2150
2169
  }
2151
- function Le(t) {
2152
- return typeof Window < "u" && t instanceof Window ? t.document.documentElement : typeof Document < "u" && t instanceof Document ? t.documentElement : t;
2170
+ function Be(o) {
2171
+ return typeof Window < "u" && o instanceof Window ? o.document.documentElement : typeof Document < "u" && o instanceof Document ? o.documentElement : o;
2153
2172
  }
2154
- const Be = /* @__PURE__ */ new WeakMap();
2155
- function To(t, e = !1) {
2156
- const o = Se(e);
2173
+ const We = /* @__PURE__ */ new WeakMap();
2174
+ function Ro(o, e = !1) {
2175
+ const t = Se(e);
2157
2176
  let n = "";
2158
- L(xo(t), (a) => {
2159
- const u = Le(Q(a));
2160
- if (u) {
2161
- const c = u;
2162
- if (Be.get(c) || Be.set(c, c.style.overflow), c.style.overflow !== "hidden" && (n = c.style.overflow), c.style.overflow === "hidden") return o.value = !0;
2163
- if (o.value) return c.style.overflow = "hidden";
2177
+ H(Io(o), (s) => {
2178
+ const c = Be(q(s));
2179
+ if (c) {
2180
+ const d = c;
2181
+ if (We.get(d) || We.set(d, d.style.overflow), d.style.overflow !== "hidden" && (n = d.style.overflow), d.style.overflow === "hidden") return t.value = !0;
2182
+ if (t.value) return d.style.overflow = "hidden";
2164
2183
  }
2165
2184
  }, { immediate: !0 });
2166
2185
  const r = () => {
2167
- const a = Le(Q(t));
2168
- !a || o.value || (a.style.overflow = "hidden", o.value = !0);
2169
- }, i = () => {
2170
- const a = Le(Q(t));
2171
- !a || !o.value || (a.style.overflow = n, Be.delete(a), o.value = !1);
2186
+ const s = Be(q(o));
2187
+ !s || t.value || (s.style.overflow = "hidden", t.value = !0);
2188
+ }, a = () => {
2189
+ const s = Be(q(o));
2190
+ !s || !t.value || (s.style.overflow = n, We.delete(s), t.value = !1);
2172
2191
  };
2173
- return Io(i), I({
2192
+ return Ao(a), R({
2174
2193
  get() {
2175
- return o.value;
2194
+ return t.value;
2176
2195
  },
2177
- set(a) {
2178
- a ? r() : i();
2196
+ set(s) {
2197
+ s ? r() : a();
2179
2198
  }
2180
2199
  });
2181
2200
  }
2182
- function Po() {
2183
- let t = !1;
2201
+ function xo() {
2202
+ let o = !1;
2184
2203
  const e = Se(!1);
2185
- return (o, n) => {
2186
- if (e.value = n.value, t) return;
2187
- t = !0;
2188
- const r = To(o, n.value);
2189
- L(e, (i) => r.value = i);
2204
+ return (t, n) => {
2205
+ if (e.value = n.value, o) return;
2206
+ o = !0;
2207
+ const r = Ro(t, n.value);
2208
+ H(e, (a) => r.value = a);
2190
2209
  };
2191
2210
  }
2192
- Po();
2193
- const Vo = (t, e) => {
2194
- const o = t.__vccOpts || t;
2211
+ xo();
2212
+ const Po = (o, e) => {
2213
+ const t = o.__vccOpts || o;
2195
2214
  for (const [n, r] of e)
2196
- o[n] = r;
2197
- return o;
2215
+ t[n] = r;
2216
+ return t;
2198
2217
  };
2199
- function jo(t, e) {
2200
- return Qe() ? (Xe(t, e), !0) : !1;
2218
+ function To(o, e) {
2219
+ return Xe() ? (Ye(o, e), !0) : !1;
2201
2220
  }
2202
2221
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
2203
- const Mo = () => {
2222
+ const Vo = () => {
2204
2223
  };
2205
- function Fo(...t) {
2206
- if (t.length !== 1) return re(...t);
2207
- const e = t[0];
2208
- return typeof e == "function" ? Te(Ye(() => ({
2224
+ function jo(...o) {
2225
+ if (o.length !== 1) return re(...o);
2226
+ const e = o[0];
2227
+ return typeof e == "function" ? Te(et(() => ({
2209
2228
  get: e,
2210
- set: Mo
2229
+ set: Vo
2211
2230
  }))) : C(e);
2212
2231
  }
2213
- function We(t) {
2214
- return typeof Window < "u" && t instanceof Window ? t.document.documentElement : typeof Document < "u" && t instanceof Document ? t.documentElement : t;
2232
+ function He(o) {
2233
+ return typeof Window < "u" && o instanceof Window ? o.document.documentElement : typeof Document < "u" && o instanceof Document ? o.documentElement : o;
2215
2234
  }
2216
- const He = /* @__PURE__ */ new WeakMap();
2217
- function Lo(t, e = !1) {
2218
- const o = Se(e);
2235
+ const Ue = /* @__PURE__ */ new WeakMap();
2236
+ function Mo(o, e = !1) {
2237
+ const t = Se(e);
2219
2238
  let n = "";
2220
- L(Fo(t), (a) => {
2221
- const u = We(Q(a));
2222
- if (u) {
2223
- const c = u;
2224
- if (He.get(c) || He.set(c, c.style.overflow), c.style.overflow !== "hidden" && (n = c.style.overflow), c.style.overflow === "hidden") return o.value = !0;
2225
- if (o.value) return c.style.overflow = "hidden";
2239
+ H(jo(o), (s) => {
2240
+ const c = He(q(s));
2241
+ if (c) {
2242
+ const d = c;
2243
+ if (Ue.get(d) || Ue.set(d, d.style.overflow), d.style.overflow !== "hidden" && (n = d.style.overflow), d.style.overflow === "hidden") return t.value = !0;
2244
+ if (t.value) return d.style.overflow = "hidden";
2226
2245
  }
2227
2246
  }, { immediate: !0 });
2228
2247
  const r = () => {
2229
- const a = We(Q(t));
2230
- !a || o.value || (a.style.overflow = "hidden", o.value = !0);
2231
- }, i = () => {
2232
- const a = We(Q(t));
2233
- !a || !o.value || (a.style.overflow = n, He.delete(a), o.value = !1);
2248
+ const s = He(q(o));
2249
+ !s || t.value || (s.style.overflow = "hidden", t.value = !0);
2250
+ }, a = () => {
2251
+ const s = He(q(o));
2252
+ !s || !t.value || (s.style.overflow = n, Ue.delete(s), t.value = !1);
2234
2253
  };
2235
- return jo(i), I({
2254
+ return To(a), R({
2236
2255
  get() {
2237
- return o.value;
2256
+ return t.value;
2238
2257
  },
2239
- set(a) {
2240
- a ? r() : i();
2258
+ set(s) {
2259
+ s ? r() : a();
2241
2260
  }
2242
2261
  });
2243
2262
  }
2244
- function Bo() {
2245
- let t = !1;
2263
+ function Fo() {
2264
+ let o = !1;
2246
2265
  const e = Se(!1);
2247
- return (o, n) => {
2248
- if (e.value = n.value, t) return;
2249
- t = !0;
2250
- const r = Lo(o, n.value);
2251
- L(e, (i) => r.value = i);
2266
+ return (t, n) => {
2267
+ if (e.value = n.value, o) return;
2268
+ o = !0;
2269
+ const r = Mo(t, n.value);
2270
+ H(e, (a) => r.value = a);
2252
2271
  };
2253
2272
  }
2254
- Bo();
2273
+ Fo();
2255
2274
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
2256
- const Wo = { class: "aform" }, Ho = {
2275
+ const Lo = { class: "aform" }, Bo = {
2257
2276
  key: 0,
2258
2277
  class: "aform-nested-section"
2259
- }, Uo = {
2278
+ }, Wo = {
2260
2279
  key: 0,
2261
2280
  class: "aform-nested-label"
2262
- }, zo = /* @__PURE__ */ we({
2281
+ }, Ho = /* @__PURE__ */ we({
2263
2282
  __name: "AForm",
2264
2283
  props: /* @__PURE__ */ ot({
2265
2284
  schema: {},
@@ -2269,110 +2288,110 @@ const Wo = { class: "aform" }, Ho = {
2269
2288
  dataModifiers: {}
2270
2289
  }),
2271
2290
  emits: /* @__PURE__ */ ot(["update:schema", "update:data"], ["update:data"]),
2272
- setup(t, { emit: e }) {
2273
- const o = e, n = xt(t, "data"), r = C({});
2274
- L(
2291
+ setup(o, { emit: e }) {
2292
+ const t = e, n = It(o, "data"), r = C({});
2293
+ H(
2275
2294
  () => n.value,
2276
- (b) => {
2277
- !t.schema || !b || t.schema.forEach((h) => {
2278
- "schema" in h && Array.isArray(h.schema) && h.schema.length > 0 && (r.value[h.fieldname] = b[h.fieldname] ?? {});
2295
+ (v) => {
2296
+ !o.schema || !v || o.schema.forEach((h) => {
2297
+ "schema" in h && Array.isArray(h.schema) && h.schema.length > 0 && (r.value[h.fieldname] = v[h.fieldname] ?? {});
2279
2298
  });
2280
2299
  },
2281
2300
  { immediate: !0 }
2282
2301
  );
2283
- const i = (b, h) => {
2284
- r.value[b] = h, n.value && (n.value[b] = h, o("update:data", { ...n.value }));
2285
- }, a = (b) => {
2302
+ const a = (v, h) => {
2303
+ r.value[v] = h, n.value && (n.value[v] = h, t("update:data", { ...n.value }));
2304
+ }, s = (v) => {
2286
2305
  const h = {};
2287
- for (const [_, m] of Object.entries(b))
2288
- ["component", "fieldtype", "mode"].includes(_) || (h[_] = m), _ === "rows" && (!m || Array.isArray(m) && m.length === 0) && (h.rows = n.value[b.fieldname] || []);
2306
+ for (const [w, m] of Object.entries(v))
2307
+ ["component", "fieldtype", "mode"].includes(w) || (h[w] = m), w === "rows" && (!m || Array.isArray(m) && m.length === 0) && (h.rows = n.value[v.fieldname] || []);
2289
2308
  return h;
2290
- }, u = I(() => t.mode ?? "edit");
2291
- function c(b) {
2292
- return b.mode || u.value;
2309
+ }, c = R(() => o.mode ?? "edit");
2310
+ function d(v) {
2311
+ return v.mode || c.value;
2293
2312
  }
2294
- const f = C([]);
2295
- Tt(() => {
2296
- t.schema && f.value.length !== t.schema.length && (f.value = t.schema.map((b, h) => I({
2313
+ const u = C([]);
2314
+ Rt(() => {
2315
+ o.schema && u.value.length !== o.schema.length && (u.value = o.schema.map((v, h) => R({
2297
2316
  get() {
2298
- return n.value?.[t.schema[h].fieldname];
2317
+ return n.value?.[o.schema[h].fieldname];
2299
2318
  },
2300
- set: (_) => {
2301
- const m = t.schema[h].fieldname;
2302
- m && n.value && (n.value[m] = _, o("update:data", { ...n.value })), o("update:schema", t.schema);
2319
+ set: (w) => {
2320
+ const m = o.schema[h].fieldname;
2321
+ m && n.value && (n.value[m] = w, t("update:data", { ...n.value })), t("update:schema", o.schema);
2303
2322
  }
2304
2323
  })));
2305
2324
  });
2306
- const p = I(() => f.value);
2307
- return (b, h) => {
2308
- const _ = yt("AForm", !0);
2309
- return P(), V("form", Wo, [
2310
- (P(!0), V(de, null, me(t.schema, (m, O) => (P(), V(de, { key: O }, [
2311
- "schema" in m && Array.isArray(m.schema) && m.schema.length > 0 ? (P(), V("div", Ho, [
2312
- m.label ? (P(), V("h4", Uo, X(m.label), 1)) : ue("", !0),
2313
- ne(_, {
2325
+ const b = R(() => u.value);
2326
+ return (v, h) => {
2327
+ const w = mt("AForm", !0);
2328
+ return T(), j("form", Lo, [
2329
+ (T(!0), j(ue, null, ye(o.schema, (m, k) => (T(), j(ue, { key: k }, [
2330
+ "schema" in m && Array.isArray(m.schema) && m.schema.length > 0 ? (T(), j("div", Bo, [
2331
+ m.label ? (T(), j("h4", Wo, X(m.label), 1)) : ce("", !0),
2332
+ ne(w, {
2314
2333
  data: r.value[m.fieldname],
2315
- mode: c(m),
2334
+ mode: d(m),
2316
2335
  schema: m.schema,
2317
- "onUpdate:data": (R) => i(m.fieldname, R)
2336
+ "onUpdate:data": (I) => a(m.fieldname, I)
2318
2337
  }, null, 8, ["data", "mode", "schema", "onUpdate:data"])
2319
- ])) : (P(), Ze(Pt(m.component), Vt({
2338
+ ])) : (T(), Qe(xt(m.component), Pt({
2320
2339
  key: 1,
2321
- modelValue: p.value[O].value,
2322
- "onUpdate:modelValue": (R) => p.value[O].value = R,
2340
+ modelValue: b.value[k].value,
2341
+ "onUpdate:modelValue": (I) => b.value[k].value = I,
2323
2342
  schema: m,
2324
2343
  data: n.value[m.fieldname],
2325
- mode: c(m)
2326
- }, { ref_for: !0 }, a(m)), null, 16, ["modelValue", "onUpdate:modelValue", "schema", "data", "mode"]))
2344
+ mode: d(m)
2345
+ }, { ref_for: !0 }, s(m)), null, 16, ["modelValue", "onUpdate:modelValue", "schema", "data", "mode"]))
2327
2346
  ], 64))), 128))
2328
2347
  ]);
2329
2348
  };
2330
2349
  }
2331
- }), Go = /* @__PURE__ */ Vo(zo, [["__scopeId", "data-v-5c01cea5"]]), Jo = { class: "tabs" }, Ko = { tabindex: "0" }, qo = { tabindex: "0" }, Zo = /* @__PURE__ */ we({
2350
+ }), Uo = /* @__PURE__ */ Po(Ho, [["__scopeId", "data-v-5c01cea5"]]), zo = { class: "tabs" }, Go = { tabindex: "0" }, Jo = { tabindex: "0" }, Ko = /* @__PURE__ */ we({
2332
2351
  __name: "SheetNav",
2333
2352
  props: {
2334
2353
  breadcrumbs: { default: () => [] }
2335
2354
  },
2336
- setup(t) {
2337
- const e = C(!0), o = C(!1), n = C(""), r = ft("searchinput"), i = I(() => e.value ? "unrotated" : "rotated"), a = () => {
2355
+ setup(o) {
2356
+ const e = C(!0), t = C(!1), n = C(""), r = pt("searchinput"), a = R(() => e.value ? "unrotated" : "rotated"), s = () => {
2338
2357
  e.value = !e.value;
2339
- }, u = async () => {
2340
- o.value = !o.value, await ae(() => {
2358
+ }, c = async () => {
2359
+ t.value = !t.value, await de(() => {
2341
2360
  r.value?.focus();
2342
2361
  });
2343
- }, c = (b) => {
2344
- b.preventDefault(), b.stopPropagation();
2345
- }, f = async (b) => {
2346
- b.preventDefault(), b.stopPropagation(), await u();
2347
- }, p = () => {
2362
+ }, d = (v) => {
2363
+ v.preventDefault(), v.stopPropagation();
2364
+ }, u = async (v) => {
2365
+ v.preventDefault(), v.stopPropagation(), await c();
2366
+ }, b = () => {
2348
2367
  };
2349
- return (b, h) => {
2350
- const _ = yt("router-link");
2351
- return P(), V("footer", null, [
2352
- A("ul", Jo, [
2353
- A("li", {
2368
+ return (v, h) => {
2369
+ const w = mt("router-link");
2370
+ return T(), j("footer", null, [
2371
+ x("ul", zo, [
2372
+ x("li", {
2354
2373
  class: "hidebreadcrumbs",
2355
- onClick: a,
2356
- onKeydown: pe(a, ["enter"])
2374
+ onClick: s,
2375
+ onKeydown: fe(s, ["enter"])
2357
2376
  }, [
2358
- A("a", Ko, [
2359
- A("div", {
2360
- class: Oe(i.value)
2377
+ x("a", Go, [
2378
+ x("div", {
2379
+ class: De(a.value)
2361
2380
  }, "×", 2)
2362
2381
  ])
2363
2382
  ], 32),
2364
- A("li", {
2383
+ x("li", {
2365
2384
  class: "hometab",
2366
- style: Ve({ display: e.value ? "block" : "none" }),
2367
- onClick: p,
2368
- onKeydown: pe(p, ["enter"])
2385
+ style: je({ display: e.value ? "block" : "none" }),
2386
+ onClick: b,
2387
+ onKeydown: fe(b, ["enter"])
2369
2388
  }, [
2370
- ne(_, {
2389
+ ne(w, {
2371
2390
  to: "/",
2372
2391
  tabindex: "0"
2373
2392
  }, {
2374
- default: ye(() => [...h[5] || (h[5] = [
2375
- A("svg", {
2393
+ default: me(() => [...h[5] || (h[5] = [
2394
+ x("svg", {
2376
2395
  class: "icon",
2377
2396
  "aria-label": "Home",
2378
2397
  viewBox: "0 0 24 24",
@@ -2380,19 +2399,19 @@ const Wo = { class: "aform" }, Ho = {
2380
2399
  stroke: "currentColor",
2381
2400
  "stroke-width": "2"
2382
2401
  }, [
2383
- A("path", { d: "M3 12l9-9 9 9" }),
2384
- A("path", { d: "M9 21V12h6v9" })
2402
+ x("path", { d: "M3 12l9-9 9 9" }),
2403
+ x("path", { d: "M9 21V12h6v9" })
2385
2404
  ], -1)
2386
2405
  ])]),
2387
2406
  _: 1
2388
2407
  })
2389
2408
  ], 36),
2390
- A("li", {
2391
- class: Oe(["searchtab", { "search-active": o.value }]),
2392
- style: Ve({ display: e.value ? "block" : "none" })
2409
+ x("li", {
2410
+ class: De(["searchtab", { "search-active": t.value }]),
2411
+ style: je({ display: e.value ? "block" : "none" })
2393
2412
  }, [
2394
- A("a", qo, [
2395
- Ne((P(), V("svg", {
2413
+ x("a", Jo, [
2414
+ $e((T(), j("svg", {
2396
2415
  class: "icon search-icon",
2397
2416
  role: "button",
2398
2417
  "aria-label": "Search",
@@ -2400,47 +2419,47 @@ const Wo = { class: "aform" }, Ho = {
2400
2419
  fill: "none",
2401
2420
  stroke: "currentColor",
2402
2421
  "stroke-width": "2",
2403
- onClick: u,
2404
- onKeydown: pe(u, ["enter"])
2422
+ onClick: c,
2423
+ onKeydown: fe(c, ["enter"])
2405
2424
  }, [...h[6] || (h[6] = [
2406
- A("circle", {
2425
+ x("circle", {
2407
2426
  cx: "11",
2408
2427
  cy: "11",
2409
2428
  r: "7"
2410
2429
  }, null, -1),
2411
- A("path", { d: "M21 21l-4.35-4.35" }, null, -1)
2430
+ x("path", { d: "M21 21l-4.35-4.35" }, null, -1)
2412
2431
  ])], 544)), [
2413
- [Ue, !o.value]
2432
+ [ze, !t.value]
2414
2433
  ]),
2415
- Ne(A("input", {
2434
+ $e(x("input", {
2416
2435
  ref: "searchinput",
2417
2436
  "onUpdate:modelValue": h[0] || (h[0] = (m) => n.value = m),
2418
2437
  type: "text",
2419
2438
  placeholder: "Search...",
2420
- onClick: h[1] || (h[1] = pt(() => {
2439
+ onClick: h[1] || (h[1] = ft(() => {
2421
2440
  }, ["stop"])),
2422
- onInput: h[2] || (h[2] = (m) => c(m)),
2423
- onBlur: h[3] || (h[3] = (m) => f(m)),
2441
+ onInput: h[2] || (h[2] = (m) => d(m)),
2442
+ onBlur: h[3] || (h[3] = (m) => u(m)),
2424
2443
  onKeydown: [
2425
- h[4] || (h[4] = pe((m) => f(m), ["enter"])),
2426
- pe(u, ["escape"])
2444
+ h[4] || (h[4] = fe((m) => u(m), ["enter"])),
2445
+ fe(c, ["escape"])
2427
2446
  ]
2428
2447
  }, null, 544), [
2429
- [Ue, o.value],
2448
+ [ze, t.value],
2430
2449
  [ht, n.value]
2431
2450
  ])
2432
2451
  ])
2433
2452
  ], 6),
2434
- (P(!0), V(de, null, me(t.breadcrumbs, (m) => (P(), V("li", {
2453
+ (T(!0), j(ue, null, ye(o.breadcrumbs, (m) => (T(), j("li", {
2435
2454
  key: m.title,
2436
- style: Ve({ display: e.value ? "block" : "none" })
2455
+ style: je({ display: e.value ? "block" : "none" })
2437
2456
  }, [
2438
- ne(_, {
2457
+ ne(w, {
2439
2458
  tabindex: "0",
2440
2459
  to: m.to
2441
2460
  }, {
2442
- default: ye(() => [
2443
- $e(X(m.title), 1)
2461
+ default: me(() => [
2462
+ Ae(X(m.title), 1)
2444
2463
  ]),
2445
2464
  _: 2
2446
2465
  }, 1032, ["to"])
@@ -2449,135 +2468,117 @@ const Wo = { class: "aform" }, Ho = {
2449
2468
  ]);
2450
2469
  };
2451
2470
  }
2452
- }), Nt = /* @__PURE__ */ bt(Zo, [["__scopeId", "data-v-eb5bcbb6"]]), Qo = {
2471
+ }), Dt = /* @__PURE__ */ bt(Ko, [["__scopeId", "data-v-eb5bcbb6"]]), qo = {
2453
2472
  key: 1,
2454
2473
  class: "loading"
2455
- }, Xo = {
2474
+ }, Zo = {
2456
2475
  key: 2,
2457
2476
  class: "loading"
2458
- }, Yo = /* @__PURE__ */ we({
2477
+ }, Qo = /* @__PURE__ */ we({
2459
2478
  __name: "Desktop",
2460
2479
  props: {
2461
- availableDoctypes: { default: () => [] }
2480
+ availableDoctypes: {},
2481
+ routeAdapter: {},
2482
+ confirmFn: { type: Function }
2462
2483
  },
2463
- setup(t) {
2464
- const { stonecrop: e } = Co(), o = C(!1), n = C(!1), r = C(!1), i = I({
2484
+ emits: ["action", "navigate", "record:open"],
2485
+ setup(o, { emit: e }) {
2486
+ const t = o, n = e, { availableDoctypes: r = [] } = t, { stonecrop: a } = Do(), s = C(!1), c = C(!1), d = R({
2465
2487
  get() {
2466
- if (!e.value || !c.value || !p.value)
2488
+ if (!a.value || !v.value || !w.value)
2467
2489
  return {};
2468
2490
  try {
2469
- return { ...e.value.getRecordById(c.value, p.value)?.get("") || {} };
2491
+ return { ...a.value.getRecordById(v.value, w.value)?.get("") || {} };
2470
2492
  } catch {
2471
2493
  return {};
2472
2494
  }
2473
2495
  },
2474
- set(s) {
2475
- if (!(!e.value || !c.value || !p.value))
2496
+ set(i) {
2497
+ if (!(!a.value || !v.value || !w.value))
2476
2498
  try {
2477
- const l = e.value.getStore();
2478
- for (const [y, N] of Object.entries(s)) {
2479
- const j = `${c.value}.${p.value}.${y}`;
2480
- (l.has(j) ? l.get(j) : void 0) !== N && l.set(j, N);
2499
+ const l = a.value.getStore();
2500
+ for (const [A, $] of Object.entries(i)) {
2501
+ const W = `${v.value}.${w.value}.${A}`;
2502
+ (l.has(W) ? l.get(W) : void 0) !== $ && l.set(W, $);
2481
2503
  }
2482
2504
  } catch (l) {
2483
2505
  console.warn("HST update failed:", l);
2484
2506
  }
2485
2507
  }
2486
- }), a = I(() => De(e.value?.registry.router?.currentRoute)), u = I(() => e.value?.registry.router), c = I(() => {
2487
- if (!a.value) return "";
2488
- if (a.value.meta?.actualDoctype)
2489
- return a.value.meta.actualDoctype;
2490
- if (a.value.params.doctype)
2491
- return a.value.params.doctype;
2492
- const s = a.value.params.pathMatch;
2493
- return s && s.length > 0 ? s[0] : "";
2494
- }), f = I(() => {
2495
- if (!a.value) return "";
2496
- if (a.value.meta?.doctype)
2497
- return a.value.meta.doctype;
2498
- if (a.value.params.doctype)
2499
- return a.value.params.doctype;
2500
- const s = a.value.params.pathMatch;
2501
- return s && s.length > 0 ? s[0] : "";
2502
- }), p = I(() => {
2503
- if (!a.value) return "";
2504
- if (a.value.params.recordId)
2505
- return a.value.params.recordId;
2506
- const s = a.value.params.pathMatch;
2507
- return s && s.length > 1 ? s[1] : "";
2508
- }), b = I(() => p.value?.startsWith("new-")), h = I(() => {
2509
- if (!a.value || a.value.name === "home" || a.value.path === "/")
2508
+ }), u = R(() => t.routeAdapter ? null : Ne(a.value?.registry.router?.currentRoute)), b = R(() => t.routeAdapter ? null : a.value?.registry.router), v = R(() => {
2509
+ if (t.routeAdapter) return t.routeAdapter.getCurrentDoctype();
2510
+ if (!u.value) return "";
2511
+ if (u.value.meta?.actualDoctype)
2512
+ return u.value.meta.actualDoctype;
2513
+ if (u.value.params.doctype)
2514
+ return u.value.params.doctype;
2515
+ const i = u.value.params.pathMatch;
2516
+ return i && i.length > 0 ? i[0] : "";
2517
+ }), h = R(() => {
2518
+ if (t.routeAdapter) return t.routeAdapter.getCurrentDoctype();
2519
+ if (!u.value) return "";
2520
+ if (u.value.meta?.doctype)
2521
+ return u.value.meta.doctype;
2522
+ if (u.value.params.doctype)
2523
+ return u.value.params.doctype;
2524
+ const i = u.value.params.pathMatch;
2525
+ return i && i.length > 0 ? i[0] : "";
2526
+ }), w = R(() => {
2527
+ if (t.routeAdapter) return t.routeAdapter.getCurrentRecordId();
2528
+ if (!u.value) return "";
2529
+ if (u.value.params.recordId)
2530
+ return u.value.params.recordId;
2531
+ const i = u.value.params.pathMatch;
2532
+ return i && i.length > 1 ? i[1] : "";
2533
+ }), m = R(() => w.value?.startsWith("new-")), k = R(() => {
2534
+ if (t.routeAdapter) return t.routeAdapter.getCurrentView();
2535
+ if (!u.value || u.value.name === "home" || u.value.path === "/")
2510
2536
  return "doctypes";
2511
- if (a.value.name && a.value.name !== "catch-all") {
2512
- const l = a.value.name;
2513
- if (l.includes("form") || a.value.params.recordId)
2537
+ if (u.value.name && u.value.name !== "catch-all") {
2538
+ const l = u.value.name;
2539
+ if (l.includes("form") || u.value.params.recordId)
2514
2540
  return "record";
2515
- if (l.includes("list") || a.value.params.doctype)
2541
+ if (l.includes("list") || u.value.params.doctype)
2516
2542
  return "records";
2517
2543
  }
2518
- const s = a.value.params.pathMatch;
2519
- return s && s.length > 0 ? s.length === 1 ? "records" : "record" : "doctypes";
2520
- }), _ = () => {
2521
- if (!e.value || !c.value || !p.value)
2544
+ const i = u.value.params.pathMatch;
2545
+ return i && i.length > 0 ? i.length === 1 ? "records" : "record" : "doctypes";
2546
+ }), I = () => {
2547
+ if (!a.value || !v.value || !w.value)
2522
2548
  return [];
2523
2549
  try {
2524
- const l = e.value.registry.registry[c.value];
2525
- if (!l?.workflow?.states)
2526
- return [];
2527
- const y = b.value ? "creating" : "editing", N = l.workflow.states[y];
2528
- return N?.on ? Object.keys(N.on).map((W) => {
2529
- const te = N.on?.[W], q = typeof te == "string" ? te : "unknown", $t = async () => {
2530
- const et = e.value?.getRecordById(c.value, p.value);
2531
- if (et) {
2532
- const Ct = i.value || {};
2533
- await et.triggerTransition(W, {
2534
- currentState: y,
2535
- targetState: q,
2536
- fsmContext: Ct
2537
- });
2538
- }
2539
- };
2540
- return {
2541
- label: `${W} (→ ${q})`,
2542
- action: $t
2543
- };
2544
- }) : [];
2545
- } catch (s) {
2546
- return console.warn("Error getting available transitions:", s), [];
2550
+ const i = a.value.registry.getDoctype(v.value);
2551
+ if (!i?.workflow) return [];
2552
+ const l = a.value.getRecordState(v.value, w.value), A = i.getAvailableTransitions(l), $ = d.value || {};
2553
+ return A.map(({ name: W, targetState: z }) => ({
2554
+ label: `${W} ( ${z})`,
2555
+ action: () => {
2556
+ n("action", {
2557
+ name: W,
2558
+ doctype: v.value,
2559
+ recordId: w.value,
2560
+ data: $
2561
+ });
2562
+ }
2563
+ }));
2564
+ } catch (i) {
2565
+ return console.warn("Error getting available transitions:", i), [];
2547
2566
  }
2548
- }, m = I(() => {
2549
- const s = [];
2550
- switch (h.value) {
2551
- case "doctypes":
2552
- s.push({
2567
+ }, P = R(() => {
2568
+ const i = [];
2569
+ switch (k.value) {
2570
+ case "records":
2571
+ i.push({
2553
2572
  type: "button",
2554
- label: "Refresh",
2573
+ label: "New Record",
2555
2574
  action: () => {
2556
- window.location.reload();
2575
+ g();
2557
2576
  }
2558
2577
  });
2559
2578
  break;
2560
- case "records":
2561
- s.push(
2562
- {
2563
- type: "button",
2564
- label: "New Record",
2565
- action: () => {
2566
- z();
2567
- }
2568
- },
2569
- {
2570
- type: "button",
2571
- label: "Refresh",
2572
- action: () => {
2573
- window.location.reload();
2574
- }
2575
- }
2576
- );
2577
- break;
2578
2579
  case "record": {
2579
- const l = _();
2580
- l.length > 0 && s.push({
2580
+ const l = I();
2581
+ l.length > 0 && i.push({
2581
2582
  type: "dropdown",
2582
2583
  label: "Actions",
2583
2584
  actions: l
@@ -2585,77 +2586,80 @@ const Wo = { class: "aform" }, Ho = {
2585
2586
  break;
2586
2587
  }
2587
2588
  }
2588
- return s;
2589
- }), O = I(() => {
2590
- const s = [];
2591
- return h.value === "records" && f.value ? s.push(
2592
- { title: "Home", to: "/" },
2593
- { title: H(f.value), to: `/${f.value}` }
2594
- ) : h.value === "record" && f.value && s.push(
2595
- { title: "Home", to: "/" },
2596
- { title: H(f.value), to: `/${f.value}` },
2597
- { title: b.value ? "New Record" : "Edit Record", to: a.value?.fullPath || "" }
2598
- ), s;
2599
- }), R = (s) => {
2589
+ return i;
2590
+ }), Z = R(() => {
2591
+ const i = [];
2592
+ if (k.value === "records" && h.value)
2593
+ i.push(
2594
+ { title: "Home", to: "/" },
2595
+ { title: L(h.value), to: `/${h.value}` }
2596
+ );
2597
+ else if (k.value === "record" && h.value) {
2598
+ const l = w.value ? `/${h.value}/${w.value}` : u.value?.fullPath ?? "";
2599
+ i.push(
2600
+ { title: "Home", to: "/" },
2601
+ { title: L(h.value), to: `/${h.value}` },
2602
+ { title: m.value ? "New Record" : "Edit Record", to: l }
2603
+ );
2604
+ }
2605
+ return i;
2606
+ }), U = (i) => {
2600
2607
  const l = [
2601
2608
  {
2602
2609
  title: "Go Home",
2603
2610
  description: "Navigate to the home page",
2604
2611
  action: () => {
2605
- u.value?.push("/");
2612
+ E({ view: "doctypes" });
2606
2613
  }
2607
2614
  },
2608
2615
  {
2609
2616
  title: "Toggle Command Palette",
2610
2617
  description: "Open/close the command palette",
2611
- action: () => r.value = !r.value
2618
+ action: () => c.value = !c.value
2612
2619
  }
2613
2620
  ];
2614
- return f.value && (l.push({
2615
- title: `View ${H(f.value)} Records`,
2616
- description: `Navigate to ${f.value} list`,
2621
+ return h.value && (l.push({
2622
+ title: `View ${L(h.value)} Records`,
2623
+ description: `Navigate to ${h.value} list`,
2617
2624
  action: () => {
2618
- u.value?.push(`/${f.value}`);
2625
+ E({ view: "records", doctype: h.value });
2619
2626
  }
2620
2627
  }), l.push({
2621
- title: `Create New ${H(f.value)}`,
2622
- description: `Create a new ${f.value} record`,
2628
+ title: `Create New ${L(h.value)}`,
2629
+ description: `Create a new ${h.value} record`,
2623
2630
  action: () => {
2624
- z();
2631
+ g();
2625
2632
  }
2626
- })), t.availableDoctypes.forEach((y) => {
2633
+ })), r.forEach((A) => {
2627
2634
  l.push({
2628
- title: `View ${H(y)}`,
2629
- description: `Navigate to ${y} list`,
2635
+ title: `View ${L(A)}`,
2636
+ description: `Navigate to ${A} list`,
2630
2637
  action: () => {
2631
- u.value?.push(`/${y}`);
2638
+ E({ view: "records", doctype: A });
2632
2639
  }
2633
2640
  });
2634
- }), s ? l.filter(
2635
- (y) => y.title.toLowerCase().includes(s.toLowerCase()) || y.description.toLowerCase().includes(s.toLowerCase())
2641
+ }), i ? l.filter(
2642
+ (A) => A.title.toLowerCase().includes(i.toLowerCase()) || A.description.toLowerCase().includes(i.toLowerCase())
2636
2643
  ) : l;
2637
- }, x = (s) => {
2638
- s.action(), r.value = !1;
2639
- }, H = (s) => s.split("-").map((l) => l.charAt(0).toUpperCase() + l.slice(1)).join(" "), U = (s) => e.value ? e.value.getRecordIds(s).length : 0, K = async (s) => {
2640
- await u.value?.push(`/${s}`);
2641
- }, G = async (s) => {
2642
- await u.value?.push(`/${f.value}/${s}`);
2643
- }, z = async () => {
2644
- const s = `new-${Date.now()}`;
2645
- await u.value?.push(`/${f.value}/${s}`);
2646
- }, E = (s) => {
2647
- if (e.value)
2648
- try {
2649
- e.value.records(s);
2650
- } catch {
2651
- }
2652
- }, Y = () => {
2653
- if (!t.availableDoctypes.length) return [];
2654
- const s = t.availableDoctypes.map((l) => ({
2644
+ }, G = (i) => {
2645
+ i.action(), c.value = !1;
2646
+ }, L = (i) => i.split("-").map((l) => l.charAt(0).toUpperCase() + l.slice(1)).join(" "), J = (i) => a.value ? a.value.getRecordIds(i).length : 0, E = async (i) => {
2647
+ n("navigate", i), t.routeAdapter ? await t.routeAdapter.navigate(i) : i.view === "doctypes" ? await b.value?.push("/") : i.view === "records" && i.doctype ? await b.value?.push(`/${i.doctype}`) : i.view === "record" && i.doctype && i.recordId && await b.value?.push(`/${i.doctype}/${i.recordId}`);
2648
+ }, Y = async (i) => {
2649
+ await E({ view: "records", doctype: i });
2650
+ }, B = async (i) => {
2651
+ const l = h.value;
2652
+ n("record:open", { doctype: l, recordId: i }), await E({ view: "record", doctype: l, recordId: i });
2653
+ }, g = async () => {
2654
+ const i = `new-${Date.now()}`;
2655
+ await E({ view: "record", doctype: h.value, recordId: i });
2656
+ }, y = () => {
2657
+ if (!r.length) return [];
2658
+ const i = r.map((l) => ({
2655
2659
  id: l,
2656
2660
  doctype: l,
2657
- display_name: H(l),
2658
- record_count: U(l),
2661
+ display_name: L(l),
2662
+ record_count: J(l),
2659
2663
  actions: "View Records"
2660
2664
  }));
2661
2665
  return [
@@ -2700,19 +2704,19 @@ const Wo = { class: "aform" }, Ho = {
2700
2704
  view: "list",
2701
2705
  fullWidth: !0
2702
2706
  },
2703
- rows: s
2707
+ rows: i
2704
2708
  }
2705
2709
  ];
2706
- }, B = () => {
2707
- if (!c.value) return [];
2708
- if (!e.value) return [];
2709
- const s = g(), l = $();
2710
+ }, D = () => {
2711
+ if (!v.value) return [];
2712
+ if (!a.value) return [];
2713
+ const i = N(), l = V();
2710
2714
  if (l.length === 0)
2711
2715
  return [];
2712
- const y = s.map((N) => ({
2713
- ...N,
2716
+ const A = i.map(($) => ({
2717
+ ...$,
2714
2718
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
2715
- id: N.id || "",
2719
+ id: $.id || "",
2716
2720
  actions: "Edit | Delete"
2717
2721
  }));
2718
2722
  return [
@@ -2720,10 +2724,10 @@ const Wo = { class: "aform" }, Ho = {
2720
2724
  fieldname: "records_table",
2721
2725
  component: "ATable",
2722
2726
  columns: [
2723
- ...l.map((N) => ({
2724
- label: N.label,
2725
- name: N.fieldname,
2726
- fieldtype: N.fieldtype,
2727
+ ...l.map(($) => ({
2728
+ label: $.label,
2729
+ name: $.fieldname,
2730
+ fieldtype: $.fieldtype,
2727
2731
  align: "left",
2728
2732
  edit: !1,
2729
2733
  width: "20ch"
@@ -2741,235 +2745,172 @@ const Wo = { class: "aform" }, Ho = {
2741
2745
  view: "list",
2742
2746
  fullWidth: !0
2743
2747
  },
2744
- rows: y
2748
+ rows: A
2745
2749
  }
2746
2750
  ];
2747
- }, v = () => {
2748
- if (!c.value) return [];
2749
- if (!e.value) return [];
2751
+ }, F = () => {
2752
+ if (!v.value) return [];
2753
+ if (!a.value) return [];
2750
2754
  try {
2751
- const l = e.value?.registry?.registry[c.value];
2755
+ const l = a.value?.registry?.registry[v.value];
2752
2756
  return l?.schema ? "toArray" in l.schema ? l.schema.toArray() : l.schema : [];
2753
2757
  } catch {
2754
2758
  return [];
2755
2759
  }
2756
- }, g = () => {
2757
- if (!e.value || !c.value)
2760
+ }, N = () => {
2761
+ if (!a.value || !v.value)
2758
2762
  return [];
2759
- const l = e.value.records(c.value)?.get("");
2763
+ const l = a.value.records(v.value)?.get("");
2760
2764
  return l && typeof l == "object" && !Array.isArray(l) ? Object.values(l) : [];
2761
- }, $ = () => {
2762
- if (!e.value || !c.value) return [];
2765
+ }, V = () => {
2766
+ if (!a.value || !v.value) return [];
2763
2767
  try {
2764
- const l = e.value.registry.registry[c.value];
2768
+ const l = a.value.registry.registry[v.value];
2765
2769
  if (l?.schema)
2766
- return ("toArray" in l.schema ? l.schema.toArray() : l.schema).map((N) => ({
2767
- fieldname: N.fieldname,
2768
- label: "label" in N && N.label || N.fieldname,
2769
- fieldtype: "fieldtype" in N && N.fieldtype || "Data"
2770
+ return ("toArray" in l.schema ? l.schema.toArray() : l.schema).map(($) => ({
2771
+ fieldname: $.fieldname,
2772
+ label: "label" in $ && $.label || $.fieldname,
2773
+ fieldtype: "fieldtype" in $ && $.fieldtype || "Data"
2770
2774
  }));
2771
2775
  } catch {
2772
2776
  }
2773
2777
  return [];
2774
- }, M = I(() => {
2775
- switch (h.value) {
2778
+ }, M = R(() => {
2779
+ switch (k.value) {
2776
2780
  case "doctypes":
2777
- return Y();
2781
+ return y();
2778
2782
  case "records":
2779
- return B();
2783
+ return D();
2780
2784
  case "record":
2781
- return v();
2785
+ return F();
2782
2786
  default:
2783
2787
  return [];
2784
2788
  }
2785
- }), k = async () => {
2786
- if (e.value) {
2787
- n.value = !0;
2788
- try {
2789
- const s = i.value || {};
2790
- if (b.value) {
2791
- const l = `record-${Date.now()}`, y = { id: l, ...s };
2792
- e.value.addRecord(c.value, l, y);
2793
- const N = e.value.getRecordById(c.value, l);
2794
- N && await N.triggerTransition("SAVE", {
2795
- currentState: "creating",
2796
- targetState: "saved",
2797
- fsmContext: y
2798
- }), await u.value?.replace(`/${f.value}/${l}`);
2799
- } else {
2800
- const l = { id: p.value, ...s };
2801
- e.value.addRecord(c.value, p.value, l);
2802
- const y = e.value.getRecordById(c.value, p.value);
2803
- y && await y.triggerTransition("SAVE", {
2804
- currentState: "editing",
2805
- targetState: "saved",
2806
- fsmContext: l
2807
- });
2808
- }
2809
- } catch {
2810
- } finally {
2811
- n.value = !1;
2812
- }
2813
- }
2814
- }, T = async () => {
2815
- if (b.value)
2816
- await u.value?.push(`/${f.value}`);
2817
- else {
2818
- if (e.value) {
2819
- const s = e.value.getRecordById(c.value, p.value);
2820
- s && await s.triggerTransition("CANCEL", {
2821
- currentState: "editing",
2822
- targetState: "cancelled"
2823
- });
2824
- }
2825
- S();
2826
- }
2827
- }, F = (s, l) => {
2789
+ }), _ = (i, l) => {
2828
2790
  l && l();
2829
- }, w = async (s) => {
2830
- if (!e.value) return;
2831
- const l = s || p.value;
2832
- if (l && confirm("Are you sure you want to delete this record?")) {
2833
- const y = e.value.getRecordById(c.value, l);
2834
- y && await y.triggerTransition("DELETE", {
2835
- currentState: "editing",
2836
- targetState: "deleted"
2837
- }), e.value.removeRecord(c.value, l), h.value === "record" && await u.value?.push(`/${f.value}`);
2838
- }
2839
- }, D = async (s) => {
2840
- const l = s.target, y = l.getAttribute("data-action");
2841
- if (y)
2842
- switch (y) {
2843
- case "create":
2844
- await z();
2845
- break;
2846
- case "save":
2847
- await k();
2848
- break;
2849
- case "cancel":
2850
- await T();
2851
- break;
2852
- case "delete":
2853
- await w();
2854
- break;
2855
- }
2856
- const N = l.closest("td, th");
2857
- if (N) {
2858
- const j = N.textContent?.trim(), J = N.closest("tr");
2859
- if (j === "View Records" && J) {
2860
- const W = J.querySelectorAll("td");
2861
- if (W.length > 0) {
2862
- const q = W[1].textContent?.trim();
2863
- q && await K(q);
2791
+ }, O = async (i) => {
2792
+ const l = i || w.value;
2793
+ if (!l) return;
2794
+ (t.confirmFn ? await t.confirmFn("Are you sure you want to delete this record?") : confirm("Are you sure you want to delete this record?")) && n("action", {
2795
+ name: "DELETE",
2796
+ doctype: v.value,
2797
+ recordId: l,
2798
+ data: d.value || {}
2799
+ });
2800
+ }, S = async (i) => {
2801
+ const l = i.target;
2802
+ l.getAttribute("data-action") === "create" && await g();
2803
+ const $ = l.closest("td, th");
2804
+ if ($) {
2805
+ const W = $.textContent?.trim(), z = $.closest("tr");
2806
+ if (W === "View Records" && z) {
2807
+ const Q = z.querySelectorAll("td");
2808
+ if (Q.length > 0) {
2809
+ const ee = Q[1].textContent?.trim();
2810
+ ee && await Y(ee);
2864
2811
  }
2865
- } else if (j?.includes("Edit") && J) {
2866
- const W = J.querySelectorAll("td");
2867
- if (W.length > 0) {
2868
- const q = W[0].textContent?.trim();
2869
- q && await G(q);
2812
+ } else if (W?.includes("Edit") && z) {
2813
+ const Q = z.querySelectorAll("td");
2814
+ if (Q.length > 0) {
2815
+ const ee = Q[0].textContent?.trim();
2816
+ ee && await B(ee);
2870
2817
  }
2871
- } else if (j?.includes("Delete") && J) {
2872
- const W = J.querySelectorAll("td");
2873
- if (W.length > 0) {
2874
- const q = W[0].textContent?.trim();
2875
- q && await w(q);
2818
+ } else if (W?.includes("Delete") && z) {
2819
+ const Q = z.querySelectorAll("td");
2820
+ if (Q.length > 0) {
2821
+ const ee = Q[0].textContent?.trim();
2822
+ ee && await O(ee);
2876
2823
  }
2877
2824
  }
2878
2825
  }
2879
- };
2880
- L(
2881
- [h, c, p],
2882
- () => {
2883
- h.value === "record" && S();
2884
- },
2885
- { immediate: !0 }
2886
- ), L(
2887
- e,
2888
- (s) => {
2889
- },
2890
- { immediate: !0 }
2891
- ), L(
2892
- [h, c, e],
2893
- ([s, l, y]) => {
2894
- s === "records" && l && y && E(l);
2895
- },
2896
- { immediate: !0 }
2897
- );
2898
- const S = () => {
2899
- if (!(!e.value || !c.value)) {
2900
- o.value = !0;
2826
+ }, p = () => {
2827
+ if (!(!a.value || !v.value)) {
2828
+ s.value = !0;
2901
2829
  try {
2902
- b.value || e.value.getRecordById(c.value, p.value);
2903
- } catch (s) {
2904
- console.warn("Error loading record data:", s);
2830
+ m.value || a.value.getRecordById(v.value, w.value);
2831
+ } catch (i) {
2832
+ console.warn("Error loading record data:", i);
2905
2833
  } finally {
2906
- o.value = !1;
2834
+ s.value = !1;
2907
2835
  }
2908
2836
  }
2909
2837
  };
2910
- return Ge("desktopMethods", {
2911
- navigateToDoctype: K,
2912
- openRecord: G,
2913
- createNewRecord: z,
2914
- handleSave: k,
2915
- handleCancel: T,
2916
- handleDelete: w
2917
- }), Ae(() => {
2918
- ae(() => {
2919
- h.value === "records" && c.value && e.value && E(c.value);
2920
- });
2921
- const s = (l) => {
2922
- (l.ctrlKey || l.metaKey) && l.key === "k" && (l.preventDefault(), r.value = !0), l.key === "Escape" && r.value && (r.value = !1);
2838
+ return H(
2839
+ [k, v, w],
2840
+ () => {
2841
+ k.value === "record" && p();
2842
+ },
2843
+ { immediate: !0 }
2844
+ ), Je("desktopMethods", {
2845
+ navigateToDoctype: Y,
2846
+ openRecord: B,
2847
+ createNewRecord: g,
2848
+ handleDelete: O,
2849
+ /**
2850
+ * Convenience wrapper so child components (e.g. slot content) can emit
2851
+ * an action event without needing a direct reference to the emit function.
2852
+ */
2853
+ emitAction: (i, l) => {
2854
+ n("action", {
2855
+ name: i,
2856
+ doctype: v.value,
2857
+ recordId: w.value,
2858
+ data: l ?? d.value ?? {}
2859
+ });
2860
+ }
2861
+ }), xe(() => {
2862
+ const i = (l) => {
2863
+ (l.ctrlKey || l.metaKey) && l.key === "k" && (l.preventDefault(), c.value = !0), l.key === "Escape" && c.value && (c.value = !1);
2923
2864
  };
2924
- return document.addEventListener("keydown", s), () => {
2925
- document.removeEventListener("keydown", s);
2865
+ return document.addEventListener("keydown", i), () => {
2866
+ document.removeEventListener("keydown", i);
2926
2867
  };
2927
- }), (s, l) => (P(), V("div", {
2868
+ }), (i, l) => (T(), j("div", {
2928
2869
  class: "desktop",
2929
- onClick: D
2870
+ onClick: S
2930
2871
  }, [
2931
2872
  ne(wt, {
2932
- elements: m.value,
2933
- onActionClick: F
2873
+ elements: P.value,
2874
+ onActionClick: _
2934
2875
  }, null, 8, ["elements"]),
2935
- M.value.length > 0 ? (P(), Ze(De(Go), {
2876
+ M.value.length > 0 ? (T(), Qe(Ne(Uo), {
2936
2877
  key: 0,
2937
- data: i.value,
2938
- "onUpdate:data": l[0] || (l[0] = (y) => i.value = y),
2878
+ data: d.value,
2879
+ "onUpdate:data": l[0] || (l[0] = (A) => d.value = A),
2939
2880
  schema: M.value
2940
- }, null, 8, ["data", "schema"])) : De(e) ? (P(), V("div", Xo, [
2941
- A("p", null, "Loading " + X(h.value) + " data...", 1)
2942
- ])) : (P(), V("div", Qo, [...l[2] || (l[2] = [
2943
- A("p", null, "Initializing Stonecrop...", -1)
2881
+ }, null, 8, ["data", "schema"])) : Ne(a) ? (T(), j("div", Zo, [
2882
+ x("p", null, "Loading " + X(k.value) + " data...", 1)
2883
+ ])) : (T(), j("div", qo, [...l[2] || (l[2] = [
2884
+ x("p", null, "Initializing Stonecrop...", -1)
2944
2885
  ])])),
2945
- ne(Nt, { breadcrumbs: O.value }, null, 8, ["breadcrumbs"]),
2886
+ ne(Dt, { breadcrumbs: Z.value }, null, 8, ["breadcrumbs"]),
2946
2887
  ne(St, {
2947
- "is-open": r.value,
2948
- search: R,
2888
+ "is-open": c.value,
2889
+ search: U,
2949
2890
  placeholder: "Type a command or search...",
2950
- onSelect: x,
2951
- onClose: l[1] || (l[1] = (y) => r.value = !1)
2891
+ onSelect: G,
2892
+ onClose: l[1] || (l[1] = (A) => c.value = !1)
2952
2893
  }, {
2953
- title: ye(({ result: y }) => [
2954
- $e(X(y.title), 1)
2894
+ title: me(({ result: A }) => [
2895
+ Ae(X(A.title), 1)
2955
2896
  ]),
2956
- content: ye(({ result: y }) => [
2957
- $e(X(y.description), 1)
2897
+ content: me(({ result: A }) => [
2898
+ Ae(X(A.description), 1)
2958
2899
  ]),
2959
2900
  _: 1
2960
2901
  }, 8, ["is-open"])
2961
2902
  ]));
2962
2903
  }
2963
- }), on = {
2964
- install: (t) => {
2965
- t.component("ActionSet", wt), t.component("CommandPalette", St), t.component("Desktop", Yo), t.component("SheetNav", Nt);
2904
+ }), Yo = {
2905
+ install: (o) => {
2906
+ o.component("ActionSet", wt), o.component("CommandPalette", St), o.component("Desktop", Qo), o.component("SheetNav", Dt);
2966
2907
  }
2967
2908
  };
2968
2909
  export {
2969
2910
  wt as ActionSet,
2970
2911
  St as CommandPalette,
2971
- Yo as Desktop,
2972
- Nt as SheetNav,
2973
- on as StonecropDesktop
2912
+ Qo as Desktop,
2913
+ Dt as SheetNav,
2914
+ Yo as StonecropDesktop
2974
2915
  };
2975
2916
  //# sourceMappingURL=desktop.js.map