@golemui/core 1.1.0 → 1.1.1-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/CHANGELOG.md +26 -0
- package/index.d.ts +1 -0
- package/index.js +453 -437
- package/index.umd.cjs +6 -6
- package/internals.d.ts +1 -2
- package/lib/context/widget-registry.d.ts +3 -1
- package/lib/context/with-widget.type.d.ts +4 -1
- package/lib/shared.d.ts +11 -2
- package/lib/utils/deterministic-uids.d.ts +19 -0
- package/package.json +4 -1
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BehaviorSubject as or, distinctUntilChanged as k, Subject as
|
|
1
|
+
import { BehaviorSubject as or, distinctUntilChanged as k, Subject as dt, pipe as T, map as W, filter as $e, combineLatest as sr, startWith as ir } from "rxjs";
|
|
2
2
|
import "@standard-schema/spec";
|
|
3
3
|
function ur(e, t) {
|
|
4
4
|
const r = e["~standard"].validate(t);
|
|
@@ -20,13 +20,13 @@ var cr = class {
|
|
|
20
20
|
isOk() {
|
|
21
21
|
return !0;
|
|
22
22
|
}
|
|
23
|
-
}, lr = class
|
|
23
|
+
}, lr = class At {
|
|
24
24
|
issues;
|
|
25
25
|
constructor(t) {
|
|
26
26
|
this.issues = t;
|
|
27
27
|
}
|
|
28
28
|
map(t) {
|
|
29
|
-
return new
|
|
29
|
+
return new At(this.issues);
|
|
30
30
|
}
|
|
31
31
|
isOk() {
|
|
32
32
|
return !1;
|
|
@@ -38,11 +38,11 @@ function F(e) {
|
|
|
38
38
|
function E(e) {
|
|
39
39
|
return new lr(e);
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function St(e) {
|
|
42
42
|
return e.reduce((t, r) => typeof r == "number" ? `${t}[${r}]` : t.length === 0 ? String(r) : `${t}.${r}`, "");
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
return e.map((t) => t.path.length === 0 ? t.message : `${
|
|
44
|
+
function ct(e) {
|
|
45
|
+
return e.map((t) => t.path.length === 0 ? t.message : `${St(t.path)}: ${t.message}`).join("; ");
|
|
46
46
|
}
|
|
47
47
|
var C = class Fe {
|
|
48
48
|
decodeFn;
|
|
@@ -54,7 +54,7 @@ var C = class Fe {
|
|
|
54
54
|
if (r.isOk()) return r.value;
|
|
55
55
|
{
|
|
56
56
|
let n = r;
|
|
57
|
-
throw Error(
|
|
57
|
+
throw Error(ct(n.issues), { cause: n.issues });
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
decode(t) {
|
|
@@ -77,7 +77,7 @@ var C = class Fe {
|
|
|
77
77
|
if (o.isOk()) return r(o.value);
|
|
78
78
|
{
|
|
79
79
|
let s = o;
|
|
80
|
-
return n(Error(
|
|
80
|
+
return n(Error(ct(s.issues), { cause: s.issues }));
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
83
|
}
|
|
@@ -96,17 +96,17 @@ var C = class Fe {
|
|
|
96
96
|
}, B = (e, t) => [{
|
|
97
97
|
message: `${JSON.stringify(e)} is not a valid ${t}`,
|
|
98
98
|
path: []
|
|
99
|
-
}],
|
|
99
|
+
}], Ve = (e, t) => e.map((r) => ({
|
|
100
100
|
...r,
|
|
101
101
|
path: [t, ...r.path]
|
|
102
102
|
}));
|
|
103
|
-
function
|
|
103
|
+
function Ue(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(...
|
|
109
|
+
s.isOk() ? r.push(s.value) : n.push(...Ve(s.issues, o));
|
|
110
110
|
}
|
|
111
111
|
return n.length > 0 ? E(n) : F(r);
|
|
112
112
|
} else return E(B(t, "array"));
|
|
@@ -125,10 +125,10 @@ function fr(e, t) {
|
|
|
125
125
|
}]);
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function vt(e) {
|
|
129
129
|
return new C((t) => e().decode(t));
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function J(e) {
|
|
132
132
|
return new C((t) => t === e ? F(e) : E([{
|
|
133
133
|
message: `${JSON.stringify(t)} is not exactly ${JSON.stringify(e)}`,
|
|
134
134
|
path: []
|
|
@@ -137,19 +137,19 @@ function b(e) {
|
|
|
137
137
|
function Ae() {
|
|
138
138
|
return new C((e) => typeof e == "number" ? F(e) : E(B(e, "number")));
|
|
139
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function se(e) {
|
|
141
141
|
return new C((t) => {
|
|
142
142
|
if (typeof t == "object" && t) {
|
|
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(...
|
|
146
|
+
s = i instanceof C ? i.decode(t[o]) : i.decoder.decode(t[i.fromKey]), s.isOk() ? r[o] = s.value : n.push(...Ve(s.issues, o));
|
|
147
147
|
}
|
|
148
148
|
return n.length > 0 ? E(n) : F(r);
|
|
149
149
|
} else return E(B(t, "object"));
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function x(e) {
|
|
153
153
|
return new C((t) => {
|
|
154
154
|
let r = [];
|
|
155
155
|
for (let n = 0; n < e.length; n++) {
|
|
@@ -186,7 +186,7 @@ function hr(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(...
|
|
189
|
+
s.isOk() ? r[o] = s.value : n.push(...Ve(s.issues, o));
|
|
190
190
|
}
|
|
191
191
|
return n.length > 0 ? E(n) : F(r);
|
|
192
192
|
} else return E(B(t, "object"));
|
|
@@ -195,10 +195,10 @@ function hr(e) {
|
|
|
195
195
|
function I() {
|
|
196
196
|
return new C((e) => typeof e == "string" ? F(e) : E(B(e, "string")));
|
|
197
197
|
}
|
|
198
|
-
function
|
|
198
|
+
function z() {
|
|
199
199
|
return new C((e) => F(e));
|
|
200
200
|
}
|
|
201
|
-
function
|
|
201
|
+
function ie(e) {
|
|
202
202
|
return new C((t) => {
|
|
203
203
|
if (typeof t != "object" || t === null)
|
|
204
204
|
return E([{ message: `Expected object literal, got "${typeof t}"`, path: [] }]);
|
|
@@ -230,33 +230,33 @@ function se(e) {
|
|
|
230
230
|
return F(r);
|
|
231
231
|
});
|
|
232
232
|
}
|
|
233
|
-
const
|
|
233
|
+
const mr = () => crypto.randomUUID().slice(0, 8), gr = (e) => typeof e != "function" && e.kind === "display", ae = (e) => typeof e != "function" && e.kind === "action", D = (e) => typeof e != "function" && e.kind === "input", re = (e) => typeof e != "function" && e.kind === "layout", G = (e) => typeof e == "function", yr = se({ in: Ue(I()) }), Me = se({ when: I() }), Se = x([yr, Me]), $r = se({ from: Ue(I()) }), ve = x([$r, Me]), Te = x([ar(), Me]), Ar = new C((e) => {
|
|
234
234
|
const t = typeof e;
|
|
235
235
|
return t === "function" ? F(e) : E([{ message: `Expected a function, got '${t}'`, path: [] }]);
|
|
236
|
-
}), L = (e) =>
|
|
236
|
+
}), L = (e) => x([e, Ar]), He = ie({
|
|
237
237
|
load: { suffixed: !0, decoder: L(y(I())) },
|
|
238
238
|
click: { suffixed: !0, decoder: L(y(I())) },
|
|
239
239
|
change: { suffixed: !0, decoder: L(y(I())) },
|
|
240
240
|
filter: { suffixed: !0, decoder: L(y(I())) },
|
|
241
241
|
blur: { suffixed: !0, decoder: L(y(I())) }
|
|
242
|
-
}),
|
|
242
|
+
}), Sr = se({
|
|
243
243
|
key: I(),
|
|
244
244
|
default: y(I()),
|
|
245
|
-
params: y(
|
|
246
|
-
}), Et =
|
|
247
|
-
kind: { decoder:
|
|
245
|
+
params: y(z())
|
|
246
|
+
}), Et = x([I(), Sr]), ze = y(I()), vr = ie({
|
|
247
|
+
kind: { decoder: J("display") },
|
|
248
248
|
uid: { decoder: ze },
|
|
249
249
|
type: { decoder: I() },
|
|
250
250
|
size: { suffixed: !0, decoder: y(Ae()) },
|
|
251
251
|
include: { decoder: y(Se) },
|
|
252
252
|
exclude: { decoder: y(ve) },
|
|
253
|
-
props: { decoder: y(
|
|
254
|
-
}),
|
|
255
|
-
kind: { decoder:
|
|
253
|
+
props: { decoder: y(z()) }
|
|
254
|
+
}), Er = ie({
|
|
255
|
+
kind: { decoder: J("action") },
|
|
256
256
|
uid: { decoder: ze },
|
|
257
257
|
type: { decoder: I() },
|
|
258
258
|
actionType: {
|
|
259
|
-
decoder: y(
|
|
259
|
+
decoder: y(x([J("button"), J("submit")]))
|
|
260
260
|
},
|
|
261
261
|
size: { suffixed: !0, decoder: y(Ae()) },
|
|
262
262
|
include: { decoder: y(Se) },
|
|
@@ -266,9 +266,9 @@ const vt = () => crypto.randomUUID().slice(0, 8), mr = (e) => typeof e != "funct
|
|
|
266
266
|
decoder: L(y(Et))
|
|
267
267
|
},
|
|
268
268
|
disabled: { suffixed: !0, decoder: y(Te) },
|
|
269
|
-
on: { decoder: y(
|
|
270
|
-
props: { decoder: y(
|
|
271
|
-
}),
|
|
269
|
+
on: { decoder: y(He) },
|
|
270
|
+
props: { decoder: y(z()) }
|
|
271
|
+
}), Ir = new C((e) => {
|
|
272
272
|
const t = typeof e;
|
|
273
273
|
if (t === "function") {
|
|
274
274
|
const r = e, n = r({
|
|
@@ -277,11 +277,11 @@ const vt = () => crypto.randomUUID().slice(0, 8), mr = (e) => typeof e != "funct
|
|
|
277
277
|
touched: void 0,
|
|
278
278
|
translate: void 0
|
|
279
279
|
});
|
|
280
|
-
return r.uid = n.uid ||
|
|
280
|
+
return r.uid = r.uid || n.uid || mr(), r.type = n.type, r.path = n.path, F(r);
|
|
281
281
|
} else
|
|
282
282
|
return E([{ message: `Expected a function, got '${t}'`, path: [] }]);
|
|
283
|
-
}),
|
|
284
|
-
kind: { decoder:
|
|
283
|
+
}), wr = ie({
|
|
284
|
+
kind: { decoder: J("input") },
|
|
285
285
|
uid: { decoder: y(I()) },
|
|
286
286
|
type: { decoder: I() },
|
|
287
287
|
size: { suffixed: !0, decoder: y(Ae()) },
|
|
@@ -289,46 +289,46 @@ const vt = () => crypto.randomUUID().slice(0, 8), mr = (e) => typeof e != "funct
|
|
|
289
289
|
exclude: { decoder: y(ve) },
|
|
290
290
|
disabled: { suffixed: !0, decoder: y(Te) },
|
|
291
291
|
readonly: { suffixed: !0, decoder: y(Te) },
|
|
292
|
-
on: { decoder: y(
|
|
293
|
-
props: { decoder: y(
|
|
292
|
+
on: { decoder: y(He) },
|
|
293
|
+
props: { decoder: y(z()) },
|
|
294
294
|
label: {
|
|
295
295
|
suffixed: !0,
|
|
296
296
|
decoder: L(y(Et))
|
|
297
297
|
},
|
|
298
298
|
path: { decoder: I() },
|
|
299
|
-
defaultValue: { decoder: y(
|
|
299
|
+
defaultValue: { decoder: y(z()) },
|
|
300
300
|
validator: {
|
|
301
301
|
suffixed: !0,
|
|
302
|
-
decoder: L(y(
|
|
302
|
+
decoder: L(y(z()))
|
|
303
303
|
}
|
|
304
304
|
}).map((e) => {
|
|
305
305
|
const t = { ...e };
|
|
306
306
|
if (e.uid || (t.uid = `${e.path}-${e.type}`), e.type === "repeater") {
|
|
307
307
|
const r = e.props;
|
|
308
|
-
|
|
308
|
+
t.props = { ...r, template: Be.parse(r.template) };
|
|
309
309
|
}
|
|
310
310
|
return t;
|
|
311
|
-
}),
|
|
311
|
+
}), Or = vt(() => {
|
|
312
312
|
const e = fr("kind", {
|
|
313
|
-
input:
|
|
314
|
-
layout:
|
|
315
|
-
display:
|
|
316
|
-
action:
|
|
313
|
+
input: wr,
|
|
314
|
+
layout: Be,
|
|
315
|
+
display: vr,
|
|
316
|
+
action: Er
|
|
317
317
|
});
|
|
318
318
|
return new C(
|
|
319
|
-
(t) => typeof t == "function" ?
|
|
319
|
+
(t) => typeof t == "function" ? Ir.decode(t) : e.decode(t)
|
|
320
320
|
);
|
|
321
|
-
}),
|
|
322
|
-
kind: { decoder:
|
|
321
|
+
}), Be = ie({
|
|
322
|
+
kind: { decoder: J("layout") },
|
|
323
323
|
uid: { decoder: ze },
|
|
324
324
|
type: { decoder: I() },
|
|
325
325
|
size: { suffixed: !0, decoder: y(Ae()) },
|
|
326
326
|
include: { decoder: y(Se) },
|
|
327
327
|
exclude: { decoder: y(ve) },
|
|
328
|
-
props: { decoder: y(
|
|
329
|
-
on: { decoder: y(
|
|
330
|
-
children: { decoder:
|
|
331
|
-
}),
|
|
328
|
+
props: { decoder: y(z()) },
|
|
329
|
+
on: { decoder: y(He) },
|
|
330
|
+
children: { decoder: Ue(Or) }
|
|
331
|
+
}), H = class H {
|
|
332
332
|
constructor() {
|
|
333
333
|
this.widgetLoaders = {}, this._ready = !1;
|
|
334
334
|
}
|
|
@@ -343,16 +343,27 @@ const vt = () => crypto.randomUUID().slice(0, 8), mr = (e) => typeof e != "funct
|
|
|
343
343
|
}
|
|
344
344
|
async loadWidget(t) {
|
|
345
345
|
const r = this.widgetLoaders[t];
|
|
346
|
-
if (!
|
|
347
|
-
const n = r().catch((o) => (
|
|
348
|
-
|
|
346
|
+
if (!H.sharedCache.has(r)) {
|
|
347
|
+
const n = r().catch((o) => (H.sharedCache.delete(r), Promise.reject(o)));
|
|
348
|
+
H.sharedCache.set(r, n);
|
|
349
349
|
}
|
|
350
|
-
return
|
|
350
|
+
return H.sharedCache.get(r);
|
|
351
351
|
}
|
|
352
352
|
};
|
|
353
|
-
|
|
354
|
-
let je =
|
|
355
|
-
function
|
|
353
|
+
H.sharedCache = /* @__PURE__ */ new Map();
|
|
354
|
+
let je = H;
|
|
355
|
+
function Cr(e) {
|
|
356
|
+
Pe(e, "#0");
|
|
357
|
+
}
|
|
358
|
+
function Pe(e, t) {
|
|
359
|
+
if (!G(e) && (e.uid || (e.uid = t), re(e) && e.children.forEach((r, n) => {
|
|
360
|
+
Pe(r, `${t}.${n}`);
|
|
361
|
+
}), D(e) && e.type === "repeater")) {
|
|
362
|
+
const r = e.props?.template;
|
|
363
|
+
r && Pe(r, `${t}.t`);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
function Uo(e) {
|
|
356
367
|
return {
|
|
357
368
|
...e,
|
|
358
369
|
form: {
|
|
@@ -363,10 +374,10 @@ function Lo(e) {
|
|
|
363
374
|
}
|
|
364
375
|
};
|
|
365
376
|
}
|
|
366
|
-
const It =
|
|
377
|
+
const It = se({
|
|
367
378
|
states: y(hr(I())),
|
|
368
|
-
form:
|
|
369
|
-
}), wt = (e) => ({
|
|
379
|
+
form: vt(() => Be)
|
|
380
|
+
}).map((e) => (Cr(e.form), e)), wt = (e) => ({
|
|
370
381
|
formName: "",
|
|
371
382
|
formDef: It.parse({
|
|
372
383
|
form: {
|
|
@@ -391,12 +402,16 @@ const It = oe({
|
|
|
391
402
|
formHealth: { status: "ok" },
|
|
392
403
|
touched: !1,
|
|
393
404
|
lang: e
|
|
394
|
-
}),
|
|
395
|
-
|
|
405
|
+
}), Mo = {
|
|
406
|
+
submit: "formSubmit",
|
|
407
|
+
health: "formHealth",
|
|
408
|
+
event: "formEvent"
|
|
409
|
+
}, Dr = (e) => !(typeof e != "object" || e === null || typeof e.key != "string");
|
|
410
|
+
function Ho(e) {
|
|
396
411
|
const t = new Intl.Locale(e).maximize().script;
|
|
397
412
|
return ["Arab", "Hebr", "Thaa", "Syrc", "Tfng", "Adlm", "Rohg"].includes(t || "") ? "rtl" : "ltr";
|
|
398
413
|
}
|
|
399
|
-
const
|
|
414
|
+
const Wr = (e = navigator.language || "en-US") => {
|
|
400
415
|
const t = /* @__PURE__ */ new Set();
|
|
401
416
|
return {
|
|
402
417
|
get lang() {
|
|
@@ -414,7 +429,7 @@ const Cr = (e = navigator.language || "en-US") => {
|
|
|
414
429
|
e = n, t.forEach((o) => o(e));
|
|
415
430
|
}
|
|
416
431
|
};
|
|
417
|
-
},
|
|
432
|
+
}, kr = (e) => {
|
|
418
433
|
throw new Error(`Unhandled case: ${JSON.stringify(e)}`);
|
|
419
434
|
};
|
|
420
435
|
function N(e, ...t) {
|
|
@@ -424,7 +439,7 @@ const _ = (e, t) => {
|
|
|
424
439
|
if (e === void 0)
|
|
425
440
|
throw new Error("obj is undefined");
|
|
426
441
|
return t.split(".").reduce((r, n) => r === void 0 || n === "" ? r : Array.isArray(r) ? r[parseInt(n, 10)] : r[n], e);
|
|
427
|
-
},
|
|
442
|
+
}, Ge = (e, t, r) => {
|
|
428
443
|
if (e === null)
|
|
429
444
|
throw new Error("object is null");
|
|
430
445
|
if (e === void 0)
|
|
@@ -435,11 +450,11 @@ const _ = (e, t) => {
|
|
|
435
450
|
let o = e;
|
|
436
451
|
for (let i = 0; i < n.length - 1; i++) {
|
|
437
452
|
const u = n[i], c = n[i + 1];
|
|
438
|
-
(o[u] == null || typeof o[u] != "object") && (o[u] =
|
|
453
|
+
(o[u] == null || typeof o[u] != "object") && (o[u] = Tr(c) ? [] : {}), o = o[u];
|
|
439
454
|
}
|
|
440
455
|
const s = n[n.length - 1];
|
|
441
456
|
return o[s] = r, e;
|
|
442
|
-
},
|
|
457
|
+
}, Fr = (e, t) => {
|
|
443
458
|
if (t === "")
|
|
444
459
|
return e;
|
|
445
460
|
const r = t.split("."), n = [e];
|
|
@@ -456,7 +471,7 @@ const _ = (e, t) => {
|
|
|
456
471
|
Array.isArray(o) ? o.splice(parseInt(s, 10), 1) : delete o[s];
|
|
457
472
|
for (let i = n.length - 1; i >= 1; i--) {
|
|
458
473
|
const u = n[i];
|
|
459
|
-
if (Array.isArray(u) || !
|
|
474
|
+
if (Array.isArray(u) || !jr(u))
|
|
460
475
|
break;
|
|
461
476
|
const c = n[i - 1], l = r[i - 1];
|
|
462
477
|
if (Array.isArray(c))
|
|
@@ -465,29 +480,29 @@ const _ = (e, t) => {
|
|
|
465
480
|
}
|
|
466
481
|
return e;
|
|
467
482
|
};
|
|
468
|
-
function
|
|
483
|
+
function Tr(e) {
|
|
469
484
|
const t = Number(e);
|
|
470
485
|
return Number.isInteger(t) && t >= 0 && t.toString() === e;
|
|
471
486
|
}
|
|
472
|
-
function
|
|
487
|
+
function jr(e) {
|
|
473
488
|
return e != null && typeof e == "object" && !Array.isArray(e) && Object.keys(e).length === 0;
|
|
474
489
|
}
|
|
475
490
|
const Ee = (e, t) => (delete e[t], e);
|
|
476
|
-
function
|
|
491
|
+
function Ne(e) {
|
|
477
492
|
if (e === null || typeof e != "object")
|
|
478
493
|
return e;
|
|
479
494
|
if (Array.isArray(e))
|
|
480
|
-
return e.map((r) =>
|
|
495
|
+
return e.map((r) => Ne(r));
|
|
481
496
|
const t = {};
|
|
482
497
|
for (const r of Object.keys(e))
|
|
483
|
-
t[r] =
|
|
498
|
+
t[r] = Ne(e[r]);
|
|
484
499
|
return t;
|
|
485
500
|
}
|
|
486
|
-
function
|
|
501
|
+
function Pr(e, t) {
|
|
487
502
|
const r = t.payload.widget.uid;
|
|
488
503
|
if (!r)
|
|
489
504
|
throw new Error("addWidget: widget must have a uid");
|
|
490
|
-
const n = t.payload.widget, o = e.touched &&
|
|
505
|
+
const n = t.payload.widget, o = e.touched && D(n) ? { ...e.touchedControls, [n.path]: !0 } : e.touchedControls;
|
|
491
506
|
return {
|
|
492
507
|
...e,
|
|
493
508
|
touchedControls: o,
|
|
@@ -500,7 +515,7 @@ function Tr(e, t) {
|
|
|
500
515
|
}
|
|
501
516
|
};
|
|
502
517
|
}
|
|
503
|
-
const
|
|
518
|
+
const Q = {
|
|
504
519
|
calculateCurrentStateError: 10,
|
|
505
520
|
initializeParseError: 20,
|
|
506
521
|
initializeUidCollisionError: 21,
|
|
@@ -509,29 +524,29 @@ const J = {
|
|
|
509
524
|
widgetCouldNotBeLoaded: 30,
|
|
510
525
|
resolveStringInterpolationError: 40
|
|
511
526
|
};
|
|
512
|
-
function
|
|
527
|
+
function Ke(e) {
|
|
513
528
|
return e.flatMap((t) => [
|
|
514
529
|
t,
|
|
515
|
-
...
|
|
530
|
+
...re(t) ? Ke(t.children) : []
|
|
516
531
|
]);
|
|
517
532
|
}
|
|
518
|
-
function
|
|
533
|
+
function be(e) {
|
|
519
534
|
return Object.entries(e.validations).reduce(
|
|
520
|
-
(r, [n, o]) => (o !== null && (r.$formIsInvalid = !0,
|
|
535
|
+
(r, [n, o]) => (o !== null && (r.$formIsInvalid = !0, Ge(r.$errors, n, [...o])), r),
|
|
521
536
|
{ $formIsInvalid: !1, $errors: {} }
|
|
522
537
|
);
|
|
523
538
|
}
|
|
524
539
|
function Ce(e) {
|
|
525
|
-
const t =
|
|
540
|
+
const t = Ne(e.data);
|
|
526
541
|
for (const [r, n] of Object.entries(e.widgetFlags))
|
|
527
542
|
if (n.hidden === !0) {
|
|
528
543
|
const o = e.flatForm[r];
|
|
529
|
-
o &&
|
|
544
|
+
o && D(o) && Fr(t, o.path);
|
|
530
545
|
}
|
|
531
546
|
return t;
|
|
532
547
|
}
|
|
533
548
|
const Xe = 32;
|
|
534
|
-
let
|
|
549
|
+
let _e, p, g, $ = (e) => (p = 0, g = e, $.newline = !1, e = S(), g[p] ? K() : e || ""), K = (e = "Unexpected token", t = p, r = g.slice(0, t).split(`
|
|
535
550
|
`), n = r.pop(), o = g.slice(Math.max(0, t - 40), t), s = "̭", i = (g[t] || " ") + s, u = g.slice(t + 1, t + 20)) => {
|
|
536
551
|
throw SyntaxError(`${e} at ${r.length + 1}:${n.length + 1}
|
|
537
552
|
${g[t - 41] !== `
|
|
@@ -539,77 +554,77 @@ ${g[t - 41] !== `
|
|
|
539
554
|
}, Ot = (e, t = p) => (Array.isArray(e) && (e.loc = t), e), q = (e, t = p, r) => {
|
|
540
555
|
for (; r = e(g.charCodeAt(p)); ) p += r;
|
|
541
556
|
return g.slice(t, p);
|
|
542
|
-
}, w = (e = 1) => g[p += e],
|
|
557
|
+
}, w = (e = 1) => g[p += e], Re = (e) => p = e, S = (e = 0, t) => {
|
|
543
558
|
let r, n, o, s, i;
|
|
544
559
|
for (t && $.asi && ($.newline = !1); (r = $.space()) && (i = $.newline, 1) && r !== t && (o = // ASI before [ on new line (access handler would consume it; lineBreak distinguishes real \n from synthetic } flag)
|
|
545
|
-
(n && r === 91 &&
|
|
546
|
-
return t && (r == t ? (p++, t === 125 && $.asi && ($.newline = !0)) :
|
|
560
|
+
(n && r === 91 && _e && $.asi?.(n, e, S) || null) ?? ((s = P[r]) && s(n, e)) ?? (n && i && $.asi?.(n, e, S)) ?? (!n && q($.id))); ) n = o;
|
|
561
|
+
return t && (r == t ? (p++, t === 125 && $.asi && ($.newline = !0)) : K("Unclosed " + String.fromCharCode(t - (t > 42 ? 2 : 1)))), n;
|
|
547
562
|
}, U = (e, t = p) => {
|
|
548
|
-
for (
|
|
549
|
-
$.asi && e === 10 && ($.newline =
|
|
563
|
+
for (_e = !1; (e = g.charCodeAt(p)) <= Xe; )
|
|
564
|
+
$.asi && e === 10 && ($.newline = _e = !0), p++;
|
|
550
565
|
return e;
|
|
551
|
-
},
|
|
566
|
+
}, Nr = (e = p) => {
|
|
552
567
|
for (; g.charCodeAt(e) <= Xe; ) e++;
|
|
553
568
|
return g.charCodeAt(e);
|
|
554
569
|
};
|
|
555
570
|
$.id = (e) => e >= 48 && e <= 57 || e >= 65 && e <= 90 || e >= 97 && e <= 122 || e == 36 || e == 95 || e >= 192 && e != 215 && e != 247;
|
|
556
|
-
let
|
|
571
|
+
let _r = (e, t = e.length) => g.substr(p, t) === e && !$.id(g.charCodeAt(p + t)), P = [], lt = {}, j = (e, t = Xe, r, n = e.charCodeAt(0), o = e.length, s = P[n], i = e.toUpperCase() !== e, u, c) => (t = lt[e] = !s && lt[e] || t, P[n] = (l, f, m, h = p) => (u = m, (m ? e == m : (o < 2 || e.charCodeAt(1) === g.charCodeAt(p + 1) && (o < 3 || g.substr(p, o) == e)) && (!i || !$.id(g.charCodeAt(p + o))) && (u = m = e)) && f < t && (p += o, (c = r(l)) ? Ot(c, h) : (p = h, u = 0, !i && !s && !l && K()), c) || s?.(l, f, u))), A = (e, t, r = !1) => j(e, t, (n) => n && /* @__PURE__ */ ((o) => o && [e, n, o])(S(t - (r ? 0.5 : 0)))), M = (e, t, r) => j(e, t, (n) => !n && (n = S(t - 0.5)) && [e, n]), ue = (e, t) => j(e, 200, (r) => !r && [, t]), Ct = (e, t, r) => j(
|
|
557
572
|
e,
|
|
558
573
|
t,
|
|
559
574
|
(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)
|
|
560
|
-
),
|
|
575
|
+
), Je = (e, t) => j(e[0], t, (r) => !r && [e, S(0, e.charCodeAt(1)) || null]), Dt = (e, t) => j(e[0], t, (r) => r && [e, r, S(0, e.charCodeAt(1)) || null]), de = (e, t, r, n = e.charCodeAt(0), o = e.length, s = P[n], i) => P[n] = (u, c, l, f = p) => !u && (l ? e == l : (o < 2 || g.substr(p, o) == e) && (l = e)) && c < t && !$.id(g.charCodeAt(p + o)) && (!$.prop || $.prop(p + o)) && (Re(p + o), (i = r()) ? Ot(i, f) : Re(f), i) || s?.(u, c, l);
|
|
561
576
|
Object.defineProperty($, "space", {
|
|
562
577
|
configurable: !0,
|
|
563
578
|
enumerable: !0,
|
|
564
579
|
get: () => U,
|
|
565
580
|
set: (e) => U = e
|
|
566
581
|
});
|
|
567
|
-
const
|
|
582
|
+
const Le = {}, a = (e, t, r = Le[e]) => Le[e] = (...n) => t(...n) || r?.(...n), d = (e) => Array.isArray(e) ? e[0] == null ? /* @__PURE__ */ ((t) => () => t)(e[1]) : (
|
|
568
583
|
// == catches both undefined and null
|
|
569
|
-
|
|
584
|
+
Le[e[0]]?.(...e.slice(1)) ?? K(`Unknown operator: ${e[0]}`, e?.loc)
|
|
570
585
|
) : e === void 0 ? () => {
|
|
571
|
-
} : (t) => t?.[e], fe = 46,
|
|
586
|
+
} : (t) => t?.[e], fe = 46, ne = 48, pe = 57, Rr = 69, Lr = 101, Vr = 43, Ur = 45, le = 95, Wt = 110, Mr = 97, Hr = 102, zr = 65, Br = 70, kt = (e) => e.indexOf("_") < 0 ? e : e.replaceAll("_", ""), Qe = (e) => {
|
|
572
587
|
let t = kt(q(
|
|
573
588
|
(r) => (
|
|
574
589
|
// . is decimal only if NOT followed by another . (range operator)
|
|
575
|
-
r === fe && g.charCodeAt(p + 1) !== fe || r >=
|
|
590
|
+
r === fe && g.charCodeAt(p + 1) !== fe || r >= ne && r <= pe || r === le || ((r === Rr || r === Lr) && ((r = g.charCodeAt(p + 1)) >= ne && r <= pe || r === Vr || r === Ur) ? 2 : 0)
|
|
576
591
|
)
|
|
577
592
|
));
|
|
578
|
-
return g.charCodeAt(p) === Wt ? (w(), [, BigInt(t)]) : (e = +t) != e ?
|
|
579
|
-
},
|
|
580
|
-
2: (e) => e === 48 || e === 49 || e ===
|
|
581
|
-
8: (e) => e >= 48 && e <= 55 || e ===
|
|
582
|
-
16: (e) => e >=
|
|
593
|
+
return g.charCodeAt(p) === Wt ? (w(), [, BigInt(t)]) : (e = +t) != e ? K() : [, e];
|
|
594
|
+
}, Gr = {
|
|
595
|
+
2: (e) => e === 48 || e === 49 || e === le,
|
|
596
|
+
8: (e) => e >= 48 && e <= 55 || e === le,
|
|
597
|
+
16: (e) => e >= ne && e <= pe || e >= Mr && e <= Hr || e >= zr && e <= Br || e === le
|
|
583
598
|
};
|
|
584
599
|
$.number = null;
|
|
585
|
-
P[fe] = (e) => !e && g.charCodeAt(p + 1) !== fe &&
|
|
586
|
-
for (let e =
|
|
587
|
-
P[
|
|
600
|
+
P[fe] = (e) => !e && g.charCodeAt(p + 1) !== fe && Qe();
|
|
601
|
+
for (let e = ne; e <= pe; e++) P[e] = (t) => t ? void 0 : Qe();
|
|
602
|
+
P[ne] = (e) => {
|
|
588
603
|
if (e) return;
|
|
589
604
|
const t = $.number;
|
|
590
605
|
if (t) {
|
|
591
606
|
for (const [r, n] of Object.entries(t))
|
|
592
607
|
if (r[0] === "0" && g[p + 1]?.toLowerCase() === r[1]) {
|
|
593
608
|
w(2);
|
|
594
|
-
const o = kt(q(
|
|
609
|
+
const o = kt(q(Gr[n]));
|
|
595
610
|
return g.charCodeAt(p) === Wt ? (w(), [, BigInt("0" + r[1] + o)]) : [, parseInt(o, n)];
|
|
596
611
|
}
|
|
597
612
|
}
|
|
598
|
-
return
|
|
613
|
+
return Qe();
|
|
599
614
|
};
|
|
600
|
-
const
|
|
615
|
+
const Kr = 92, at = 34, ft = 39, br = { n: `
|
|
601
616
|
`, r: "\r", t: " ", b: "\b", f: "\f", v: "\v" }, Ft = (e) => (t, r, n = "") => {
|
|
602
617
|
if (!(t || !$.string?.[String.fromCharCode(e)]))
|
|
603
|
-
return w(), q((o) => o - e && (o ===
|
|
618
|
+
return w(), q((o) => o - e && (o === Kr ? (n += br[g[p + 1]] || g[p + 1], 2) : (n += g[p], 1))), g[p] === String.fromCharCode(e) ? w() : K("Bad string"), [, n];
|
|
604
619
|
};
|
|
605
|
-
P[lt] = Ft(lt);
|
|
606
620
|
P[at] = Ft(at);
|
|
621
|
+
P[ft] = Ft(ft);
|
|
607
622
|
$.string = { '"': !0 };
|
|
608
|
-
const
|
|
609
|
-
"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map((e) => A(e,
|
|
623
|
+
const Xr = 20;
|
|
624
|
+
"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map((e) => A(e, Xr, !0));
|
|
610
625
|
const Tt = (e, t, r, n) => typeof e == "string" ? (o) => t(o, e, o) : e[0] === "." ? (r = d(e[1]), n = e[2], (o) => t(r(o), n, o)) : e[0] === "[]" && e.length === 3 ? (r = d(e[1]), n = d(e[2]), (o) => t(r(o), n(o), o)) : e[0] === "()" && e.length === 2 ? Tt(e[1], t) : (() => {
|
|
611
626
|
throw Error("Invalid assignment target");
|
|
612
|
-
})(),
|
|
627
|
+
})(), pt = {
|
|
613
628
|
"=": (e, t, r) => e[t] = r,
|
|
614
629
|
"+=": (e, t, r) => e[t] += r,
|
|
615
630
|
"-=": (e, t, r) => e[t] -= r,
|
|
@@ -622,21 +637,21 @@ const Tt = (e, t, r, n) => typeof e == "string" ? (o) => t(o, e, o) : e[0] === "
|
|
|
622
637
|
">>=": (e, t, r) => e[t] >>= r,
|
|
623
638
|
"<<=": (e, t, r) => e[t] <<= r
|
|
624
639
|
};
|
|
625
|
-
for (const e in
|
|
626
|
-
const
|
|
627
|
-
M("!",
|
|
628
|
-
A("||",
|
|
629
|
-
A("&&",
|
|
640
|
+
for (const e in pt) a(e, (t, r) => (r = d(r), Tt(t, (n, o, s) => pt[e](n, o, r(s)))));
|
|
641
|
+
const Jr = 30, Qr = 40, xr = 140;
|
|
642
|
+
M("!", xr);
|
|
643
|
+
A("||", Jr);
|
|
644
|
+
A("&&", Qr);
|
|
630
645
|
a("!", (e) => (e = d(e), (t) => !e(t)));
|
|
631
646
|
a("||", (e, t) => (e = d(e), t = d(t), (r) => e(r) || t(r)));
|
|
632
647
|
a("&&", (e, t) => (e = d(e), t = d(t), (r) => e(r) && t(r)));
|
|
633
|
-
const
|
|
634
|
-
A("|",
|
|
635
|
-
A("&",
|
|
636
|
-
A("^",
|
|
648
|
+
const qr = 50, Zr = 60, Yr = 70, jt = 100, en = 140;
|
|
649
|
+
A("|", qr);
|
|
650
|
+
A("&", Yr);
|
|
651
|
+
A("^", Zr);
|
|
637
652
|
A(">>", jt);
|
|
638
653
|
A("<<", jt);
|
|
639
|
-
M("~",
|
|
654
|
+
M("~", en);
|
|
640
655
|
a("~", (e) => (e = d(e), (t) => ~e(t)));
|
|
641
656
|
a("|", (e, t) => (e = d(e), t = d(t), (r) => e(r) | t(r)));
|
|
642
657
|
a("&", (e, t) => (e = d(e), t = d(t), (r) => e(r) & t(r)));
|
|
@@ -657,12 +672,12 @@ A("==", Pt);
|
|
|
657
672
|
A("!=", Pt);
|
|
658
673
|
a("==", (e, t) => (e = d(e), t = d(t), (r) => e(r) == t(r)));
|
|
659
674
|
a("!=", (e, t) => (e = d(e), t = d(t), (r) => e(r) != t(r)));
|
|
660
|
-
const Nt = 110,
|
|
675
|
+
const Nt = 110, xe = 120, _t = 140;
|
|
661
676
|
A("+", Nt);
|
|
662
677
|
A("-", Nt);
|
|
663
|
-
A("*",
|
|
664
|
-
A("/",
|
|
665
|
-
A("%",
|
|
678
|
+
A("*", xe);
|
|
679
|
+
A("/", xe);
|
|
680
|
+
A("%", xe);
|
|
666
681
|
M("+", _t);
|
|
667
682
|
M("-", _t);
|
|
668
683
|
a("+", (e, t) => t !== void 0 ? (e = d(e), t = d(t), (r) => e(r) + t(r)) : (e = d(e), (r) => +e(r)));
|
|
@@ -673,17 +688,17 @@ a("%", (e, t) => (e = d(e), t = d(t), (r) => e(r) % t(r)));
|
|
|
673
688
|
const he = 150;
|
|
674
689
|
j("++", he, (e) => e ? ["++", e, null] : ["++", S(he - 1)]);
|
|
675
690
|
j("--", he, (e) => e ? ["--", e, null] : ["--", S(he - 1)]);
|
|
676
|
-
const
|
|
691
|
+
const qe = (e, t, r, n) => typeof e == "string" ? (o) => t(o, e) : e[0] === "." ? (r = d(e[1]), n = e[2], (o) => t(r(o), n)) : e[0] === "[]" && e.length === 3 ? (r = d(e[1]), n = d(e[2]), (o) => t(r(o), n(o))) : e[0] === "()" && e.length === 2 ? qe(e[1], t) : (
|
|
677
692
|
// unwrap parens: (x)++
|
|
678
693
|
(() => {
|
|
679
694
|
throw Error("Invalid increment target");
|
|
680
695
|
})()
|
|
681
696
|
);
|
|
682
|
-
a("++", (e, t) =>
|
|
683
|
-
a("--", (e, t) =>
|
|
684
|
-
const
|
|
685
|
-
Ct(",",
|
|
686
|
-
Ct(";",
|
|
697
|
+
a("++", (e, t) => qe(e, t === null ? (r, n) => r[n]++ : (r, n) => ++r[n]));
|
|
698
|
+
a("--", (e, t) => qe(e, t === null ? (r, n) => r[n]-- : (r, n) => --r[n]));
|
|
699
|
+
const tn = 5, rn = 10;
|
|
700
|
+
Ct(",", rn);
|
|
701
|
+
Ct(";", tn, !0);
|
|
687
702
|
const Rt = (...e) => (e = e.map(d), (t) => {
|
|
688
703
|
let r;
|
|
689
704
|
for (const n of e) r = n(t);
|
|
@@ -691,12 +706,12 @@ const Rt = (...e) => (e = e.map(d), (t) => {
|
|
|
691
706
|
});
|
|
692
707
|
a(",", Rt);
|
|
693
708
|
a(";", Rt);
|
|
694
|
-
const
|
|
695
|
-
|
|
696
|
-
const V = (e) => e?.[0] === "_" && e[1] === "_" || e === "constructor" || e === "prototype",
|
|
697
|
-
Dt("[]",
|
|
698
|
-
A(".",
|
|
699
|
-
Dt("()",
|
|
709
|
+
const nn = 170;
|
|
710
|
+
Je("()", nn);
|
|
711
|
+
const V = (e) => e?.[0] === "_" && e[1] === "_" || e === "constructor" || e === "prototype", Ze = 170;
|
|
712
|
+
Dt("[]", Ze);
|
|
713
|
+
A(".", Ze);
|
|
714
|
+
Dt("()", Ze);
|
|
700
715
|
const me = (e) => {
|
|
701
716
|
throw Error(e);
|
|
702
717
|
};
|
|
@@ -712,31 +727,31 @@ a("()", (e, t) => {
|
|
|
712
727
|
const r = (o) => o?.[0] === "," && o.slice(1).some((s) => s == null || r(s));
|
|
713
728
|
r(t) && me("Empty argument");
|
|
714
729
|
const n = t ? t[0] === "," ? (t = t.slice(1).map(d), (o) => t.map((s) => s(o))) : (t = d(t), (o) => [t(o)]) : () => [];
|
|
715
|
-
return
|
|
730
|
+
return Ye(e, (o, s, i) => o[s](...n(i)));
|
|
716
731
|
});
|
|
717
|
-
const
|
|
732
|
+
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] === "{}"), Ye = (e, t, r, n) => e == null ? me("Empty ()") : e[0] === "()" && e.length == 2 ? Ye(e[1], t) : typeof e == "string" ? (o) => t(o, e, o) : e[0] === "." ? (r = d(e[1]), n = e[2], (o) => t(r(o), n, o)) : e[0] === "?." ? (r = d(e[1]), n = e[2], (o) => {
|
|
718
733
|
const s = r(o);
|
|
719
734
|
return s == null ? void 0 : t(s, n, o);
|
|
720
735
|
}) : e[0] === "[]" && e.length === 3 ? (r = d(e[1]), n = d(e[2]), (o) => t(r(o), n(o), o)) : e[0] === "?.[]" ? (r = d(e[1]), n = d(e[2]), (o) => {
|
|
721
736
|
const s = r(o);
|
|
722
737
|
return s == null ? void 0 : t(s, n(o), o);
|
|
723
|
-
}) : (e = d(e), (o) => t([e(o)], 0, o)), Z =
|
|
738
|
+
}) : (e = d(e), (o) => t([e(o)], 0, o)), Z = Ye, on = 32, sn = $.space;
|
|
724
739
|
$.comment ??= { "//": `
|
|
725
740
|
`, "/*": "*/" };
|
|
726
741
|
let De;
|
|
727
742
|
$.space = () => {
|
|
728
743
|
De || (De = Object.entries($.comment).map(([o, s]) => [o, s, o.charCodeAt(0)]));
|
|
729
|
-
for (var e; e =
|
|
744
|
+
for (var e; e = sn(); ) {
|
|
730
745
|
for (var t = 0, r; r = De[t++]; )
|
|
731
746
|
if (e === r[2] && g.substr(p, r[0].length) === r[0]) {
|
|
732
747
|
var n = p + r[0].length;
|
|
733
748
|
if (r[1] === `
|
|
734
|
-
`) for (; g.charCodeAt(n) >=
|
|
749
|
+
`) for (; g.charCodeAt(n) >= on; ) n++;
|
|
735
750
|
else {
|
|
736
751
|
for (; g[n] && g.substr(n, r[1].length) !== r[1]; ) n++;
|
|
737
752
|
g[n] && (n += r[1].length);
|
|
738
753
|
}
|
|
739
|
-
|
|
754
|
+
Re(n), e = 0;
|
|
740
755
|
break;
|
|
741
756
|
}
|
|
742
757
|
if (e) return e;
|
|
@@ -748,34 +763,34 @@ A("===", Lt);
|
|
|
748
763
|
A("!==", Lt);
|
|
749
764
|
a("===", (e, t) => (e = d(e), t = d(t), (r) => e(r) === t(r)));
|
|
750
765
|
a("!==", (e, t) => (e = d(e), t = d(t), (r) => e(r) !== t(r)));
|
|
751
|
-
const
|
|
752
|
-
A("??",
|
|
766
|
+
const un = 30;
|
|
767
|
+
A("??", un);
|
|
753
768
|
a("??", (e, t) => (e = d(e), t = d(t), (r) => e(r) ?? t(r)));
|
|
754
|
-
const
|
|
755
|
-
A("**",
|
|
756
|
-
A("**=",
|
|
769
|
+
const dn = 130, cn = 20;
|
|
770
|
+
A("**", dn, !0);
|
|
771
|
+
A("**=", cn, !0);
|
|
757
772
|
a("**", (e, t) => (e = d(e), t = d(t), (r) => e(r) ** t(r)));
|
|
758
|
-
const
|
|
773
|
+
const ln = (e) => {
|
|
759
774
|
throw Error(e);
|
|
760
775
|
};
|
|
761
|
-
a("**=", (e, t) => (
|
|
776
|
+
a("**=", (e, t) => (b(e) || ln("Invalid assignment target"), t = d(t), Z(e, (r, n, o) => r[n] **= t(o))));
|
|
762
777
|
const Vt = 90;
|
|
763
778
|
A("in", Vt);
|
|
764
779
|
A("of", Vt);
|
|
765
780
|
a("in", (e, t) => (e = d(e), t = d(t), (r) => e(r) in t(r)));
|
|
766
|
-
const
|
|
781
|
+
const an = 20, fn = 100, pn = (e) => {
|
|
767
782
|
throw Error(e);
|
|
768
783
|
};
|
|
769
|
-
A(">>>",
|
|
770
|
-
A(">>>=",
|
|
784
|
+
A(">>>", fn);
|
|
785
|
+
A(">>>=", an, !0);
|
|
771
786
|
a(">>>", (e, t) => (e = d(e), t = d(t), (r) => e(r) >>> t(r)));
|
|
772
|
-
a(">>>=", (e, t) => (
|
|
773
|
-
const
|
|
787
|
+
a(">>>=", (e, t) => (b(e) || pn("Invalid assignment target"), t = d(t), Z(e, (r, n, o) => r[n] >>>= t(o))));
|
|
788
|
+
const et = 5, hn = 10, mn = 20, gn = (e) => e[0]?.[0] === "," ? e[0].slice(1) : e, ge = (e, t, r) => {
|
|
774
789
|
if (typeof e == "string") {
|
|
775
790
|
r[e] = t;
|
|
776
791
|
return;
|
|
777
792
|
}
|
|
778
|
-
const [n, ...o] = e, s =
|
|
793
|
+
const [n, ...o] = e, s = gn(o);
|
|
779
794
|
if (n === "{}") {
|
|
780
795
|
const i = [];
|
|
781
796
|
for (const u of s) {
|
|
@@ -808,12 +823,12 @@ const Ye = 5, fn = 10, pn = 20, hn = (e) => e[0]?.[0] === "," ? e[0].slice(1) :
|
|
|
808
823
|
}
|
|
809
824
|
}
|
|
810
825
|
}, Ut = (e) => {
|
|
811
|
-
let t = S(
|
|
826
|
+
let t = S(hn - 1);
|
|
812
827
|
return t?.[0] === "in" || t?.[0] === "of" ? [t[0], [e, t[1]], t[2]] : t?.[0] === "," ? [e, ...t.slice(1)] : [e, t];
|
|
813
828
|
};
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
829
|
+
de("let", et + 1, () => Ut("let"));
|
|
830
|
+
de("const", et + 1, () => Ut("const"));
|
|
831
|
+
de("var", et, () => (U(), ["var", S(mn)]));
|
|
817
832
|
const Mt = (...e) => (e = e.map((t) => {
|
|
818
833
|
if (typeof t == "string") return (r) => {
|
|
819
834
|
r[t] = void 0;
|
|
@@ -834,12 +849,12 @@ a("var", (e) => typeof e == "string" ? (t) => {
|
|
|
834
849
|
t[e] = void 0;
|
|
835
850
|
} : () => {
|
|
836
851
|
});
|
|
837
|
-
const
|
|
852
|
+
const tt = 20, we = (e) => {
|
|
838
853
|
throw Error(e);
|
|
839
854
|
};
|
|
840
|
-
A("||=",
|
|
841
|
-
A("&&=",
|
|
842
|
-
A("??=",
|
|
855
|
+
A("||=", tt, !0);
|
|
856
|
+
A("&&=", tt, !0);
|
|
857
|
+
A("??=", tt, !0);
|
|
843
858
|
a("=", (e, t) => {
|
|
844
859
|
if (Array.isArray(e) && (e[0] === "let" || e[0] === "const" || e[0] === "var")) {
|
|
845
860
|
const r = e[1];
|
|
@@ -847,22 +862,22 @@ a("=", (e, t) => {
|
|
|
847
862
|
n[r] = t(n);
|
|
848
863
|
} : (n) => ge(r, t(n), n);
|
|
849
864
|
}
|
|
850
|
-
return
|
|
865
|
+
return b(e) || we("Invalid assignment target"), t = d(t), Z(e, (r, n, o) => r[n] = t(o));
|
|
851
866
|
});
|
|
852
|
-
a("||=", (e, t) => (
|
|
853
|
-
a("&&=", (e, t) => (
|
|
854
|
-
a("??=", (e, t) => (
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
867
|
+
a("||=", (e, t) => (b(e) || we("Invalid assignment target"), t = d(t), Z(e, (r, n, o) => r[n] ||= t(o))));
|
|
868
|
+
a("&&=", (e, t) => (b(e) || we("Invalid assignment target"), t = d(t), Z(e, (r, n, o) => r[n] &&= t(o))));
|
|
869
|
+
a("??=", (e, t) => (b(e) || we("Invalid assignment target"), t = d(t), Z(e, (r, n, o) => r[n] ??= t(o))));
|
|
870
|
+
ue("true", !0);
|
|
871
|
+
ue("false", !1);
|
|
872
|
+
ue("null", null);
|
|
873
|
+
de("undefined", 200, () => []);
|
|
874
|
+
ue("NaN", NaN);
|
|
875
|
+
ue("Infinity", 1 / 0);
|
|
861
876
|
const We = 20;
|
|
862
877
|
j("?", We, (e, t, r) => e && (t = S(We - 1)) && q((n) => n === 58) && (r = S(We - 1), ["?", e, t, r]));
|
|
863
878
|
a("?", (e, t, r) => (e = d(e), t = d(t), r = d(r), (n) => e(n) ? t(n) : r(n)));
|
|
864
|
-
const
|
|
865
|
-
A("=>",
|
|
879
|
+
const yn = [], $n = 20;
|
|
880
|
+
A("=>", $n, !0);
|
|
866
881
|
a("=>", (e, t) => {
|
|
867
882
|
e = e?.[0] === "()" ? e[1] : e;
|
|
868
883
|
const r = e ? e[0] === "," ? e.slice(1) : [e] : [];
|
|
@@ -882,19 +897,19 @@ a("=>", (e, t) => {
|
|
|
882
897
|
const m = t(f);
|
|
883
898
|
return i ? void 0 : m;
|
|
884
899
|
} catch (m) {
|
|
885
|
-
if (m ===
|
|
900
|
+
if (m === yn) return m[0];
|
|
886
901
|
throw m;
|
|
887
902
|
}
|
|
888
903
|
};
|
|
889
904
|
});
|
|
890
|
-
const
|
|
891
|
-
M("...",
|
|
905
|
+
const An = 140;
|
|
906
|
+
M("...", An);
|
|
892
907
|
a("...", (e) => (e = d(e), (t) => Object.entries(e(t))));
|
|
893
|
-
const
|
|
894
|
-
j("?.",
|
|
908
|
+
const ht = 170;
|
|
909
|
+
j("?.", ht, (e, t) => {
|
|
895
910
|
if (!e) return;
|
|
896
911
|
const r = U();
|
|
897
|
-
return r === 40 ? (w(), ["?.()", e, S(0, 41) || null]) : r === 91 ? (w(), ["?.[]", e, S(0, 93)]) : (t = S(
|
|
912
|
+
return r === 40 ? (w(), ["?.()", e, S(0, 41) || null]) : r === 91 ? (w(), ["?.[]", e, S(0, 93)]) : (t = S(ht), t ? ["?.", e, t] : void 0);
|
|
898
913
|
});
|
|
899
914
|
a("?.", (e, t) => (e = d(e), V(t) ? () => {
|
|
900
915
|
} : (r) => e(r)?.[t]));
|
|
@@ -931,14 +946,14 @@ a("?.()", (e, t) => {
|
|
|
931
946
|
const n = d(e);
|
|
932
947
|
return (o) => n(o)?.(...r(o));
|
|
933
948
|
});
|
|
934
|
-
const
|
|
935
|
-
M("typeof",
|
|
936
|
-
M("void",
|
|
937
|
-
M("delete",
|
|
938
|
-
|
|
949
|
+
const oe = 140;
|
|
950
|
+
M("typeof", oe);
|
|
951
|
+
M("void", oe);
|
|
952
|
+
M("delete", oe);
|
|
953
|
+
de(
|
|
939
954
|
"new",
|
|
940
|
-
|
|
941
|
-
() =>
|
|
955
|
+
oe,
|
|
956
|
+
() => _r(".target") ? (w(7), ["new.target"]) : ["new", S(oe)]
|
|
942
957
|
);
|
|
943
958
|
a("typeof", (e) => (e = d(e), (t) => typeof e(t)));
|
|
944
959
|
a("void", (e) => (e = d(e), (t) => (e(t), void 0)));
|
|
@@ -957,52 +972,52 @@ a("new", (e) => {
|
|
|
957
972
|
const t = d(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(d)) : /* @__PURE__ */ ((o) => (s) => [o(s)])(d(r)) : () => [];
|
|
958
973
|
return (o) => new (t(o))(...n(o));
|
|
959
974
|
});
|
|
960
|
-
const
|
|
975
|
+
const rt = /* @__PURE__ */ Symbol("accessor"), nt = 20, Sn = 40, Ht = 41, zt = 123, Bt = 125, Gt = (e) => (t) => {
|
|
961
976
|
if (t) return;
|
|
962
977
|
U();
|
|
963
978
|
const r = q($.id);
|
|
964
|
-
if (!r || (U(), g.charCodeAt(p) !==
|
|
979
|
+
if (!r || (U(), g.charCodeAt(p) !== Sn)) return !1;
|
|
965
980
|
w();
|
|
966
|
-
const n = S(0,
|
|
967
|
-
return U(), g.charCodeAt(p) !==
|
|
981
|
+
const n = S(0, Ht);
|
|
982
|
+
return U(), g.charCodeAt(p) !== zt ? !1 : (w(), [e, r, n, S(0, Bt)]);
|
|
968
983
|
};
|
|
969
|
-
j("get",
|
|
970
|
-
j("set",
|
|
971
|
-
j("(",
|
|
984
|
+
j("get", nt - 1, Gt("get"));
|
|
985
|
+
j("set", nt - 1, Gt("set"));
|
|
986
|
+
j("(", nt - 1, (e) => {
|
|
972
987
|
if (!e || typeof e != "string") return;
|
|
973
|
-
const t = S(0,
|
|
974
|
-
if (U(), g.charCodeAt(p) ===
|
|
988
|
+
const t = S(0, Ht) || null;
|
|
989
|
+
if (U(), g.charCodeAt(p) === zt)
|
|
975
990
|
return w(), [":", e, ["=>", ["()", t], S(0, Bt) || null]];
|
|
976
991
|
});
|
|
977
992
|
a("get", (e, t) => (t = t ? d(t) : () => {
|
|
978
|
-
}, (r) => [[
|
|
993
|
+
}, (r) => [[rt, e, {
|
|
979
994
|
get: function() {
|
|
980
995
|
const n = Object.create(r || {});
|
|
981
996
|
return n.this = this, t(n);
|
|
982
997
|
}
|
|
983
998
|
}]]));
|
|
984
999
|
a("set", (e, t, r) => (r = r ? d(r) : () => {
|
|
985
|
-
}, (n) => [[
|
|
1000
|
+
}, (n) => [[rt, e, {
|
|
986
1001
|
set: function(o) {
|
|
987
1002
|
const s = Object.create(n || {});
|
|
988
1003
|
s.this = this, s[t] = o, r(s);
|
|
989
1004
|
}
|
|
990
1005
|
}]]));
|
|
991
|
-
const
|
|
992
|
-
$.prop = (e) =>
|
|
993
|
-
const
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
A(":",
|
|
1006
|
+
const vn = 20, Kt = 200;
|
|
1007
|
+
$.prop = (e) => Nr(e) !== 58;
|
|
1008
|
+
const En = (e) => e == null || typeof e == "string" || [":", ",", "...", "get", "set"].includes(e[0]);
|
|
1009
|
+
Je("[]", Kt);
|
|
1010
|
+
Je("{}", Kt);
|
|
1011
|
+
A(":", vn - 1, !0);
|
|
997
1012
|
a("{}", (e, t) => {
|
|
998
1013
|
if (t !== void 0) return;
|
|
999
|
-
if (!
|
|
1014
|
+
if (!En(e)) return d(["{", e]);
|
|
1000
1015
|
e = e ? e[0] !== "," ? [e] : e.slice(1) : [];
|
|
1001
1016
|
const r = e.map((n) => d(typeof n == "string" ? [":", n, n] : n));
|
|
1002
1017
|
return (n) => {
|
|
1003
1018
|
const o = {}, s = {};
|
|
1004
1019
|
for (const i of r.flatMap((u) => u(n)))
|
|
1005
|
-
if (i[0] ===
|
|
1020
|
+
if (i[0] === rt) {
|
|
1006
1021
|
const [, u, c] = i;
|
|
1007
1022
|
s[u] = { ...s[u], ...c, configurable: !0, enumerable: !0 };
|
|
1008
1023
|
} else o[i[0]] = i[1];
|
|
@@ -1013,19 +1028,19 @@ a("{}", (e, t) => {
|
|
|
1013
1028
|
a("{", (e) => (e = e ? d(e) : () => {
|
|
1014
1029
|
}, (t) => e(Object.create(t))));
|
|
1015
1030
|
a(":", (e, t) => (t = d(t), Array.isArray(e) ? (e = d(e), (r) => [[e(r), t(r)]]) : (r) => [[e, t(r)]]));
|
|
1016
|
-
const
|
|
1017
|
-
`, r: "\r", t: " ", b: "\b", f: "\f", v: "\v" },
|
|
1031
|
+
const In = 170, ye = 96, wn = 36, On = 123, Cn = 92, Dn = { n: `
|
|
1032
|
+
`, r: "\r", t: " ", b: "\b", f: "\f", v: "\v" }, mt = () => {
|
|
1018
1033
|
const e = [];
|
|
1019
1034
|
for (let t = "", r; (r = g.charCodeAt(p)) !== ye; )
|
|
1020
|
-
r ? r ===
|
|
1035
|
+
r ? r === Cn ? (w(), t += Dn[g[p]] || g[p], w()) : r === wn && g.charCodeAt(p + 1) === On ? (t && e.push([, t]), t = "", w(2), e.push(S(0, 125))) : (t += g[p], w(), r = g.charCodeAt(p), r === ye && t && e.push([, t])) : K("Unterminated template");
|
|
1021
1036
|
return w(), e;
|
|
1022
|
-
},
|
|
1023
|
-
P[ye] = (e, t) => e && t <
|
|
1037
|
+
}, Wn = P[ye];
|
|
1038
|
+
P[ye] = (e, t) => e && t < In ? $.asi && $.newline ? void 0 : (w(), ["``", e, ...mt()]) : (
|
|
1024
1039
|
// tagged
|
|
1025
1040
|
e ? (
|
|
1026
1041
|
// plain
|
|
1027
|
-
|
|
1028
|
-
) : (w(), ((r) => r.length < 2 && r[0]?.[0] === void 0 ? r[0] || [, ""] : ["`", ...r])(
|
|
1042
|
+
Wn?.(e, t)
|
|
1043
|
+
) : (w(), ((r) => r.length < 2 && r[0]?.[0] === void 0 ? r[0] || [, ""] : ["`", ...r])(mt()))
|
|
1029
1044
|
);
|
|
1030
1045
|
a("`", (...e) => (e = e.map(d), (t) => e.map((r) => r(t)).join("")));
|
|
1031
1046
|
a("``", (e, ...t) => {
|
|
@@ -1038,28 +1053,28 @@ a("``", (e, ...t) => {
|
|
|
1038
1053
|
});
|
|
1039
1054
|
$.string["'"] = !0;
|
|
1040
1055
|
$.number = { "0x": 16, "0b": 2, "0o": 8 };
|
|
1041
|
-
const
|
|
1056
|
+
const kn = {
|
|
1042
1057
|
log: (e, t) => (t ? console.log(t, e) : console.log(e), e)
|
|
1043
1058
|
};
|
|
1044
1059
|
function ee(e, t, r, n, o, s) {
|
|
1045
|
-
const i = $(
|
|
1060
|
+
const i = $(ot(e));
|
|
1046
1061
|
return d(i)({
|
|
1047
1062
|
$form: t,
|
|
1048
1063
|
$meta: r,
|
|
1049
1064
|
$errors: n,
|
|
1050
1065
|
$formIsInvalid: o,
|
|
1051
|
-
$log:
|
|
1066
|
+
$log: kn.log,
|
|
1052
1067
|
$fn: {},
|
|
1053
1068
|
...s
|
|
1054
1069
|
}) === !0;
|
|
1055
1070
|
}
|
|
1056
|
-
function
|
|
1071
|
+
function ot(e) {
|
|
1057
1072
|
return e.replace(
|
|
1058
1073
|
/(\?\.|\.)(\d+)/g,
|
|
1059
|
-
(t, r, n, o) => r === "." &&
|
|
1074
|
+
(t, r, n, o) => r === "." && Fn(e, o) ? t : r === "?." ? `?.[${n}]` : `[${n}]`
|
|
1060
1075
|
);
|
|
1061
1076
|
}
|
|
1062
|
-
function
|
|
1077
|
+
function Fn(e, t) {
|
|
1063
1078
|
let r = t - 1, n = !1;
|
|
1064
1079
|
for (; r >= 0 && e[r] >= "0" && e[r] <= "9"; )
|
|
1065
1080
|
n = !0, r--;
|
|
@@ -1068,12 +1083,12 @@ function Wn(e, t) {
|
|
|
1068
1083
|
const o = e[r];
|
|
1069
1084
|
return n ? !/[\w$.\]]/.test(o) : !/[\w$)\]]/.test(o);
|
|
1070
1085
|
}
|
|
1071
|
-
const
|
|
1086
|
+
const Tn = (e) => (t) => {
|
|
1072
1087
|
let r = t.formDef.states;
|
|
1073
1088
|
if (!r || Object.keys(r).length === 0 || t.formHealth.status === "errored")
|
|
1074
1089
|
return t;
|
|
1075
|
-
const { $formIsInvalid: n, $errors: o } =
|
|
1076
|
-
r =
|
|
1090
|
+
const { $formIsInvalid: n, $errors: o } = be(t);
|
|
1091
|
+
r = jn(r);
|
|
1077
1092
|
let s = [], i = { status: "ok" };
|
|
1078
1093
|
try {
|
|
1079
1094
|
s = Object.keys(r).map((u) => {
|
|
@@ -1089,7 +1104,7 @@ const kn = (e) => (t) => {
|
|
|
1089
1104
|
return l === !0 ? u : void 0;
|
|
1090
1105
|
}).filter((u) => u !== void 0);
|
|
1091
1106
|
} catch (u) {
|
|
1092
|
-
const c = u, l =
|
|
1107
|
+
const c = u, l = Q.calculateCurrentStateError;
|
|
1093
1108
|
i = {
|
|
1094
1109
|
status: "errored",
|
|
1095
1110
|
message: `[${l}] ${c.message}`,
|
|
@@ -1098,7 +1113,7 @@ const kn = (e) => (t) => {
|
|
|
1098
1113
|
}
|
|
1099
1114
|
return { ...t, currentStates: s, formHealth: i };
|
|
1100
1115
|
};
|
|
1101
|
-
function
|
|
1116
|
+
function jn(e) {
|
|
1102
1117
|
const t = {};
|
|
1103
1118
|
function r(n) {
|
|
1104
1119
|
const o = n.split(":"), s = [];
|
|
@@ -1114,16 +1129,16 @@ function Fn(e) {
|
|
|
1114
1129
|
}
|
|
1115
1130
|
return t;
|
|
1116
1131
|
}
|
|
1117
|
-
const Y = (e, t) => (r) => e(r) ? t(r) : r, te = (e) => e !== void 0 && typeof e == "object" && e !== null && "when" in e,
|
|
1118
|
-
const { $formIsInvalid: r, $errors: n } =
|
|
1132
|
+
const Y = (e, t) => (r) => e(r) ? t(r) : r, te = (e) => e !== void 0 && typeof e == "object" && e !== null && "when" in e, Pn = (e) => (t) => {
|
|
1133
|
+
const { $formIsInvalid: r, $errors: n } = be(t);
|
|
1119
1134
|
return {
|
|
1120
1135
|
...t,
|
|
1121
|
-
widgetFlags:
|
|
1136
|
+
widgetFlags: Nn(t, n, r, e)
|
|
1122
1137
|
};
|
|
1123
1138
|
};
|
|
1124
|
-
function
|
|
1139
|
+
function Nn(e, t, r, n) {
|
|
1125
1140
|
const o = Object.values(e.flatForm).map((i) => {
|
|
1126
|
-
if (
|
|
1141
|
+
if (G(i)) {
|
|
1127
1142
|
const u = i({
|
|
1128
1143
|
$form: e.data,
|
|
1129
1144
|
errors: void 0,
|
|
@@ -1134,7 +1149,7 @@ function jn(e, t, r, n) {
|
|
|
1134
1149
|
}
|
|
1135
1150
|
return i;
|
|
1136
1151
|
}), s = Object.values(e.materializedRepeaterWidgets);
|
|
1137
|
-
return [...o, ...s].filter((i) => !!(i.include && ("in" in i.include || "when" in i.include) || i.exclude && ("from" in i.exclude || "when" in i.exclude) || (
|
|
1152
|
+
return [...o, ...s].filter((i) => !!(i.include && ("in" in i.include || "when" in i.include) || i.exclude && ("from" in i.exclude || "when" in i.exclude) || (D(i) || ae(i)) && te(i.disabled) || D(i) && te(i.readonly))).reduce(
|
|
1138
1153
|
(i, u) => {
|
|
1139
1154
|
i[u.uid] = i[u.uid] || {};
|
|
1140
1155
|
const c = e.repeaterItemScopes[u.uid], l = c ? { $item: _(e.data, c.itemPath), $index: c.index, $fn: n } : { $fn: n };
|
|
@@ -1156,14 +1171,14 @@ function jn(e, t, r, n) {
|
|
|
1156
1171
|
t,
|
|
1157
1172
|
r,
|
|
1158
1173
|
l
|
|
1159
|
-
)), (
|
|
1174
|
+
)), (D(u) || ae(u)) && te(u.disabled) && (i[u.uid].disabled = ee(
|
|
1160
1175
|
u.disabled.when,
|
|
1161
1176
|
e.data,
|
|
1162
1177
|
e.meta,
|
|
1163
1178
|
t,
|
|
1164
1179
|
r,
|
|
1165
1180
|
l
|
|
1166
|
-
)),
|
|
1181
|
+
)), D(u) && te(u.readonly) && (i[u.uid].readonly = ee(
|
|
1167
1182
|
u.readonly.when,
|
|
1168
1183
|
e.data,
|
|
1169
1184
|
e.meta,
|
|
@@ -1175,9 +1190,9 @@ function jn(e, t, r, n) {
|
|
|
1175
1190
|
{}
|
|
1176
1191
|
);
|
|
1177
1192
|
}
|
|
1178
|
-
const
|
|
1193
|
+
const _n = (e, t) => (r) => {
|
|
1179
1194
|
try {
|
|
1180
|
-
return { ...r, calculatedWidgets:
|
|
1195
|
+
return { ...r, calculatedWidgets: Rn(r, e, t) };
|
|
1181
1196
|
} catch (n) {
|
|
1182
1197
|
const o = n;
|
|
1183
1198
|
return {
|
|
@@ -1190,8 +1205,8 @@ const Pn = (e, t) => (r) => {
|
|
|
1190
1205
|
};
|
|
1191
1206
|
}
|
|
1192
1207
|
};
|
|
1193
|
-
function
|
|
1194
|
-
const { $formIsInvalid: n, $errors: o } =
|
|
1208
|
+
function Rn(e, t, r) {
|
|
1209
|
+
const { $formIsInvalid: n, $errors: o } = be(e), s = to(e, t, n, o, r), i = {};
|
|
1195
1210
|
for (const u of Object.keys(e.calculatedWidgets)) {
|
|
1196
1211
|
if (e.widgetFlags[u]?.hidden)
|
|
1197
1212
|
continue;
|
|
@@ -1200,12 +1215,12 @@ function Nn(e, t, r) {
|
|
|
1200
1215
|
i[u] = c;
|
|
1201
1216
|
continue;
|
|
1202
1217
|
}
|
|
1203
|
-
if (
|
|
1204
|
-
i[u] =
|
|
1218
|
+
if (G(l)) {
|
|
1219
|
+
i[u] = Ln(u, l, e, t, f);
|
|
1205
1220
|
continue;
|
|
1206
1221
|
}
|
|
1207
1222
|
const m = f ? { ...s, $item: _(s.$form, f.itemPath), $index: f.index } : s;
|
|
1208
|
-
i[u] =
|
|
1223
|
+
i[u] = Vn(
|
|
1209
1224
|
c,
|
|
1210
1225
|
l,
|
|
1211
1226
|
e,
|
|
@@ -1214,7 +1229,7 @@ function Nn(e, t, r) {
|
|
|
1214
1229
|
}
|
|
1215
1230
|
return i;
|
|
1216
1231
|
}
|
|
1217
|
-
function
|
|
1232
|
+
function Ln(e, t, r, n, o) {
|
|
1218
1233
|
const s = t({
|
|
1219
1234
|
$form: r.data,
|
|
1220
1235
|
errors: t.path ? r.validations[t.path] : void 0,
|
|
@@ -1225,68 +1240,68 @@ function _n(e, t, r, n, o) {
|
|
|
1225
1240
|
});
|
|
1226
1241
|
return s.uid = e, { source: t, current: s };
|
|
1227
1242
|
}
|
|
1228
|
-
function
|
|
1229
|
-
const o = new
|
|
1230
|
-
return o.write("uid", t.uid), o.write("type", t.type), o.write("kind", t.kind),
|
|
1243
|
+
function Vn(e, t, r, n) {
|
|
1244
|
+
const o = new eo(t, e.current);
|
|
1245
|
+
return o.write("uid", t.uid), o.write("type", t.type), o.write("kind", t.kind), gr(t) ? Un(o, n) : ae(t) ? Mn(o, n) : D(t) ? Hn(o, n) : re(t) && zn(o, n), Bn(t, o, n, r), (ae(t) || D(t)) && Gn(t, o, n), re(t) && Kn(t, o, r), o.changed ? { source: e.source, current: o.current } : e;
|
|
1231
1246
|
}
|
|
1232
|
-
function
|
|
1247
|
+
function Un(e, t) {
|
|
1233
1248
|
v(e, t, "size"), v(e, t, "include"), v(e, t, "exclude");
|
|
1234
1249
|
}
|
|
1235
|
-
function
|
|
1250
|
+
function Mn(e, t) {
|
|
1236
1251
|
v(e, t, "size"), v(e, t, "include"), v(e, t, "exclude"), v(e, t, "label"), v(e, t, "disabled"), v(e, t, "actionType");
|
|
1237
1252
|
}
|
|
1238
|
-
function
|
|
1253
|
+
function Hn(e, t) {
|
|
1239
1254
|
v(e, t, "size"), v(e, t, "include"), v(e, t, "exclude"), v(e, t, "label"), v(e, t, "disabled"), v(e, t, "readonly"), v(e, t, "validator"), v(e, t, "path"), v(e, t, "defaultValue");
|
|
1240
1255
|
}
|
|
1241
|
-
function
|
|
1256
|
+
function zn(e, t) {
|
|
1242
1257
|
v(e, t, "size"), v(e, t, "include"), v(e, t, "exclude");
|
|
1243
1258
|
}
|
|
1244
|
-
function
|
|
1259
|
+
function Bn(e, t, r, n) {
|
|
1245
1260
|
const o = n.widgetPropOverrides[e.uid] ?? {}, s = { ...e.props ?? {}, ...o };
|
|
1246
1261
|
for (const i of Jt(Object.keys(s)))
|
|
1247
|
-
|
|
1262
|
+
bn(t, r, i);
|
|
1248
1263
|
}
|
|
1249
|
-
function
|
|
1264
|
+
function Gn(e, t, r) {
|
|
1250
1265
|
const n = e.on ?? {};
|
|
1251
1266
|
for (const o of Jt(Object.keys(n)))
|
|
1252
|
-
|
|
1267
|
+
Xn(t, r, o);
|
|
1253
1268
|
}
|
|
1254
|
-
function
|
|
1255
|
-
const n = Qt(e.uid), o =
|
|
1269
|
+
function Kn(e, t, r) {
|
|
1270
|
+
const n = Qt(e.uid), o = no(e.children, n, r.widgetFlags);
|
|
1256
1271
|
t.current.children = o;
|
|
1257
1272
|
const s = t.previous.children ?? [];
|
|
1258
1273
|
s.length === o.length && o.every((u, c) => s[c] && s[c].uid === o[c].uid) || t.markChanged();
|
|
1259
1274
|
}
|
|
1260
1275
|
function v(e, t, r) {
|
|
1261
1276
|
const n = e.source;
|
|
1262
|
-
if (!
|
|
1277
|
+
if (!ro(n, r))
|
|
1263
1278
|
return;
|
|
1264
|
-
const o =
|
|
1279
|
+
const o = it(n, r, t.sortedStates);
|
|
1265
1280
|
let s;
|
|
1266
1281
|
switch (r) {
|
|
1267
1282
|
case "disabled":
|
|
1268
1283
|
case "readonly":
|
|
1269
|
-
s =
|
|
1284
|
+
s = xn(o, t, e.source.uid, r);
|
|
1270
1285
|
break;
|
|
1271
1286
|
case "defaultValue":
|
|
1272
1287
|
s = o;
|
|
1273
1288
|
break;
|
|
1274
1289
|
default:
|
|
1275
|
-
s =
|
|
1290
|
+
s = Xt(o, t);
|
|
1276
1291
|
}
|
|
1277
1292
|
e.write(r, s);
|
|
1278
1293
|
}
|
|
1279
|
-
function
|
|
1280
|
-
const n = e.source.props, o =
|
|
1281
|
-
let s =
|
|
1294
|
+
function bn(e, t, r) {
|
|
1295
|
+
const n = e.source.props, o = it(n, r, t.sortedStates);
|
|
1296
|
+
let s = Xt(o, t);
|
|
1282
1297
|
const i = t.widgetPropOverrides[e.source.uid]?.[r];
|
|
1283
1298
|
i !== void 0 && (s = i), e.write(`props.${r}`, s);
|
|
1284
1299
|
}
|
|
1285
|
-
function
|
|
1286
|
-
const n = e.source.on, o =
|
|
1287
|
-
e.write(`on.${r}`,
|
|
1300
|
+
function Xn(e, t, r) {
|
|
1301
|
+
const n = e.source.on, o = it(n, r, t.sortedStates);
|
|
1302
|
+
e.write(`on.${r}`, qn(o, t));
|
|
1288
1303
|
}
|
|
1289
|
-
function
|
|
1304
|
+
function st(e, t) {
|
|
1290
1305
|
return e({
|
|
1291
1306
|
$form: t.$form,
|
|
1292
1307
|
translate: t.localization.translate,
|
|
@@ -1294,13 +1309,13 @@ function ot(e, t) {
|
|
|
1294
1309
|
$index: t.$index
|
|
1295
1310
|
});
|
|
1296
1311
|
}
|
|
1297
|
-
function
|
|
1298
|
-
return t.localization.translate(e.key,
|
|
1312
|
+
function Jn(e, t) {
|
|
1313
|
+
return t.localization.translate(e.key, Yn(e.params, t), e.default);
|
|
1299
1314
|
}
|
|
1300
|
-
const
|
|
1301
|
-
function
|
|
1302
|
-
return e.includes("{{") ? e.replace(
|
|
1303
|
-
const o =
|
|
1315
|
+
const Qn = /\{\{([^}]+)\}\}/g;
|
|
1316
|
+
function bt(e, t) {
|
|
1317
|
+
return e.includes("{{") ? e.replace(Qn, (r, n) => {
|
|
1318
|
+
const o = ot(n.trim());
|
|
1304
1319
|
try {
|
|
1305
1320
|
const s = d($(o))({
|
|
1306
1321
|
$form: t.$form,
|
|
@@ -1318,16 +1333,16 @@ function Xt(e, t) {
|
|
|
1318
1333
|
}
|
|
1319
1334
|
}) : e;
|
|
1320
1335
|
}
|
|
1321
|
-
function
|
|
1322
|
-
return typeof e == "function" ?
|
|
1336
|
+
function Xt(e, t) {
|
|
1337
|
+
return typeof e == "function" ? st(e, t) : Dr(e) ? Jn(e, t) : typeof e == "string" ? bt(e, t) : e;
|
|
1323
1338
|
}
|
|
1324
|
-
function
|
|
1325
|
-
return typeof e == "function" ?
|
|
1339
|
+
function xn(e, t, r, n) {
|
|
1340
|
+
return typeof e == "function" ? st(e, t) : te(e) ? t.widgetFlags[r]?.[n] : typeof e == "string" ? bt(e, t) : e;
|
|
1326
1341
|
}
|
|
1327
|
-
function
|
|
1328
|
-
return typeof e == "function" ?
|
|
1342
|
+
function qn(e, t) {
|
|
1343
|
+
return typeof e == "function" ? st(e, t) : e;
|
|
1329
1344
|
}
|
|
1330
|
-
function
|
|
1345
|
+
function it(e, t, r) {
|
|
1331
1346
|
if (e) {
|
|
1332
1347
|
for (const n of r) {
|
|
1333
1348
|
const o = e[`${t}.${n}`];
|
|
@@ -1337,15 +1352,15 @@ function st(e, t, r) {
|
|
|
1337
1352
|
return e[t];
|
|
1338
1353
|
}
|
|
1339
1354
|
}
|
|
1340
|
-
function
|
|
1355
|
+
function Zn(e) {
|
|
1341
1356
|
return e.startsWith("$form") || e.startsWith("$meta") || e.startsWith("$errors") || e.startsWith("$item") || e.startsWith("$index") || e.startsWith("$fn") || e === "$formIsInvalid";
|
|
1342
1357
|
}
|
|
1343
|
-
function
|
|
1358
|
+
function Yn(e, t) {
|
|
1344
1359
|
return e && Object.keys(e).reduce((r, n) => {
|
|
1345
1360
|
const o = String(e[n]);
|
|
1346
|
-
if (
|
|
1361
|
+
if (Zn(o))
|
|
1347
1362
|
try {
|
|
1348
|
-
const s = d($(
|
|
1363
|
+
const s = d($(ot(o)))({
|
|
1349
1364
|
$form: t.$form,
|
|
1350
1365
|
$meta: t.$meta,
|
|
1351
1366
|
$errors: t.$errors,
|
|
@@ -1364,7 +1379,7 @@ function qn(e, t) {
|
|
|
1364
1379
|
return r;
|
|
1365
1380
|
}, {});
|
|
1366
1381
|
}
|
|
1367
|
-
class
|
|
1382
|
+
class eo {
|
|
1368
1383
|
constructor(t, r) {
|
|
1369
1384
|
this._changed = !1, this.source = t, this.previous = r, this.current = {};
|
|
1370
1385
|
}
|
|
@@ -1375,10 +1390,10 @@ class Zn {
|
|
|
1375
1390
|
this._changed = !0;
|
|
1376
1391
|
}
|
|
1377
1392
|
write(t, r) {
|
|
1378
|
-
|
|
1393
|
+
Ge(this.current, t, r), _(this.previous, t) !== r && (this._changed = !0);
|
|
1379
1394
|
}
|
|
1380
1395
|
}
|
|
1381
|
-
function
|
|
1396
|
+
function to(e, t, r, n, o) {
|
|
1382
1397
|
return {
|
|
1383
1398
|
sortedStates: [...e.currentStates].sort((s, i) => i.length - s.length),
|
|
1384
1399
|
widgetPropOverrides: e.widgetPropOverrides,
|
|
@@ -1391,7 +1406,7 @@ function Yn(e, t, r, n, o) {
|
|
|
1391
1406
|
$fn: o
|
|
1392
1407
|
};
|
|
1393
1408
|
}
|
|
1394
|
-
function
|
|
1409
|
+
function ro(e, t) {
|
|
1395
1410
|
if (t in e)
|
|
1396
1411
|
return !0;
|
|
1397
1412
|
const r = `${t}.`;
|
|
@@ -1400,7 +1415,7 @@ function eo(e, t) {
|
|
|
1400
1415
|
function Jt(e) {
|
|
1401
1416
|
return Array.from(new Set(e.map((t) => t.split(".")[0])));
|
|
1402
1417
|
}
|
|
1403
|
-
function
|
|
1418
|
+
function no(e, t, r) {
|
|
1404
1419
|
const n = t.map((o) => `[${o}]`).join("");
|
|
1405
1420
|
return e.filter((o) => {
|
|
1406
1421
|
const s = o.uid + n, i = r[s];
|
|
@@ -1410,10 +1425,10 @@ function to(e, t, r) {
|
|
|
1410
1425
|
const Qt = (e) => [...e.matchAll(/\[(\d+)\]/g)].map((t) => parseInt(t[1], 10));
|
|
1411
1426
|
class xt extends Error {
|
|
1412
1427
|
constructor() {
|
|
1413
|
-
super(...arguments), this.code =
|
|
1428
|
+
super(...arguments), this.code = Q.resolveStringInterpolationError, this.name = "StringInterpolationError";
|
|
1414
1429
|
}
|
|
1415
1430
|
}
|
|
1416
|
-
const
|
|
1431
|
+
const oo = ({ lang: e }, t) => {
|
|
1417
1432
|
const r = {
|
|
1418
1433
|
...wt(e),
|
|
1419
1434
|
formName: t.payload.formName
|
|
@@ -1423,7 +1438,7 @@ const ro = ({ lang: e }, t) => {
|
|
|
1423
1438
|
try {
|
|
1424
1439
|
n = JSON.parse(n);
|
|
1425
1440
|
} catch (l) {
|
|
1426
|
-
const f = l, m =
|
|
1441
|
+
const f = l, m = Q.initializeParseError;
|
|
1427
1442
|
o = {
|
|
1428
1443
|
status: "errored",
|
|
1429
1444
|
message: `[${m}] ${f.message}`,
|
|
@@ -1447,7 +1462,7 @@ const ro = ({ lang: e }, t) => {
|
|
|
1447
1462
|
o = { status: "ok" };
|
|
1448
1463
|
let l = {};
|
|
1449
1464
|
try {
|
|
1450
|
-
l =
|
|
1465
|
+
l = Ke([s.value.form]).reduce(
|
|
1451
1466
|
(f, m) => {
|
|
1452
1467
|
const h = m.uid;
|
|
1453
1468
|
if (f[h])
|
|
@@ -1457,19 +1472,19 @@ const ro = ({ lang: e }, t) => {
|
|
|
1457
1472
|
{}
|
|
1458
1473
|
);
|
|
1459
1474
|
} catch (f) {
|
|
1460
|
-
o =
|
|
1475
|
+
o = uo(f.existingWidget, f.newWidget), l = {};
|
|
1461
1476
|
}
|
|
1462
|
-
return
|
|
1477
|
+
return co(l, s.value.states), {
|
|
1463
1478
|
...r,
|
|
1464
1479
|
formDef: s.value,
|
|
1465
1480
|
flatForm: l,
|
|
1466
1481
|
formHealth: o
|
|
1467
1482
|
};
|
|
1468
1483
|
}
|
|
1469
|
-
const i =
|
|
1484
|
+
const i = io(n);
|
|
1470
1485
|
if (i)
|
|
1471
1486
|
return { ...r, formHealth: i };
|
|
1472
|
-
const u =
|
|
1487
|
+
const u = Q.initializeUnknownError, c = s.issues.map((l) => `${l.path.length > 0 ? St(l.path) : "root"}: ${l.message}`).join("; ");
|
|
1473
1488
|
return {
|
|
1474
1489
|
...r,
|
|
1475
1490
|
formHealth: {
|
|
@@ -1482,20 +1497,20 @@ const ro = ({ lang: e }, t) => {
|
|
|
1482
1497
|
function qt(e, t) {
|
|
1483
1498
|
return { status: "errored", code: e, message: `[${e}] ${t}` };
|
|
1484
1499
|
}
|
|
1485
|
-
function
|
|
1500
|
+
function so() {
|
|
1486
1501
|
return "Malformed form definition. Pass it directly as formDef - `config={{ formDef: { states, form: [...] } }}`. Do NOT wrap it in an extra `{ form: ... }`.";
|
|
1487
1502
|
}
|
|
1488
|
-
function
|
|
1503
|
+
function io(e) {
|
|
1489
1504
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
1490
1505
|
return null;
|
|
1491
1506
|
const t = e.form;
|
|
1492
|
-
return t && typeof t == "object" && !Array.isArray(t) && !
|
|
1507
|
+
return t && typeof t == "object" && !Array.isArray(t) && !re(t) ? qt(Q.initializeMalformedFormShapeError, so()) : null;
|
|
1493
1508
|
}
|
|
1494
|
-
function
|
|
1495
|
-
const r = (o) =>
|
|
1496
|
-
return qt(
|
|
1509
|
+
function uo(e, t) {
|
|
1510
|
+
const r = (o) => D(o) ? ` at "${o.path}"` : "", n = `Duplicate UID "${t.uid}": Assigned to widget "${e.type}"${r(e)} and "${t.type}"${r(t)}.`;
|
|
1511
|
+
return qt(Q.initializeUidCollisionError, n);
|
|
1497
1512
|
}
|
|
1498
|
-
function
|
|
1513
|
+
function co(e, t) {
|
|
1499
1514
|
const r = new Set(Object.keys(t ?? {})), n = /* @__PURE__ */ new Map();
|
|
1500
1515
|
for (const s of Object.values(e)) {
|
|
1501
1516
|
const i = [], u = s.include;
|
|
@@ -1517,7 +1532,7 @@ function io(e, t) {
|
|
|
1517
1532
|
`[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.`
|
|
1518
1533
|
);
|
|
1519
1534
|
}
|
|
1520
|
-
function
|
|
1535
|
+
function lo(e, t) {
|
|
1521
1536
|
return {
|
|
1522
1537
|
...e,
|
|
1523
1538
|
injectedValidations: {
|
|
@@ -1526,16 +1541,16 @@ function uo(e, t) {
|
|
|
1526
1541
|
}
|
|
1527
1542
|
};
|
|
1528
1543
|
}
|
|
1529
|
-
function
|
|
1544
|
+
function gt(e, t) {
|
|
1530
1545
|
const r = Zt(e.uid, t);
|
|
1531
|
-
if (
|
|
1546
|
+
if (G(e)) {
|
|
1532
1547
|
const n = (o) => e(o);
|
|
1533
|
-
return n.uid = r, n.type = e.type, e.path !== void 0 && (n.path =
|
|
1548
|
+
return n.uid = r, n.type = e.type, e.path !== void 0 && (n.path = yt(e.path, t)), n;
|
|
1534
1549
|
}
|
|
1535
|
-
return
|
|
1550
|
+
return D(e) ? {
|
|
1536
1551
|
...e,
|
|
1537
1552
|
uid: r,
|
|
1538
|
-
path:
|
|
1553
|
+
path: yt(e.path, t)
|
|
1539
1554
|
} : {
|
|
1540
1555
|
...e,
|
|
1541
1556
|
uid: r
|
|
@@ -1547,7 +1562,7 @@ function Zt(e, t) {
|
|
|
1547
1562
|
const r = t.reduce((n, o) => `${n}[${o}]`, "");
|
|
1548
1563
|
return `${e}${r}`;
|
|
1549
1564
|
}
|
|
1550
|
-
function
|
|
1565
|
+
function yt(e, t) {
|
|
1551
1566
|
if (t.length === 0)
|
|
1552
1567
|
throw new Error("Repeater indexes cannot be an empty array");
|
|
1553
1568
|
const r = "items", n = e.split(`.${r}`), o = n.length - 1;
|
|
@@ -1557,31 +1572,31 @@ function gt(e, t) {
|
|
|
1557
1572
|
);
|
|
1558
1573
|
return n.reduce((s, i, u) => u === 0 ? i : `${s}.${t[u - 1]}${i}`);
|
|
1559
1574
|
}
|
|
1560
|
-
function
|
|
1575
|
+
function ao(e, t) {
|
|
1561
1576
|
let r = 0;
|
|
1562
1577
|
return e.replace(/\.items(\??)\./g, (n, o) => {
|
|
1563
1578
|
const s = t[r++];
|
|
1564
1579
|
return s === void 0 ? n : `.${s}${o}.`;
|
|
1565
1580
|
});
|
|
1566
1581
|
}
|
|
1567
|
-
const
|
|
1568
|
-
function
|
|
1582
|
+
const fo = ["include", "exclude", "disabled", "readonly"];
|
|
1583
|
+
function po(e, t) {
|
|
1569
1584
|
const r = { ...e };
|
|
1570
|
-
for (const n of
|
|
1585
|
+
for (const n of fo) {
|
|
1571
1586
|
const o = r[n];
|
|
1572
|
-
|
|
1587
|
+
ho(o) && (r[n] = {
|
|
1573
1588
|
...o,
|
|
1574
|
-
when:
|
|
1589
|
+
when: ao(o.when, t)
|
|
1575
1590
|
});
|
|
1576
1591
|
}
|
|
1577
1592
|
return r;
|
|
1578
1593
|
}
|
|
1579
|
-
function
|
|
1594
|
+
function ho(e) {
|
|
1580
1595
|
return e !== null && typeof e == "object" && "when" in e && typeof e.when == "string";
|
|
1581
1596
|
}
|
|
1582
1597
|
const R = (e) => {
|
|
1583
1598
|
const t = {}, r = {}, n = Object.values(e.flatForm).filter(
|
|
1584
|
-
(o) => !
|
|
1599
|
+
(o) => !G(o) && o.type === "repeater"
|
|
1585
1600
|
);
|
|
1586
1601
|
for (const o of n)
|
|
1587
1602
|
Yt(e, o, [], t, r);
|
|
@@ -1591,9 +1606,9 @@ function Yt(e, t, r, n, o) {
|
|
|
1591
1606
|
const s = t.props.template, i = _(e.data, t.path);
|
|
1592
1607
|
Array.isArray(i) && i.forEach((u, c) => {
|
|
1593
1608
|
const l = [...r, c], f = { itemPath: `${t.path}.${c}`, index: c };
|
|
1594
|
-
|
|
1609
|
+
Ke([s]).forEach((m) => {
|
|
1595
1610
|
let h;
|
|
1596
|
-
if (
|
|
1611
|
+
if (G(m) ? (h = m({
|
|
1597
1612
|
$form: e.data,
|
|
1598
1613
|
$item: u,
|
|
1599
1614
|
$index: c,
|
|
@@ -1601,26 +1616,26 @@ function Yt(e, t, r, n, o) {
|
|
|
1601
1616
|
touched: void 0,
|
|
1602
1617
|
translate: void 0
|
|
1603
1618
|
}), h.uid = m.uid) : h = m, h.type === "repeater") {
|
|
1604
|
-
const X =
|
|
1619
|
+
const X = gt(
|
|
1605
1620
|
h,
|
|
1606
1621
|
l
|
|
1607
1622
|
);
|
|
1608
1623
|
n[Zt(h.uid, l)] = f, Yt(e, X, l, n, o);
|
|
1609
1624
|
return;
|
|
1610
1625
|
}
|
|
1611
|
-
const O =
|
|
1612
|
-
|
|
1626
|
+
const O = po(
|
|
1627
|
+
gt(h, l),
|
|
1613
1628
|
l
|
|
1614
1629
|
);
|
|
1615
1630
|
n[O.uid] = f, o[O.uid] = O;
|
|
1616
1631
|
});
|
|
1617
1632
|
});
|
|
1618
1633
|
}
|
|
1619
|
-
const
|
|
1634
|
+
const mo = (e, { payload: t }) => {
|
|
1620
1635
|
let r;
|
|
1621
1636
|
if ("path" in t) {
|
|
1622
1637
|
if (r = Object.values(e.calculatedWidgets).find(
|
|
1623
|
-
({ source: s }) =>
|
|
1638
|
+
({ source: s }) => D(s) && s.path === t.path
|
|
1624
1639
|
), !r)
|
|
1625
1640
|
return console.warn(`Input with path "${t.path}" not found`), e;
|
|
1626
1641
|
} else if (r = e.calculatedWidgets[t.uid], !r)
|
|
@@ -1634,57 +1649,57 @@ const po = (e, { payload: t }) => {
|
|
|
1634
1649
|
}
|
|
1635
1650
|
};
|
|
1636
1651
|
};
|
|
1637
|
-
function
|
|
1652
|
+
function go(e, t) {
|
|
1638
1653
|
return N(
|
|
1639
1654
|
e,
|
|
1640
|
-
mo(t),
|
|
1641
|
-
go(t),
|
|
1642
1655
|
yo(t),
|
|
1643
|
-
$o(t)
|
|
1656
|
+
$o(t),
|
|
1657
|
+
Ao(t),
|
|
1658
|
+
So(t)
|
|
1644
1659
|
);
|
|
1645
1660
|
}
|
|
1646
|
-
const
|
|
1661
|
+
const yo = (e) => (t) => ({
|
|
1647
1662
|
...t,
|
|
1648
1663
|
widgetFlags: {
|
|
1649
1664
|
...Ee(t.widgetFlags, e.payload.uid)
|
|
1650
1665
|
}
|
|
1651
|
-
}),
|
|
1666
|
+
}), $o = (e) => (t) => ({
|
|
1652
1667
|
...t,
|
|
1653
1668
|
// TODO: has this already been removed in calculate-widget-props??? Do we need this at all?
|
|
1654
1669
|
calculatedWidgets: {
|
|
1655
1670
|
...Ee(t.calculatedWidgets, e.payload.uid)
|
|
1656
1671
|
}
|
|
1657
|
-
}),
|
|
1672
|
+
}), Ao = (e) => (t) => ({
|
|
1658
1673
|
...t,
|
|
1659
1674
|
widgetPropOverrides: {
|
|
1660
1675
|
...Ee(t.widgetPropOverrides, e.payload.uid)
|
|
1661
1676
|
}
|
|
1662
|
-
}),
|
|
1677
|
+
}), So = (e) => (t) => ({
|
|
1663
1678
|
...t,
|
|
1664
1679
|
touchedControls: N(t.touchedControls, (r) => {
|
|
1665
1680
|
const n = t.flatForm[e.payload.uid];
|
|
1666
|
-
return n &&
|
|
1681
|
+
return n && D(n) ? Ee(r, n.path) : r;
|
|
1667
1682
|
})
|
|
1668
|
-
}),
|
|
1683
|
+
}), vo = (e, t) => ({
|
|
1669
1684
|
...e,
|
|
1670
1685
|
data: { ...t.payload.data }
|
|
1671
|
-
}),
|
|
1686
|
+
}), Eo = (e, t) => ({
|
|
1672
1687
|
...e,
|
|
1673
1688
|
formHealth: t.payload.formHealth
|
|
1674
|
-
}),
|
|
1689
|
+
}), Io = (e, t) => ({
|
|
1675
1690
|
...e,
|
|
1676
1691
|
lang: t.payload.lang
|
|
1677
|
-
}),
|
|
1692
|
+
}), wo = (e, t) => ({
|
|
1678
1693
|
...e,
|
|
1679
1694
|
meta: { ...t.payload.meta }
|
|
1680
|
-
}),
|
|
1695
|
+
}), Oo = (e, t) => {
|
|
1681
1696
|
const r = _(e.data, t.payload.path);
|
|
1682
1697
|
return t.type === "SET_WIDGET_DATA" || t.type === "SET_WIDGET_INITIAL_DATA" && r === void 0 ? {
|
|
1683
1698
|
...e,
|
|
1684
|
-
data: { ...
|
|
1699
|
+
data: { ...Ge(e.data, t.payload.path, t.payload.data) }
|
|
1685
1700
|
} : e;
|
|
1686
1701
|
}, er = /* @__PURE__ */ Symbol("filterMap.skip");
|
|
1687
|
-
function
|
|
1702
|
+
function Co(e, t) {
|
|
1688
1703
|
const r = [];
|
|
1689
1704
|
for (let n = 0; n < e.length; n++) {
|
|
1690
1705
|
const o = t(e[n], n, e);
|
|
@@ -1692,11 +1707,11 @@ function wo(e, t) {
|
|
|
1692
1707
|
}
|
|
1693
1708
|
return r;
|
|
1694
1709
|
}
|
|
1695
|
-
function
|
|
1710
|
+
function zo(e, t, r) {
|
|
1696
1711
|
for (let n = 0; n < e.length; n++)
|
|
1697
1712
|
t(e[n], n, e) && r(e[n], n, e);
|
|
1698
1713
|
}
|
|
1699
|
-
function
|
|
1714
|
+
function Do(e, t, r) {
|
|
1700
1715
|
if (e.length !== t.length)
|
|
1701
1716
|
return !1;
|
|
1702
1717
|
for (let n = 0; n < e.length; n++)
|
|
@@ -1705,9 +1720,9 @@ function Oo(e, t, r) {
|
|
|
1705
1720
|
return !0;
|
|
1706
1721
|
}
|
|
1707
1722
|
const ke = (e, t) => (r) => {
|
|
1708
|
-
const n =
|
|
1723
|
+
const n = Co(
|
|
1709
1724
|
Object.values(r.calculatedWidgets),
|
|
1710
|
-
({ current: s }) =>
|
|
1725
|
+
({ current: s }) => D(s) ? s : er
|
|
1711
1726
|
), o = r.validations;
|
|
1712
1727
|
return {
|
|
1713
1728
|
...r,
|
|
@@ -1720,7 +1735,7 @@ const ke = (e, t) => (r) => {
|
|
|
1720
1735
|
);
|
|
1721
1736
|
s[i.path] = dr(l) ? null : l.issues.map((f) => f.message);
|
|
1722
1737
|
}
|
|
1723
|
-
return Array.isArray(s[i.path]) && Array.isArray(o[i.path]) &&
|
|
1738
|
+
return Array.isArray(s[i.path]) && Array.isArray(o[i.path]) && Do(
|
|
1724
1739
|
s[i.path],
|
|
1725
1740
|
o[i.path],
|
|
1726
1741
|
(u, c) => u === c
|
|
@@ -1729,20 +1744,20 @@ const ke = (e, t) => (r) => {
|
|
|
1729
1744
|
{}
|
|
1730
1745
|
)
|
|
1731
1746
|
};
|
|
1732
|
-
},
|
|
1747
|
+
}, Wo = ({
|
|
1733
1748
|
validators: e,
|
|
1734
1749
|
validateOn: t,
|
|
1735
1750
|
localization: r,
|
|
1736
1751
|
functions: n
|
|
1737
1752
|
}) => {
|
|
1738
|
-
const o =
|
|
1753
|
+
const o = Tn(n), s = Pn(n), i = _n(r, n);
|
|
1739
1754
|
return (u, c) => {
|
|
1740
1755
|
switch (c.type) {
|
|
1741
1756
|
case "INITIALIZE":
|
|
1742
|
-
return
|
|
1757
|
+
return oo(u, c);
|
|
1743
1758
|
case "SET_DATA":
|
|
1744
1759
|
return N(
|
|
1745
|
-
|
|
1760
|
+
vo(u, c),
|
|
1746
1761
|
o,
|
|
1747
1762
|
R,
|
|
1748
1763
|
s,
|
|
@@ -1750,25 +1765,25 @@ const ke = (e, t) => (r) => {
|
|
|
1750
1765
|
);
|
|
1751
1766
|
case "SET_META":
|
|
1752
1767
|
return N(
|
|
1753
|
-
|
|
1768
|
+
wo(u, c),
|
|
1754
1769
|
o,
|
|
1755
1770
|
R,
|
|
1756
1771
|
s,
|
|
1757
1772
|
i
|
|
1758
1773
|
);
|
|
1759
1774
|
case "SET_LANGUAGE":
|
|
1760
|
-
return N(
|
|
1775
|
+
return N(Io(u, c), i);
|
|
1761
1776
|
case "ADD_WIDGET":
|
|
1762
1777
|
return N(
|
|
1763
|
-
|
|
1764
|
-
Y(
|
|
1765
|
-
Y(
|
|
1766
|
-
Y(
|
|
1767
|
-
Y(
|
|
1778
|
+
Pr(u, c),
|
|
1779
|
+
Y(ce, o),
|
|
1780
|
+
Y(ce, R),
|
|
1781
|
+
Y(ce, s),
|
|
1782
|
+
Y(ce, i)
|
|
1768
1783
|
);
|
|
1769
1784
|
case "REMOVE_WIDGET":
|
|
1770
1785
|
return N(
|
|
1771
|
-
|
|
1786
|
+
go(u, c),
|
|
1772
1787
|
o,
|
|
1773
1788
|
R,
|
|
1774
1789
|
s,
|
|
@@ -1777,7 +1792,7 @@ const ke = (e, t) => (r) => {
|
|
|
1777
1792
|
case "SET_WIDGET_INITIAL_DATA":
|
|
1778
1793
|
case "SET_WIDGET_DATA":
|
|
1779
1794
|
return N(
|
|
1780
|
-
|
|
1795
|
+
Oo(u, c),
|
|
1781
1796
|
o,
|
|
1782
1797
|
R,
|
|
1783
1798
|
s,
|
|
@@ -1785,7 +1800,7 @@ const ke = (e, t) => (r) => {
|
|
|
1785
1800
|
);
|
|
1786
1801
|
case "OVERRIDE_WIDGET_PROP":
|
|
1787
1802
|
return N(
|
|
1788
|
-
|
|
1803
|
+
mo(u, c),
|
|
1789
1804
|
o,
|
|
1790
1805
|
R,
|
|
1791
1806
|
s,
|
|
@@ -1795,7 +1810,7 @@ const ke = (e, t) => (r) => {
|
|
|
1795
1810
|
Y(
|
|
1796
1811
|
(l) => {
|
|
1797
1812
|
let f = !1, m = "";
|
|
1798
|
-
"path" in c.payload ? (f = !0, m = c.payload.path) :
|
|
1813
|
+
"path" in c.payload ? (f = !0, m = c.payload.path) : D(l.calculatedWidgets[c.payload.uid].current) && (f = !0, m = l.calculatedWidgets[c.payload.uid].current.path);
|
|
1799
1814
|
const h = f && l.touchedControls[m];
|
|
1800
1815
|
return l.touched && h;
|
|
1801
1816
|
},
|
|
@@ -1803,7 +1818,7 @@ const ke = (e, t) => (r) => {
|
|
|
1803
1818
|
)
|
|
1804
1819
|
);
|
|
1805
1820
|
case "SET_FORM_HEALTH":
|
|
1806
|
-
return
|
|
1821
|
+
return Eo(u, c);
|
|
1807
1822
|
case "VALIDATE_ALL":
|
|
1808
1823
|
return N(
|
|
1809
1824
|
{
|
|
@@ -1812,7 +1827,7 @@ const ke = (e, t) => (r) => {
|
|
|
1812
1827
|
touchedControls: Object.keys(u.calculatedWidgets).reduce(
|
|
1813
1828
|
(l, f) => {
|
|
1814
1829
|
const m = u.calculatedWidgets[f].source;
|
|
1815
|
-
return
|
|
1830
|
+
return D(m) && (l[m.path] = !0), l;
|
|
1816
1831
|
},
|
|
1817
1832
|
{}
|
|
1818
1833
|
)
|
|
@@ -1823,7 +1838,7 @@ const ke = (e, t) => (r) => {
|
|
|
1823
1838
|
R,
|
|
1824
1839
|
s,
|
|
1825
1840
|
i,
|
|
1826
|
-
|
|
1841
|
+
$t
|
|
1827
1842
|
);
|
|
1828
1843
|
case "ATTEMPT_VALIDATION": {
|
|
1829
1844
|
const l = c.payload.reason, f = c.payload.path;
|
|
@@ -1842,9 +1857,9 @@ const ke = (e, t) => (r) => {
|
|
|
1842
1857
|
// TODO: extract this into a separate function
|
|
1843
1858
|
// When the widget is a Widget Function, we propagate the validation result immediately
|
|
1844
1859
|
(h) => {
|
|
1845
|
-
const O = c.payload.uid, X = h.calculatedWidgets[O],
|
|
1846
|
-
if (
|
|
1847
|
-
const Oe = h.repeaterItemScopes[O], nr =
|
|
1860
|
+
const O = c.payload.uid, X = h.calculatedWidgets[O], ut = X.source;
|
|
1861
|
+
if (G(ut)) {
|
|
1862
|
+
const Oe = h.repeaterItemScopes[O], nr = ut({
|
|
1848
1863
|
$form: h.data,
|
|
1849
1864
|
errors: h.validations[f],
|
|
1850
1865
|
touched: !0,
|
|
@@ -1865,17 +1880,17 @@ const ke = (e, t) => (r) => {
|
|
|
1865
1880
|
}
|
|
1866
1881
|
return h;
|
|
1867
1882
|
},
|
|
1868
|
-
|
|
1883
|
+
$t
|
|
1869
1884
|
) : u;
|
|
1870
1885
|
}
|
|
1871
1886
|
case "INJECT_VALIDATION_ISSUES":
|
|
1872
|
-
return
|
|
1887
|
+
return lo(u, c);
|
|
1873
1888
|
default:
|
|
1874
|
-
return
|
|
1889
|
+
return kr(c);
|
|
1875
1890
|
}
|
|
1876
1891
|
};
|
|
1877
|
-
},
|
|
1878
|
-
function
|
|
1892
|
+
}, ce = (e) => e.formHealth.status === "ok";
|
|
1893
|
+
function $t(e) {
|
|
1879
1894
|
const t = Object.keys(e.injectedValidations), r = Object.keys(e.validations);
|
|
1880
1895
|
if (t.length === 0 && r.length === 0)
|
|
1881
1896
|
return { ...e, isFormValid: !0 };
|
|
@@ -1886,8 +1901,8 @@ function yt(e) {
|
|
|
1886
1901
|
(o) => e.validations[o] !== null && Array.isArray(e.validations[o])
|
|
1887
1902
|
), n !== void 0 ? { ...e, isFormValid: !1 } : { ...e, isFormValid: !0 });
|
|
1888
1903
|
}
|
|
1889
|
-
function
|
|
1890
|
-
const s = new or(wt(n.lang)), i = s.asObservable().pipe(k()), u =
|
|
1904
|
+
function ko(e = [], t, r, n, o = {}) {
|
|
1905
|
+
const s = new or(wt(n.lang)), i = s.asObservable().pipe(k()), u = Wo({ validators: t, validateOn: r, localization: n, functions: o });
|
|
1891
1906
|
function c(h) {
|
|
1892
1907
|
const O = s.getValue(), X = u(O, h);
|
|
1893
1908
|
s.next(X);
|
|
@@ -1904,12 +1919,12 @@ function Do(e = [], t, r, n, o = {}) {
|
|
|
1904
1919
|
getState: () => s.getValue()
|
|
1905
1920
|
};
|
|
1906
1921
|
}
|
|
1907
|
-
class
|
|
1922
|
+
class Bo {
|
|
1908
1923
|
constructor() {
|
|
1909
|
-
this.widgetRegistry = new je(), this.store = {}, this.events$ = new
|
|
1924
|
+
this.widgetRegistry = new je(), this.store = {}, this.events$ = new dt(), this.submit$ = new dt(), this.uuid = crypto.randomUUID(), this.itemRenderers = {}, this.dependencies = {};
|
|
1910
1925
|
}
|
|
1911
|
-
initialize(t, r = [], n, o, s, i =
|
|
1912
|
-
this.localization = i, this.dependencies = u, this.widgetRegistry.setWidgetLoaders(t), this.itemRenderers = s, this.store =
|
|
1926
|
+
initialize(t, r = [], n, o, s, i = Wr(), u, c = {}) {
|
|
1927
|
+
this.localization = i, this.dependencies = u, this.widgetRegistry.setWidgetLoaders(t), this.itemRenderers = s, this.store = ko(r, n, o, i, c);
|
|
1913
1928
|
}
|
|
1914
1929
|
emitEvent(t, r, n) {
|
|
1915
1930
|
const s = this.store.getState().currentStates.filter((i) => r.on?.[`${t}.${i}`] !== void 0);
|
|
@@ -1960,7 +1975,7 @@ class Mo {
|
|
|
1960
1975
|
}));
|
|
1961
1976
|
}
|
|
1962
1977
|
}
|
|
1963
|
-
function
|
|
1978
|
+
function Go(e = "GolemUI Form Store") {
|
|
1964
1979
|
return (t) => {
|
|
1965
1980
|
const n = (typeof window < "u" ? window.__REDUX_DEVTOOLS_EXTENSION__ : void 0)?.connect({ name: e });
|
|
1966
1981
|
return n?.init(t.getState()), (o) => (s) => {
|
|
@@ -1968,73 +1983,73 @@ function zo(e = "GolemUI Form Store") {
|
|
|
1968
1983
|
};
|
|
1969
1984
|
};
|
|
1970
1985
|
}
|
|
1971
|
-
const
|
|
1972
|
-
|
|
1986
|
+
const Fo = T(
|
|
1987
|
+
W((e) => e.data),
|
|
1973
1988
|
k()
|
|
1974
|
-
),
|
|
1975
|
-
|
|
1976
|
-
|
|
1989
|
+
), Ko = (e) => T(
|
|
1990
|
+
Fo,
|
|
1991
|
+
W((t) => _(t, e)),
|
|
1977
1992
|
k()
|
|
1978
|
-
),
|
|
1993
|
+
), To = T(
|
|
1979
1994
|
$e((e) => e.touched === !0),
|
|
1980
|
-
|
|
1995
|
+
W((e) => e.validations),
|
|
1981
1996
|
k()
|
|
1982
|
-
),
|
|
1983
|
-
|
|
1984
|
-
|
|
1997
|
+
), bo = (e) => T(
|
|
1998
|
+
To,
|
|
1999
|
+
W((t) => t[e]),
|
|
1985
2000
|
k()
|
|
1986
|
-
),
|
|
2001
|
+
), jo = T(
|
|
1987
2002
|
$e((e) => e.touched === !0),
|
|
1988
|
-
|
|
2003
|
+
W((e) => e.injectedValidations),
|
|
1989
2004
|
k()
|
|
1990
|
-
),
|
|
1991
|
-
|
|
1992
|
-
|
|
2005
|
+
), Xo = (e) => T(
|
|
2006
|
+
jo,
|
|
2007
|
+
W((t) => t[e]),
|
|
1993
2008
|
k(),
|
|
1994
2009
|
// we want to make sure combineLatest([validation$, injectedValidation$]) triggers
|
|
1995
2010
|
ir(null)
|
|
1996
|
-
),
|
|
1997
|
-
|
|
2011
|
+
), Po = T(
|
|
2012
|
+
W((e) => e.lang),
|
|
1998
2013
|
k()
|
|
1999
2014
|
), tr = T(
|
|
2000
|
-
|
|
2015
|
+
W((e) => e.calculatedWidgets),
|
|
2001
2016
|
k()
|
|
2002
|
-
),
|
|
2003
|
-
|
|
2017
|
+
), Jo = (e) => (t) => sr([t.pipe(Po), t.pipe(tr)]).pipe(
|
|
2018
|
+
W(([r, n]) => ({ lang: r, widget: n[e] })),
|
|
2004
2019
|
$e((r) => r.widget !== void 0),
|
|
2005
2020
|
k((r, n) => r.lang === n.lang && r.widget === n.widget),
|
|
2006
|
-
|
|
2007
|
-
),
|
|
2021
|
+
W((r) => r.widget.current)
|
|
2022
|
+
), Qo = (e) => T(
|
|
2008
2023
|
tr,
|
|
2009
|
-
|
|
2024
|
+
W((t) => t[e]),
|
|
2010
2025
|
$e((t) => t !== void 0),
|
|
2011
|
-
|
|
2026
|
+
W((t) => t.current.children),
|
|
2012
2027
|
k()
|
|
2013
2028
|
);
|
|
2014
2029
|
T(
|
|
2015
|
-
|
|
2030
|
+
W((e) => e.widgetFlags),
|
|
2016
2031
|
k()
|
|
2017
2032
|
);
|
|
2018
|
-
const
|
|
2019
|
-
|
|
2033
|
+
const No = T(
|
|
2034
|
+
W((e) => e.touchedControls),
|
|
2020
2035
|
k()
|
|
2021
|
-
),
|
|
2022
|
-
|
|
2023
|
-
|
|
2036
|
+
), xo = (e) => T(
|
|
2037
|
+
No,
|
|
2038
|
+
W((t) => t[e]),
|
|
2024
2039
|
k()
|
|
2025
|
-
),
|
|
2026
|
-
|
|
2040
|
+
), _o = T(
|
|
2041
|
+
W((e) => e.formHealth),
|
|
2027
2042
|
k((e, t) => e.status !== t.status ? !1 : e.status === "errored" && t.status === "errored" ? e.message === t.message && e.code === t.code : !0)
|
|
2028
|
-
),
|
|
2043
|
+
), qo = (e) => e.pipe(_o);
|
|
2029
2044
|
let rr = !1;
|
|
2030
|
-
function
|
|
2045
|
+
function Zo() {
|
|
2031
2046
|
rr = !0;
|
|
2032
2047
|
}
|
|
2033
|
-
function
|
|
2048
|
+
function Ro() {
|
|
2034
2049
|
return rr;
|
|
2035
2050
|
}
|
|
2036
|
-
function
|
|
2037
|
-
if (!
|
|
2051
|
+
function Yo(e, t, r) {
|
|
2052
|
+
if (!Ro())
|
|
2038
2053
|
return;
|
|
2039
2054
|
const n = Object.keys(t ?? {}).filter((o) => o in r);
|
|
2040
2055
|
if (n.length > 0)
|
|
@@ -2043,25 +2058,26 @@ function xo(e, t, r) {
|
|
|
2043
2058
|
);
|
|
2044
2059
|
}
|
|
2045
2060
|
export {
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
+
Bo as FormContext,
|
|
2062
|
+
Yo as assertNoPropCollisions,
|
|
2063
|
+
Qo as calculatedLayoutChildrenByUid$,
|
|
2064
|
+
Jo as calculatedWidgetsByUid$,
|
|
2065
|
+
Ne as cloneObject,
|
|
2066
|
+
Ko as dataByPath$,
|
|
2067
|
+
Uo as defineForm,
|
|
2068
|
+
Go as devToolsMiddleware,
|
|
2069
|
+
Zo as enableDevMode,
|
|
2070
|
+
Q as errorCodes,
|
|
2071
|
+
zo as filterTap,
|
|
2072
|
+
Mo as formEventNames,
|
|
2073
|
+
qo as formHealth,
|
|
2074
|
+
Ho as getDirectionFromLanguage,
|
|
2075
|
+
Wr as identityTranslator,
|
|
2076
|
+
Xo as injectedValidationByPath$,
|
|
2061
2077
|
dr as isStandardValidateSuccess,
|
|
2062
|
-
|
|
2063
|
-
|
|
2078
|
+
gt as makeRepeaterItemConfig,
|
|
2079
|
+
mr as shortUUID,
|
|
2064
2080
|
ur as standardValidate,
|
|
2065
|
-
|
|
2066
|
-
|
|
2081
|
+
xo as touchedControlsByPath$,
|
|
2082
|
+
bo as validationByPath$
|
|
2067
2083
|
};
|