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