@golemui/core 0.15.1 → 0.16.1

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/index.js CHANGED
@@ -1,42 +1,42 @@
1
- import { BehaviorSubject as qr, distinctUntilChanged as T, Subject as sr, pipe as R, map as F, filter as Se, combineLatest as Yr, startWith as Zr } from "rxjs";
1
+ import { BehaviorSubject as Yr, distinctUntilChanged as W, Subject as sr, pipe as k, map as O, filter as Se, combineLatest as Zr, startWith as xr } from "rxjs";
2
2
  import "@standard-schema/spec";
3
- function xr(e, r) {
3
+ function br(e, r) {
4
4
  const t = e["~standard"].validate(r);
5
5
  if (t instanceof Promise)
6
6
  throw new TypeError("Schema validation must be synchronous");
7
7
  return t;
8
8
  }
9
- function br(e) {
9
+ function et(e) {
10
10
  return e.issues === void 0;
11
11
  }
12
- var et = class {
12
+ var rt = class {
13
13
  constructor(e) {
14
14
  this.value = e;
15
15
  }
16
16
  map(e) {
17
- return W(e(this.value));
17
+ return F(e(this.value));
18
18
  }
19
19
  isOk() {
20
20
  return !0;
21
21
  }
22
- }, rt = class {
22
+ }, tt = class {
23
23
  constructor(e) {
24
24
  this.error = e;
25
25
  }
26
26
  map(e) {
27
- return v(this.error);
27
+ return E(this.error);
28
28
  }
29
29
  isOk() {
30
30
  return !1;
31
31
  }
32
32
  };
33
- function W(e) {
34
- return new et(e);
35
- }
36
- function v(e) {
33
+ function F(e) {
37
34
  return new rt(e);
38
35
  }
39
- var P = class Re {
36
+ function E(e) {
37
+ return new tt(e);
38
+ }
39
+ var T = class ke {
40
40
  constructor(r) {
41
41
  this.decodeFn = r, this["~standard"] = { version: 1, vendor: "ts.data.json", validate: (t) => {
42
42
  let n = this.decode(t);
@@ -58,188 +58,188 @@ var P = class Re {
58
58
  });
59
59
  }
60
60
  map(r) {
61
- return new Re((t) => {
61
+ return new ke((t) => {
62
62
  let n = this.decodeFn(t);
63
- return n.isOk() ? W(r(n.value)) : v(n.error);
63
+ return n.isOk() ? F(r(n.value)) : E(n.error);
64
64
  });
65
65
  }
66
66
  flatMap(r) {
67
- return new Re((t) => {
67
+ return new ke((t) => {
68
68
  let n = this.decodeFn(t);
69
- return n.isOk() ? r(n.value).decode(t) : v(n.error);
69
+ return n.isOk() ? r(n.value).decode(t) : E(n.error);
70
70
  });
71
71
  }
72
- }, tt = (e, r, t) => `<${e}> decoder failed at index "${r}" with error: ${t}`, x = (e, r) => `${JSON.stringify(e)} is not a valid ${r}`;
73
- function Me(e, r) {
74
- return new P((t) => {
72
+ }, nt = (e, r, t) => `<${e}> decoder failed at index "${r}" with error: ${t}`, Y = (e, r) => `${JSON.stringify(e)} is not a valid ${r}`;
73
+ function Re(e, r) {
74
+ return new T((t) => {
75
75
  if (t instanceof Array) {
76
76
  let n = [];
77
77
  for (let o = 0; o < t.length; o++) {
78
78
  let i = e.decode(t[o]);
79
79
  if (i.isOk()) n.push(i.value);
80
- else return v(tt(r, o, i.error));
80
+ else return E(nt(r, o, i.error));
81
81
  }
82
- return W(n);
83
- } else return v(x(t, "array"));
82
+ return F(n);
83
+ } else return E(Y(t, "array"));
84
84
  });
85
85
  }
86
- function nt() {
87
- return new P((e) => typeof e == "boolean" ? W(e) : v(x(e, "boolean")));
86
+ function ot() {
87
+ return new T((e) => typeof e == "boolean" ? F(e) : E(Y(e, "boolean")));
88
88
  }
89
89
  function mr(e) {
90
- return new P((r) => e().decode(r));
90
+ return new T((r) => e().decode(r));
91
91
  }
92
- var ot = (e, r) => `${JSON.stringify(e)} is not exactly ${JSON.stringify(r)}`;
93
- function Z(e) {
94
- return new P((r) => r === e ? W(e) : v(ot(r, e)));
92
+ var it = (e, r) => `${JSON.stringify(e)} is not exactly ${JSON.stringify(r)}`;
93
+ function q(e) {
94
+ return new T((r) => r === e ? F(e) : E(it(r, e)));
95
95
  }
96
96
  function ve() {
97
- return new P((e) => typeof e == "number" ? W(e) : v(x(e, "number")));
97
+ return new T((e) => typeof e == "number" ? F(e) : E(Y(e, "number")));
98
98
  }
99
- var it = (e, r, t) => `<${e}> decoder failed at key "${r}" with error: ${t}`;
100
- function ie(e, r) {
101
- return new P((t) => {
99
+ var st = (e, r, t) => `<${e}> decoder failed at key "${r}" with error: ${t}`;
100
+ function oe(e, r) {
101
+ return new T((t) => {
102
102
  if (t !== null && typeof t == "object") {
103
103
  let n = {};
104
104
  for (let o in e) if (Object.prototype.hasOwnProperty.call(e, o)) {
105
105
  let i, s = e[o];
106
- if (s instanceof P ? i = s.decode(t[o]) : i = s.decoder.decode(t[s.fromKey]), i.isOk()) n[o] = i.value;
107
- else return v(it(r, o, i.error));
106
+ if (s instanceof T ? i = s.decode(t[o]) : i = s.decoder.decode(t[s.fromKey]), i.isOk()) n[o] = i.value;
107
+ else return E(st(r, o, i.error));
108
108
  }
109
- return W(n);
110
- } else return v(x(t, r));
109
+ return F(n);
110
+ } else return E(Y(t, r));
111
111
  });
112
112
  }
113
- var st = (e, r) => `<${e}> decoder failed because ${JSON.stringify(r)} can't be decoded with any of the provided oneOf decoders`;
114
- function Q(e, r) {
115
- return new P((t) => {
113
+ var dt = (e, r) => `<${e}> decoder failed because ${JSON.stringify(r)} can't be decoded with any of the provided oneOf decoders`;
114
+ function z(e, r) {
115
+ return new T((t) => {
116
116
  for (let n = 0; n < e.length; n++) {
117
117
  let o = e[n].decode(t);
118
118
  if (o.isOk()) return o;
119
119
  }
120
- return v(st(r, t));
120
+ return E(dt(r, t));
121
121
  });
122
122
  }
123
- function g(e) {
124
- return new P((r) => r === void 0 ? W(void 0) : e.decode(r));
123
+ function y(e) {
124
+ return new T((r) => r === void 0 ? F(void 0) : e.decode(r));
125
125
  }
126
- var dt = (e, r, t) => `<${e}> record decoder failed at key "${r}" with error: ${t}`;
127
- function ut(e, r) {
128
- return new P((t) => {
126
+ var ut = (e, r, t) => `<${e}> record decoder failed at key "${r}" with error: ${t}`;
127
+ function ct(e, r) {
128
+ return new T((t) => {
129
129
  if (t !== null && typeof t == "object") {
130
130
  let n = {};
131
131
  for (let o in t) if (Object.prototype.hasOwnProperty.call(t, o)) {
132
132
  let i = e.decode(t[o]);
133
133
  if (i.isOk()) n[o] = i.value;
134
- else return v(dt(r, o, i.error));
134
+ else return E(ut(r, o, i.error));
135
135
  }
136
- return W(n);
137
- } else return v(x(t, r));
136
+ return F(n);
137
+ } else return E(Y(t, r));
138
138
  });
139
139
  }
140
- function I() {
141
- return new P((e) => typeof e == "string" ? W(e) : v(x(e, "string")));
140
+ function w() {
141
+ return new T((e) => typeof e == "string" ? F(e) : E(Y(e, "string")));
142
142
  }
143
- function J() {
144
- return new P((e) => W(e));
143
+ function X() {
144
+ return new T((e) => F(e));
145
145
  }
146
- function se(e, r) {
147
- return new P((t) => {
146
+ function ie(e, r) {
147
+ return new T((t) => {
148
148
  if (typeof t != "object" || t === null)
149
- return v(`<${r}> failed. Expected object literal, got "${typeof t}"`);
149
+ return E(`<${r}> failed. Expected object literal, got "${typeof t}"`);
150
150
  const n = {};
151
151
  for (const [o, i] of Object.entries(e)) {
152
152
  const s = i.decoder.decode(t[o]);
153
153
  if (!s.isOk())
154
- return v(`<${r}> failed at "${o}" with ${s.error}`);
154
+ return E(`<${r}> failed at "${o}" with ${s.error}`);
155
155
  if (n[o] = s.value, i.suffixed) {
156
156
  for (const [u, c] of Object.entries(t))
157
157
  if (u.startsWith(o + ".")) {
158
158
  const h = i.decoder.decode(c);
159
159
  if (!h.isOk())
160
- return v(`<${r}> failed at "${u}" with ${h.error}`);
160
+ return E(`<${r}> failed at "${u}" with ${h.error}`);
161
161
  n[u] = h.value;
162
162
  }
163
163
  }
164
164
  }
165
- return W(n);
165
+ return F(n);
166
166
  });
167
167
  }
168
- const gr = () => crypto.randomUUID().slice(0, 8), ct = (e) => typeof e != "function" && e.kind === "display", te = (e) => typeof e != "function" && e.kind === "action", D = (e) => typeof e != "function" && e.kind === "input", ke = (e) => typeof e != "function" && e.kind === "layout", de = (e) => typeof e == "function", lt = ie({ in: Me(I(), "In[]") }, "In"), Ue = ie({ when: I() }, "When"), Ie = Q([lt, Ue], "In | When"), at = ie({ from: Me(I(), "From[]") }, "From"), Oe = Q([at, Ue], "Exclude"), _e = Q([nt(), Ue], "Bool | When"), ft = new P((e) => {
168
+ const gr = () => crypto.randomUUID().slice(0, 8), lt = (e) => typeof e != "function" && e.kind === "display", re = (e) => typeof e != "function" && e.kind === "action", D = (e) => typeof e != "function" && e.kind === "input", Pe = (e) => typeof e != "function" && e.kind === "layout", se = (e) => typeof e == "function", at = oe({ in: Re(w(), "In[]") }, "In"), Ue = oe({ when: w() }, "When"), Ee = z([at, Ue], "In | When"), ft = oe({ from: Re(w(), "From[]") }, "From"), we = z([ft, Ue], "Exclude"), _e = z([ot(), Ue], "Bool | When"), ht = new T((e) => {
169
169
  const r = typeof e;
170
- return r === "function" ? W(e) : v(`Expected a function, got '${r}'`);
171
- }), H = (e) => Q([e, ft], ""), He = se(
170
+ return r === "function" ? F(e) : E(`Expected a function, got '${r}'`);
171
+ }), U = (e) => z([e, ht], ""), Me = ie(
172
172
  {
173
- load: { suffixed: !0, decoder: H(g(I())) },
174
- click: { suffixed: !0, decoder: H(g(I())) },
175
- change: { suffixed: !0, decoder: H(g(I())) },
176
- filter: { suffixed: !0, decoder: H(g(I())) },
177
- blur: { suffixed: !0, decoder: H(g(I())) }
173
+ load: { suffixed: !0, decoder: U(y(w())) },
174
+ click: { suffixed: !0, decoder: U(y(w())) },
175
+ change: { suffixed: !0, decoder: U(y(w())) },
176
+ filter: { suffixed: !0, decoder: U(y(w())) },
177
+ blur: { suffixed: !0, decoder: U(y(w())) }
178
178
  },
179
179
  "On"
180
- ), ht = ie(
180
+ ), pt = oe(
181
181
  {
182
- key: I(),
183
- default: g(I()),
184
- params: J()
182
+ key: w(),
183
+ default: y(w()),
184
+ params: X()
185
185
  },
186
186
  "TranslationConfig"
187
- ), yr = Q([I(), ht], "Localizable"), we = g(I()).map((e) => e || gr()), pt = se(
187
+ ), yr = z([w(), pt], "Localizable"), Ie = y(w()).map((e) => e || gr()), mt = ie(
188
188
  {
189
- kind: { decoder: Z("display") },
190
- uid: { decoder: we },
191
- type: { decoder: I() },
192
- size: { suffixed: !0, decoder: g(ve()) },
193
- include: { decoder: g(Ie) },
194
- exclude: { decoder: g(Oe) },
195
- props: { decoder: g(J()) }
189
+ kind: { decoder: q("display") },
190
+ uid: { decoder: Ie },
191
+ type: { decoder: w() },
192
+ size: { suffixed: !0, decoder: y(ve()) },
193
+ include: { decoder: y(Ee) },
194
+ exclude: { decoder: y(we) },
195
+ props: { decoder: y(X()) }
196
196
  },
197
197
  "DisplayWidget"
198
- ), mt = se(
198
+ ), gt = ie(
199
199
  {
200
- kind: { decoder: Z("action") },
201
- uid: { decoder: we },
202
- type: { decoder: I() },
200
+ kind: { decoder: q("action") },
201
+ uid: { decoder: Ie },
202
+ type: { decoder: w() },
203
203
  actionType: {
204
- decoder: g(Q([Z("button"), Z("submit")], "button | submit "))
204
+ decoder: y(z([q("button"), q("submit")], "button | submit "))
205
205
  },
206
- size: { suffixed: !0, decoder: g(ve()) },
207
- include: { decoder: g(Ie) },
208
- exclude: { decoder: g(Oe) },
209
- label: { suffixed: !0, decoder: H(yr) },
210
- disabled: { suffixed: !0, decoder: g(_e) },
211
- on: { decoder: g(He) },
212
- props: { decoder: g(J()) }
206
+ size: { suffixed: !0, decoder: y(ve()) },
207
+ include: { decoder: y(Ee) },
208
+ exclude: { decoder: y(we) },
209
+ label: { suffixed: !0, decoder: U(yr) },
210
+ disabled: { suffixed: !0, decoder: y(_e) },
211
+ on: { decoder: y(Me) },
212
+ props: { decoder: y(X()) }
213
213
  },
214
214
  "ActionWidget"
215
- ), gt = new P((e) => {
215
+ ), yt = new T((e) => {
216
216
  const r = typeof e;
217
217
  if (r === "function") {
218
218
  const t = e, n = t(void 0);
219
- return t.uid = n.uid || gr(), t.type = n.type, t.path = n.path, W(t);
219
+ return t.uid = n.uid || gr(), t.type = n.type, t.path = n.path, F(t);
220
220
  } else
221
- return v(`Expected a function, got '${r}'`);
222
- }), yt = se(
221
+ return E(`Expected a function, got '${r}'`);
222
+ }), $t = ie(
223
223
  {
224
- kind: { decoder: Z("input") },
225
- uid: { decoder: we },
226
- type: { decoder: I() },
227
- size: { suffixed: !0, decoder: g(ve()) },
228
- include: { decoder: g(Ie) },
229
- exclude: { decoder: g(Oe) },
230
- disabled: { suffixed: !0, decoder: g(_e) },
231
- readonly: { suffixed: !0, decoder: g(_e) },
232
- on: { decoder: g(He) },
233
- props: { decoder: g(J()) },
224
+ kind: { decoder: q("input") },
225
+ uid: { decoder: Ie },
226
+ type: { decoder: w() },
227
+ size: { suffixed: !0, decoder: y(ve()) },
228
+ include: { decoder: y(Ee) },
229
+ exclude: { decoder: y(we) },
230
+ disabled: { suffixed: !0, decoder: y(_e) },
231
+ readonly: { suffixed: !0, decoder: y(_e) },
232
+ on: { decoder: y(Me) },
233
+ props: { decoder: y(X()) },
234
234
  label: {
235
235
  suffixed: !0,
236
- decoder: H(g(yr))
236
+ decoder: U(y(yr))
237
237
  },
238
- path: { decoder: I() },
239
- defaultValue: { decoder: g(J()) },
238
+ path: { decoder: w() },
239
+ defaultValue: { decoder: y(X()) },
240
240
  validator: {
241
241
  suffixed: !0,
242
- decoder: H(g(J()))
242
+ decoder: U(y(X()))
243
243
  }
244
244
  },
245
245
  "InputWidget"
@@ -247,34 +247,34 @@ const gr = () => crypto.randomUUID().slice(0, 8), ct = (e) => typeof e != "funct
247
247
  const r = { ...e };
248
248
  if (e.uid || (r.uid = `${e.path}-${e.type}`), e.type === "repeater") {
249
249
  const t = e.props;
250
- t.template = Be.parse(t.template);
250
+ t.template = He.parse(t.template);
251
251
  }
252
252
  return r;
253
253
  }), At = mr(
254
- () => Q(
254
+ () => z(
255
255
  [
256
- gt,
257
256
  yt,
258
- Be,
259
- pt,
260
- mt
257
+ $t,
258
+ He,
259
+ mt,
260
+ gt
261
261
  ],
262
262
  "FormWidget"
263
263
  )
264
- ), Be = se(
264
+ ), He = ie(
265
265
  {
266
- kind: { decoder: Z("layout") },
267
- uid: { decoder: we },
268
- type: { decoder: I() },
269
- size: { suffixed: !0, decoder: g(ve()) },
270
- include: { decoder: g(Ie) },
271
- exclude: { decoder: g(Oe) },
272
- props: { decoder: g(J()) },
273
- on: { decoder: g(He) },
274
- children: { decoder: Me(At, "FormWidget[]") }
266
+ kind: { decoder: q("layout") },
267
+ uid: { decoder: Ie },
268
+ type: { decoder: w() },
269
+ size: { suffixed: !0, decoder: y(ve()) },
270
+ include: { decoder: y(Ee) },
271
+ exclude: { decoder: y(we) },
272
+ props: { decoder: y(X()) },
273
+ on: { decoder: y(Me) },
274
+ children: { decoder: Re(At, "FormWidget[]") }
275
275
  },
276
276
  "LayoutWidget"
277
- ), X = class X {
277
+ ), G = class G {
278
278
  constructor() {
279
279
  this.widgetLoaders = {}, this._ready = !1;
280
280
  }
@@ -289,16 +289,16 @@ const gr = () => crypto.randomUUID().slice(0, 8), ct = (e) => typeof e != "funct
289
289
  }
290
290
  async loadWidget(r) {
291
291
  const t = this.widgetLoaders[r];
292
- if (!X.sharedCache.has(t)) {
293
- const n = t().catch((o) => (X.sharedCache.delete(t), Promise.reject(o)));
294
- X.sharedCache.set(t, n);
292
+ if (!G.sharedCache.has(t)) {
293
+ const n = t().catch((o) => (G.sharedCache.delete(t), Promise.reject(o)));
294
+ G.sharedCache.set(t, n);
295
295
  }
296
- return X.sharedCache.get(t);
296
+ return G.sharedCache.get(t);
297
297
  }
298
298
  };
299
- X.sharedCache = /* @__PURE__ */ new Map();
300
- let Ne = X;
301
- function vo(e) {
299
+ G.sharedCache = /* @__PURE__ */ new Map();
300
+ let Ne = G;
301
+ function Ao(e) {
302
302
  return {
303
303
  ...e,
304
304
  form: {
@@ -309,15 +309,15 @@ function vo(e) {
309
309
  }
310
310
  };
311
311
  }
312
- const Ar = ie(
312
+ const $r = oe(
313
313
  {
314
- states: g(ut(I(), "states")),
315
- form: mr(() => Be)
314
+ states: y(ct(w(), "states")),
315
+ form: mr(() => He)
316
316
  },
317
317
  "FormDef"
318
- ), $r = (e) => ({
318
+ ), Ar = (e) => ({
319
319
  formName: "",
320
- formDef: Ar.parse({
320
+ formDef: $r.parse({
321
321
  form: {
322
322
  kind: "layout",
323
323
  type: "flex",
@@ -338,12 +338,12 @@ const Ar = ie(
338
338
  formHealth: { status: "ok" },
339
339
  touched: !1,
340
340
  lang: e
341
- }), $t = (e) => !(typeof e != "object" || e === null || typeof e.key != "string");
342
- function Io(e) {
341
+ }), St = (e) => !(typeof e != "object" || e === null || typeof e.key != "string");
342
+ function So(e) {
343
343
  const r = new Intl.Locale(e).maximize().script;
344
344
  return ["Arab", "Hebr", "Thaa", "Syrc", "Tfng", "Adlm", "Rohg"].includes(r || "") ? "rtl" : "ltr";
345
345
  }
346
- const Et = (e = navigator.language || "en-US") => {
346
+ const vt = (e = navigator.language || "en-US") => {
347
347
  const r = /* @__PURE__ */ new Set();
348
348
  return {
349
349
  get lang() {
@@ -361,13 +361,13 @@ const Et = (e = navigator.language || "en-US") => {
361
361
  e = n, r.forEach((o) => o(e));
362
362
  }
363
363
  };
364
- }, St = (e) => {
364
+ }, Et = (e) => {
365
365
  throw new Error(`Unhandled case: ${JSON.stringify(e)}`);
366
366
  };
367
- function j(e, ...r) {
367
+ function N(e, ...r) {
368
368
  return r.reduce((t, n) => n(t), e);
369
369
  }
370
- function vt(e, r) {
370
+ function wt(e, r) {
371
371
  const t = r.payload.widget.uid;
372
372
  if (!t)
373
373
  throw new Error("addWidget: widget must have a uid");
@@ -382,17 +382,18 @@ function vt(e, r) {
382
382
  }
383
383
  };
384
384
  }
385
- const he = {
385
+ const ee = {
386
386
  calculateCurrentStateError: 10,
387
387
  initializeParseError: 20,
388
388
  initializeUidCollisionError: 21,
389
389
  initializeUnknownError: 22,
390
- widgetCouldNotBeLoaded: 30
391
- }, N = (e, r) => {
390
+ widgetCouldNotBeLoaded: 30,
391
+ resolveStringInterpolationError: 40
392
+ }, de = (e, r) => {
392
393
  if (e === void 0)
393
394
  throw new Error("obj is undefined");
394
395
  return r.split(".").reduce((t, n) => t === void 0 || n === "" ? t : Array.isArray(t) ? t[parseInt(n, 10)] : t[n], e);
395
- }, Ge = (e, r, t) => {
396
+ }, Be = (e, r, t) => {
396
397
  if (e === null)
397
398
  throw new Error("object is null");
398
399
  if (e === void 0)
@@ -423,137 +424,96 @@ function dr(e) {
423
424
  r[t] = dr(e[t]);
424
425
  return r;
425
426
  }
426
- const C = {
427
- FORM: "$form",
428
- META: "$meta",
429
- ERRORS: "$errors",
430
- FORM_IS_INVALID: "$formIsInvalid"
431
- }, Ot = (e) => typeof e == "string" && !e.includes(" ") && (e.startsWith(`${C.FORM}.`) || e.startsWith(`${C.META}.`) || e.startsWith(`${C.ERRORS}.`) || e === C.FORM_IS_INVALID), wt = [C.FORM, C.META, C.ERRORS].map((e) => e.replace("$", "\\$")).join("|"), Ct = new RegExp(
432
- `\\{\\{(?:(?<scope>${wt})\\.(?<path>[^}]+)|(?<isInvalid>\\${C.FORM_IS_INVALID}))\\}\\}`,
433
- "g"
434
- ), Ft = (e, r) => typeof e != "string" || !e.includes("{{$") ? e : e.replace(Ct, (t, ...n) => {
435
- const o = n[n.length - 1], { scope: i, path: s, isInvalid: u } = o;
436
- try {
437
- if (u === C.FORM_IS_INVALID)
438
- return r.resolveFormIsInvalid();
439
- if (i && s)
440
- switch (i) {
441
- case C.FORM:
442
- return r.resolveFormPath(s);
443
- case C.META:
444
- return r.resolveMetaPath(s);
445
- case C.ERRORS:
446
- return r.resolveErrorsPath(s);
447
- default:
448
- return t;
449
- }
450
- } catch (c) {
451
- return console.error(`Error resolving Expression: '${e}'`, c), t;
452
- }
453
- return t;
454
- }), Dt = (e, r) => {
455
- const t = `${C.FORM}.`;
456
- if (e.startsWith(t))
457
- return r.resolveFormPath(e.replace(t, ""));
458
- const n = `${C.META}.`;
459
- if (e.startsWith(n))
460
- return r.resolveMetaPath(e.replace(n, ""));
461
- const o = `${C.ERRORS}.`;
462
- if (e.startsWith(o))
463
- return r.resolveErrorsPath(e.replace(o, ""));
464
- if (e === C.FORM_IS_INVALID)
465
- return r.resolveFormIsInvalid();
466
- };
467
- function Ke(e) {
427
+ function Ge(e) {
468
428
  return e.flatMap((r) => [
469
429
  r,
470
- ...ke(r) ? Ke(r.children) : []
430
+ ...Pe(r) ? Ge(r.children) : []
471
431
  ]);
472
432
  }
473
- function Xe(e) {
433
+ function Ke(e) {
474
434
  return Object.entries(e.validations).reduce(
475
- (t, [n, o]) => (o !== null && (t.$formIsInvalid = !0, Ge(t.$errors, n, [...o])), t),
435
+ (t, [n, o]) => (o !== null && (t.$formIsInvalid = !0, Be(t.$errors, n, [...o])), t),
476
436
  { $formIsInvalid: !1, $errors: {} }
477
437
  );
478
438
  }
479
- const ze = 32;
480
- let je, f, p, y = (e) => (f = 0, p = e, y.newline = !1, e = E(), p[f] ? q() : e || ""), q = (e = "Unexpected token", r = f, t = p.slice(0, r).split(`
439
+ const Xe = 32;
440
+ let je, f, p, g = (e) => (f = 0, p = e, g.newline = !1, e = S(), p[f] ? J() : e || ""), J = (e = "Unexpected token", r = f, t = p.slice(0, r).split(`
481
441
  `), n = t.pop(), o = p.slice(Math.max(0, r - 40), r), i = "̭", s = (p[r] || " ") + i, u = p.slice(r + 1, r + 20)) => {
482
442
  throw SyntaxError(`${e} at ${t.length + 1}:${n.length + 1}
483
443
  ${p[r - 41] !== `
484
444
  `, "" + o}${s}${u}`);
485
- }, Er = (e, r = f) => (Array.isArray(e) && (e.loc = r), e), b = (e, r = f, t) => {
445
+ }, Sr = (e, r = f) => (Array.isArray(e) && (e.loc = r), e), Z = (e, r = f, t) => {
486
446
  for (; t = e(p.charCodeAt(f)); ) f += t;
487
447
  return p.slice(r, f);
488
- }, O = (e = 1) => p[f += e], Le = (e) => f = e, E = (e = 0, r) => {
448
+ }, I = (e = 1) => p[f += e], Le = (e) => f = e, S = (e = 0, r) => {
489
449
  let t, n, o, i, s;
490
- for (r && y.asi && (y.newline = !1); (t = y.space()) && (s = y.newline, 1) && t !== r && (o = // ASI before [ on new line (access handler would consume it; lineBreak distinguishes real \n from synthetic } flag)
491
- (n && t === 91 && je && y.asi?.(n, e, E) || null) ?? ((i = _[t]) && i(n, e)) ?? (n && s && y.asi?.(n, e, E)) ?? (!n && b(y.id))); ) n = o;
492
- return r && (t == r ? (f++, r === 125 && y.asi && (y.newline = !0)) : q("Unclosed " + String.fromCharCode(r - (r > 42 ? 2 : 1)))), n;
493
- }, G = (e, r = f) => {
494
- for (je = !1; (e = p.charCodeAt(f)) <= ze; )
495
- y.asi && e === 10 && (y.newline = je = !0), f++;
450
+ for (r && g.asi && (g.newline = !1); (t = g.space()) && (s = g.newline, 1) && t !== r && (o = // ASI before [ on new line (access handler would consume it; lineBreak distinguishes real \n from synthetic } flag)
451
+ (n && t === 91 && je && g.asi?.(n, e, S) || null) ?? ((i = _[t]) && i(n, e)) ?? (n && s && g.asi?.(n, e, S)) ?? (!n && Z(g.id))); ) n = o;
452
+ return r && (t == r ? (f++, r === 125 && g.asi && (g.newline = !0)) : J("Unclosed " + String.fromCharCode(r - (r > 42 ? 2 : 1)))), n;
453
+ }, H = (e, r = f) => {
454
+ for (je = !1; (e = p.charCodeAt(f)) <= Xe; )
455
+ g.asi && e === 10 && (g.newline = je = !0), f++;
496
456
  return e;
497
- }, Pt = (e = f) => {
498
- for (; p.charCodeAt(e) <= ze; ) e++;
457
+ }, Ct = (e = f) => {
458
+ for (; p.charCodeAt(e) <= Xe; ) e++;
499
459
  return p.charCodeAt(e);
500
460
  };
501
- y.id = (e) => e >= 48 && e <= 57 || e >= 65 && e <= 90 || e >= 97 && e <= 122 || e == 36 || e == 95 || e >= 192 && e != 215 && e != 247;
502
- let Tt = (e, r = e.length) => p.substr(f, r) === e && !y.id(p.charCodeAt(f + r)), _ = [], ur = {}, k = (e, r = ze, t, n = e.charCodeAt(0), o = e.length, i = _[n], s = e.toUpperCase() !== e, u, c) => (r = ur[e] = !i && ur[e] || r, _[n] = (h, $, m, a = f) => (u = m, (m ? e == m : (o < 2 || e.charCodeAt(1) === p.charCodeAt(f + 1) && (o < 3 || p.substr(f, o) == e)) && (!s || !y.id(p.charCodeAt(f + o))) && (u = m = e)) && $ < r && (f += o, (c = t(h)) ? Er(c, a) : (f = a, u = 0, !s && !i && !h && q()), c) || i?.(h, $, u))), A = (e, r, t = !1) => k(e, r, (n) => n && /* @__PURE__ */ ((o) => o && [e, n, o])(E(r - (t ? 0.5 : 0)))), K = (e, r, t) => k(e, r, (n) => !n && (n = E(r - 0.5)) && [e, n]), ue = (e, r) => k(e, 200, (t) => !t && [, r]), Sr = (e, r, t) => k(
461
+ g.id = (e) => e >= 48 && e <= 57 || e >= 65 && e <= 90 || e >= 97 && e <= 122 || e == 36 || e == 95 || e >= 192 && e != 215 && e != 247;
462
+ let Ot = (e, r = e.length) => p.substr(f, r) === e && !g.id(p.charCodeAt(f + r)), _ = [], ur = {}, P = (e, r = Xe, t, n = e.charCodeAt(0), o = e.length, i = _[n], s = e.toUpperCase() !== e, u, c) => (r = ur[e] = !i && ur[e] || r, _[n] = (h, A, m, a = f) => (u = m, (m ? e == m : (o < 2 || e.charCodeAt(1) === p.charCodeAt(f + 1) && (o < 3 || p.substr(f, o) == e)) && (!s || !g.id(p.charCodeAt(f + o))) && (u = m = e)) && A < r && (f += o, (c = t(h)) ? Sr(c, a) : (f = a, u = 0, !s && !i && !h && J()), c) || i?.(h, A, u))), $ = (e, r, t = !1) => P(e, r, (n) => n && /* @__PURE__ */ ((o) => o && [e, n, o])(S(r - (t ? 0.5 : 0)))), B = (e, r, t) => P(e, r, (n) => !n && (n = S(r - 0.5)) && [e, n]), ue = (e, r) => P(e, 200, (t) => !t && [, r]), vr = (e, r, t) => P(
503
463
  e,
504
464
  r,
505
- (n, o) => (o = E(r - (t ? 0.5 : 0)), n?.[0] !== e && (n = [e, n || null]), o?.[0] === e ? n.push(...o.slice(1)) : n.push(o || null), n)
506
- ), Je = (e, r) => k(e[0], r, (t) => !t && [e, E(0, e.charCodeAt(1)) || null]), vr = (e, r) => k(e[0], r, (t) => t && [e, t, E(0, e.charCodeAt(1)) || null]), ce = (e, r, t, n = e.charCodeAt(0), o = e.length, i = _[n], s) => _[n] = (u, c, h, $ = f) => !u && (h ? e == h : (o < 2 || p.substr(f, o) == e) && (h = e)) && c < r && !y.id(p.charCodeAt(f + o)) && (!y.prop || y.prop(f + o)) && (Le(f + o), (s = t()) ? Er(s, $) : Le($), s) || i?.(u, c, h);
507
- Object.defineProperty(y, "space", {
465
+ (n, o) => (o = S(r - (t ? 0.5 : 0)), n?.[0] !== e && (n = [e, n || null]), o?.[0] === e ? n.push(...o.slice(1)) : n.push(o || null), n)
466
+ ), ze = (e, r) => P(e[0], r, (t) => !t && [e, S(0, e.charCodeAt(1)) || null]), Er = (e, r) => P(e[0], r, (t) => t && [e, t, S(0, e.charCodeAt(1)) || null]), ce = (e, r, t, n = e.charCodeAt(0), o = e.length, i = _[n], s) => _[n] = (u, c, h, A = f) => !u && (h ? e == h : (o < 2 || p.substr(f, o) == e) && (h = e)) && c < r && !g.id(p.charCodeAt(f + o)) && (!g.prop || g.prop(f + o)) && (Le(f + o), (s = t()) ? Sr(s, A) : Le(A), s) || i?.(u, c, h);
467
+ Object.defineProperty(g, "space", {
508
468
  configurable: !0,
509
469
  enumerable: !0,
510
- get: () => G,
511
- set: (e) => G = e
470
+ get: () => H,
471
+ set: (e) => H = e
512
472
  });
513
473
  const Ve = {}, l = (e, r, t = Ve[e]) => Ve[e] = (...n) => r(...n) || t?.(...n), d = (e) => Array.isArray(e) ? e[0] == null ? /* @__PURE__ */ ((r) => () => r)(e[1]) : (
514
474
  // == catches both undefined and null
515
- Ve[e[0]]?.(...e.slice(1)) ?? q(`Unknown operator: ${e[0]}`, e?.loc)
475
+ Ve[e[0]]?.(...e.slice(1)) ?? J(`Unknown operator: ${e[0]}`, e?.loc)
516
476
  ) : e === void 0 ? () => {
517
- } : (r) => r?.[e], me = 46, ne = 48, ge = 57, Wt = 69, Rt = 101, kt = 43, _t = 45, pe = 95, Ir = 110, Nt = 97, jt = 102, Lt = 65, Vt = 70, Or = (e) => e.indexOf("_") < 0 ? e : e.replaceAll("_", ""), Qe = (e) => {
518
- let r = Or(b(
477
+ } : (r) => r?.[e], pe = 46, te = 48, me = 57, Dt = 69, Tt = 101, Wt = 43, Ft = 45, he = 95, wr = 110, kt = 97, Pt = 102, _t = 65, Nt = 70, Ir = (e) => e.indexOf("_") < 0 ? e : e.replaceAll("_", ""), Je = (e) => {
478
+ let r = Ir(Z(
519
479
  (t) => (
520
480
  // . is decimal only if NOT followed by another . (range operator)
521
- t === me && p.charCodeAt(f + 1) !== me || t >= ne && t <= ge || t === pe || ((t === Wt || t === Rt) && ((t = p.charCodeAt(f + 1)) >= ne && t <= ge || t === kt || t === _t) ? 2 : 0)
481
+ t === pe && p.charCodeAt(f + 1) !== pe || t >= te && t <= me || t === he || ((t === Dt || t === Tt) && ((t = p.charCodeAt(f + 1)) >= te && t <= me || t === Wt || t === Ft) ? 2 : 0)
522
482
  )
523
483
  ));
524
- return p.charCodeAt(f) === Ir ? (O(), [, BigInt(r)]) : (e = +r) != e ? q() : [, e];
525
- }, Mt = {
526
- 2: (e) => e === 48 || e === 49 || e === pe,
527
- 8: (e) => e >= 48 && e <= 55 || e === pe,
528
- 16: (e) => e >= ne && e <= ge || e >= Nt && e <= jt || e >= Lt && e <= Vt || e === pe
484
+ return p.charCodeAt(f) === wr ? (I(), [, BigInt(r)]) : (e = +r) != e ? J() : [, e];
485
+ }, jt = {
486
+ 2: (e) => e === 48 || e === 49 || e === he,
487
+ 8: (e) => e >= 48 && e <= 55 || e === he,
488
+ 16: (e) => e >= te && e <= me || e >= kt && e <= Pt || e >= _t && e <= Nt || e === he
529
489
  };
530
- y.number = null;
531
- _[me] = (e) => !e && p.charCodeAt(f + 1) !== me && Qe();
532
- for (let e = ne; e <= ge; e++) _[e] = (r) => r ? void 0 : Qe();
533
- _[ne] = (e) => {
490
+ g.number = null;
491
+ _[pe] = (e) => !e && p.charCodeAt(f + 1) !== pe && Je();
492
+ for (let e = te; e <= me; e++) _[e] = (r) => r ? void 0 : Je();
493
+ _[te] = (e) => {
534
494
  if (e) return;
535
- const r = y.number;
495
+ const r = g.number;
536
496
  if (r) {
537
497
  for (const [t, n] of Object.entries(r))
538
498
  if (t[0] === "0" && p[f + 1]?.toLowerCase() === t[1]) {
539
- O(2);
540
- const o = Or(b(Mt[n]));
541
- return p.charCodeAt(f) === Ir ? (O(), [, BigInt("0" + t[1] + o)]) : [, parseInt(o, n)];
499
+ I(2);
500
+ const o = Ir(Z(jt[n]));
501
+ return p.charCodeAt(f) === wr ? (I(), [, BigInt("0" + t[1] + o)]) : [, parseInt(o, n)];
542
502
  }
543
503
  }
544
- return Qe();
504
+ return Je();
545
505
  };
546
- const Ut = 92, cr = 34, lr = 39, Ht = { n: `
547
- `, r: "\r", t: " ", b: "\b", f: "\f", v: "\v" }, wr = (e) => (r, t, n = "") => {
548
- if (!(r || !y.string?.[String.fromCharCode(e)]))
549
- return O(), b((o) => o - e && (o === Ut ? (n += Ht[p[f + 1]] || p[f + 1], 2) : (n += p[f], 1))), p[f] === String.fromCharCode(e) ? O() : q("Bad string"), [, n];
506
+ const Lt = 92, cr = 34, lr = 39, Vt = { n: `
507
+ `, r: "\r", t: " ", b: "\b", f: "\f", v: "\v" }, Cr = (e) => (r, t, n = "") => {
508
+ if (!(r || !g.string?.[String.fromCharCode(e)]))
509
+ return I(), Z((o) => o - e && (o === Lt ? (n += Vt[p[f + 1]] || p[f + 1], 2) : (n += p[f], 1))), p[f] === String.fromCharCode(e) ? I() : J("Bad string"), [, n];
550
510
  };
551
- _[cr] = wr(cr);
552
- _[lr] = wr(lr);
553
- y.string = { '"': !0 };
554
- const Bt = 20;
555
- "= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map((e) => A(e, Bt, !0));
556
- const Cr = (e, r, t, n) => typeof e == "string" ? (o) => r(o, e, o) : e[0] === "." ? (t = d(e[1]), n = e[2], (o) => r(t(o), n, o)) : e[0] === "[]" && e.length === 3 ? (t = d(e[1]), n = d(e[2]), (o) => r(t(o), n(o), o)) : e[0] === "()" && e.length === 2 ? Cr(e[1], r) : (() => {
511
+ _[cr] = Cr(cr);
512
+ _[lr] = Cr(lr);
513
+ g.string = { '"': !0 };
514
+ const Rt = 20;
515
+ "= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map((e) => $(e, Rt, !0));
516
+ const Or = (e, r, t, n) => typeof e == "string" ? (o) => r(o, e, o) : e[0] === "." ? (t = d(e[1]), n = e[2], (o) => r(t(o), n, o)) : e[0] === "[]" && e.length === 3 ? (t = d(e[1]), n = d(e[2]), (o) => r(t(o), n(o), o)) : e[0] === "()" && e.length === 2 ? Or(e[1], r) : (() => {
557
517
  throw Error("Invalid assignment target");
558
518
  })(), ar = {
559
519
  "=": (e, r, t) => e[r] = t,
@@ -568,21 +528,21 @@ const Cr = (e, r, t, n) => typeof e == "string" ? (o) => r(o, e, o) : e[0] === "
568
528
  ">>=": (e, r, t) => e[r] >>= t,
569
529
  "<<=": (e, r, t) => e[r] <<= t
570
530
  };
571
- for (const e in ar) l(e, (r, t) => (t = d(t), Cr(r, (n, o, i) => ar[e](n, o, t(i)))));
572
- const Gt = 30, Kt = 40, Xt = 140;
573
- K("!", Xt);
574
- A("||", Gt);
575
- A("&&", Kt);
531
+ for (const e in ar) l(e, (r, t) => (t = d(t), Or(r, (n, o, i) => ar[e](n, o, t(i)))));
532
+ const Ut = 30, Mt = 40, Ht = 140;
533
+ B("!", Ht);
534
+ $("||", Ut);
535
+ $("&&", Mt);
576
536
  l("!", (e) => (e = d(e), (r) => !e(r)));
577
537
  l("||", (e, r) => (e = d(e), r = d(r), (t) => e(t) || r(t)));
578
538
  l("&&", (e, r) => (e = d(e), r = d(r), (t) => e(t) && r(t)));
579
- const zt = 50, Jt = 60, Qt = 70, Fr = 100, qt = 140;
580
- A("|", zt);
581
- A("&", Qt);
582
- A("^", Jt);
583
- A(">>", Fr);
584
- A("<<", Fr);
585
- K("~", qt);
539
+ const Bt = 50, Gt = 60, Kt = 70, Dr = 100, Xt = 140;
540
+ $("|", Bt);
541
+ $("&", Kt);
542
+ $("^", Gt);
543
+ $(">>", Dr);
544
+ $("<<", Dr);
545
+ B("~", Xt);
586
546
  l("~", (e) => (e = d(e), (r) => ~e(r)));
587
547
  l("|", (e, r) => (e = d(e), r = d(r), (t) => e(t) | r(t)));
588
548
  l("&", (e, r) => (e = d(e), r = d(r), (t) => e(t) & r(t)));
@@ -590,94 +550,94 @@ l("^", (e, r) => (e = d(e), r = d(r), (t) => e(t) ^ r(t)));
590
550
  l(">>", (e, r) => (e = d(e), r = d(r), (t) => e(t) >> r(t)));
591
551
  l("<<", (e, r) => (e = d(e), r = d(r), (t) => e(t) << r(t)));
592
552
  const Ce = 90;
593
- A("<", Ce);
594
- A(">", Ce);
595
- A("<=", Ce);
596
- A(">=", Ce);
553
+ $("<", Ce);
554
+ $(">", Ce);
555
+ $("<=", Ce);
556
+ $(">=", Ce);
597
557
  l(">", (e, r) => (e = d(e), r = d(r), (t) => e(t) > r(t)));
598
558
  l("<", (e, r) => (e = d(e), r = d(r), (t) => e(t) < r(t)));
599
559
  l(">=", (e, r) => (e = d(e), r = d(r), (t) => e(t) >= r(t)));
600
560
  l("<=", (e, r) => (e = d(e), r = d(r), (t) => e(t) <= r(t)));
601
- const Dr = 80;
602
- A("==", Dr);
603
- A("!=", Dr);
561
+ const Tr = 80;
562
+ $("==", Tr);
563
+ $("!=", Tr);
604
564
  l("==", (e, r) => (e = d(e), r = d(r), (t) => e(t) == r(t)));
605
565
  l("!=", (e, r) => (e = d(e), r = d(r), (t) => e(t) != r(t)));
606
- const Pr = 110, qe = 120, Tr = 140;
607
- A("+", Pr);
608
- A("-", Pr);
609
- A("*", qe);
610
- A("/", qe);
611
- A("%", qe);
612
- K("+", Tr);
613
- K("-", Tr);
566
+ const Wr = 110, Qe = 120, Fr = 140;
567
+ $("+", Wr);
568
+ $("-", Wr);
569
+ $("*", Qe);
570
+ $("/", Qe);
571
+ $("%", Qe);
572
+ B("+", Fr);
573
+ B("-", Fr);
614
574
  l("+", (e, r) => r !== void 0 ? (e = d(e), r = d(r), (t) => e(t) + r(t)) : (e = d(e), (t) => +e(t)));
615
575
  l("-", (e, r) => r !== void 0 ? (e = d(e), r = d(r), (t) => e(t) - r(t)) : (e = d(e), (t) => -e(t)));
616
576
  l("*", (e, r) => (e = d(e), r = d(r), (t) => e(t) * r(t)));
617
577
  l("/", (e, r) => (e = d(e), r = d(r), (t) => e(t) / r(t)));
618
578
  l("%", (e, r) => (e = d(e), r = d(r), (t) => e(t) % r(t)));
619
- const ye = 150;
620
- k("++", ye, (e) => e ? ["++", e, null] : ["++", E(ye - 1)]);
621
- k("--", ye, (e) => e ? ["--", e, null] : ["--", E(ye - 1)]);
622
- const Ye = (e, r, t, n) => typeof e == "string" ? (o) => r(o, e) : e[0] === "." ? (t = d(e[1]), n = e[2], (o) => r(t(o), n)) : e[0] === "[]" && e.length === 3 ? (t = d(e[1]), n = d(e[2]), (o) => r(t(o), n(o))) : e[0] === "()" && e.length === 2 ? Ye(e[1], r) : (
579
+ const ge = 150;
580
+ P("++", ge, (e) => e ? ["++", e, null] : ["++", S(ge - 1)]);
581
+ P("--", ge, (e) => e ? ["--", e, null] : ["--", S(ge - 1)]);
582
+ const qe = (e, r, t, n) => typeof e == "string" ? (o) => r(o, e) : e[0] === "." ? (t = d(e[1]), n = e[2], (o) => r(t(o), n)) : e[0] === "[]" && e.length === 3 ? (t = d(e[1]), n = d(e[2]), (o) => r(t(o), n(o))) : e[0] === "()" && e.length === 2 ? qe(e[1], r) : (
623
583
  // unwrap parens: (x)++
624
584
  (() => {
625
585
  throw Error("Invalid increment target");
626
586
  })()
627
587
  );
628
- l("++", (e, r) => Ye(e, r === null ? (t, n) => t[n]++ : (t, n) => ++t[n]));
629
- l("--", (e, r) => Ye(e, r === null ? (t, n) => t[n]-- : (t, n) => --t[n]));
630
- const Yt = 5, Zt = 10;
631
- Sr(",", Zt);
632
- Sr(";", Yt, !0);
633
- const Wr = (...e) => (e = e.map(d), (r) => {
588
+ l("++", (e, r) => qe(e, r === null ? (t, n) => t[n]++ : (t, n) => ++t[n]));
589
+ l("--", (e, r) => qe(e, r === null ? (t, n) => t[n]-- : (t, n) => --t[n]));
590
+ const zt = 5, Jt = 10;
591
+ vr(",", Jt);
592
+ vr(";", zt, !0);
593
+ const kr = (...e) => (e = e.map(d), (r) => {
634
594
  let t;
635
595
  for (const n of e) t = n(r);
636
596
  return t;
637
597
  });
638
- l(",", Wr);
639
- l(";", Wr);
640
- const xt = 170;
641
- Je("()", xt);
642
- const B = (e) => e?.[0] === "_" && e[1] === "_" || e === "constructor" || e === "prototype", Ze = 170;
643
- vr("[]", Ze);
644
- A(".", Ze);
645
- vr("()", Ze);
646
- const Ae = (e) => {
598
+ l(",", kr);
599
+ l(";", kr);
600
+ const Qt = 170;
601
+ ze("()", Qt);
602
+ const M = (e) => e?.[0] === "_" && e[1] === "_" || e === "constructor" || e === "prototype", Ye = 170;
603
+ Er("[]", Ye);
604
+ $(".", Ye);
605
+ Er("()", Ye);
606
+ const ye = (e) => {
647
607
  throw Error(e);
648
608
  };
649
609
  l("[]", (e, r) => r === void 0 ? (e = e ? e[0] === "," ? e.slice(1) : [e] : [], e = e.map((t) => t == null ? (() => {
650
- }) : t[0] === "..." ? (t = d(t[1]), (n) => t(n)) : (t = d(t), (n) => [t(n)])), (t) => e.flatMap((n) => n(t))) : (r == null && Ae("Missing index"), e = d(e), r = d(r), (t) => {
610
+ }) : t[0] === "..." ? (t = d(t[1]), (n) => t(n)) : (t = d(t), (n) => [t(n)])), (t) => e.flatMap((n) => n(t))) : (r == null && ye("Missing index"), e = d(e), r = d(r), (t) => {
651
611
  const n = r(t);
652
- return B(n) ? void 0 : e(t)[n];
612
+ return M(n) ? void 0 : e(t)[n];
653
613
  }));
654
- l(".", (e, r) => (e = d(e), r = r[0] ? r : r[1], B(r) ? () => {
614
+ l(".", (e, r) => (e = d(e), r = r[0] ? r : r[1], M(r) ? () => {
655
615
  } : (t) => e(t)[r]));
656
616
  l("()", (e, r) => {
657
- if (r === void 0) return e == null ? Ae("Empty ()") : d(e);
617
+ if (r === void 0) return e == null ? ye("Empty ()") : d(e);
658
618
  const t = (o) => o?.[0] === "," && o.slice(1).some((i) => i == null || t(i));
659
- t(r) && Ae("Empty argument");
619
+ t(r) && ye("Empty argument");
660
620
  const n = r ? r[0] === "," ? (r = r.slice(1).map(d), (o) => r.map((i) => i(o))) : (r = d(r), (o) => [r(o)]) : () => [];
661
- return xe(e, (o, i, s) => o[i](...n(s)));
621
+ return Ze(e, (o, i, s) => o[i](...n(s)));
662
622
  });
663
- const Y = (e) => typeof e == "string" || Array.isArray(e) && (e[0] === "." || e[0] === "?." || e[0] === "[]" && e.length === 3 || e[0] === "?.[]" || e[0] === "()" && e.length === 2 && Y(e[1]) || e[0] === "{}"), xe = (e, r, t, n) => e == null ? Ae("Empty ()") : e[0] === "()" && e.length == 2 ? xe(e[1], r) : typeof e == "string" ? (o) => r(o, e, o) : e[0] === "." ? (t = d(e[1]), n = e[2], (o) => r(t(o), n, o)) : e[0] === "?." ? (t = d(e[1]), n = e[2], (o) => {
623
+ const Q = (e) => typeof e == "string" || Array.isArray(e) && (e[0] === "." || e[0] === "?." || e[0] === "[]" && e.length === 3 || e[0] === "?.[]" || e[0] === "()" && e.length === 2 && Q(e[1]) || e[0] === "{}"), Ze = (e, r, t, n) => e == null ? ye("Empty ()") : e[0] === "()" && e.length == 2 ? Ze(e[1], r) : typeof e == "string" ? (o) => r(o, e, o) : e[0] === "." ? (t = d(e[1]), n = e[2], (o) => r(t(o), n, o)) : e[0] === "?." ? (t = d(e[1]), n = e[2], (o) => {
664
624
  const i = t(o);
665
625
  return i == null ? void 0 : r(i, n, o);
666
626
  }) : e[0] === "[]" && e.length === 3 ? (t = d(e[1]), n = d(e[2]), (o) => r(t(o), n(o), o)) : e[0] === "?.[]" ? (t = d(e[1]), n = d(e[2]), (o) => {
667
627
  const i = t(o);
668
628
  return i == null ? void 0 : r(i, n(o), o);
669
- }) : (e = d(e), (o) => r([e(o)], 0, o)), ee = xe, bt = 32, en = y.space;
670
- y.comment ??= { "//": `
629
+ }) : (e = d(e), (o) => r([e(o)], 0, o)), x = Ze, qt = 32, Yt = g.space;
630
+ g.comment ??= { "//": `
671
631
  `, "/*": "*/" };
672
632
  let De;
673
- y.space = () => {
674
- De || (De = Object.entries(y.comment).map(([o, i]) => [o, i, o.charCodeAt(0)]));
675
- for (var e; e = en(); ) {
633
+ g.space = () => {
634
+ De || (De = Object.entries(g.comment).map(([o, i]) => [o, i, o.charCodeAt(0)]));
635
+ for (var e; e = Yt(); ) {
676
636
  for (var r = 0, t; t = De[r++]; )
677
637
  if (e === t[2] && p.substr(f, t[0].length) === t[0]) {
678
638
  var n = f + t[0].length;
679
639
  if (t[1] === `
680
- `) for (; p.charCodeAt(n) >= bt; ) n++;
640
+ `) for (; p.charCodeAt(n) >= qt; ) n++;
681
641
  else {
682
642
  for (; p[n] && p.substr(n, t[1].length) !== t[1]; ) n++;
683
643
  p[n] && (n += t[1].length);
@@ -689,52 +649,52 @@ y.space = () => {
689
649
  }
690
650
  return e;
691
651
  };
692
- const Rr = 80;
693
- A("===", Rr);
694
- A("!==", Rr);
652
+ const Pr = 80;
653
+ $("===", Pr);
654
+ $("!==", Pr);
695
655
  l("===", (e, r) => (e = d(e), r = d(r), (t) => e(t) === r(t)));
696
656
  l("!==", (e, r) => (e = d(e), r = d(r), (t) => e(t) !== r(t)));
697
- const rn = 30;
698
- A("??", rn);
657
+ const Zt = 30;
658
+ $("??", Zt);
699
659
  l("??", (e, r) => (e = d(e), r = d(r), (t) => e(t) ?? r(t)));
700
- const tn = 130, nn = 20;
701
- A("**", tn, !0);
702
- A("**=", nn, !0);
660
+ const xt = 130, bt = 20;
661
+ $("**", xt, !0);
662
+ $("**=", bt, !0);
703
663
  l("**", (e, r) => (e = d(e), r = d(r), (t) => e(t) ** r(t)));
704
- const on = (e) => {
664
+ const en = (e) => {
705
665
  throw Error(e);
706
666
  };
707
- l("**=", (e, r) => (Y(e) || on("Invalid assignment target"), r = d(r), ee(e, (t, n, o) => t[n] **= r(o))));
708
- const kr = 90;
709
- A("in", kr);
710
- A("of", kr);
667
+ l("**=", (e, r) => (Q(e) || en("Invalid assignment target"), r = d(r), x(e, (t, n, o) => t[n] **= r(o))));
668
+ const _r = 90;
669
+ $("in", _r);
670
+ $("of", _r);
711
671
  l("in", (e, r) => (e = d(e), r = d(r), (t) => e(t) in r(t)));
712
- const sn = 20, dn = 100, un = (e) => {
672
+ const rn = 20, tn = 100, nn = (e) => {
713
673
  throw Error(e);
714
674
  };
715
- A(">>>", dn);
716
- A(">>>=", sn, !0);
675
+ $(">>>", tn);
676
+ $(">>>=", rn, !0);
717
677
  l(">>>", (e, r) => (e = d(e), r = d(r), (t) => e(t) >>> r(t)));
718
- l(">>>=", (e, r) => (Y(e) || un("Invalid assignment target"), r = d(r), ee(e, (t, n, o) => t[n] >>>= r(o))));
719
- const be = 5, cn = 10, ln = 20, an = (e) => e[0]?.[0] === "," ? e[0].slice(1) : e, $e = (e, r, t) => {
678
+ l(">>>=", (e, r) => (Q(e) || nn("Invalid assignment target"), r = d(r), x(e, (t, n, o) => t[n] >>>= r(o))));
679
+ const xe = 5, on = 10, sn = 20, dn = (e) => e[0]?.[0] === "," ? e[0].slice(1) : e, $e = (e, r, t) => {
720
680
  if (typeof e == "string") {
721
681
  t[e] = r;
722
682
  return;
723
683
  }
724
- const [n, ...o] = e, i = an(o);
684
+ const [n, ...o] = e, i = dn(o);
725
685
  if (n === "{}") {
726
686
  const s = [];
727
687
  for (const u of i) {
728
688
  if (Array.isArray(u) && u[0] === "...") {
729
689
  const a = {};
730
- for (const w in r) s.includes(w) || (a[w] = r[w]);
690
+ for (const C in r) s.includes(C) || (a[C] = r[C]);
731
691
  t[u[1]] = a;
732
692
  break;
733
693
  }
734
- let c, h, $;
735
- typeof u == "string" ? c = h = u : u[0] === "=" ? (typeof u[1] == "string" ? c = h = u[1] : [, c, h] = u[1], $ = u[2]) : [, c, h] = u, s.push(c);
694
+ let c, h, A;
695
+ typeof u == "string" ? c = h = u : u[0] === "=" ? (typeof u[1] == "string" ? c = h = u[1] : [, c, h] = u[1], A = u[2]) : [, c, h] = u, s.push(c);
736
696
  let m = r[c];
737
- m === void 0 && $ && (m = d($)(t)), $e(h, m, t);
697
+ m === void 0 && A && (m = d(A)(t)), $e(h, m, t);
738
698
  }
739
699
  } else if (n === "[]") {
740
700
  let s = 0;
@@ -749,18 +709,18 @@ const be = 5, cn = 10, ln = 20, an = (e) => e[0]?.[0] === "," ? e[0].slice(1) :
749
709
  }
750
710
  let c = u, h;
751
711
  Array.isArray(u) && u[0] === "=" && ([, c, h] = u);
752
- let $ = r[s++];
753
- $ === void 0 && h && ($ = d(h)(t)), $e(c, $, t);
712
+ let A = r[s++];
713
+ A === void 0 && h && (A = d(h)(t)), $e(c, A, t);
754
714
  }
755
715
  }
756
- }, _r = (e) => {
757
- let r = E(cn - 1);
716
+ }, Nr = (e) => {
717
+ let r = S(on - 1);
758
718
  return r?.[0] === "in" || r?.[0] === "of" ? [r[0], [e, r[1]], r[2]] : r?.[0] === "," ? [e, ...r.slice(1)] : [e, r];
759
719
  };
760
- ce("let", be + 1, () => _r("let"));
761
- ce("const", be + 1, () => _r("const"));
762
- ce("var", be, () => (G(), ["var", E(ln)]));
763
- const Nr = (...e) => (e = e.map((r) => {
720
+ ce("let", xe + 1, () => Nr("let"));
721
+ ce("const", xe + 1, () => Nr("const"));
722
+ ce("var", xe, () => (H(), ["var", S(sn)]));
723
+ const jr = (...e) => (e = e.map((r) => {
764
724
  if (typeof r == "string") return (t) => {
765
725
  t[r] = void 0;
766
726
  };
@@ -774,18 +734,18 @@ const Nr = (...e) => (e = e.map((r) => {
774
734
  }), (r) => {
775
735
  for (const t of e) t(r);
776
736
  });
777
- l("let", Nr);
778
- l("const", Nr);
737
+ l("let", jr);
738
+ l("const", jr);
779
739
  l("var", (e) => typeof e == "string" ? (r) => {
780
740
  r[e] = void 0;
781
741
  } : () => {
782
742
  });
783
- const er = 20, Fe = (e) => {
743
+ const be = 20, Oe = (e) => {
784
744
  throw Error(e);
785
745
  };
786
- A("||=", er, !0);
787
- A("&&=", er, !0);
788
- A("??=", er, !0);
746
+ $("||=", be, !0);
747
+ $("&&=", be, !0);
748
+ $("??=", be, !0);
789
749
  l("=", (e, r) => {
790
750
  if (Array.isArray(e) && (e[0] === "let" || e[0] === "const" || e[0] === "var")) {
791
751
  const t = e[1];
@@ -793,22 +753,22 @@ l("=", (e, r) => {
793
753
  n[t] = r(n);
794
754
  } : (n) => $e(t, r(n), n);
795
755
  }
796
- return Y(e) || Fe("Invalid assignment target"), r = d(r), ee(e, (t, n, o) => t[n] = r(o));
756
+ return Q(e) || Oe("Invalid assignment target"), r = d(r), x(e, (t, n, o) => t[n] = r(o));
797
757
  });
798
- l("||=", (e, r) => (Y(e) || Fe("Invalid assignment target"), r = d(r), ee(e, (t, n, o) => t[n] ||= r(o))));
799
- l("&&=", (e, r) => (Y(e) || Fe("Invalid assignment target"), r = d(r), ee(e, (t, n, o) => t[n] &&= r(o))));
800
- l("??=", (e, r) => (Y(e) || Fe("Invalid assignment target"), r = d(r), ee(e, (t, n, o) => t[n] ??= r(o))));
758
+ l("||=", (e, r) => (Q(e) || Oe("Invalid assignment target"), r = d(r), x(e, (t, n, o) => t[n] ||= r(o))));
759
+ l("&&=", (e, r) => (Q(e) || Oe("Invalid assignment target"), r = d(r), x(e, (t, n, o) => t[n] &&= r(o))));
760
+ l("??=", (e, r) => (Q(e) || Oe("Invalid assignment target"), r = d(r), x(e, (t, n, o) => t[n] ??= r(o))));
801
761
  ue("true", !0);
802
762
  ue("false", !1);
803
763
  ue("null", null);
804
764
  ce("undefined", 200, () => []);
805
765
  ue("NaN", NaN);
806
766
  ue("Infinity", 1 / 0);
807
- const Pe = 20;
808
- k("?", Pe, (e, r, t) => e && (r = E(Pe - 1)) && b((n) => n === 58) && (t = E(Pe - 1), ["?", e, r, t]));
767
+ const Te = 20;
768
+ P("?", Te, (e, r, t) => e && (r = S(Te - 1)) && Z((n) => n === 58) && (t = S(Te - 1), ["?", e, r, t]));
809
769
  l("?", (e, r, t) => (e = d(e), r = d(r), t = d(t), (n) => e(n) ? r(n) : t(n)));
810
- const fn = [], hn = 20;
811
- A("=>", hn, !0);
770
+ const un = [], cn = 20;
771
+ $("=>", cn, !0);
812
772
  l("=>", (e, r) => {
813
773
  e = e?.[0] === "()" ? e[1] : e;
814
774
  const t = e ? e[0] === "," ? e.slice(1) : [e] : [];
@@ -819,72 +779,72 @@ l("=>", (e, r) => {
819
779
  return r = d(s ? ["{", r[1]] : r), (u) => (...c) => {
820
780
  const h = {};
821
781
  t.forEach((m, a) => h[m] = c[a]), o && (h[o] = c.slice(n));
822
- const $ = new Proxy(h, {
782
+ const A = new Proxy(h, {
823
783
  get: (m, a) => a in m ? m[a] : u?.[a],
824
- set: (m, a, w) => ((a in m ? m : u)[a] = w, !0),
784
+ set: (m, a, C) => ((a in m ? m : u)[a] = C, !0),
825
785
  has: (m, a) => a in m || (u ? a in u : !1)
826
786
  });
827
787
  try {
828
- const m = r($);
788
+ const m = r(A);
829
789
  return s ? void 0 : m;
830
790
  } catch (m) {
831
- if (m === fn) return m[0];
791
+ if (m === un) return m[0];
832
792
  throw m;
833
793
  }
834
794
  };
835
795
  });
836
- const pn = 140;
837
- K("...", pn);
796
+ const ln = 140;
797
+ B("...", ln);
838
798
  l("...", (e) => (e = d(e), (r) => Object.entries(e(r))));
839
799
  const fr = 170;
840
- k("?.", fr, (e, r) => {
800
+ P("?.", fr, (e, r) => {
841
801
  if (!e) return;
842
- const t = G();
843
- return t === 40 ? (O(), ["?.()", e, E(0, 41) || null]) : t === 91 ? (O(), ["?.[]", e, E(0, 93)]) : (r = E(fr), r ? ["?.", e, r] : void 0);
802
+ const t = H();
803
+ return t === 40 ? (I(), ["?.()", e, S(0, 41) || null]) : t === 91 ? (I(), ["?.[]", e, S(0, 93)]) : (r = S(fr), r ? ["?.", e, r] : void 0);
844
804
  });
845
- l("?.", (e, r) => (e = d(e), B(r) ? () => {
805
+ l("?.", (e, r) => (e = d(e), M(r) ? () => {
846
806
  } : (t) => e(t)?.[r]));
847
807
  l("?.[]", (e, r) => (e = d(e), r = d(r), (t) => {
848
808
  const n = r(t);
849
- return B(n) ? void 0 : e(t)?.[n];
809
+ return M(n) ? void 0 : e(t)?.[n];
850
810
  }));
851
811
  l("?.()", (e, r) => {
852
812
  const t = r ? r[0] === "," ? (r = r.slice(1).map(d), (o) => r.map((i) => i(o))) : (r = d(r), (o) => [r(o)]) : () => [];
853
813
  if (e[0] === "?.") {
854
814
  const o = d(e[1]), i = e[2];
855
- return B(i) ? () => {
815
+ return M(i) ? () => {
856
816
  } : (s) => o(s)?.[i]?.(...t(s));
857
817
  }
858
818
  if (e[0] === "?.[]") {
859
819
  const o = d(e[1]), i = d(e[2]);
860
820
  return (s) => {
861
821
  const u = o(s), c = i(s);
862
- return B(c) ? void 0 : u?.[c]?.(...t(s));
822
+ return M(c) ? void 0 : u?.[c]?.(...t(s));
863
823
  };
864
824
  }
865
825
  if (e[0] === ".") {
866
826
  const o = d(e[1]), i = e[2];
867
- return B(i) ? () => {
827
+ return M(i) ? () => {
868
828
  } : (s) => o(s)?.[i]?.(...t(s));
869
829
  }
870
830
  if (e[0] === "[]" && e.length === 3) {
871
831
  const o = d(e[1]), i = d(e[2]);
872
832
  return (s) => {
873
833
  const u = o(s), c = i(s);
874
- return B(c) ? void 0 : u?.[c]?.(...t(s));
834
+ return M(c) ? void 0 : u?.[c]?.(...t(s));
875
835
  };
876
836
  }
877
837
  const n = d(e);
878
838
  return (o) => n(o)?.(...t(o));
879
839
  });
880
- const oe = 140;
881
- K("typeof", oe);
882
- K("void", oe);
883
- K("delete", oe);
840
+ const ne = 140;
841
+ B("typeof", ne);
842
+ B("void", ne);
843
+ B("delete", ne);
884
844
  ce(
885
845
  "new",
886
- oe,
887
- () => Tt(".target") ? (O(7), ["new.target"]) : ["new", E(oe)]
846
+ ne,
847
+ () => Ot(".target") ? (I(7), ["new.target"]) : ["new", S(ne)]
888
848
  );
889
849
  l("typeof", (e) => (e = d(e), (r) => typeof e(r)));
890
850
  l("void", (e) => (e = d(e), (r) => (e(r), void 0)));
@@ -903,52 +863,52 @@ l("new", (e) => {
903
863
  const r = d(e?.[0] === "()" ? e[1] : e), t = e?.[0] === "()" ? e[2] : null, n = t ? t[0] === "," ? /* @__PURE__ */ ((o) => (i) => o.map((s) => s(i)))(t.slice(1).map(d)) : /* @__PURE__ */ ((o) => (i) => [o(i)])(d(t)) : () => [];
904
864
  return (o) => new (r(o))(...n(o));
905
865
  });
906
- const rr = Symbol("accessor"), tr = 20, mn = 40, jr = 41, Lr = 123, Vr = 125, Mr = (e) => (r) => {
866
+ const er = Symbol("accessor"), rr = 20, an = 40, Lr = 41, Vr = 123, Rr = 125, Ur = (e) => (r) => {
907
867
  if (r) return;
908
- G();
909
- const t = b(y.id);
910
- if (!t || (G(), p.charCodeAt(f) !== mn)) return !1;
911
- O();
912
- const n = E(0, jr);
913
- return G(), p.charCodeAt(f) !== Lr ? !1 : (O(), [e, t, n, E(0, Vr)]);
868
+ H();
869
+ const t = Z(g.id);
870
+ if (!t || (H(), p.charCodeAt(f) !== an)) return !1;
871
+ I();
872
+ const n = S(0, Lr);
873
+ return H(), p.charCodeAt(f) !== Vr ? !1 : (I(), [e, t, n, S(0, Rr)]);
914
874
  };
915
- k("get", tr - 1, Mr("get"));
916
- k("set", tr - 1, Mr("set"));
917
- k("(", tr - 1, (e) => {
875
+ P("get", rr - 1, Ur("get"));
876
+ P("set", rr - 1, Ur("set"));
877
+ P("(", rr - 1, (e) => {
918
878
  if (!e || typeof e != "string") return;
919
- const r = E(0, jr) || null;
920
- if (G(), p.charCodeAt(f) === Lr)
921
- return O(), [":", e, ["=>", ["()", r], E(0, Vr) || null]];
879
+ const r = S(0, Lr) || null;
880
+ if (H(), p.charCodeAt(f) === Vr)
881
+ return I(), [":", e, ["=>", ["()", r], S(0, Rr) || null]];
922
882
  });
923
883
  l("get", (e, r) => (r = r ? d(r) : () => {
924
- }, (t) => [[rr, e, {
884
+ }, (t) => [[er, e, {
925
885
  get: function() {
926
886
  const n = Object.create(t || {});
927
887
  return n.this = this, r(n);
928
888
  }
929
889
  }]]));
930
890
  l("set", (e, r, t) => (t = t ? d(t) : () => {
931
- }, (n) => [[rr, e, {
891
+ }, (n) => [[er, e, {
932
892
  set: function(o) {
933
893
  const i = Object.create(n || {});
934
894
  i.this = this, i[r] = o, t(i);
935
895
  }
936
896
  }]]));
937
- const gn = 20, Ur = 200;
938
- y.prop = (e) => Pt(e) !== 58;
939
- const yn = (e) => e == null || typeof e == "string" || [":", ",", "...", "get", "set"].includes(e[0]);
940
- Je("[]", Ur);
941
- Je("{}", Ur);
942
- A(":", gn - 1, !0);
897
+ const fn = 20, Mr = 200;
898
+ g.prop = (e) => Ct(e) !== 58;
899
+ const hn = (e) => e == null || typeof e == "string" || [":", ",", "...", "get", "set"].includes(e[0]);
900
+ ze("[]", Mr);
901
+ ze("{}", Mr);
902
+ $(":", fn - 1, !0);
943
903
  l("{}", (e, r) => {
944
904
  if (r !== void 0) return;
945
- if (!yn(e)) return d(["{", e]);
905
+ if (!hn(e)) return d(["{", e]);
946
906
  e = e ? e[0] !== "," ? [e] : e.slice(1) : [];
947
907
  const t = e.map((n) => d(typeof n == "string" ? [":", n, n] : n));
948
908
  return (n) => {
949
909
  const o = {}, i = {};
950
910
  for (const s of t.flatMap((u) => u(n)))
951
- if (s[0] === rr) {
911
+ if (s[0] === er) {
952
912
  const [, u, c] = s;
953
913
  i[u] = { ...i[u], ...c, configurable: !0, enumerable: !0 };
954
914
  } else o[s[0]] = s[1];
@@ -959,19 +919,19 @@ l("{}", (e, r) => {
959
919
  l("{", (e) => (e = e ? d(e) : () => {
960
920
  }, (r) => e(Object.create(r))));
961
921
  l(":", (e, r) => (r = d(r), Array.isArray(e) ? (e = d(e), (t) => [[e(t), r(t)]]) : (t) => [[e, r(t)]]));
962
- const An = 170, Ee = 96, $n = 36, En = 123, Sn = 92, vn = { n: `
922
+ const pn = 170, Ae = 96, mn = 36, gn = 123, yn = 92, $n = { n: `
963
923
  `, r: "\r", t: " ", b: "\b", f: "\f", v: "\v" }, hr = () => {
964
924
  const e = [];
965
- for (let r = "", t; (t = p.charCodeAt(f)) !== Ee; )
966
- t ? t === Sn ? (O(), r += vn[p[f]] || p[f], O()) : t === $n && p.charCodeAt(f + 1) === En ? (r && e.push([, r]), r = "", O(2), e.push(E(0, 125))) : (r += p[f], O(), t = p.charCodeAt(f), t === Ee && r && e.push([, r])) : q("Unterminated template");
967
- return O(), e;
968
- }, In = _[Ee];
969
- _[Ee] = (e, r) => e && r < An ? y.asi && y.newline ? void 0 : (O(), ["``", e, ...hr()]) : (
925
+ for (let r = "", t; (t = p.charCodeAt(f)) !== Ae; )
926
+ t ? t === yn ? (I(), r += $n[p[f]] || p[f], I()) : t === mn && p.charCodeAt(f + 1) === gn ? (r && e.push([, r]), r = "", I(2), e.push(S(0, 125))) : (r += p[f], I(), t = p.charCodeAt(f), t === Ae && r && e.push([, r])) : J("Unterminated template");
927
+ return I(), e;
928
+ }, An = _[Ae];
929
+ _[Ae] = (e, r) => e && r < pn ? g.asi && g.newline ? void 0 : (I(), ["``", e, ...hr()]) : (
970
930
  // tagged
971
931
  e ? (
972
932
  // plain
973
- In?.(e, r)
974
- ) : (O(), ((t) => t.length < 2 && t[0]?.[0] === void 0 ? t[0] || [, ""] : ["`", ...t])(hr()))
933
+ An?.(e, r)
934
+ ) : (I(), ((t) => t.length < 2 && t[0]?.[0] === void 0 ? t[0] || [, ""] : ["`", ...t])(hr()))
975
935
  );
976
936
  l("`", (...e) => (e = e.map(d), (r) => e.map((t) => t(r)).join("")));
977
937
  l("``", (e, ...r) => {
@@ -982,44 +942,44 @@ l("``", (e, ...r) => {
982
942
  const o = Object.assign([...t], { raw: t });
983
943
  return (i) => e(i)(o, ...n.map((s) => s(i)));
984
944
  });
985
- y.string["'"] = !0;
986
- y.number = { "0x": 16, "0b": 2, "0o": 8 };
987
- const On = {
945
+ g.string["'"] = !0;
946
+ g.number = { "0x": 16, "0b": 2, "0o": 8 };
947
+ const Sn = {
988
948
  log: (e, r) => (r ? console.log(r, e) : console.log(e), e)
989
949
  };
990
- function V(e, r, t, n, o) {
991
- const i = y(wn(e));
950
+ function L(e, r, t, n, o) {
951
+ const i = g(tr(e));
992
952
  return d(i)({
993
953
  $form: r,
994
954
  $meta: t,
995
955
  $errors: n,
996
956
  $formIsInvalid: o,
997
- $log: On.log
957
+ $log: Sn.log
998
958
  }) === !0;
999
959
  }
1000
- function wn(e) {
960
+ function tr(e) {
1001
961
  return e.replace(/\?\.(\d+)/g, "?.[$1]").replace(/\.(\d+)/g, "[$1]");
1002
962
  }
1003
- const M = (e) => {
963
+ const V = (e) => {
1004
964
  let r = e.formDef.states;
1005
965
  if (!r || Object.keys(r).length === 0 || e.formHealth.status === "errored")
1006
966
  return e;
1007
- const { $formIsInvalid: t, $errors: n } = Xe(e);
1008
- r = Cn(r);
967
+ const { $formIsInvalid: t, $errors: n } = Ke(e);
968
+ r = vn(r);
1009
969
  let o = [], i = { status: "ok" };
1010
970
  try {
1011
971
  o = Object.keys(r).map((s) => {
1012
972
  const u = r[s];
1013
973
  let c;
1014
974
  try {
1015
- c = V(u, e.data, e.meta, n, t);
975
+ c = L(u, e.data, e.meta, n, t);
1016
976
  } catch {
1017
977
  c = !1;
1018
978
  }
1019
979
  return c === !0 ? s : void 0;
1020
980
  }).filter((s) => s !== void 0);
1021
981
  } catch (s) {
1022
- const u = s, c = he.calculateCurrentStateError;
982
+ const u = s, c = ee.calculateCurrentStateError;
1023
983
  i = {
1024
984
  status: "errored",
1025
985
  message: `[${c}] ${u.message}`,
@@ -1028,7 +988,7 @@ const M = (e) => {
1028
988
  }
1029
989
  return { ...e, currentStates: o, formHealth: i };
1030
990
  };
1031
- function Cn(e) {
991
+ function vn(e) {
1032
992
  const r = {};
1033
993
  function t(n) {
1034
994
  const o = n.split(":"), i = [];
@@ -1053,17 +1013,17 @@ function Hr(e, r) {
1053
1013
  }
1054
1014
  return t;
1055
1015
  }
1056
- function Oo(e, r, t) {
1016
+ function vo(e, r, t) {
1057
1017
  for (let n = 0; n < e.length; n++)
1058
1018
  r(e[n], n, e) && t(e[n], n, e);
1059
1019
  }
1060
- function Fn(e, r, t, n) {
1020
+ function En(e, r, t, n) {
1061
1021
  let o = n;
1062
1022
  for (let i = 0; i < e.length; i++)
1063
1023
  r(e[i], i, e) && (o = t(o, e[i], i, e));
1064
1024
  return o;
1065
1025
  }
1066
- function Dn(e, r, t) {
1026
+ function wn(e, r, t) {
1067
1027
  if (e.length !== r.length)
1068
1028
  return !1;
1069
1029
  for (let n = 0; n < e.length; n++)
@@ -1071,12 +1031,12 @@ function Dn(e, r, t) {
1071
1031
  return !1;
1072
1032
  return !0;
1073
1033
  }
1074
- function Pn(e, r) {
1034
+ function In(e, r) {
1075
1035
  const t = Br(e.uid, r);
1076
1036
  return D(e) ? {
1077
1037
  ...e,
1078
1038
  uid: t,
1079
- path: Tn(e.path, r)
1039
+ path: Cn(e.path, r)
1080
1040
  } : {
1081
1041
  ...e,
1082
1042
  uid: t
@@ -1088,7 +1048,7 @@ function Br(e, r) {
1088
1048
  const t = r.reduce((n, o) => `${n}[${o}]`, "");
1089
1049
  return `${e}${t}`;
1090
1050
  }
1091
- function Tn(e, r) {
1051
+ function Cn(e, r) {
1092
1052
  if (r.length === 0)
1093
1053
  throw new Error("Repeater indexes cannot be an empty array");
1094
1054
  const t = "items", n = e.split(`.${t}`), o = n.length - 1;
@@ -1105,21 +1065,21 @@ function ae(e, r) {
1105
1065
  return i === void 0 ? n : `.${i}${o}.`;
1106
1066
  });
1107
1067
  }
1108
- const fe = (e, r) => (t) => e(t) ? r(t) : t, z = (e) => e !== void 0 && typeof e == "object" && e !== null && "when" in e, U = (e) => {
1109
- const { $formIsInvalid: r, $errors: t } = Xe(e);
1068
+ const fe = (e, r) => (t) => e(t) ? r(t) : t, K = (e) => e !== void 0 && typeof e == "object" && e !== null && "when" in e, R = (e) => {
1069
+ const { $formIsInvalid: r, $errors: t } = Ke(e);
1110
1070
  return {
1111
1071
  ...e,
1112
1072
  widgetFlags: {
1113
- ...Wn(e, t, r),
1114
- ...Rn(e, t, r)
1073
+ ...On(e, t, r),
1074
+ ...Dn(e, t, r)
1115
1075
  }
1116
1076
  };
1117
1077
  };
1118
- function Wn(e, r, t) {
1078
+ function On(e, r, t) {
1119
1079
  return Hr(Object.values(e.flatForm), (n) => {
1120
1080
  if (n.uid?.includes("["))
1121
1081
  return nr;
1122
- if (de(n)) {
1082
+ if (se(n)) {
1123
1083
  const o = n({
1124
1084
  $form: e.data,
1125
1085
  errors: void 0,
@@ -1129,10 +1089,10 @@ function Wn(e, r, t) {
1129
1089
  return o.uid = n.uid, o;
1130
1090
  }
1131
1091
  return n;
1132
- }).filter((n) => !!(n.include && ("in" in n.include || "when" in n.include) || n.exclude && ("from" in n.exclude || "when" in n.exclude) || (D(n) || te(n)) && z(n.disabled) || D(n) && z(n.readonly))).reduce(
1092
+ }).filter((n) => !!(n.include && ("in" in n.include || "when" in n.include) || n.exclude && ("from" in n.exclude || "when" in n.exclude) || (D(n) || re(n)) && K(n.disabled) || D(n) && K(n.readonly))).reduce(
1133
1093
  (n, o) => (n[o.uid] = n[o.uid] || {}, o.include && "in" in o.include ? n[o.uid].hidden = !o.include.in.some(
1134
1094
  (i) => e.currentStates.includes(i)
1135
- ) : o.include && "when" in o.include && (n[o.uid].hidden = !V(
1095
+ ) : o.include && "when" in o.include && (n[o.uid].hidden = !L(
1136
1096
  o.include.when,
1137
1097
  e.data,
1138
1098
  e.meta,
@@ -1140,19 +1100,19 @@ function Wn(e, r, t) {
1140
1100
  t
1141
1101
  )), o.exclude && "from" in o.exclude ? n[o.uid].hidden = o.exclude.from.some(
1142
1102
  (i) => e.currentStates.includes(i)
1143
- ) : o.exclude && "when" in o.exclude && (n[o.uid].hidden = V(
1103
+ ) : o.exclude && "when" in o.exclude && (n[o.uid].hidden = L(
1144
1104
  o.exclude.when,
1145
1105
  e.data,
1146
1106
  e.meta,
1147
1107
  r,
1148
1108
  t
1149
- )), (D(o) || te(o)) && z(o.disabled) && (n[o.uid].disabled = V(
1109
+ )), (D(o) || re(o)) && K(o.disabled) && (n[o.uid].disabled = L(
1150
1110
  o.disabled.when,
1151
1111
  e.data,
1152
1112
  e.meta,
1153
1113
  r,
1154
1114
  t
1155
- )), D(o) && z(o.readonly) && (n[o.uid].readonly = V(
1115
+ )), D(o) && K(o.readonly) && (n[o.uid].readonly = L(
1156
1116
  o.readonly.when,
1157
1117
  e.data,
1158
1118
  e.meta,
@@ -1162,10 +1122,10 @@ function Wn(e, r, t) {
1162
1122
  {}
1163
1123
  );
1164
1124
  }
1165
- function Rn(e, r, t) {
1166
- return Fn(
1125
+ function Dn(e, r, t) {
1126
+ return En(
1167
1127
  Object.values(e.flatForm),
1168
- (n) => !de(n) && n.type === "repeater",
1128
+ (n) => !se(n) && n.type === "repeater",
1169
1129
  (n, o) => ({
1170
1130
  ...n,
1171
1131
  ...Gr(e, o, [], r, t)
@@ -1174,62 +1134,62 @@ function Rn(e, r, t) {
1174
1134
  );
1175
1135
  }
1176
1136
  function Gr(e, r, t, n, o) {
1177
- const i = r.props.template, s = N(e.data, r.path);
1137
+ const i = r.props.template, s = de(e.data, r.path);
1178
1138
  if (!Array.isArray(s))
1179
1139
  return {};
1180
1140
  const u = {};
1181
1141
  return s.forEach((c, h) => {
1182
- const $ = [...t, h];
1183
- Ke([i]).forEach((m) => {
1142
+ const A = [...t, h];
1143
+ Ge([i]).forEach((m) => {
1184
1144
  let a;
1185
- if (de(m) ? (a = m({
1145
+ if (se(m) ? (a = m({
1186
1146
  $form: e.data,
1187
1147
  errors: void 0,
1188
1148
  touched: void 0,
1189
1149
  translate: void 0
1190
1150
  }), a.uid = m.uid) : a = m, a.type === "repeater") {
1191
- const re = Pn(
1151
+ const b = In(
1192
1152
  a,
1193
- $
1153
+ A
1194
1154
  );
1195
1155
  Object.assign(
1196
1156
  u,
1197
1157
  Gr(
1198
1158
  e,
1199
- re,
1200
- $,
1159
+ b,
1160
+ A,
1201
1161
  n,
1202
1162
  o
1203
1163
  )
1204
1164
  );
1205
1165
  return;
1206
1166
  }
1207
- const w = Br(a.uid, $);
1208
- u[w] = u[w] || {}, a.include && "in" in a.include ? u[w].hidden = !a.include.in.some((re) => e.currentStates.includes(re)) : a.include && "when" in a.include && (u[w].hidden = !V(
1209
- ae(a.include.when, $),
1167
+ const C = Br(a.uid, A);
1168
+ u[C] = u[C] || {}, a.include && "in" in a.include ? u[C].hidden = !a.include.in.some((b) => e.currentStates.includes(b)) : a.include && "when" in a.include && (u[C].hidden = !L(
1169
+ ae(a.include.when, A),
1210
1170
  e.data,
1211
1171
  e.meta,
1212
1172
  n,
1213
1173
  o
1214
- )), a.exclude && "from" in a.exclude ? u[w].hidden = a.exclude.from.some((re) => e.currentStates.includes(re)) : a.exclude && "when" in a.exclude && (u[w].hidden = V(
1215
- ae(a.exclude.when, $),
1174
+ )), a.exclude && "from" in a.exclude ? u[C].hidden = a.exclude.from.some((b) => e.currentStates.includes(b)) : a.exclude && "when" in a.exclude && (u[C].hidden = L(
1175
+ ae(a.exclude.when, A),
1216
1176
  e.data,
1217
1177
  e.meta,
1218
1178
  n,
1219
1179
  o
1220
- )), (D(a) || te(a)) && z(a.disabled) && (u[w].disabled = V(
1180
+ )), (D(a) || re(a)) && K(a.disabled) && (u[C].disabled = L(
1221
1181
  ae(
1222
1182
  a.disabled.when,
1223
- $
1183
+ A
1224
1184
  ),
1225
1185
  e.data,
1226
1186
  e.meta,
1227
1187
  n,
1228
1188
  o
1229
- )), D(a) && z(a.readonly) && (u[w].readonly = V(
1189
+ )), D(a) && K(a.readonly) && (u[C].readonly = L(
1230
1190
  ae(
1231
1191
  a.readonly.when,
1232
- $
1192
+ A
1233
1193
  ),
1234
1194
  e.data,
1235
1195
  e.meta,
@@ -1239,21 +1199,32 @@ function Gr(e, r, t, n, o) {
1239
1199
  });
1240
1200
  }), u;
1241
1201
  }
1242
- const L = (e) => (r) => ({
1243
- ...r,
1244
- calculatedWidgets: kn(r, e)
1245
- });
1246
- function kn(e, r) {
1247
- const { $formIsInvalid: t, $errors: n } = Xe(e), o = Yn(e, r, t, n), i = {};
1202
+ const j = (e) => (r) => {
1203
+ try {
1204
+ return { ...r, calculatedWidgets: Tn(r, e) };
1205
+ } catch (t) {
1206
+ const n = t;
1207
+ return {
1208
+ ...r,
1209
+ formHealth: {
1210
+ status: "errored",
1211
+ message: `[${n.code}] ${n.message}`,
1212
+ code: n.code
1213
+ }
1214
+ };
1215
+ }
1216
+ };
1217
+ function Tn(e, r) {
1218
+ const { $formIsInvalid: t, $errors: n } = Ke(e), o = Jn(e, r, t, n), i = {};
1248
1219
  for (const s of Object.keys(e.calculatedWidgets)) {
1249
1220
  if (e.widgetFlags[s]?.hidden)
1250
1221
  continue;
1251
1222
  const u = e.calculatedWidgets[s], c = u.source;
1252
- if (de(c)) {
1253
- i[s] = _n(s, c, e, r);
1223
+ if (se(c)) {
1224
+ i[s] = Wn(s, c, e, r);
1254
1225
  continue;
1255
1226
  }
1256
- i[s] = Nn(
1227
+ i[s] = Fn(
1257
1228
  u,
1258
1229
  c,
1259
1230
  e,
@@ -1262,7 +1233,7 @@ function kn(e, r) {
1262
1233
  }
1263
1234
  return i;
1264
1235
  }
1265
- function _n(e, r, t, n) {
1236
+ function Wn(e, r, t, n) {
1266
1237
  const o = r({
1267
1238
  $form: t.data,
1268
1239
  errors: r.path ? t.validations[r.path] : void 0,
@@ -1271,85 +1242,98 @@ function _n(e, r, t, n) {
1271
1242
  });
1272
1243
  return o.uid = e, { source: r, current: o };
1273
1244
  }
1274
- function Nn(e, r, t, n) {
1275
- const o = new qn(r, e.current);
1276
- return o.write("uid", r.uid), o.write("type", r.type), o.write("kind", r.kind), ct(r) ? jn(o, n) : te(r) ? Ln(o, n) : D(r) ? Vn(o, n) : ke(r) && Mn(o, n), Un(r, o, n, t), (te(r) || D(r)) && Hn(r, o, n), ke(r) && Bn(r, o, t), o.changed ? { source: e.source, current: o.current } : e;
1245
+ function Fn(e, r, t, n) {
1246
+ const o = new zn(r, e.current);
1247
+ return o.write("uid", r.uid), o.write("type", r.type), o.write("kind", r.kind), lt(r) ? kn(o, n) : re(r) ? Pn(o, n) : D(r) ? _n(o, n) : Pe(r) && Nn(o, n), jn(r, o, n, t), (re(r) || D(r)) && Ln(r, o, n), Pe(r) && Vn(r, o, t), o.changed ? { source: e.source, current: o.current } : e;
1277
1248
  }
1278
- function jn(e, r) {
1279
- S(e, r, "size"), S(e, r, "include"), S(e, r, "exclude");
1249
+ function kn(e, r) {
1250
+ v(e, r, "size"), v(e, r, "include"), v(e, r, "exclude");
1280
1251
  }
1281
- function Ln(e, r) {
1282
- S(e, r, "size"), S(e, r, "include"), S(e, r, "exclude"), S(e, r, "label"), S(e, r, "disabled"), S(e, r, "actionType");
1252
+ function Pn(e, r) {
1253
+ v(e, r, "size"), v(e, r, "include"), v(e, r, "exclude"), v(e, r, "label"), v(e, r, "disabled"), v(e, r, "actionType");
1283
1254
  }
1284
- function Vn(e, r) {
1285
- S(e, r, "size"), S(e, r, "include"), S(e, r, "exclude"), S(e, r, "label"), S(e, r, "disabled"), S(e, r, "readonly"), S(e, r, "validator"), S(e, r, "path"), S(e, r, "defaultValue");
1255
+ function _n(e, r) {
1256
+ v(e, r, "size"), v(e, r, "include"), v(e, r, "exclude"), v(e, r, "label"), v(e, r, "disabled"), v(e, r, "readonly"), v(e, r, "validator"), v(e, r, "path"), v(e, r, "defaultValue");
1286
1257
  }
1287
- function Mn(e, r) {
1288
- S(e, r, "size"), S(e, r, "include"), S(e, r, "exclude");
1258
+ function Nn(e, r) {
1259
+ v(e, r, "size"), v(e, r, "include"), v(e, r, "exclude");
1289
1260
  }
1290
- function Un(e, r, t, n) {
1261
+ function jn(e, r, t, n) {
1291
1262
  const o = n.widgetPropOverrides[e.uid] ?? {}, i = { ...e.props ?? {}, ...o };
1292
1263
  for (const s of zr(Object.keys(i)))
1293
- Gn(r, t, s);
1264
+ Rn(r, t, s);
1294
1265
  }
1295
- function Hn(e, r, t) {
1266
+ function Ln(e, r, t) {
1296
1267
  const n = e.on ?? {};
1297
1268
  for (const o of zr(Object.keys(n)))
1298
- Kn(r, t, o);
1269
+ Un(r, t, o);
1299
1270
  }
1300
- function Bn(e, r, t) {
1301
- const n = bn(e.uid), o = xn(e.children, n, t.widgetFlags);
1271
+ function Vn(e, r, t) {
1272
+ const n = Yn(e.uid), o = qn(e.children, n, t.widgetFlags);
1302
1273
  r.current.children = o;
1303
1274
  const i = r.previous.children ?? [];
1304
1275
  i.length === o.length && o.every((u, c) => i[c] && i[c].uid === o[c].uid) || r.markChanged();
1305
1276
  }
1306
- function S(e, r, t) {
1277
+ function v(e, r, t) {
1307
1278
  const n = e.source;
1308
- if (!Zn(n, t))
1279
+ if (!Qn(n, t))
1309
1280
  return;
1310
1281
  const o = ir(n, t, r.sortedStates);
1311
1282
  let i;
1312
1283
  switch (t) {
1313
1284
  case "disabled":
1314
1285
  case "readonly":
1315
- i = zn(o, r, e.source.uid, t);
1286
+ i = Bn(o, r, e.source.uid, t);
1287
+ break;
1288
+ case "defaultValue":
1289
+ i = o;
1316
1290
  break;
1317
1291
  default:
1318
1292
  i = Xr(o, r);
1319
1293
  }
1320
1294
  e.write(t, i);
1321
1295
  }
1322
- function Gn(e, r, t) {
1296
+ function Rn(e, r, t) {
1323
1297
  const n = e.source.props, o = ir(n, t, r.sortedStates);
1324
1298
  let i = Xr(o, r);
1325
1299
  const s = r.widgetPropOverrides[e.source.uid]?.[t];
1326
1300
  s !== void 0 && (i = s), e.write(`props.${t}`, i);
1327
1301
  }
1328
- function Kn(e, r, t) {
1302
+ function Un(e, r, t) {
1329
1303
  const n = e.source.on, o = ir(n, t, r.sortedStates);
1330
- e.write(`on.${t}`, Jn(o, r));
1304
+ e.write(`on.${t}`, Gn(o, r));
1331
1305
  }
1332
1306
  function or(e, r) {
1333
1307
  return e({ $form: r.$form, translate: r.localization.translate });
1334
1308
  }
1335
- function Xn(e, r) {
1336
- return r.localization.translate(e.key, Qn(e.params, r), e.default);
1309
+ function Mn(e, r) {
1310
+ return r.localization.translate(e.key, Xn(e.params, r), e.default);
1337
1311
  }
1312
+ const Hn = /\{\{([^}]+)\}\}/g;
1338
1313
  function Kr(e, r) {
1339
- return Ft(e, {
1340
- resolveFormPath: (t) => N(r.$form, t) ?? e,
1341
- resolveMetaPath: (t) => N(r.$meta, t) ?? e,
1342
- resolveErrorsPath: (t) => N(r.$errors, t) ?? e,
1343
- resolveFormIsInvalid: () => String(r.$formIsInvalid)
1344
- });
1314
+ return e.includes("{{") ? e.replace(Hn, (t, n) => {
1315
+ const o = tr(n.trim());
1316
+ try {
1317
+ const i = d(g(o))({
1318
+ $form: r.$form,
1319
+ $meta: r.$meta,
1320
+ $errors: r.$errors,
1321
+ $formIsInvalid: r.$formIsInvalid
1322
+ });
1323
+ return i == null ? "" : String(i);
1324
+ } catch (i) {
1325
+ const s = i instanceof Error ? i.message : String(i);
1326
+ throw new Jr(`Failed to evaluate '{{${n.trim()}}}': ${s}`);
1327
+ }
1328
+ }) : e;
1345
1329
  }
1346
1330
  function Xr(e, r) {
1347
- return typeof e == "function" ? or(e, r) : $t(e) ? Xn(e, r) : typeof e == "string" ? Kr(e, r) : e;
1331
+ return typeof e == "function" ? or(e, r) : St(e) ? Mn(e, r) : typeof e == "string" ? Kr(e, r) : e;
1348
1332
  }
1349
- function zn(e, r, t, n) {
1350
- return typeof e == "function" ? or(e, r) : z(e) ? r.widgetFlags[t]?.[n] : typeof e == "string" ? Kr(e, r) : e;
1333
+ function Bn(e, r, t, n) {
1334
+ return typeof e == "function" ? or(e, r) : K(e) ? r.widgetFlags[t]?.[n] : typeof e == "string" ? Kr(e, r) : e;
1351
1335
  }
1352
- function Jn(e, r) {
1336
+ function Gn(e, r) {
1353
1337
  return typeof e == "function" ? or(e, r) : e;
1354
1338
  }
1355
1339
  function ir(e, r, t) {
@@ -1362,18 +1346,31 @@ function ir(e, r, t) {
1362
1346
  return e[r];
1363
1347
  }
1364
1348
  }
1365
- function Qn(e, r) {
1349
+ function Kn(e) {
1350
+ return e.startsWith("$form") || e.startsWith("$meta") || e.startsWith("$errors") || e === "$formIsInvalid";
1351
+ }
1352
+ function Xn(e, r) {
1366
1353
  return e && Object.keys(e).reduce((t, n) => {
1367
1354
  const o = String(e[n]);
1368
- return Ot(o) ? t[n] = Dt(o, {
1369
- resolveFormPath: (i) => N(r.$form, i) ?? o,
1370
- resolveMetaPath: (i) => N(r.$meta, i) ?? o,
1371
- resolveErrorsPath: (i) => N(r.$errors, i) ?? o,
1372
- resolveFormIsInvalid: () => r.$formIsInvalid
1373
- }) : t[n] = o, t;
1355
+ if (Kn(o))
1356
+ try {
1357
+ const i = d(g(tr(o)))({
1358
+ $form: r.$form,
1359
+ $meta: r.$meta,
1360
+ $errors: r.$errors,
1361
+ $formIsInvalid: r.$formIsInvalid
1362
+ });
1363
+ t[n] = i ?? o;
1364
+ } catch (i) {
1365
+ const s = i instanceof Error ? i.message : String(i);
1366
+ throw new Jr(`Failed to evaluate i18n param '${o}': ${s}`);
1367
+ }
1368
+ else
1369
+ t[n] = o;
1370
+ return t;
1374
1371
  }, {});
1375
1372
  }
1376
- class qn {
1373
+ class zn {
1377
1374
  constructor(r, t) {
1378
1375
  this._changed = !1, this.source = r, this.previous = t, this.current = {};
1379
1376
  }
@@ -1384,10 +1381,10 @@ class qn {
1384
1381
  this._changed = !0;
1385
1382
  }
1386
1383
  write(r, t) {
1387
- Ge(this.current, r, t), N(this.previous, r) !== t && (this._changed = !0);
1384
+ Be(this.current, r, t), de(this.previous, r) !== t && (this._changed = !0);
1388
1385
  }
1389
1386
  }
1390
- function Yn(e, r, t, n) {
1387
+ function Jn(e, r, t, n) {
1391
1388
  return {
1392
1389
  sortedStates: [...e.currentStates].sort((o, i) => i.length - o.length),
1393
1390
  widgetPropOverrides: e.widgetPropOverrides,
@@ -1399,7 +1396,7 @@ function Yn(e, r, t, n) {
1399
1396
  localization: r
1400
1397
  };
1401
1398
  }
1402
- function Zn(e, r) {
1399
+ function Qn(e, r) {
1403
1400
  if (r in e)
1404
1401
  return !0;
1405
1402
  const t = `${r}.`;
@@ -1408,16 +1405,22 @@ function Zn(e, r) {
1408
1405
  function zr(e) {
1409
1406
  return Array.from(new Set(e.map((r) => r.split(".")[0])));
1410
1407
  }
1411
- function xn(e, r, t) {
1408
+ function qn(e, r, t) {
1412
1409
  const n = r.map((o) => `[${o}]`).join("");
1413
1410
  return e.filter((o) => {
1414
1411
  const i = o.uid + n, s = t[i];
1415
1412
  return !s || s.hidden !== !0;
1416
1413
  });
1417
1414
  }
1418
- const bn = (e) => [...e.matchAll(/\[(\d+)\]/g)].map((r) => parseInt(r[1], 10)), eo = ({ lang: e }, r) => {
1415
+ const Yn = (e) => [...e.matchAll(/\[(\d+)\]/g)].map((r) => parseInt(r[1], 10));
1416
+ class Jr extends Error {
1417
+ constructor() {
1418
+ super(...arguments), this.code = ee.resolveStringInterpolationError, this.name = "StringInterpolationError";
1419
+ }
1420
+ }
1421
+ const Zn = ({ lang: e }, r) => {
1419
1422
  const t = {
1420
- ...$r(e),
1423
+ ...Ar(e),
1421
1424
  formName: r.payload.formName
1422
1425
  };
1423
1426
  let n = r.payload.formDef, o = { status: "ok" };
@@ -1425,7 +1428,7 @@ const bn = (e) => [...e.matchAll(/\[(\d+)\]/g)].map((r) => parseInt(r[1], 10)),
1425
1428
  try {
1426
1429
  n = JSON.parse(n);
1427
1430
  } catch (u) {
1428
- const c = u, h = he.initializeParseError;
1431
+ const c = u, h = ee.initializeParseError;
1429
1432
  o = {
1430
1433
  status: "errored",
1431
1434
  message: `[${h}] ${c.message}`,
@@ -1444,25 +1447,25 @@ const bn = (e) => [...e.matchAll(/\[(\d+)\]/g)].map((r) => parseInt(r[1], 10)),
1444
1447
  children: c
1445
1448
  };
1446
1449
  }
1447
- const i = Ar.decode(n);
1450
+ const i = $r.decode(n);
1448
1451
  if (i.isOk()) {
1449
1452
  o = { status: "ok" };
1450
1453
  let u = {};
1451
1454
  try {
1452
- u = Ke([i.value.form]).reduce(
1455
+ u = Ge([i.value.form]).reduce(
1453
1456
  (c, h) => {
1454
- const $ = h.uid;
1455
- if (c[$])
1456
- throw { existingWidget: c[$], newWidget: h };
1457
- return c[$] = h, c;
1457
+ const A = h.uid;
1458
+ if (c[A])
1459
+ throw { existingWidget: c[A], newWidget: h };
1460
+ return c[A] = h, c;
1458
1461
  },
1459
1462
  {}
1460
1463
  );
1461
1464
  } catch (c) {
1462
- const h = he.initializeUidCollisionError;
1465
+ const h = ee.initializeUidCollisionError;
1463
1466
  o = {
1464
1467
  status: "errored",
1465
- message: `[${h}] ${ro(c.existingWidget, c.newWidget)}`,
1468
+ message: `[${h}] ${xn(c.existingWidget, c.newWidget)}`,
1466
1469
  code: h
1467
1470
  }, u = {};
1468
1471
  }
@@ -1473,7 +1476,7 @@ const bn = (e) => [...e.matchAll(/\[(\d+)\]/g)].map((r) => parseInt(r[1], 10)),
1473
1476
  formHealth: o
1474
1477
  };
1475
1478
  }
1476
- const s = he.initializeUnknownError;
1479
+ const s = ee.initializeUnknownError;
1477
1480
  return {
1478
1481
  ...t,
1479
1482
  formHealth: {
@@ -1483,11 +1486,11 @@ const bn = (e) => [...e.matchAll(/\[(\d+)\]/g)].map((r) => parseInt(r[1], 10)),
1483
1486
  }
1484
1487
  };
1485
1488
  };
1486
- function ro(e, r) {
1489
+ function xn(e, r) {
1487
1490
  const t = (n) => D(n) ? ` at "${n.path}"` : "";
1488
1491
  return `Duplicate UID "${r.uid}": Assigned to widget "${e.type}"${t(e)} and "${r.type}"${t(r)}.`;
1489
1492
  }
1490
- function to(e, r) {
1493
+ function bn(e, r) {
1491
1494
  return {
1492
1495
  ...e,
1493
1496
  injectedValidations: {
@@ -1496,7 +1499,7 @@ function to(e, r) {
1496
1499
  }
1497
1500
  };
1498
1501
  }
1499
- const no = (e, { payload: r }) => {
1502
+ const eo = (e, { payload: r }) => {
1500
1503
  let t;
1501
1504
  if ("path" in r) {
1502
1505
  if (t = Object.values(e.calculatedWidgets).find(
@@ -1514,7 +1517,7 @@ const no = (e, { payload: r }) => {
1514
1517
  }
1515
1518
  };
1516
1519
  };
1517
- function oo(e, r) {
1520
+ function ro(e, r) {
1518
1521
  return {
1519
1522
  ...e,
1520
1523
  widgetFlags: {
@@ -1528,7 +1531,7 @@ function oo(e, r) {
1528
1531
  ...le(e.widgetPropOverrides, r.payload.uid)
1529
1532
  },
1530
1533
  touchedControls: {
1531
- ...j(e.touchedControls, (t) => {
1534
+ ...N(e.touchedControls, (t) => {
1532
1535
  const n = e.flatForm[r.payload.uid];
1533
1536
  return n && D(n) ? le(t, n.path) : t;
1534
1537
  })
@@ -1536,25 +1539,25 @@ function oo(e, r) {
1536
1539
  // TODO: clear widget from injectedValidations
1537
1540
  };
1538
1541
  }
1539
- const io = (e, r) => ({
1542
+ const to = (e, r) => ({
1540
1543
  ...e,
1541
1544
  data: { ...r.payload.data }
1542
- }), so = (e, r) => ({
1545
+ }), no = (e, r) => ({
1543
1546
  ...e,
1544
1547
  formHealth: r.payload.formHealth
1545
- }), uo = (e, r) => ({
1548
+ }), oo = (e, r) => ({
1546
1549
  ...e,
1547
1550
  lang: r.payload.lang
1548
- }), co = (e, r) => ({
1551
+ }), io = (e, r) => ({
1549
1552
  ...e,
1550
1553
  meta: { ...r.payload.meta }
1551
- }), lo = (e, r) => {
1552
- const t = N(e.data, r.payload.path);
1554
+ }), so = (e, r) => {
1555
+ const t = de(e.data, r.payload.path);
1553
1556
  return r.type === "SET_WIDGET_DATA" || r.type === "SET_WIDGET_INITIAL_DATA" && t === void 0 ? {
1554
1557
  ...e,
1555
- data: { ...Ge(e.data, r.payload.path, r.payload.data) }
1558
+ data: { ...Be(e.data, r.payload.path, r.payload.data) }
1556
1559
  } : e;
1557
- }, Te = (e, r) => (t) => {
1560
+ }, We = (e, r) => (t) => {
1558
1561
  const n = Hr(
1559
1562
  Object.values(t.calculatedWidgets),
1560
1563
  ({ current: i }) => D(i) ? i : nr
@@ -1564,13 +1567,13 @@ const io = (e, r) => ({
1564
1567
  validations: n.reduce(
1565
1568
  (i, s) => {
1566
1569
  if (i[s.path] = null, s.validator) {
1567
- const u = e(s.validator, r), c = N(t.data, s.path), h = xr(
1570
+ const u = e(s.validator, r), c = de(t.data, s.path), h = br(
1568
1571
  u,
1569
1572
  c
1570
1573
  );
1571
- i[s.path] = br(h) ? null : h.issues.map(($) => $.message);
1574
+ i[s.path] = et(h) ? null : h.issues.map((A) => A.message);
1572
1575
  }
1573
- return Array.isArray(i[s.path]) && Array.isArray(o[s.path]) && Dn(
1576
+ return Array.isArray(i[s.path]) && Array.isArray(o[s.path]) && wn(
1574
1577
  i[s.path],
1575
1578
  o[s.path],
1576
1579
  (u, c) => u === c
@@ -1579,58 +1582,58 @@ const io = (e, r) => ({
1579
1582
  {}
1580
1583
  )
1581
1584
  };
1582
- }, ao = ({
1585
+ }, uo = ({
1583
1586
  validators: e,
1584
1587
  validateOn: r,
1585
1588
  localization: t
1586
1589
  }) => (n, o) => {
1587
1590
  switch (o.type) {
1588
1591
  case "INITIALIZE":
1589
- return eo(n, o);
1592
+ return Zn(n, o);
1590
1593
  case "SET_DATA":
1591
- return j(
1592
- io(n, o),
1593
- M,
1594
- U,
1595
- L(t)
1594
+ return N(
1595
+ to(n, o),
1596
+ V,
1597
+ R,
1598
+ j(t)
1596
1599
  );
1597
1600
  case "SET_META":
1598
- return j(
1599
- co(n, o),
1600
- M,
1601
- U,
1602
- L(t)
1601
+ return N(
1602
+ io(n, o),
1603
+ V,
1604
+ R,
1605
+ j(t)
1603
1606
  );
1604
1607
  case "SET_LANGUAGE":
1605
- return j(uo(n, o), L(t));
1608
+ return N(oo(n, o), j(t));
1606
1609
  case "ADD_WIDGET":
1607
- return j(
1608
- vt(n, o),
1609
- fe(We, M),
1610
- fe(We, U),
1611
- fe(We, L(t))
1610
+ return N(
1611
+ wt(n, o),
1612
+ fe(Fe, V),
1613
+ fe(Fe, R),
1614
+ fe(Fe, j(t))
1612
1615
  );
1613
1616
  case "REMOVE_WIDGET":
1614
- return j(
1615
- oo(n, o),
1616
- M,
1617
- U,
1618
- L(t)
1617
+ return N(
1618
+ ro(n, o),
1619
+ V,
1620
+ R,
1621
+ j(t)
1619
1622
  );
1620
1623
  case "SET_WIDGET_INITIAL_DATA":
1621
1624
  case "SET_WIDGET_DATA":
1622
- return j(
1623
- lo(n, o),
1624
- M,
1625
- U,
1626
- L(t)
1625
+ return N(
1626
+ so(n, o),
1627
+ V,
1628
+ R,
1629
+ j(t)
1627
1630
  );
1628
1631
  case "OVERRIDE_WIDGET_PROP":
1629
- return j(
1630
- no(n, o),
1631
- M,
1632
- U,
1633
- L(t),
1632
+ return N(
1633
+ eo(n, o),
1634
+ V,
1635
+ R,
1636
+ j(t),
1634
1637
  // Apply validation here because this action can be dispatched from the form's event handlers callback
1635
1638
  // Apply only when the action is related to an input
1636
1639
  fe(
@@ -1640,13 +1643,13 @@ const io = (e, r) => ({
1640
1643
  const c = s && i.touchedControls[u];
1641
1644
  return i.touched && c;
1642
1645
  },
1643
- Te(e, t)
1646
+ We(e, t)
1644
1647
  )
1645
1648
  );
1646
1649
  case "SET_FORM_HEALTH":
1647
- return so(n, o);
1650
+ return no(n, o);
1648
1651
  case "VALIDATE_ALL":
1649
- return j(
1652
+ return N(
1650
1653
  {
1651
1654
  ...n,
1652
1655
  touched: !0,
@@ -1658,31 +1661,31 @@ const io = (e, r) => ({
1658
1661
  {}
1659
1662
  )
1660
1663
  },
1661
- Te(e, t),
1664
+ We(e, t),
1662
1665
  // This handles $errors and $formIsValid expressions variables
1663
- M,
1664
- U,
1665
- L(t),
1666
+ V,
1667
+ R,
1668
+ j(t),
1666
1669
  pr
1667
1670
  );
1668
1671
  case "ATTEMPT_VALIDATION": {
1669
1672
  const i = o.payload.reason, s = o.payload.path;
1670
- return r === "eager" || i === r || r.includes(i) ? j(
1673
+ return r === "eager" || i === r || r.includes(i) ? N(
1671
1674
  {
1672
1675
  ...n,
1673
1676
  touched: !0,
1674
1677
  touchedControls: { ...n.touchedControls, [s]: !0 }
1675
1678
  },
1676
- Te(e, t),
1679
+ We(e, t),
1677
1680
  // This handles $errors and $formIsValid expressions variables
1678
- M,
1679
- U,
1680
- L(t),
1681
+ V,
1682
+ R,
1683
+ j(t),
1681
1684
  // TODO: extract this into a separate function
1682
1685
  // When the widget is a Widget Function, we propagate the validation result immediately
1683
1686
  (c) => {
1684
- const h = o.payload.uid, $ = c.calculatedWidgets[h], m = $.source;
1685
- if (de(m)) {
1687
+ const h = o.payload.uid, A = c.calculatedWidgets[h], m = A.source;
1688
+ if (se(m)) {
1686
1689
  const a = m({
1687
1690
  $form: c.data,
1688
1691
  errors: c.validations[s],
@@ -1694,7 +1697,7 @@ const io = (e, r) => ({
1694
1697
  calculatedWidgets: {
1695
1698
  ...c.calculatedWidgets,
1696
1699
  [h]: {
1697
- source: $.source,
1700
+ source: A.source,
1698
1701
  current: a
1699
1702
  }
1700
1703
  }
@@ -1706,11 +1709,11 @@ const io = (e, r) => ({
1706
1709
  ) : n;
1707
1710
  }
1708
1711
  case "INJECT_VALIDATION_ISSUES":
1709
- return to(n, o);
1712
+ return bn(n, o);
1710
1713
  default:
1711
- return St(o);
1714
+ return Et(o);
1712
1715
  }
1713
- }, We = (e) => e.formHealth.status === "ok";
1716
+ }, Fe = (e) => e.formHealth.status === "ok";
1714
1717
  function pr(e) {
1715
1718
  const r = Object.keys(e.injectedValidations), t = Object.keys(e.validations);
1716
1719
  if (r.length === 0 && t.length === 0)
@@ -1722,11 +1725,11 @@ function pr(e) {
1722
1725
  (o) => e.validations[o] !== null && Array.isArray(e.validations[o])
1723
1726
  ), n !== void 0 ? { ...e, isFormValid: !1 } : { ...e, isFormValid: !0 });
1724
1727
  }
1725
- function fo(e = [], r, t, n) {
1726
- const o = new qr($r(n.lang)), i = o.asObservable().pipe(T()), s = ao({ validators: r, validateOn: t, localization: n });
1728
+ function co(e = [], r, t, n) {
1729
+ const o = new Yr(Ar(n.lang)), i = o.asObservable().pipe(W()), s = uo({ validators: r, validateOn: t, localization: n });
1727
1730
  function u(m) {
1728
- const a = o.getValue(), w = s(a, m);
1729
- o.next(w);
1731
+ const a = o.getValue(), C = s(a, m);
1732
+ o.next(C);
1730
1733
  }
1731
1734
  let c = u;
1732
1735
  const h = {
@@ -1740,12 +1743,12 @@ function fo(e = [], r, t, n) {
1740
1743
  getState: () => o.getValue()
1741
1744
  };
1742
1745
  }
1743
- class wo {
1746
+ class Eo {
1744
1747
  constructor() {
1745
1748
  this.widgetRegistry = new Ne(), this.store = {}, this.events$ = new sr(), this.submit$ = new sr(), this.uuid = crypto.randomUUID(), this.itemRenderers = {}, this.dependencies = {};
1746
1749
  }
1747
- initialize(r, t = [], n, o, i, s = Et(), u) {
1748
- this.localization = s, this.dependencies = u, this.widgetRegistry.setWidgetLoaders(r), this.itemRenderers = i, this.store = fo(t, n, o, s);
1750
+ initialize(r, t = [], n, o, i, s = vt(), u) {
1751
+ this.localization = s, this.dependencies = u, this.widgetRegistry.setWidgetLoaders(r), this.itemRenderers = i, this.store = co(t, n, o, s);
1749
1752
  }
1750
1753
  emitEvent(r, t, n) {
1751
1754
  const i = this.store.getState().currentStates.filter((s) => t.on?.[`${r}.${s}`] !== void 0);
@@ -1796,7 +1799,7 @@ class wo {
1796
1799
  }));
1797
1800
  }
1798
1801
  }
1799
- function Co(e = "GolemUI Form Store") {
1802
+ function wo(e = "GolemUI Form Store") {
1800
1803
  return (r) => {
1801
1804
  const n = (typeof window < "u" ? window.__REDUX_DEVTOOLS_EXTENSION__ : void 0)?.connect({ name: e });
1802
1805
  return n?.init(r.getState()), (o) => (i) => {
@@ -1804,73 +1807,73 @@ function Co(e = "GolemUI Form Store") {
1804
1807
  };
1805
1808
  };
1806
1809
  }
1807
- const ho = R(
1808
- F((e) => e.data),
1809
- T()
1810
- ), Fo = (e) => R(
1811
- ho,
1812
- F((r) => N(r, e)),
1813
- T()
1814
- ), po = R(
1810
+ const lo = k(
1811
+ O((e) => e.data),
1812
+ W()
1813
+ ), Io = (e) => k(
1814
+ lo,
1815
+ O((r) => de(r, e)),
1816
+ W()
1817
+ ), ao = k(
1815
1818
  Se((e) => e.touched === !0),
1816
- F((e) => e.validations),
1817
- T()
1818
- ), Do = (e) => R(
1819
- po,
1820
- F((r) => r[e]),
1821
- T()
1822
- ), mo = R(
1819
+ O((e) => e.validations),
1820
+ W()
1821
+ ), Co = (e) => k(
1822
+ ao,
1823
+ O((r) => r[e]),
1824
+ W()
1825
+ ), fo = k(
1823
1826
  Se((e) => e.touched === !0),
1824
- F((e) => e.injectedValidations),
1825
- T()
1826
- ), Po = (e) => R(
1827
- mo,
1828
- F((r) => r[e]),
1829
- T(),
1827
+ O((e) => e.injectedValidations),
1828
+ W()
1829
+ ), Oo = (e) => k(
1830
+ fo,
1831
+ O((r) => r[e]),
1832
+ W(),
1830
1833
  // we want to make sure combineLatest([validation$, injectedValidation$]) triggers
1831
- Zr(null)
1832
- ), go = R(
1833
- F((e) => e.lang),
1834
- T()
1835
- ), Jr = R(
1836
- F((e) => e.calculatedWidgets),
1837
- T()
1838
- ), To = (e) => (r) => Yr([r.pipe(go), r.pipe(Jr)]).pipe(
1839
- F(([t, n]) => ({ lang: t, widget: n[e] })),
1834
+ xr(null)
1835
+ ), ho = k(
1836
+ O((e) => e.lang),
1837
+ W()
1838
+ ), Qr = k(
1839
+ O((e) => e.calculatedWidgets),
1840
+ W()
1841
+ ), Do = (e) => (r) => Zr([r.pipe(ho), r.pipe(Qr)]).pipe(
1842
+ O(([t, n]) => ({ lang: t, widget: n[e] })),
1840
1843
  Se((t) => t.widget !== void 0),
1841
- T((t, n) => t.lang === n.lang && t.widget === n.widget),
1842
- F((t) => t.widget.current)
1843
- ), Wo = (e) => R(
1844
- Jr,
1845
- F((r) => r[e]),
1844
+ W((t, n) => t.lang === n.lang && t.widget === n.widget),
1845
+ O((t) => t.widget.current)
1846
+ ), To = (e) => k(
1847
+ Qr,
1848
+ O((r) => r[e]),
1846
1849
  Se((r) => r !== void 0),
1847
- F((r) => r.current.children),
1848
- T()
1850
+ O((r) => r.current.children),
1851
+ W()
1849
1852
  );
1850
- R(
1851
- F((e) => e.widgetFlags),
1852
- T()
1853
+ k(
1854
+ O((e) => e.widgetFlags),
1855
+ W()
1853
1856
  );
1854
- const yo = R(
1855
- F((e) => e.touchedControls),
1856
- T()
1857
- ), Ro = (e) => R(
1858
- yo,
1859
- F((r) => r[e]),
1860
- T()
1861
- ), Ao = R(
1862
- F((e) => e.formHealth),
1863
- T((e, r) => e.status !== r.status ? !1 : e.status === "errored" && r.status === "errored" ? e.message === r.message && e.code === r.code : !0)
1864
- ), ko = (e) => e.pipe(Ao);
1865
- let Qr = !1;
1866
- function _o() {
1867
- Qr = !0;
1868
- }
1869
- function $o() {
1870
- return Qr;
1871
- }
1872
- function No(e, r, t) {
1873
- if (!$o())
1857
+ const po = k(
1858
+ O((e) => e.touchedControls),
1859
+ W()
1860
+ ), Wo = (e) => k(
1861
+ po,
1862
+ O((r) => r[e]),
1863
+ W()
1864
+ ), mo = k(
1865
+ O((e) => e.formHealth),
1866
+ W((e, r) => e.status !== r.status ? !1 : e.status === "errored" && r.status === "errored" ? e.message === r.message && e.code === r.code : !0)
1867
+ ), Fo = (e) => e.pipe(mo);
1868
+ let qr = !1;
1869
+ function ko() {
1870
+ qr = !0;
1871
+ }
1872
+ function go() {
1873
+ return qr;
1874
+ }
1875
+ function Po(e, r, t) {
1876
+ if (!go())
1874
1877
  return;
1875
1878
  const n = Object.keys(r ?? {}).filter((o) => o in t);
1876
1879
  if (n.length > 0)
@@ -1879,25 +1882,25 @@ function No(e, r, t) {
1879
1882
  );
1880
1883
  }
1881
1884
  export {
1882
- wo as FormContext,
1883
- No as assertNoPropCollisions,
1884
- Wo as calculatedLayoutChildrenByUid$,
1885
- To as calculatedWidgetsByUid$,
1885
+ Eo as FormContext,
1886
+ Po as assertNoPropCollisions,
1887
+ To as calculatedLayoutChildrenByUid$,
1888
+ Do as calculatedWidgetsByUid$,
1886
1889
  dr as cloneObject,
1887
- Fo as dataByPath$,
1888
- vo as defineForm,
1889
- Co as devToolsMiddleware,
1890
- _o as enableDevMode,
1891
- he as errorCodes,
1892
- Oo as filterTap,
1893
- ko as formHealth,
1894
- Io as getDirectionFromLanguage,
1895
- Et as identityTranslator,
1896
- Po as injectedValidationByPath$,
1897
- br as isStandardValidateSuccess,
1898
- Pn as makeRepeaterItemConfig,
1890
+ Io as dataByPath$,
1891
+ Ao as defineForm,
1892
+ wo as devToolsMiddleware,
1893
+ ko as enableDevMode,
1894
+ ee as errorCodes,
1895
+ vo as filterTap,
1896
+ Fo as formHealth,
1897
+ So as getDirectionFromLanguage,
1898
+ vt as identityTranslator,
1899
+ Oo as injectedValidationByPath$,
1900
+ et as isStandardValidateSuccess,
1901
+ In as makeRepeaterItemConfig,
1899
1902
  gr as shortUUID,
1900
- xr as standardValidate,
1901
- Ro as touchedControlsByPath$,
1902
- Do as validationByPath$
1903
+ br as standardValidate,
1904
+ Wo as touchedControlsByPath$,
1905
+ Co as validationByPath$
1903
1906
  };