@golemui/core 1.4.0 → 1.5.0-rc.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,4 +1,4 @@
1
- import { BehaviorSubject as hr, distinctUntilChanged as _e, Subject as it, pipe as mr, map as Ct } from "rxjs";
1
+ import { BehaviorSubject as hr, distinctUntilChanged as Le, Subject as it, pipe as mr, map as Ct } from "rxjs";
2
2
  import "@standard-schema/spec";
3
3
  function gr(e, t) {
4
4
  const r = e["~standard"].validate(t);
@@ -44,7 +44,7 @@ function kt(e) {
44
44
  function ut(e) {
45
45
  return e.map((t) => t.path.length === 0 ? t.message : `${kt(t.path)}: ${t.message}`).join("; ");
46
46
  }
47
- var C = class je {
47
+ var C = class Pe {
48
48
  decodeFn;
49
49
  constructor(t) {
50
50
  this.decodeFn = t;
@@ -82,13 +82,13 @@ var C = class je {
82
82
  });
83
83
  }
84
84
  map(t) {
85
- return new je((r) => {
85
+ return new Pe((r) => {
86
86
  let n = this.decodeFn(r);
87
87
  return n.isOk() ? k(t(n.value)) : E(n.issues);
88
88
  });
89
89
  }
90
90
  flatMap(t) {
91
- return new je((r) => {
91
+ return new Pe((r) => {
92
92
  let n = this.decodeFn(r);
93
93
  return n.isOk() ? t(n.value).decode(r) : E(n.issues);
94
94
  });
@@ -96,17 +96,17 @@ var C = class je {
96
96
  }, b = (e, t) => [{
97
97
  message: `${JSON.stringify(e)} is not a valid ${t}`,
98
98
  path: []
99
- }], Le = (e, t) => e.map((r) => ({
99
+ }], Me = (e, t) => e.map((r) => ({
100
100
  ...r,
101
101
  path: [t, ...r.path]
102
102
  }));
103
- function Me(e) {
103
+ function _e(e) {
104
104
  return new C((t) => {
105
105
  if (t instanceof Array) {
106
106
  let r = [], n = [];
107
107
  for (let o = 0; o < t.length; o++) {
108
108
  let s = e.decode(t[o]);
109
- s.isOk() ? r.push(s.value) : n.push(...Le(s.issues, o));
109
+ s.isOk() ? r.push(s.value) : n.push(...Me(s.issues, o));
110
110
  }
111
111
  return n.length > 0 ? E(n) : k(r);
112
112
  } else return E(b(t, "array"));
@@ -134,7 +134,7 @@ function G(e) {
134
134
  path: []
135
135
  }]));
136
136
  }
137
- function ge() {
137
+ function ye() {
138
138
  return new C((e) => typeof e == "number" ? k(e) : E(b(e, "number")));
139
139
  }
140
140
  function Y(e) {
@@ -143,7 +143,7 @@ function Y(e) {
143
143
  let r = {}, n = [];
144
144
  for (let o in e) if (Object.prototype.hasOwnProperty.call(e, o)) {
145
145
  let s, i = e[o];
146
- s = i instanceof C ? i.decode(t[o]) : i.decoder.decode(t[i.fromKey]), s.isOk() ? r[o] = s.value : n.push(...Le(s.issues, o));
146
+ s = i instanceof C ? i.decode(t[o]) : i.decoder.decode(t[i.fromKey]), s.isOk() ? r[o] = s.value : n.push(...Me(s.issues, o));
147
147
  }
148
148
  return n.length > 0 ? E(n) : k(r);
149
149
  } else return E(b(t, "object"));
@@ -186,7 +186,7 @@ function wr(e) {
186
186
  let r = {}, n = [];
187
187
  for (let o in t) if (Object.prototype.hasOwnProperty.call(t, o)) {
188
188
  let s = e.decode(t[o]);
189
- s.isOk() ? r[o] = s.value : n.push(...Le(s.issues, o));
189
+ s.isOk() ? r[o] = s.value : n.push(...Me(s.issues, o));
190
190
  }
191
191
  return n.length > 0 ? E(n) : k(r);
192
192
  } else return E(b(t, "object"));
@@ -230,42 +230,42 @@ function ee(e) {
230
230
  return k(r);
231
231
  });
232
232
  }
233
- const Or = () => crypto.randomUUID().slice(0, 8), Cr = (e) => typeof e != "function" && e.kind === "display", ue = (e) => typeof e != "function" && e.kind === "action", j = (e) => typeof e != "function" && e.kind === "input", H = (e) => typeof e != "function" && e.kind === "layout", W = (e) => typeof e == "function", Ir = Y({ in: Me(w()) }), Ue = Y({ when: w() }), ye = K([Ir, Ue]), kr = Y({ from: Me(w()) }), ve = K([kr, Ue]), Pe = K([Sr(), Ue]), jr = new C((e) => {
233
+ const Or = (e) => typeof e != "function" && e.kind === "display", ue = (e) => typeof e != "function" && e.kind === "action", j = (e) => typeof e != "function" && e.kind === "input", H = (e) => typeof e != "function" && e.kind === "layout", T = (e) => typeof e == "function", Cr = Y({ in: _e(w()) }), Ue = Y({ when: w() }), ve = K([Cr, Ue]), Ir = Y({ from: _e(w()) }), $e = K([Ir, Ue]), Fe = K([Sr(), Ue]), kr = new C((e) => {
234
234
  const t = typeof e;
235
235
  return t === "function" ? k(e) : E([{ message: `Expected a function, got '${t}'`, path: [] }]);
236
- }), N = (e) => K([e, jr]), He = ee({
236
+ }), N = (e) => K([e, kr]), He = ee({
237
237
  load: { suffixed: !0, decoder: N(y(w())) },
238
238
  click: { suffixed: !0, decoder: N(y(w())) },
239
239
  change: { suffixed: !0, decoder: N(y(w())) },
240
240
  filter: { suffixed: !0, decoder: N(y(w())) },
241
241
  blur: { suffixed: !0, decoder: N(y(w())) }
242
- }), Pr = Y({
242
+ }), jr = Y({
243
243
  key: w(),
244
244
  default: y(w()),
245
245
  params: y(U())
246
- }), Pt = K([w(), Pr]), be = y(w()), Fr = ee({
246
+ }), Pt = K([w(), jr]), be = y(w()), Pr = ee({
247
247
  kind: { decoder: G("display") },
248
248
  uid: { decoder: be },
249
249
  type: { decoder: w() },
250
- size: { suffixed: !0, decoder: y(ge()) },
251
- include: { decoder: y(ye) },
252
- exclude: { decoder: y(ve) },
250
+ size: { suffixed: !0, decoder: y(ye()) },
251
+ include: { decoder: y(ve) },
252
+ exclude: { decoder: y($e) },
253
253
  props: { decoder: y(U()) }
254
- }), Dr = ee({
254
+ }), Fr = ee({
255
255
  kind: { decoder: G("action") },
256
256
  uid: { decoder: be },
257
257
  type: { decoder: w() },
258
258
  actionType: {
259
259
  decoder: y(K([G("button"), G("submit")]))
260
260
  },
261
- size: { suffixed: !0, decoder: y(ge()) },
262
- include: { decoder: y(ye) },
263
- exclude: { decoder: y(ve) },
261
+ size: { suffixed: !0, decoder: y(ye()) },
262
+ include: { decoder: y(ve) },
263
+ exclude: { decoder: y($e) },
264
264
  label: {
265
265
  suffixed: !0,
266
266
  decoder: N(y(Pt))
267
267
  },
268
- disabled: { suffixed: !0, decoder: y(Pe) },
268
+ disabled: { suffixed: !0, decoder: y(Fe) },
269
269
  on: { decoder: y(He) },
270
270
  props: { decoder: y(U()) }
271
271
  }), Wr = new C((e) => {
@@ -277,18 +277,18 @@ const Or = () => crypto.randomUUID().slice(0, 8), Cr = (e) => typeof e != "funct
277
277
  touched: void 0,
278
278
  translate: void 0
279
279
  });
280
- return r.uid = r.uid || n.uid || Or(), r.type = n.type, r.path = n.path, k(r);
280
+ return r.uid = r.uid || n.uid, r.type = n.type, r.path = n.path, k(r);
281
281
  } else
282
282
  return E([{ message: `Expected a function, got '${t}'`, path: [] }]);
283
- }), Nr = ee({
283
+ }), Dr = ee({
284
284
  kind: { decoder: G("input") },
285
285
  uid: { decoder: y(w()) },
286
286
  type: { decoder: w() },
287
- size: { suffixed: !0, decoder: y(ge()) },
288
- include: { decoder: y(ye) },
289
- exclude: { decoder: y(ve) },
290
- disabled: { suffixed: !0, decoder: y(Pe) },
291
- readonly: { suffixed: !0, decoder: y(Pe) },
287
+ size: { suffixed: !0, decoder: y(ye()) },
288
+ include: { decoder: y(ve) },
289
+ exclude: { decoder: y($e) },
290
+ disabled: { suffixed: !0, decoder: y(Fe) },
291
+ readonly: { suffixed: !0, decoder: y(Fe) },
292
292
  on: { decoder: y(He) },
293
293
  props: { decoder: y(U()) },
294
294
  label: {
@@ -310,10 +310,10 @@ const Or = () => crypto.randomUUID().slice(0, 8), Cr = (e) => typeof e != "funct
310
310
  return t;
311
311
  }), Tr = jt(() => {
312
312
  const e = Ar("kind", {
313
- input: Nr,
313
+ input: Dr,
314
314
  layout: ze,
315
- display: Fr,
316
- action: Dr
315
+ display: Pr,
316
+ action: Fr
317
317
  });
318
318
  return new C(
319
319
  (t) => typeof t == "function" ? Wr.decode(t) : e.decode(t)
@@ -322,13 +322,13 @@ const Or = () => crypto.randomUUID().slice(0, 8), Cr = (e) => typeof e != "funct
322
322
  kind: { decoder: G("layout") },
323
323
  uid: { decoder: be },
324
324
  type: { decoder: w() },
325
- size: { suffixed: !0, decoder: y(ge()) },
326
- include: { decoder: y(ye) },
327
- exclude: { decoder: y(ve) },
325
+ size: { suffixed: !0, decoder: y(ye()) },
326
+ include: { decoder: y(ve) },
327
+ exclude: { decoder: y($e) },
328
328
  props: { decoder: y(U()) },
329
329
  on: { decoder: y(He) },
330
- children: { decoder: Me(Tr) }
331
- }), M = class M {
330
+ children: { decoder: _e(Tr) }
331
+ }), D = class D {
332
332
  constructor() {
333
333
  this.widgetLoaders = {}, this._ready = !1;
334
334
  }
@@ -343,24 +343,55 @@ const Or = () => crypto.randomUUID().slice(0, 8), Cr = (e) => typeof e != "funct
343
343
  }
344
344
  async loadWidget(t) {
345
345
  const r = this.widgetLoaders[t];
346
- if (!M.sharedCache.has(r)) {
347
- const n = r().catch((o) => (M.sharedCache.delete(r), Promise.reject(o)));
348
- M.sharedCache.set(r, n);
346
+ if (!D.sharedCache.has(r)) {
347
+ const n = r().catch((o) => (D.sharedCache.delete(r), Promise.reject(o)));
348
+ D.sharedCache.set(r, n);
349
349
  }
350
- return M.sharedCache.get(r);
350
+ return D.sharedCache.get(r);
351
+ }
352
+ /**
353
+ * Loads the given widget types (default: every configured type) and stores each
354
+ * resolved component for synchronous access through `getIfLoaded`.
355
+ * A failed loader rejects the returned promise, stores nothing, and stays retryable.
356
+ */
357
+ async preloadWidgets(t) {
358
+ const r = t ?? Object.keys(this.widgetLoaders);
359
+ await Promise.all(
360
+ r.map(async (n) => {
361
+ const o = await this.loadWidget(n);
362
+ D.resolvedCache.set(this.widgetLoaders[n], o);
363
+ })
364
+ );
365
+ }
366
+ /**
367
+ * Returns the resolved component for the given widget type, or `undefined` when it
368
+ * was never preloaded. Never starts a load.
369
+ */
370
+ getIfLoaded(t) {
371
+ const r = this.widgetLoaders[t];
372
+ if (r)
373
+ return D.resolvedCache.get(r);
351
374
  }
352
375
  };
353
- M.sharedCache = /* @__PURE__ */ new Map();
354
- let Fe = M;
355
- function Vr(e) {
356
- De(e, "#0");
357
- }
358
- function De(e, t) {
359
- if (!W(e) && (e.uid || (e.uid = t), H(e) && e.children.forEach((r, n) => {
360
- De(r, `${t}.${n}`);
361
- }), j(e) && e.type === "repeater")) {
376
+ D.sharedCache = /* @__PURE__ */ new Map(), D.resolvedCache = /* @__PURE__ */ new Map();
377
+ let ce = D;
378
+ async function is(e) {
379
+ const t = new ce();
380
+ t.setWidgetLoaders(e.widgetLoaders), await t.preloadWidgets();
381
+ }
382
+ function Nr(e) {
383
+ We(e, "#0");
384
+ }
385
+ function We(e, t) {
386
+ if (T(e)) {
387
+ e.uid || (e.uid = `${t}.f`);
388
+ return;
389
+ }
390
+ if (e.uid || (e.uid = t), H(e) && e.children.forEach((r, n) => {
391
+ We(r, `${t}.${n}`);
392
+ }), j(e) && e.type === "repeater") {
362
393
  const r = e.props?.template;
363
- r && De(r, `${t}.t`);
394
+ r && We(r, `${t}.t`);
364
395
  }
365
396
  }
366
397
  function us(e) {
@@ -377,7 +408,7 @@ function us(e) {
377
408
  const Ft = Y({
378
409
  states: y(wr(w())),
379
410
  form: jt(() => ze)
380
- }).map((e) => (Vr(e.form), e)), Dt = (e) => ({
411
+ }).map((e) => (Nr(e.form), e)), Wt = (e) => ({
381
412
  formName: "",
382
413
  formDef: Ft.parse({
383
414
  form: {
@@ -407,12 +438,12 @@ const Ft = Y({
407
438
  submit: "formSubmit",
408
439
  health: "formHealth",
409
440
  event: "formEvent"
410
- }, Rr = (e) => !(typeof e != "object" || e === null || typeof e.key != "string");
441
+ }, Vr = (e) => !(typeof e != "object" || e === null || typeof e.key != "string");
411
442
  function ds(e) {
412
443
  const t = new Intl.Locale(e).maximize().script;
413
444
  return ["Arab", "Hebr", "Thaa", "Syrc", "Tfng", "Adlm", "Rohg"].includes(t || "") ? "rtl" : "ltr";
414
445
  }
415
- const _r = (e = navigator.language || "en-US") => {
446
+ const Rr = (e = typeof navigator < "u" && navigator.language || "en-US") => {
416
447
  const t = /* @__PURE__ */ new Set();
417
448
  return {
418
449
  get lang() {
@@ -442,7 +473,7 @@ const _r = (e = navigator.language || "en-US") => {
442
473
  resolveStringInterpolationError: 40
443
474
  }, Lr = (e) => {
444
475
  throw new Error(`Unhandled case: ${JSON.stringify(e)}`);
445
- }, _ = (e, t) => {
476
+ }, M = (e, t) => {
446
477
  if (e === void 0)
447
478
  throw new Error("obj is undefined");
448
479
  return t.split(".").reduce((r, n) => r === void 0 || n === "" ? r : Array.isArray(r) ? r[parseInt(n, 10)] : r[n], e);
@@ -465,7 +496,7 @@ const _r = (e = navigator.language || "en-US") => {
465
496
  }
466
497
  }
467
498
  return !0;
468
- }, We = (e, t, r) => {
499
+ }, De = (e, t, r) => {
469
500
  if (e === null)
470
501
  throw new Error("object is null");
471
502
  if (e === void 0)
@@ -476,11 +507,11 @@ const _r = (e = navigator.language || "en-US") => {
476
507
  let o = e;
477
508
  for (let i = 0; i < n.length - 1; i++) {
478
509
  const u = n[i], d = n[i + 1];
479
- (o[u] == null || typeof o[u] != "object") && (o[u] = Nt(d) ? [] : {}), o = o[u];
510
+ (o[u] == null || typeof o[u] != "object") && (o[u] = Tt(d) ? [] : {}), o = o[u];
480
511
  }
481
512
  const s = n[n.length - 1];
482
513
  return o[s] = r, e;
483
- }, Wt = (e, t, r) => {
514
+ }, Dt = (e, t, r) => {
484
515
  if (e === null)
485
516
  throw new Error("object is null");
486
517
  if (e === void 0)
@@ -491,10 +522,10 @@ const _r = (e = navigator.language || "en-US") => {
491
522
  let s = o;
492
523
  for (let i = 0; i < n.length - 1; i++) {
493
524
  const u = n[i], d = n[i + 1];
494
- s[u] == null || typeof s[u] != "object" ? s[u] = Nt(d) ? [] : {} : s[u] = ct(s[u]), s = s[u];
525
+ s[u] == null || typeof s[u] != "object" ? s[u] = Tt(d) ? [] : {} : s[u] = ct(s[u]), s = s[u];
495
526
  }
496
527
  return s[n[n.length - 1]] = r, o;
497
- }, ct = (e) => Array.isArray(e) ? e.slice() : { ...e }, Ur = (e, t) => {
528
+ }, ct = (e) => Array.isArray(e) ? e.slice() : { ...e }, _r = (e, t) => {
498
529
  if (t === "")
499
530
  return e;
500
531
  const r = t.split("."), n = [e];
@@ -511,7 +542,7 @@ const _r = (e = navigator.language || "en-US") => {
511
542
  Array.isArray(o) ? o.splice(parseInt(s, 10), 1) : delete o[s];
512
543
  for (let i = n.length - 1; i >= 1; i--) {
513
544
  const u = n[i];
514
- if (Array.isArray(u) || !Hr(u))
545
+ if (Array.isArray(u) || !Ur(u))
515
546
  break;
516
547
  const d = n[i - 1], l = r[i - 1];
517
548
  if (Array.isArray(d))
@@ -520,21 +551,21 @@ const _r = (e = navigator.language || "en-US") => {
520
551
  }
521
552
  return e;
522
553
  };
523
- function Nt(e) {
554
+ function Tt(e) {
524
555
  const t = Number(e);
525
556
  return Number.isInteger(t) && t >= 0 && t.toString() === e;
526
557
  }
527
- function Hr(e) {
558
+ function Ur(e) {
528
559
  return e != null && typeof e == "object" && !Array.isArray(e) && Object.keys(e).length === 0;
529
560
  }
530
- function ce(e) {
561
+ function de(e) {
531
562
  if (e === null || typeof e != "object")
532
563
  return e;
533
564
  if (Array.isArray(e))
534
- return e.map((r) => ce(r));
565
+ return e.map((r) => de(r));
535
566
  const t = {};
536
567
  for (const r of Object.keys(e))
537
- t[r] = ce(e[r]);
568
+ t[r] = de(e[r]);
538
569
  return t;
539
570
  }
540
571
  function Be(e) {
@@ -543,36 +574,36 @@ function Be(e) {
543
574
  ...H(t) ? Be(t.children) : []
544
575
  ]);
545
576
  }
546
- function $e(e) {
577
+ function Se(e) {
547
578
  return Object.entries(e.validations).sort(
548
579
  ([n], [o]) => n.split(".").length - o.split(".").length
549
580
  ).reduce(
550
- (n, [o, s]) => (s !== null && (n.$formIsInvalid = !0, We(n.$errors, o, [...s])), n),
581
+ (n, [o, s]) => (s !== null && (n.$formIsInvalid = !0, De(n.$errors, o, [...s])), n),
551
582
  { $formIsInvalid: !1, $errors: {} }
552
583
  );
553
584
  }
554
- function V(e) {
585
+ function R(e) {
555
586
  if (e !== void 0)
556
- return j(e) || W(e) ? e.path : void 0;
587
+ return j(e) || T(e) ? e.path : void 0;
557
588
  }
558
- function Ce(e) {
559
- const t = ce(e.data);
589
+ function Ie(e) {
590
+ const t = de(e.data);
560
591
  for (const [r, n] of Object.entries(e.widgetFlags))
561
592
  if (n.hidden === !0) {
562
- const o = V(e.resolvedSources[r]);
563
- o !== void 0 && Ur(t, o);
593
+ const o = R(e.resolvedSources[r]);
594
+ o !== void 0 && _r(t, o);
564
595
  }
565
596
  return t;
566
597
  }
567
- const Se = (e) => !W(e) && e.type === "repeater", te = (e) => [...e.matchAll(/\[(\d+)\]/g)].map((t) => parseInt(t[1], 10));
568
- function Ne(e, t) {
598
+ const Ae = (e) => !T(e) && e.type === "repeater", te = (e) => [...e.matchAll(/\[(\d+)\]/g)].map((t) => parseInt(t[1], 10));
599
+ function Te(e, t) {
569
600
  const r = { resolvedSources: {}, repeaterItemScopes: {} };
570
601
  for (const n of Object.values(e))
571
- r.resolvedSources[n.uid] = n, Se(n) && Tt(n, [], t, r);
602
+ r.resolvedSources[n.uid] = n, Ae(n) && Nt(n, [], t, r);
572
603
  return r;
573
604
  }
574
- function Tt(e, t, r, n) {
575
- const o = _(r, e.path);
605
+ function Nt(e, t, r, n) {
606
+ const o = M(r, e.path);
576
607
  if (!Array.isArray(o))
577
608
  return;
578
609
  const s = Be([e.props.template]);
@@ -584,15 +615,15 @@ function Tt(e, t, r, n) {
584
615
  for (const a of s) {
585
616
  const p = Vt(a, d);
586
617
  n.resolvedSources[p.uid] = p, n.repeaterItemScopes[p.uid] = l;
587
- const g = br(a, p, d, r, i, u);
588
- g && Tt(g, d, r, n);
618
+ const g = Hr(a, p, d, r, i, u);
619
+ g && Nt(g, d, r, n);
589
620
  }
590
621
  });
591
622
  }
592
- function br(e, t, r, n, o, s) {
593
- if (Se(t))
623
+ function Hr(e, t, r, n, o, s) {
624
+ if (Ae(t))
594
625
  return t;
595
- if (!W(e))
626
+ if (!T(e))
596
627
  return;
597
628
  const i = e({
598
629
  $form: n,
@@ -609,7 +640,7 @@ function br(e, t, r, n, o, s) {
609
640
  }
610
641
  function Vt(e, t) {
611
642
  const r = Ge(e.uid, t);
612
- if (W(e)) {
643
+ if (T(e)) {
613
644
  const n = (o) => e(o);
614
645
  return n.uid = r, n.type = e.type, e.path !== void 0 && (n.path = dt(e.path, t)), n;
615
646
  }
@@ -638,7 +669,7 @@ function dt(e, t) {
638
669
  );
639
670
  return n.reduce((s, i, u) => u === 0 ? i : `${s}.${t[u - 1]}${i}`);
640
671
  }
641
- function zr(e, t) {
672
+ function br(e, t) {
642
673
  let r = 0;
643
674
  return e.replace(/\.items(\??)\./g, (n, o) => {
644
675
  const s = t[r++];
@@ -646,7 +677,7 @@ function zr(e, t) {
646
677
  });
647
678
  }
648
679
  const lt = ["include", "exclude", "disabled", "readonly"];
649
- function Br(e, t) {
680
+ function zr(e, t) {
650
681
  if (!lt.some(
651
682
  (o) => at(e[o])
652
683
  ))
@@ -656,7 +687,7 @@ function Br(e, t) {
656
687
  const s = n[o];
657
688
  at(s) && (n[o] = {
658
689
  ...s,
659
- when: zr(s.when, t)
690
+ when: br(s.when, t)
660
691
  });
661
692
  }
662
693
  return n;
@@ -664,19 +695,19 @@ function Br(e, t) {
664
695
  function at(e) {
665
696
  return e !== null && typeof e == "object" && "when" in e && typeof e.when == "string";
666
697
  }
667
- const Gr = 50, Kr = (e) => {
668
- let t = e.data, r = Ne(e.flatForm, t);
669
- for (let n = 0; n < Gr; n++) {
698
+ const Br = 50, Gr = (e) => {
699
+ let t = e.data, r = Te(e.flatForm, t);
700
+ for (let n = 0; n < Br; n++) {
670
701
  let o = !1;
671
702
  for (const s of Object.values(r.resolvedSources))
672
- !j(s) || Mr(t, s.path) || (t = Wt(t, s.path, ce(s.defaultValue)), s.defaultValue !== void 0 && (o = !0));
703
+ !j(s) || Mr(t, s.path) || (t = Dt(t, s.path, de(s.defaultValue)), s.defaultValue !== void 0 && (o = !0));
673
704
  if (!o)
674
705
  break;
675
- r = Ne(e.flatForm, t);
706
+ r = Te(e.flatForm, t);
676
707
  }
677
708
  return { ...e, data: t, ...r };
678
709
  }, Ke = 32;
679
- let Te, h, m, v = (e) => (h = 0, m = e, v.newline = !1, e = S(), m[h] ? z() : e || ""), z = (e = "Unexpected token", t = h, r = m.slice(0, t).split(`
710
+ let Ne, h, m, v = (e) => (h = 0, m = e, v.newline = !1, e = S(), m[h] ? z() : e || ""), z = (e = "Unexpected token", t = h, r = m.slice(0, t).split(`
680
711
  `), n = r.pop(), o = m.slice(Math.max(0, t - 40), t), s = "̭", i = (m[t] || " ") + s, u = m.slice(t + 1, t + 20)) => {
681
712
  throw SyntaxError(`${e} at ${r.length + 1}:${n.length + 1}
682
713
  ${m[t - 41] !== `
@@ -687,71 +718,71 @@ ${m[t - 41] !== `
687
718
  }, O = (e = 1) => m[h += e], Ve = (e) => h = e, S = (e = 0, t) => {
688
719
  let r, n, o, s, i;
689
720
  for (t && v.asi && (v.newline = !1); (r = v.space()) && (i = v.newline, 1) && r !== t && (o = // ASI before [ on new line (access handler would consume it; lineBreak distinguishes real \n from synthetic } flag)
690
- (n && r === 91 && Te && v.asi?.(n, e, S) || null) ?? ((s = D[r]) && s(n, e)) ?? (n && i && v.asi?.(n, e, S)) ?? (!n && x(v.id))); ) n = o;
721
+ (n && r === 91 && Ne && v.asi?.(n, e, S) || null) ?? ((s = W[r]) && s(n, e)) ?? (n && i && v.asi?.(n, e, S)) ?? (!n && x(v.id))); ) n = o;
691
722
  return t && (r == t ? (h++, t === 125 && v.asi && (v.newline = !0)) : z("Unclosed " + String.fromCharCode(t - (t > 42 ? 2 : 1)))), n;
692
- }, R = (e, t = h) => {
693
- for (Te = !1; (e = m.charCodeAt(h)) <= Ke; )
694
- v.asi && e === 10 && (v.newline = Te = !0), h++;
723
+ }, L = (e, t = h) => {
724
+ for (Ne = !1; (e = m.charCodeAt(h)) <= Ke; )
725
+ v.asi && e === 10 && (v.newline = Ne = !0), h++;
695
726
  return e;
696
- }, xr = (e = h) => {
727
+ }, Kr = (e = h) => {
697
728
  for (; m.charCodeAt(e) <= Ke; ) e++;
698
729
  return m.charCodeAt(e);
699
730
  };
700
731
  v.id = (e) => e >= 48 && e <= 57 || e >= 65 && e <= 90 || e >= 97 && e <= 122 || e == 36 || e == 95 || e >= 192 && e != 215 && e != 247;
701
- let Xr = (e, t = e.length) => m.substr(h, t) === e && !v.id(m.charCodeAt(h + t)), D = [], ft = {}, P = (e, t = Ke, r, n = e.charCodeAt(0), o = e.length, s = D[n], i = e.toUpperCase() !== e, u, d) => (t = ft[e] = !s && ft[e] || t, D[n] = (l, a, p, g = h) => (u = p, (p ? e == p : (o < 2 || e.charCodeAt(1) === m.charCodeAt(h + 1) && (o < 3 || m.substr(h, o) == e)) && (!i || !v.id(m.charCodeAt(h + o))) && (u = p = e)) && a < t && (h += o, (d = r(l)) ? Rt(d, g) : (h = g, u = 0, !i && !s && !l && z()), d) || s?.(l, a, u))), $ = (e, t, r = !1) => P(e, t, (n) => n && /* @__PURE__ */ ((o) => o && [e, n, o])(S(t - (r ? 0.5 : 0)))), L = (e, t, r) => P(e, t, (n) => !n && (n = S(t - 0.5)) && [e, n]), re = (e, t) => P(e, 200, (r) => !r && [, t]), _t = (e, t, r) => P(
732
+ let xr = (e, t = e.length) => m.substr(h, t) === e && !v.id(m.charCodeAt(h + t)), W = [], ft = {}, P = (e, t = Ke, r, n = e.charCodeAt(0), o = e.length, s = W[n], i = e.toUpperCase() !== e, u, d) => (t = ft[e] = !s && ft[e] || t, W[n] = (l, a, p, g = h) => (u = p, (p ? e == p : (o < 2 || e.charCodeAt(1) === m.charCodeAt(h + 1) && (o < 3 || m.substr(h, o) == e)) && (!i || !v.id(m.charCodeAt(h + o))) && (u = p = e)) && a < t && (h += o, (d = r(l)) ? Rt(d, g) : (h = g, u = 0, !i && !s && !l && z()), d) || s?.(l, a, u))), $ = (e, t, r = !1) => P(e, t, (n) => n && /* @__PURE__ */ ((o) => o && [e, n, o])(S(t - (r ? 0.5 : 0)))), _ = (e, t, r) => P(e, t, (n) => !n && (n = S(t - 0.5)) && [e, n]), re = (e, t) => P(e, 200, (r) => !r && [, t]), Lt = (e, t, r) => P(
702
733
  e,
703
734
  t,
704
735
  (n, o) => (o = S(t - (r ? 0.5 : 0)), n?.[0] !== e && (n = [e, n || null]), o?.[0] === e ? n.push(...o.slice(1)) : n.push(o || null), n)
705
- ), xe = (e, t) => P(e[0], t, (r) => !r && [e, S(0, e.charCodeAt(1)) || null]), Lt = (e, t) => P(e[0], t, (r) => r && [e, r, S(0, e.charCodeAt(1)) || null]), ne = (e, t, r, n = e.charCodeAt(0), o = e.length, s = D[n], i) => D[n] = (u, d, l, a = h) => !u && (l ? e == l : (o < 2 || m.substr(h, o) == e) && (l = e)) && d < t && !v.id(m.charCodeAt(h + o)) && (!v.prop || v.prop(h + o)) && (Ve(h + o), (i = r()) ? Rt(i, a) : Ve(a), i) || s?.(u, d, l);
736
+ ), xe = (e, t) => P(e[0], t, (r) => !r && [e, S(0, e.charCodeAt(1)) || null]), Mt = (e, t) => P(e[0], t, (r) => r && [e, r, S(0, e.charCodeAt(1)) || null]), ne = (e, t, r, n = e.charCodeAt(0), o = e.length, s = W[n], i) => W[n] = (u, d, l, a = h) => !u && (l ? e == l : (o < 2 || m.substr(h, o) == e) && (l = e)) && d < t && !v.id(m.charCodeAt(h + o)) && (!v.prop || v.prop(h + o)) && (Ve(h + o), (i = r()) ? Rt(i, a) : Ve(a), i) || s?.(u, d, l);
706
737
  Object.defineProperty(v, "space", {
707
738
  configurable: !0,
708
739
  enumerable: !0,
709
- get: () => R,
710
- set: (e) => R = e
740
+ get: () => L,
741
+ set: (e) => L = e
711
742
  });
712
743
  const Re = {}, f = (e, t, r = Re[e]) => Re[e] = (...n) => t(...n) || r?.(...n), c = (e) => Array.isArray(e) ? e[0] == null ? /* @__PURE__ */ ((t) => () => t)(e[1]) : (
713
744
  // == catches both undefined and null
714
745
  Re[e[0]]?.(...e.slice(1)) ?? z(`Unknown operator: ${e[0]}`, e?.loc)
715
746
  ) : e === void 0 ? () => {
716
- } : (t) => t?.[e], de = 46, Q = 48, le = 57, Jr = 69, Qr = 101, qr = 43, Zr = 45, ie = 95, Mt = 110, Yr = 97, en = 102, tn = 65, rn = 70, Ut = (e) => e.indexOf("_") < 0 ? e : e.replaceAll("_", ""), Xe = (e) => {
747
+ } : (t) => t?.[e], le = 46, Q = 48, ae = 57, Xr = 69, Jr = 101, Qr = 43, qr = 45, ie = 95, _t = 110, Zr = 97, Yr = 102, en = 65, tn = 70, Ut = (e) => e.indexOf("_") < 0 ? e : e.replaceAll("_", ""), Xe = (e) => {
717
748
  let t = Ut(x(
718
749
  (r) => (
719
750
  // . is decimal only if NOT followed by another . (range operator)
720
- r === de && m.charCodeAt(h + 1) !== de || r >= Q && r <= le || r === ie || ((r === Jr || r === Qr) && ((r = m.charCodeAt(h + 1)) >= Q && r <= le || r === qr || r === Zr) ? 2 : 0)
751
+ r === le && m.charCodeAt(h + 1) !== le || r >= Q && r <= ae || r === ie || ((r === Xr || r === Jr) && ((r = m.charCodeAt(h + 1)) >= Q && r <= ae || r === Qr || r === qr) ? 2 : 0)
721
752
  )
722
753
  ));
723
- return m.charCodeAt(h) === Mt ? (O(), [, BigInt(t)]) : (e = +t) != e ? z() : [, e];
724
- }, nn = {
754
+ return m.charCodeAt(h) === _t ? (O(), [, BigInt(t)]) : (e = +t) != e ? z() : [, e];
755
+ }, rn = {
725
756
  2: (e) => e === 48 || e === 49 || e === ie,
726
757
  8: (e) => e >= 48 && e <= 55 || e === ie,
727
- 16: (e) => e >= Q && e <= le || e >= Yr && e <= en || e >= tn && e <= rn || e === ie
758
+ 16: (e) => e >= Q && e <= ae || e >= Zr && e <= Yr || e >= en && e <= tn || e === ie
728
759
  };
729
760
  v.number = null;
730
- D[de] = (e) => !e && m.charCodeAt(h + 1) !== de && Xe();
731
- for (let e = Q; e <= le; e++) D[e] = (t) => t ? void 0 : Xe();
732
- D[Q] = (e) => {
761
+ W[le] = (e) => !e && m.charCodeAt(h + 1) !== le && Xe();
762
+ for (let e = Q; e <= ae; e++) W[e] = (t) => t ? void 0 : Xe();
763
+ W[Q] = (e) => {
733
764
  if (e) return;
734
765
  const t = v.number;
735
766
  if (t) {
736
767
  for (const [r, n] of Object.entries(t))
737
768
  if (r[0] === "0" && m[h + 1]?.toLowerCase() === r[1]) {
738
769
  O(2);
739
- const o = Ut(x(nn[n]));
740
- return m.charCodeAt(h) === Mt ? (O(), [, BigInt("0" + r[1] + o)]) : [, parseInt(o, n)];
770
+ const o = Ut(x(rn[n]));
771
+ return m.charCodeAt(h) === _t ? (O(), [, BigInt("0" + r[1] + o)]) : [, parseInt(o, n)];
741
772
  }
742
773
  }
743
774
  return Xe();
744
775
  };
745
- const on = 92, pt = 34, ht = 39, sn = { n: `
776
+ const nn = 92, pt = 34, ht = 39, on = { n: `
746
777
  `, r: "\r", t: " ", b: "\b", f: "\f", v: "\v" }, Ht = (e) => (t, r, n = "") => {
747
778
  if (!(t || !v.string?.[String.fromCharCode(e)]))
748
- return O(), x((o) => o - e && (o === on ? (n += sn[m[h + 1]] || m[h + 1], 2) : (n += m[h], 1))), m[h] === String.fromCharCode(e) ? O() : z("Bad string"), [, n];
779
+ return O(), x((o) => o - e && (o === nn ? (n += on[m[h + 1]] || m[h + 1], 2) : (n += m[h], 1))), m[h] === String.fromCharCode(e) ? O() : z("Bad string"), [, n];
749
780
  };
750
- D[pt] = Ht(pt);
751
- D[ht] = Ht(ht);
781
+ W[pt] = Ht(pt);
782
+ W[ht] = Ht(ht);
752
783
  v.string = { '"': !0 };
753
- const un = 20;
754
- "= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map((e) => $(e, un, !0));
784
+ const sn = 20;
785
+ "= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map((e) => $(e, sn, !0));
755
786
  const bt = (e, t, r, n) => typeof e == "string" ? (o) => t(o, e, o) : e[0] === "." ? (r = c(e[1]), n = e[2], (o) => t(r(o), n, o)) : e[0] === "[]" && e.length === 3 ? (r = c(e[1]), n = c(e[2]), (o) => t(r(o), n(o), o)) : e[0] === "()" && e.length === 2 ? bt(e[1], t) : (() => {
756
787
  throw Error("Invalid assignment target");
757
788
  })(), mt = {
@@ -768,31 +799,31 @@ const bt = (e, t, r, n) => typeof e == "string" ? (o) => t(o, e, o) : e[0] === "
768
799
  "<<=": (e, t, r) => e[t] <<= r
769
800
  };
770
801
  for (const e in mt) f(e, (t, r) => (r = c(r), bt(t, (n, o, s) => mt[e](n, o, r(s)))));
771
- const cn = 30, dn = 40, ln = 140;
772
- L("!", ln);
773
- $("||", cn);
774
- $("&&", dn);
802
+ const un = 30, cn = 40, dn = 140;
803
+ _("!", dn);
804
+ $("||", un);
805
+ $("&&", cn);
775
806
  f("!", (e) => (e = c(e), (t) => !e(t)));
776
807
  f("||", (e, t) => (e = c(e), t = c(t), (r) => e(r) || t(r)));
777
808
  f("&&", (e, t) => (e = c(e), t = c(t), (r) => e(r) && t(r)));
778
- const an = 50, fn = 60, pn = 70, zt = 100, hn = 140;
779
- $("|", an);
780
- $("&", pn);
781
- $("^", fn);
809
+ const ln = 50, an = 60, fn = 70, zt = 100, pn = 140;
810
+ $("|", ln);
811
+ $("&", fn);
812
+ $("^", an);
782
813
  $(">>", zt);
783
814
  $("<<", zt);
784
- L("~", hn);
815
+ _("~", pn);
785
816
  f("~", (e) => (e = c(e), (t) => ~e(t)));
786
817
  f("|", (e, t) => (e = c(e), t = c(t), (r) => e(r) | t(r)));
787
818
  f("&", (e, t) => (e = c(e), t = c(t), (r) => e(r) & t(r)));
788
819
  f("^", (e, t) => (e = c(e), t = c(t), (r) => e(r) ^ t(r)));
789
820
  f(">>", (e, t) => (e = c(e), t = c(t), (r) => e(r) >> t(r)));
790
821
  f("<<", (e, t) => (e = c(e), t = c(t), (r) => e(r) << t(r)));
791
- const Ae = 90;
792
- $("<", Ae);
793
- $(">", Ae);
794
- $("<=", Ae);
795
- $(">=", Ae);
822
+ const Ee = 90;
823
+ $("<", Ee);
824
+ $(">", Ee);
825
+ $("<=", Ee);
826
+ $(">=", Ee);
796
827
  f(">", (e, t) => (e = c(e), t = c(t), (r) => e(r) > t(r)));
797
828
  f("<", (e, t) => (e = c(e), t = c(t), (r) => e(r) < t(r)));
798
829
  f(">=", (e, t) => (e = c(e), t = c(t), (r) => e(r) >= t(r)));
@@ -808,16 +839,16 @@ $("-", Gt);
808
839
  $("*", Je);
809
840
  $("/", Je);
810
841
  $("%", Je);
811
- L("+", Kt);
812
- L("-", Kt);
842
+ _("+", Kt);
843
+ _("-", Kt);
813
844
  f("+", (e, t) => t !== void 0 ? (e = c(e), t = c(t), (r) => e(r) + t(r)) : (e = c(e), (r) => +e(r)));
814
845
  f("-", (e, t) => t !== void 0 ? (e = c(e), t = c(t), (r) => e(r) - t(r)) : (e = c(e), (r) => -e(r)));
815
846
  f("*", (e, t) => (e = c(e), t = c(t), (r) => e(r) * t(r)));
816
847
  f("/", (e, t) => (e = c(e), t = c(t), (r) => e(r) / t(r)));
817
848
  f("%", (e, t) => (e = c(e), t = c(t), (r) => e(r) % t(r)));
818
- const ae = 150;
819
- P("++", ae, (e) => e ? ["++", e, null] : ["++", S(ae - 1)]);
820
- P("--", ae, (e) => e ? ["--", e, null] : ["--", S(ae - 1)]);
849
+ const fe = 150;
850
+ P("++", fe, (e) => e ? ["++", e, null] : ["++", S(fe - 1)]);
851
+ P("--", fe, (e) => e ? ["--", e, null] : ["--", S(fe - 1)]);
821
852
  const Qe = (e, t, r, n) => typeof e == "string" ? (o) => t(o, e) : e[0] === "." ? (r = c(e[1]), n = e[2], (o) => t(r(o), n)) : e[0] === "[]" && e.length === 3 ? (r = c(e[1]), n = c(e[2]), (o) => t(r(o), n(o))) : e[0] === "()" && e.length === 2 ? Qe(e[1], t) : (
822
853
  // unwrap parens: (x)++
823
854
  (() => {
@@ -826,9 +857,9 @@ const Qe = (e, t, r, n) => typeof e == "string" ? (o) => t(o, e) : e[0] === "."
826
857
  );
827
858
  f("++", (e, t) => Qe(e, t === null ? (r, n) => r[n]++ : (r, n) => ++r[n]));
828
859
  f("--", (e, t) => Qe(e, t === null ? (r, n) => r[n]-- : (r, n) => --r[n]));
829
- const mn = 5, gn = 10;
830
- _t(",", gn);
831
- _t(";", mn, !0);
860
+ const hn = 5, mn = 10;
861
+ Lt(",", mn);
862
+ Lt(";", hn, !0);
832
863
  const xt = (...e) => (e = e.map(c), (t) => {
833
864
  let r;
834
865
  for (const n of e) r = n(t);
@@ -836,47 +867,47 @@ const xt = (...e) => (e = e.map(c), (t) => {
836
867
  });
837
868
  f(",", xt);
838
869
  f(";", xt);
839
- const yn = 170;
840
- xe("()", yn);
841
- const T = (e) => e?.[0] === "_" && e[1] === "_" || e === "constructor" || e === "prototype", qe = 170;
842
- Lt("[]", qe);
870
+ const gn = 170;
871
+ xe("()", gn);
872
+ const V = (e) => e?.[0] === "_" && e[1] === "_" || e === "constructor" || e === "prototype", qe = 170;
873
+ Mt("[]", qe);
843
874
  $(".", qe);
844
- Lt("()", qe);
845
- const fe = (e) => {
875
+ Mt("()", qe);
876
+ const pe = (e) => {
846
877
  throw Error(e);
847
878
  };
848
879
  f("[]", (e, t) => t === void 0 ? (e = e ? e[0] === "," ? e.slice(1) : [e] : [], e = e.map((r) => r == null ? (() => {
849
- }) : r[0] === "..." ? (r = c(r[1]), (n) => r(n)) : (r = c(r), (n) => [r(n)])), (r) => e.flatMap((n) => n(r))) : (t == null && fe("Missing index"), e = c(e), t = c(t), (r) => {
880
+ }) : r[0] === "..." ? (r = c(r[1]), (n) => r(n)) : (r = c(r), (n) => [r(n)])), (r) => e.flatMap((n) => n(r))) : (t == null && pe("Missing index"), e = c(e), t = c(t), (r) => {
850
881
  const n = t(r);
851
- return T(n) ? void 0 : e(r)[n];
882
+ return V(n) ? void 0 : e(r)[n];
852
883
  }));
853
- f(".", (e, t) => (e = c(e), t = t[0] ? t : t[1], T(t) ? () => {
884
+ f(".", (e, t) => (e = c(e), t = t[0] ? t : t[1], V(t) ? () => {
854
885
  } : (r) => e(r)[t]));
855
886
  f("()", (e, t) => {
856
- if (t === void 0) return e == null ? fe("Empty ()") : c(e);
887
+ if (t === void 0) return e == null ? pe("Empty ()") : c(e);
857
888
  const r = (o) => o?.[0] === "," && o.slice(1).some((s) => s == null || r(s));
858
- r(t) && fe("Empty argument");
889
+ r(t) && pe("Empty argument");
859
890
  const n = t ? t[0] === "," ? (t = t.slice(1).map(c), (o) => t.map((s) => s(o))) : (t = c(t), (o) => [t(o)]) : () => [];
860
891
  return Ze(e, (o, s, i) => o[s](...n(i)));
861
892
  });
862
- const B = (e) => typeof e == "string" || Array.isArray(e) && (e[0] === "." || e[0] === "?." || e[0] === "[]" && e.length === 3 || e[0] === "?.[]" || e[0] === "()" && e.length === 2 && B(e[1]) || e[0] === "{}"), Ze = (e, t, r, n) => e == null ? fe("Empty ()") : e[0] === "()" && e.length == 2 ? Ze(e[1], t) : typeof e == "string" ? (o) => t(o, e, o) : e[0] === "." ? (r = c(e[1]), n = e[2], (o) => t(r(o), n, o)) : e[0] === "?." ? (r = c(e[1]), n = e[2], (o) => {
893
+ const B = (e) => typeof e == "string" || Array.isArray(e) && (e[0] === "." || e[0] === "?." || e[0] === "[]" && e.length === 3 || e[0] === "?.[]" || e[0] === "()" && e.length === 2 && B(e[1]) || e[0] === "{}"), Ze = (e, t, r, n) => e == null ? pe("Empty ()") : e[0] === "()" && e.length == 2 ? Ze(e[1], t) : typeof e == "string" ? (o) => t(o, e, o) : e[0] === "." ? (r = c(e[1]), n = e[2], (o) => t(r(o), n, o)) : e[0] === "?." ? (r = c(e[1]), n = e[2], (o) => {
863
894
  const s = r(o);
864
895
  return s == null ? void 0 : t(s, n, o);
865
896
  }) : e[0] === "[]" && e.length === 3 ? (r = c(e[1]), n = c(e[2]), (o) => t(r(o), n(o), o)) : e[0] === "?.[]" ? (r = c(e[1]), n = c(e[2]), (o) => {
866
897
  const s = r(o);
867
898
  return s == null ? void 0 : t(s, n(o), o);
868
- }) : (e = c(e), (o) => t([e(o)], 0, o)), X = Ze, vn = 32, $n = v.space;
899
+ }) : (e = c(e), (o) => t([e(o)], 0, o)), X = Ze, yn = 32, vn = v.space;
869
900
  v.comment ??= { "//": `
870
901
  `, "/*": "*/" };
871
- let Ie;
902
+ let ke;
872
903
  v.space = () => {
873
- Ie || (Ie = Object.entries(v.comment).map(([o, s]) => [o, s, o.charCodeAt(0)]));
874
- for (var e; e = $n(); ) {
875
- for (var t = 0, r; r = Ie[t++]; )
904
+ ke || (ke = Object.entries(v.comment).map(([o, s]) => [o, s, o.charCodeAt(0)]));
905
+ for (var e; e = vn(); ) {
906
+ for (var t = 0, r; r = ke[t++]; )
876
907
  if (e === r[2] && m.substr(h, r[0].length) === r[0]) {
877
908
  var n = h + r[0].length;
878
909
  if (r[1] === `
879
- `) for (; m.charCodeAt(n) >= vn; ) n++;
910
+ `) for (; m.charCodeAt(n) >= yn; ) n++;
880
911
  else {
881
912
  for (; m[n] && m.substr(n, r[1].length) !== r[1]; ) n++;
882
913
  m[n] && (n += r[1].length);
@@ -893,34 +924,34 @@ $("===", Xt);
893
924
  $("!==", Xt);
894
925
  f("===", (e, t) => (e = c(e), t = c(t), (r) => e(r) === t(r)));
895
926
  f("!==", (e, t) => (e = c(e), t = c(t), (r) => e(r) !== t(r)));
896
- const Sn = 30;
897
- $("??", Sn);
927
+ const $n = 30;
928
+ $("??", $n);
898
929
  f("??", (e, t) => (e = c(e), t = c(t), (r) => e(r) ?? t(r)));
899
- const An = 130, En = 20;
900
- $("**", An, !0);
901
- $("**=", En, !0);
930
+ const Sn = 130, An = 20;
931
+ $("**", Sn, !0);
932
+ $("**=", An, !0);
902
933
  f("**", (e, t) => (e = c(e), t = c(t), (r) => e(r) ** t(r)));
903
- const wn = (e) => {
934
+ const En = (e) => {
904
935
  throw Error(e);
905
936
  };
906
- f("**=", (e, t) => (B(e) || wn("Invalid assignment target"), t = c(t), X(e, (r, n, o) => r[n] **= t(o))));
937
+ f("**=", (e, t) => (B(e) || En("Invalid assignment target"), t = c(t), X(e, (r, n, o) => r[n] **= t(o))));
907
938
  const Jt = 90;
908
939
  $("in", Jt);
909
940
  $("of", Jt);
910
941
  f("in", (e, t) => (e = c(e), t = c(t), (r) => e(r) in t(r)));
911
- const On = 20, Cn = 100, In = (e) => {
942
+ const wn = 20, On = 100, Cn = (e) => {
912
943
  throw Error(e);
913
944
  };
914
- $(">>>", Cn);
915
- $(">>>=", On, !0);
945
+ $(">>>", On);
946
+ $(">>>=", wn, !0);
916
947
  f(">>>", (e, t) => (e = c(e), t = c(t), (r) => e(r) >>> t(r)));
917
- f(">>>=", (e, t) => (B(e) || In("Invalid assignment target"), t = c(t), X(e, (r, n, o) => r[n] >>>= t(o))));
918
- const Ye = 5, kn = 10, jn = 20, Pn = (e) => e[0]?.[0] === "," ? e[0].slice(1) : e, pe = (e, t, r) => {
948
+ f(">>>=", (e, t) => (B(e) || Cn("Invalid assignment target"), t = c(t), X(e, (r, n, o) => r[n] >>>= t(o))));
949
+ const Ye = 5, In = 10, kn = 20, jn = (e) => e[0]?.[0] === "," ? e[0].slice(1) : e, he = (e, t, r) => {
919
950
  if (typeof e == "string") {
920
951
  r[e] = t;
921
952
  return;
922
953
  }
923
- const [n, ...o] = e, s = Pn(o);
954
+ const [n, ...o] = e, s = jn(o);
924
955
  if (n === "{}") {
925
956
  const i = [];
926
957
  for (const u of s) {
@@ -933,7 +964,7 @@ const Ye = 5, kn = 10, jn = 20, Pn = (e) => e[0]?.[0] === "," ? e[0].slice(1) :
933
964
  let d, l, a;
934
965
  typeof u == "string" ? d = l = u : u[0] === "=" ? (typeof u[1] == "string" ? d = l = u[1] : [, d, l] = u[1], a = u[2]) : [, d, l] = u, i.push(d);
935
966
  let p = t[d];
936
- p === void 0 && a && (p = c(a)(r)), pe(l, p, r);
967
+ p === void 0 && a && (p = c(a)(r)), he(l, p, r);
937
968
  }
938
969
  } else if (n === "[]") {
939
970
  let i = 0;
@@ -949,16 +980,16 @@ const Ye = 5, kn = 10, jn = 20, Pn = (e) => e[0]?.[0] === "," ? e[0].slice(1) :
949
980
  let d = u, l;
950
981
  Array.isArray(u) && u[0] === "=" && ([, d, l] = u);
951
982
  let a = t[i++];
952
- a === void 0 && l && (a = c(l)(r)), pe(d, a, r);
983
+ a === void 0 && l && (a = c(l)(r)), he(d, a, r);
953
984
  }
954
985
  }
955
986
  }, Qt = (e) => {
956
- let t = S(kn - 1);
987
+ let t = S(In - 1);
957
988
  return t?.[0] === "in" || t?.[0] === "of" ? [t[0], [e, t[1]], t[2]] : t?.[0] === "," ? [e, ...t.slice(1)] : [e, t];
958
989
  };
959
990
  ne("let", Ye + 1, () => Qt("let"));
960
991
  ne("const", Ye + 1, () => Qt("const"));
961
- ne("var", Ye, () => (R(), ["var", S(jn)]));
992
+ ne("var", Ye, () => (L(), ["var", S(kn)]));
962
993
  const qt = (...e) => (e = e.map((t) => {
963
994
  if (typeof t == "string") return (r) => {
964
995
  r[t] = void 0;
@@ -967,7 +998,7 @@ const qt = (...e) => (e = e.map((t) => {
967
998
  const [, r, n] = t, o = c(n);
968
999
  return typeof r == "string" ? (s) => {
969
1000
  s[r] = o(s);
970
- } : (s) => pe(r, o(s), s);
1001
+ } : (s) => he(r, o(s), s);
971
1002
  }
972
1003
  return c(t);
973
1004
  }), (t) => {
@@ -979,7 +1010,7 @@ f("var", (e) => typeof e == "string" ? (t) => {
979
1010
  t[e] = void 0;
980
1011
  } : () => {
981
1012
  });
982
- const et = 20, Ee = (e) => {
1013
+ const et = 20, we = (e) => {
983
1014
  throw Error(e);
984
1015
  };
985
1016
  $("||=", et, !0);
@@ -990,24 +1021,24 @@ f("=", (e, t) => {
990
1021
  const r = e[1];
991
1022
  return t = c(t), typeof r == "string" ? (n) => {
992
1023
  n[r] = t(n);
993
- } : (n) => pe(r, t(n), n);
1024
+ } : (n) => he(r, t(n), n);
994
1025
  }
995
- return B(e) || Ee("Invalid assignment target"), t = c(t), X(e, (r, n, o) => r[n] = t(o));
1026
+ return B(e) || we("Invalid assignment target"), t = c(t), X(e, (r, n, o) => r[n] = t(o));
996
1027
  });
997
- f("||=", (e, t) => (B(e) || Ee("Invalid assignment target"), t = c(t), X(e, (r, n, o) => r[n] ||= t(o))));
998
- f("&&=", (e, t) => (B(e) || Ee("Invalid assignment target"), t = c(t), X(e, (r, n, o) => r[n] &&= t(o))));
999
- f("??=", (e, t) => (B(e) || Ee("Invalid assignment target"), t = c(t), X(e, (r, n, o) => r[n] ??= t(o))));
1028
+ f("||=", (e, t) => (B(e) || we("Invalid assignment target"), t = c(t), X(e, (r, n, o) => r[n] ||= t(o))));
1029
+ f("&&=", (e, t) => (B(e) || we("Invalid assignment target"), t = c(t), X(e, (r, n, o) => r[n] &&= t(o))));
1030
+ f("??=", (e, t) => (B(e) || we("Invalid assignment target"), t = c(t), X(e, (r, n, o) => r[n] ??= t(o))));
1000
1031
  re("true", !0);
1001
1032
  re("false", !1);
1002
1033
  re("null", null);
1003
1034
  ne("undefined", 200, () => []);
1004
1035
  re("NaN", NaN);
1005
1036
  re("Infinity", 1 / 0);
1006
- const ke = 20;
1007
- P("?", ke, (e, t, r) => e && (t = S(ke - 1)) && x((n) => n === 58) && (r = S(ke - 1), ["?", e, t, r]));
1037
+ const je = 20;
1038
+ P("?", je, (e, t, r) => e && (t = S(je - 1)) && x((n) => n === 58) && (r = S(je - 1), ["?", e, t, r]));
1008
1039
  f("?", (e, t, r) => (e = c(e), t = c(t), r = c(r), (n) => e(n) ? t(n) : r(n)));
1009
- const Fn = [], Dn = 20;
1010
- $("=>", Dn, !0);
1040
+ const Pn = [], Fn = 20;
1041
+ $("=>", Fn, !0);
1011
1042
  f("=>", (e, t) => {
1012
1043
  e = e?.[0] === "()" ? e[1] : e;
1013
1044
  const r = e ? e[0] === "," ? e.slice(1) : [e] : [];
@@ -1027,63 +1058,63 @@ f("=>", (e, t) => {
1027
1058
  const p = t(a);
1028
1059
  return i ? void 0 : p;
1029
1060
  } catch (p) {
1030
- if (p === Fn) return p[0];
1061
+ if (p === Pn) return p[0];
1031
1062
  throw p;
1032
1063
  }
1033
1064
  };
1034
1065
  });
1035
1066
  const Wn = 140;
1036
- L("...", Wn);
1067
+ _("...", Wn);
1037
1068
  f("...", (e) => (e = c(e), (t) => Object.entries(e(t))));
1038
1069
  const gt = 170;
1039
1070
  P("?.", gt, (e, t) => {
1040
1071
  if (!e) return;
1041
- const r = R();
1072
+ const r = L();
1042
1073
  return r === 40 ? (O(), ["?.()", e, S(0, 41) || null]) : r === 91 ? (O(), ["?.[]", e, S(0, 93)]) : (t = S(gt), t ? ["?.", e, t] : void 0);
1043
1074
  });
1044
- f("?.", (e, t) => (e = c(e), T(t) ? () => {
1075
+ f("?.", (e, t) => (e = c(e), V(t) ? () => {
1045
1076
  } : (r) => e(r)?.[t]));
1046
1077
  f("?.[]", (e, t) => (e = c(e), t = c(t), (r) => {
1047
1078
  const n = t(r);
1048
- return T(n) ? void 0 : e(r)?.[n];
1079
+ return V(n) ? void 0 : e(r)?.[n];
1049
1080
  }));
1050
1081
  f("?.()", (e, t) => {
1051
1082
  const r = t ? t[0] === "," ? (t = t.slice(1).map(c), (o) => t.map((s) => s(o))) : (t = c(t), (o) => [t(o)]) : () => [];
1052
1083
  if (e[0] === "?.") {
1053
1084
  const o = c(e[1]), s = e[2];
1054
- return T(s) ? () => {
1085
+ return V(s) ? () => {
1055
1086
  } : (i) => o(i)?.[s]?.(...r(i));
1056
1087
  }
1057
1088
  if (e[0] === "?.[]") {
1058
1089
  const o = c(e[1]), s = c(e[2]);
1059
1090
  return (i) => {
1060
1091
  const u = o(i), d = s(i);
1061
- return T(d) ? void 0 : u?.[d]?.(...r(i));
1092
+ return V(d) ? void 0 : u?.[d]?.(...r(i));
1062
1093
  };
1063
1094
  }
1064
1095
  if (e[0] === ".") {
1065
1096
  const o = c(e[1]), s = e[2];
1066
- return T(s) ? () => {
1097
+ return V(s) ? () => {
1067
1098
  } : (i) => o(i)?.[s]?.(...r(i));
1068
1099
  }
1069
1100
  if (e[0] === "[]" && e.length === 3) {
1070
1101
  const o = c(e[1]), s = c(e[2]);
1071
1102
  return (i) => {
1072
1103
  const u = o(i), d = s(i);
1073
- return T(d) ? void 0 : u?.[d]?.(...r(i));
1104
+ return V(d) ? void 0 : u?.[d]?.(...r(i));
1074
1105
  };
1075
1106
  }
1076
1107
  const n = c(e);
1077
1108
  return (o) => n(o)?.(...r(o));
1078
1109
  });
1079
1110
  const q = 140;
1080
- L("typeof", q);
1081
- L("void", q);
1082
- L("delete", q);
1111
+ _("typeof", q);
1112
+ _("void", q);
1113
+ _("delete", q);
1083
1114
  ne(
1084
1115
  "new",
1085
1116
  q,
1086
- () => Xr(".target") ? (O(7), ["new.target"]) : ["new", S(q)]
1117
+ () => xr(".target") ? (O(7), ["new.target"]) : ["new", S(q)]
1087
1118
  );
1088
1119
  f("typeof", (e) => (e = c(e), (t) => typeof e(t)));
1089
1120
  f("void", (e) => (e = c(e), (t) => (e(t), void 0)));
@@ -1102,21 +1133,21 @@ f("new", (e) => {
1102
1133
  const t = c(e?.[0] === "()" ? e[1] : e), r = e?.[0] === "()" ? e[2] : null, n = r ? r[0] === "," ? /* @__PURE__ */ ((o) => (s) => o.map((i) => i(s)))(r.slice(1).map(c)) : /* @__PURE__ */ ((o) => (s) => [o(s)])(c(r)) : () => [];
1103
1134
  return (o) => new (t(o))(...n(o));
1104
1135
  });
1105
- const tt = /* @__PURE__ */ Symbol("accessor"), rt = 20, Nn = 40, Zt = 41, Yt = 123, er = 125, tr = (e) => (t) => {
1136
+ const tt = /* @__PURE__ */ Symbol("accessor"), rt = 20, Dn = 40, Zt = 41, Yt = 123, er = 125, tr = (e) => (t) => {
1106
1137
  if (t) return;
1107
- R();
1138
+ L();
1108
1139
  const r = x(v.id);
1109
- if (!r || (R(), m.charCodeAt(h) !== Nn)) return !1;
1140
+ if (!r || (L(), m.charCodeAt(h) !== Dn)) return !1;
1110
1141
  O();
1111
1142
  const n = S(0, Zt);
1112
- return R(), m.charCodeAt(h) !== Yt ? !1 : (O(), [e, r, n, S(0, er)]);
1143
+ return L(), m.charCodeAt(h) !== Yt ? !1 : (O(), [e, r, n, S(0, er)]);
1113
1144
  };
1114
1145
  P("get", rt - 1, tr("get"));
1115
1146
  P("set", rt - 1, tr("set"));
1116
1147
  P("(", rt - 1, (e) => {
1117
1148
  if (!e || typeof e != "string") return;
1118
1149
  const t = S(0, Zt) || null;
1119
- if (R(), m.charCodeAt(h) === Yt)
1150
+ if (L(), m.charCodeAt(h) === Yt)
1120
1151
  return O(), [":", e, ["=>", ["()", t], S(0, er) || null]];
1121
1152
  });
1122
1153
  f("get", (e, t) => (t = t ? c(t) : () => {
@@ -1134,14 +1165,14 @@ f("set", (e, t, r) => (r = r ? c(r) : () => {
1134
1165
  }
1135
1166
  }]]));
1136
1167
  const Tn = 20, rr = 200;
1137
- v.prop = (e) => xr(e) !== 58;
1138
- const Vn = (e) => e == null || typeof e == "string" || [":", ",", "...", "get", "set"].includes(e[0]);
1168
+ v.prop = (e) => Kr(e) !== 58;
1169
+ const Nn = (e) => e == null || typeof e == "string" || [":", ",", "...", "get", "set"].includes(e[0]);
1139
1170
  xe("[]", rr);
1140
1171
  xe("{}", rr);
1141
1172
  $(":", Tn - 1, !0);
1142
1173
  f("{}", (e, t) => {
1143
1174
  if (t !== void 0) return;
1144
- if (!Vn(e)) return c(["{", e]);
1175
+ if (!Nn(e)) return c(["{", e]);
1145
1176
  e = e ? e[0] !== "," ? [e] : e.slice(1) : [];
1146
1177
  const r = e.map((n) => c(typeof n == "string" ? [":", n, n] : n));
1147
1178
  return (n) => {
@@ -1158,18 +1189,18 @@ f("{}", (e, t) => {
1158
1189
  f("{", (e) => (e = e ? c(e) : () => {
1159
1190
  }, (t) => e(Object.create(t))));
1160
1191
  f(":", (e, t) => (t = c(t), Array.isArray(e) ? (e = c(e), (r) => [[e(r), t(r)]]) : (r) => [[e, t(r)]]));
1161
- const Rn = 170, he = 96, _n = 36, Ln = 123, Mn = 92, Un = { n: `
1192
+ const Vn = 170, me = 96, Rn = 36, Ln = 123, Mn = 92, _n = { n: `
1162
1193
  `, r: "\r", t: " ", b: "\b", f: "\f", v: "\v" }, yt = () => {
1163
1194
  const e = [];
1164
- for (let t = "", r; (r = m.charCodeAt(h)) !== he; )
1165
- r ? r === Mn ? (O(), t += Un[m[h]] || m[h], O()) : r === _n && m.charCodeAt(h + 1) === Ln ? (t && e.push([, t]), t = "", O(2), e.push(S(0, 125))) : (t += m[h], O(), r = m.charCodeAt(h), r === he && t && e.push([, t])) : z("Unterminated template");
1195
+ for (let t = "", r; (r = m.charCodeAt(h)) !== me; )
1196
+ r ? r === Mn ? (O(), t += _n[m[h]] || m[h], O()) : r === Rn && m.charCodeAt(h + 1) === Ln ? (t && e.push([, t]), t = "", O(2), e.push(S(0, 125))) : (t += m[h], O(), r = m.charCodeAt(h), r === me && t && e.push([, t])) : z("Unterminated template");
1166
1197
  return O(), e;
1167
- }, Hn = D[he];
1168
- D[he] = (e, t) => e && t < Rn ? v.asi && v.newline ? void 0 : (O(), ["``", e, ...yt()]) : (
1198
+ }, Un = W[me];
1199
+ W[me] = (e, t) => e && t < Vn ? v.asi && v.newline ? void 0 : (O(), ["``", e, ...yt()]) : (
1169
1200
  // tagged
1170
1201
  e ? (
1171
1202
  // plain
1172
- Hn?.(e, t)
1203
+ Un?.(e, t)
1173
1204
  ) : (O(), ((r) => r.length < 2 && r[0]?.[0] === void 0 ? r[0] || [, ""] : ["`", ...r])(yt()))
1174
1205
  );
1175
1206
  f("`", (...e) => (e = e.map(c), (t) => e.map((r) => r(t)).join("")));
@@ -1183,15 +1214,15 @@ f("``", (e, ...t) => {
1183
1214
  });
1184
1215
  v.string["'"] = !0;
1185
1216
  v.number = { "0x": 16, "0b": 2, "0o": 8 };
1186
- const bn = {
1217
+ const Hn = {
1187
1218
  log: (e, t) => (t ? console.log(t, e) : console.log(e), e)
1188
- }, zn = 2e3, oe = /* @__PURE__ */ new Map();
1219
+ }, bn = 2e3, oe = /* @__PURE__ */ new Map();
1189
1220
  function nt(e) {
1190
1221
  const t = oe.get(e);
1191
1222
  if (t !== void 0)
1192
1223
  return t;
1193
- const r = c(v(Bn(e)));
1194
- return oe.size >= zn && oe.clear(), oe.set(e, r), r;
1224
+ const r = c(v(zn(e)));
1225
+ return oe.size >= bn && oe.clear(), oe.set(e, r), r;
1195
1226
  }
1196
1227
  function J(e, t, r, n, o, s) {
1197
1228
  return nt(e)({
@@ -1199,18 +1230,18 @@ function J(e, t, r, n, o, s) {
1199
1230
  $meta: r,
1200
1231
  $errors: n,
1201
1232
  $formIsInvalid: o,
1202
- $log: bn.log,
1233
+ $log: Hn.log,
1203
1234
  $fn: {},
1204
1235
  ...s
1205
1236
  }) === !0;
1206
1237
  }
1207
- function Bn(e) {
1238
+ function zn(e) {
1208
1239
  return e.replace(
1209
1240
  /(\?\.|\.)(\d+)/g,
1210
- (t, r, n, o) => r === "." && Gn(e, o) ? t : r === "?." ? `?.[${n}]` : `[${n}]`
1241
+ (t, r, n, o) => r === "." && Bn(e, o) ? t : r === "?." ? `?.[${n}]` : `[${n}]`
1211
1242
  );
1212
1243
  }
1213
- function Gn(e, t) {
1244
+ function Bn(e, t) {
1214
1245
  let r = t - 1, n = !1;
1215
1246
  for (; r >= 0 && e[r] >= "0" && e[r] <= "9"; )
1216
1247
  n = !0, r--;
@@ -1219,12 +1250,12 @@ function Gn(e, t) {
1219
1250
  const o = e[r];
1220
1251
  return n ? !/[\w$.\]]/.test(o) : !/[\w$)\]]/.test(o);
1221
1252
  }
1222
- const Kn = (e) => (t, r) => {
1253
+ const Gn = (e) => (t, r) => {
1223
1254
  let n = t.formDef.states;
1224
1255
  if (!n || Object.keys(n).length === 0 || t.formHealth.status === "errored")
1225
1256
  return t;
1226
- const { $formIsInvalid: o, $errors: s } = r ?? $e(t);
1227
- n = xn(n);
1257
+ const { $formIsInvalid: o, $errors: s } = r ?? Se(t);
1258
+ n = Kn(n);
1228
1259
  let i = [], u = { status: "ok" };
1229
1260
  try {
1230
1261
  i = Object.keys(n).map((d) => {
@@ -1249,7 +1280,7 @@ const Kn = (e) => (t, r) => {
1249
1280
  }
1250
1281
  return { ...t, currentStates: i, formHealth: u };
1251
1282
  };
1252
- function xn(e) {
1283
+ function Kn(e) {
1253
1284
  const t = {};
1254
1285
  function r(n) {
1255
1286
  const o = n.split(":"), s = [];
@@ -1272,35 +1303,35 @@ function vt(e) {
1272
1303
  const t = Object.getPrototypeOf(e);
1273
1304
  return t === Object.prototype || t === null;
1274
1305
  }
1275
- function me(e, t) {
1306
+ function ge(e, t) {
1276
1307
  if (e === t)
1277
1308
  return !0;
1278
1309
  if (Array.isArray(e) && Array.isArray(t))
1279
- return e.length === t.length && e.every((r, n) => me(r, t[n]));
1310
+ return e.length === t.length && e.every((r, n) => ge(r, t[n]));
1280
1311
  if (vt(e) && vt(t)) {
1281
1312
  const r = Object.keys(e);
1282
- return r.length !== Object.keys(t).length ? !1 : r.every((n) => n in t && me(e[n], t[n]));
1313
+ return r.length !== Object.keys(t).length ? !1 : r.every((n) => n in t && ge(e[n], t[n]));
1283
1314
  }
1284
1315
  return !1;
1285
1316
  }
1286
- const Xn = (e) => (t, r) => {
1287
- const { $formIsInvalid: n, $errors: o } = r ?? $e(t);
1317
+ const xn = (e) => (t, r) => {
1318
+ const { $formIsInvalid: n, $errors: o } = r ?? Se(t);
1288
1319
  return {
1289
1320
  ...t,
1290
- widgetFlags: Jn(t, o, n, e)
1321
+ widgetFlags: Xn(t, o, n, e)
1291
1322
  };
1292
1323
  };
1293
- function Jn(e, t, r, n) {
1324
+ function Xn(e, t, r, n) {
1294
1325
  const o = [];
1295
1326
  for (const [i, u] of Object.entries(e.resolvedSources))
1296
- if (W(u)) {
1327
+ if (T(u)) {
1297
1328
  const d = At(i, u, e);
1298
1329
  $t(d) && o.push(d);
1299
1330
  } else $t(u) && o.push(At(i, u, e));
1300
1331
  const s = o.reduce(
1301
1332
  (i, u) => {
1302
1333
  i[u.uid] = i[u.uid] || {};
1303
- const d = e.repeaterItemScopes[u.uid], l = d ? { $item: _(e.data, d.itemPath), $index: d.index, $fn: n } : { $fn: n };
1334
+ const d = e.repeaterItemScopes[u.uid], l = d ? { $item: M(e.data, d.itemPath), $index: d.index, $fn: n } : { $fn: n };
1304
1335
  return u.include && "in" in u.include ? i[u.uid].hidden = !u.include.in.some(
1305
1336
  (a) => e.currentStates.includes(a)
1306
1337
  ) : u.include && "when" in u.include && (i[u.uid].hidden = !J(
@@ -1337,12 +1368,12 @@ function Jn(e, t, r, n) {
1337
1368
  },
1338
1369
  {}
1339
1370
  );
1340
- return Qn(e, s), s;
1371
+ return Jn(e, s), s;
1341
1372
  }
1342
1373
  function $t(e) {
1343
1374
  return !!(e.include && ("in" in e.include || "when" in e.include) || e.exclude && ("from" in e.exclude || "when" in e.exclude) || (j(e) || ue(e)) && Z(e.disabled) || j(e) && Z(e.readonly));
1344
1375
  }
1345
- function Qn(e, t) {
1376
+ function Jn(e, t) {
1346
1377
  const r = Object.keys(t).filter((n) => t[n].hidden === !0);
1347
1378
  for (const n of r)
1348
1379
  nr(n, e, t);
@@ -1350,7 +1381,7 @@ function Qn(e, t) {
1350
1381
  function nr(e, t, r) {
1351
1382
  const n = t.resolvedSources[e];
1352
1383
  if (n !== void 0) {
1353
- if (Se(n) || W(n) && n.path !== void 0) {
1384
+ if (Ae(n) || T(n) && n.path !== void 0) {
1354
1385
  const o = `${n.path}.`;
1355
1386
  for (const [s, i] of Object.entries(t.repeaterItemScopes))
1356
1387
  i.itemPath.startsWith(o) && St(s, r);
@@ -1373,10 +1404,10 @@ function St(e, t) {
1373
1404
  function At(e, t, r) {
1374
1405
  const n = r.repeaterItemScopes[e];
1375
1406
  let o;
1376
- W(t) ? (o = {
1407
+ T(t) ? (o = {
1377
1408
  ...t({
1378
1409
  $form: r.data,
1379
- $item: n ? _(r.data, n.itemPath) : void 0,
1410
+ $item: n ? M(r.data, n.itemPath) : void 0,
1380
1411
  $index: n?.index,
1381
1412
  errors: void 0,
1382
1413
  touched: void 0,
@@ -1384,14 +1415,14 @@ function At(e, t, r) {
1384
1415
  })
1385
1416
  }, o.uid = e) : o = t;
1386
1417
  const s = te(e);
1387
- return s.length > 0 && (o = Br(o, s)), o;
1418
+ return s.length > 0 && (o = zr(o, s)), o;
1388
1419
  }
1389
1420
  const or = (e, t) => (r, n) => {
1390
1421
  try {
1391
- const o = n ?? $e(r);
1422
+ const o = n ?? Se(r);
1392
1423
  return {
1393
1424
  ...r,
1394
- calculatedWidgets: qn(r, e, t, o)
1425
+ calculatedWidgets: Qn(r, e, t, o)
1395
1426
  };
1396
1427
  } catch (o) {
1397
1428
  const s = o, i = s.code ?? F.calculateWidgetPropsError;
@@ -1405,18 +1436,18 @@ const or = (e, t) => (r, n) => {
1405
1436
  };
1406
1437
  }
1407
1438
  };
1408
- function qn(e, t, r, { $formIsInvalid: n, $errors: o }) {
1409
- const s = yo(e, t, n, o, r), i = {};
1439
+ function Qn(e, t, r, { $formIsInvalid: n, $errors: o }) {
1440
+ const s = go(e, t, n, o, r), i = {};
1410
1441
  for (const u of Object.keys(e.calculatedWidgets)) {
1411
1442
  if (e.widgetFlags[u]?.hidden)
1412
1443
  continue;
1413
1444
  const d = e.calculatedWidgets[u], l = d.source, a = e.repeaterItemScopes[u];
1414
- if (W(l)) {
1415
- i[u] = Zn(d, u, l, e, t, a);
1445
+ if (T(l)) {
1446
+ i[u] = qn(d, u, l, e, t, a);
1416
1447
  continue;
1417
1448
  }
1418
- const p = a ? { ...s, $item: _(s.$form, a.itemPath), $index: a.index } : s;
1419
- i[u] = Yn(
1449
+ const p = a ? { ...s, $item: M(s.$form, a.itemPath), $index: a.index } : s;
1450
+ i[u] = Zn(
1420
1451
  d,
1421
1452
  l,
1422
1453
  e,
@@ -1425,63 +1456,63 @@ function qn(e, t, r, { $formIsInvalid: n, $errors: o }) {
1425
1456
  }
1426
1457
  return i;
1427
1458
  }
1428
- function Zn(e, t, r, n, o, s) {
1459
+ function qn(e, t, r, n, o, s) {
1429
1460
  const i = {
1430
1461
  ...r({
1431
1462
  $form: n.data,
1432
1463
  errors: r.path ? n.validations[r.path] : void 0,
1433
1464
  touched: r.path ? n.touchedControls[r.path] : void 0,
1434
1465
  translate: o.translate,
1435
- $item: s ? _(n.data, s.itemPath) : void 0,
1466
+ $item: s ? M(n.data, s.itemPath) : void 0,
1436
1467
  $index: s?.index
1437
1468
  })
1438
1469
  };
1439
1470
  i.uid = t, r.path !== void 0 && (i.path = r.path);
1440
1471
  const u = n.widgetPropOverrides[t];
1441
- return u !== void 0 && (i.props = { ...i.props, ...u }), e.current && me(e.current, i) ? e : { source: r, current: i };
1472
+ return u !== void 0 && (i.props = { ...i.props, ...u }), e.current && ge(e.current, i) ? e : { source: r, current: i };
1442
1473
  }
1443
- function Yn(e, t, r, n) {
1444
- const o = new go(t, e.current);
1445
- return o.write("uid", t.uid), o.write("type", t.type), o.write("kind", t.kind), Cr(t) ? eo(o, n) : ue(t) ? to(o, n) : j(t) ? ro(o, n) : H(t) && no(o, n), oo(t, o, n, r), (ue(t) || j(t)) && so(t, o, n), H(t) && io(t, o, r), o.changed ? { source: e.source, current: o.current } : e;
1474
+ function Zn(e, t, r, n) {
1475
+ const o = new mo(t, e.current);
1476
+ return o.write("uid", t.uid), o.write("type", t.type), o.write("kind", t.kind), Or(t) ? Yn(o, n) : ue(t) ? eo(o, n) : j(t) ? to(o, n) : H(t) && ro(o, n), no(t, o, n, r), (ue(t) || j(t)) && oo(t, o, n), H(t) && so(t, o, r), o.changed ? { source: e.source, current: o.current } : e;
1446
1477
  }
1447
- function eo(e, t) {
1478
+ function Yn(e, t) {
1448
1479
  A(e, t, "size"), A(e, t, "include"), A(e, t, "exclude");
1449
1480
  }
1450
- function to(e, t) {
1481
+ function eo(e, t) {
1451
1482
  A(e, t, "size"), A(e, t, "include"), A(e, t, "exclude"), A(e, t, "label"), A(e, t, "disabled"), A(e, t, "actionType");
1452
1483
  }
1453
- function ro(e, t) {
1484
+ function to(e, t) {
1454
1485
  A(e, t, "size"), A(e, t, "include"), A(e, t, "exclude"), A(e, t, "label"), A(e, t, "disabled"), A(e, t, "readonly"), A(e, t, "validator"), A(e, t, "path"), A(e, t, "defaultValue");
1455
1486
  }
1456
- function no(e, t) {
1487
+ function ro(e, t) {
1457
1488
  A(e, t, "size"), A(e, t, "include"), A(e, t, "exclude");
1458
1489
  }
1459
- function oo(e, t, r, n) {
1490
+ function no(e, t, r, n) {
1460
1491
  const o = n.widgetPropOverrides[e.uid] ?? {}, s = { ...e.props ?? {}, ...o };
1461
1492
  for (const i of ur(Object.keys(s)))
1462
- uo(t, r, i);
1493
+ io(t, r, i);
1463
1494
  }
1464
- function so(e, t, r) {
1495
+ function oo(e, t, r) {
1465
1496
  const n = e.on ?? {};
1466
1497
  for (const o of ur(Object.keys(n)))
1467
- co(t, r, o);
1498
+ uo(t, r, o);
1468
1499
  }
1469
- function io(e, t, r) {
1470
- const n = te(e.uid), o = $o(e.children, n, r.widgetFlags);
1500
+ function so(e, t, r) {
1501
+ const n = te(e.uid), o = vo(e.children, n, r.widgetFlags);
1471
1502
  t.current.children = o;
1472
1503
  const s = t.previous.children ?? [];
1473
1504
  s.length === o.length && o.every((u, d) => s[d] && s[d].uid === o[d].uid) || t.markChanged();
1474
1505
  }
1475
1506
  function A(e, t, r) {
1476
1507
  const n = e.source;
1477
- if (!vo(n, r))
1508
+ if (!yo(n, r))
1478
1509
  return;
1479
1510
  const o = st(n, r, t.sortedStates);
1480
1511
  let s;
1481
1512
  switch (r) {
1482
1513
  case "disabled":
1483
1514
  case "readonly":
1484
- s = fo(o, t, e.source.uid, r);
1515
+ s = ao(o, t, e.source.uid, r);
1485
1516
  break;
1486
1517
  case "defaultValue":
1487
1518
  s = o;
@@ -1491,15 +1522,15 @@ function A(e, t, r) {
1491
1522
  }
1492
1523
  e.write(r, s);
1493
1524
  }
1494
- function uo(e, t, r) {
1525
+ function io(e, t, r) {
1495
1526
  const n = e.source.props, o = st(n, r, t.sortedStates);
1496
1527
  let s = ir(o, t);
1497
1528
  const i = t.widgetPropOverrides[e.source.uid]?.[r];
1498
1529
  i !== void 0 && (s = i), e.write(`props.${r}`, s);
1499
1530
  }
1500
- function co(e, t, r) {
1531
+ function uo(e, t, r) {
1501
1532
  const n = e.source.on, o = st(n, r, t.sortedStates);
1502
- e.write(`on.${r}`, po(o, t));
1533
+ e.write(`on.${r}`, fo(o, t));
1503
1534
  }
1504
1535
  function ot(e, t) {
1505
1536
  return e({
@@ -1509,12 +1540,12 @@ function ot(e, t) {
1509
1540
  $index: t.$index
1510
1541
  });
1511
1542
  }
1512
- function lo(e, t) {
1513
- return t.localization.translate(e.key, mo(e.params, t), e.default);
1543
+ function co(e, t) {
1544
+ return t.localization.translate(e.key, ho(e.params, t), e.default);
1514
1545
  }
1515
- const ao = /\{\{([^}]+)\}\}/g;
1546
+ const lo = /\{\{([^}]+)\}\}/g;
1516
1547
  function sr(e, t) {
1517
- return e.includes("{{") ? e.replace(ao, (r, n) => {
1548
+ return e.includes("{{") ? e.replace(lo, (r, n) => {
1518
1549
  try {
1519
1550
  const o = nt(n.trim())({
1520
1551
  $form: t.$form,
@@ -1533,12 +1564,12 @@ function sr(e, t) {
1533
1564
  }) : e;
1534
1565
  }
1535
1566
  function ir(e, t) {
1536
- return typeof e == "function" ? ot(e, t) : Rr(e) ? lo(e, t) : typeof e == "string" ? sr(e, t) : e;
1567
+ return typeof e == "function" ? ot(e, t) : Vr(e) ? co(e, t) : typeof e == "string" ? sr(e, t) : e;
1537
1568
  }
1538
- function fo(e, t, r, n) {
1569
+ function ao(e, t, r, n) {
1539
1570
  return typeof e == "function" ? ot(e, t) : Z(e) ? t.widgetFlags[r]?.[n] : typeof e == "string" ? sr(e, t) : e;
1540
1571
  }
1541
- function po(e, t) {
1572
+ function fo(e, t) {
1542
1573
  return typeof e == "function" ? ot(e, t) : e;
1543
1574
  }
1544
1575
  function st(e, t, r) {
@@ -1551,13 +1582,13 @@ function st(e, t, r) {
1551
1582
  return e[t];
1552
1583
  }
1553
1584
  }
1554
- function ho(e) {
1585
+ function po(e) {
1555
1586
  return e.startsWith("$form") || e.startsWith("$meta") || e.startsWith("$errors") || e.startsWith("$item") || e.startsWith("$index") || e.startsWith("$fn") || e === "$formIsInvalid";
1556
1587
  }
1557
- function mo(e, t) {
1588
+ function ho(e, t) {
1558
1589
  return e && Object.keys(e).reduce((r, n) => {
1559
1590
  const o = String(e[n]);
1560
- if (ho(o))
1591
+ if (po(o))
1561
1592
  try {
1562
1593
  const s = nt(o)({
1563
1594
  $form: t.$form,
@@ -1578,7 +1609,7 @@ function mo(e, t) {
1578
1609
  return r;
1579
1610
  }, {});
1580
1611
  }
1581
- class go {
1612
+ class mo {
1582
1613
  constructor(t, r) {
1583
1614
  this._changed = !1, this.source = t, this.previous = r, this.current = {};
1584
1615
  }
@@ -1589,15 +1620,15 @@ class go {
1589
1620
  this._changed = !0;
1590
1621
  }
1591
1622
  write(t, r) {
1592
- const n = _(this.previous, t);
1593
- if (me(n, r)) {
1594
- We(this.current, t, n);
1623
+ const n = M(this.previous, t);
1624
+ if (ge(n, r)) {
1625
+ De(this.current, t, n);
1595
1626
  return;
1596
1627
  }
1597
- We(this.current, t, r), this._changed = !0;
1628
+ De(this.current, t, r), this._changed = !0;
1598
1629
  }
1599
1630
  }
1600
- function yo(e, t, r, n, o) {
1631
+ function go(e, t, r, n, o) {
1601
1632
  return {
1602
1633
  sortedStates: [...e.currentStates].sort((s, i) => i.length - s.length),
1603
1634
  widgetPropOverrides: e.widgetPropOverrides,
@@ -1610,7 +1641,7 @@ function yo(e, t, r, n, o) {
1610
1641
  $fn: o
1611
1642
  };
1612
1643
  }
1613
- function vo(e, t) {
1644
+ function yo(e, t) {
1614
1645
  if (t in e)
1615
1646
  return !0;
1616
1647
  const r = `${t}.`;
@@ -1619,7 +1650,7 @@ function vo(e, t) {
1619
1650
  function ur(e) {
1620
1651
  return Array.from(new Set(e.map((t) => t.split(".")[0])));
1621
1652
  }
1622
- function $o(e, t, r) {
1653
+ function vo(e, t, r) {
1623
1654
  const n = t.map((o) => `[${o}]`).join("");
1624
1655
  return e.filter((o) => {
1625
1656
  const s = o.uid + n, i = r[s];
@@ -1631,8 +1662,8 @@ class cr extends Error {
1631
1662
  super(...arguments), this.code = F.resolveStringInterpolationError, this.name = "StringInterpolationError";
1632
1663
  }
1633
1664
  }
1634
- const So = (e) => {
1635
- const t = Ao(e.resolvedSources), r = se(
1665
+ const $o = (e) => {
1666
+ const t = So(e.resolvedSources), r = se(
1636
1667
  e.widgetPropOverrides,
1637
1668
  (i) => i in e.resolvedSources
1638
1669
  ), n = se(e.touchedControls, (i) => t.has(i)), o = se(e.validations, (i) => t.has(i)), s = se(
@@ -1641,10 +1672,10 @@ const So = (e) => {
1641
1672
  );
1642
1673
  return r === e.widgetPropOverrides && n === e.touchedControls && o === e.validations && s === e.injectedValidations ? e : { ...e, widgetPropOverrides: r, touchedControls: n, validations: o, injectedValidations: s };
1643
1674
  };
1644
- function Ao(e) {
1675
+ function So(e) {
1645
1676
  const t = /* @__PURE__ */ new Set();
1646
1677
  for (const r of Object.values(e)) {
1647
- const n = V(r);
1678
+ const n = R(r);
1648
1679
  n !== void 0 && t.add(n);
1649
1680
  }
1650
1681
  return t;
@@ -1658,7 +1689,7 @@ function se(e, t) {
1658
1689
  n[o] = e[o];
1659
1690
  return n;
1660
1691
  }
1661
- const Eo = (e) => {
1692
+ const Ao = (e) => {
1662
1693
  const t = Object.keys(e.resolvedSources), r = {};
1663
1694
  let n = t.length !== Object.keys(e.calculatedWidgets).length;
1664
1695
  for (const o of t) {
@@ -1669,9 +1700,9 @@ const Eo = (e) => {
1669
1700
  }, n = !0);
1670
1701
  }
1671
1702
  return n ? { ...e, calculatedWidgets: r } : e;
1672
- }, wo = ({ lang: e }, t) => {
1703
+ }, Eo = ({ lang: e }, t) => {
1673
1704
  const r = {
1674
- ...Dt(e),
1705
+ ...Wt(e),
1675
1706
  formName: t.payload.formName
1676
1707
  };
1677
1708
  let n = t.payload.formDef, o = { status: "ok" };
@@ -1717,17 +1748,17 @@ const Eo = (e) => {
1717
1748
  {}
1718
1749
  );
1719
1750
  } catch (p) {
1720
- o = Io(p.existingWidget, p.newWidget), a = {};
1751
+ o = Co(p.existingWidget, p.newWidget), a = {};
1721
1752
  }
1722
- return ko(a, i.value.states), {
1753
+ return Io(a, i.value.states), {
1723
1754
  ...r,
1724
1755
  formDef: i.value,
1725
1756
  flatForm: a,
1726
- ...Ne(a, {}),
1757
+ ...Te(a, {}),
1727
1758
  formHealth: o
1728
1759
  };
1729
1760
  }
1730
- const u = Co(n);
1761
+ const u = Oo(n);
1731
1762
  if (u)
1732
1763
  return { ...r, formHealth: u };
1733
1764
  const d = F.initializeUnknownError, l = i.issues.map((a) => `${a.path.length > 0 ? kt(a.path) : "root"}: ${a.message}`).join("; ");
@@ -1743,20 +1774,20 @@ const Eo = (e) => {
1743
1774
  function dr(e, t) {
1744
1775
  return { status: "errored", code: e, message: `[${e}] ${t}` };
1745
1776
  }
1746
- function Oo() {
1777
+ function wo() {
1747
1778
  return "Malformed form definition. Pass it directly as formDef - `config={{ formDef: { states, form: [...] } }}`. Do NOT wrap it in an extra `{ form: ... }`.";
1748
1779
  }
1749
- function Co(e) {
1780
+ function Oo(e) {
1750
1781
  if (!e || typeof e != "object" || Array.isArray(e))
1751
1782
  return null;
1752
1783
  const t = e.form;
1753
- return t && typeof t == "object" && !Array.isArray(t) && !H(t) ? dr(F.initializeMalformedFormShapeError, Oo()) : null;
1784
+ return t && typeof t == "object" && !Array.isArray(t) && !H(t) ? dr(F.initializeMalformedFormShapeError, wo()) : null;
1754
1785
  }
1755
- function Io(e, t) {
1786
+ function Co(e, t) {
1756
1787
  const r = (o) => j(o) ? ` at "${o.path}"` : "", n = `Duplicate UID "${t.uid}": Assigned to widget "${e.type}"${r(e)} and "${t.type}"${r(t)}.`;
1757
1788
  return dr(F.initializeUidCollisionError, n);
1758
1789
  }
1759
- function ko(e, t) {
1790
+ function Io(e, t) {
1760
1791
  const r = new Set(Object.keys(t ?? {})), n = /* @__PURE__ */ new Map();
1761
1792
  for (const s of Object.values(e)) {
1762
1793
  const i = [], u = s.include;
@@ -1778,7 +1809,7 @@ function ko(e, t) {
1778
1809
  `[GolemUI] include/exclude references undefined state "${s}" (on ${i.join(", ")}); these widgets will stay hidden. Declared states: ${o}. Fix: declare "${s}" in formConfig.states, or correct the name.`
1779
1810
  );
1780
1811
  }
1781
- function jo(e, t) {
1812
+ function ko(e, t) {
1782
1813
  const { path: r, issues: n } = t.payload, o = n?.length ? {
1783
1814
  touched: !0,
1784
1815
  touchedControls: { ...e.touchedControls, [r]: !0 }
@@ -1792,8 +1823,8 @@ function jo(e, t) {
1792
1823
  }
1793
1824
  };
1794
1825
  }
1795
- const Po = (e, { payload: t }) => {
1796
- const r = "path" in t ? Do(e, t.path) : Fo(e, t.uid);
1826
+ const jo = (e, { payload: t }) => {
1827
+ const r = "path" in t ? Fo(e, t.path) : Po(e, t.uid);
1797
1828
  if (r === void 0)
1798
1829
  return e;
1799
1830
  const n = e.widgetPropOverrides[r] || {};
@@ -1805,19 +1836,19 @@ const Po = (e, { payload: t }) => {
1805
1836
  }
1806
1837
  };
1807
1838
  };
1808
- function Fo(e, t) {
1839
+ function Po(e, t) {
1809
1840
  if (t in e.resolvedSources)
1810
1841
  return t;
1811
1842
  console.warn(`Widget with uid "${t}" not found`);
1812
1843
  }
1813
- function Do(e, t) {
1844
+ function Fo(e, t) {
1814
1845
  const r = Object.values(e.calculatedWidgets).find(
1815
- ({ source: o, current: s }) => (V(s) ?? V(o)) === t
1846
+ ({ source: o, current: s }) => (R(s) ?? R(o)) === t
1816
1847
  );
1817
1848
  if (r)
1818
1849
  return r.source.uid;
1819
1850
  const n = Object.keys(e.resolvedSources).find(
1820
- (o) => V(e.resolvedSources[o]) === t
1851
+ (o) => R(e.resolvedSources[o]) === t
1821
1852
  );
1822
1853
  if (n !== void 0)
1823
1854
  return n;
@@ -1826,20 +1857,20 @@ function Do(e, t) {
1826
1857
  const Wo = (e, t) => ({
1827
1858
  ...e,
1828
1859
  data: { ...t.payload.data }
1829
- }), No = (e, t) => ({
1860
+ }), Do = (e, t) => ({
1830
1861
  ...e,
1831
1862
  formHealth: t.payload.formHealth
1832
1863
  }), To = (e, t) => ({
1833
1864
  ...e,
1834
1865
  lang: t.payload.lang
1835
- }), Vo = (e, t) => ({
1866
+ }), No = (e, t) => ({
1836
1867
  ...e,
1837
1868
  meta: { ...t.payload.meta }
1838
- }), Ro = (e, t) => ({
1869
+ }), Vo = (e, t) => ({
1839
1870
  ...e,
1840
- data: Wt(e.data, t.payload.path, t.payload.data)
1871
+ data: Dt(e.data, t.payload.path, t.payload.data)
1841
1872
  }), lr = /* @__PURE__ */ Symbol("filterMap.skip");
1842
- function _o(e, t) {
1873
+ function Ro(e, t) {
1843
1874
  const r = [];
1844
1875
  for (let n = 0; n < e.length; n++) {
1845
1876
  const o = t(e[n], n, e);
@@ -1860,7 +1891,7 @@ function Lo(e, t, r) {
1860
1891
  return !0;
1861
1892
  }
1862
1893
  const Mo = (e, t) => (r) => {
1863
- const n = _o(
1894
+ const n = Ro(
1864
1895
  Object.values(r.calculatedWidgets),
1865
1896
  ({ current: s }) => j(s) ? s : lr
1866
1897
  ), o = r.validations;
@@ -1869,7 +1900,7 @@ const Mo = (e, t) => (r) => {
1869
1900
  validations: n.reduce(
1870
1901
  (s, i) => {
1871
1902
  if (s[i.path] = null, i.validator) {
1872
- const u = e(i.validator, t), d = _(r.data, i.path), l = gr(
1903
+ const u = e(i.validator, t), d = M(r.data, i.path), l = gr(
1873
1904
  u,
1874
1905
  d
1875
1906
  );
@@ -1884,38 +1915,38 @@ const Mo = (e, t) => (r) => {
1884
1915
  {}
1885
1916
  )
1886
1917
  };
1887
- }, Uo = ({
1918
+ }, _o = ({
1888
1919
  validators: e,
1889
1920
  validateOn: t,
1890
1921
  localization: r,
1891
1922
  functions: n
1892
1923
  }) => {
1893
- const o = zo(r, n), s = Mo(e, r), i = or(r, n), u = (l) => Et(l, o, s, !1), d = (l) => Et(l, o, s, !0);
1924
+ const o = bo(r, n), s = Mo(e, r), i = or(r, n), u = (l) => Et(l, o, s, !1), d = (l) => Et(l, o, s, !0);
1894
1925
  return (l, a) => {
1895
1926
  switch (a.type) {
1896
1927
  case "INITIALIZE":
1897
- return wo(l, a);
1928
+ return Eo(l, a);
1898
1929
  case "SET_DATA":
1899
1930
  return u(Wo(l, a));
1900
1931
  case "SET_META":
1901
- return u(Vo(l, a));
1932
+ return u(No(l, a));
1902
1933
  case "SET_WIDGET_DATA":
1903
- return u(Ro(l, a));
1934
+ return u(Vo(l, a));
1904
1935
  case "SET_LANGUAGE":
1905
1936
  return i(To(l, a));
1906
1937
  case "OVERRIDE_WIDGET_PROP": {
1907
- const p = Po(l, a);
1938
+ const p = jo(l, a);
1908
1939
  if (p === l)
1909
1940
  return l;
1910
1941
  const g = u(p);
1911
- return xo(g, a) ? s(g) : g;
1942
+ return Ko(g, a) ? s(g) : g;
1912
1943
  }
1913
1944
  case "SET_FORM_HEALTH":
1914
- return No(l, a);
1945
+ return Do(l, a);
1915
1946
  case "VALIDATE_ALL":
1916
- return d(s(Go(l)));
1947
+ return d(s(Bo(l)));
1917
1948
  case "ATTEMPT_VALIDATION": {
1918
- if (!Ko(t, a.payload.reason))
1949
+ if (!Go(t, a.payload.reason))
1919
1950
  return l;
1920
1951
  const p = {
1921
1952
  ...l,
@@ -1925,28 +1956,28 @@ const Mo = (e, t) => (r) => {
1925
1956
  return d(s(p));
1926
1957
  }
1927
1958
  case "INJECT_VALIDATION_ISSUES":
1928
- return jo(l, a);
1959
+ return ko(l, a);
1929
1960
  default:
1930
1961
  return Lr(a);
1931
1962
  }
1932
1963
  };
1933
- }, Ho = /* @__PURE__ */ new Set([
1964
+ }, Uo = /* @__PURE__ */ new Set([
1934
1965
  F.calculateCurrentStateError,
1935
1966
  F.calculateWidgetFlagsError,
1936
1967
  F.calculateWidgetPropsError,
1937
1968
  F.resolveStringInterpolationError
1938
- ]), bo = (e) => e.formHealth.status === "errored" && !Ho.has(e.formHealth.code);
1939
- function zo(e, t) {
1940
- const r = Kn(t), n = Xn(t), o = or(e, t);
1969
+ ]), Ho = (e) => e.formHealth.status === "errored" && !Uo.has(e.formHealth.code);
1970
+ function bo(e, t) {
1971
+ const r = Gn(t), n = xn(t), o = or(e, t);
1941
1972
  return function(i) {
1942
- if (bo(i))
1973
+ if (Ho(i))
1943
1974
  return i;
1944
1975
  const u = (d) => ({ ...i, formHealth: d });
1945
1976
  try {
1946
1977
  let d = i.formHealth.status === "ok" ? i : { ...i, formHealth: { status: "ok" } };
1947
- d = Kr(d), d = So(d);
1948
- const l = $e(d);
1949
- return d = r(d, l), d.formHealth.status !== "ok" ? u(d.formHealth) : (d = n(d, l), d = Eo(d), d = o(d, l), d.formHealth.status === "ok" ? d : u(d.formHealth));
1978
+ d = Gr(d), d = $o(d);
1979
+ const l = Se(d);
1980
+ return d = r(d, l), d.formHealth.status !== "ok" ? u(d.formHealth) : (d = n(d, l), d = Ao(d), d = o(d, l), d.formHealth.status === "ok" ? d : u(d.formHealth));
1950
1981
  } catch (d) {
1951
1982
  const l = F.calculateWidgetFlagsError;
1952
1983
  return u({
@@ -1962,7 +1993,7 @@ function Et(e, t, r, n) {
1962
1993
  let u = t(e);
1963
1994
  if (!u.allControlsValidated || u.formHealth.status !== "ok")
1964
1995
  return o(u);
1965
- const d = Bo(u, s, i);
1996
+ const d = zo(u, s, i);
1966
1997
  if (d.length === 0)
1967
1998
  return o(u);
1968
1999
  const l = { ...u.touchedControls };
@@ -1970,10 +2001,10 @@ function Et(e, t, r, n) {
1970
2001
  l[a] = !0;
1971
2002
  return u = { ...u, touchedControls: l }, wt(t(r(u)));
1972
2003
  }
1973
- function Bo(e, t, r) {
2004
+ function zo(e, t, r) {
1974
2005
  const n = [];
1975
2006
  for (const [o, s] of Object.entries(e.resolvedSources)) {
1976
- const i = V(s);
2007
+ const i = R(s);
1977
2008
  if (i === void 0 || e.widgetFlags[o]?.hidden === !0 || e.touchedControls[i] === !0)
1978
2009
  continue;
1979
2010
  const u = t[o] === void 0, d = r[o]?.hidden === !0;
@@ -1981,18 +2012,18 @@ function Bo(e, t, r) {
1981
2012
  }
1982
2013
  return n;
1983
2014
  }
1984
- function Go(e) {
2015
+ function Bo(e) {
1985
2016
  const t = {};
1986
2017
  for (const { source: r, current: n } of Object.values(e.calculatedWidgets)) {
1987
- const o = V(n) ?? V(r);
2018
+ const o = R(n) ?? R(r);
1988
2019
  o !== void 0 && (t[o] = !0);
1989
2020
  }
1990
2021
  return { ...e, touched: !0, allControlsValidated: !0, touchedControls: t };
1991
2022
  }
1992
- function Ko(e, t) {
2023
+ function Go(e, t) {
1993
2024
  return e === "eager" || t === e || Array.isArray(e) && e.includes(t);
1994
2025
  }
1995
- function xo(e, t) {
2026
+ function Ko(e, t) {
1996
2027
  if (!e.touched)
1997
2028
  return !1;
1998
2029
  let r;
@@ -2017,11 +2048,11 @@ function wt(e) {
2017
2048
  return Array.isArray(s) && s.length > 0;
2018
2049
  }), n !== void 0 ? { ...e, isFormValid: !1 } : { ...e, isFormValid: !0 });
2019
2050
  }
2020
- function Xo(e = [], t, r, n, o = {}) {
2021
- const s = new hr(Dt(n.lang)), i = s.asObservable().pipe(_e()), u = Uo({ validators: t, validateOn: r, localization: n, functions: o });
2051
+ function xo(e = [], t, r, n, o = {}) {
2052
+ const s = new hr(Wt(n.lang)), i = s.asObservable().pipe(Le()), u = _o({ validators: t, validateOn: r, localization: n, functions: o });
2022
2053
  function d(g) {
2023
- const I = s.getValue(), we = u(I, g);
2024
- s.next(we);
2054
+ const I = s.getValue(), Oe = u(I, g);
2055
+ s.next(Oe);
2025
2056
  }
2026
2057
  let l = d;
2027
2058
  const a = {
@@ -2037,10 +2068,10 @@ function Xo(e = [], t, r, n, o = {}) {
2037
2068
  }
2038
2069
  class as {
2039
2070
  constructor() {
2040
- this.widgetRegistry = new Fe(), this.store = {}, this.events$ = new it(), this.submit$ = new it(), this.itemRenderers = {}, this.dependencies = {};
2071
+ this.widgetRegistry = new ce(), this.store = {}, this.events$ = new it(), this.submit$ = new it(), this.itemRenderers = {}, this.dependencies = {};
2041
2072
  }
2042
- initialize(t, r = [], n, o, s, i = _r(), u, d = {}) {
2043
- this.localization = i, this.dependencies = u, this.widgetRegistry.setWidgetLoaders(t), this.itemRenderers = s, this.store = Xo(r, n, o, i, d);
2073
+ initialize(t, r = [], n, o, s, i = Rr(), u, d = {}) {
2074
+ this.localization = i, this.dependencies = u, this.widgetRegistry.setWidgetLoaders(t), this.itemRenderers = s, this.store = xo(r, n, o, i, d);
2044
2075
  }
2045
2076
  emitEvent(t, r, n) {
2046
2077
  const s = this.store.getState().currentStates.filter((i) => r.on?.[`${t}.${i}`] !== void 0);
@@ -2049,7 +2080,7 @@ class as {
2049
2080
  const u = r.on?.[`${t}.${i}`];
2050
2081
  u && this.events$.next({
2051
2082
  name: u,
2052
- data: Ce(this.store.getState()),
2083
+ data: Ie(this.store.getState()),
2053
2084
  detail: n ?? void 0,
2054
2085
  callback: (d) => {
2055
2086
  this.store.dispatch(d);
@@ -2060,7 +2091,7 @@ class as {
2060
2091
  const i = r.on?.[t];
2061
2092
  i && this.events$.next({
2062
2093
  name: i,
2063
- data: Ce(this.store.getState()),
2094
+ data: Ie(this.store.getState()),
2064
2095
  detail: n,
2065
2096
  callback: (u) => {
2066
2097
  this.store.dispatch(u);
@@ -2072,7 +2103,7 @@ class as {
2072
2103
  this.store.dispatch({
2073
2104
  type: "VALIDATE_ALL"
2074
2105
  }), this.store.getState().isFormValid && this.submit$.next({
2075
- data: Ce(this.store.getState()),
2106
+ data: Ie(this.store.getState()),
2076
2107
  callback: (t) => {
2077
2108
  this.store.dispatch(t);
2078
2109
  }
@@ -2099,37 +2130,37 @@ function fs(e = "GolemUI Form Store") {
2099
2130
  };
2100
2131
  };
2101
2132
  }
2102
- const Jo = mr(
2133
+ const Xo = mr(
2103
2134
  Ct((e) => e.formHealth),
2104
- _e((e, t) => e.status !== t.status ? !1 : e.status === "errored" && t.status === "errored" ? e.message === t.message && e.code === t.code : !0)
2105
- ), ps = (e) => e.pipe(Jo);
2135
+ Le((e, t) => e.status !== t.status ? !1 : e.status === "errored" && t.status === "errored" ? e.message === t.message && e.code === t.code : !0)
2136
+ ), ps = (e) => e.pipe(Xo);
2106
2137
  function hs(e, t) {
2107
2138
  return fr(e, t, ar(e, t), void 0);
2108
2139
  }
2109
- function Qo() {
2140
+ function Jo() {
2110
2141
  const e = /* @__PURE__ */ new Map();
2111
2142
  return (t, r) => {
2112
2143
  const n = ar(t, r), o = e.get(r);
2113
- if (o && Yo(o.slices, n))
2144
+ if (o && Zo(o.slices, n))
2114
2145
  return o.viewModel;
2115
2146
  const s = fr(t, r, n, o);
2116
2147
  return e.set(r, { slices: n, viewModel: s }), s;
2117
2148
  };
2118
2149
  }
2119
2150
  const ms = (e) => (t) => {
2120
- const r = Qo();
2151
+ const r = Jo();
2121
2152
  return t.pipe(
2122
2153
  Ct((n) => r(n, e)),
2123
2154
  // The reader returns the same object while nothing changed, so reference equality is enough.
2124
- _e()
2155
+ Le()
2125
2156
  );
2126
- }, qo = [], Ot = [], Zo = [];
2157
+ }, Qo = [], Ot = [], qo = [];
2127
2158
  function ar(e, t) {
2128
- const r = es(e, t);
2159
+ const r = Yo(e, t);
2129
2160
  return [
2130
2161
  e.calculatedWidgets[t],
2131
2162
  e.lang,
2132
- r === void 0 ? void 0 : _(e.data, r),
2163
+ r === void 0 ? void 0 : M(e.data, r),
2133
2164
  r !== void 0 && e.touched ? e.validations[r] : null,
2134
2165
  r !== void 0 && e.touched ? e.injectedValidations[r] : null,
2135
2166
  r !== void 0 && e.touchedControls[r] === !0,
@@ -2137,41 +2168,41 @@ function ar(e, t) {
2137
2168
  e.widgetFlags[t]?.hidden === !0
2138
2169
  ];
2139
2170
  }
2140
- function Yo(e, t) {
2171
+ function Zo(e, t) {
2141
2172
  return e.every((r, n) => Object.is(r, t[n]));
2142
2173
  }
2143
2174
  function fr(e, t, r, n) {
2144
- const [o, s, i, u, d, l, a, p] = r, g = n === void 0 || !Object.is(n.slices[0], o), I = n === void 0 || !Object.is(n.slices[2], i), we = n === void 0 || !Object.is(n.slices[3], u) || !Object.is(n.slices[4], d), Oe = o?.current;
2175
+ const [o, s, i, u, d, l, a, p] = r, g = n === void 0 || !Object.is(n.slices[0], o), I = n === void 0 || !Object.is(n.slices[2], i), Oe = n === void 0 || !Object.is(n.slices[3], u) || !Object.is(n.slices[4], d), Ce = o?.current;
2145
2176
  return {
2146
2177
  uid: t,
2147
- widget: Oe,
2148
- children: g ? ts(e, t, Oe) : n.viewModel.children,
2149
- rows: g || I ? rs(e, t, Oe, i) : n.viewModel.rows,
2178
+ widget: Ce,
2179
+ children: g ? es(e, t, Ce) : n.viewModel.children,
2180
+ rows: g || I ? ts(e, t, Ce, i) : n.viewModel.rows,
2150
2181
  lang: s,
2151
2182
  value: i,
2152
- errors: we ? ns(u, d) : n.viewModel.errors,
2183
+ errors: Oe ? rs(u, d) : n.viewModel.errors,
2153
2184
  touched: l,
2154
2185
  formInvalid: a,
2155
2186
  hidden: p
2156
2187
  };
2157
2188
  }
2158
- function es(e, t) {
2189
+ function Yo(e, t) {
2159
2190
  return e.resolvedSources[t]?.path;
2160
2191
  }
2161
- function ts(e, t, r) {
2192
+ function es(e, t, r) {
2162
2193
  if (r === void 0 || !H(r))
2163
- return qo;
2194
+ return Qo;
2164
2195
  const n = r.children, o = te(t);
2165
2196
  if (o.length === 0)
2166
2197
  return n;
2167
2198
  const s = o.map((i) => `[${i}]`).join("");
2168
2199
  return n.map((i) => e.resolvedSources[`${i.uid}${s}`] ?? i);
2169
2200
  }
2170
- function rs(e, t, r, n) {
2201
+ function ts(e, t, r, n) {
2171
2202
  if (r === void 0 || !Array.isArray(n))
2172
2203
  return Ot;
2173
2204
  const o = e.resolvedSources[t];
2174
- if (o === void 0 || !Se(o))
2205
+ if (o === void 0 || !Ae(o))
2175
2206
  return Ot;
2176
2207
  const s = o.props.template.uid, i = te(t);
2177
2208
  return n.map((u, d) => {
@@ -2179,18 +2210,18 @@ function rs(e, t, r, n) {
2179
2210
  return e.resolvedSources[l];
2180
2211
  }).filter((u) => u !== void 0);
2181
2212
  }
2182
- function ns(e, t) {
2183
- return (e?.length ?? 0) + (t?.length ?? 0) === 0 ? Zo : [...e ?? [], ...t ?? []];
2213
+ function rs(e, t) {
2214
+ return (e?.length ?? 0) + (t?.length ?? 0) === 0 ? qo : [...e ?? [], ...t ?? []];
2184
2215
  }
2185
2216
  let pr = !1;
2186
2217
  function gs() {
2187
2218
  pr = !0;
2188
2219
  }
2189
- function os() {
2220
+ function ns() {
2190
2221
  return pr;
2191
2222
  }
2192
2223
  function ys(e, t, r) {
2193
- if (!os())
2224
+ if (!ns())
2194
2225
  return;
2195
2226
  const n = Object.keys(t ?? {}).filter((o) => o in r);
2196
2227
  if (n.length > 0)
@@ -2198,11 +2229,12 @@ function ys(e, t, r) {
2198
2229
  `[GolemUI] Widget "${e}": prop keys [${n.join(", ")}] collide with widget fields`
2199
2230
  );
2200
2231
  }
2232
+ const vs = () => crypto.randomUUID().slice(0, 8);
2201
2233
  export {
2202
2234
  as as FormContext,
2203
2235
  ys as assertNoPropCollisions,
2204
- ce as cloneObject,
2205
- Qo as createWidgetViewModelReader,
2236
+ de as cloneObject,
2237
+ Jo as createWidgetViewModelReader,
2206
2238
  us as defineForm,
2207
2239
  fs as devToolsMiddleware,
2208
2240
  gs as enableDevMode,
@@ -2211,10 +2243,11 @@ export {
2211
2243
  cs as formEventNames,
2212
2244
  ps as formHealth,
2213
2245
  ds as getDirectionFromLanguage,
2214
- _r as identityTranslator,
2246
+ Rr as identityTranslator,
2215
2247
  yr as isStandardValidateSuccess,
2216
2248
  Vt as makeRepeaterItemConfig,
2217
- Or as shortUUID,
2249
+ is as preloadFormWidgets,
2250
+ vs as shortUUID,
2218
2251
  gr as standardValidate,
2219
2252
  hs as widgetViewModel,
2220
2253
  ms as widgetViewModel$