@dynamicforms/vue-forms 1.1.0 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,46 +1,37 @@
1
1
  import { createTranslatable as e, interpolate as t } from "@dynamicforms/translatable";
2
- import { computed as n, createBlock as r, defineComponent as i, h as a, isRef as o, openBlock as s, reactive as ee, ref as te, resolveComponent as c, toRef as l, unref as u, watch as d } from "vue";
3
- import { isArray as f, isBoolean as p, isEmpty as m, isEqual as h, isEqualWith as ne, isObject as re, isString as g, truncate as ie } from "lodash-es";
2
+ import { computed as n, createBlock as r, defineComponent as i, h as a, isRef as o, openBlock as s, reactive as c, ref as l, resolveComponent as u, toRef as d, unref as f, watch as p } from "vue";
3
+ import { isArray as m, isEmpty as h, isEqual as g, isEqualWith as ee, isObject as te, isPlainObject as ne, isString as _, truncate as re } from "lodash-es";
4
4
  //#region \0rolldown/runtime.js
5
- var ae = Object.defineProperty, oe = (e, t) => {
5
+ var ie = Object.defineProperty, ae = (e, t) => {
6
6
  let n = {};
7
- for (var r in e) ae(n, r, {
7
+ for (var r in e) ie(n, r, {
8
8
  get: e[r],
9
9
  enumerable: !0
10
10
  });
11
- return t || ae(n, Symbol.toStringTag, { value: "Module" }), n;
12
- }, _ = /* @__PURE__ */ function(e) {
13
- return e[e.SUPPRESS = 1] = "SUPPRESS", e[e.HIDDEN = 5] = "HIDDEN", e[e.INVISIBLE = 8] = "INVISIBLE", e[e.FULL = 10] = "FULL", e;
14
- }(_ || {}), se = 10, ce = new Set(Object.values(_).filter((e) => typeof e == "number")), le = new Set(Object.values(_).filter((e) => typeof e == "string"));
15
- function v(e) {
16
- let t = typeof e == "string" ? `'${e}'` : String(e);
17
- return /* @__PURE__ */ Error(`${t} is not a DisplayMode constant`);
11
+ return t || ie(n, Symbol.toStringTag, { value: "Module" }), n;
12
+ }, v = Object.freeze([
13
+ "editable",
14
+ "readonly",
15
+ "disabled",
16
+ "disabled-null"
17
+ ]), oe = "editable";
18
+ function se(e) {
19
+ return v.includes(e);
18
20
  }
19
- (function(e) {
20
- function t(e) {
21
- let t = typeof e == "string" ? e.toUpperCase() : "";
22
- if (t === "SUPPRESS") return 1;
23
- if (t === "HIDDEN") return 5;
24
- if (t === "INVISIBLE") return 8;
25
- if (t === "FULL") return 10;
26
- throw v(e);
27
- }
28
- e.fromString = t;
29
- function n(e) {
30
- if (typeof e == "number") {
31
- if (ce.has(e)) return e;
32
- throw v(e);
33
- }
34
- if (typeof e != "string") throw v(e);
35
- return _.fromString(e);
36
- }
37
- e.fromAny = n;
38
- function r(e) {
39
- return typeof e == "number" ? ce.has(e) : typeof e == "string" && le.has(e.toUpperCase());
40
- }
41
- e.isDefined = r;
42
- })(_ ||= {}), Object.freeze(_);
43
- var y = _, b = class {
21
+ //#endregion
22
+ //#region src/visibility.ts
23
+ var y = Object.freeze([
24
+ "full",
25
+ "invisible",
26
+ "hidden",
27
+ "suppress"
28
+ ]), b = "full";
29
+ function x(e) {
30
+ return y.includes(e);
31
+ }
32
+ //#endregion
33
+ //#region src/actions/field-action-base.ts
34
+ var S = class {
44
35
  static get classIdentifier() {
45
36
  throw Error("classIdentifier must be declared");
46
37
  }
@@ -63,26 +54,26 @@ var y = _, b = class {
63
54
  }
64
55
  boundToBinding(e) {}
65
56
  unregisterFrom(e) {}
66
- }, x = class extends Error {}, ue = Symbol("ValueChangedAction"), S = class extends b {
57
+ }, C = class extends Error {}, w = Symbol("ValueChangedAction"), T = class extends S {
67
58
  constructor(e) {
68
59
  super(e);
69
60
  }
70
61
  static get classIdentifier() {
71
- return ue;
62
+ return w;
72
63
  }
73
64
  execute(e, t, n, r) {
74
65
  return super.execute(e, t, n, r);
75
66
  }
76
- }, C = Symbol("Transaction.capture"), de = Symbol("Transaction.restore"), fe = Symbol("Transaction.announceValue"), pe = Symbol("Transaction.settleValidity");
77
- function w(e) {
67
+ }, E = Symbol("Transaction.capture"), ce = Symbol("FieldBase.sentNowhere"), le = Symbol("Transaction.restore"), ue = Symbol("Transaction.announceValue"), de = Symbol("Transaction.settleValidity");
68
+ function D(e) {
78
69
  return e;
79
70
  }
80
- function me(e) {
71
+ function fe(e) {
81
72
  let t = 0, n = e.parent;
82
73
  for (; n;) t++, n = n.parent;
83
74
  return t;
84
75
  }
85
- var he = class {
76
+ var pe = class {
86
77
  participants = /* @__PURE__ */ new Map();
87
78
  undo = [];
88
79
  settled = [];
@@ -103,7 +94,7 @@ var he = class {
103
94
  }
104
95
  touch(e) {
105
96
  let t = this.participant(e);
106
- t.snapshot ||= w(e)[C]();
97
+ t.snapshot ||= D(e)[E]();
107
98
  }
108
99
  markValueChanged(e, t) {
109
100
  let n = this.participant(e);
@@ -126,11 +117,11 @@ var he = class {
126
117
  this.settled.push(e);
127
118
  }
128
119
  noteDepth(e) {
129
- this.passDepth < 0 || me(e) >= this.passDepth && (this.restartPass = !0);
120
+ this.passDepth < 0 || fe(e) >= this.passDepth && (this.restartPass = !0);
130
121
  }
131
122
  rollback() {
132
123
  this.unwound = !0, [...this.participants.values()].reverse().forEach((e) => {
133
- e.snapshot && w(e.element)[de](e.snapshot);
124
+ e.snapshot && D(e.element)[le](e.snapshot);
134
125
  }), this.participants.clear();
135
126
  for (let e = this.undo.length - 1; e >= 0; e--) this.undo[e]();
136
127
  this.undo.length = 0, this.settled.length = 0;
@@ -144,7 +135,7 @@ var he = class {
144
135
  let t = [];
145
136
  return this.participants.forEach((n) => {
146
137
  if (!e(n)) return;
147
- let r = me(n.element);
138
+ let r = fe(n.element);
148
139
  (t[r] ??= []).push(n);
149
140
  }), t;
150
141
  }
@@ -172,82 +163,86 @@ var he = class {
172
163
  announceValues() {
173
164
  return this.pass((e) => e.valueDirty || e.structural !== void 0, (e) => {
174
165
  let { structural: t } = e, n = e.valueDirty, r = e.forceValue;
175
- e.structural = void 0, e.valueDirty = !1, e.forceValue = !1, w(e.element)[fe](this, n, r, t);
166
+ e.structural = void 0, e.valueDirty = !1, e.forceValue = !1, D(e.element)[ue](this, n, r, t);
176
167
  });
177
168
  }
178
169
  settleValidity() {
179
170
  return this.pass((e) => e.validityDirty, (e) => {
180
- e.validityDirty = !1, w(e.element)[pe](this);
171
+ e.validityDirty = !1, D(e.element)[de](this);
181
172
  });
182
173
  }
183
- }, T, ge;
184
- function _e() {
185
- return T;
174
+ }, O, me;
175
+ function he() {
176
+ return O;
186
177
  }
187
- var ve = class {}, ye = class {
178
+ var ge = class {}, _e = class {
188
179
  open = !0;
189
180
  rollback() {
190
- throw this.open ? new ve() : TypeError("this transaction handle is spent: the transaction that handed it out has closed. A handle is only usable inside the call that received it.");
181
+ throw this.open ? new ge() : TypeError("this transaction handle is spent: the transaction that handed it out has closed. A handle is only usable inside the call that received it.");
191
182
  }
192
183
  close() {
193
184
  this.open = !1;
194
185
  }
195
186
  };
196
- function be(e) {
187
+ function ve(e) {
197
188
  if (e != null && typeof e.then == "function") throw TypeError("a transaction may not be asynchronous: the callback returned a thenable. Do the awaiting outside and open a transaction for each synchronous part.");
198
189
  }
199
- function E(e) {
200
- if (T) {
201
- let t = e(ge);
202
- return be(t), t;
190
+ function k(e) {
191
+ if (O) {
192
+ let t = e(me);
193
+ return ve(t), t;
203
194
  }
204
- let t = new he(), n = new ye();
205
- T = t, ge = n;
195
+ let t = new pe(), n = new _e();
196
+ O = t, me = n;
206
197
  try {
207
198
  let r = e(n);
208
- return be(r), t.commit(), r;
199
+ return ve(r), t.commit(), r;
209
200
  } catch (e) {
210
- if (t.rollback(), e instanceof ve) return;
201
+ if (t.rollback(), e instanceof ge) return;
211
202
  throw e;
212
203
  } finally {
213
- T = void 0, ge = void 0, n.close();
204
+ O = void 0, me = void 0, n.close();
214
205
  }
215
206
  }
216
- function D(e) {
217
- return T ? e(T) : E(() => e(T));
207
+ function A(e) {
208
+ return O ? e(O) : k(() => e(O));
218
209
  }
219
210
  //#endregion
220
211
  //#region src/config.ts
221
- var xe = { useMarkdownInValidators: !0 };
222
- function Se() {
223
- return xe;
212
+ var ye = { useMarkdownInValidators: !0 };
213
+ function be() {
214
+ return ye;
224
215
  }
225
- function Ce(e) {
226
- Object.assign(xe, e);
216
+ function xe(e) {
217
+ Object.assign(ye, e);
227
218
  }
228
- var we = { install(e, t) {
229
- t && Ce(t);
230
- } }, O = class extends String {
219
+ var Se = { install(e, t) {
220
+ t && xe(t);
221
+ } }, j = class extends String {
231
222
  plugins;
232
223
  options;
233
224
  constructor(e, t, n) {
234
225
  super(e), this.plugins = n, this.options = t;
235
226
  }
236
227
  };
237
- function k(e) {
238
- let t = u(e);
228
+ function M(e) {
229
+ let t = f(e);
239
230
  return typeof t == "object" && !!t && "componentName" in t;
240
231
  }
241
- function A(e) {
242
- return typeof u(e) == "function";
232
+ function N(e) {
233
+ return typeof f(e) == "function";
243
234
  }
244
- var j = class {
235
+ var P = class {
245
236
  code;
246
- constructor(e) {
247
- this.code = e;
237
+ statedOrigin;
238
+ constructor(e, t) {
239
+ this.code = e, this.statedOrigin = t;
240
+ }
241
+ get origin() {
242
+ return this.statedOrigin === void 0 ? typeof this.source == "symbol" ? "validator" : "application" : this.statedOrigin;
248
243
  }
249
244
  sameAs(e) {
250
- return Object.getPrototypeOf(this) === Object.getPrototypeOf(e) && this.code === e.code && this.componentName === e.componentName && h(this.componentBody, e.componentBody) && h(this.componentBindings, e.componentBindings) && h(this.extraClasses, e.extraClasses);
245
+ return Object.getPrototypeOf(this) === Object.getPrototypeOf(e) && this.code === e.code && this.statedOrigin === e.statedOrigin && this.componentName === e.componentName && g(this.componentBody, e.componentBody) && g(this.componentBindings, e.componentBindings) && g(this.extraClasses, e.extraClasses);
251
246
  }
252
247
  get componentName() {
253
248
  return "Comment";
@@ -261,11 +256,11 @@ var j = class {
261
256
  get extraClasses() {
262
257
  return "";
263
258
  }
264
- }, Te = class extends j {
259
+ }, Ce = class extends P {
265
260
  text;
266
261
  classes;
267
- constructor(e, t = "", n) {
268
- super(n), this.text = e, this.classes = t;
262
+ constructor(e, t = "", n, r) {
263
+ super(n, r), this.text = e, this.classes = t;
269
264
  }
270
265
  get componentName() {
271
266
  return "template";
@@ -276,23 +271,23 @@ var j = class {
276
271
  get extraClasses() {
277
272
  return this.classes;
278
273
  }
279
- }, M = class extends j {
274
+ }, F = class extends P {
280
275
  classes;
281
276
  text;
282
277
  textType;
283
- constructor(e, t = "", r) {
284
- super(r), this.classes = t, this.text = e, this.textType = n(() => this.getTextType);
278
+ constructor(e, t = "", r, i) {
279
+ super(r, i), this.classes = t, this.text = e, this.textType = n(() => this.getTextType);
285
280
  }
286
281
  get resolvedText() {
287
- let e = u(this.text);
288
- return A(e) ? e() : e;
282
+ let e = f(this.text);
283
+ return N(e) ? e() : e;
289
284
  }
290
285
  get getTextType() {
291
286
  let e = this.resolvedText;
292
- return e ? e instanceof O ? "md" : k(e) ? "component" : "string" : "string";
287
+ return e ? e instanceof j ? "md" : M(e) ? "component" : "string" : "string";
293
288
  }
294
289
  get componentName() {
295
- switch (u(this.textType)) {
290
+ switch (f(this.textType)) {
296
291
  case "string": return "template";
297
292
  case "md": return "vue-markdown";
298
293
  case "component": return this.resolvedText.componentName;
@@ -300,7 +295,7 @@ var j = class {
300
295
  }
301
296
  }
302
297
  get componentBindings() {
303
- switch (u(this.textType)) {
298
+ switch (f(this.textType)) {
304
299
  case "string": return {};
305
300
  case "md": {
306
301
  let e = this.resolvedText;
@@ -315,7 +310,7 @@ var j = class {
315
310
  }
316
311
  }
317
312
  get componentBody() {
318
- switch (u(this.textType)) {
313
+ switch (f(this.textType)) {
319
314
  case "string": return this.resolvedText;
320
315
  case "component": return this.resolvedText.componentVHtml || "";
321
316
  default: return "";
@@ -324,18 +319,18 @@ var j = class {
324
319
  get extraClasses() {
325
320
  return this.classes;
326
321
  }
327
- }, Ee = class extends M {};
322
+ }, we = class extends F {};
328
323
  //#endregion
329
324
  //#region src/validators/error-message-builder.ts
330
- function De(e) {
331
- return Se().useMarkdownInValidators ? new O(e) : e.replace(/[*_~`]/g, "").replace(/!\[(.*?)\]\(.*?\)/g, "$1").replace(/\[(.*?)\]\((.*?)\)/g, "$1").replace(/#+\s?/g, "").replace(/>\s?/g, "").replace(/(\*|-|\d+\.)\s+/g, "").replace(/`{3}[\s\S]*?`{3}/g, "").replace(/`([^`]+)`/g, "$1").replace(/\n{2,}/g, "\n");
325
+ function Te(e) {
326
+ return be().useMarkdownInValidators ? new j(e) : e.replace(/[*_~`]/g, "").replace(/!\[(.*?)\]\(.*?\)/g, "$1").replace(/\[(.*?)\]\((.*?)\)/g, "$1").replace(/#+\s?/g, "").replace(/>\s?/g, "").replace(/(\*|-|\d+\.)\s+/g, "").replace(/`{3}[\s\S]*?`{3}/g, "").replace(/`([^`]+)`/g, "$1").replace(/\n{2,}/g, "\n");
332
327
  }
333
- function N(e) {
334
- return o(e) ? n(() => De(e.value)) : De(e);
328
+ function I(e) {
329
+ return o(e) ? n(() => Te(e.value)) : Te(e);
335
330
  }
336
331
  //#endregion
337
332
  //#region src/validators/translations.ts
338
- var { strings: P, translateStrings: Oe } = e({
333
+ var { strings: Ee, translateStrings: De } = e({
339
334
  Required: "Please enter a value",
340
335
  MinValue: "Value must be larger or equal to **{minValue}**",
341
336
  MaxValue: "Value must be less than or equal to **{maxValue}**",
@@ -347,20 +342,20 @@ var { strings: P, translateStrings: Oe } = e({
347
342
  InAllowedValues: "Must be one of [**{allowedAsText}**]",
348
343
  ValidationFailed: "Validation could not be completed"
349
344
  });
350
- function F(e) {
351
- return N(l(P, e));
345
+ function L(e) {
346
+ return I(d(Ee, e));
352
347
  }
353
348
  //#endregion
354
349
  //#region src/validators/validator.ts
355
- var ke = Symbol("Validator"), Ae = () => F("ValidationFailed"), I = class extends S {
350
+ var Oe = Symbol("Validator"), ke = () => L("ValidationFailed"), R = class extends T {
356
351
  source;
357
352
  constructor(e) {
358
353
  super((t, n, r, i) => {
359
- let a = this.bindingState(t), o = a.abandon, s = ++a.run, ee = t.validationEpoch, te = _e(), c = !1, l = () => !c && a.run === s && t.validationEpoch === ee && !te?.rolledBack, u = new AbortController(), d = () => {
360
- l() || (c = !0, a.abandon === d && (a.abandon = void 0), u.abort());
354
+ let a = this.bindingState(t), o = a.abandon, s = ++a.run, c = t.validationEpoch, l = he(), u = !1, d = () => !u && a.run === s && t.validationEpoch === c && !l?.rolledBack, f = new AbortController(), p = () => {
355
+ d() || (u = !0, a.abandon === p && (a.abandon = void 0), f.abort());
361
356
  };
362
357
  o?.();
363
- let f = e(r, i, t, u.signal) || [], p = (e) => E(() => {
358
+ let m = t[ce]() ? [] : e(r, i, t, f.signal) || [], h = (e) => k(() => {
364
359
  let n = e?.map((e) => this.claim(e)) ?? [];
365
360
  for (let e = t.errors.length - 1; e >= 0; e--) {
366
361
  let r = t.errors[e];
@@ -371,13 +366,13 @@ var ke = Symbol("Validator"), Ae = () => F("ValidationFailed"), I = class extend
371
366
  }
372
367
  n.length > 0 && t.errors.push(...n), t.validate();
373
368
  });
374
- return f instanceof Promise ? (a.abandon = d, te?.whenRolledBack(d), t.beginValidating(), f.then((e) => {
375
- l() && p(e);
369
+ return m instanceof Promise ? (a.abandon = p, l?.whenRolledBack(p), t.beginValidating(), m.then((e) => {
370
+ d() && h(e);
376
371
  }, (e) => {
377
- l() && (p([new M(Ae(), "", "validation-failed")]), console.error("Validation failed", e));
372
+ d() && (h([new F(ke(), "", "validation-failed")]), console.error("Validation failed", e));
378
373
  }).finally(() => {
379
- a.abandon === d && (a.abandon = void 0), t.endValidating();
380
- }).catch((e) => console.error("Validation failed", e))) : p(f), n(t, r, i);
374
+ a.abandon === p && (a.abandon = void 0), t.endValidating();
375
+ }).catch((e) => console.error("Validation failed", e))) : h(m), n(t, r, i);
381
376
  }), this.source = Symbol(this.constructor.name);
382
377
  }
383
378
  claim(e) {
@@ -396,13 +391,13 @@ var ke = Symbol("Validator"), Ae = () => F("ValidationFailed"), I = class extend
396
391
  });
397
392
  }
398
393
  static get classIdentifier() {
399
- return ke;
394
+ return Oe;
400
395
  }
401
396
  get eager() {
402
397
  return !0;
403
398
  }
404
399
  unregisterFrom(e) {
405
- D((t) => {
400
+ A((t) => {
406
401
  t.whenCommitted(() => this.abandonRun(e));
407
402
  for (let t = e.errors.length - 1; t >= 0; t--) e.errors[t].source === this.source && e.errors.splice(t, 1);
408
403
  e.validate();
@@ -419,22 +414,22 @@ var ke = Symbol("Validator"), Ae = () => F("ValidationFailed"), I = class extend
419
414
  }
420
415
  replacePlaceholdersFunction(e, t) {
421
416
  return () => {
422
- let n = u(e);
423
- for (; A(n);) n = u(this.replacePlaceholders(n(), t));
417
+ let n = f(e);
418
+ for (; N(n);) n = f(this.replacePlaceholders(n(), t));
424
419
  return n;
425
420
  };
426
421
  }
427
422
  replacePlaceholders(e, n) {
428
- if (A(e)) return this.replacePlaceholdersFunction(e, n);
429
- if (k(e)) return e;
430
- if (o(e)) return this.replacePlaceholdersFunction(() => u(e), n);
431
- let r = u(e), i = t(r.toString(), n);
432
- return r instanceof O ? new O(i, r.options, r.plugins) : i;
423
+ if (N(e)) return this.replacePlaceholdersFunction(e, n);
424
+ if (M(e)) return e;
425
+ if (o(e)) return this.replacePlaceholdersFunction(() => f(e), n);
426
+ let r = f(e), i = t(r.toString(), n);
427
+ return r instanceof j ? new j(i, r.options, r.plugins) : i;
433
428
  }
434
- }, L = class e {
429
+ }, Ae = class e {
435
430
  actions = [];
436
431
  register(e, t) {
437
- if (!(e instanceof b)) throw Error("Invalid action type");
432
+ if (!(e instanceof S)) throw Error("Invalid action type");
438
433
  let n = t ? this.actions.indexOf(t) : -1;
439
434
  if (t && (t.classIdentifier !== e.classIdentifier || n < 0)) throw Error("Action to register before is not registered under the same identifier");
440
435
  n < 0 ? this.actions.push(e) : this.actions.splice(n, 0, e);
@@ -458,10 +453,10 @@ var ke = Symbol("Validator"), Ae = () => F("ValidationFailed"), I = class extend
458
453
  if (a.eager && e.outermostEager(r, i)) try {
459
454
  let o = this.walk(r, i, a.classIdentifier, !0, t, n);
460
455
  e.isPromise(o) && o.then(void 0, (e) => {
461
- if (!(e instanceof x)) throw e;
456
+ if (!(e instanceof C)) throw e;
462
457
  });
463
458
  } catch (e) {
464
- if (!(e instanceof x)) throw e;
459
+ if (!(e instanceof C)) throw e;
465
460
  }
466
461
  }
467
462
  }
@@ -469,7 +464,7 @@ var ke = Symbol("Validator"), Ae = () => F("ValidationFailed"), I = class extend
469
464
  return this.run(e, !0, t, n);
470
465
  }
471
466
  get validators() {
472
- return this.actions.filter((e) => e instanceof I);
467
+ return this.actions.filter((e) => e instanceof R);
473
468
  }
474
469
  bindTo(e) {
475
470
  this.actions.forEach((t) => t.boundToBinding(e));
@@ -484,7 +479,7 @@ var ke = Symbol("Validator"), Ae = () => F("ValidationFailed"), I = class extend
484
479
  }
485
480
  static answerAbort(t) {
486
481
  return e.isPromise(t) ? t.then(void 0, (e) => {
487
- if (e instanceof x) return e;
482
+ if (e instanceof C) return e;
488
483
  throw e;
489
484
  }) : t;
490
485
  }
@@ -493,7 +488,7 @@ var ke = Symbol("Validator"), Ae = () => F("ValidationFailed"), I = class extend
493
488
  try {
494
489
  return e.answerAbort(this.walk(a, a.length - 1, t, n, r, i));
495
490
  } catch (e) {
496
- if (e instanceof x) return e;
491
+ if (e instanceof C) return e;
497
492
  throw e;
498
493
  }
499
494
  }
@@ -505,7 +500,7 @@ var ke = Symbol("Validator"), Ae = () => F("ValidationFailed"), I = class extend
505
500
  };
506
501
  //#endregion
507
502
  //#region src/binding/resolve.ts
508
- function R(e) {
503
+ function z(e) {
509
504
  let t = e;
510
505
  for (; t.fieldName !== void 0 && t.parent;) t = t.parent;
511
506
  return t;
@@ -520,25 +515,25 @@ function Me(e) {
520
515
  for (; n.fieldName !== void 0 && n.parent;) t.unshift(n.fieldName), n = n.parent;
521
516
  return t;
522
517
  }
523
- function z(e, t) {
518
+ function Ne(e, t) {
524
519
  let n = je(t, e);
525
520
  if (n) return n;
526
521
  let r = t.parent;
527
522
  for (; r;) {
528
- let t = je(R(r), e);
523
+ let t = je(z(r), e);
529
524
  if (t) return t;
530
525
  r = r.parent;
531
526
  }
532
- return R(e) === R(t.declaration) ? void 0 : e;
527
+ return z(e) === z(t.declaration) ? void 0 : e;
533
528
  }
534
- function Ne(e, t) {
535
- let n = z(e, t);
529
+ function Pe(e, t) {
530
+ let n = Ne(e, t);
536
531
  if (!n) return [];
537
532
  if (n !== e) return [n];
538
533
  let r = t.bindingsOf(e);
539
534
  return r.length > 0 ? r : [e];
540
535
  }
541
- function Pe(e, t) {
536
+ function Fe(e, t) {
542
537
  let n = t.parent;
543
538
  for (; n;) {
544
539
  let t = n.field?.(e);
@@ -548,18 +543,18 @@ function Pe(e, t) {
548
543
  }
549
544
  //#endregion
550
545
  //#region src/actions/conditional/conditional-statement-action.ts
551
- var Fe = Symbol("ConditionalStatementAction"), B = class extends S {
546
+ var Ie = Symbol("ConditionalStatementAction"), B = class extends T {
552
547
  statement;
553
548
  conditionalExecutor;
554
549
  declarations = /* @__PURE__ */ new Set();
555
550
  registrations = /* @__PURE__ */ new WeakSet();
556
551
  constructor(e, t) {
557
- super((e, t, n, r) => (this.applyIn(R(e)) || e.markRecordIncomplete(), t(e, n, r))), this.statement = e, this.conditionalExecutor = t;
558
- let n = new S((e, t, ...n) => (this.applyFrom(e), t(e, ...n)));
552
+ super((e, t, n, r) => (this.applyIn(z(e)) || e.markRecordIncomplete(), t(e, n, r))), this.statement = e, this.conditionalExecutor = t;
553
+ let n = new T((e, t, ...n) => (this.applyFrom(e), t(e, ...n)));
559
554
  e.collectFields().forEach((e) => e.registerAction(n));
560
555
  }
561
556
  static get classIdentifier() {
562
- return Fe;
557
+ return Ie;
563
558
  }
564
559
  get eager() {
565
560
  return !0;
@@ -572,7 +567,7 @@ var Fe = Symbol("ConditionalStatementAction"), B = class extends S {
572
567
  }
573
568
  targetsIn(e) {
574
569
  let t = [];
575
- return this.declarations.forEach((n) => Ne(n, e).forEach((e) => {
570
+ return this.declarations.forEach((n) => Pe(n, e).forEach((e) => {
576
571
  this.registrations.has(e) && t.push(e);
577
572
  })), t;
578
573
  }
@@ -586,21 +581,21 @@ var Fe = Symbol("ConditionalStatementAction"), B = class extends S {
586
581
  }
587
582
  applyFrom(e) {
588
583
  let t = /* @__PURE__ */ new Set();
589
- this.targetsIn(R(e)).forEach((e) => t.add(R(e))), t.forEach((e) => this.applyIn(e));
590
- }
591
- }, Ie = class extends B {
592
- constructor(e) {
593
- super(e, (e, t) => {
594
- e.visibility = t ? y.FULL : y.SUPPRESS;
595
- });
584
+ this.targetsIn(z(e)).forEach((e) => t.add(z(e))), t.forEach((e) => this.applyIn(e));
596
585
  }
597
586
  }, Le = class extends B {
598
- constructor(e) {
599
- super(e, (e, t) => {
600
- e.enabled = t;
587
+ constructor(e, t = "full", n = "suppress") {
588
+ super(e, (e, r) => {
589
+ e.visibility = r ? t : n;
601
590
  });
602
591
  }
603
592
  }, Re = class extends B {
593
+ constructor(e, t = "editable", n = "disabled") {
594
+ super(e, (e, r) => {
595
+ e.access = r ? t : n;
596
+ });
597
+ }
598
+ }, ze = class extends B {
604
599
  constructor(e, t) {
605
600
  super(e, (e, n) => {
606
601
  n && (e.value = t);
@@ -659,57 +654,91 @@ var Fe = Symbol("ConditionalStatementAction"), B = class extends S {
659
654
  }
660
655
  e.isLogicOperator = i;
661
656
  })(V ||= {}), Object.freeze(V);
662
- var H = V, ze = Symbol("EnabledChangingAction"), U = class extends b {
657
+ var H = V, Be = Symbol("AccessChangingAction"), Ve = class extends S {
663
658
  constructor(e) {
664
659
  super(e);
665
660
  }
666
661
  static get classIdentifier() {
667
- return ze;
662
+ return Be;
668
663
  }
669
664
  execute(e, t, n, r) {
670
665
  return super.execute(e, t, n, r);
671
666
  }
672
- }, Be = Symbol("EnabledChangedAction"), W = class extends b {
667
+ }, He = Symbol("AccessChangedAction"), Ue = class extends S {
673
668
  constructor(e) {
674
669
  super(e);
675
670
  }
676
671
  static get classIdentifier() {
677
- return Be;
672
+ return He;
678
673
  }
679
674
  execute(e, t, n, r) {
680
675
  return super.execute(e, t, n, r);
681
676
  }
682
- }, Ve = Symbol("ValidChangedAction"), G = class extends b {
677
+ }, We = Symbol("ContributionChangedAction"), U = class extends S {
683
678
  constructor(e) {
684
679
  super(e);
685
680
  }
686
681
  static get classIdentifier() {
687
- return Ve;
682
+ return We;
688
683
  }
689
684
  execute(e, t, n, r) {
690
685
  return super.execute(e, t, n, r);
691
686
  }
692
- }, He = Symbol("VisibilityChangingAction"), K = class extends b {
687
+ }, Ge = Symbol("EnabledChangingAction"), Ke = class extends S {
693
688
  constructor(e) {
694
689
  super(e);
695
690
  }
696
691
  static get classIdentifier() {
697
- return He;
692
+ return Ge;
693
+ }
694
+ execute(e, t, n, r) {
695
+ return super.execute(e, t, n, r);
696
+ }
697
+ }, qe = Symbol("EnabledChangedAction"), Je = class extends S {
698
+ constructor(e) {
699
+ super(e);
700
+ }
701
+ static get classIdentifier() {
702
+ return qe;
698
703
  }
699
704
  execute(e, t, n, r) {
700
705
  return super.execute(e, t, n, r);
701
706
  }
702
- }, Ue = Symbol("VisibilityChangedAction"), q = class extends b {
707
+ }, Ye = Symbol("ValidChangedAction"), Xe = class extends S {
703
708
  constructor(e) {
704
709
  super(e);
705
710
  }
706
711
  static get classIdentifier() {
707
- return Ue;
712
+ return Ye;
708
713
  }
709
714
  execute(e, t, n, r) {
710
715
  return super.execute(e, t, n, r);
711
716
  }
712
- }, We = /* @__PURE__ */ new WeakMap(), Ge = /* @__PURE__ */ new WeakMap(), J = /* @__PURE__ */ new WeakMap(), Ke = /* @__PURE__ */ new Set(["validators", "actions"]), qe = 0, Y = class {
717
+ }, Ze = Symbol("VisibilityChangingAction"), Qe = class extends S {
718
+ constructor(e) {
719
+ super(e);
720
+ }
721
+ static get classIdentifier() {
722
+ return Ze;
723
+ }
724
+ execute(e, t, n, r) {
725
+ return super.execute(e, t, n, r);
726
+ }
727
+ }, $e = Symbol("VisibilityChangedAction"), et = class extends S {
728
+ constructor(e) {
729
+ super(e);
730
+ }
731
+ static get classIdentifier() {
732
+ return $e;
733
+ }
734
+ execute(e, t, n, r) {
735
+ return super.execute(e, t, n, r);
736
+ }
737
+ }, tt = /* @__PURE__ */ new WeakMap(), nt = /* @__PURE__ */ new Set(["validators", "actions"]), W = (e) => typeof e == "string" ? `'${e}'` : String(e), rt = (e) => e.map(W).join(", ");
738
+ function it(e) {
739
+ if (Object.hasOwn(e, "enabled")) throw TypeError(`enabled is read from access and cannot be assigned; state access instead: ${rt(v)}`);
740
+ }
741
+ var at = 0, G = class {
713
742
  get __v_skip() {
714
743
  return !0;
715
744
  }
@@ -722,7 +751,7 @@ var H = V, ze = Symbol("EnabledChangingAction"), U = class extends b {
722
751
  #e;
723
752
  #t;
724
753
  constructor(e) {
725
- this.#t = e, this.#e = ee(e);
754
+ this.#t = e, this.#e = c(e);
726
755
  }
727
756
  get state() {
728
757
  return this.#e;
@@ -731,10 +760,14 @@ var H = V, ze = Symbol("EnabledChangingAction"), U = class extends b {
731
760
  return this.#t;
732
761
  }
733
762
  rebind(e) {
734
- return D((t) => {
763
+ return A((t) => {
735
764
  t.touch(this);
736
- let n = t.willAnnounceValue(this), r = this.#t.announcedValue;
737
- this.resetTo(this.declaration, e), this.#t.announcedValue = n ? r : this.value;
765
+ let n = t.willAnnounceValue(this), { announcedValue: r, announcedContribution: i, validatedValue: a } = this.#t;
766
+ this.resetTo(this.declaration, e), n ? Object.assign(this.#t, {
767
+ announcedValue: r,
768
+ announcedContribution: i,
769
+ validatedValue: a
770
+ }) : this.recordAnnounced();
738
771
  }), this;
739
772
  }
740
773
  get originalValue() {
@@ -755,25 +788,26 @@ var H = V, ze = Symbol("EnabledChangingAction"), U = class extends b {
755
788
  extendedOf(e) {
756
789
  let t = Object.create(null);
757
790
  return Object.entries(e).forEach(([e, n]) => {
758
- Ke.has(e) || (!(e in this) || Object.hasOwn(Object.prototype, e)) && (t[e] = n);
791
+ nt.has(e) || (!(e in this) || Object.hasOwn(Object.prototype, e)) && (t[e] = n);
759
792
  }), t;
760
793
  }
761
794
  assignParams(e) {
795
+ it(e);
762
796
  let t = this.extendedOf(e);
763
797
  Object.entries(e).forEach(([e, n]) => {
764
- Object.hasOwn(t, e) || Ke.has(e) || (this[e] = n);
765
- }), m(t) || this.setExtendedValues(t);
798
+ Object.hasOwn(t, e) || nt.has(e) || (this[e] = n);
799
+ }), h(t) || this.setExtendedValues(t);
766
800
  }
767
801
  touchState() {
768
- _e()?.touch(this);
802
+ he()?.touch(this);
769
803
  }
770
- [C]() {
804
+ [E]() {
771
805
  return {
772
806
  ...this.#t,
773
807
  errors: [...this.#t.errors]
774
808
  };
775
809
  }
776
- [de](e) {
810
+ [le](e) {
777
811
  let t = this.#t.validatingCount, n = this.#t.validatingChildren;
778
812
  Object.assign(this.#e, e), this.#e.validatingCount = t, this.#e.validatingChildren = n;
779
813
  }
@@ -787,23 +821,13 @@ var H = V, ze = Symbol("EnabledChangingAction"), U = class extends b {
787
821
  endValidating() {
788
822
  this.#t.validatingCount !== 0 && (this.#e.validatingCount--, this.validating || this.container?.childValidatingChanged(!1));
789
823
  }
790
- childValidatingChanged(e) {
791
- let t = this.validating;
792
- this.#e.validatingChildren += e ? 1 : -1, this.validating !== t && this.container?.childValidatingChanged(e);
793
- }
824
+ childValidatingChanged(e) {}
794
825
  get busy() {
795
826
  return !1;
796
827
  }
797
- get busyRead() {
798
- let e = Ge.get(this);
799
- return e || (e = n(() => this.composeBusy()), Ge.set(this, e)), e.value;
800
- }
801
- composeBusy() {
802
- return !1;
803
- }
804
828
  settled() {
805
829
  return !this.validating && !this.busy ? Promise.resolve() : new Promise((e) => {
806
- let t = d(() => this.validating || this.busy, (n) => {
830
+ let t = p(() => this.validating || this.busy, (n) => {
807
831
  n || (t(), e());
808
832
  }, { flush: "sync" });
809
833
  });
@@ -836,30 +860,30 @@ var H = V, ze = Symbol("EnabledChangingAction"), U = class extends b {
836
860
  return r(this), n;
837
861
  }
838
862
  markRecordIncomplete() {
839
- this._recordPending || (this._recordPending = !0, qe++);
863
+ this._recordPending || (this._recordPending = !0, at++);
840
864
  }
841
865
  completeRecords(e = this) {
842
- qe !== 0 && D(() => {
866
+ at !== 0 && A(() => {
843
867
  let t = (e) => {
844
- e._recordPending && (e._recordPending = !1, qe--, e.rerunEagerActions()), e.members.forEach(t);
868
+ e._recordPending && (e._recordPending = !1, at--, e.rerunEagerActions()), e.members.forEach(t);
845
869
  };
846
870
  t(e);
847
871
  });
848
872
  }
849
873
  rerunEagerActions() {
850
- D((e) => {
851
- this.boundActions?.triggerEager(this, this.value, this.value), e.markValidityDirty(this);
874
+ A((e) => {
875
+ this.boundActions?.triggerEager(this, this.contribution, this.contribution), e.markValidityDirty(this);
852
876
  });
853
877
  }
854
878
  get boundActions() {
855
879
  return this._actions;
856
880
  }
857
881
  noteBinding(e) {
858
- let t = J.get(this);
859
- t || (t = /* @__PURE__ */ new Set(), J.set(this, t)), t.add(new WeakRef(e));
882
+ let t = tt.get(this);
883
+ t || (t = /* @__PURE__ */ new Set(), tt.set(this, t)), t.add(new WeakRef(e));
860
884
  }
861
885
  get boundElements() {
862
- let e = this.declaration, t = J.get(e), n = [e];
886
+ let e = this.declaration, t = tt.get(e), n = [e];
863
887
  return t && t.forEach((e) => {
864
888
  let r = e.deref();
865
889
  r ? n.push(r) : t.delete(e);
@@ -868,7 +892,7 @@ var H = V, ze = Symbol("EnabledChangingAction"), U = class extends b {
868
892
  get actions() {
869
893
  let e = this.declaration;
870
894
  if (!e._actions) {
871
- let t = new L();
895
+ let t = new Ae();
872
896
  e.boundElements.forEach((e) => {
873
897
  e._actions = t;
874
898
  });
@@ -879,91 +903,158 @@ var H = V, ze = Symbol("EnabledChangingAction"), U = class extends b {
879
903
  return this.#e.valueVersion;
880
904
  }
881
905
  bumpValueVersion() {
882
- D((e) => {
906
+ A((e) => {
883
907
  e.touch(this), this.#e.valueVersion++;
884
908
  let t = this.parent;
885
909
  for (; t;) e.touch(t), t.#e.valueVersion++, t = t.parent;
886
910
  });
887
911
  }
888
912
  propagateValueChanged(e = !1) {
889
- D((t) => {
913
+ A((t) => {
890
914
  t.markValueChanged(this, e), t.markValidityDirty(this), this.parent?.notifyValueChanged();
891
915
  });
892
916
  }
893
917
  constructed(e) {}
894
- refreshPreviousValue() {}
918
+ refreshPreviousValue() {
919
+ this.#t.announcedContribution = this.contribution;
920
+ }
895
921
  get countedValid() {
896
922
  return this.#t.errors.length === 0 && this.#t.invalidChildren === 0;
897
923
  }
898
924
  takeChild(e, t) {
899
- D((n) => {
925
+ A((n) => {
900
926
  if (e.parent) throw TypeError("This element already belongs to a container - pass a bind() of it");
901
- n.touch(e), e.#e.fieldName = t, e.#e.parent = this, this.adoptChild(e);
927
+ n.touch(e), e.#e.fieldName = t;
928
+ let r = this.effectiveAccess === "editable" ? void 0 : e.effectiveAccessFromHere();
929
+ e.#e.parent = this, r && e.revalidateWhereChanged(r), this.adoptChild(e);
902
930
  });
903
931
  }
904
932
  adoptChild(e) {
905
- D((t) => {
906
- t.touch(this), e.#t.valid || this.#t.invalidChildren++, e.validating && this.childValidatingChanged(!0), t.whenRolledBack(() => {
933
+ A((t) => {
934
+ t.touch(this), !e.#t.valid && e.countsInContainer && this.#t.invalidChildren++, e.validating && this.childValidatingChanged(!0), t.whenRolledBack(() => {
907
935
  e.validating && this.childValidatingChanged(!1);
908
936
  }), t.markValidityDirty(this);
909
937
  });
910
938
  }
911
939
  releaseChild(e) {
912
- D((t) => {
913
- t.touch(this), t.touch(e), e.#t.valid || this.#t.invalidChildren--, e.validating && this.childValidatingChanged(!1), t.whenRolledBack(() => {
940
+ A((t) => {
941
+ t.touch(this), t.touch(e), !e.#t.valid && e.countsInContainer && this.#t.invalidChildren--;
942
+ let n = this.effectiveAccess === "editable" ? void 0 : e.effectiveAccessFromHere();
943
+ e.validating && this.childValidatingChanged(!1), t.whenRolledBack(() => {
914
944
  e.validating && this.childValidatingChanged(!0);
915
- }), e.#e.parent = void 0, e.#e.fieldName = void 0, t.markValidityDirty(this);
945
+ }), e.#e.parent = void 0, e.#e.fieldName = void 0, n && e.revalidateWhereChanged(n), t.markValidityDirty(this);
916
946
  });
917
947
  }
918
948
  resetTo(e, t) {
919
- D(() => {
949
+ A(() => {
920
950
  let n = t === void 0 ? e.value : t, r = this.errors.length > 0;
921
951
  r && (this.errors = []), this.touched = !1;
922
- let i = this.enabled && this.value !== n;
952
+ let i = this.value !== n;
923
953
  this.value = n, this.originalValue = this.value, this.validate(!i && r);
924
954
  });
925
955
  }
926
956
  resetChild(e, t, n) {
927
957
  e.resetTo(t, n);
928
958
  }
929
- childValidityChanged(e) {
930
- this.#t.invalidChildren += e ? -1 : 1;
931
- }
932
- get validRead() {
933
- let e = We.get(this);
934
- return e || (e = n(() => this.composeValid()), We.set(this, e)), e.value;
935
- }
936
- composeValid() {
937
- return this.#e.errors.length === 0;
938
- }
959
+ childValidityChanged(e) {}
939
960
  get visibility() {
940
961
  return this.#e.visibility;
941
962
  }
942
963
  set visibility(e) {
943
964
  let t = this.#e.visibility;
944
- e !== t && D((n) => {
945
- let r = this.boundActions?.trigger(K, this, e, t);
946
- if (!(r instanceof x)) {
947
- if (!y.isDefined(r ?? e)) throw Error("visibility must be a DisplayMode constant");
948
- n.touch(this), this.#e.visibility = y.fromAny(r ?? e), this.boundActions?.trigger(q, this, this.#e.visibility, t);
949
- }
965
+ e !== t && A((n) => {
966
+ let r = this.boundActions?.trigger(Qe, this, e, t);
967
+ if (r instanceof C) return;
968
+ let i = r ?? e;
969
+ if (!x(i)) throw Error(`${W(i)} is not a visibility: ${rt(y)}`);
970
+ n.touch(this), this.#e.visibility = i, this.boundActions?.trigger(et, this, i, t);
950
971
  });
951
972
  }
952
- get enabled() {
953
- return this.#e.enabled;
954
- }
955
- set enabled(e) {
956
- let t = this.#e.enabled;
957
- e !== t && D((n) => {
958
- let r = this.boundActions?.trigger(U, this, e, t);
959
- if (!(r instanceof x)) {
960
- if (!p(r ?? e)) throw Error("Enabled value must be boolean");
961
- n.touch(this), this.#e.enabled = r ?? e, this.#e.enabled !== t && this.bumpValueVersion(), this.boundActions?.trigger(W, this, this.#e.enabled, t);
973
+ get access() {
974
+ return this.#e.access;
975
+ }
976
+ set access(e) {
977
+ let t = this.#e.access;
978
+ e !== t && A((n) => {
979
+ let r = this.boundActions?.trigger(Ve, this, e, t);
980
+ if (r instanceof C) return;
981
+ let i = r ?? e;
982
+ if (!se(i)) throw Error(`${W(i)} is not an access: ${rt(v)}`);
983
+ if (i === t) return;
984
+ let a = this.enabled, o = i === "editable";
985
+ if (o !== a) {
986
+ let e = this.boundActions?.trigger(Ke, this, o, a);
987
+ if (e instanceof C) return;
988
+ if (e != null && typeof e != "boolean") throw Error(`${W(e)} is not what an EnabledChangingAction answers with: a boolean`);
989
+ if (e === a) return;
962
990
  }
991
+ n.touch(this);
992
+ let s = this.contribution, c = this.countsInContainer, l = this.effectiveAccessBelow();
993
+ this.#e.access = i, this.revalidateWhereChanged(l), this.composesValue || this.boundActions?.triggerEager(this, this.contribution, s), this.contributionChanged(n, c), this.boundActions?.trigger(Ue, this, i, t), this.enabled !== a && this.boundActions?.trigger(Je, this, this.enabled, a);
963
994
  });
964
995
  }
996
+ get effectiveAccess() {
997
+ let e = this.access, t = this.parent?.effectiveAccess;
998
+ return t === "disabled" || t === "disabled-null" ? "disabled" : t === "readonly" && e === "editable" ? "readonly" : e;
999
+ }
1000
+ [ce]() {
1001
+ if (this.#t.access === "disabled") return !0;
1002
+ for (let e = this.#t.parent; e; e = e.#t.parent) if (e.#t.access === "disabled" || e.#t.access === "disabled-null") return !0;
1003
+ return !1;
1004
+ }
1005
+ get enabled() {
1006
+ return this.access === "editable";
1007
+ }
965
1008
  get effectiveEnabled() {
966
- return this.enabled && (this.parent?.effectiveEnabled ?? !0);
1009
+ return this.effectiveAccess === "editable";
1010
+ }
1011
+ effectiveAccessFromHere() {
1012
+ let e = this.effectiveAccessBelow();
1013
+ return e.set(this, this.effectiveAccess), e;
1014
+ }
1015
+ effectiveAccessBelow() {
1016
+ let e = /* @__PURE__ */ new Map(), t = (n) => {
1017
+ n.members.forEach((n) => {
1018
+ e.set(n, n.effectiveAccess), t(n);
1019
+ });
1020
+ };
1021
+ return t(this), e;
1022
+ }
1023
+ revalidateWhereChanged(e) {
1024
+ e.forEach((e, t) => {
1025
+ t.effectiveAccess !== e && t.rerunEagerActions();
1026
+ });
1027
+ }
1028
+ serializesAs(e) {
1029
+ if (e === "fullValue") return "value";
1030
+ switch (this.access) {
1031
+ case "disabled": return "omit";
1032
+ case "disabled-null": return "null";
1033
+ default: return "value";
1034
+ }
1035
+ }
1036
+ childSerializesAs(e, t) {
1037
+ return e.serializesAs(t);
1038
+ }
1039
+ get contribution() {
1040
+ switch (this.serializesAs("value")) {
1041
+ case "omit": return;
1042
+ case "null": return null;
1043
+ default: return this.value;
1044
+ }
1045
+ }
1046
+ get holding() {
1047
+ return this.value;
1048
+ }
1049
+ get countsInContainer() {
1050
+ return this.serializesAs("value") !== "omit";
1051
+ }
1052
+ contributionChanged(e, t) {
1053
+ e.markValueChanged(this, !1), e.markValidityDirty(this), this.bumpValueVersion();
1054
+ let n = this.container;
1055
+ if (!n) return;
1056
+ let r = this.countsInContainer;
1057
+ r !== t && !this.#t.valid && (e.touch(n), n.childValidityChanged(!r), e.markValidityDirty(n)), this.parent.notifyValueChanged();
967
1058
  }
968
1059
  get composesValue() {
969
1060
  return !1;
@@ -971,23 +1062,36 @@ var H = V, ze = Symbol("EnabledChangingAction"), U = class extends b {
971
1062
  childComposesValue(e) {
972
1063
  return e.composesValue;
973
1064
  }
974
- [fe](e, t, n, r) {
1065
+ [ue](e, t, n, r) {
975
1066
  if (r?.forEach((e) => this.boundActions?.trigger(e.actionClass, this, e.item, e.index)), !t) return;
976
- let i = this.boundActions;
977
- if (this.composesValue && !(i?.willTrigger(ue) || i?.hasEager)) return;
978
- let a = this.value, o = this.#t.announcedValue;
979
- !n && (this.composesValue ? h(a, o) : a === o) || (e.touch(this), this.#t.announcedValue = a, this.composesValue && i?.triggerEager(this, a, o), i?.trigger(S, this, a, o));
1067
+ let i = this.boundActions, a = this.composesValue, o = (e, t) => a ? g(e, t) : e === t;
1068
+ if (a && i?.hasEager) {
1069
+ let t = this.contribution, r = this.#t.validatedValue;
1070
+ (n || !g(t, r)) && (e.touch(this), this.#t.validatedValue = t, i.triggerEager(this, t, r));
1071
+ }
1072
+ if (!a || i?.willTrigger(w)) {
1073
+ let t = this.holding, r = this.#t.announcedValue;
1074
+ (n || !o(t, r)) && (e.touch(this), this.#t.announcedValue = t, i?.trigger(T, this, t, r));
1075
+ }
1076
+ if (i?.willTrigger(We)) {
1077
+ let t = this.contribution, n = this.#t.announcedContribution;
1078
+ o(t, n) || (e.touch(this), this.#t.announcedContribution = t, i.trigger(U, this, t, n));
1079
+ }
1080
+ }
1081
+ recordAnnounced() {
1082
+ let e = this.boundActions;
1083
+ (!this.composesValue || e?.willTrigger(w)) && (this.#t.announcedValue = this.holding), e?.willTrigger(We) && (this.#t.announcedContribution = this.contribution), this.composesValue && e?.hasEager && (this.#t.validatedValue = this.contribution);
980
1084
  }
981
- [pe](e) {
1085
+ [de](e) {
982
1086
  let t = this.#t.valid, n = this.countedValid;
983
1087
  if (n === t) return;
984
1088
  e.touch(this), this.#t.valid = n;
985
1089
  let r = this.container;
986
- r && (e.touch(r), r.childValidityChanged(n), e.markValidityDirty(r)), this.boundActions?.trigger(G, this, n, t);
1090
+ r && this.countsInContainer && (e.touch(r), r.childValidityChanged(n), e.markValidityDirty(r)), this.boundActions?.trigger(Xe, this, n, t);
987
1091
  }
988
1092
  validate(e = !1) {
989
- D((t) => {
990
- e && this.boundActions?.triggerEager(this, this.value, this.value), t.markValidityDirty(this);
1093
+ A((t) => {
1094
+ e && this.boundActions?.triggerEager(this, this.contribution, this.contribution), t.markValidityDirty(this);
991
1095
  });
992
1096
  }
993
1097
  get valid() {
@@ -997,19 +1101,19 @@ var H = V, ze = Symbol("EnabledChangingAction"), U = class extends b {
997
1101
  return this.value;
998
1102
  }
999
1103
  get isChanged() {
1000
- return !h(this.value, this.originalValue);
1104
+ return !g(this.value, this.originalValue);
1001
1105
  }
1002
1106
  boundFrom(e, t, n, r) {
1003
- this.#t.declaration = e.declaration;
1107
+ r && it(r), this.#t.declaration = e.declaration;
1004
1108
  let i = {
1005
1109
  ...e.extra,
1006
1110
  ...r && this.extendedOf(r)
1007
1111
  };
1008
- m(i) || this.setExtendedValues(i);
1112
+ h(i) || this.setExtendedValues(i);
1009
1113
  let a = this.declaration;
1010
1114
  a.noteBinding(this);
1011
1115
  let o = a._actions;
1012
- o && (this._actions = o, o.bindTo(this), o.triggerEager(this, t, n));
1116
+ o && (this._actions = o, o.bindTo(this), this.recordAnnounced(), o.triggerEager(this, t, n));
1013
1117
  }
1014
1118
  registerInitialActions(e) {
1015
1119
  e.forEach((e) => {
@@ -1017,21 +1121,21 @@ var H = V, ze = Symbol("EnabledChangingAction"), U = class extends b {
1017
1121
  });
1018
1122
  }
1019
1123
  registerAction(e) {
1020
- return D((t) => {
1124
+ return A((t) => {
1021
1125
  t.willAnnounceValue(this) || this.refreshPreviousValue(), this.actions.register(e), this.registered(t, e);
1022
1126
  }), this;
1023
1127
  }
1024
1128
  registerActionBefore(e, t) {
1025
- return D((n) => {
1129
+ return A((n) => {
1026
1130
  n.willAnnounceValue(this) || this.refreshPreviousValue(), this.actions.register(e, t), this.registered(n, e);
1027
1131
  }), this;
1028
1132
  }
1029
1133
  unregisterAction(e) {
1030
1134
  let t = !1;
1031
- return D((n) => {
1135
+ return A((n) => {
1032
1136
  let r = this.boundActions;
1033
1137
  if (!r || (t = r.unregister(e), !t)) return;
1034
- n.touch(this), e instanceof I && this.#e.validationEpoch++;
1138
+ n.touch(this), e instanceof R && this.#e.validationEpoch++;
1035
1139
  let i = this.boundElements;
1036
1140
  n.whenRolledBack(() => {
1037
1141
  r.register(e), i.forEach((t) => e.boundToBinding(t));
@@ -1041,7 +1145,7 @@ var H = V, ze = Symbol("EnabledChangingAction"), U = class extends b {
1041
1145
  registered(e, t) {
1042
1146
  let n = this.boundElements;
1043
1147
  n.forEach((e) => {
1044
- t.boundToBinding(e), t.eager && this.actions.triggerEagerFor(t.classIdentifier, e, e.value, e.originalValue);
1148
+ t.boundToBinding(e), t.eager && (e.#t.validatedValue = e.contribution, this.actions.triggerEagerFor(t.classIdentifier, e, e.contribution, e.originalValue));
1045
1149
  }), e.whenRolledBack(() => {
1046
1150
  this.boundActions?.unregister(t) && n.forEach((e) => t.unregisterFrom(e));
1047
1151
  });
@@ -1054,7 +1158,7 @@ var H = V, ze = Symbol("EnabledChangingAction"), U = class extends b {
1054
1158
  return this.#e.validationEpoch;
1055
1159
  }
1056
1160
  clearValidators() {
1057
- D((e) => {
1161
+ A((e) => {
1058
1162
  e.touch(this), this.#e.validationEpoch++;
1059
1163
  let t = this.boundActions;
1060
1164
  if (t) {
@@ -1071,10 +1175,10 @@ var H = V, ze = Symbol("EnabledChangingAction"), U = class extends b {
1071
1175
  };
1072
1176
  //#endregion
1073
1177
  //#region src/actions/conditional/statement.ts
1074
- function Je(e, t) {
1178
+ function ot(e, t) {
1075
1179
  return e ? !t : t;
1076
1180
  }
1077
- var Ye = class e {
1181
+ var st = class e {
1078
1182
  operand1;
1079
1183
  operator;
1080
1184
  operand2;
@@ -1087,9 +1191,9 @@ var Ye = class e {
1087
1191
  }
1088
1192
  static valueOf(t, n) {
1089
1193
  if (t instanceof e) return t.evaluate(n);
1090
- if (t instanceof Y) {
1091
- let e = n ? z(t, n) : t;
1092
- return e ? u(e.value) : void 0;
1194
+ if (t instanceof G) {
1195
+ let e = n ? Ne(t, n) : t;
1196
+ return e ? f(e.value) : void 0;
1093
1197
  }
1094
1198
  return t;
1095
1199
  }
@@ -1106,7 +1210,7 @@ var Ye = class e {
1106
1210
  case H.OR: return !!(n || r);
1107
1211
  case H.NAND: return !(n && r);
1108
1212
  case H.NOR: return !(n || r);
1109
- case H.XOR: return Je(!!n, !!r);
1213
+ case H.XOR: return ot(!!n, !!r);
1110
1214
  case H.NOT: return !n;
1111
1215
  case H.EQUALS: return n == r;
1112
1216
  case H.NOT_EQUALS: return n != r;
@@ -1116,56 +1220,58 @@ var Ye = class e {
1116
1220
  case H.GT: return n > r;
1117
1221
  case H.IN: return !!r?.includes?.(n);
1118
1222
  case H.NOT_IN: return !r?.includes?.(n);
1119
- case H.INCLUDES: return g(n) && g(r) && n.indexOf(r) >= 0;
1120
- case H.NOT_INCLUDES: return !(g(n) && g(r) && n.indexOf(r) >= 0);
1223
+ case H.INCLUDES: return _(n) && _(r) && n.indexOf(r) >= 0;
1224
+ case H.NOT_INCLUDES: return !(_(n) && _(r) && n.indexOf(r) >= 0);
1121
1225
  default: throw Error(`Operator not implemented ${this.operator}`);
1122
1226
  }
1123
1227
  }
1124
1228
  collectFields() {
1125
1229
  let t = /* @__PURE__ */ new Set();
1126
1230
  function n(n) {
1127
- n instanceof Y ? t.add(n) : n instanceof e && n.collectFields().forEach((e) => t.add(e));
1231
+ n instanceof G ? t.add(n) : n instanceof e && n.collectFields().forEach((e) => t.add(e));
1128
1232
  }
1129
1233
  return n(this.operand1), n(this.operand2), t;
1130
1234
  }
1131
- }, Xe = Symbol("ExecuteAction"), Ze = class extends b {
1235
+ }, ct = Symbol("ExecuteAction"), lt = class extends S {
1132
1236
  constructor(e) {
1133
1237
  super(e);
1134
1238
  }
1135
1239
  static get classIdentifier() {
1136
- return Xe;
1240
+ return ct;
1137
1241
  }
1138
1242
  execute(e, t, n) {
1139
1243
  return super.execute(e, t, n);
1140
1244
  }
1141
- }, Qe = Symbol("ListItemAddedAction"), X = class extends b {
1245
+ }, ut = Symbol("ListItemAddedAction"), K = class extends S {
1142
1246
  constructor(e) {
1143
1247
  super(e);
1144
1248
  }
1145
1249
  static get classIdentifier() {
1146
- return Qe;
1250
+ return ut;
1147
1251
  }
1148
1252
  execute(e, t, n, r) {
1149
1253
  return super.execute(e, t, n, r);
1150
1254
  }
1151
- }, $e = Symbol("ListItemRemovedAction"), et = class extends b {
1255
+ }, dt = Symbol("ListItemRemovedAction"), ft = class extends S {
1152
1256
  constructor(e) {
1153
1257
  super(e);
1154
1258
  }
1155
1259
  static get classIdentifier() {
1156
- return $e;
1260
+ return dt;
1157
1261
  }
1158
1262
  execute(e, t, n, r) {
1159
1263
  return super.execute(e, t, n, r);
1160
1264
  }
1161
- }, tt = Object.freeze({});
1162
- function nt() {
1265
+ }, pt = Object.freeze({});
1266
+ function mt() {
1163
1267
  return {
1164
1268
  originalValue: void 0,
1165
1269
  announcedValue: void 0,
1270
+ announcedContribution: void 0,
1271
+ validatedValue: void 0,
1166
1272
  errors: [],
1167
- visibility: y.FULL,
1168
- enabled: !0,
1273
+ visibility: b,
1274
+ access: oe,
1169
1275
  valueVersion: 0,
1170
1276
  validatingCount: 0,
1171
1277
  validatingChildren: 0,
@@ -1173,35 +1279,35 @@ function nt() {
1173
1279
  fieldName: void 0,
1174
1280
  validationEpoch: 0,
1175
1281
  declaration: void 0,
1176
- extra: tt,
1282
+ extra: pt,
1177
1283
  valid: !0,
1178
1284
  invalidChildren: 0
1179
1285
  };
1180
1286
  }
1181
- function rt() {
1287
+ function ht() {
1182
1288
  return {
1183
- ...nt(),
1289
+ ...mt(),
1184
1290
  value: void 0,
1185
1291
  touched: !1
1186
1292
  };
1187
1293
  }
1188
- function it() {
1294
+ function gt() {
1189
1295
  return {
1190
- ...nt(),
1296
+ ...mt(),
1191
1297
  announcedValue: null,
1192
1298
  cachedValue: null,
1193
1299
  cachedValueVersion: -1
1194
1300
  };
1195
1301
  }
1196
- function at() {
1302
+ function _t() {
1197
1303
  return {
1198
- ...it(),
1304
+ ...gt(),
1199
1305
  fieldNames: []
1200
1306
  };
1201
1307
  }
1202
- function ot() {
1308
+ function vt() {
1203
1309
  return {
1204
- ...it(),
1310
+ ...gt(),
1205
1311
  rows: null,
1206
1312
  rowsVersion: 0,
1207
1313
  cachedItems: null,
@@ -1210,7 +1316,7 @@ function ot() {
1210
1316
  }
1211
1317
  //#endregion
1212
1318
  //#region src/field.ts
1213
- var Z = class extends Y {
1319
+ var q = class extends G {
1214
1320
  get [Symbol.toStringTag]() {
1215
1321
  return "Field";
1216
1322
  }
@@ -1227,15 +1333,15 @@ var Z = class extends Y {
1227
1333
  this.state.value = e;
1228
1334
  }
1229
1335
  constructor(e) {
1230
- super(rt()), this.init(e);
1336
+ super(ht()), this.init(e);
1231
1337
  }
1232
1338
  init(e) {
1233
- D(() => {
1339
+ A(() => {
1234
1340
  if (e) {
1235
1341
  let { value: t, validators: n, actions: r, ...i } = e;
1236
1342
  this.registerInitialActions([...n || [], ...r || []]), this.assignParams(i), this._value = t === void 0 ? this.originalValue : t;
1237
1343
  }
1238
- this.constructed(e), this.originalValue === void 0 && (this.originalValue = this._value), this.raw.announcedValue = this._value, this.boundActions?.triggerEager(this, this.value, this.originalValue), this.validate();
1344
+ this.constructed(e), this.originalValue === void 0 && (this.originalValue = this._value), this.recordAnnounced(), this.boundActions?.triggerEager(this, this.contribution, this.originalValue), this.validate();
1239
1345
  });
1240
1346
  }
1241
1347
  get value() {
@@ -1243,13 +1349,10 @@ var Z = class extends Y {
1243
1349
  }
1244
1350
  set value(e) {
1245
1351
  let t = this._value;
1246
- !this.enabled || t === e || D((n) => {
1247
- n.touch(this), this._value = e, this.bumpValueVersion(), this.boundActions?.triggerEager(this, e, t), this.propagateValueChanged();
1352
+ t !== e && A((n) => {
1353
+ n.touch(this), this._value = e, this.bumpValueVersion(), this.serializesAs("value") === "value" && this.boundActions?.triggerEager(this, e, t), this.propagateValueChanged();
1248
1354
  });
1249
1355
  }
1250
- get parent() {
1251
- return super.parent;
1252
- }
1253
1356
  get touched() {
1254
1357
  return this.state.touched;
1255
1358
  }
@@ -1260,31 +1363,31 @@ var Z = class extends Y {
1260
1363
  let n = this.constructor, r = new n({
1261
1364
  value: e === void 0 ? this.value : e,
1262
1365
  ...t && "originalValue" in t ? { originalValue: t.originalValue } : {},
1263
- enabled: t?.enabled ?? this.enabled,
1366
+ access: t?.access ?? this.access,
1264
1367
  visibility: t?.visibility ?? this.visibility
1265
1368
  });
1266
- return r.boundFrom(this, r.value, r.originalValue, t), r;
1369
+ return r.boundFrom(this, r.contribution, r.originalValue, t), r;
1267
1370
  }
1268
- }, st = /* @__PURE__ */ new WeakMap();
1269
- function ct(e) {
1371
+ }, yt = /* @__PURE__ */ new WeakMap();
1372
+ function bt(e) {
1270
1373
  if (e != null) return Object.values(e).some((e) => e != null) ? e : void 0;
1271
1374
  }
1272
- var lt = class extends Z {
1375
+ var xt = class extends q {
1273
1376
  get [Symbol.toStringTag]() {
1274
1377
  return "Action";
1275
1378
  }
1276
1379
  init(e) {
1277
- D(() => {
1380
+ A(() => {
1278
1381
  if (this._value = {
1279
1382
  label: void 0,
1280
1383
  icon: void 0
1281
1384
  }, e) {
1282
1385
  let { value: t, originalValue: n, validators: r, actions: i, ...a } = e;
1283
1386
  this.registerInitialActions([...r || [], ...i || []]), this.assignParams(a);
1284
- let o = ct(t), s = ct(n);
1387
+ let o = bt(t), s = bt(n);
1285
1388
  o ? this._value = o : s && (this._value = { ...s }), s && (this.originalValue = Object.freeze({ ...s }));
1286
1389
  }
1287
- this.constructed(e), this.originalValue === void 0 && (this.originalValue = this._value), this.raw.announcedValue = this._value, this.boundActions?.triggerEager(this, this.value, this.originalValue), this.validate();
1390
+ this.constructed(e), this.originalValue === void 0 && (this.originalValue = this._value), this.recordAnnounced(), this.boundActions?.triggerEager(this, this.contribution, this.originalValue), this.validate();
1288
1391
  });
1289
1392
  }
1290
1393
  valueWith(e, t) {
@@ -1304,8 +1407,8 @@ var lt = class extends Z {
1304
1407
  this.value.label !== e && (this.value = this.valueWith("label", e));
1305
1408
  }
1306
1409
  get busyRuns() {
1307
- let e = st.get(this);
1308
- return e || (e = te(0), st.set(this, e)), e;
1410
+ let e = yt.get(this);
1411
+ return e || (e = l(0), yt.set(this, e)), e;
1309
1412
  }
1310
1413
  get busy() {
1311
1414
  return this.busyRuns.value > 0;
@@ -1314,19 +1417,19 @@ var lt = class extends Z {
1314
1417
  let t = this.busyRuns;
1315
1418
  t.value++;
1316
1419
  try {
1317
- return await this.triggerAction(Ze, e);
1420
+ return await this.triggerAction(lt, e);
1318
1421
  } finally {
1319
1422
  t.value--;
1320
1423
  }
1321
1424
  }
1322
- }, ut = /* @__PURE__ */ i({
1425
+ }, St = /* @__PURE__ */ i({
1323
1426
  __name: "messages-widget",
1324
1427
  props: {
1325
1428
  message: {},
1326
1429
  classes: {}
1327
1430
  },
1328
1431
  setup(e) {
1329
- let t = e, n = c("vue-markdown"), i = /* @__PURE__ */ new Set(/* @__PURE__ */ "div.span.p.h1.h2.h3.h4.h5.h6.section.article.aside.nav.header.footer.main.figure.figcaption.blockquote.pre.code.em.strong.small.mark.del.ins.sub.sup.i.b.u.s.a.img.button.input.textarea.select.option.label.form.table.tr.td.th.thead.tbody.tfoot.ul.ol.li.dl.dt.dd".split(".")), o = () => {
1432
+ let t = e, n = u("vue-markdown"), i = /* @__PURE__ */ new Set(/* @__PURE__ */ "div.span.p.h1.h2.h3.h4.h5.h6.section.article.aside.nav.header.footer.main.figure.figcaption.blockquote.pre.code.em.strong.small.mark.del.ins.sub.sup.i.b.u.s.a.img.button.input.textarea.select.option.label.form.table.tr.td.th.thead.tbody.tfoot.ul.ol.li.dl.dt.dd".split(".")), o = () => {
1330
1433
  if (typeof t.message == "string") return a("span", { class: t.classes }, t.message);
1331
1434
  let e = [];
1332
1435
  return t.message.forEach((r) => {
@@ -1350,7 +1453,7 @@ var lt = class extends Z {
1350
1453
  }));
1351
1454
  }
1352
1455
  break;
1353
- default: e.push(a(i.has(r.componentName.toLowerCase()) ? r.componentName : c(r.componentName), {
1456
+ default: e.push(a(i.has(r.componentName.toLowerCase()) ? r.componentName : u(r.componentName), {
1354
1457
  class: [t.classes, r.extraClasses],
1355
1458
  ...r.componentBindings,
1356
1459
  ...r.componentBody ? { innerHTML: r.componentBody } : {}
@@ -1360,7 +1463,59 @@ var lt = class extends Z {
1360
1463
  };
1361
1464
  return (e, t) => (s(), r(o));
1362
1465
  }
1363
- }), dt = /* @__PURE__ */ new WeakMap(), ft = (e) => ({
1466
+ }), Ct = /* @__PURE__ */ new WeakMap(), wt = /* @__PURE__ */ new WeakMap(), J = class extends G {
1467
+ get [Symbol.toStringTag]() {
1468
+ return "Container";
1469
+ }
1470
+ get touched() {
1471
+ return this.children.some((e) => e.touched);
1472
+ }
1473
+ set touched(e) {
1474
+ A(() => {
1475
+ this.members.forEach((t) => {
1476
+ t.touched = e;
1477
+ });
1478
+ });
1479
+ }
1480
+ get valid() {
1481
+ return this.validRead;
1482
+ }
1483
+ get busy() {
1484
+ return this.busyRead;
1485
+ }
1486
+ validate(e = !1) {
1487
+ A(() => {
1488
+ e && this.members.forEach((e) => e.validate(!0)), super.validate(e);
1489
+ });
1490
+ }
1491
+ notifyValueChanged() {
1492
+ this.propagateValueChanged();
1493
+ }
1494
+ get composesValue() {
1495
+ return !0;
1496
+ }
1497
+ refreshPreviousValue() {
1498
+ super.refreshPreviousValue(), this.raw.announcedValue = this.holding;
1499
+ }
1500
+ get holding() {
1501
+ return this.fullValue;
1502
+ }
1503
+ get validRead() {
1504
+ let e = Ct.get(this);
1505
+ return e || (e = n(() => this.state.errors.length === 0 && this.children.every((e) => e.valid || this.childSerializesAs(e, "value") === "omit")), Ct.set(this, e)), e.value;
1506
+ }
1507
+ get busyRead() {
1508
+ let e = wt.get(this);
1509
+ return e || (e = n(() => this.children.some((e) => e.busy)), wt.set(this, e)), e.value;
1510
+ }
1511
+ childValidatingChanged(e) {
1512
+ let t = this.validating;
1513
+ this.state.validatingChildren += e ? 1 : -1, this.validating !== t && this.parent?.childValidatingChanged(e);
1514
+ }
1515
+ childValidityChanged(e) {
1516
+ this.raw.invalidChildren += e ? -1 : 1;
1517
+ }
1518
+ }, Tt = /* @__PURE__ */ new WeakSet(), Et = Object.freeze({}), Dt = /* @__PURE__ */ new WeakMap(), Ot = (e) => ({
1364
1519
  get(t, n, r) {
1365
1520
  return e(), Reflect.get(t, n, r);
1366
1521
  },
@@ -1382,7 +1537,7 @@ var lt = class extends Z {
1382
1537
  deleteProperty(e, t) {
1383
1538
  throw TypeError(`fields.${String(t)} cannot be deleted: use removeField() to take a member out`);
1384
1539
  }
1385
- }), Q = class e extends Y {
1540
+ }), Y = class e extends J {
1386
1541
  get [Symbol.toStringTag]() {
1387
1542
  return "Group";
1388
1543
  }
@@ -1394,33 +1549,38 @@ var lt = class extends Z {
1394
1549
  }
1395
1550
  _fields;
1396
1551
  constructor(t, n) {
1397
- if (super(at()), !e.isValidFields(t)) throw Error("Invalid fields object provided");
1398
- this._fields = Object.create(null), D(() => {
1399
- if (Object.entries(t).forEach(([e, t]) => this.addField(e, t)), n) {
1400
- let { value: e, validators: t, actions: r, ...i } = n;
1401
- this.registerInitialActions([...t || [], ...r || []]), this.assignParams(i), e === void 0 ? this.originalValue !== void 0 && this.assignMembers(this.originalValue) : this.assignMembers(e);
1552
+ if (super(_t()), !e.isValidFields(t)) throw Error("Invalid fields object provided");
1553
+ this._fields = Object.create(null), A(() => {
1554
+ Tt.add(this);
1555
+ try {
1556
+ if (Object.entries(t).forEach(([e, t]) => this.addField(e, t)), n) {
1557
+ let { value: e, validators: t, actions: r, ...i } = n;
1558
+ this.registerInitialActions([...t || [], ...r || []]), this.assignParams(i), e === void 0 ? this.originalValue !== void 0 && this.assignMembers(this.originalValue) : this.assignMembers(e);
1559
+ }
1560
+ } finally {
1561
+ Tt.delete(this);
1402
1562
  }
1403
1563
  this.completeRecords(), this.constructed(n);
1404
1564
  let r = this.value;
1405
- this.originalValue === void 0 && (this.originalValue = e.baseline(r)), this.raw.announcedValue = r, this.boundActions?.triggerEager(this, r, this.originalValue), this.validate();
1565
+ this.originalValue === void 0 && (this.originalValue = e.baseline(r)), this.recordAnnounced(), this.boundActions?.triggerEager(this, this.contribution, this.originalValue), this.validate();
1406
1566
  });
1407
1567
  }
1408
- [C]() {
1409
- let e = super[C]();
1568
+ [E]() {
1569
+ let e = super[E]();
1410
1570
  return e.fieldNames = [...this.raw.fieldNames], e;
1411
1571
  }
1412
1572
  static baseline(e) {
1413
1573
  return e == null ? e : { ...e };
1414
1574
  }
1415
1575
  addField(t, n) {
1416
- return D((r) => {
1576
+ return A((r) => {
1417
1577
  if (Object.hasOwn(this._fields, t)) throw Error(`Field ${t} is already in this form`);
1418
- this.takeChild(n, t), r.touch(this), e.setEntry(this._fields, t, n), r.whenRolledBack(() => e.dropEntry(this._fields, t)), this.state.fieldNames.push(t), this.completeRecords(n), this.bumpValueVersion(), this.notifyValueChanged();
1578
+ this.takeChild(n, t), r.touch(this), e.setEntry(this._fields, t, n), r.whenRolledBack(() => e.dropEntry(this._fields, t)), this.state.fieldNames.push(t), Tt.has(this) || this.completeRecords(n), this.bumpValueVersion(), this.notifyValueChanged();
1419
1579
  }), this;
1420
1580
  }
1421
1581
  removeField(t) {
1422
1582
  let n;
1423
- return D((r) => {
1583
+ return A((r) => {
1424
1584
  if (!Object.hasOwn(this._fields, t)) return;
1425
1585
  let i = this._fields[t];
1426
1586
  r.touch(this), this.releaseChild(i), e.dropEntry(this._fields, t), r.whenRolledBack(() => e.setEntry(this._fields, t, i)), this.state.fieldNames.splice(this.state.fieldNames.indexOf(t), 1), this.bumpValueVersion(), this.notifyValueChanged(), n = i;
@@ -1434,66 +1594,61 @@ var lt = class extends Z {
1434
1594
  }
1435
1595
  static isValidFields(e) {
1436
1596
  function t(e) {
1437
- return e instanceof Y;
1597
+ return e instanceof G;
1438
1598
  }
1439
1599
  return typeof e == "object" && !!e && Object.entries(e).every(([, e]) => t(e));
1440
1600
  }
1441
1601
  static createFromFormData(t) {
1442
- if (t instanceof Y) throw Error("data is already a Form structure, should be a simple object");
1443
- return new e(t == null ? {} : Object.fromEntries(Object.entries(t).map(([e, t]) => [e, new Z({ value: t })])));
1602
+ if (t instanceof G) throw Error("data is already a Form structure, should be a simple object");
1603
+ return new e(t == null ? {} : Object.fromEntries(Object.entries(t).map(([e, t]) => [e, new q({ value: t })])));
1444
1604
  }
1445
1605
  field(e) {
1446
1606
  return this._fields[e] ?? null;
1447
1607
  }
1448
1608
  get fields() {
1449
- let e = dt.get(this);
1450
- return e || (e = new Proxy(this._fields, ft(() => this.state.fieldNames.length)), dt.set(this, e)), e;
1609
+ let e = Dt.get(this);
1610
+ return e || (e = new Proxy(this._fields, Ot(() => this.state.fieldNames.length)), Dt.set(this, e)), e;
1451
1611
  }
1452
1612
  get members() {
1453
1613
  return this.raw.fieldNames.map((e) => this._fields[e]);
1454
1614
  }
1615
+ get children() {
1616
+ return this.state.fieldNames.map((e) => this._fields[e]);
1617
+ }
1455
1618
  get value() {
1456
1619
  let e = this.valueVersion;
1457
1620
  if (this.raw.cachedValueVersion === e) return this.raw.cachedValue;
1458
1621
  let t = Object.create(null);
1459
1622
  Object.entries(this._fields).forEach(([e, n]) => {
1460
- let r = n.value;
1461
- (n.enabled || this.childComposesValue(n) && !m(r)) && (t[e] = r);
1623
+ switch (this.childSerializesAs(n, "value")) {
1624
+ case "value":
1625
+ t[e] = n.value;
1626
+ break;
1627
+ case "null": t[e] = null;
1628
+ }
1462
1629
  });
1463
- let n = m(t) ? null : Object.freeze({ ...t });
1630
+ let n = h(t) ? Et : Object.freeze({ ...t });
1464
1631
  return this.raw.cachedValue = n, this.raw.cachedValueVersion = e, n;
1465
1632
  }
1466
1633
  assignMembers(e) {
1467
- D(() => {
1634
+ A(() => {
1468
1635
  Object.entries(this._fields).forEach(([t, n]) => {
1469
1636
  (e == null || Object.hasOwn(e, t)) && (n.value = e == null ? null : e[t]);
1470
1637
  });
1471
1638
  });
1472
1639
  }
1473
1640
  set value(e) {
1474
- D((t) => {
1641
+ A((t) => {
1475
1642
  this.assignMembers(e), t.markValidityDirty(this);
1476
1643
  });
1477
1644
  }
1478
1645
  resetTo(t, n) {
1479
1646
  let r = t;
1480
- D((t) => {
1647
+ A((t) => {
1481
1648
  t.touch(this), this.errors.length && (this.errors = []), Object.entries(this._fields).forEach(([e, t]) => {
1482
1649
  let i;
1483
1650
  n === null ? i = null : n !== void 0 && Object.hasOwn(n, e) && (i = n[e]), this.resetChild(t, r.field(e) ?? t, i);
1484
- });
1485
- let i = this.value;
1486
- this.raw.announcedValue = i, this.originalValue = e.baseline(i), super.validate(!0);
1487
- });
1488
- }
1489
- get touched() {
1490
- return Object.values(this._fields).some((e) => e.touched);
1491
- }
1492
- set touched(e) {
1493
- D(() => {
1494
- Object.values(this._fields).forEach((t) => {
1495
- t.touched = e;
1496
- });
1651
+ }), this.recordAnnounced(), this.originalValue = e.baseline(this.value), super.validate(!0);
1497
1652
  });
1498
1653
  }
1499
1654
  get fullValue() {
@@ -1502,32 +1657,6 @@ var lt = class extends Z {
1502
1657
  e[t] = n.fullValue;
1503
1658
  }), { ...e };
1504
1659
  }
1505
- notifyValueChanged() {
1506
- this.propagateValueChanged();
1507
- }
1508
- get composesValue() {
1509
- return !0;
1510
- }
1511
- refreshPreviousValue() {
1512
- this.raw.announcedValue = this.value;
1513
- }
1514
- get valid() {
1515
- return this.validRead;
1516
- }
1517
- composeValid() {
1518
- return this.state.errors.length === 0 && this.state.fieldNames.every((e) => this._fields[e].valid);
1519
- }
1520
- get busy() {
1521
- return this.busyRead;
1522
- }
1523
- composeBusy() {
1524
- return this.state.fieldNames.some((e) => this._fields[e].busy);
1525
- }
1526
- validate(e = !1) {
1527
- D(() => {
1528
- e && Object.values(this._fields).forEach((e) => e.validate(!0)), super.validate(e);
1529
- });
1530
- }
1531
1660
  static assertTookFields(e, t, n) {
1532
1661
  let r = Object.entries(t), i = e.raw.fieldNames;
1533
1662
  if (!(r.length === i.length && r.every(([t, n]) => e._fields[t] === n))) throw TypeError(`${n}.bind() built an element that did not take the members it was given, so the binding would carry the declaration's data. A subclass whose constructor does not take (fields, params) has to override bind() and construct itself.`);
@@ -1538,12 +1667,12 @@ var lt = class extends Z {
1538
1667
  r[e] = t.bind();
1539
1668
  });
1540
1669
  let i = this.constructor, a = new i(r, {
1541
- value: t === void 0 ? this.value : t,
1670
+ value: t === void 0 ? this.fullValue : t,
1542
1671
  ...n && "originalValue" in n ? { originalValue: n.originalValue } : {},
1543
- enabled: n?.enabled ?? this.enabled,
1672
+ access: n?.access ?? this.access,
1544
1673
  visibility: n?.visibility ?? this.visibility
1545
1674
  });
1546
- return e.assertTookFields(a, r, this.constructor.name), a.boundFrom(this, a.raw.announcedValue, a.originalValue, n), a;
1675
+ return e.assertTookFields(a, r, this.constructor.name), a.boundFrom(this, a.contribution, a.originalValue, n), a;
1547
1676
  }
1548
1677
  rebind(e) {
1549
1678
  return super.rebind(e);
@@ -1551,16 +1680,16 @@ var lt = class extends Z {
1551
1680
  };
1552
1681
  //#endregion
1553
1682
  //#region src/is-equal.ts
1554
- function pt(e, t) {
1555
- let n = e instanceof Y ? e.value : e, r = t instanceof Y ? t.value : t;
1556
- return n === e && r === t ? void 0 : h(n, r);
1683
+ function kt(e, t) {
1684
+ let n = e instanceof G ? e.value : e, r = t instanceof G ? t.value : t;
1685
+ return n === e && r === t ? void 0 : g(n, r);
1557
1686
  }
1558
- function mt(e, t) {
1559
- return e instanceof Y && t instanceof Y ? h(e.value, t.value) : ne(e, t, pt);
1687
+ function At(e, t) {
1688
+ return e instanceof G && t instanceof G ? g(e.value, t.value) : ee(e, t, kt);
1560
1689
  }
1561
1690
  //#endregion
1562
1691
  //#region src/list.ts
1563
- var ht = class e extends Y {
1692
+ var jt = Object.freeze([]), Mt = class e extends J {
1564
1693
  get [Symbol.toStringTag]() {
1565
1694
  return "List";
1566
1695
  }
@@ -1572,27 +1701,30 @@ var ht = class e extends Y {
1572
1701
  }
1573
1702
  _itemTemplate;
1574
1703
  constructor(t, n) {
1575
- super(ot()), this._itemTemplate = t, D(() => {
1704
+ super(vt()), this._itemTemplate = t, A(() => {
1576
1705
  if (n) {
1577
1706
  let { value: e, validators: t, actions: r, ...i } = n;
1578
1707
  this.registerInitialActions([...t || [], ...r || []]), this.assignParams(i), e === void 0 ? this.originalValue !== void 0 && this.setValueInternal(this.originalValue) : this.setValueInternal(e);
1579
1708
  }
1580
- this.constructed(n), this.originalValue === void 0 && (this.originalValue = e.baseline(this.value)), this.raw.announcedValue = this.value, this.boundActions?.triggerEager(this, this.value, this.originalValue), this.validate();
1709
+ this.constructed(n), this.originalValue === void 0 && (this.originalValue = e.baseline(this.value)), this.recordAnnounced(), this.boundActions?.triggerEager(this, this.contribution, this.originalValue), this.validate();
1581
1710
  });
1582
1711
  }
1583
- [C]() {
1584
- let e = super[C]();
1712
+ [E]() {
1713
+ let e = super[E]();
1585
1714
  return e.rows = this.raw.rows ? [...this.raw.rows] : this.raw.rows, e;
1586
1715
  }
1587
1716
  static baseline(e) {
1588
1717
  return e == null ? e : [...e];
1589
1718
  }
1590
- processSetValueItem(e) {
1591
- let t;
1592
- return t = e instanceof Q ? e : this._itemTemplate ? this._itemTemplate.bind(e) : Q.createFromFormData(e), this.takeChild(t), this.completeRecords(t), t;
1719
+ processSetValueItem(t) {
1720
+ let n;
1721
+ return n = t instanceof G ? t : this._itemTemplate ? this._itemTemplate.bind(t) : e.elementFor(t), this.takeChild(n), this.completeRecords(n), n;
1722
+ }
1723
+ static elementFor(t) {
1724
+ return ne(t) ? Y.createFromFormData(t) : Array.isArray(t) ? new e(void 0, { value: t }) : new q({ value: t });
1593
1725
  }
1594
- createPaddingItem() {
1595
- return this.processSetValueItem(this._itemTemplate ? this._itemTemplate.bind() : null);
1726
+ createPaddingItem(t) {
1727
+ return this._itemTemplate ? this.processSetValueItem(this._itemTemplate.bind()) : t instanceof Y || ne(t) ? this.processSetValueItem({}) : t instanceof e || Array.isArray(t) ? this.processSetValueItem([]) : this.processSetValueItem(void 0);
1596
1728
  }
1597
1729
  rowsChanged() {
1598
1730
  this.state.rowsVersion++;
@@ -1603,7 +1735,7 @@ var ht = class e extends Y {
1603
1735
  }
1604
1736
  setValueInternal(t) {
1605
1737
  if (t != null && !Array.isArray(t)) throw TypeError("Invalid value provided: a list takes an array of rows, or null to empty it");
1606
- D((n) => {
1738
+ A((n) => {
1607
1739
  n.touch(this);
1608
1740
  let r = this.raw.rows;
1609
1741
  if (t == null) this.releaseRows(), this.state.rows = null;
@@ -1611,7 +1743,7 @@ var ht = class e extends Y {
1611
1743
  let e = this.state.rows ?? [], n = Array(t.length);
1612
1744
  for (let r = 0; r < t.length; r++) {
1613
1745
  let i = t[r], a = e[r];
1614
- a && this._itemTemplate && !(i instanceof Q) ? (this.resetChild(a, this._itemTemplate, i), n[r] = a) : (a && this.releaseChild(a), n[r] = this.processSetValueItem(i));
1746
+ a && this._itemTemplate && !(i instanceof G) ? (this.resetChild(a, this._itemTemplate, i), n[r] = a) : (a && this.releaseChild(a), n[r] = this.processSetValueItem(i));
1615
1747
  }
1616
1748
  for (let n = t.length; n < e.length; n++) this.releaseChild(e[n]);
1617
1749
  this.state.rows = n;
@@ -1622,70 +1754,44 @@ var ht = class e extends Y {
1622
1754
  get value() {
1623
1755
  let e = this.valueVersion;
1624
1756
  if (this.raw.cachedValueVersion === e) return this.raw.cachedValue;
1625
- let t = this.state.rows?.map((e) => e.value), n = m(t) ? null : Object.freeze(t);
1757
+ let t = [];
1758
+ (this.state.rows ?? []).forEach((e) => {
1759
+ switch (this.childSerializesAs(e, "value")) {
1760
+ case "value":
1761
+ t.push(e.value);
1762
+ break;
1763
+ case "null": t.push(null);
1764
+ }
1765
+ });
1766
+ let n = t.length ? Object.freeze(t) : jt;
1626
1767
  return this.raw.cachedValue = n, this.raw.cachedValueVersion = e, n;
1627
1768
  }
1628
1769
  set value(e) {
1629
- D(() => {
1770
+ A(() => {
1630
1771
  this.setValueInternal(e), this.propagateValueChanged(!0);
1631
1772
  });
1632
1773
  }
1633
1774
  resetTo(t, n) {
1634
- D((r) => {
1635
- r.touch(this), this.errors.length && (this.errors = []), this.setValueInternal(n === void 0 ? t.value : n);
1636
- let i = this.value;
1637
- this.raw.announcedValue = i, this.originalValue = e.baseline(i), super.validate(!0);
1638
- });
1639
- }
1640
- get touched() {
1641
- return this.state.rows?.some((e) => e.touched) || !1;
1642
- }
1643
- set touched(e) {
1644
- D(() => {
1645
- this.state.rows?.forEach((t) => {
1646
- t.touched = e;
1647
- });
1775
+ A((r) => {
1776
+ r.touch(this), this.errors.length && (this.errors = []), this.setValueInternal(n === void 0 ? t.fullValue : n), this.recordAnnounced(), this.originalValue = e.baseline(this.value), super.validate(!0);
1648
1777
  });
1649
1778
  }
1650
1779
  bind(e, t) {
1651
1780
  let n = this._itemTemplate?.bind(), r = this.constructor, i = new r(n, {
1652
- value: [...(e === void 0 ? this.value : e) ?? []],
1781
+ value: [...(e === void 0 ? this.fullValue : e) ?? []],
1653
1782
  ...t && "originalValue" in t ? { originalValue: t.originalValue } : {},
1654
- enabled: t?.enabled ?? this.enabled,
1783
+ access: t?.access ?? this.access,
1655
1784
  visibility: t?.visibility ?? this.visibility
1656
1785
  });
1657
1786
  if (i._itemTemplate !== n) throw TypeError(`${this.constructor.name}.bind() built a list that did not take the item template it was given, so the binding would carry the declaration's rows. A subclass whose constructor does not take (itemTemplate, params) has to override bind() and construct itself.`);
1658
- return i.boundFrom(this, i.value, i.originalValue, t), i;
1659
- }
1660
- notifyValueChanged() {
1661
- this.propagateValueChanged();
1662
- }
1663
- get composesValue() {
1664
- return !0;
1665
- }
1666
- refreshPreviousValue() {
1667
- this.raw.announcedValue = this.value;
1668
- }
1669
- get valid() {
1670
- return this.validRead;
1671
- }
1672
- composeValid() {
1673
- return this.state.errors.length === 0 && (this.state.rows?.every((e) => e.valid) ?? !0);
1674
- }
1675
- get busy() {
1676
- return this.busyRead;
1677
- }
1678
- composeBusy() {
1679
- return this.state.rows?.some((e) => e.busy) ?? !1;
1680
- }
1681
- validate(e = !1) {
1682
- D(() => {
1683
- e && this.state.rows?.forEach((e) => e.validate(!0)), super.validate(e);
1684
- });
1787
+ return i.boundFrom(this, i.contribution, i.originalValue, t), i;
1685
1788
  }
1686
1789
  get members() {
1687
1790
  return this.raw.rows ?? [];
1688
1791
  }
1792
+ get children() {
1793
+ return this.state.rows ?? [];
1794
+ }
1689
1795
  get fullValue() {
1690
1796
  return (this.state.rows ?? []).map((e) => e.fullValue);
1691
1797
  }
@@ -1707,12 +1813,12 @@ var ht = class e extends Y {
1707
1813
  }
1708
1814
  remove(e) {
1709
1815
  let t;
1710
- return D((n) => {
1816
+ return A((n) => {
1711
1817
  if (this.state.rows == null || e < 0 || this.state.rows.length <= e) return;
1712
1818
  n.touch(this);
1713
1819
  let r = this.state.rows.splice(e, 1)?.[0];
1714
1820
  r && (this.releaseChild(r), this.rowsChanged(), this.bumpValueVersion(), t = r, n.recordStructural(this, {
1715
- actionClass: et,
1821
+ actionClass: ft,
1716
1822
  item: t,
1717
1823
  index: e
1718
1824
  }), this.propagateValueChanged(!0));
@@ -1720,18 +1826,18 @@ var ht = class e extends Y {
1720
1826
  }
1721
1827
  insert(e, t) {
1722
1828
  let n = 0;
1723
- return D((r) => {
1829
+ return A((r) => {
1724
1830
  for (r.touch(this), this.state.rows ?? (this.state.rows = []), n = t < 0 ? Math.max(this.state.rows.length + t, 0) : t; this.state.rows.length < n;) {
1725
- let e = this.createPaddingItem(), t = this.state.rows.push(e) - 1;
1831
+ let t = this.createPaddingItem(e), n = this.state.rows.push(t) - 1;
1726
1832
  this.bumpValueVersion(), r.recordStructural(this, {
1727
- actionClass: X,
1728
- item: e,
1729
- index: t
1833
+ actionClass: K,
1834
+ item: t,
1835
+ index: n
1730
1836
  });
1731
1837
  }
1732
1838
  let i = this.processSetValueItem(e);
1733
1839
  this.state.rows.splice(n, 0, i), r.recordStructural(this, {
1734
- actionClass: X,
1840
+ actionClass: K,
1735
1841
  item: i,
1736
1842
  index: n
1737
1843
  }), this.rowsChanged(), this.bumpValueVersion(), this.propagateValueChanged(!0);
@@ -1741,12 +1847,12 @@ var ht = class e extends Y {
1741
1847
  this.state.rows?.forEach((e) => this.releaseChild(e));
1742
1848
  }
1743
1849
  clear() {
1744
- D((e) => {
1850
+ A((e) => {
1745
1851
  let t = (this.state.rows?.length ?? 0) > 0;
1746
1852
  e.touch(this), this.releaseRows(), this.state.rows = null, t && this.rowsChanged(), this.bumpValueVersion(), this.propagateValueChanged(t);
1747
1853
  });
1748
1854
  }
1749
- }, gt = class extends I {
1855
+ }, Nt = class extends R {
1750
1856
  isValidComparison;
1751
1857
  otherField;
1752
1858
  registrations = /* @__PURE__ */ new WeakSet();
@@ -1756,7 +1862,7 @@ var ht = class e extends Y {
1756
1862
  super((e, t, r) => {
1757
1863
  this.comparisonState(r).oldValue = t;
1758
1864
  let i = this.resolve(r);
1759
- return i ? (this.listenOn(i), this.isValidComparison(u(e), u(i.value)) ? null : [new M(this.replacePlaceholders(n, {
1865
+ return i ? (this.listenOn(i), this.isValidComparison(f(e), f(i.value)) ? null : [new F(this.replacePlaceholders(n, {
1760
1866
  newValue: e,
1761
1867
  oldValue: t,
1762
1868
  field: r,
@@ -1766,14 +1872,14 @@ var ht = class e extends Y {
1766
1872
  }
1767
1873
  resolve(e) {
1768
1874
  let t = this.otherField;
1769
- return typeof t == "function" ? t(e) ?? void 0 : typeof t == "string" ? Pe(t, e) : z(t, R(e));
1875
+ return typeof t == "function" ? t(e) ?? void 0 : typeof t == "string" ? Fe(t, e) : Ne(t, z(e));
1770
1876
  }
1771
1877
  listenOn(e) {
1772
- this.listening.has(e) || this.listening.has(e.declaration) || (this.listening.add(e), e.registerAction(new S((e, t, n, r) => {
1878
+ this.listening.has(e) || this.listening.has(e.declaration) || (this.listening.add(e), e.registerAction(new T((e, t, n, r) => {
1773
1879
  t(e, n, r);
1774
- let i = R(e);
1775
- this.declarations.forEach((e) => Ne(e, i).forEach((e) => {
1776
- this.registrations.has(e) && this.execute(e, () => null, e.value, this.comparisonState(e).oldValue);
1880
+ let i = z(e);
1881
+ this.declarations.forEach((e) => Pe(e, i).forEach((e) => {
1882
+ this.registrations.has(e) && this.execute(e, () => null, e.contribution, this.comparisonState(e).oldValue);
1777
1883
  }));
1778
1884
  })));
1779
1885
  }
@@ -1792,14 +1898,14 @@ var ht = class e extends Y {
1792
1898
  unregisterFrom(e) {
1793
1899
  super.unregisterFrom(e), this.registrations.delete(e);
1794
1900
  }
1795
- }, _t = class extends I {
1901
+ }, Pt = class extends R {
1796
1902
  constructor(e, t) {
1797
- let n = t || F("InAllowedValues"), r = () => {
1798
- let t = u(e);
1903
+ let n = t || L("InAllowedValues"), r = () => {
1904
+ let t = f(e);
1799
1905
  return typeof t == "function" ? t() : t;
1800
1906
  }, i = (e) => {
1801
1907
  let t = e.join(", ");
1802
- return t.length <= 60 ? t : ie(t, {
1908
+ return t.length <= 60 ? t : re(t, {
1803
1909
  length: 40,
1804
1910
  separator: ", ",
1805
1911
  omission: `... (${e.length} items total)`
@@ -1807,7 +1913,7 @@ var ht = class e extends Y {
1807
1913
  };
1808
1914
  super((e, t, a) => {
1809
1915
  let o = r();
1810
- return o.includes(u(e)) ? null : [new M(this.replacePlaceholders(n, {
1916
+ return o.includes(f(e)) ? null : [new F(this.replacePlaceholders(n, {
1811
1917
  newValue: e,
1812
1918
  oldValue: t,
1813
1919
  field: a,
@@ -1819,48 +1925,48 @@ var ht = class e extends Y {
1819
1925
  };
1820
1926
  //#endregion
1821
1927
  //#region src/validators/validator-required.ts
1822
- function vt(e) {
1823
- return e == null ? 0 : f(e) || g(e) ? e.length : re(e) && Object.getPrototypeOf(e) === Object.prototype ? Object.keys(e).length : String(e).length;
1928
+ function Ft(e) {
1929
+ return e == null ? 0 : m(e) || _(e) ? e.length : te(e) && Object.getPrototypeOf(e) === Object.prototype ? Object.keys(e).length : String(e).length;
1824
1930
  }
1825
- function yt(e) {
1931
+ function It(e) {
1826
1932
  return typeof e == "object" && !!e && !o(e) && !(e instanceof String) && !("componentName" in e);
1827
1933
  }
1828
- var bt = class extends I {
1934
+ var Lt = class extends R {
1829
1935
  constructor(e, t) {
1830
- let n = yt(e) ? void 0 : e, r = (yt(e) ? e : t)?.trim ?? !0, i = n || F("Required");
1936
+ let n = It(e) ? void 0 : e, r = (It(e) ? e : t)?.trim ?? !0, i = n || L("Required");
1831
1937
  super((e, t, n) => {
1832
- let a = u(e);
1833
- return vt(r && g(a) ? a.trim() : a) === 0 ? [new M(this.replacePlaceholders(i, {
1938
+ let a = f(e);
1939
+ return Ft(r && _(a) ? a.trim() : a) === 0 ? [new F(this.replacePlaceholders(i, {
1834
1940
  newValue: e,
1835
1941
  oldValue: t,
1836
1942
  field: n
1837
1943
  }), "", "required")] : null;
1838
1944
  });
1839
1945
  }
1840
- }, xt = class extends I {
1946
+ }, Rt = class extends R {
1841
1947
  constructor(e, t) {
1842
- let n = t || F("MinValue");
1843
- super((t, r, i) => t < e || t === void 0 ? [new M(this.replacePlaceholders(n, {
1948
+ let n = t || L("MinValue");
1949
+ super((t, r, i) => t < e || t === void 0 ? [new F(this.replacePlaceholders(n, {
1844
1950
  newValue: t,
1845
1951
  oldValue: r,
1846
1952
  field: i,
1847
1953
  minValue: e
1848
1954
  }), "", "min")] : null);
1849
1955
  }
1850
- }, St = class extends I {
1956
+ }, zt = class extends R {
1851
1957
  constructor(e, t) {
1852
- let n = t || F("MaxValue");
1853
- super((t, r, i) => t > e || t === void 0 ? [new M(this.replacePlaceholders(n, {
1958
+ let n = t || L("MaxValue");
1959
+ super((t, r, i) => t > e || t === void 0 ? [new F(this.replacePlaceholders(n, {
1854
1960
  newValue: t,
1855
1961
  oldValue: r,
1856
1962
  field: i,
1857
1963
  maxValue: e
1858
1964
  }), "", "max")] : null);
1859
1965
  }
1860
- }, Ct = class extends I {
1966
+ }, Bt = class extends R {
1861
1967
  constructor(e, t, n) {
1862
- let r = n || F("ValueInRange");
1863
- super((n, i, a) => n < e || n > t || n === void 0 ? [new M(this.replacePlaceholders(r, {
1968
+ let r = n || L("ValueInRange");
1969
+ super((n, i, a) => n < e || n > t || n === void 0 ? [new F(this.replacePlaceholders(r, {
1864
1970
  newValue: n,
1865
1971
  oldValue: i,
1866
1972
  field: a,
@@ -1871,35 +1977,35 @@ var bt = class extends I {
1871
1977
  };
1872
1978
  //#endregion
1873
1979
  //#region src/validators/validator-min-max-range-length.ts
1874
- function $(e) {
1875
- return e == null ? 0 : f(e) || g(e) ? e.length : re(e) && Object.getPrototypeOf(e) === Object.prototype ? Object.keys(e).length : String(e).length;
1980
+ function Vt(e) {
1981
+ return e == null ? 0 : m(e) || _(e) ? e.length : te(e) && Object.getPrototypeOf(e) === Object.prototype ? Object.keys(e).length : String(e).length;
1876
1982
  }
1877
- var wt = class extends I {
1983
+ var Ht = class extends R {
1878
1984
  constructor(e, t) {
1879
- let n = t || F("MinLength");
1880
- super((t, r, i) => $(t) < e ? [new M(this.replacePlaceholders(n, {
1985
+ let n = t || L("MinLength");
1986
+ super((t, r, i) => Vt(t) < e ? [new F(this.replacePlaceholders(n, {
1881
1987
  newValue: t,
1882
1988
  oldValue: r,
1883
1989
  field: i,
1884
1990
  minLength: e
1885
1991
  }), "", "min-length")] : null);
1886
1992
  }
1887
- }, Tt = class extends I {
1993
+ }, Ut = class extends R {
1888
1994
  constructor(e, t) {
1889
- let n = t || F("MaxLength");
1890
- super((t, r, i) => $(t) > e ? [new M(this.replacePlaceholders(n, {
1995
+ let n = t || L("MaxLength");
1996
+ super((t, r, i) => Vt(t) > e ? [new F(this.replacePlaceholders(n, {
1891
1997
  newValue: t,
1892
1998
  oldValue: r,
1893
1999
  field: i,
1894
2000
  maxLength: e
1895
2001
  }), "", "max-length")] : null);
1896
2002
  }
1897
- }, Et = class extends I {
2003
+ }, Wt = class extends R {
1898
2004
  constructor(e, t, n) {
1899
- let r = n || F("LengthInRange");
2005
+ let r = n || L("LengthInRange");
1900
2006
  super((n, i, a) => {
1901
- let o = $(n);
1902
- return o < e || o > t ? [new M(this.replacePlaceholders(r, {
2007
+ let o = Vt(n);
2008
+ return o < e || o > t ? [new F(this.replacePlaceholders(r, {
1903
2009
  newValue: n,
1904
2010
  oldValue: i,
1905
2011
  field: a,
@@ -1908,71 +2014,295 @@ var wt = class extends I {
1908
2014
  }), "", "range-length")] : null;
1909
2015
  });
1910
2016
  }
1911
- }, Dt = class extends I {
2017
+ }, Gt = class extends R {
1912
2018
  constructor(e, t) {
1913
- let n = t || F("Pattern");
1914
- super((t, r, i) => e.test(String(u(t))) ? null : [new M(this.replacePlaceholders(n, {
2019
+ let n = t || L("Pattern");
2020
+ super((t, r, i) => e.test(String(f(t))) ? null : [new F(this.replacePlaceholders(n, {
1915
2021
  newValue: t,
1916
2022
  oldValue: r,
1917
2023
  field: i,
1918
2024
  pattern: e
1919
2025
  }), "", "pattern")]);
1920
2026
  }
1921
- }, Ot = /* @__PURE__ */ oe({
1922
- CompareTo: () => gt,
1923
- InAllowedValues: () => _t,
1924
- LengthInRange: () => Et,
1925
- MaxLength: () => Tt,
1926
- MaxValue: () => St,
1927
- MinLength: () => wt,
1928
- MinValue: () => xt,
1929
- Pattern: () => Dt,
1930
- Required: () => bt,
1931
- Validator: () => I,
1932
- ValueInRange: () => Ct
1933
- }), kt = /* @__PURE__ */ oe({
1934
- AbortEventHandlingException: () => x,
1935
- Action: () => lt,
1936
- ActionsMap: () => L,
1937
- ConditionalEnabledAction: () => Le,
2027
+ }, Kt = /* @__PURE__ */ ae({
2028
+ CompareTo: () => Nt,
2029
+ InAllowedValues: () => Pt,
2030
+ LengthInRange: () => Wt,
2031
+ MaxLength: () => Ut,
2032
+ MaxValue: () => zt,
2033
+ MinLength: () => Ht,
2034
+ MinValue: () => Rt,
2035
+ Pattern: () => Gt,
2036
+ Required: () => Lt,
2037
+ Validator: () => R,
2038
+ ValueInRange: () => Bt
2039
+ }), qt = /* @__PURE__ */ new WeakMap(), Jt = /* @__PURE__ */ new WeakMap(), Yt = /* @__PURE__ */ new Set([
2040
+ "push",
2041
+ "pop",
2042
+ "shift",
2043
+ "unshift",
2044
+ "splice",
2045
+ "sort",
2046
+ "reverse",
2047
+ "fill",
2048
+ "copyWithin"
2049
+ ]);
2050
+ function X(e) {
2051
+ return typeof e == "string" && /^(0|[1-9]\d*)$/.test(e);
2052
+ }
2053
+ function Z(e) {
2054
+ return typeof e == "object" && !!e && Jt.get(e) || e;
2055
+ }
2056
+ function Q(e) {
2057
+ return e instanceof J ? $(e) : e.value;
2058
+ }
2059
+ function Xt(e, t) {
2060
+ e.value = Z(t) instanceof G ? Z(t).value : t;
2061
+ }
2062
+ function Zt(e) {
2063
+ return e === "__v_skip" ? {
2064
+ answered: !0,
2065
+ value: !0
2066
+ } : typeof e == "string" && e.startsWith("__v_") || e === "then" ? {
2067
+ answered: !0,
2068
+ value: void 0
2069
+ } : { answered: !1 };
2070
+ }
2071
+ function Qt(e) {
2072
+ let t = (t) => typeof t == "string" && t !== "$" ? e.field(t) ?? void 0 : void 0, n = () => Object.keys(e.fields);
2073
+ return {
2074
+ get(n, r) {
2075
+ let i = Zt(r);
2076
+ if (i.answered) return i.value;
2077
+ if (r === "$") return e;
2078
+ if (r === Symbol.toStringTag) return "View";
2079
+ let a = t(r);
2080
+ return a ? Q(a) : void 0;
2081
+ },
2082
+ set(e, n, r) {
2083
+ if (n === "$") throw TypeError("$ is the element a view stands for, and cannot be replaced");
2084
+ let i = t(n);
2085
+ if (!i) throw TypeError(`${String(n)} is not a member of this group - use $addField() to add one`);
2086
+ return Xt(i, r), !0;
2087
+ },
2088
+ has(e, t) {
2089
+ return t === "$" || typeof t == "string" && n().includes(t);
2090
+ },
2091
+ ownKeys() {
2092
+ return n();
2093
+ },
2094
+ getOwnPropertyDescriptor(t, r) {
2095
+ if (!(typeof r != "string" || !n().includes(r))) return {
2096
+ value: Q(e.fields[r]),
2097
+ writable: !0,
2098
+ enumerable: !0,
2099
+ configurable: !0
2100
+ };
2101
+ },
2102
+ deleteProperty(e, t) {
2103
+ throw TypeError(`${String(t)} cannot be deleted from a view - use $removeField() to take a member out`);
2104
+ },
2105
+ defineProperty(e, t) {
2106
+ throw TypeError(`${String(t)} cannot be defined on a view`);
2107
+ }
2108
+ };
2109
+ }
2110
+ function $t(e) {
2111
+ let t = () => [...e.items], n = (n) => {
2112
+ let r = t();
2113
+ return n < r.length ? e.items.indexOf(r[n]) : e.length;
2114
+ }, r = (e, t) => e < 0 ? Math.max(t + e, 0) : Math.min(e, t), i = (n) => k(() => {
2115
+ let r = t(), i = e.items.map((e) => {
2116
+ let t = r.indexOf(e);
2117
+ return t === -1 ? e : n[t];
2118
+ });
2119
+ for (; e.length;) e.pop();
2120
+ i.forEach((t) => e.push(t));
2121
+ }), a = {
2122
+ push: (...n) => (k(() => n.forEach((t) => e.push(Z(t)))), t().length),
2123
+ pop: () => {
2124
+ let n = t();
2125
+ if (!n.length) return;
2126
+ let r = Q(n[n.length - 1]);
2127
+ return e.remove(e.items.indexOf(n[n.length - 1])), r;
2128
+ },
2129
+ shift: () => {
2130
+ let n = t();
2131
+ if (!n.length) return;
2132
+ let r = Q(n[0]);
2133
+ return e.remove(e.items.indexOf(n[0])), r;
2134
+ },
2135
+ unshift: (...r) => (k(() => {
2136
+ let t = n(0);
2137
+ r.forEach((n, r) => e.insert(Z(n), t + r));
2138
+ }), t().length),
2139
+ splice: (i, a, ...o) => {
2140
+ let s = [];
2141
+ return k(() => {
2142
+ let c = t(), l = r(Math.trunc(i) || 0, c.length), u = a === void 0 ? c.length - l : Math.max(0, Math.min(a, c.length - l));
2143
+ c.slice(l, l + u).forEach((t) => {
2144
+ s.push(Q(t)), e.remove(e.items.indexOf(t));
2145
+ });
2146
+ let d = n(l);
2147
+ o.forEach((t, n) => e.insert(Z(t), d + n));
2148
+ }), s;
2149
+ },
2150
+ sort: (e) => {
2151
+ let n = t().map((e) => ({
2152
+ row: e,
2153
+ slot: Q(e)
2154
+ })).sort((t, n) => {
2155
+ if (e) return e(t.slot, n.slot);
2156
+ let r = String(t.slot), i = String(n.slot);
2157
+ return r < i ? -1 : +(r > i);
2158
+ }).map(({ row: e }) => e);
2159
+ return i(n), o;
2160
+ },
2161
+ reverse: () => (i([...t()].reverse()), o),
2162
+ fill: () => {
2163
+ throw TypeError("fill() is not available on a list view - assign $value instead");
2164
+ },
2165
+ copyWithin: () => {
2166
+ throw TypeError("copyWithin() is not available on a list view - assign $value instead");
2167
+ }
2168
+ }, o;
2169
+ return o = new Proxy([], {
2170
+ get(n, r, i) {
2171
+ let o = Zt(r);
2172
+ if (o.answered) return o.value;
2173
+ if (r === "$") return e;
2174
+ if (r === "length") return t().length;
2175
+ if (X(r)) {
2176
+ let e = t()[Number(r)];
2177
+ return e ? Q(e) : void 0;
2178
+ }
2179
+ return typeof r == "string" && Yt.has(r) ? a[r] : Reflect.get(n, r, i);
2180
+ },
2181
+ set(r, i, a) {
2182
+ if (i === "$") throw TypeError("$ is the element a view stands for, and cannot be replaced");
2183
+ if (i === "length") {
2184
+ let n = Number(a), r = t();
2185
+ if (n > r.length) throw TypeError("a list view grows by push(), not by its length");
2186
+ return k(() => r.slice(n).forEach((t) => e.remove(e.items.indexOf(t)))), !0;
2187
+ }
2188
+ if (X(i)) {
2189
+ let r = Number(i), o = t();
2190
+ return r < o.length ? Xt(o[r], a) : e.insert(Z(a), n(o.length) + (r - o.length)), !0;
2191
+ }
2192
+ throw TypeError(`${String(i)} cannot be set on a list view`);
2193
+ },
2194
+ has(e, n) {
2195
+ return n === "$" || n === "length" ? !0 : X(n) ? Number(n) < t().length : Reflect.has(e, n);
2196
+ },
2197
+ ownKeys() {
2198
+ return [...t().map((e, t) => String(t)), "length"];
2199
+ },
2200
+ getOwnPropertyDescriptor(e, n) {
2201
+ if (n === "length") return {
2202
+ value: t().length,
2203
+ writable: !0,
2204
+ enumerable: !1,
2205
+ configurable: !1
2206
+ };
2207
+ if (!(!X(n) || Number(n) >= t().length)) return {
2208
+ value: Q(t()[Number(n)]),
2209
+ writable: !0,
2210
+ enumerable: !0,
2211
+ configurable: !0
2212
+ };
2213
+ },
2214
+ deleteProperty() {
2215
+ throw TypeError("rows cannot be deleted from a list view - use splice() or pop()");
2216
+ },
2217
+ defineProperty(e, t) {
2218
+ throw TypeError(`${String(t)} cannot be defined on a list view`);
2219
+ }
2220
+ }), o;
2221
+ }
2222
+ function en(e) {
2223
+ return {
2224
+ get(t, n) {
2225
+ let r = Zt(n);
2226
+ if (r.answered) return r.value;
2227
+ if (n === "$") return e;
2228
+ },
2229
+ set(e, t) {
2230
+ throw TypeError(`${String(t)} cannot be set on the view of a field - its value is $.value`);
2231
+ },
2232
+ has(e, t) {
2233
+ return t === "$";
2234
+ },
2235
+ ownKeys() {
2236
+ return [];
2237
+ }
2238
+ };
2239
+ }
2240
+ function tn(e) {
2241
+ Object.keys(e.fields).forEach((e) => {
2242
+ if (e === "$" || e === "then" || e.startsWith("__v_")) throw TypeError(`A view cannot hold a member named ${e}: $ is the element the view stands for, and then and __v_* are read by the language and by Vue`);
2243
+ });
2244
+ }
2245
+ function $(e) {
2246
+ if (Jt.has(e)) return e;
2247
+ let t = qt.get(e);
2248
+ if (t) return t;
2249
+ let n;
2250
+ return e instanceof Y ? (tn(e), n = new Proxy({}, Qt(e))) : n = e instanceof Mt ? $t(e) : new Proxy({}, en(e)), qt.set(e, n), Jt.set(n, e), n;
2251
+ }
2252
+ //#endregion
2253
+ //#region src/index.ts
2254
+ var nn = /* @__PURE__ */ ae({
2255
+ AbortEventHandlingException: () => C,
2256
+ AccessChangedAction: () => Ue,
2257
+ AccessChangingAction: () => Ve,
2258
+ Action: () => xt,
2259
+ ActionsMap: () => Ae,
2260
+ ConditionalAccessAction: () => Re,
1938
2261
  ConditionalStatementAction: () => B,
1939
- ConditionalValueAction: () => Re,
1940
- ConditionalVisibilityAction: () => Ie,
1941
- DisplayMode: () => y,
1942
- EnabledChangedAction: () => W,
1943
- EnabledChangingAction: () => U,
1944
- ExecuteAction: () => Ze,
1945
- Field: () => Z,
1946
- FieldActionBase: () => b,
1947
- FieldBase: () => Y,
1948
- Group: () => Q,
1949
- List: () => ht,
1950
- ListItemAddedAction: () => X,
1951
- ListItemRemovedAction: () => et,
1952
- MdString: () => O,
1953
- MessagesWidget: () => ut,
2262
+ ConditionalValueAction: () => ze,
2263
+ ConditionalVisibilityAction: () => Le,
2264
+ Container: () => J,
2265
+ ContributionChangedAction: () => U,
2266
+ EnabledChangedAction: () => Je,
2267
+ EnabledChangingAction: () => Ke,
2268
+ ExecuteAction: () => lt,
2269
+ Field: () => q,
2270
+ FieldActionBase: () => S,
2271
+ FieldBase: () => G,
2272
+ Group: () => Y,
2273
+ List: () => Mt,
2274
+ ListItemAddedAction: () => K,
2275
+ ListItemRemovedAction: () => ft,
2276
+ MdString: () => j,
2277
+ MessagesWidget: () => St,
1954
2278
  Operator: () => H,
1955
- RenderableValue: () => Ee,
1956
- Statement: () => Ye,
1957
- ValidChangedAction: () => G,
1958
- ValidationError: () => j,
1959
- ValidationErrorRenderContent: () => M,
1960
- ValidationErrorText: () => Te,
1961
- Validators: () => Ot,
1962
- ValueChangedAction: () => S,
1963
- VisibilityChangedAction: () => q,
1964
- VisibilityChangingAction: () => K,
1965
- buildErrorMessage: () => N,
1966
- defaultDisplayMode: () => 10,
1967
- isCallableFunction: () => A,
1968
- isEqual: () => mt,
1969
- isSimpleComponentDef: () => k,
1970
- strings: () => P,
1971
- transaction: () => E,
1972
- translateStrings: () => Oe,
1973
- translatedMessage: () => F
2279
+ RenderableValue: () => we,
2280
+ Statement: () => st,
2281
+ ValidChangedAction: () => Xe,
2282
+ ValidationError: () => P,
2283
+ ValidationErrorRenderContent: () => F,
2284
+ ValidationErrorText: () => Ce,
2285
+ Validators: () => Kt,
2286
+ ValueChangedAction: () => T,
2287
+ VisibilityChangedAction: () => et,
2288
+ VisibilityChangingAction: () => Qe,
2289
+ accessValues: () => v,
2290
+ buildErrorMessage: () => I,
2291
+ defaultAccess: () => oe,
2292
+ defaultVisibility: () => b,
2293
+ isAccess: () => se,
2294
+ isCallableFunction: () => N,
2295
+ isEqual: () => At,
2296
+ isSimpleComponentDef: () => M,
2297
+ isVisibility: () => x,
2298
+ strings: () => Ee,
2299
+ transaction: () => k,
2300
+ translateStrings: () => De,
2301
+ translatedMessage: () => L,
2302
+ view: () => $,
2303
+ visibilityValues: () => y
1974
2304
  });
1975
2305
  //#endregion
1976
- export { x as AbortEventHandlingException, lt as Action, L as ActionsMap, Le as ConditionalEnabledAction, B as ConditionalStatementAction, Re as ConditionalValueAction, Ie as ConditionalVisibilityAction, y as DisplayMode, W as EnabledChangedAction, U as EnabledChangingAction, Ze as ExecuteAction, Z as Field, b as FieldActionBase, Y as FieldBase, Q as Group, ht as List, X as ListItemAddedAction, et as ListItemRemovedAction, O as MdString, ut as MessagesWidget, H as Operator, Ee as RenderableValue, Ye as Statement, G as ValidChangedAction, j as ValidationError, M as ValidationErrorRenderContent, Te as ValidationErrorText, Ot as Validators, S as ValueChangedAction, q as VisibilityChangedAction, K as VisibilityChangingAction, N as buildErrorMessage, kt as default, se as defaultDisplayMode, we as forms, Se as getConfig, A as isCallableFunction, mt as isEqual, k as isSimpleComponentDef, Ce as setConfig, P as strings, E as transaction, Oe as translateStrings, F as translatedMessage };
2306
+ export { C as AbortEventHandlingException, Ue as AccessChangedAction, Ve as AccessChangingAction, xt as Action, Ae as ActionsMap, Re as ConditionalAccessAction, B as ConditionalStatementAction, ze as ConditionalValueAction, Le as ConditionalVisibilityAction, J as Container, U as ContributionChangedAction, Je as EnabledChangedAction, Ke as EnabledChangingAction, lt as ExecuteAction, q as Field, S as FieldActionBase, G as FieldBase, Y as Group, Mt as List, K as ListItemAddedAction, ft as ListItemRemovedAction, j as MdString, St as MessagesWidget, H as Operator, we as RenderableValue, st as Statement, Xe as ValidChangedAction, P as ValidationError, F as ValidationErrorRenderContent, Ce as ValidationErrorText, Kt as Validators, T as ValueChangedAction, et as VisibilityChangedAction, Qe as VisibilityChangingAction, v as accessValues, I as buildErrorMessage, nn as default, oe as defaultAccess, b as defaultVisibility, Se as forms, be as getConfig, se as isAccess, N as isCallableFunction, At as isEqual, M as isSimpleComponentDef, x as isVisibility, xe as setConfig, Ee as strings, k as transaction, De as translateStrings, L as translatedMessage, $ as view, y as visibilityValues };
1977
2307
 
1978
2308
  //# sourceMappingURL=dynamicforms-vue-forms.js.map