@tempots/beatui 0.75.0 → 0.76.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/json-schema/index.cjs.js +6 -6
- package/dist/json-schema/index.es.js +978 -945
- package/dist/types/components/json-schema/controls/generic-control.d.ts +9 -1
- package/dist/types/components/json-schema/json-schema-form.d.ts +8 -2
- package/dist/types/components/json-schema/schema-context.d.ts +43 -0
- package/dist/types/components/json-schema/widgets/widget-customization.d.ts +25 -2
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { U as sn, V as ye, B as Gs, o as ze, m as br, p as Xs, C as Zs, t as
|
|
1
|
+
import { U as sn, V as ye, B as Gs, o as ze, m as br, p as Xs, C as Zs, t as Ys, l as xs, j as Qs, N as ei, k as ti, s as ri, r as ni, q as ai, R as si, S as ii, E as rs, W as oi, u as ci, X as ui } from "../widget-customization-CobH7Rj_.js";
|
|
2
2
|
import { Y as gf, c as vf, d as $f, f as bf } from "../widget-customization-CobH7Rj_.js";
|
|
3
3
|
import { g as dr } from "../_commonjsHelpers-C6fGbg64.js";
|
|
4
4
|
import { a as Ee, S as me, I as nt, c as te, j as _r, b as on, L as We, M as li, C as ns, g as di, A as fi, h as mi } from "../use-form-B7A865EM.js";
|
|
5
5
|
import { _ as Kr, g as pi, S as hi, f as yi, N as as, l as de, W as gi, e as vi, t as Xe, T as $i, U as bi, b as Mr, c as _i, M as st, h as wi, G as Si, L as Pi, i as ji, j as Ei } from "../deep-merge-CQQCMLwG.js";
|
|
6
|
-
import { attr as K, Value as
|
|
6
|
+
import { attr as K, Value as ae, Fragment as ke, WithElement as ss, Empty as is, html as J, When as et, computedOf as ce, prop as Ne, Use as Wr, style as os, Ensure as cs, aria as Oi, on as tt, MapSignal as fr, Async as Ri, OnDispose as Ai } from "@tempots/dom";
|
|
7
7
|
import { T as ki, a as Br, c as us, B as Ni } from "../translations-DQxouiBG.js";
|
|
8
8
|
import { P as Ii, E as Ci, N as ls } from "../notice-Cqq8g17n.js";
|
|
9
9
|
import { f as Ti } from "../colors-pQZlNrwM.js";
|
|
@@ -301,126 +301,126 @@ function H() {
|
|
|
301
301
|
optimizeNodes() {
|
|
302
302
|
return this;
|
|
303
303
|
}
|
|
304
|
-
optimizeNames(
|
|
304
|
+
optimizeNames(v, j) {
|
|
305
305
|
return this;
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
308
|
class i extends a {
|
|
309
|
-
constructor(
|
|
310
|
-
super(), this.varKind =
|
|
309
|
+
constructor(v, j, R) {
|
|
310
|
+
super(), this.varKind = v, this.name = j, this.rhs = R;
|
|
311
311
|
}
|
|
312
|
-
render({ es5:
|
|
313
|
-
const R =
|
|
312
|
+
render({ es5: v, _n: j }) {
|
|
313
|
+
const R = v ? r.varKinds.var : this.varKind, F = this.rhs === void 0 ? "" : ` = ${this.rhs}`;
|
|
314
314
|
return `${R} ${this.name}${F};` + j;
|
|
315
315
|
}
|
|
316
|
-
optimizeNames(
|
|
317
|
-
if (
|
|
318
|
-
return this.rhs && (this.rhs = W(this.rhs,
|
|
316
|
+
optimizeNames(v, j) {
|
|
317
|
+
if (v[this.name.str])
|
|
318
|
+
return this.rhs && (this.rhs = W(this.rhs, v, j)), this;
|
|
319
319
|
}
|
|
320
320
|
get names() {
|
|
321
321
|
return this.rhs instanceof t._CodeOrName ? this.rhs.names : {};
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
324
|
class c extends a {
|
|
325
|
-
constructor(
|
|
326
|
-
super(), this.lhs =
|
|
325
|
+
constructor(v, j, R) {
|
|
326
|
+
super(), this.lhs = v, this.rhs = j, this.sideEffects = R;
|
|
327
327
|
}
|
|
328
|
-
render({ _n:
|
|
329
|
-
return `${this.lhs} = ${this.rhs};` +
|
|
328
|
+
render({ _n: v }) {
|
|
329
|
+
return `${this.lhs} = ${this.rhs};` + v;
|
|
330
330
|
}
|
|
331
|
-
optimizeNames(
|
|
332
|
-
if (!(this.lhs instanceof t.Name &&
|
|
333
|
-
return this.rhs = W(this.rhs,
|
|
331
|
+
optimizeNames(v, j) {
|
|
332
|
+
if (!(this.lhs instanceof t.Name && !v[this.lhs.str] && !this.sideEffects))
|
|
333
|
+
return this.rhs = W(this.rhs, v, j), this;
|
|
334
334
|
}
|
|
335
335
|
get names() {
|
|
336
|
-
const
|
|
337
|
-
return
|
|
336
|
+
const v = this.lhs instanceof t.Name ? {} : { ...this.lhs.names };
|
|
337
|
+
return U(v, this.rhs);
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
340
|
class l extends c {
|
|
341
|
-
constructor(
|
|
342
|
-
super(
|
|
341
|
+
constructor(v, j, R, F) {
|
|
342
|
+
super(v, R, F), this.op = j;
|
|
343
343
|
}
|
|
344
|
-
render({ _n:
|
|
345
|
-
return `${this.lhs} ${this.op}= ${this.rhs};` +
|
|
344
|
+
render({ _n: v }) {
|
|
345
|
+
return `${this.lhs} ${this.op}= ${this.rhs};` + v;
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
348
|
class p extends a {
|
|
349
|
-
constructor(
|
|
350
|
-
super(), this.label =
|
|
349
|
+
constructor(v) {
|
|
350
|
+
super(), this.label = v, this.names = {};
|
|
351
351
|
}
|
|
352
|
-
render({ _n:
|
|
353
|
-
return `${this.label}:` +
|
|
352
|
+
render({ _n: v }) {
|
|
353
|
+
return `${this.label}:` + v;
|
|
354
354
|
}
|
|
355
355
|
}
|
|
356
356
|
class m extends a {
|
|
357
|
-
constructor(
|
|
358
|
-
super(), this.label =
|
|
357
|
+
constructor(v) {
|
|
358
|
+
super(), this.label = v, this.names = {};
|
|
359
359
|
}
|
|
360
|
-
render({ _n:
|
|
361
|
-
return `break${this.label ? ` ${this.label}` : ""};` +
|
|
360
|
+
render({ _n: v }) {
|
|
361
|
+
return `break${this.label ? ` ${this.label}` : ""};` + v;
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
364
|
class b extends a {
|
|
365
|
-
constructor(
|
|
366
|
-
super(), this.error =
|
|
365
|
+
constructor(v) {
|
|
366
|
+
super(), this.error = v;
|
|
367
367
|
}
|
|
368
|
-
render({ _n:
|
|
369
|
-
return `throw ${this.error};` +
|
|
368
|
+
render({ _n: v }) {
|
|
369
|
+
return `throw ${this.error};` + v;
|
|
370
370
|
}
|
|
371
371
|
get names() {
|
|
372
372
|
return this.error.names;
|
|
373
373
|
}
|
|
374
374
|
}
|
|
375
375
|
class g extends a {
|
|
376
|
-
constructor(
|
|
377
|
-
super(), this.code =
|
|
376
|
+
constructor(v) {
|
|
377
|
+
super(), this.code = v;
|
|
378
378
|
}
|
|
379
|
-
render({ _n:
|
|
380
|
-
return `${this.code};` +
|
|
379
|
+
render({ _n: v }) {
|
|
380
|
+
return `${this.code};` + v;
|
|
381
381
|
}
|
|
382
382
|
optimizeNodes() {
|
|
383
383
|
return `${this.code}` ? this : void 0;
|
|
384
384
|
}
|
|
385
|
-
optimizeNames(
|
|
386
|
-
return this.code = W(this.code,
|
|
385
|
+
optimizeNames(v, j) {
|
|
386
|
+
return this.code = W(this.code, v, j), this;
|
|
387
387
|
}
|
|
388
388
|
get names() {
|
|
389
389
|
return this.code instanceof t._CodeOrName ? this.code.names : {};
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
392
|
class w extends a {
|
|
393
|
-
constructor(
|
|
394
|
-
super(), this.nodes =
|
|
393
|
+
constructor(v = []) {
|
|
394
|
+
super(), this.nodes = v;
|
|
395
395
|
}
|
|
396
|
-
render(
|
|
397
|
-
return this.nodes.reduce((j, R) => j + R.render(
|
|
396
|
+
render(v) {
|
|
397
|
+
return this.nodes.reduce((j, R) => j + R.render(v), "");
|
|
398
398
|
}
|
|
399
399
|
optimizeNodes() {
|
|
400
|
-
const { nodes:
|
|
401
|
-
let j =
|
|
400
|
+
const { nodes: v } = this;
|
|
401
|
+
let j = v.length;
|
|
402
402
|
for (; j--; ) {
|
|
403
|
-
const R =
|
|
404
|
-
Array.isArray(R) ?
|
|
403
|
+
const R = v[j].optimizeNodes();
|
|
404
|
+
Array.isArray(R) ? v.splice(j, 1, ...R) : R ? v[j] = R : v.splice(j, 1);
|
|
405
405
|
}
|
|
406
|
-
return
|
|
406
|
+
return v.length > 0 ? this : void 0;
|
|
407
407
|
}
|
|
408
|
-
optimizeNames(
|
|
408
|
+
optimizeNames(v, j) {
|
|
409
409
|
const { nodes: R } = this;
|
|
410
410
|
let F = R.length;
|
|
411
411
|
for (; F--; ) {
|
|
412
|
-
const
|
|
413
|
-
|
|
412
|
+
const V = R[F];
|
|
413
|
+
V.optimizeNames(v, j) || (ee(v, V.names), R.splice(F, 1));
|
|
414
414
|
}
|
|
415
415
|
return R.length > 0 ? this : void 0;
|
|
416
416
|
}
|
|
417
417
|
get names() {
|
|
418
|
-
return this.nodes.reduce((
|
|
418
|
+
return this.nodes.reduce((v, j) => D(v, j.names), {});
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
421
|
class S extends w {
|
|
422
|
-
render(
|
|
423
|
-
return "{" +
|
|
422
|
+
render(v) {
|
|
423
|
+
return "{" + v._n + super.render(v) + "}" + v._n;
|
|
424
424
|
}
|
|
425
425
|
}
|
|
426
426
|
class h extends w {
|
|
@@ -429,17 +429,17 @@ function H() {
|
|
|
429
429
|
}
|
|
430
430
|
u.kind = "else";
|
|
431
431
|
class f extends S {
|
|
432
|
-
constructor(
|
|
433
|
-
super(j), this.condition =
|
|
432
|
+
constructor(v, j) {
|
|
433
|
+
super(j), this.condition = v;
|
|
434
434
|
}
|
|
435
|
-
render(
|
|
436
|
-
let j = `if(${this.condition})` + super.render(
|
|
437
|
-
return this.else && (j += "else " + this.else.render(
|
|
435
|
+
render(v) {
|
|
436
|
+
let j = `if(${this.condition})` + super.render(v);
|
|
437
|
+
return this.else && (j += "else " + this.else.render(v)), j;
|
|
438
438
|
}
|
|
439
439
|
optimizeNodes() {
|
|
440
440
|
super.optimizeNodes();
|
|
441
|
-
const
|
|
442
|
-
if (
|
|
441
|
+
const v = this.condition;
|
|
442
|
+
if (v === !0)
|
|
443
443
|
return this.nodes;
|
|
444
444
|
let j = this.else;
|
|
445
445
|
if (j) {
|
|
@@ -447,18 +447,18 @@ function H() {
|
|
|
447
447
|
j = this.else = Array.isArray(R) ? new u(R) : R;
|
|
448
448
|
}
|
|
449
449
|
if (j)
|
|
450
|
-
return
|
|
451
|
-
if (!(
|
|
450
|
+
return v === !1 ? j instanceof f ? j : j.nodes : this.nodes.length ? this : new f(oe(v), j instanceof f ? [j] : j.nodes);
|
|
451
|
+
if (!(v === !1 || !this.nodes.length))
|
|
452
452
|
return this;
|
|
453
453
|
}
|
|
454
|
-
optimizeNames(
|
|
454
|
+
optimizeNames(v, j) {
|
|
455
455
|
var R;
|
|
456
|
-
if (this.else = (R = this.else) === null || R === void 0 ? void 0 : R.optimizeNames(
|
|
457
|
-
return this.condition = W(this.condition,
|
|
456
|
+
if (this.else = (R = this.else) === null || R === void 0 ? void 0 : R.optimizeNames(v, j), !!(super.optimizeNames(v, j) || this.else))
|
|
457
|
+
return this.condition = W(this.condition, v, j), this;
|
|
458
458
|
}
|
|
459
459
|
get names() {
|
|
460
|
-
const
|
|
461
|
-
return
|
|
460
|
+
const v = super.names;
|
|
461
|
+
return U(v, this.condition), this.else && D(v, this.else.names), v;
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
464
|
f.kind = "if";
|
|
@@ -466,166 +466,166 @@ function H() {
|
|
|
466
466
|
}
|
|
467
467
|
o.kind = "for";
|
|
468
468
|
class d extends o {
|
|
469
|
-
constructor(
|
|
470
|
-
super(), this.iteration =
|
|
469
|
+
constructor(v) {
|
|
470
|
+
super(), this.iteration = v;
|
|
471
471
|
}
|
|
472
|
-
render(
|
|
473
|
-
return `for(${this.iteration})` + super.render(
|
|
472
|
+
render(v) {
|
|
473
|
+
return `for(${this.iteration})` + super.render(v);
|
|
474
474
|
}
|
|
475
|
-
optimizeNames(
|
|
476
|
-
if (super.optimizeNames(
|
|
477
|
-
return this.iteration = W(this.iteration,
|
|
475
|
+
optimizeNames(v, j) {
|
|
476
|
+
if (super.optimizeNames(v, j))
|
|
477
|
+
return this.iteration = W(this.iteration, v, j), this;
|
|
478
478
|
}
|
|
479
479
|
get names() {
|
|
480
|
-
return
|
|
480
|
+
return D(super.names, this.iteration.names);
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
483
|
class y extends o {
|
|
484
|
-
constructor(
|
|
485
|
-
super(), this.varKind =
|
|
484
|
+
constructor(v, j, R, F) {
|
|
485
|
+
super(), this.varKind = v, this.name = j, this.from = R, this.to = F;
|
|
486
486
|
}
|
|
487
|
-
render(
|
|
488
|
-
const j =
|
|
489
|
-
return `for(${j} ${R}=${F}; ${R}<${
|
|
487
|
+
render(v) {
|
|
488
|
+
const j = v.es5 ? r.varKinds.var : this.varKind, { name: R, from: F, to: V } = this;
|
|
489
|
+
return `for(${j} ${R}=${F}; ${R}<${V}; ${R}++)` + super.render(v);
|
|
490
490
|
}
|
|
491
491
|
get names() {
|
|
492
|
-
const
|
|
493
|
-
return
|
|
492
|
+
const v = U(super.names, this.from);
|
|
493
|
+
return U(v, this.to);
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
|
-
class
|
|
497
|
-
constructor(
|
|
498
|
-
super(), this.loop =
|
|
496
|
+
class $ extends o {
|
|
497
|
+
constructor(v, j, R, F) {
|
|
498
|
+
super(), this.loop = v, this.varKind = j, this.name = R, this.iterable = F;
|
|
499
499
|
}
|
|
500
|
-
render(
|
|
501
|
-
return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(
|
|
500
|
+
render(v) {
|
|
501
|
+
return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(v);
|
|
502
502
|
}
|
|
503
|
-
optimizeNames(
|
|
504
|
-
if (super.optimizeNames(
|
|
505
|
-
return this.iterable = W(this.iterable,
|
|
503
|
+
optimizeNames(v, j) {
|
|
504
|
+
if (super.optimizeNames(v, j))
|
|
505
|
+
return this.iterable = W(this.iterable, v, j), this;
|
|
506
506
|
}
|
|
507
507
|
get names() {
|
|
508
|
-
return
|
|
508
|
+
return D(super.names, this.iterable.names);
|
|
509
509
|
}
|
|
510
510
|
}
|
|
511
511
|
class _ extends S {
|
|
512
|
-
constructor(
|
|
513
|
-
super(), this.name =
|
|
512
|
+
constructor(v, j, R) {
|
|
513
|
+
super(), this.name = v, this.args = j, this.async = R;
|
|
514
514
|
}
|
|
515
|
-
render(
|
|
516
|
-
return `${this.async ? "async " : ""}function ${this.name}(${this.args})` + super.render(
|
|
515
|
+
render(v) {
|
|
516
|
+
return `${this.async ? "async " : ""}function ${this.name}(${this.args})` + super.render(v);
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
519
|
_.kind = "func";
|
|
520
520
|
class P extends w {
|
|
521
|
-
render(
|
|
522
|
-
return "return " + super.render(
|
|
521
|
+
render(v) {
|
|
522
|
+
return "return " + super.render(v);
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
525
|
P.kind = "return";
|
|
526
526
|
class N extends S {
|
|
527
|
-
render(
|
|
528
|
-
let j = "try" + super.render(
|
|
529
|
-
return this.catch && (j += this.catch.render(
|
|
527
|
+
render(v) {
|
|
528
|
+
let j = "try" + super.render(v);
|
|
529
|
+
return this.catch && (j += this.catch.render(v)), this.finally && (j += this.finally.render(v)), j;
|
|
530
530
|
}
|
|
531
531
|
optimizeNodes() {
|
|
532
|
-
var
|
|
533
|
-
return super.optimizeNodes(), (
|
|
532
|
+
var v, j;
|
|
533
|
+
return super.optimizeNodes(), (v = this.catch) === null || v === void 0 || v.optimizeNodes(), (j = this.finally) === null || j === void 0 || j.optimizeNodes(), this;
|
|
534
534
|
}
|
|
535
|
-
optimizeNames(
|
|
535
|
+
optimizeNames(v, j) {
|
|
536
536
|
var R, F;
|
|
537
|
-
return super.optimizeNames(
|
|
537
|
+
return super.optimizeNames(v, j), (R = this.catch) === null || R === void 0 || R.optimizeNames(v, j), (F = this.finally) === null || F === void 0 || F.optimizeNames(v, j), this;
|
|
538
538
|
}
|
|
539
539
|
get names() {
|
|
540
|
-
const
|
|
541
|
-
return this.catch &&
|
|
540
|
+
const v = super.names;
|
|
541
|
+
return this.catch && D(v, this.catch.names), this.finally && D(v, this.finally.names), v;
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
544
|
class q extends S {
|
|
545
|
-
constructor(
|
|
546
|
-
super(), this.error =
|
|
545
|
+
constructor(v) {
|
|
546
|
+
super(), this.error = v;
|
|
547
547
|
}
|
|
548
|
-
render(
|
|
549
|
-
return `catch(${this.error})` + super.render(
|
|
548
|
+
render(v) {
|
|
549
|
+
return `catch(${this.error})` + super.render(v);
|
|
550
550
|
}
|
|
551
551
|
}
|
|
552
552
|
q.kind = "catch";
|
|
553
|
-
class
|
|
554
|
-
render(
|
|
555
|
-
return "finally" + super.render(
|
|
553
|
+
class L extends S {
|
|
554
|
+
render(v) {
|
|
555
|
+
return "finally" + super.render(v);
|
|
556
556
|
}
|
|
557
557
|
}
|
|
558
|
-
|
|
558
|
+
L.kind = "finally";
|
|
559
559
|
class I {
|
|
560
|
-
constructor(
|
|
560
|
+
constructor(v, j = {}) {
|
|
561
561
|
this._values = {}, this._blockStarts = [], this._constants = {}, this.opts = { ...j, _n: j.lines ? `
|
|
562
|
-
` : "" }, this._extScope =
|
|
562
|
+
` : "" }, this._extScope = v, this._scope = new r.Scope({ parent: v }), this._nodes = [new h()];
|
|
563
563
|
}
|
|
564
564
|
toString() {
|
|
565
565
|
return this._root.render(this.opts);
|
|
566
566
|
}
|
|
567
567
|
// returns unique name in the internal scope
|
|
568
|
-
name(
|
|
569
|
-
return this._scope.name(
|
|
568
|
+
name(v) {
|
|
569
|
+
return this._scope.name(v);
|
|
570
570
|
}
|
|
571
571
|
// reserves unique name in the external scope
|
|
572
|
-
scopeName(
|
|
573
|
-
return this._extScope.name(
|
|
572
|
+
scopeName(v) {
|
|
573
|
+
return this._extScope.name(v);
|
|
574
574
|
}
|
|
575
575
|
// reserves unique name in the external scope and assigns value to it
|
|
576
|
-
scopeValue(
|
|
577
|
-
const R = this._extScope.value(
|
|
576
|
+
scopeValue(v, j) {
|
|
577
|
+
const R = this._extScope.value(v, j);
|
|
578
578
|
return (this._values[R.prefix] || (this._values[R.prefix] = /* @__PURE__ */ new Set())).add(R), R;
|
|
579
579
|
}
|
|
580
|
-
getScopeValue(
|
|
581
|
-
return this._extScope.getValue(
|
|
580
|
+
getScopeValue(v, j) {
|
|
581
|
+
return this._extScope.getValue(v, j);
|
|
582
582
|
}
|
|
583
583
|
// return code that assigns values in the external scope to the names that are used internally
|
|
584
584
|
// (same names that were returned by gen.scopeName or gen.scopeValue)
|
|
585
|
-
scopeRefs(
|
|
586
|
-
return this._extScope.scopeRefs(
|
|
585
|
+
scopeRefs(v) {
|
|
586
|
+
return this._extScope.scopeRefs(v, this._values);
|
|
587
587
|
}
|
|
588
588
|
scopeCode() {
|
|
589
589
|
return this._extScope.scopeCode(this._values);
|
|
590
590
|
}
|
|
591
|
-
_def(
|
|
592
|
-
const
|
|
593
|
-
return R !== void 0 && F && (this._constants[
|
|
591
|
+
_def(v, j, R, F) {
|
|
592
|
+
const V = this._scope.toName(j);
|
|
593
|
+
return R !== void 0 && F && (this._constants[V.str] = R), this._leafNode(new i(v, V, R)), V;
|
|
594
594
|
}
|
|
595
595
|
// `const` declaration (`var` in es5 mode)
|
|
596
|
-
const(
|
|
597
|
-
return this._def(r.varKinds.const,
|
|
596
|
+
const(v, j, R) {
|
|
597
|
+
return this._def(r.varKinds.const, v, j, R);
|
|
598
598
|
}
|
|
599
599
|
// `let` declaration with optional assignment (`var` in es5 mode)
|
|
600
|
-
let(
|
|
601
|
-
return this._def(r.varKinds.let,
|
|
600
|
+
let(v, j, R) {
|
|
601
|
+
return this._def(r.varKinds.let, v, j, R);
|
|
602
602
|
}
|
|
603
603
|
// `var` declaration with optional assignment
|
|
604
|
-
var(
|
|
605
|
-
return this._def(r.varKinds.var,
|
|
604
|
+
var(v, j, R) {
|
|
605
|
+
return this._def(r.varKinds.var, v, j, R);
|
|
606
606
|
}
|
|
607
607
|
// assignment code
|
|
608
|
-
assign(
|
|
609
|
-
return this._leafNode(new c(
|
|
608
|
+
assign(v, j, R) {
|
|
609
|
+
return this._leafNode(new c(v, j, R));
|
|
610
610
|
}
|
|
611
611
|
// `+=` code
|
|
612
|
-
add(
|
|
613
|
-
return this._leafNode(new l(
|
|
612
|
+
add(v, j) {
|
|
613
|
+
return this._leafNode(new l(v, e.operators.ADD, j));
|
|
614
614
|
}
|
|
615
615
|
// appends passed SafeExpr to code or executes Block
|
|
616
|
-
code(
|
|
617
|
-
return typeof
|
|
616
|
+
code(v) {
|
|
617
|
+
return typeof v == "function" ? v() : v !== t.nil && this._leafNode(new g(v)), this;
|
|
618
618
|
}
|
|
619
619
|
// returns code for object literal for the passed argument list of key-value pairs
|
|
620
|
-
object(
|
|
620
|
+
object(...v) {
|
|
621
621
|
const j = ["{"];
|
|
622
|
-
for (const [R, F] of
|
|
622
|
+
for (const [R, F] of v)
|
|
623
623
|
j.length > 1 && j.push(","), j.push(R), (R !== F || this.opts.es5) && (j.push(":"), (0, t.addCodeArg)(j, F));
|
|
624
624
|
return j.push("}"), new t._Code(j);
|
|
625
625
|
}
|
|
626
626
|
// `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed)
|
|
627
|
-
if(
|
|
628
|
-
if (this._blockNode(new f(
|
|
627
|
+
if(v, j, R) {
|
|
628
|
+
if (this._blockNode(new f(v)), j && R)
|
|
629
629
|
this.code(j).else().code(R).endIf();
|
|
630
630
|
else if (j)
|
|
631
631
|
this.code(j).endIf();
|
|
@@ -634,8 +634,8 @@ function H() {
|
|
|
634
634
|
return this;
|
|
635
635
|
}
|
|
636
636
|
// `else if` clause - invalid without `if` or after `else` clauses
|
|
637
|
-
elseIf(
|
|
638
|
-
return this._elseNode(new f(
|
|
637
|
+
elseIf(v) {
|
|
638
|
+
return this._elseNode(new f(v));
|
|
639
639
|
}
|
|
640
640
|
// `else` clause - only valid after `if` or `else if` clauses
|
|
641
641
|
else() {
|
|
@@ -645,316 +645,316 @@ function H() {
|
|
|
645
645
|
endIf() {
|
|
646
646
|
return this._endBlockNode(f, u);
|
|
647
647
|
}
|
|
648
|
-
_for(
|
|
649
|
-
return this._blockNode(
|
|
648
|
+
_for(v, j) {
|
|
649
|
+
return this._blockNode(v), j && this.code(j).endFor(), this;
|
|
650
650
|
}
|
|
651
651
|
// a generic `for` clause (or statement if `forBody` is passed)
|
|
652
|
-
for(
|
|
653
|
-
return this._for(new d(
|
|
652
|
+
for(v, j) {
|
|
653
|
+
return this._for(new d(v), j);
|
|
654
654
|
}
|
|
655
655
|
// `for` statement for a range of values
|
|
656
|
-
forRange(
|
|
657
|
-
const X = this._scope.toName(
|
|
658
|
-
return this._for(new y(
|
|
656
|
+
forRange(v, j, R, F, V = this.opts.es5 ? r.varKinds.var : r.varKinds.let) {
|
|
657
|
+
const X = this._scope.toName(v);
|
|
658
|
+
return this._for(new y(V, X, j, R), () => F(X));
|
|
659
659
|
}
|
|
660
660
|
// `for-of` statement (in es5 mode replace with a normal for loop)
|
|
661
|
-
forOf(
|
|
662
|
-
const
|
|
661
|
+
forOf(v, j, R, F = r.varKinds.const) {
|
|
662
|
+
const V = this._scope.toName(v);
|
|
663
663
|
if (this.opts.es5) {
|
|
664
664
|
const X = j instanceof t.Name ? j : this.var("_arr", j);
|
|
665
665
|
return this.forRange("_i", 0, (0, t._)`${X}.length`, (G) => {
|
|
666
|
-
this.var(
|
|
666
|
+
this.var(V, (0, t._)`${X}[${G}]`), R(V);
|
|
667
667
|
});
|
|
668
668
|
}
|
|
669
|
-
return this._for(new
|
|
669
|
+
return this._for(new $("of", F, V, j), () => R(V));
|
|
670
670
|
}
|
|
671
671
|
// `for-in` statement.
|
|
672
672
|
// With option `ownProperties` replaced with a `for-of` loop for object keys
|
|
673
|
-
forIn(
|
|
673
|
+
forIn(v, j, R, F = this.opts.es5 ? r.varKinds.var : r.varKinds.const) {
|
|
674
674
|
if (this.opts.ownProperties)
|
|
675
|
-
return this.forOf(
|
|
676
|
-
const
|
|
677
|
-
return this._for(new
|
|
675
|
+
return this.forOf(v, (0, t._)`Object.keys(${j})`, R);
|
|
676
|
+
const V = this._scope.toName(v);
|
|
677
|
+
return this._for(new $("in", F, V, j), () => R(V));
|
|
678
678
|
}
|
|
679
679
|
// end `for` loop
|
|
680
680
|
endFor() {
|
|
681
681
|
return this._endBlockNode(o);
|
|
682
682
|
}
|
|
683
683
|
// `label` statement
|
|
684
|
-
label(
|
|
685
|
-
return this._leafNode(new p(
|
|
684
|
+
label(v) {
|
|
685
|
+
return this._leafNode(new p(v));
|
|
686
686
|
}
|
|
687
687
|
// `break` statement
|
|
688
|
-
break(
|
|
689
|
-
return this._leafNode(new m(
|
|
688
|
+
break(v) {
|
|
689
|
+
return this._leafNode(new m(v));
|
|
690
690
|
}
|
|
691
691
|
// `return` statement
|
|
692
|
-
return(
|
|
692
|
+
return(v) {
|
|
693
693
|
const j = new P();
|
|
694
|
-
if (this._blockNode(j), this.code(
|
|
694
|
+
if (this._blockNode(j), this.code(v), j.nodes.length !== 1)
|
|
695
695
|
throw new Error('CodeGen: "return" should have one node');
|
|
696
696
|
return this._endBlockNode(P);
|
|
697
697
|
}
|
|
698
698
|
// `try` statement
|
|
699
|
-
try(
|
|
699
|
+
try(v, j, R) {
|
|
700
700
|
if (!j && !R)
|
|
701
701
|
throw new Error('CodeGen: "try" without "catch" and "finally"');
|
|
702
702
|
const F = new N();
|
|
703
|
-
if (this._blockNode(F), this.code(
|
|
704
|
-
const
|
|
705
|
-
this._currNode = F.catch = new q(
|
|
703
|
+
if (this._blockNode(F), this.code(v), j) {
|
|
704
|
+
const V = this.name("e");
|
|
705
|
+
this._currNode = F.catch = new q(V), j(V);
|
|
706
706
|
}
|
|
707
|
-
return R && (this._currNode = F.finally = new
|
|
707
|
+
return R && (this._currNode = F.finally = new L(), this.code(R)), this._endBlockNode(q, L);
|
|
708
708
|
}
|
|
709
709
|
// `throw` statement
|
|
710
|
-
throw(
|
|
711
|
-
return this._leafNode(new b(
|
|
710
|
+
throw(v) {
|
|
711
|
+
return this._leafNode(new b(v));
|
|
712
712
|
}
|
|
713
713
|
// start self-balancing block
|
|
714
|
-
block(
|
|
715
|
-
return this._blockStarts.push(this._nodes.length),
|
|
714
|
+
block(v, j) {
|
|
715
|
+
return this._blockStarts.push(this._nodes.length), v && this.code(v).endBlock(j), this;
|
|
716
716
|
}
|
|
717
717
|
// end the current self-balancing block
|
|
718
|
-
endBlock(
|
|
718
|
+
endBlock(v) {
|
|
719
719
|
const j = this._blockStarts.pop();
|
|
720
720
|
if (j === void 0)
|
|
721
721
|
throw new Error("CodeGen: not in self-balancing block");
|
|
722
722
|
const R = this._nodes.length - j;
|
|
723
|
-
if (R < 0 ||
|
|
724
|
-
throw new Error(`CodeGen: wrong number of nodes: ${R} vs ${
|
|
723
|
+
if (R < 0 || v !== void 0 && R !== v)
|
|
724
|
+
throw new Error(`CodeGen: wrong number of nodes: ${R} vs ${v} expected`);
|
|
725
725
|
return this._nodes.length = j, this;
|
|
726
726
|
}
|
|
727
727
|
// `function` heading (or definition if funcBody is passed)
|
|
728
|
-
func(
|
|
729
|
-
return this._blockNode(new _(
|
|
728
|
+
func(v, j = t.nil, R, F) {
|
|
729
|
+
return this._blockNode(new _(v, j, R)), F && this.code(F).endFunc(), this;
|
|
730
730
|
}
|
|
731
731
|
// end function definition
|
|
732
732
|
endFunc() {
|
|
733
733
|
return this._endBlockNode(_);
|
|
734
734
|
}
|
|
735
|
-
optimize(
|
|
736
|
-
for (;
|
|
735
|
+
optimize(v = 1) {
|
|
736
|
+
for (; v-- > 0; )
|
|
737
737
|
this._root.optimizeNodes(), this._root.optimizeNames(this._root.names, this._constants);
|
|
738
738
|
}
|
|
739
|
-
_leafNode(
|
|
740
|
-
return this._currNode.nodes.push(
|
|
739
|
+
_leafNode(v) {
|
|
740
|
+
return this._currNode.nodes.push(v), this;
|
|
741
741
|
}
|
|
742
|
-
_blockNode(
|
|
743
|
-
this._currNode.nodes.push(
|
|
742
|
+
_blockNode(v) {
|
|
743
|
+
this._currNode.nodes.push(v), this._nodes.push(v);
|
|
744
744
|
}
|
|
745
|
-
_endBlockNode(
|
|
745
|
+
_endBlockNode(v, j) {
|
|
746
746
|
const R = this._currNode;
|
|
747
|
-
if (R instanceof
|
|
747
|
+
if (R instanceof v || j && R instanceof j)
|
|
748
748
|
return this._nodes.pop(), this;
|
|
749
|
-
throw new Error(`CodeGen: not in block "${j ? `${
|
|
749
|
+
throw new Error(`CodeGen: not in block "${j ? `${v.kind}/${j.kind}` : v.kind}"`);
|
|
750
750
|
}
|
|
751
|
-
_elseNode(
|
|
751
|
+
_elseNode(v) {
|
|
752
752
|
const j = this._currNode;
|
|
753
753
|
if (!(j instanceof f))
|
|
754
754
|
throw new Error('CodeGen: "else" without "if"');
|
|
755
|
-
return this._currNode = j.else =
|
|
755
|
+
return this._currNode = j.else = v, this;
|
|
756
756
|
}
|
|
757
757
|
get _root() {
|
|
758
758
|
return this._nodes[0];
|
|
759
759
|
}
|
|
760
760
|
get _currNode() {
|
|
761
|
-
const
|
|
762
|
-
return
|
|
761
|
+
const v = this._nodes;
|
|
762
|
+
return v[v.length - 1];
|
|
763
763
|
}
|
|
764
|
-
set _currNode(
|
|
764
|
+
set _currNode(v) {
|
|
765
765
|
const j = this._nodes;
|
|
766
|
-
j[j.length - 1] =
|
|
766
|
+
j[j.length - 1] = v;
|
|
767
767
|
}
|
|
768
768
|
}
|
|
769
769
|
e.CodeGen = I;
|
|
770
|
-
function
|
|
771
|
-
for (const j in
|
|
772
|
-
k[j] = (k[j] || 0) + (
|
|
770
|
+
function D(k, v) {
|
|
771
|
+
for (const j in v)
|
|
772
|
+
k[j] = (k[j] || 0) + (v[j] || 0);
|
|
773
773
|
return k;
|
|
774
774
|
}
|
|
775
|
-
function
|
|
776
|
-
return
|
|
775
|
+
function U(k, v) {
|
|
776
|
+
return v instanceof t._CodeOrName ? D(k, v.names) : k;
|
|
777
777
|
}
|
|
778
|
-
function W(k,
|
|
778
|
+
function W(k, v, j) {
|
|
779
779
|
if (k instanceof t.Name)
|
|
780
780
|
return R(k);
|
|
781
781
|
if (!F(k))
|
|
782
782
|
return k;
|
|
783
|
-
return new t._Code(k._items.reduce((
|
|
784
|
-
function R(
|
|
785
|
-
const X = j[
|
|
786
|
-
return X === void 0 ||
|
|
783
|
+
return new t._Code(k._items.reduce((V, X) => (X instanceof t.Name && (X = R(X)), X instanceof t._Code ? V.push(...X._items) : V.push(X), V), []));
|
|
784
|
+
function R(V) {
|
|
785
|
+
const X = j[V.str];
|
|
786
|
+
return X === void 0 || v[V.str] !== 1 ? V : (delete v[V.str], X);
|
|
787
787
|
}
|
|
788
|
-
function F(
|
|
789
|
-
return
|
|
788
|
+
function F(V) {
|
|
789
|
+
return V instanceof t._Code && V._items.some((X) => X instanceof t.Name && v[X.str] === 1 && j[X.str] !== void 0);
|
|
790
790
|
}
|
|
791
791
|
}
|
|
792
|
-
function ee(k,
|
|
793
|
-
for (const j in
|
|
794
|
-
k[j] = (k[j] || 0) - (
|
|
792
|
+
function ee(k, v) {
|
|
793
|
+
for (const j in v)
|
|
794
|
+
k[j] = (k[j] || 0) - (v[j] || 0);
|
|
795
795
|
}
|
|
796
|
-
function
|
|
796
|
+
function oe(k) {
|
|
797
797
|
return typeof k == "boolean" || typeof k == "number" || k === null ? !k : (0, t._)`!${C(k)}`;
|
|
798
798
|
}
|
|
799
|
-
e.not =
|
|
800
|
-
const
|
|
801
|
-
function
|
|
802
|
-
return k.reduce(
|
|
799
|
+
e.not = oe;
|
|
800
|
+
const re = O(e.operators.AND);
|
|
801
|
+
function Z(...k) {
|
|
802
|
+
return k.reduce(re);
|
|
803
803
|
}
|
|
804
|
-
e.and =
|
|
805
|
-
const
|
|
804
|
+
e.and = Z;
|
|
805
|
+
const se = O(e.operators.OR);
|
|
806
806
|
function M(...k) {
|
|
807
|
-
return k.reduce(
|
|
807
|
+
return k.reduce(se);
|
|
808
808
|
}
|
|
809
809
|
e.or = M;
|
|
810
810
|
function O(k) {
|
|
811
|
-
return (
|
|
811
|
+
return (v, j) => v === t.nil ? j : j === t.nil ? v : (0, t._)`${C(v)} ${k} ${C(j)}`;
|
|
812
812
|
}
|
|
813
813
|
function C(k) {
|
|
814
814
|
return k instanceof t.Name ? k : (0, t._)`(${k})`;
|
|
815
815
|
}
|
|
816
816
|
}(Pr)), Pr;
|
|
817
817
|
}
|
|
818
|
-
var
|
|
818
|
+
var Y = {}, fn;
|
|
819
819
|
function Q() {
|
|
820
|
-
if (fn) return
|
|
821
|
-
fn = 1, Object.defineProperty(
|
|
820
|
+
if (fn) return Y;
|
|
821
|
+
fn = 1, Object.defineProperty(Y, "__esModule", { value: !0 }), Y.checkStrictMode = Y.getErrorPath = Y.Type = Y.useFunc = Y.setEvaluated = Y.evaluatedPropsToName = Y.mergeEvaluated = Y.eachItem = Y.unescapeJsonPointer = Y.escapeJsonPointer = Y.escapeFragment = Y.unescapeFragment = Y.schemaRefOrVal = Y.schemaHasRulesButRef = Y.schemaHasRules = Y.checkUnknownRules = Y.alwaysValidSchema = Y.toHash = void 0;
|
|
822
822
|
const e = H(), t = ir();
|
|
823
|
-
function r(
|
|
823
|
+
function r($) {
|
|
824
824
|
const _ = {};
|
|
825
|
-
for (const P of
|
|
825
|
+
for (const P of $)
|
|
826
826
|
_[P] = !0;
|
|
827
827
|
return _;
|
|
828
828
|
}
|
|
829
|
-
|
|
830
|
-
function n(
|
|
831
|
-
return typeof _ == "boolean" ? _ : Object.keys(_).length === 0 ? !0 : (s(
|
|
829
|
+
Y.toHash = r;
|
|
830
|
+
function n($, _) {
|
|
831
|
+
return typeof _ == "boolean" ? _ : Object.keys(_).length === 0 ? !0 : (s($, _), !a(_, $.self.RULES.all));
|
|
832
832
|
}
|
|
833
|
-
|
|
834
|
-
function s(
|
|
835
|
-
const { opts: P, self: N } =
|
|
833
|
+
Y.alwaysValidSchema = n;
|
|
834
|
+
function s($, _ = $.schema) {
|
|
835
|
+
const { opts: P, self: N } = $;
|
|
836
836
|
if (!P.strictSchema || typeof _ == "boolean")
|
|
837
837
|
return;
|
|
838
838
|
const q = N.RULES.keywords;
|
|
839
|
-
for (const
|
|
840
|
-
q[
|
|
841
|
-
}
|
|
842
|
-
|
|
843
|
-
function a(
|
|
844
|
-
if (typeof
|
|
845
|
-
return
|
|
846
|
-
for (const P in
|
|
839
|
+
for (const L in _)
|
|
840
|
+
q[L] || y($, `unknown keyword: "${L}"`);
|
|
841
|
+
}
|
|
842
|
+
Y.checkUnknownRules = s;
|
|
843
|
+
function a($, _) {
|
|
844
|
+
if (typeof $ == "boolean")
|
|
845
|
+
return !$;
|
|
846
|
+
for (const P in $)
|
|
847
847
|
if (_[P])
|
|
848
848
|
return !0;
|
|
849
849
|
return !1;
|
|
850
850
|
}
|
|
851
|
-
|
|
852
|
-
function i(
|
|
853
|
-
if (typeof
|
|
854
|
-
return
|
|
855
|
-
for (const P in
|
|
851
|
+
Y.schemaHasRules = a;
|
|
852
|
+
function i($, _) {
|
|
853
|
+
if (typeof $ == "boolean")
|
|
854
|
+
return !$;
|
|
855
|
+
for (const P in $)
|
|
856
856
|
if (P !== "$ref" && _.all[P])
|
|
857
857
|
return !0;
|
|
858
858
|
return !1;
|
|
859
859
|
}
|
|
860
|
-
|
|
861
|
-
function c({ topSchemaRef:
|
|
860
|
+
Y.schemaHasRulesButRef = i;
|
|
861
|
+
function c({ topSchemaRef: $, schemaPath: _ }, P, N, q) {
|
|
862
862
|
if (!q) {
|
|
863
863
|
if (typeof P == "number" || typeof P == "boolean")
|
|
864
864
|
return P;
|
|
865
865
|
if (typeof P == "string")
|
|
866
866
|
return (0, e._)`${P}`;
|
|
867
867
|
}
|
|
868
|
-
return (0, e._)`${
|
|
868
|
+
return (0, e._)`${$}${_}${(0, e.getProperty)(N)}`;
|
|
869
869
|
}
|
|
870
|
-
|
|
871
|
-
function l(
|
|
872
|
-
return b(decodeURIComponent(
|
|
870
|
+
Y.schemaRefOrVal = c;
|
|
871
|
+
function l($) {
|
|
872
|
+
return b(decodeURIComponent($));
|
|
873
873
|
}
|
|
874
|
-
|
|
875
|
-
function p(
|
|
876
|
-
return encodeURIComponent(m(
|
|
874
|
+
Y.unescapeFragment = l;
|
|
875
|
+
function p($) {
|
|
876
|
+
return encodeURIComponent(m($));
|
|
877
877
|
}
|
|
878
|
-
|
|
879
|
-
function m(
|
|
880
|
-
return typeof
|
|
878
|
+
Y.escapeFragment = p;
|
|
879
|
+
function m($) {
|
|
880
|
+
return typeof $ == "number" ? `${$}` : $.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
881
881
|
}
|
|
882
|
-
|
|
883
|
-
function b(
|
|
884
|
-
return
|
|
882
|
+
Y.escapeJsonPointer = m;
|
|
883
|
+
function b($) {
|
|
884
|
+
return $.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
885
885
|
}
|
|
886
|
-
|
|
887
|
-
function g(
|
|
888
|
-
if (Array.isArray(
|
|
889
|
-
for (const P of
|
|
886
|
+
Y.unescapeJsonPointer = b;
|
|
887
|
+
function g($, _) {
|
|
888
|
+
if (Array.isArray($))
|
|
889
|
+
for (const P of $)
|
|
890
890
|
_(P);
|
|
891
891
|
else
|
|
892
|
-
_(
|
|
892
|
+
_($);
|
|
893
893
|
}
|
|
894
|
-
|
|
895
|
-
function w({ mergeNames:
|
|
896
|
-
return (q,
|
|
897
|
-
const
|
|
898
|
-
return
|
|
894
|
+
Y.eachItem = g;
|
|
895
|
+
function w({ mergeNames: $, mergeToName: _, mergeValues: P, resultToName: N }) {
|
|
896
|
+
return (q, L, I, D) => {
|
|
897
|
+
const U = I === void 0 ? L : I instanceof e.Name ? (L instanceof e.Name ? $(q, L, I) : _(q, L, I), I) : L instanceof e.Name ? (_(q, I, L), L) : P(L, I);
|
|
898
|
+
return D === e.Name && !(U instanceof e.Name) ? N(q, U) : U;
|
|
899
899
|
};
|
|
900
900
|
}
|
|
901
|
-
|
|
901
|
+
Y.mergeEvaluated = {
|
|
902
902
|
props: w({
|
|
903
|
-
mergeNames: (
|
|
904
|
-
|
|
903
|
+
mergeNames: ($, _, P) => $.if((0, e._)`${P} !== true && ${_} !== undefined`, () => {
|
|
904
|
+
$.if((0, e._)`${_} === true`, () => $.assign(P, !0), () => $.assign(P, (0, e._)`${P} || {}`).code((0, e._)`Object.assign(${P}, ${_})`));
|
|
905
905
|
}),
|
|
906
|
-
mergeToName: (
|
|
907
|
-
_ === !0 ?
|
|
906
|
+
mergeToName: ($, _, P) => $.if((0, e._)`${P} !== true`, () => {
|
|
907
|
+
_ === !0 ? $.assign(P, !0) : ($.assign(P, (0, e._)`${P} || {}`), h($, P, _));
|
|
908
908
|
}),
|
|
909
|
-
mergeValues: (
|
|
909
|
+
mergeValues: ($, _) => $ === !0 ? !0 : { ...$, ..._ },
|
|
910
910
|
resultToName: S
|
|
911
911
|
}),
|
|
912
912
|
items: w({
|
|
913
|
-
mergeNames: (
|
|
914
|
-
mergeToName: (
|
|
915
|
-
mergeValues: (
|
|
916
|
-
resultToName: (
|
|
913
|
+
mergeNames: ($, _, P) => $.if((0, e._)`${P} !== true && ${_} !== undefined`, () => $.assign(P, (0, e._)`${_} === true ? true : ${P} > ${_} ? ${P} : ${_}`)),
|
|
914
|
+
mergeToName: ($, _, P) => $.if((0, e._)`${P} !== true`, () => $.assign(P, _ === !0 ? !0 : (0, e._)`${P} > ${_} ? ${P} : ${_}`)),
|
|
915
|
+
mergeValues: ($, _) => $ === !0 ? !0 : Math.max($, _),
|
|
916
|
+
resultToName: ($, _) => $.var("items", _)
|
|
917
917
|
})
|
|
918
918
|
};
|
|
919
|
-
function S(
|
|
919
|
+
function S($, _) {
|
|
920
920
|
if (_ === !0)
|
|
921
|
-
return
|
|
922
|
-
const P =
|
|
923
|
-
return _ !== void 0 && h(
|
|
921
|
+
return $.var("props", !0);
|
|
922
|
+
const P = $.var("props", (0, e._)`{}`);
|
|
923
|
+
return _ !== void 0 && h($, P, _), P;
|
|
924
924
|
}
|
|
925
|
-
|
|
926
|
-
function h(
|
|
927
|
-
Object.keys(P).forEach((N) =>
|
|
925
|
+
Y.evaluatedPropsToName = S;
|
|
926
|
+
function h($, _, P) {
|
|
927
|
+
Object.keys(P).forEach((N) => $.assign((0, e._)`${_}${(0, e.getProperty)(N)}`, !0));
|
|
928
928
|
}
|
|
929
|
-
|
|
929
|
+
Y.setEvaluated = h;
|
|
930
930
|
const u = {};
|
|
931
|
-
function f(
|
|
932
|
-
return
|
|
931
|
+
function f($, _) {
|
|
932
|
+
return $.scopeValue("func", {
|
|
933
933
|
ref: _,
|
|
934
934
|
code: u[_.code] || (u[_.code] = new t._Code(_.code))
|
|
935
935
|
});
|
|
936
936
|
}
|
|
937
|
-
|
|
937
|
+
Y.useFunc = f;
|
|
938
938
|
var o;
|
|
939
|
-
(function(
|
|
940
|
-
|
|
941
|
-
})(o || (
|
|
942
|
-
function d(
|
|
943
|
-
if (
|
|
939
|
+
(function($) {
|
|
940
|
+
$[$.Num = 0] = "Num", $[$.Str = 1] = "Str";
|
|
941
|
+
})(o || (Y.Type = o = {}));
|
|
942
|
+
function d($, _, P) {
|
|
943
|
+
if ($ instanceof e.Name) {
|
|
944
944
|
const N = _ === o.Num;
|
|
945
|
-
return P ? N ? (0, e._)`"[" + ${
|
|
945
|
+
return P ? N ? (0, e._)`"[" + ${$} + "]"` : (0, e._)`"['" + ${$} + "']"` : N ? (0, e._)`"/" + ${$}` : (0, e._)`"/" + ${$}.replace(/~/g, "~0").replace(/\\//g, "~1")`;
|
|
946
946
|
}
|
|
947
|
-
return P ? (0, e.getProperty)(
|
|
947
|
+
return P ? (0, e.getProperty)($).toString() : "/" + m($);
|
|
948
948
|
}
|
|
949
|
-
|
|
950
|
-
function y(
|
|
949
|
+
Y.getErrorPath = d;
|
|
950
|
+
function y($, _, P = $.opts.strictSchema) {
|
|
951
951
|
if (P) {
|
|
952
952
|
if (_ = `strict mode: ${_}`, P === !0)
|
|
953
953
|
throw new Error(_);
|
|
954
|
-
|
|
954
|
+
$.self.logger.warn(_);
|
|
955
955
|
}
|
|
956
956
|
}
|
|
957
|
-
return
|
|
957
|
+
return Y.checkStrictMode = y, Y;
|
|
958
958
|
}
|
|
959
959
|
var ot = {}, mn;
|
|
960
960
|
function Pe() {
|
|
@@ -1002,25 +1002,25 @@ function mr() {
|
|
|
1002
1002
|
message: ({ keyword: u, schemaType: f }) => f ? (0, t.str)`"${u}" keyword must be ${f} ($data)` : (0, t.str)`"${u}" keyword is invalid ($data)`
|
|
1003
1003
|
};
|
|
1004
1004
|
function s(u, f = e.keywordError, o, d) {
|
|
1005
|
-
const { it: y } = u, { gen:
|
|
1006
|
-
d ?? (_ || P) ? l(
|
|
1005
|
+
const { it: y } = u, { gen: $, compositeRule: _, allErrors: P } = y, N = b(u, f, o);
|
|
1006
|
+
d ?? (_ || P) ? l($, N) : p(y, (0, t._)`[${N}]`);
|
|
1007
1007
|
}
|
|
1008
1008
|
e.reportError = s;
|
|
1009
1009
|
function a(u, f = e.keywordError, o) {
|
|
1010
|
-
const { it: d } = u, { gen: y, compositeRule:
|
|
1011
|
-
l(y, P),
|
|
1010
|
+
const { it: d } = u, { gen: y, compositeRule: $, allErrors: _ } = d, P = b(u, f, o);
|
|
1011
|
+
l(y, P), $ || _ || p(d, n.default.vErrors);
|
|
1012
1012
|
}
|
|
1013
1013
|
e.reportExtraError = a;
|
|
1014
1014
|
function i(u, f) {
|
|
1015
1015
|
u.assign(n.default.errors, f), u.if((0, t._)`${n.default.vErrors} !== null`, () => u.if(f, () => u.assign((0, t._)`${n.default.vErrors}.length`, f), () => u.assign(n.default.vErrors, null)));
|
|
1016
1016
|
}
|
|
1017
1017
|
e.resetErrorsCount = i;
|
|
1018
|
-
function c({ gen: u, keyword: f, schemaValue: o, data: d, errsCount: y, it:
|
|
1018
|
+
function c({ gen: u, keyword: f, schemaValue: o, data: d, errsCount: y, it: $ }) {
|
|
1019
1019
|
if (y === void 0)
|
|
1020
1020
|
throw new Error("ajv implementation error");
|
|
1021
1021
|
const _ = u.name("err");
|
|
1022
1022
|
u.forRange("i", y, n.default.errors, (P) => {
|
|
1023
|
-
u.const(_, (0, t._)`${n.default.vErrors}[${P}]`), u.if((0, t._)`${_}.instancePath === undefined`, () => u.assign((0, t._)`${_}.instancePath`, (0, t.strConcat)(n.default.instancePath,
|
|
1023
|
+
u.const(_, (0, t._)`${n.default.vErrors}[${P}]`), u.if((0, t._)`${_}.instancePath === undefined`, () => u.assign((0, t._)`${_}.instancePath`, (0, t.strConcat)(n.default.instancePath, $.errorPath))), u.assign((0, t._)`${_}.schemaPath`, (0, t.str)`${$.errSchemaPath}/${f}`), $.opts.verbose && (u.assign((0, t._)`${_}.schema`, o), u.assign((0, t._)`${_}.data`, d));
|
|
1024
1024
|
});
|
|
1025
1025
|
}
|
|
1026
1026
|
e.extendErrors = c;
|
|
@@ -1047,11 +1047,11 @@ function mr() {
|
|
|
1047
1047
|
return d === !1 ? (0, t._)`{}` : g(u, f, o);
|
|
1048
1048
|
}
|
|
1049
1049
|
function g(u, f, o = {}) {
|
|
1050
|
-
const { gen: d, it: y } = u,
|
|
1050
|
+
const { gen: d, it: y } = u, $ = [
|
|
1051
1051
|
w(y, o),
|
|
1052
1052
|
S(u, o)
|
|
1053
1053
|
];
|
|
1054
|
-
return h(u, f,
|
|
1054
|
+
return h(u, f, $), d.object(...$);
|
|
1055
1055
|
}
|
|
1056
1056
|
function w({ errorPath: u }, { instancePath: f }) {
|
|
1057
1057
|
const o = f ? (0, t.str)`${u}${(0, r.getErrorPath)(f, r.Type.Str)}` : u;
|
|
@@ -1062,8 +1062,8 @@ function mr() {
|
|
|
1062
1062
|
return o && (y = (0, t.str)`${y}${(0, r.getErrorPath)(o, r.Type.Str)}`), [m.schemaPath, y];
|
|
1063
1063
|
}
|
|
1064
1064
|
function h(u, { params: f, message: o }, d) {
|
|
1065
|
-
const { keyword: y, data:
|
|
1066
|
-
d.push([m.keyword, y], [m.params, typeof f == "function" ? f(u) : f || (0, t._)`{}`]), N.messages && d.push([m.message, typeof o == "function" ? o(u) : o]), N.verbose && d.push([m.schema, _], [m.parentSchema, (0, t._)`${
|
|
1065
|
+
const { keyword: y, data: $, schemaValue: _, it: P } = u, { opts: N, propertyName: q, topSchemaRef: L, schemaPath: I } = P;
|
|
1066
|
+
d.push([m.keyword, y], [m.params, typeof f == "function" ? f(u) : f || (0, t._)`{}`]), N.messages && d.push([m.message, typeof o == "function" ? o(u) : o]), N.verbose && d.push([m.schema, _], [m.parentSchema, (0, t._)`${L}${I}`], [n.default.data, $]), q && d.push([m.propertyName, q]);
|
|
1067
1067
|
}
|
|
1068
1068
|
}(Sr)), Sr;
|
|
1069
1069
|
}
|
|
@@ -1174,9 +1174,9 @@ function or() {
|
|
|
1174
1174
|
}
|
|
1175
1175
|
fe.getJSONTypes = c;
|
|
1176
1176
|
function l(o, d) {
|
|
1177
|
-
const { gen: y, data:
|
|
1177
|
+
const { gen: y, data: $, opts: _ } = o, P = m(d, _.coerceTypes), N = d.length > 0 && !(P.length === 0 && d.length === 1 && (0, t.schemaHasRulesForType)(o, d[0]));
|
|
1178
1178
|
if (N) {
|
|
1179
|
-
const q = S(d,
|
|
1179
|
+
const q = S(d, $, _.strictNumbers, a.Wrong);
|
|
1180
1180
|
y.if(q, () => {
|
|
1181
1181
|
P.length ? b(o, d, P) : u(o);
|
|
1182
1182
|
});
|
|
@@ -1189,43 +1189,43 @@ function or() {
|
|
|
1189
1189
|
return d ? o.filter((y) => p.has(y) || d === "array" && y === "array") : [];
|
|
1190
1190
|
}
|
|
1191
1191
|
function b(o, d, y) {
|
|
1192
|
-
const { gen:
|
|
1193
|
-
P.coerceTypes === "array" &&
|
|
1192
|
+
const { gen: $, data: _, opts: P } = o, N = $.let("dataType", (0, n._)`typeof ${_}`), q = $.let("coerced", (0, n._)`undefined`);
|
|
1193
|
+
P.coerceTypes === "array" && $.if((0, n._)`${N} == 'object' && Array.isArray(${_}) && ${_}.length == 1`, () => $.assign(_, (0, n._)`${_}[0]`).assign(N, (0, n._)`typeof ${_}`).if(S(d, _, P.strictNumbers), () => $.assign(q, _))), $.if((0, n._)`${q} !== undefined`);
|
|
1194
1194
|
for (const I of y)
|
|
1195
|
-
(p.has(I) || I === "array" && P.coerceTypes === "array") &&
|
|
1196
|
-
|
|
1197
|
-
|
|
1195
|
+
(p.has(I) || I === "array" && P.coerceTypes === "array") && L(I);
|
|
1196
|
+
$.else(), u(o), $.endIf(), $.if((0, n._)`${q} !== undefined`, () => {
|
|
1197
|
+
$.assign(_, q), g(o, q);
|
|
1198
1198
|
});
|
|
1199
|
-
function
|
|
1199
|
+
function L(I) {
|
|
1200
1200
|
switch (I) {
|
|
1201
1201
|
case "string":
|
|
1202
|
-
|
|
1202
|
+
$.elseIf((0, n._)`${N} == "number" || ${N} == "boolean"`).assign(q, (0, n._)`"" + ${_}`).elseIf((0, n._)`${_} === null`).assign(q, (0, n._)`""`);
|
|
1203
1203
|
return;
|
|
1204
1204
|
case "number":
|
|
1205
|
-
|
|
1205
|
+
$.elseIf((0, n._)`${N} == "boolean" || ${_} === null
|
|
1206
1206
|
|| (${N} == "string" && ${_} && ${_} == +${_})`).assign(q, (0, n._)`+${_}`);
|
|
1207
1207
|
return;
|
|
1208
1208
|
case "integer":
|
|
1209
|
-
|
|
1209
|
+
$.elseIf((0, n._)`${N} === "boolean" || ${_} === null
|
|
1210
1210
|
|| (${N} === "string" && ${_} && ${_} == +${_} && !(${_} % 1))`).assign(q, (0, n._)`+${_}`);
|
|
1211
1211
|
return;
|
|
1212
1212
|
case "boolean":
|
|
1213
|
-
|
|
1213
|
+
$.elseIf((0, n._)`${_} === "false" || ${_} === 0 || ${_} === null`).assign(q, !1).elseIf((0, n._)`${_} === "true" || ${_} === 1`).assign(q, !0);
|
|
1214
1214
|
return;
|
|
1215
1215
|
case "null":
|
|
1216
|
-
|
|
1216
|
+
$.elseIf((0, n._)`${_} === "" || ${_} === 0 || ${_} === false`), $.assign(q, null);
|
|
1217
1217
|
return;
|
|
1218
1218
|
case "array":
|
|
1219
|
-
|
|
1219
|
+
$.elseIf((0, n._)`${N} === "string" || ${N} === "number"
|
|
1220
1220
|
|| ${N} === "boolean" || ${_} === null`).assign(q, (0, n._)`[${_}]`);
|
|
1221
1221
|
}
|
|
1222
1222
|
}
|
|
1223
1223
|
}
|
|
1224
|
-
function g({ gen: o, parentData: d, parentDataProperty: y },
|
|
1225
|
-
o.if((0, n._)`${d} !== undefined`, () => o.assign((0, n._)`${d}[${y}]`,
|
|
1224
|
+
function g({ gen: o, parentData: d, parentDataProperty: y }, $) {
|
|
1225
|
+
o.if((0, n._)`${d} !== undefined`, () => o.assign((0, n._)`${d}[${y}]`, $));
|
|
1226
1226
|
}
|
|
1227
|
-
function w(o, d, y,
|
|
1228
|
-
const _ =
|
|
1227
|
+
function w(o, d, y, $ = a.Correct) {
|
|
1228
|
+
const _ = $ === a.Correct ? n.operators.EQ : n.operators.NEQ;
|
|
1229
1229
|
let P;
|
|
1230
1230
|
switch (o) {
|
|
1231
1231
|
case "null":
|
|
@@ -1245,15 +1245,15 @@ function or() {
|
|
|
1245
1245
|
default:
|
|
1246
1246
|
return (0, n._)`typeof ${d} ${_} ${o}`;
|
|
1247
1247
|
}
|
|
1248
|
-
return
|
|
1248
|
+
return $ === a.Correct ? P : (0, n.not)(P);
|
|
1249
1249
|
function N(q = n.nil) {
|
|
1250
1250
|
return (0, n.and)((0, n._)`typeof ${d} == "number"`, q, y ? (0, n._)`isFinite(${d})` : n.nil);
|
|
1251
1251
|
}
|
|
1252
1252
|
}
|
|
1253
1253
|
fe.checkDataType = w;
|
|
1254
|
-
function S(o, d, y,
|
|
1254
|
+
function S(o, d, y, $) {
|
|
1255
1255
|
if (o.length === 1)
|
|
1256
|
-
return w(o[0], d, y,
|
|
1256
|
+
return w(o[0], d, y, $);
|
|
1257
1257
|
let _;
|
|
1258
1258
|
const P = (0, s.toHash)(o);
|
|
1259
1259
|
if (P.array && P.object) {
|
|
@@ -1263,7 +1263,7 @@ function or() {
|
|
|
1263
1263
|
_ = n.nil;
|
|
1264
1264
|
P.number && delete P.integer;
|
|
1265
1265
|
for (const N in P)
|
|
1266
|
-
_ = (0, n.and)(_, w(N, d, y,
|
|
1266
|
+
_ = (0, n.and)(_, w(N, d, y, $));
|
|
1267
1267
|
return _;
|
|
1268
1268
|
}
|
|
1269
1269
|
fe.checkDataTypes = S;
|
|
@@ -1277,15 +1277,15 @@ function or() {
|
|
|
1277
1277
|
}
|
|
1278
1278
|
fe.reportTypeError = u;
|
|
1279
1279
|
function f(o) {
|
|
1280
|
-
const { gen: d, data: y, schema:
|
|
1280
|
+
const { gen: d, data: y, schema: $ } = o, _ = (0, s.schemaRefOrVal)(o, $, "type");
|
|
1281
1281
|
return {
|
|
1282
1282
|
gen: d,
|
|
1283
1283
|
keyword: "type",
|
|
1284
1284
|
data: y,
|
|
1285
|
-
schema:
|
|
1285
|
+
schema: $.type,
|
|
1286
1286
|
schemaCode: _,
|
|
1287
1287
|
schemaValue: _,
|
|
1288
|
-
parentSchema:
|
|
1288
|
+
parentSchema: $,
|
|
1289
1289
|
params: {},
|
|
1290
1290
|
it: o
|
|
1291
1291
|
};
|
|
@@ -1325,14 +1325,14 @@ function je() {
|
|
|
1325
1325
|
bn = 1, Object.defineProperty(ne, "__esModule", { value: !0 }), ne.validateUnion = ne.validateArray = ne.usePattern = ne.callValidateCode = ne.schemaProperties = ne.allSchemaProperties = ne.noPropertyInData = ne.propertyInData = ne.isOwnProperty = ne.hasPropFunc = ne.reportMissingProp = ne.checkMissingProp = ne.checkReportMissingProp = void 0;
|
|
1326
1326
|
const e = H(), t = Q(), r = Pe(), n = Q();
|
|
1327
1327
|
function s(o, d) {
|
|
1328
|
-
const { gen: y, data:
|
|
1329
|
-
y.if(m(y,
|
|
1328
|
+
const { gen: y, data: $, it: _ } = o;
|
|
1329
|
+
y.if(m(y, $, d, _.opts.ownProperties), () => {
|
|
1330
1330
|
o.setParams({ missingProperty: (0, e._)`${d}` }, !0), o.error();
|
|
1331
1331
|
});
|
|
1332
1332
|
}
|
|
1333
1333
|
ne.checkReportMissingProp = s;
|
|
1334
|
-
function a({ gen: o, data: d, it: { opts: y } },
|
|
1335
|
-
return (0, e.or)(
|
|
1334
|
+
function a({ gen: o, data: d, it: { opts: y } }, $, _) {
|
|
1335
|
+
return (0, e.or)(...$.map((P) => (0, e.and)(m(o, d, P, y.ownProperties), (0, e._)`${_} = ${P}`)));
|
|
1336
1336
|
}
|
|
1337
1337
|
ne.checkMissingProp = a;
|
|
1338
1338
|
function i(o, d) {
|
|
@@ -1351,14 +1351,14 @@ function je() {
|
|
|
1351
1351
|
return (0, e._)`${c(o)}.call(${d}, ${y})`;
|
|
1352
1352
|
}
|
|
1353
1353
|
ne.isOwnProperty = l;
|
|
1354
|
-
function p(o, d, y,
|
|
1354
|
+
function p(o, d, y, $) {
|
|
1355
1355
|
const _ = (0, e._)`${d}${(0, e.getProperty)(y)} !== undefined`;
|
|
1356
|
-
return
|
|
1356
|
+
return $ ? (0, e._)`${_} && ${l(o, d, y)}` : _;
|
|
1357
1357
|
}
|
|
1358
1358
|
ne.propertyInData = p;
|
|
1359
|
-
function m(o, d, y,
|
|
1359
|
+
function m(o, d, y, $) {
|
|
1360
1360
|
const _ = (0, e._)`${d}${(0, e.getProperty)(y)} === undefined`;
|
|
1361
|
-
return
|
|
1361
|
+
return $ ? (0, e.or)(_, (0, e.not)(l(o, d, y))) : _;
|
|
1362
1362
|
}
|
|
1363
1363
|
ne.noPropertyInData = m;
|
|
1364
1364
|
function b(o) {
|
|
@@ -1369,40 +1369,40 @@ function je() {
|
|
|
1369
1369
|
return b(d).filter((y) => !(0, t.alwaysValidSchema)(o, d[y]));
|
|
1370
1370
|
}
|
|
1371
1371
|
ne.schemaProperties = g;
|
|
1372
|
-
function w({ schemaCode: o, data: d, it: { gen: y, topSchemaRef:
|
|
1373
|
-
const
|
|
1372
|
+
function w({ schemaCode: o, data: d, it: { gen: y, topSchemaRef: $, schemaPath: _, errorPath: P }, it: N }, q, L, I) {
|
|
1373
|
+
const D = I ? (0, e._)`${o}, ${d}, ${$}${_}` : d, U = [
|
|
1374
1374
|
[r.default.instancePath, (0, e.strConcat)(r.default.instancePath, P)],
|
|
1375
1375
|
[r.default.parentData, N.parentData],
|
|
1376
1376
|
[r.default.parentDataProperty, N.parentDataProperty],
|
|
1377
1377
|
[r.default.rootData, r.default.rootData]
|
|
1378
1378
|
];
|
|
1379
|
-
N.opts.dynamicRef &&
|
|
1380
|
-
const W = (0, e._)`${
|
|
1381
|
-
return
|
|
1379
|
+
N.opts.dynamicRef && U.push([r.default.dynamicAnchors, r.default.dynamicAnchors]);
|
|
1380
|
+
const W = (0, e._)`${D}, ${y.object(...U)}`;
|
|
1381
|
+
return L !== e.nil ? (0, e._)`${q}.call(${L}, ${W})` : (0, e._)`${q}(${W})`;
|
|
1382
1382
|
}
|
|
1383
1383
|
ne.callValidateCode = w;
|
|
1384
1384
|
const S = (0, e._)`new RegExp`;
|
|
1385
1385
|
function h({ gen: o, it: { opts: d } }, y) {
|
|
1386
|
-
const
|
|
1386
|
+
const $ = d.unicodeRegExp ? "u" : "", { regExp: _ } = d.code, P = _(y, $);
|
|
1387
1387
|
return o.scopeValue("pattern", {
|
|
1388
1388
|
key: P.toString(),
|
|
1389
1389
|
ref: P,
|
|
1390
|
-
code: (0, e._)`${_.code === "new RegExp" ? S : (0, n.useFunc)(o, _)}(${y}, ${
|
|
1390
|
+
code: (0, e._)`${_.code === "new RegExp" ? S : (0, n.useFunc)(o, _)}(${y}, ${$})`
|
|
1391
1391
|
});
|
|
1392
1392
|
}
|
|
1393
1393
|
ne.usePattern = h;
|
|
1394
1394
|
function u(o) {
|
|
1395
|
-
const { gen: d, data: y, keyword:
|
|
1395
|
+
const { gen: d, data: y, keyword: $, it: _ } = o, P = d.name("valid");
|
|
1396
1396
|
if (_.allErrors) {
|
|
1397
1397
|
const q = d.let("valid", !0);
|
|
1398
1398
|
return N(() => d.assign(q, !1)), q;
|
|
1399
1399
|
}
|
|
1400
1400
|
return d.var(P, !0), N(() => d.break()), P;
|
|
1401
1401
|
function N(q) {
|
|
1402
|
-
const
|
|
1403
|
-
d.forRange("i", 0,
|
|
1402
|
+
const L = d.const("len", (0, e._)`${y}.length`);
|
|
1403
|
+
d.forRange("i", 0, L, (I) => {
|
|
1404
1404
|
o.subschema({
|
|
1405
|
-
keyword:
|
|
1405
|
+
keyword: $,
|
|
1406
1406
|
dataProp: I,
|
|
1407
1407
|
dataPropType: t.Type.Num
|
|
1408
1408
|
}, P), d.if((0, e.not)(P), q);
|
|
@@ -1411,70 +1411,70 @@ function je() {
|
|
|
1411
1411
|
}
|
|
1412
1412
|
ne.validateArray = u;
|
|
1413
1413
|
function f(o) {
|
|
1414
|
-
const { gen: d, schema: y, keyword:
|
|
1414
|
+
const { gen: d, schema: y, keyword: $, it: _ } = o;
|
|
1415
1415
|
if (!Array.isArray(y))
|
|
1416
1416
|
throw new Error("ajv implementation error");
|
|
1417
|
-
if (y.some((
|
|
1417
|
+
if (y.some((L) => (0, t.alwaysValidSchema)(_, L)) && !_.opts.unevaluated)
|
|
1418
1418
|
return;
|
|
1419
1419
|
const N = d.let("valid", !1), q = d.name("_valid");
|
|
1420
|
-
d.block(() => y.forEach((
|
|
1421
|
-
const
|
|
1422
|
-
keyword:
|
|
1420
|
+
d.block(() => y.forEach((L, I) => {
|
|
1421
|
+
const D = o.subschema({
|
|
1422
|
+
keyword: $,
|
|
1423
1423
|
schemaProp: I,
|
|
1424
1424
|
compositeRule: !0
|
|
1425
1425
|
}, q);
|
|
1426
|
-
d.assign(N, (0, e._)`${N} || ${q}`), o.mergeValidEvaluated(
|
|
1426
|
+
d.assign(N, (0, e._)`${N} || ${q}`), o.mergeValidEvaluated(D, q) || d.if((0, e.not)(N));
|
|
1427
1427
|
})), o.result(N, () => o.reset(), () => o.error(!0));
|
|
1428
1428
|
}
|
|
1429
1429
|
return ne.validateUnion = f, ne;
|
|
1430
1430
|
}
|
|
1431
1431
|
var _n;
|
|
1432
|
-
function
|
|
1432
|
+
function Vi() {
|
|
1433
1433
|
if (_n) return Se;
|
|
1434
1434
|
_n = 1, Object.defineProperty(Se, "__esModule", { value: !0 }), Se.validateKeywordUsage = Se.validSchemaType = Se.funcKeywordCode = Se.macroKeywordCode = void 0;
|
|
1435
1435
|
const e = H(), t = Pe(), r = je(), n = mr();
|
|
1436
1436
|
function s(g, w) {
|
|
1437
1437
|
const { gen: S, keyword: h, schema: u, parentSchema: f, it: o } = g, d = w.macro.call(o.self, u, f, o), y = p(S, h, d);
|
|
1438
1438
|
o.opts.validateSchema !== !1 && o.self.validateSchema(d, !0);
|
|
1439
|
-
const
|
|
1439
|
+
const $ = S.name("valid");
|
|
1440
1440
|
g.subschema({
|
|
1441
1441
|
schema: d,
|
|
1442
1442
|
schemaPath: e.nil,
|
|
1443
1443
|
errSchemaPath: `${o.errSchemaPath}/${h}`,
|
|
1444
1444
|
topSchemaRef: y,
|
|
1445
1445
|
compositeRule: !0
|
|
1446
|
-
},
|
|
1446
|
+
}, $), g.pass($, () => g.error(!0));
|
|
1447
1447
|
}
|
|
1448
1448
|
Se.macroKeywordCode = s;
|
|
1449
1449
|
function a(g, w) {
|
|
1450
1450
|
var S;
|
|
1451
1451
|
const { gen: h, keyword: u, schema: f, parentSchema: o, $data: d, it: y } = g;
|
|
1452
1452
|
l(y, w);
|
|
1453
|
-
const
|
|
1453
|
+
const $ = !d && w.compile ? w.compile.call(y.self, f, o, y) : w.validate, _ = p(h, u, $), P = h.let("valid");
|
|
1454
1454
|
g.block$data(P, N), g.ok((S = w.valid) !== null && S !== void 0 ? S : P);
|
|
1455
1455
|
function N() {
|
|
1456
1456
|
if (w.errors === !1)
|
|
1457
|
-
I(), w.modifying && i(g),
|
|
1457
|
+
I(), w.modifying && i(g), D(() => g.error());
|
|
1458
1458
|
else {
|
|
1459
|
-
const
|
|
1460
|
-
w.modifying && i(g),
|
|
1459
|
+
const U = w.async ? q() : L();
|
|
1460
|
+
w.modifying && i(g), D(() => c(g, U));
|
|
1461
1461
|
}
|
|
1462
1462
|
}
|
|
1463
1463
|
function q() {
|
|
1464
|
-
const
|
|
1465
|
-
return h.try(() => I((0, e._)`await `), (W) => h.assign(P, !1).if((0, e._)`${W} instanceof ${y.ValidationError}`, () => h.assign(
|
|
1464
|
+
const U = h.let("ruleErrs", null);
|
|
1465
|
+
return h.try(() => I((0, e._)`await `), (W) => h.assign(P, !1).if((0, e._)`${W} instanceof ${y.ValidationError}`, () => h.assign(U, (0, e._)`${W}.errors`), () => h.throw(W))), U;
|
|
1466
1466
|
}
|
|
1467
|
-
function
|
|
1468
|
-
const
|
|
1469
|
-
return h.assign(
|
|
1467
|
+
function L() {
|
|
1468
|
+
const U = (0, e._)`${_}.errors`;
|
|
1469
|
+
return h.assign(U, null), I(e.nil), U;
|
|
1470
1470
|
}
|
|
1471
|
-
function I(
|
|
1471
|
+
function I(U = w.async ? (0, e._)`await ` : e.nil) {
|
|
1472
1472
|
const W = y.opts.passContext ? t.default.this : t.default.self, ee = !("compile" in w && !d || w.schema === !1);
|
|
1473
|
-
h.assign(P, (0, e._)`${
|
|
1473
|
+
h.assign(P, (0, e._)`${U}${(0, r.callValidateCode)(g, _, W, ee)}`, w.modifying);
|
|
1474
1474
|
}
|
|
1475
|
-
function
|
|
1475
|
+
function D(U) {
|
|
1476
1476
|
var W;
|
|
1477
|
-
h.if((0, e.not)((W = w.valid) !== null && W !== void 0 ? W : P),
|
|
1477
|
+
h.if((0, e.not)((W = w.valid) !== null && W !== void 0 ? W : P), U);
|
|
1478
1478
|
}
|
|
1479
1479
|
}
|
|
1480
1480
|
Se.funcKeywordCode = a;
|
|
@@ -1518,7 +1518,7 @@ function Di() {
|
|
|
1518
1518
|
return Se.validateKeywordUsage = b, Se;
|
|
1519
1519
|
}
|
|
1520
1520
|
var Ae = {}, wn;
|
|
1521
|
-
function
|
|
1521
|
+
function Di() {
|
|
1522
1522
|
if (wn) return Ae;
|
|
1523
1523
|
wn = 1, Object.defineProperty(Ae, "__esModule", { value: !0 }), Ae.extendSubschemaMode = Ae.extendSubschemaData = Ae.getSubschema = void 0;
|
|
1524
1524
|
const e = H(), t = Q();
|
|
@@ -1752,35 +1752,35 @@ function pr() {
|
|
|
1752
1752
|
function S(h, u) {
|
|
1753
1753
|
if (typeof h == "boolean")
|
|
1754
1754
|
return {};
|
|
1755
|
-
const { schemaId: f, uriResolver: o } = this.opts, d = b(h[f] || u), y = { "": d },
|
|
1756
|
-
return r(h, { allKeys: !0 }, (
|
|
1757
|
-
if (
|
|
1755
|
+
const { schemaId: f, uriResolver: o } = this.opts, d = b(h[f] || u), y = { "": d }, $ = l(o, d, !1), _ = {}, P = /* @__PURE__ */ new Set();
|
|
1756
|
+
return r(h, { allKeys: !0 }, (L, I, D, U) => {
|
|
1757
|
+
if (U === void 0)
|
|
1758
1758
|
return;
|
|
1759
|
-
const W =
|
|
1760
|
-
let ee = y[
|
|
1761
|
-
typeof
|
|
1762
|
-
function
|
|
1763
|
-
const
|
|
1764
|
-
if (
|
|
1765
|
-
throw q(
|
|
1766
|
-
P.add(
|
|
1767
|
-
let M = this.refs[
|
|
1768
|
-
return typeof M == "string" && (M = this.refs[M]), typeof M == "object" ? N(
|
|
1769
|
-
}
|
|
1770
|
-
function
|
|
1771
|
-
if (typeof
|
|
1772
|
-
if (!w.test(
|
|
1773
|
-
throw new Error(`invalid anchor "${
|
|
1774
|
-
|
|
1759
|
+
const W = $ + I;
|
|
1760
|
+
let ee = y[U];
|
|
1761
|
+
typeof L[f] == "string" && (ee = oe.call(this, L[f])), re.call(this, L.$anchor), re.call(this, L.$dynamicAnchor), y[I] = ee;
|
|
1762
|
+
function oe(Z) {
|
|
1763
|
+
const se = this.opts.uriResolver.resolve;
|
|
1764
|
+
if (Z = b(ee ? se(ee, Z) : Z), P.has(Z))
|
|
1765
|
+
throw q(Z);
|
|
1766
|
+
P.add(Z);
|
|
1767
|
+
let M = this.refs[Z];
|
|
1768
|
+
return typeof M == "string" && (M = this.refs[M]), typeof M == "object" ? N(L, M.schema, Z) : Z !== b(W) && (Z[0] === "#" ? (N(L, _[Z], Z), _[Z] = L) : this.refs[Z] = W), Z;
|
|
1769
|
+
}
|
|
1770
|
+
function re(Z) {
|
|
1771
|
+
if (typeof Z == "string") {
|
|
1772
|
+
if (!w.test(Z))
|
|
1773
|
+
throw new Error(`invalid anchor "${Z}"`);
|
|
1774
|
+
oe.call(this, `#${Z}`);
|
|
1775
1775
|
}
|
|
1776
1776
|
}
|
|
1777
1777
|
}), _;
|
|
1778
|
-
function N(
|
|
1779
|
-
if (I !== void 0 && !t(
|
|
1780
|
-
throw q(
|
|
1778
|
+
function N(L, I, D) {
|
|
1779
|
+
if (I !== void 0 && !t(L, I))
|
|
1780
|
+
throw q(D);
|
|
1781
1781
|
}
|
|
1782
|
-
function q(
|
|
1783
|
-
return new Error(`reference "${
|
|
1782
|
+
function q(L) {
|
|
1783
|
+
return new Error(`reference "${L}" resolves to more than one schema`);
|
|
1784
1784
|
}
|
|
1785
1785
|
}
|
|
1786
1786
|
return pe.getSchemaRefs = S, pe;
|
|
@@ -1789,9 +1789,9 @@ var En;
|
|
|
1789
1789
|
function Je() {
|
|
1790
1790
|
if (En) return Oe;
|
|
1791
1791
|
En = 1, Object.defineProperty(Oe, "__esModule", { value: !0 }), Oe.getData = Oe.KeywordCxt = Oe.validateFunctionCode = void 0;
|
|
1792
|
-
const e = qi(), t = or(), r = fs(), n = or(), s = Mi(), a =
|
|
1792
|
+
const e = qi(), t = or(), r = fs(), n = or(), s = Mi(), a = Vi(), i = Di(), c = H(), l = Pe(), p = pr(), m = Q(), b = mr();
|
|
1793
1793
|
function g(E) {
|
|
1794
|
-
if (
|
|
1794
|
+
if ($(E) && (P(E), y(E))) {
|
|
1795
1795
|
u(E);
|
|
1796
1796
|
return;
|
|
1797
1797
|
}
|
|
@@ -1816,7 +1816,7 @@ function Je() {
|
|
|
1816
1816
|
function u(E) {
|
|
1817
1817
|
const { schema: A, opts: T, gen: z } = E;
|
|
1818
1818
|
w(E, () => {
|
|
1819
|
-
T.$comment && A.$comment &&
|
|
1819
|
+
T.$comment && A.$comment && U(E), L(E), z.let(l.default.vErrors, null), z.let(l.default.errors, 0), T.unevaluated && f(E), N(E), W(E);
|
|
1820
1820
|
});
|
|
1821
1821
|
}
|
|
1822
1822
|
function f(E) {
|
|
@@ -1828,7 +1828,7 @@ function Je() {
|
|
|
1828
1828
|
return T && (A.code.source || A.code.process) ? (0, c._)`/*# sourceURL=${T} */` : c.nil;
|
|
1829
1829
|
}
|
|
1830
1830
|
function d(E, A) {
|
|
1831
|
-
if (
|
|
1831
|
+
if ($(E) && (P(E), y(E))) {
|
|
1832
1832
|
_(E, A);
|
|
1833
1833
|
return;
|
|
1834
1834
|
}
|
|
@@ -1842,12 +1842,12 @@ function Je() {
|
|
|
1842
1842
|
return !0;
|
|
1843
1843
|
return !1;
|
|
1844
1844
|
}
|
|
1845
|
-
function
|
|
1845
|
+
function $(E) {
|
|
1846
1846
|
return typeof E.schema != "boolean";
|
|
1847
1847
|
}
|
|
1848
1848
|
function _(E, A) {
|
|
1849
1849
|
const { schema: T, gen: z, opts: B } = E;
|
|
1850
|
-
B.$comment && T.$comment &&
|
|
1850
|
+
B.$comment && T.$comment && U(E), I(E), D(E);
|
|
1851
1851
|
const x = z.const("_errs", l.default.errors);
|
|
1852
1852
|
N(E, x), z.var(A, (0, c._)`${x} === ${l.default.errors}`);
|
|
1853
1853
|
}
|
|
@@ -1856,15 +1856,15 @@ function Je() {
|
|
|
1856
1856
|
}
|
|
1857
1857
|
function N(E, A) {
|
|
1858
1858
|
if (E.opts.jtd)
|
|
1859
|
-
return
|
|
1859
|
+
return oe(E, [], !1, A);
|
|
1860
1860
|
const T = (0, t.getSchemaTypes)(E.schema), z = (0, t.coerceAndCheckDataType)(E, T);
|
|
1861
|
-
|
|
1861
|
+
oe(E, T, !z, A);
|
|
1862
1862
|
}
|
|
1863
1863
|
function q(E) {
|
|
1864
1864
|
const { schema: A, errSchemaPath: T, opts: z, self: B } = E;
|
|
1865
1865
|
A.$ref && z.ignoreKeywordsWithRef && (0, m.schemaHasRulesButRef)(A, B.RULES) && B.logger.warn(`$ref: keywords ignored in schema at path "${T}"`);
|
|
1866
1866
|
}
|
|
1867
|
-
function
|
|
1867
|
+
function L(E) {
|
|
1868
1868
|
const { schema: A, opts: T } = E;
|
|
1869
1869
|
A.default !== void 0 && T.useDefaults && T.strictSchema && (0, m.checkStrictMode)(E, "default is ignored in the schema root");
|
|
1870
1870
|
}
|
|
@@ -1872,11 +1872,11 @@ function Je() {
|
|
|
1872
1872
|
const A = E.schema[E.opts.schemaId];
|
|
1873
1873
|
A && (E.baseId = (0, p.resolveUrl)(E.opts.uriResolver, E.baseId, A));
|
|
1874
1874
|
}
|
|
1875
|
-
function
|
|
1875
|
+
function D(E) {
|
|
1876
1876
|
if (E.schema.$async && !E.schemaEnv.$async)
|
|
1877
1877
|
throw new Error("async schema in sync schema");
|
|
1878
1878
|
}
|
|
1879
|
-
function
|
|
1879
|
+
function U({ gen: E, schemaEnv: A, schema: T, errSchemaPath: z, opts: B }) {
|
|
1880
1880
|
const x = T.$comment;
|
|
1881
1881
|
if (B.$comment === !0)
|
|
1882
1882
|
E.code((0, c._)`${l.default.self}.logger.log(${x})`);
|
|
@@ -1892,32 +1892,32 @@ function Je() {
|
|
|
1892
1892
|
function ee({ gen: E, evaluated: A, props: T, items: z }) {
|
|
1893
1893
|
T instanceof c.Name && E.assign((0, c._)`${A}.props`, T), z instanceof c.Name && E.assign((0, c._)`${A}.items`, z);
|
|
1894
1894
|
}
|
|
1895
|
-
function
|
|
1895
|
+
function oe(E, A, T, z) {
|
|
1896
1896
|
const { gen: B, schema: x, data: ue, allErrors: we, opts: ge, self: ve } = E, { RULES: le } = ve;
|
|
1897
1897
|
if (x.$ref && (ge.ignoreKeywordsWithRef || !(0, m.schemaHasRulesButRef)(x, le))) {
|
|
1898
1898
|
B.block(() => F(E, "$ref", le.all.$ref.definition));
|
|
1899
1899
|
return;
|
|
1900
1900
|
}
|
|
1901
|
-
ge.jtd ||
|
|
1901
|
+
ge.jtd || Z(E, A), B.block(() => {
|
|
1902
1902
|
for (const _e of le.rules)
|
|
1903
|
-
|
|
1904
|
-
|
|
1903
|
+
De(_e);
|
|
1904
|
+
De(le.post);
|
|
1905
1905
|
});
|
|
1906
|
-
function
|
|
1907
|
-
(0, r.shouldUseGroup)(x, _e) && (_e.type ? (B.if((0, n.checkDataType)(_e.type, ue, ge.strictNumbers)),
|
|
1906
|
+
function De(_e) {
|
|
1907
|
+
(0, r.shouldUseGroup)(x, _e) && (_e.type ? (B.if((0, n.checkDataType)(_e.type, ue, ge.strictNumbers)), re(E, _e), A.length === 1 && A[0] === _e.type && T && (B.else(), (0, n.reportTypeError)(E)), B.endIf()) : re(E, _e), we || B.if((0, c._)`${l.default.errors} === ${z || 0}`));
|
|
1908
1908
|
}
|
|
1909
1909
|
}
|
|
1910
|
-
function
|
|
1910
|
+
function re(E, A) {
|
|
1911
1911
|
const { gen: T, schema: z, opts: { useDefaults: B } } = E;
|
|
1912
1912
|
B && (0, s.assignDefaults)(E, A.type), T.block(() => {
|
|
1913
1913
|
for (const x of A.rules)
|
|
1914
1914
|
(0, r.shouldUseRule)(z, x) && F(E, x.keyword, x.definition, A.type);
|
|
1915
1915
|
});
|
|
1916
1916
|
}
|
|
1917
|
-
function
|
|
1918
|
-
E.schemaEnv.meta || !E.opts.strictTypes || (
|
|
1917
|
+
function Z(E, A) {
|
|
1918
|
+
E.schemaEnv.meta || !E.opts.strictTypes || (se(E, A), E.opts.allowUnionTypes || M(E, A), O(E, E.dataTypes));
|
|
1919
1919
|
}
|
|
1920
|
-
function
|
|
1920
|
+
function se(E, A) {
|
|
1921
1921
|
if (A.length) {
|
|
1922
1922
|
if (!E.dataTypes.length) {
|
|
1923
1923
|
E.dataTypes = A;
|
|
@@ -1925,7 +1925,7 @@ function Je() {
|
|
|
1925
1925
|
}
|
|
1926
1926
|
A.forEach((T) => {
|
|
1927
1927
|
k(E.dataTypes, T) || j(E, `type "${T}" not allowed by context "${E.dataTypes.join(",")}"`);
|
|
1928
|
-
}),
|
|
1928
|
+
}), v(E, A);
|
|
1929
1929
|
}
|
|
1930
1930
|
}
|
|
1931
1931
|
function M(E, A) {
|
|
@@ -1947,7 +1947,7 @@ function Je() {
|
|
|
1947
1947
|
function k(E, A) {
|
|
1948
1948
|
return E.includes(A) || A === "integer" && E.includes("number");
|
|
1949
1949
|
}
|
|
1950
|
-
function
|
|
1950
|
+
function v(E, A) {
|
|
1951
1951
|
const T = [];
|
|
1952
1952
|
for (const z of E.dataTypes)
|
|
1953
1953
|
k(A, z) ? T.push(z) : A.includes("integer") && z === "number" && T.push("integer");
|
|
@@ -2063,13 +2063,13 @@ function Je() {
|
|
|
2063
2063
|
const B = new R(E, T, A);
|
|
2064
2064
|
"code" in T ? T.code(B, z) : B.$data && T.validate ? (0, a.funcKeywordCode)(B, T) : "macro" in T ? (0, a.macroKeywordCode)(B, T) : (T.compile || T.validate) && (0, a.funcKeywordCode)(B, T);
|
|
2065
2065
|
}
|
|
2066
|
-
const
|
|
2066
|
+
const V = /^\/(?:[^~]|~0|~1)*$/, X = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
|
|
2067
2067
|
function G(E, { dataLevel: A, dataNames: T, dataPathArr: z }) {
|
|
2068
2068
|
let B, x;
|
|
2069
2069
|
if (E === "")
|
|
2070
2070
|
return l.default.rootData;
|
|
2071
2071
|
if (E[0] === "/") {
|
|
2072
|
-
if (!
|
|
2072
|
+
if (!V.test(E))
|
|
2073
2073
|
throw new Error(`Invalid JSON-pointer: ${E}`);
|
|
2074
2074
|
B = E, x = l.default.rootData;
|
|
2075
2075
|
} else {
|
|
@@ -2139,7 +2139,7 @@ function hr() {
|
|
|
2139
2139
|
const f = m.call(this, u);
|
|
2140
2140
|
if (f)
|
|
2141
2141
|
return f;
|
|
2142
|
-
const o = (0, n.getFullPath)(this.opts.uriResolver, u.root.baseId), { es5: d, lines: y } = this.opts.code, { ownProperties:
|
|
2142
|
+
const o = (0, n.getFullPath)(this.opts.uriResolver, u.root.baseId), { es5: d, lines: y } = this.opts.code, { ownProperties: $ } = this.opts, _ = new e.CodeGen(this.scope, { es5: d, lines: y, ownProperties: $ });
|
|
2143
2143
|
let P;
|
|
2144
2144
|
u.$async && (P = _.scopeValue("Error", {
|
|
2145
2145
|
ref: t.default,
|
|
@@ -2172,24 +2172,24 @@ function hr() {
|
|
|
2172
2172
|
opts: this.opts,
|
|
2173
2173
|
self: this
|
|
2174
2174
|
};
|
|
2175
|
-
let
|
|
2175
|
+
let L;
|
|
2176
2176
|
try {
|
|
2177
2177
|
this._compilations.add(u), (0, a.validateFunctionCode)(q), _.optimize(this.opts.code.optimize);
|
|
2178
2178
|
const I = _.toString();
|
|
2179
|
-
|
|
2180
|
-
const
|
|
2181
|
-
if (this.scope.value(N, { ref:
|
|
2179
|
+
L = `${_.scopeRefs(r.default.scope)}return ${I}`, this.opts.code.process && (L = this.opts.code.process(L, u));
|
|
2180
|
+
const U = new Function(`${r.default.self}`, `${r.default.scope}`, L)(this, this.scope.get());
|
|
2181
|
+
if (this.scope.value(N, { ref: U }), U.errors = null, U.schema = u.schema, U.schemaEnv = u, u.$async && (U.$async = !0), this.opts.code.source === !0 && (U.source = { validateName: N, validateCode: I, scopeValues: _._values }), this.opts.unevaluated) {
|
|
2182
2182
|
const { props: W, items: ee } = q;
|
|
2183
|
-
|
|
2183
|
+
U.evaluated = {
|
|
2184
2184
|
props: W instanceof e.Name ? void 0 : W,
|
|
2185
2185
|
items: ee instanceof e.Name ? void 0 : ee,
|
|
2186
2186
|
dynamicProps: W instanceof e.Name,
|
|
2187
2187
|
dynamicItems: ee instanceof e.Name
|
|
2188
|
-
},
|
|
2188
|
+
}, U.source && (U.source.evaluated = (0, e.stringify)(U.evaluated));
|
|
2189
2189
|
}
|
|
2190
|
-
return u.validate =
|
|
2190
|
+
return u.validate = U, u;
|
|
2191
2191
|
} catch (I) {
|
|
2192
|
-
throw delete u.validate, delete u.validateName,
|
|
2192
|
+
throw delete u.validate, delete u.validateName, L && this.logger.error("Error compiling schema, function code:", L), I;
|
|
2193
2193
|
} finally {
|
|
2194
2194
|
this._compilations.delete(u);
|
|
2195
2195
|
}
|
|
@@ -2201,13 +2201,13 @@ function hr() {
|
|
|
2201
2201
|
const y = u.refs[o];
|
|
2202
2202
|
if (y)
|
|
2203
2203
|
return y;
|
|
2204
|
-
let
|
|
2205
|
-
if (
|
|
2204
|
+
let $ = g.call(this, u, o);
|
|
2205
|
+
if ($ === void 0) {
|
|
2206
2206
|
const _ = (d = u.localRefs) === null || d === void 0 ? void 0 : d[o], { schemaId: P } = this.opts;
|
|
2207
|
-
_ && (
|
|
2207
|
+
_ && ($ = new i({ schema: _, schemaId: P, root: u, baseId: f }));
|
|
2208
2208
|
}
|
|
2209
|
-
if (
|
|
2210
|
-
return u.refs[o] = p.call(this,
|
|
2209
|
+
if ($ !== void 0)
|
|
2210
|
+
return u.refs[o] = p.call(this, $);
|
|
2211
2211
|
}
|
|
2212
2212
|
$e.resolveRef = l;
|
|
2213
2213
|
function p(u) {
|
|
@@ -2233,13 +2233,13 @@ function hr() {
|
|
|
2233
2233
|
let y = (0, n.getFullPath)(this.opts.uriResolver, u.baseId, void 0);
|
|
2234
2234
|
if (Object.keys(u.schema).length > 0 && d === y)
|
|
2235
2235
|
return h.call(this, o, u);
|
|
2236
|
-
const
|
|
2236
|
+
const $ = (0, n.normalizeId)(d), _ = this.refs[$] || this.schemas[$];
|
|
2237
2237
|
if (typeof _ == "string") {
|
|
2238
2238
|
const P = w.call(this, u, _);
|
|
2239
2239
|
return typeof P?.schema != "object" ? void 0 : h.call(this, o, P);
|
|
2240
2240
|
}
|
|
2241
2241
|
if (typeof _?.schema == "object") {
|
|
2242
|
-
if (_.validate || c.call(this, _),
|
|
2242
|
+
if (_.validate || c.call(this, _), $ === (0, n.normalizeId)(f)) {
|
|
2243
2243
|
const { schema: P } = _, { schemaId: N } = this.opts, q = P[N];
|
|
2244
2244
|
return q && (y = (0, n.resolveUrl)(this.opts.uriResolver, y, q)), new i({ schema: P, schemaId: N, root: u, baseId: y });
|
|
2245
2245
|
}
|
|
@@ -2268,14 +2268,14 @@ function hr() {
|
|
|
2268
2268
|
const q = typeof o == "object" && o[this.opts.schemaId];
|
|
2269
2269
|
!S.has(P) && q && (f = (0, n.resolveUrl)(this.opts.uriResolver, f, q));
|
|
2270
2270
|
}
|
|
2271
|
-
let
|
|
2271
|
+
let $;
|
|
2272
2272
|
if (typeof o != "boolean" && o.$ref && !(0, s.schemaHasRulesButRef)(o, this.RULES)) {
|
|
2273
2273
|
const P = (0, n.resolveUrl)(this.opts.uriResolver, f, o.$ref);
|
|
2274
|
-
|
|
2274
|
+
$ = w.call(this, d, P);
|
|
2275
2275
|
}
|
|
2276
2276
|
const { schemaId: _ } = this.opts;
|
|
2277
|
-
if (
|
|
2278
|
-
return
|
|
2277
|
+
if ($ = $ || new i({ schema: o, schemaId: _, root: d, baseId: f }), $.schema !== $.root.schema)
|
|
2278
|
+
return $;
|
|
2279
2279
|
}
|
|
2280
2280
|
return $e;
|
|
2281
2281
|
}
|
|
@@ -2287,7 +2287,7 @@ const Fi = "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/
|
|
|
2287
2287
|
properties: Wi,
|
|
2288
2288
|
additionalProperties: Bi
|
|
2289
2289
|
};
|
|
2290
|
-
var lt = {},
|
|
2290
|
+
var lt = {}, Ye = { exports: {} }, Ar, kn;
|
|
2291
2291
|
function Hi() {
|
|
2292
2292
|
return kn || (kn = 1, Ar = {
|
|
2293
2293
|
HEX: {
|
|
@@ -2338,7 +2338,7 @@ function Gi() {
|
|
|
2338
2338
|
function s(h) {
|
|
2339
2339
|
let u = 0;
|
|
2340
2340
|
const f = { error: !1, address: "", zone: "" }, o = [], d = [];
|
|
2341
|
-
let y = !1,
|
|
2341
|
+
let y = !1, $ = !1, _ = !1;
|
|
2342
2342
|
function P() {
|
|
2343
2343
|
if (d.length) {
|
|
2344
2344
|
if (y === !1) {
|
|
@@ -2356,13 +2356,13 @@ function Gi() {
|
|
|
2356
2356
|
const q = h[N];
|
|
2357
2357
|
if (!(q === "[" || q === "]"))
|
|
2358
2358
|
if (q === ":") {
|
|
2359
|
-
if (
|
|
2359
|
+
if ($ === !0 && (_ = !0), !P())
|
|
2360
2360
|
break;
|
|
2361
2361
|
if (u++, o.push(":"), u > 7) {
|
|
2362
2362
|
f.error = !0;
|
|
2363
2363
|
break;
|
|
2364
2364
|
}
|
|
2365
|
-
N - 1 >= 0 && h[N - 1] === ":" && (
|
|
2365
|
+
N - 1 >= 0 && h[N - 1] === ":" && ($ = !0);
|
|
2366
2366
|
continue;
|
|
2367
2367
|
} else if (q === "%") {
|
|
2368
2368
|
if (!P())
|
|
@@ -2390,8 +2390,8 @@ function Gi() {
|
|
|
2390
2390
|
let f = "", o = !0;
|
|
2391
2391
|
const d = h.length;
|
|
2392
2392
|
for (let y = 0; y < d; y++) {
|
|
2393
|
-
const
|
|
2394
|
-
|
|
2393
|
+
const $ = h[y];
|
|
2394
|
+
$ === "0" && o ? (y + 1 <= d && h[y + 1] === u || y + 1 === d) && (f += $, o = !1) : ($ === u ? o = !0 : o = !1, f += $);
|
|
2395
2395
|
}
|
|
2396
2396
|
return f;
|
|
2397
2397
|
}
|
|
@@ -2481,19 +2481,19 @@ function Xi() {
|
|
|
2481
2481
|
return o.error = "URN can not be parsed", o;
|
|
2482
2482
|
const y = o.path.match(t);
|
|
2483
2483
|
if (y) {
|
|
2484
|
-
const
|
|
2484
|
+
const $ = d.scheme || o.scheme || "urn";
|
|
2485
2485
|
o.nid = y[1].toLowerCase(), o.nss = y[2];
|
|
2486
|
-
const _ = `${
|
|
2486
|
+
const _ = `${$}:${d.nid || o.nid}`, P = f[_];
|
|
2487
2487
|
o.path = void 0, P && (o = P.parse(o, d));
|
|
2488
2488
|
} else
|
|
2489
2489
|
o.error = o.error || "URN can not be parsed.";
|
|
2490
2490
|
return o;
|
|
2491
2491
|
}
|
|
2492
2492
|
function l(o, d) {
|
|
2493
|
-
const y = d.scheme || o.scheme || "urn",
|
|
2493
|
+
const y = d.scheme || o.scheme || "urn", $ = o.nid.toLowerCase(), _ = `${y}:${d.nid || $}`, P = f[_];
|
|
2494
2494
|
P && (o = P.serialize(o, d));
|
|
2495
2495
|
const N = o, q = o.nss;
|
|
2496
|
-
return N.path = `${
|
|
2496
|
+
return N.path = `${$ || d.nid}:${q}`, d.skipEscape = !0, N;
|
|
2497
2497
|
}
|
|
2498
2498
|
function p(o, d) {
|
|
2499
2499
|
const y = o;
|
|
@@ -2545,7 +2545,7 @@ function Xi() {
|
|
|
2545
2545
|
}
|
|
2546
2546
|
var Cn;
|
|
2547
2547
|
function Zi() {
|
|
2548
|
-
if (Cn) return
|
|
2548
|
+
if (Cn) return Ye.exports;
|
|
2549
2549
|
Cn = 1;
|
|
2550
2550
|
const { normalizeIPv6: e, normalizeIPv4: t, removeDotSegments: r, recomposeAuthority: n, normalizeComponentEncoding: s } = Gi(), a = Xi();
|
|
2551
2551
|
function i(u, f) {
|
|
@@ -2578,12 +2578,12 @@ function Zi() {
|
|
|
2578
2578
|
resourceName: u.resourceName,
|
|
2579
2579
|
secure: u.secure,
|
|
2580
2580
|
error: ""
|
|
2581
|
-
}, d = Object.assign({}, f), y = [],
|
|
2582
|
-
|
|
2581
|
+
}, d = Object.assign({}, f), y = [], $ = a[(d.scheme || o.scheme || "").toLowerCase()];
|
|
2582
|
+
$ && $.serialize && $.serialize(o, d), o.path !== void 0 && (d.skipEscape ? o.path = unescape(o.path) : (o.path = escape(o.path), o.scheme !== void 0 && (o.path = o.path.split("%3A").join(":")))), d.reference !== "suffix" && o.scheme && y.push(o.scheme, ":");
|
|
2583
2583
|
const _ = n(o);
|
|
2584
2584
|
if (_ !== void 0 && (d.reference !== "suffix" && y.push("//"), y.push(_), o.path && o.path.charAt(0) !== "/" && y.push("/")), o.path !== void 0) {
|
|
2585
2585
|
let P = o.path;
|
|
2586
|
-
!d.absolutePath && (
|
|
2586
|
+
!d.absolutePath && (!$ || !$.absolutePath) && (P = r(P)), _ === void 0 && (P = P.replace(/^\/\//u, "/%2F")), y.push(P);
|
|
2587
2587
|
}
|
|
2588
2588
|
return o.query !== void 0 && y.push("?", o.query), o.fragment !== void 0 && y.push("#", o.fragment), y.join("");
|
|
2589
2589
|
}
|
|
@@ -2606,7 +2606,7 @@ function Zi() {
|
|
|
2606
2606
|
query: void 0,
|
|
2607
2607
|
fragment: void 0
|
|
2608
2608
|
}, y = u.indexOf("%") !== -1;
|
|
2609
|
-
let
|
|
2609
|
+
let $ = !1;
|
|
2610
2610
|
o.reference === "suffix" && (u = (o.scheme ? o.scheme + ":" : "") + "//" + u);
|
|
2611
2611
|
const _ = u.match(w);
|
|
2612
2612
|
if (_) {
|
|
@@ -2614,13 +2614,13 @@ function Zi() {
|
|
|
2614
2614
|
const N = t(d.host);
|
|
2615
2615
|
if (N.isIPV4 === !1) {
|
|
2616
2616
|
const q = e(N.host);
|
|
2617
|
-
d.host = q.host.toLowerCase(),
|
|
2617
|
+
d.host = q.host.toLowerCase(), $ = q.isIPV6;
|
|
2618
2618
|
} else
|
|
2619
|
-
d.host = N.host,
|
|
2619
|
+
d.host = N.host, $ = !0;
|
|
2620
2620
|
}
|
|
2621
2621
|
d.scheme === void 0 && d.userinfo === void 0 && d.host === void 0 && d.port === void 0 && d.query === void 0 && !d.path ? d.reference = "same-document" : d.scheme === void 0 ? d.reference = "relative" : d.fragment === void 0 ? d.reference = "absolute" : d.reference = "uri", o.reference && o.reference !== "suffix" && o.reference !== d.reference && (d.error = d.error || "URI is not a " + o.reference + " reference.");
|
|
2622
2622
|
const P = a[(o.scheme || d.scheme || "").toLowerCase()];
|
|
2623
|
-
if (!o.unicodeSupport && (!P || !P.unicodeSupport) && d.host && (o.domainHost || P && P.domainHost) &&
|
|
2623
|
+
if (!o.unicodeSupport && (!P || !P.unicodeSupport) && d.host && (o.domainHost || P && P.domainHost) && $ === !1 && g(d.host))
|
|
2624
2624
|
try {
|
|
2625
2625
|
d.host = URL.domainToASCII(d.host.toLowerCase());
|
|
2626
2626
|
} catch (N) {
|
|
@@ -2640,10 +2640,10 @@ function Zi() {
|
|
|
2640
2640
|
serialize: m,
|
|
2641
2641
|
parse: S
|
|
2642
2642
|
};
|
|
2643
|
-
return
|
|
2643
|
+
return Ye.exports = h, Ye.exports.default = h, Ye.exports.fastUri = h, Ye.exports;
|
|
2644
2644
|
}
|
|
2645
2645
|
var Tn;
|
|
2646
|
-
function
|
|
2646
|
+
function Yi() {
|
|
2647
2647
|
if (Tn) return lt;
|
|
2648
2648
|
Tn = 1, Object.defineProperty(lt, "__esModule", { value: !0 });
|
|
2649
2649
|
const e = Zi();
|
|
@@ -2671,7 +2671,7 @@ function Jr() {
|
|
|
2671
2671
|
} }), Object.defineProperty(e, "CodeGen", { enumerable: !0, get: function() {
|
|
2672
2672
|
return r.CodeGen;
|
|
2673
2673
|
} });
|
|
2674
|
-
const n = at(), s = He(), a = ds(), i = hr(), c = H(), l = pr(), p = or(), m = Q(), b = Ji, g =
|
|
2674
|
+
const n = at(), s = He(), a = ds(), i = hr(), c = H(), l = pr(), p = or(), m = Q(), b = Ji, g = Yi(), w = (M, O) => new RegExp(M, O);
|
|
2675
2675
|
w.code = "new RegExp";
|
|
2676
2676
|
const S = ["removeAdditional", "useDefaults", "coerceTypes"], h = /* @__PURE__ */ new Set([
|
|
2677
2677
|
"validate",
|
|
@@ -2709,11 +2709,11 @@ function Jr() {
|
|
|
2709
2709
|
unicode: '"minLength"/"maxLength" account for unicode characters by default.'
|
|
2710
2710
|
}, o = 200;
|
|
2711
2711
|
function d(M) {
|
|
2712
|
-
var O, C, k,
|
|
2713
|
-
const Ge = M.strict, $r = (O = M.code) === null || O === void 0 ? void 0 : O.optimize, nn = $r === !0 || $r === void 0 ? 1 : $r || 0, an = (k = (C = M.code) === null || C === void 0 ? void 0 : C.regExp) !== null && k !== void 0 ? k : w, Hs = (
|
|
2712
|
+
var O, C, k, v, j, R, F, V, X, G, E, A, T, z, B, x, ue, we, ge, ve, le, De, _e, gr, vr;
|
|
2713
|
+
const Ge = M.strict, $r = (O = M.code) === null || O === void 0 ? void 0 : O.optimize, nn = $r === !0 || $r === void 0 ? 1 : $r || 0, an = (k = (C = M.code) === null || C === void 0 ? void 0 : C.regExp) !== null && k !== void 0 ? k : w, Hs = (v = M.uriResolver) !== null && v !== void 0 ? v : g.default;
|
|
2714
2714
|
return {
|
|
2715
2715
|
strictSchema: (R = (j = M.strictSchema) !== null && j !== void 0 ? j : Ge) !== null && R !== void 0 ? R : !0,
|
|
2716
|
-
strictNumbers: (
|
|
2716
|
+
strictNumbers: (V = (F = M.strictNumbers) !== null && F !== void 0 ? F : Ge) !== null && V !== void 0 ? V : !0,
|
|
2717
2717
|
strictTypes: (G = (X = M.strictTypes) !== null && X !== void 0 ? X : Ge) !== null && G !== void 0 ? G : "log",
|
|
2718
2718
|
strictTuples: (A = (E = M.strictTuples) !== null && E !== void 0 ? E : Ge) !== null && A !== void 0 ? A : "log",
|
|
2719
2719
|
strictRequired: (z = (T = M.strictRequired) !== null && T !== void 0 ? T : Ge) !== null && z !== void 0 ? z : !1,
|
|
@@ -2725,7 +2725,7 @@ function Jr() {
|
|
|
2725
2725
|
inlineRefs: (ge = M.inlineRefs) !== null && ge !== void 0 ? ge : !0,
|
|
2726
2726
|
schemaId: (ve = M.schemaId) !== null && ve !== void 0 ? ve : "$id",
|
|
2727
2727
|
addUsedSchema: (le = M.addUsedSchema) !== null && le !== void 0 ? le : !0,
|
|
2728
|
-
validateSchema: (
|
|
2728
|
+
validateSchema: (De = M.validateSchema) !== null && De !== void 0 ? De : !0,
|
|
2729
2729
|
validateFormats: (_e = M.validateFormats) !== null && _e !== void 0 ? _e : !0,
|
|
2730
2730
|
unicodeRegExp: (gr = M.unicodeRegExp) !== null && gr !== void 0 ? gr : !0,
|
|
2731
2731
|
int32range: (vr = M.int32range) !== null && vr !== void 0 ? vr : !0,
|
|
@@ -2736,17 +2736,17 @@ function Jr() {
|
|
|
2736
2736
|
constructor(O = {}) {
|
|
2737
2737
|
this.schemas = {}, this.refs = {}, this.formats = {}, this._compilations = /* @__PURE__ */ new Set(), this._loading = {}, this._cache = /* @__PURE__ */ new Map(), O = this.opts = { ...O, ...d(O) };
|
|
2738
2738
|
const { es5: C, lines: k } = this.opts.code;
|
|
2739
|
-
this.scope = new c.ValueScope({ scope: {}, prefixes: h, es5: C, lines: k }), this.logger =
|
|
2740
|
-
const
|
|
2741
|
-
O.validateFormats = !1, this.RULES = (0, a.getRules)(),
|
|
2739
|
+
this.scope = new c.ValueScope({ scope: {}, prefixes: h, es5: C, lines: k }), this.logger = D(O.logger);
|
|
2740
|
+
const v = O.validateFormats;
|
|
2741
|
+
O.validateFormats = !1, this.RULES = (0, a.getRules)(), $.call(this, u, O, "NOT SUPPORTED"), $.call(this, f, O, "DEPRECATED", "warn"), this._metaOpts = L.call(this), O.formats && N.call(this), this._addVocabularies(), this._addDefaultMetaSchema(), O.keywords && q.call(this, O.keywords), typeof O.meta == "object" && this.addMetaSchema(O.meta), P.call(this), O.validateFormats = v;
|
|
2742
2742
|
}
|
|
2743
2743
|
_addVocabularies() {
|
|
2744
2744
|
this.addKeyword("$async");
|
|
2745
2745
|
}
|
|
2746
2746
|
_addDefaultMetaSchema() {
|
|
2747
2747
|
const { $data: O, meta: C, schemaId: k } = this.opts;
|
|
2748
|
-
let
|
|
2749
|
-
k === "id" && (
|
|
2748
|
+
let v = b;
|
|
2749
|
+
k === "id" && (v = { ...b }, v.id = v.$id, delete v.$id), C && O && this.addMetaSchema(v, v[k], !1);
|
|
2750
2750
|
}
|
|
2751
2751
|
defaultMeta() {
|
|
2752
2752
|
const { meta: O, schemaId: C } = this.opts;
|
|
@@ -2759,8 +2759,8 @@ function Jr() {
|
|
|
2759
2759
|
throw new Error(`no schema with key or ref "${O}"`);
|
|
2760
2760
|
} else
|
|
2761
2761
|
k = this.compile(O);
|
|
2762
|
-
const
|
|
2763
|
-
return "$async" in k || (this.errors = k.errors),
|
|
2762
|
+
const v = k(C);
|
|
2763
|
+
return "$async" in k || (this.errors = k.errors), v;
|
|
2764
2764
|
}
|
|
2765
2765
|
compile(O, C) {
|
|
2766
2766
|
const k = this._addSchema(O, C);
|
|
@@ -2770,14 +2770,14 @@ function Jr() {
|
|
|
2770
2770
|
if (typeof this.opts.loadSchema != "function")
|
|
2771
2771
|
throw new Error("options.loadSchema should be a function");
|
|
2772
2772
|
const { loadSchema: k } = this.opts;
|
|
2773
|
-
return
|
|
2774
|
-
async function
|
|
2773
|
+
return v.call(this, O, C);
|
|
2774
|
+
async function v(G, E) {
|
|
2775
2775
|
await j.call(this, G.$schema);
|
|
2776
2776
|
const A = this._addSchema(G, E);
|
|
2777
2777
|
return A.validate || R.call(this, A);
|
|
2778
2778
|
}
|
|
2779
2779
|
async function j(G) {
|
|
2780
|
-
G && !this.getSchema(G) && await
|
|
2780
|
+
G && !this.getSchema(G) && await v.call(this, { $ref: G }, !0);
|
|
2781
2781
|
}
|
|
2782
2782
|
async function R(G) {
|
|
2783
2783
|
try {
|
|
@@ -2785,14 +2785,14 @@ function Jr() {
|
|
|
2785
2785
|
} catch (E) {
|
|
2786
2786
|
if (!(E instanceof s.default))
|
|
2787
2787
|
throw E;
|
|
2788
|
-
return F.call(this, E), await
|
|
2788
|
+
return F.call(this, E), await V.call(this, E.missingSchema), R.call(this, G);
|
|
2789
2789
|
}
|
|
2790
2790
|
}
|
|
2791
2791
|
function F({ missingSchema: G, missingRef: E }) {
|
|
2792
2792
|
if (this.refs[G])
|
|
2793
2793
|
throw new Error(`AnySchema ${G} is loaded but ${E} cannot be resolved`);
|
|
2794
2794
|
}
|
|
2795
|
-
async function
|
|
2795
|
+
async function V(G) {
|
|
2796
2796
|
const E = await X.call(this, G);
|
|
2797
2797
|
this.refs[G] || await j.call(this, E.$schema), this.refs[G] || this.addSchema(E, G, C);
|
|
2798
2798
|
}
|
|
@@ -2808,10 +2808,10 @@ function Jr() {
|
|
|
2808
2808
|
}
|
|
2809
2809
|
}
|
|
2810
2810
|
// Adds schema to the instance
|
|
2811
|
-
addSchema(O, C, k,
|
|
2811
|
+
addSchema(O, C, k, v = this.opts.validateSchema) {
|
|
2812
2812
|
if (Array.isArray(O)) {
|
|
2813
2813
|
for (const R of O)
|
|
2814
|
-
this.addSchema(R, void 0, k,
|
|
2814
|
+
this.addSchema(R, void 0, k, v);
|
|
2815
2815
|
return this;
|
|
2816
2816
|
}
|
|
2817
2817
|
let j;
|
|
@@ -2820,7 +2820,7 @@ function Jr() {
|
|
|
2820
2820
|
if (j = O[R], j !== void 0 && typeof j != "string")
|
|
2821
2821
|
throw new Error(`schema ${R} must be string`);
|
|
2822
2822
|
}
|
|
2823
|
-
return C = (0, l.normalizeId)(C || j), this._checkUnique(C), this.schemas[C] = this._addSchema(O, k, C,
|
|
2823
|
+
return C = (0, l.normalizeId)(C || j), this._checkUnique(C), this.schemas[C] = this._addSchema(O, k, C, v, !0), this;
|
|
2824
2824
|
}
|
|
2825
2825
|
// Add schema that will be used to validate other schemas
|
|
2826
2826
|
// options in META_IGNORE_OPTIONS are alway set to false
|
|
@@ -2836,15 +2836,15 @@ function Jr() {
|
|
|
2836
2836
|
throw new Error("$schema must be a string");
|
|
2837
2837
|
if (k = k || this.opts.defaultMeta || this.defaultMeta(), !k)
|
|
2838
2838
|
return this.logger.warn("meta-schema not available"), this.errors = null, !0;
|
|
2839
|
-
const
|
|
2840
|
-
if (
|
|
2839
|
+
const v = this.validate(k, O);
|
|
2840
|
+
if (!v && C) {
|
|
2841
2841
|
const j = "schema is invalid: " + this.errorsText();
|
|
2842
2842
|
if (this.opts.validateSchema === "log")
|
|
2843
2843
|
this.logger.error(j);
|
|
2844
2844
|
else
|
|
2845
2845
|
throw new Error(j);
|
|
2846
2846
|
}
|
|
2847
|
-
return
|
|
2847
|
+
return v;
|
|
2848
2848
|
}
|
|
2849
2849
|
// Get compiled schema by `key` or `ref`.
|
|
2850
2850
|
// (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id)
|
|
@@ -2853,8 +2853,8 @@ function Jr() {
|
|
|
2853
2853
|
for (; typeof (C = _.call(this, O)) == "string"; )
|
|
2854
2854
|
O = C;
|
|
2855
2855
|
if (C === void 0) {
|
|
2856
|
-
const { schemaId: k } = this.opts,
|
|
2857
|
-
if (C = i.resolveSchema.call(this,
|
|
2856
|
+
const { schemaId: k } = this.opts, v = new i.SchemaEnv({ schema: {}, schemaId: k });
|
|
2857
|
+
if (C = i.resolveSchema.call(this, v, O), !C)
|
|
2858
2858
|
return;
|
|
2859
2859
|
this.refs[O] = C;
|
|
2860
2860
|
}
|
|
@@ -2901,13 +2901,13 @@ function Jr() {
|
|
|
2901
2901
|
throw new Error("invalid addKeywords parameters");
|
|
2902
2902
|
if (W.call(this, k, C), !C)
|
|
2903
2903
|
return (0, m.eachItem)(k, (j) => ee.call(this, j)), this;
|
|
2904
|
-
|
|
2905
|
-
const
|
|
2904
|
+
re.call(this, C);
|
|
2905
|
+
const v = {
|
|
2906
2906
|
...C,
|
|
2907
2907
|
type: (0, p.getJSONTypes)(C.type),
|
|
2908
2908
|
schemaType: (0, p.getJSONTypes)(C.schemaType)
|
|
2909
2909
|
};
|
|
2910
|
-
return (0, m.eachItem)(k,
|
|
2910
|
+
return (0, m.eachItem)(k, v.type.length === 0 ? (j) => ee.call(this, j, v) : (j) => v.type.forEach((R) => ee.call(this, j, v, R))), this;
|
|
2911
2911
|
}
|
|
2912
2912
|
getKeyword(O) {
|
|
2913
2913
|
const C = this.RULES.all[O];
|
|
@@ -2918,8 +2918,8 @@ function Jr() {
|
|
|
2918
2918
|
const { RULES: C } = this;
|
|
2919
2919
|
delete C.keywords[O], delete C.all[O];
|
|
2920
2920
|
for (const k of C.rules) {
|
|
2921
|
-
const
|
|
2922
|
-
|
|
2921
|
+
const v = k.rules.findIndex((j) => j.keyword === O);
|
|
2922
|
+
v >= 0 && k.rules.splice(v, 1);
|
|
2923
2923
|
}
|
|
2924
2924
|
return this;
|
|
2925
2925
|
}
|
|
@@ -2928,33 +2928,33 @@ function Jr() {
|
|
|
2928
2928
|
return typeof C == "string" && (C = new RegExp(C)), this.formats[O] = C, this;
|
|
2929
2929
|
}
|
|
2930
2930
|
errorsText(O = this.errors, { separator: C = ", ", dataVar: k = "data" } = {}) {
|
|
2931
|
-
return !O || O.length === 0 ? "No errors" : O.map((
|
|
2931
|
+
return !O || O.length === 0 ? "No errors" : O.map((v) => `${k}${v.instancePath} ${v.message}`).reduce((v, j) => v + C + j);
|
|
2932
2932
|
}
|
|
2933
2933
|
$dataMetaSchema(O, C) {
|
|
2934
2934
|
const k = this.RULES.all;
|
|
2935
2935
|
O = JSON.parse(JSON.stringify(O));
|
|
2936
|
-
for (const
|
|
2937
|
-
const j =
|
|
2936
|
+
for (const v of C) {
|
|
2937
|
+
const j = v.split("/").slice(1);
|
|
2938
2938
|
let R = O;
|
|
2939
2939
|
for (const F of j)
|
|
2940
2940
|
R = R[F];
|
|
2941
2941
|
for (const F in k) {
|
|
2942
|
-
const
|
|
2943
|
-
if (typeof
|
|
2942
|
+
const V = k[F];
|
|
2943
|
+
if (typeof V != "object")
|
|
2944
2944
|
continue;
|
|
2945
|
-
const { $data: X } =
|
|
2946
|
-
X && G && (R[F] =
|
|
2945
|
+
const { $data: X } = V.definition, G = R[F];
|
|
2946
|
+
X && G && (R[F] = se(G));
|
|
2947
2947
|
}
|
|
2948
2948
|
}
|
|
2949
2949
|
return O;
|
|
2950
2950
|
}
|
|
2951
2951
|
_removeAllSchemas(O, C) {
|
|
2952
2952
|
for (const k in O) {
|
|
2953
|
-
const
|
|
2954
|
-
(!C || C.test(k)) && (typeof
|
|
2953
|
+
const v = O[k];
|
|
2954
|
+
(!C || C.test(k)) && (typeof v == "string" ? delete O[k] : v && !v.meta && (this._cache.delete(v.schema), delete O[k]));
|
|
2955
2955
|
}
|
|
2956
2956
|
}
|
|
2957
|
-
_addSchema(O, C, k,
|
|
2957
|
+
_addSchema(O, C, k, v = this.opts.validateSchema, j = this.opts.addUsedSchema) {
|
|
2958
2958
|
let R;
|
|
2959
2959
|
const { schemaId: F } = this.opts;
|
|
2960
2960
|
if (typeof O == "object")
|
|
@@ -2965,12 +2965,12 @@ function Jr() {
|
|
|
2965
2965
|
if (typeof O != "boolean")
|
|
2966
2966
|
throw new Error("schema must be object or boolean");
|
|
2967
2967
|
}
|
|
2968
|
-
let
|
|
2969
|
-
if (
|
|
2970
|
-
return
|
|
2968
|
+
let V = this._cache.get(O);
|
|
2969
|
+
if (V !== void 0)
|
|
2970
|
+
return V;
|
|
2971
2971
|
k = (0, l.normalizeId)(R || k);
|
|
2972
2972
|
const X = l.getSchemaRefs.call(this, O, k);
|
|
2973
|
-
return
|
|
2973
|
+
return V = new i.SchemaEnv({ schema: O, schemaId: F, meta: C, baseId: k, localRefs: X }), this._cache.set(V.schema, V), j && !k.startsWith("#") && (k && this._checkUnique(k), this.refs[k] = V), v && this.validateSchema(O, !0), V;
|
|
2974
2974
|
}
|
|
2975
2975
|
_checkUnique(O) {
|
|
2976
2976
|
if (this.schemas[O] || this.refs[O])
|
|
@@ -2992,10 +2992,10 @@ function Jr() {
|
|
|
2992
2992
|
}
|
|
2993
2993
|
}
|
|
2994
2994
|
y.ValidationError = n.default, y.MissingRefError = s.default, e.default = y;
|
|
2995
|
-
function
|
|
2996
|
-
for (const
|
|
2997
|
-
const j =
|
|
2998
|
-
j in O && this.logger[k](`${C}: option ${
|
|
2995
|
+
function $(M, O, C, k = "error") {
|
|
2996
|
+
for (const v in M) {
|
|
2997
|
+
const j = v;
|
|
2998
|
+
j in O && this.logger[k](`${C}: option ${v}. ${M[j]}`);
|
|
2999
2999
|
}
|
|
3000
3000
|
}
|
|
3001
3001
|
function _(M) {
|
|
@@ -3027,7 +3027,7 @@ function Jr() {
|
|
|
3027
3027
|
C.keyword || (C.keyword = O), this.addKeyword(C);
|
|
3028
3028
|
}
|
|
3029
3029
|
}
|
|
3030
|
-
function
|
|
3030
|
+
function L() {
|
|
3031
3031
|
const M = { ...this.opts };
|
|
3032
3032
|
for (const O of S)
|
|
3033
3033
|
delete M[O];
|
|
@@ -3037,7 +3037,7 @@ function Jr() {
|
|
|
3037
3037
|
}, warn() {
|
|
3038
3038
|
}, error() {
|
|
3039
3039
|
} };
|
|
3040
|
-
function
|
|
3040
|
+
function D(M) {
|
|
3041
3041
|
if (M === !1)
|
|
3042
3042
|
return I;
|
|
3043
3043
|
if (M === void 0)
|
|
@@ -3046,24 +3046,24 @@ function Jr() {
|
|
|
3046
3046
|
return M;
|
|
3047
3047
|
throw new Error("logger must implement log, warn and error methods");
|
|
3048
3048
|
}
|
|
3049
|
-
const
|
|
3049
|
+
const U = /^[a-z_$][a-z0-9_$:-]*$/i;
|
|
3050
3050
|
function W(M, O) {
|
|
3051
3051
|
const { RULES: C } = this;
|
|
3052
3052
|
if ((0, m.eachItem)(M, (k) => {
|
|
3053
3053
|
if (C.keywords[k])
|
|
3054
3054
|
throw new Error(`Keyword ${k} is already defined`);
|
|
3055
|
-
if (!
|
|
3055
|
+
if (!U.test(k))
|
|
3056
3056
|
throw new Error(`Keyword ${k} has invalid name`);
|
|
3057
3057
|
}), !!O && O.$data && !("code" in O || "validate" in O))
|
|
3058
3058
|
throw new Error('$data keyword must have "code" or "validate" function');
|
|
3059
3059
|
}
|
|
3060
3060
|
function ee(M, O, C) {
|
|
3061
3061
|
var k;
|
|
3062
|
-
const
|
|
3063
|
-
if (C &&
|
|
3062
|
+
const v = O?.post;
|
|
3063
|
+
if (C && v)
|
|
3064
3064
|
throw new Error('keyword with "post" flag cannot have "type"');
|
|
3065
3065
|
const { RULES: j } = this;
|
|
3066
|
-
let R =
|
|
3066
|
+
let R = v ? j.post : j.rules.find(({ type: V }) => V === C);
|
|
3067
3067
|
if (R || (R = { type: C, rules: [] }, j.rules.push(R)), j.keywords[M] = !0, !O)
|
|
3068
3068
|
return;
|
|
3069
3069
|
const F = {
|
|
@@ -3074,26 +3074,26 @@ function Jr() {
|
|
|
3074
3074
|
schemaType: (0, p.getJSONTypes)(O.schemaType)
|
|
3075
3075
|
}
|
|
3076
3076
|
};
|
|
3077
|
-
O.before ?
|
|
3077
|
+
O.before ? oe.call(this, R, F, O.before) : R.rules.push(F), j.all[M] = F, (k = O.implements) === null || k === void 0 || k.forEach((V) => this.addKeyword(V));
|
|
3078
3078
|
}
|
|
3079
|
-
function
|
|
3080
|
-
const k = M.rules.findIndex((
|
|
3079
|
+
function oe(M, O, C) {
|
|
3080
|
+
const k = M.rules.findIndex((v) => v.keyword === C);
|
|
3081
3081
|
k >= 0 ? M.rules.splice(k, 0, O) : (M.rules.push(O), this.logger.warn(`rule ${C} is not defined`));
|
|
3082
3082
|
}
|
|
3083
|
-
function
|
|
3083
|
+
function re(M) {
|
|
3084
3084
|
let { metaSchema: O } = M;
|
|
3085
|
-
O !== void 0 && (M.$data && this.opts.$data && (O =
|
|
3085
|
+
O !== void 0 && (M.$data && this.opts.$data && (O = se(O)), M.validateSchema = this.compile(O, !0));
|
|
3086
3086
|
}
|
|
3087
|
-
const
|
|
3087
|
+
const Z = {
|
|
3088
3088
|
$ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"
|
|
3089
3089
|
};
|
|
3090
|
-
function
|
|
3091
|
-
return { anyOf: [M,
|
|
3090
|
+
function se(M) {
|
|
3091
|
+
return { anyOf: [M, Z] };
|
|
3092
3092
|
}
|
|
3093
3093
|
}(wr)), wr;
|
|
3094
3094
|
}
|
|
3095
3095
|
var dt = {}, ft = {}, mt = {}, Mn;
|
|
3096
|
-
function
|
|
3096
|
+
function xi() {
|
|
3097
3097
|
if (Mn) return mt;
|
|
3098
3098
|
Mn = 1, Object.defineProperty(mt, "__esModule", { value: !0 });
|
|
3099
3099
|
const e = {
|
|
@@ -3104,10 +3104,10 @@ function Yi() {
|
|
|
3104
3104
|
};
|
|
3105
3105
|
return mt.default = e, mt;
|
|
3106
3106
|
}
|
|
3107
|
-
var Ce = {},
|
|
3107
|
+
var Ce = {}, Vn;
|
|
3108
3108
|
function Hr() {
|
|
3109
|
-
if (
|
|
3110
|
-
|
|
3109
|
+
if (Vn) return Ce;
|
|
3110
|
+
Vn = 1, Object.defineProperty(Ce, "__esModule", { value: !0 }), Ce.callRef = Ce.getValidate = void 0;
|
|
3111
3111
|
const e = He(), t = je(), r = H(), n = Pe(), s = hr(), a = Q(), i = {
|
|
3112
3112
|
keyword: "$ref",
|
|
3113
3113
|
schemaType: "string",
|
|
@@ -3119,7 +3119,7 @@ function Hr() {
|
|
|
3119
3119
|
if (d === void 0)
|
|
3120
3120
|
throw new e.default(g.opts.uriResolver, w, b);
|
|
3121
3121
|
if (d instanceof s.SchemaEnv)
|
|
3122
|
-
return
|
|
3122
|
+
return $(d);
|
|
3123
3123
|
return _(d);
|
|
3124
3124
|
function y() {
|
|
3125
3125
|
if (S === o)
|
|
@@ -3127,19 +3127,19 @@ function Hr() {
|
|
|
3127
3127
|
const P = m.scopeValue("root", { ref: o });
|
|
3128
3128
|
return l(p, (0, r._)`${P}.validate`, o, o.$async);
|
|
3129
3129
|
}
|
|
3130
|
-
function
|
|
3130
|
+
function $(P) {
|
|
3131
3131
|
const N = c(p, P);
|
|
3132
3132
|
l(p, N, P, P.$async);
|
|
3133
3133
|
}
|
|
3134
3134
|
function _(P) {
|
|
3135
|
-
const N = m.scopeValue("schema", u.code.source === !0 ? { ref: P, code: (0, r.stringify)(P) } : { ref: P }), q = m.name("valid"),
|
|
3135
|
+
const N = m.scopeValue("schema", u.code.source === !0 ? { ref: P, code: (0, r.stringify)(P) } : { ref: P }), q = m.name("valid"), L = p.subschema({
|
|
3136
3136
|
schema: P,
|
|
3137
3137
|
dataTypes: [],
|
|
3138
3138
|
schemaPath: r.nil,
|
|
3139
3139
|
topSchemaRef: N,
|
|
3140
3140
|
errSchemaPath: b
|
|
3141
3141
|
}, q);
|
|
3142
|
-
p.mergeEvaluated(
|
|
3142
|
+
p.mergeEvaluated(L), p.ok(q);
|
|
3143
3143
|
}
|
|
3144
3144
|
}
|
|
3145
3145
|
};
|
|
@@ -3158,13 +3158,13 @@ function Hr() {
|
|
|
3158
3158
|
w.try(() => {
|
|
3159
3159
|
w.code((0, r._)`await ${(0, t.callValidateCode)(p, m, o)}`), _(m), h || w.assign(P, !0);
|
|
3160
3160
|
}, (N) => {
|
|
3161
|
-
w.if((0, r._)`!(${N} instanceof ${S.ValidationError})`, () => w.throw(N)),
|
|
3161
|
+
w.if((0, r._)`!(${N} instanceof ${S.ValidationError})`, () => w.throw(N)), $(N), h || w.assign(P, !1);
|
|
3162
3162
|
}), p.ok(P);
|
|
3163
3163
|
}
|
|
3164
3164
|
function y() {
|
|
3165
|
-
p.result((0, t.callValidateCode)(p, m, o), () => _(m), () =>
|
|
3165
|
+
p.result((0, t.callValidateCode)(p, m, o), () => _(m), () => $(m));
|
|
3166
3166
|
}
|
|
3167
|
-
function
|
|
3167
|
+
function $(P) {
|
|
3168
3168
|
const N = (0, r._)`${P}.errors`;
|
|
3169
3169
|
w.assign(n.default.vErrors, (0, r._)`${n.default.vErrors} === null ? ${N} : ${n.default.vErrors}.concat(${N})`), w.assign(n.default.errors, (0, r._)`${n.default.vErrors}.length`);
|
|
3170
3170
|
}
|
|
@@ -3177,25 +3177,25 @@ function Hr() {
|
|
|
3177
3177
|
if (q && !q.dynamicProps)
|
|
3178
3178
|
q.props !== void 0 && (S.props = a.mergeEvaluated.props(w, q.props, S.props));
|
|
3179
3179
|
else {
|
|
3180
|
-
const
|
|
3181
|
-
S.props = a.mergeEvaluated.props(w,
|
|
3180
|
+
const L = w.var("props", (0, r._)`${P}.evaluated.props`);
|
|
3181
|
+
S.props = a.mergeEvaluated.props(w, L, S.props, r.Name);
|
|
3182
3182
|
}
|
|
3183
3183
|
if (S.items !== !0)
|
|
3184
3184
|
if (q && !q.dynamicItems)
|
|
3185
3185
|
q.items !== void 0 && (S.items = a.mergeEvaluated.items(w, q.items, S.items));
|
|
3186
3186
|
else {
|
|
3187
|
-
const
|
|
3188
|
-
S.items = a.mergeEvaluated.items(w,
|
|
3187
|
+
const L = w.var("items", (0, r._)`${P}.evaluated.items`);
|
|
3188
|
+
S.items = a.mergeEvaluated.items(w, L, S.items, r.Name);
|
|
3189
3189
|
}
|
|
3190
3190
|
}
|
|
3191
3191
|
}
|
|
3192
3192
|
return Ce.callRef = l, Ce.default = i, Ce;
|
|
3193
3193
|
}
|
|
3194
|
-
var
|
|
3194
|
+
var Dn;
|
|
3195
3195
|
function ps() {
|
|
3196
|
-
if (
|
|
3197
|
-
|
|
3198
|
-
const e =
|
|
3196
|
+
if (Dn) return ft;
|
|
3197
|
+
Dn = 1, Object.defineProperty(ft, "__esModule", { value: !0 });
|
|
3198
|
+
const e = xi(), t = Hr(), r = [
|
|
3199
3199
|
"$schema",
|
|
3200
3200
|
"$id",
|
|
3201
3201
|
"$defs",
|
|
@@ -3353,7 +3353,7 @@ function so() {
|
|
|
3353
3353
|
const o = a.parentSchema.properties, { definedProperties: d } = a.it;
|
|
3354
3354
|
for (const y of c)
|
|
3355
3355
|
if (o?.[y] === void 0 && !d.has(y)) {
|
|
3356
|
-
const
|
|
3356
|
+
const $ = b.schemaEnv.baseId + b.errSchemaPath, _ = `required property "${y}" is not defined at "${$}" (strictRequired)`;
|
|
3357
3357
|
(0, r.checkStrictMode)(b, _, b.opts.strictRequired);
|
|
3358
3358
|
}
|
|
3359
3359
|
}
|
|
@@ -3438,23 +3438,23 @@ function oo() {
|
|
|
3438
3438
|
const S = c.let("valid"), h = b.items ? (0, e.getSchemaTypes)(b.items) : [];
|
|
3439
3439
|
i.block$data(S, u, (0, t._)`${g} === false`), i.ok(S);
|
|
3440
3440
|
function u() {
|
|
3441
|
-
const y = c.let("i", (0, t._)`${l}.length`),
|
|
3442
|
-
i.setParams({ i: y, j:
|
|
3441
|
+
const y = c.let("i", (0, t._)`${l}.length`), $ = c.let("j");
|
|
3442
|
+
i.setParams({ i: y, j: $ }), c.assign(S, !0), c.if((0, t._)`${y} > 1`, () => (f() ? o : d)(y, $));
|
|
3443
3443
|
}
|
|
3444
3444
|
function f() {
|
|
3445
3445
|
return h.length > 0 && !h.some((y) => y === "object" || y === "array");
|
|
3446
3446
|
}
|
|
3447
|
-
function o(y,
|
|
3447
|
+
function o(y, $) {
|
|
3448
3448
|
const _ = c.name("item"), P = (0, e.checkDataTypes)(h, _, w.opts.strictNumbers, e.DataType.Wrong), N = c.const("indices", (0, t._)`{}`);
|
|
3449
3449
|
c.for((0, t._)`;${y}--;`, () => {
|
|
3450
3450
|
c.let(_, (0, t._)`${l}[${y}]`), c.if(P, (0, t._)`continue`), h.length > 1 && c.if((0, t._)`typeof ${_} == "string"`, (0, t._)`${_} += "_"`), c.if((0, t._)`typeof ${N}[${_}] == "number"`, () => {
|
|
3451
|
-
c.assign(
|
|
3451
|
+
c.assign($, (0, t._)`${N}[${_}]`), i.error(), c.assign(S, !1).break();
|
|
3452
3452
|
}).code((0, t._)`${N}[${_}] = ${y}`);
|
|
3453
3453
|
});
|
|
3454
3454
|
}
|
|
3455
|
-
function d(y,
|
|
3455
|
+
function d(y, $) {
|
|
3456
3456
|
const _ = (0, r.useFunc)(c, n.default), P = c.name("outer");
|
|
3457
|
-
c.label(P).for((0, t._)`;${y}--;`, () => c.for((0, t._)`${
|
|
3457
|
+
c.label(P).for((0, t._)`;${y}--;`, () => c.for((0, t._)`${$} = ${y}; ${$}--;`, () => c.if((0, t._)`${_}(${l}[${y}], ${l}[${$}])`, () => {
|
|
3458
3458
|
i.error(), c.assign(S, !1).break(P);
|
|
3459
3459
|
})));
|
|
3460
3460
|
}
|
|
@@ -3520,10 +3520,10 @@ function uo() {
|
|
|
3520
3520
|
};
|
|
3521
3521
|
return Et.default = s, Et;
|
|
3522
3522
|
}
|
|
3523
|
-
var
|
|
3523
|
+
var Yn;
|
|
3524
3524
|
function hs() {
|
|
3525
|
-
if (
|
|
3526
|
-
|
|
3525
|
+
if (Yn) return pt;
|
|
3526
|
+
Yn = 1, Object.defineProperty(pt, "__esModule", { value: !0 });
|
|
3527
3527
|
const e = Qi(), t = eo(), r = ro(), n = no(), s = ao(), a = so(), i = io(), c = oo(), l = co(), p = uo(), m = [
|
|
3528
3528
|
// number
|
|
3529
3529
|
e.default,
|
|
@@ -3545,10 +3545,10 @@ function hs() {
|
|
|
3545
3545
|
];
|
|
3546
3546
|
return pt.default = m, pt;
|
|
3547
3547
|
}
|
|
3548
|
-
var Ot = {}, Fe = {},
|
|
3548
|
+
var Ot = {}, Fe = {}, xn;
|
|
3549
3549
|
function ys() {
|
|
3550
|
-
if (
|
|
3551
|
-
|
|
3550
|
+
if (xn) return Fe;
|
|
3551
|
+
xn = 1, Object.defineProperty(Fe, "__esModule", { value: !0 }), Fe.validateAdditionalItems = void 0;
|
|
3552
3552
|
const e = H(), t = Q(), n = {
|
|
3553
3553
|
keyword: "additionalItems",
|
|
3554
3554
|
type: "array",
|
|
@@ -3615,8 +3615,8 @@ function gs() {
|
|
|
3615
3615
|
function h(u) {
|
|
3616
3616
|
const { opts: f, errSchemaPath: o } = g, d = c.length, y = d === u.minItems && (d === u.maxItems || u[i] === !1);
|
|
3617
3617
|
if (f.strictTuples && !y) {
|
|
3618
|
-
const
|
|
3619
|
-
(0, t.checkStrictMode)(g,
|
|
3618
|
+
const $ = `"${b}" is ${d}-tuple, but minItems or maxItems/${i} are not specified or different at path "${o}"`;
|
|
3619
|
+
(0, t.checkStrictMode)(g, $, f.strictTuples);
|
|
3620
3620
|
}
|
|
3621
3621
|
}
|
|
3622
3622
|
}
|
|
@@ -3696,10 +3696,10 @@ function mo() {
|
|
|
3696
3696
|
f(d, () => a.if(d, () => o(y)));
|
|
3697
3697
|
}
|
|
3698
3698
|
function f(d, y) {
|
|
3699
|
-
a.forRange("i", 0, S, (
|
|
3699
|
+
a.forRange("i", 0, S, ($) => {
|
|
3700
3700
|
s.subschema({
|
|
3701
3701
|
keyword: "contains",
|
|
3702
|
-
dataProp:
|
|
3702
|
+
dataProp: $,
|
|
3703
3703
|
dataPropType: t.Type.Num,
|
|
3704
3704
|
compositeRule: !0
|
|
3705
3705
|
}, d), y();
|
|
@@ -3867,12 +3867,12 @@ function vs() {
|
|
|
3867
3867
|
}
|
|
3868
3868
|
if (typeof l == "object" && !(0, n.alwaysValidSchema)(g, l)) {
|
|
3869
3869
|
const P = c.name("valid");
|
|
3870
|
-
S.removeAdditional === "failing" ? (
|
|
3870
|
+
S.removeAdditional === "failing" ? ($(_, P, !1), c.if((0, t.not)(P), () => {
|
|
3871
3871
|
i.reset(), d(_);
|
|
3872
|
-
})) : (
|
|
3872
|
+
})) : ($(_, P), w || c.if((0, t.not)(P), () => c.break()));
|
|
3873
3873
|
}
|
|
3874
3874
|
}
|
|
3875
|
-
function
|
|
3875
|
+
function $(_, P, N) {
|
|
3876
3876
|
const q = {
|
|
3877
3877
|
keyword: "additionalProperties",
|
|
3878
3878
|
dataProp: _,
|
|
@@ -3944,19 +3944,19 @@ function yo() {
|
|
|
3944
3944
|
S && o(y), m.allErrors ? d(y) : (i.var(h, !0), d(y), i.if(h));
|
|
3945
3945
|
}
|
|
3946
3946
|
function o(y) {
|
|
3947
|
-
for (const
|
|
3948
|
-
new RegExp(y).test(
|
|
3947
|
+
for (const $ in S)
|
|
3948
|
+
new RegExp(y).test($) && (0, r.checkStrictMode)(m, `property ${$} matches pattern ${y} (use allowMatchingProperties)`);
|
|
3949
3949
|
}
|
|
3950
3950
|
function d(y) {
|
|
3951
|
-
i.forIn("key", l, (
|
|
3952
|
-
i.if((0, t._)`${(0, e.usePattern)(a, y)}.test(${
|
|
3951
|
+
i.forIn("key", l, ($) => {
|
|
3952
|
+
i.if((0, t._)`${(0, e.usePattern)(a, y)}.test(${$})`, () => {
|
|
3953
3953
|
const _ = w.includes(y);
|
|
3954
3954
|
_ || a.subschema({
|
|
3955
3955
|
keyword: "patternProperties",
|
|
3956
3956
|
schemaProp: y,
|
|
3957
|
-
dataProp:
|
|
3957
|
+
dataProp: $,
|
|
3958
3958
|
dataPropType: n.Type.Str
|
|
3959
|
-
}, h), m.opts.unevaluated && u !== !0 ? i.assign((0, t._)`${u}[${
|
|
3959
|
+
}, h), m.opts.unevaluated && u !== !0 ? i.assign((0, t._)`${u}[${$}]`, !0) : !_ && !m.allErrors && i.if((0, t.not)(h), () => i.break());
|
|
3960
3960
|
});
|
|
3961
3961
|
});
|
|
3962
3962
|
}
|
|
@@ -4003,10 +4003,10 @@ function vo() {
|
|
|
4003
4003
|
};
|
|
4004
4004
|
return Mt.default = t, Mt;
|
|
4005
4005
|
}
|
|
4006
|
-
var
|
|
4006
|
+
var Vt = {}, la;
|
|
4007
4007
|
function $o() {
|
|
4008
|
-
if (la) return
|
|
4009
|
-
la = 1, Object.defineProperty(
|
|
4008
|
+
if (la) return Vt;
|
|
4009
|
+
la = 1, Object.defineProperty(Vt, "__esModule", { value: !0 });
|
|
4010
4010
|
const e = H(), t = Q(), n = {
|
|
4011
4011
|
keyword: "oneOf",
|
|
4012
4012
|
schemaType: "array",
|
|
@@ -4037,12 +4037,12 @@ function $o() {
|
|
|
4037
4037
|
}
|
|
4038
4038
|
}
|
|
4039
4039
|
};
|
|
4040
|
-
return
|
|
4040
|
+
return Vt.default = n, Vt;
|
|
4041
4041
|
}
|
|
4042
|
-
var
|
|
4042
|
+
var Dt = {}, da;
|
|
4043
4043
|
function bo() {
|
|
4044
|
-
if (da) return
|
|
4045
|
-
da = 1, Object.defineProperty(
|
|
4044
|
+
if (da) return Dt;
|
|
4045
|
+
da = 1, Object.defineProperty(Dt, "__esModule", { value: !0 });
|
|
4046
4046
|
const e = Q(), t = {
|
|
4047
4047
|
keyword: "allOf",
|
|
4048
4048
|
schemaType: "array",
|
|
@@ -4059,7 +4059,7 @@ function bo() {
|
|
|
4059
4059
|
});
|
|
4060
4060
|
}
|
|
4061
4061
|
};
|
|
4062
|
-
return
|
|
4062
|
+
return Dt.default = t, Dt;
|
|
4063
4063
|
}
|
|
4064
4064
|
var zt = {}, fa;
|
|
4065
4065
|
function _o() {
|
|
@@ -4169,8 +4169,8 @@ function So() {
|
|
|
4169
4169
|
ref: S.formats,
|
|
4170
4170
|
code: b.code.formats
|
|
4171
4171
|
}), o = a.const("fDef", (0, e._)`${f}[${p}]`), d = a.let("fType"), y = a.let("format");
|
|
4172
|
-
a.if((0, e._)`typeof ${o} == "object" && !(${o} instanceof RegExp)`, () => a.assign(d, (0, e._)`${o}.type || "string"`).assign(y, (0, e._)`${o}.validate`), () => a.assign(d, (0, e._)`"string"`).assign(y, o)), n.fail$data((0, e.or)(
|
|
4173
|
-
function
|
|
4172
|
+
a.if((0, e._)`typeof ${o} == "object" && !(${o} instanceof RegExp)`, () => a.assign(d, (0, e._)`${o}.type || "string"`).assign(y, (0, e._)`${o}.validate`), () => a.assign(d, (0, e._)`"string"`).assign(y, o)), n.fail$data((0, e.or)($(), _()));
|
|
4173
|
+
function $() {
|
|
4174
4174
|
return b.strictSchema === !1 ? e.nil : (0, e._)`${p} && !${y}`;
|
|
4175
4175
|
}
|
|
4176
4176
|
function _() {
|
|
@@ -4181,14 +4181,14 @@ function So() {
|
|
|
4181
4181
|
function u() {
|
|
4182
4182
|
const f = S.formats[l];
|
|
4183
4183
|
if (!f) {
|
|
4184
|
-
|
|
4184
|
+
$();
|
|
4185
4185
|
return;
|
|
4186
4186
|
}
|
|
4187
4187
|
if (f === !0)
|
|
4188
4188
|
return;
|
|
4189
4189
|
const [o, d, y] = _(f);
|
|
4190
4190
|
o === s && n.pass(P());
|
|
4191
|
-
function
|
|
4191
|
+
function $() {
|
|
4192
4192
|
if (b.strictSchema === !1) {
|
|
4193
4193
|
S.logger.warn(N());
|
|
4194
4194
|
return;
|
|
@@ -4199,8 +4199,8 @@ function So() {
|
|
|
4199
4199
|
}
|
|
4200
4200
|
}
|
|
4201
4201
|
function _(N) {
|
|
4202
|
-
const q = N instanceof RegExp ? (0, e.regexpCode)(N) : b.code.formats ? (0, e._)`${b.code.formats}${(0, e.getProperty)(l)}` : void 0,
|
|
4203
|
-
return typeof N == "object" && !(N instanceof RegExp) ? [N.type || "string", N.validate, (0, e._)`${
|
|
4202
|
+
const q = N instanceof RegExp ? (0, e.regexpCode)(N) : b.code.formats ? (0, e._)`${b.code.formats}${(0, e.getProperty)(l)}` : void 0, L = a.scopeValue("formats", { key: l, ref: N, code: q });
|
|
4203
|
+
return typeof N == "object" && !(N instanceof RegExp) ? [N.type || "string", N.validate, (0, e._)`${L}.validate`] : ["string", N, L];
|
|
4204
4204
|
}
|
|
4205
4205
|
function P() {
|
|
4206
4206
|
if (typeof f == "object" && !(f instanceof RegExp) && f.async) {
|
|
@@ -4252,14 +4252,14 @@ function ws() {
|
|
|
4252
4252
|
];
|
|
4253
4253
|
return dt.default = a, dt;
|
|
4254
4254
|
}
|
|
4255
|
-
var Kt = {},
|
|
4255
|
+
var Kt = {}, xe = {}, $a;
|
|
4256
4256
|
function Po() {
|
|
4257
|
-
if ($a) return
|
|
4258
|
-
$a = 1, Object.defineProperty(
|
|
4257
|
+
if ($a) return xe;
|
|
4258
|
+
$a = 1, Object.defineProperty(xe, "__esModule", { value: !0 }), xe.DiscrError = void 0;
|
|
4259
4259
|
var e;
|
|
4260
4260
|
return function(t) {
|
|
4261
4261
|
t.Tag = "tag", t.Mapping = "mapping";
|
|
4262
|
-
}(e || (
|
|
4262
|
+
}(e || (xe.DiscrError = e = {})), xe;
|
|
4263
4263
|
}
|
|
4264
4264
|
var ba;
|
|
4265
4265
|
function Zr() {
|
|
@@ -4289,49 +4289,49 @@ function Zr() {
|
|
|
4289
4289
|
function f() {
|
|
4290
4290
|
const y = d();
|
|
4291
4291
|
l.if(!1);
|
|
4292
|
-
for (const
|
|
4293
|
-
l.elseIf((0, e._)`${u} === ${
|
|
4292
|
+
for (const $ in y)
|
|
4293
|
+
l.elseIf((0, e._)`${u} === ${$}`), l.assign(h, o(y[$]));
|
|
4294
4294
|
l.else(), c.error(!1, { discrError: t.DiscrError.Mapping, tag: u, tagName: S }), l.endIf();
|
|
4295
4295
|
}
|
|
4296
4296
|
function o(y) {
|
|
4297
|
-
const
|
|
4298
|
-
return c.mergeEvaluated(_, e.Name),
|
|
4297
|
+
const $ = l.name("valid"), _ = c.subschema({ keyword: "oneOf", schemaProp: y }, $);
|
|
4298
|
+
return c.mergeEvaluated(_, e.Name), $;
|
|
4299
4299
|
}
|
|
4300
4300
|
function d() {
|
|
4301
4301
|
var y;
|
|
4302
|
-
const
|
|
4302
|
+
const $ = {}, _ = N(b);
|
|
4303
4303
|
let P = !0;
|
|
4304
4304
|
for (let I = 0; I < w.length; I++) {
|
|
4305
|
-
let
|
|
4306
|
-
if (
|
|
4307
|
-
const W =
|
|
4308
|
-
if (
|
|
4305
|
+
let D = w[I];
|
|
4306
|
+
if (D?.$ref && !(0, s.schemaHasRulesButRef)(D, g.self.RULES)) {
|
|
4307
|
+
const W = D.$ref;
|
|
4308
|
+
if (D = r.resolveRef.call(g.self, g.schemaEnv.root, g.baseId, W), D instanceof r.SchemaEnv && (D = D.schema), D === void 0)
|
|
4309
4309
|
throw new n.default(g.opts.uriResolver, g.baseId, W);
|
|
4310
4310
|
}
|
|
4311
|
-
const
|
|
4312
|
-
if (typeof
|
|
4311
|
+
const U = (y = D?.properties) === null || y === void 0 ? void 0 : y[S];
|
|
4312
|
+
if (typeof U != "object")
|
|
4313
4313
|
throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${S}"`);
|
|
4314
|
-
P = P && (_ || N(
|
|
4314
|
+
P = P && (_ || N(D)), q(U, I);
|
|
4315
4315
|
}
|
|
4316
4316
|
if (!P)
|
|
4317
4317
|
throw new Error(`discriminator: "${S}" must be required`);
|
|
4318
|
-
return
|
|
4318
|
+
return $;
|
|
4319
4319
|
function N({ required: I }) {
|
|
4320
4320
|
return Array.isArray(I) && I.includes(S);
|
|
4321
4321
|
}
|
|
4322
|
-
function q(I,
|
|
4322
|
+
function q(I, D) {
|
|
4323
4323
|
if (I.const)
|
|
4324
|
-
|
|
4324
|
+
L(I.const, D);
|
|
4325
4325
|
else if (I.enum)
|
|
4326
|
-
for (const
|
|
4327
|
-
U
|
|
4326
|
+
for (const U of I.enum)
|
|
4327
|
+
L(U, D);
|
|
4328
4328
|
else
|
|
4329
4329
|
throw new Error(`discriminator: "properties/${S}" must have "const" or "enum"`);
|
|
4330
4330
|
}
|
|
4331
|
-
function
|
|
4332
|
-
if (typeof I != "string" || I in
|
|
4331
|
+
function L(I, D) {
|
|
4332
|
+
if (typeof I != "string" || I in $)
|
|
4333
4333
|
throw new Error(`discriminator: "${S}" values must be unique strings`);
|
|
4334
|
-
|
|
4334
|
+
$[I] = D;
|
|
4335
4335
|
}
|
|
4336
4336
|
}
|
|
4337
4337
|
}
|
|
@@ -4510,10 +4510,10 @@ function Mo() {
|
|
|
4510
4510
|
};
|
|
4511
4511
|
return Zt.default = t, Zt;
|
|
4512
4512
|
}
|
|
4513
|
-
var
|
|
4514
|
-
function
|
|
4515
|
-
if (Aa) return
|
|
4516
|
-
Aa = 1, Object.defineProperty(
|
|
4513
|
+
var Yt = {}, Aa;
|
|
4514
|
+
function Vo() {
|
|
4515
|
+
if (Aa) return Yt;
|
|
4516
|
+
Aa = 1, Object.defineProperty(Yt, "__esModule", { value: !0 });
|
|
4517
4517
|
const e = Q(), t = {
|
|
4518
4518
|
keyword: ["maxContains", "minContains"],
|
|
4519
4519
|
type: "array",
|
|
@@ -4522,17 +4522,17 @@ function Do() {
|
|
|
4522
4522
|
n.contains === void 0 && (0, e.checkStrictMode)(s, `"${r}" without "contains" is ignored`);
|
|
4523
4523
|
}
|
|
4524
4524
|
};
|
|
4525
|
-
return
|
|
4525
|
+
return Yt.default = t, Yt;
|
|
4526
4526
|
}
|
|
4527
4527
|
var ka;
|
|
4528
4528
|
function Rs() {
|
|
4529
4529
|
if (ka) return Gt;
|
|
4530
4530
|
ka = 1, Object.defineProperty(Gt, "__esModule", { value: !0 });
|
|
4531
|
-
const e = qo(), t = Mo(), r =
|
|
4531
|
+
const e = qo(), t = Mo(), r = Vo(), n = [e.default, t.default, r.default];
|
|
4532
4532
|
return Gt.default = n, Gt;
|
|
4533
4533
|
}
|
|
4534
|
-
var
|
|
4535
|
-
function
|
|
4534
|
+
var xt = {}, Qt = {}, Na;
|
|
4535
|
+
function Do() {
|
|
4536
4536
|
if (Na) return Qt;
|
|
4537
4537
|
Na = 1, Object.defineProperty(Qt, "__esModule", { value: !0 });
|
|
4538
4538
|
const e = H(), t = Q(), r = Pe(), s = {
|
|
@@ -4612,10 +4612,10 @@ function zo() {
|
|
|
4612
4612
|
}
|
|
4613
4613
|
var Ca;
|
|
4614
4614
|
function As() {
|
|
4615
|
-
if (Ca) return
|
|
4616
|
-
Ca = 1, Object.defineProperty(
|
|
4617
|
-
const e =
|
|
4618
|
-
return
|
|
4615
|
+
if (Ca) return xt;
|
|
4616
|
+
Ca = 1, Object.defineProperty(xt, "__esModule", { value: !0 });
|
|
4617
|
+
const e = Do(), t = zo(), r = [e.default, t.default];
|
|
4618
|
+
return xt.default = r, xt;
|
|
4619
4619
|
}
|
|
4620
4620
|
var tr = {};
|
|
4621
4621
|
const Fo = "https://json-schema.org/draft/2019-09/schema", Lo = "https://json-schema.org/draft/2019-09/schema", Uo = { "https://json-schema.org/draft/2019-09/vocab/core": !0, "https://json-schema.org/draft/2019-09/vocab/applicator": !0, "https://json-schema.org/draft/2019-09/vocab/validation": !0, "https://json-schema.org/draft/2019-09/vocab/meta-data": !0, "https://json-schema.org/draft/2019-09/vocab/format": !1, "https://json-schema.org/draft/2019-09/vocab/content": !0 }, Ko = !0, Wo = "Core and Validation specifications meta-schema", Bo = [{ $ref: "meta/core" }, { $ref: "meta/applicator" }, { $ref: "meta/validation" }, { $ref: "meta/meta-data" }, { $ref: "meta/format" }, { $ref: "meta/content" }], Jo = ["object", "boolean"], Ho = { definitions: { $comment: "While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.", type: "object", additionalProperties: { $recursiveRef: "#" }, default: {} }, dependencies: { $comment: '"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"', type: "object", additionalProperties: { anyOf: [{ $recursiveRef: "#" }, { $ref: "meta/validation#/$defs/stringArray" }] } } }, Go = {
|
|
@@ -4627,11 +4627,11 @@ const Fo = "https://json-schema.org/draft/2019-09/schema", Lo = "https://json-sc
|
|
|
4627
4627
|
allOf: Bo,
|
|
4628
4628
|
type: Jo,
|
|
4629
4629
|
properties: Ho
|
|
4630
|
-
}, Xo = "https://json-schema.org/draft/2019-09/schema", Zo = "https://json-schema.org/draft/2019-09/meta/applicator",
|
|
4630
|
+
}, Xo = "https://json-schema.org/draft/2019-09/schema", Zo = "https://json-schema.org/draft/2019-09/meta/applicator", Yo = { "https://json-schema.org/draft/2019-09/vocab/applicator": !0 }, xo = !0, Qo = "Applicator vocabulary meta-schema", ec = ["object", "boolean"], tc = { additionalItems: { $recursiveRef: "#" }, unevaluatedItems: { $recursiveRef: "#" }, items: { anyOf: [{ $recursiveRef: "#" }, { $ref: "#/$defs/schemaArray" }] }, contains: { $recursiveRef: "#" }, additionalProperties: { $recursiveRef: "#" }, unevaluatedProperties: { $recursiveRef: "#" }, properties: { type: "object", additionalProperties: { $recursiveRef: "#" }, default: {} }, patternProperties: { type: "object", additionalProperties: { $recursiveRef: "#" }, propertyNames: { format: "regex" }, default: {} }, dependentSchemas: { type: "object", additionalProperties: { $recursiveRef: "#" } }, propertyNames: { $recursiveRef: "#" }, if: { $recursiveRef: "#" }, then: { $recursiveRef: "#" }, else: { $recursiveRef: "#" }, allOf: { $ref: "#/$defs/schemaArray" }, anyOf: { $ref: "#/$defs/schemaArray" }, oneOf: { $ref: "#/$defs/schemaArray" }, not: { $recursiveRef: "#" } }, rc = { schemaArray: { type: "array", minItems: 1, items: { $recursiveRef: "#" } } }, nc = {
|
|
4631
4631
|
$schema: Xo,
|
|
4632
4632
|
$id: Zo,
|
|
4633
|
-
$vocabulary:
|
|
4634
|
-
$recursiveAnchor:
|
|
4633
|
+
$vocabulary: Yo,
|
|
4634
|
+
$recursiveAnchor: xo,
|
|
4635
4635
|
title: Qo,
|
|
4636
4636
|
type: ec,
|
|
4637
4637
|
properties: tc,
|
|
@@ -4668,10 +4668,10 @@ const Fo = "https://json-schema.org/draft/2019-09/schema", Lo = "https://json-sc
|
|
|
4668
4668
|
title: Ic,
|
|
4669
4669
|
type: Cc,
|
|
4670
4670
|
properties: Tc
|
|
4671
|
-
}, Mc = "https://json-schema.org/draft/2019-09/schema",
|
|
4671
|
+
}, Mc = "https://json-schema.org/draft/2019-09/schema", Vc = "https://json-schema.org/draft/2019-09/meta/validation", Dc = { "https://json-schema.org/draft/2019-09/vocab/validation": !0 }, zc = !0, Fc = "Validation vocabulary meta-schema", Lc = ["object", "boolean"], Uc = { multipleOf: { type: "number", exclusiveMinimum: 0 }, maximum: { type: "number" }, exclusiveMaximum: { type: "number" }, minimum: { type: "number" }, exclusiveMinimum: { type: "number" }, maxLength: { $ref: "#/$defs/nonNegativeInteger" }, minLength: { $ref: "#/$defs/nonNegativeIntegerDefault0" }, pattern: { type: "string", format: "regex" }, maxItems: { $ref: "#/$defs/nonNegativeInteger" }, minItems: { $ref: "#/$defs/nonNegativeIntegerDefault0" }, uniqueItems: { type: "boolean", default: !1 }, maxContains: { $ref: "#/$defs/nonNegativeInteger" }, minContains: { $ref: "#/$defs/nonNegativeInteger", default: 1 }, maxProperties: { $ref: "#/$defs/nonNegativeInteger" }, minProperties: { $ref: "#/$defs/nonNegativeIntegerDefault0" }, required: { $ref: "#/$defs/stringArray" }, dependentRequired: { type: "object", additionalProperties: { $ref: "#/$defs/stringArray" } }, const: !0, enum: { type: "array", items: !0 }, type: { anyOf: [{ $ref: "#/$defs/simpleTypes" }, { type: "array", items: { $ref: "#/$defs/simpleTypes" }, minItems: 1, uniqueItems: !0 }] } }, Kc = { nonNegativeInteger: { type: "integer", minimum: 0 }, nonNegativeIntegerDefault0: { $ref: "#/$defs/nonNegativeInteger", default: 0 }, simpleTypes: { enum: ["array", "boolean", "integer", "null", "number", "object", "string"] }, stringArray: { type: "array", items: { type: "string" }, uniqueItems: !0, default: [] } }, Wc = {
|
|
4672
4672
|
$schema: Mc,
|
|
4673
|
-
$id:
|
|
4674
|
-
$vocabulary:
|
|
4673
|
+
$id: Vc,
|
|
4674
|
+
$vocabulary: Dc,
|
|
4675
4675
|
$recursiveAnchor: zc,
|
|
4676
4676
|
title: Fc,
|
|
4677
4677
|
type: Lc,
|
|
@@ -4774,10 +4774,10 @@ function Xc() {
|
|
|
4774
4774
|
return nr.default = l, nr;
|
|
4775
4775
|
}
|
|
4776
4776
|
var ar = {};
|
|
4777
|
-
const Zc = "https://json-schema.org/draft/2020-12/schema",
|
|
4777
|
+
const Zc = "https://json-schema.org/draft/2020-12/schema", Yc = "https://json-schema.org/draft/2020-12/schema", xc = { "https://json-schema.org/draft/2020-12/vocab/core": !0, "https://json-schema.org/draft/2020-12/vocab/applicator": !0, "https://json-schema.org/draft/2020-12/vocab/unevaluated": !0, "https://json-schema.org/draft/2020-12/vocab/validation": !0, "https://json-schema.org/draft/2020-12/vocab/meta-data": !0, "https://json-schema.org/draft/2020-12/vocab/format-annotation": !0, "https://json-schema.org/draft/2020-12/vocab/content": !0 }, Qc = "meta", eu = "Core and Validation specifications meta-schema", tu = [{ $ref: "meta/core" }, { $ref: "meta/applicator" }, { $ref: "meta/unevaluated" }, { $ref: "meta/validation" }, { $ref: "meta/meta-data" }, { $ref: "meta/format-annotation" }, { $ref: "meta/content" }], ru = ["object", "boolean"], nu = "This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.", au = { definitions: { $comment: '"definitions" has been replaced by "$defs".', type: "object", additionalProperties: { $dynamicRef: "#meta" }, deprecated: !0, default: {} }, dependencies: { $comment: '"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.', type: "object", additionalProperties: { anyOf: [{ $dynamicRef: "#meta" }, { $ref: "meta/validation#/$defs/stringArray" }] }, deprecated: !0, default: {} }, $recursiveAnchor: { $comment: '"$recursiveAnchor" has been replaced by "$dynamicAnchor".', $ref: "meta/core#/$defs/anchorString", deprecated: !0 }, $recursiveRef: { $comment: '"$recursiveRef" has been replaced by "$dynamicRef".', $ref: "meta/core#/$defs/uriReferenceString", deprecated: !0 } }, su = {
|
|
4778
4778
|
$schema: Zc,
|
|
4779
|
-
$id:
|
|
4780
|
-
$vocabulary:
|
|
4779
|
+
$id: Yc,
|
|
4780
|
+
$vocabulary: xc,
|
|
4781
4781
|
$dynamicAnchor: Qc,
|
|
4782
4782
|
title: eu,
|
|
4783
4783
|
allOf: tu,
|
|
@@ -4809,15 +4809,15 @@ const Zc = "https://json-schema.org/draft/2020-12/schema", xc = "https://json-sc
|
|
|
4809
4809
|
title: Ou,
|
|
4810
4810
|
type: Ru,
|
|
4811
4811
|
properties: Au
|
|
4812
|
-
}, Nu = "https://json-schema.org/draft/2020-12/schema", Iu = "https://json-schema.org/draft/2020-12/meta/core", Cu = { "https://json-schema.org/draft/2020-12/vocab/core": !0 }, Tu = "meta", qu = "Core vocabulary meta-schema", Mu = ["object", "boolean"],
|
|
4812
|
+
}, Nu = "https://json-schema.org/draft/2020-12/schema", Iu = "https://json-schema.org/draft/2020-12/meta/core", Cu = { "https://json-schema.org/draft/2020-12/vocab/core": !0 }, Tu = "meta", qu = "Core vocabulary meta-schema", Mu = ["object", "boolean"], Vu = { $id: { $ref: "#/$defs/uriReferenceString", $comment: "Non-empty fragments not allowed.", pattern: "^[^#]*#?$" }, $schema: { $ref: "#/$defs/uriString" }, $ref: { $ref: "#/$defs/uriReferenceString" }, $anchor: { $ref: "#/$defs/anchorString" }, $dynamicRef: { $ref: "#/$defs/uriReferenceString" }, $dynamicAnchor: { $ref: "#/$defs/anchorString" }, $vocabulary: { type: "object", propertyNames: { $ref: "#/$defs/uriString" }, additionalProperties: { type: "boolean" } }, $comment: { type: "string" }, $defs: { type: "object", additionalProperties: { $dynamicRef: "#meta" } } }, Du = { anchorString: { type: "string", pattern: "^[A-Za-z_][-A-Za-z0-9._]*$" }, uriString: { type: "string", format: "uri" }, uriReferenceString: { type: "string", format: "uri-reference" } }, zu = {
|
|
4813
4813
|
$schema: Nu,
|
|
4814
4814
|
$id: Iu,
|
|
4815
4815
|
$vocabulary: Cu,
|
|
4816
4816
|
$dynamicAnchor: Tu,
|
|
4817
4817
|
title: qu,
|
|
4818
4818
|
type: Mu,
|
|
4819
|
-
properties:
|
|
4820
|
-
$defs:
|
|
4819
|
+
properties: Vu,
|
|
4820
|
+
$defs: Du
|
|
4821
4821
|
}, Fu = "https://json-schema.org/draft/2020-12/schema", Lu = "https://json-schema.org/draft/2020-12/meta/format-annotation", Uu = { "https://json-schema.org/draft/2020-12/vocab/format-annotation": !0 }, Ku = "meta", Wu = "Format vocabulary meta-schema for annotation results", Bu = ["object", "boolean"], Ju = { format: { type: "string" } }, Hu = {
|
|
4822
4822
|
$schema: Fu,
|
|
4823
4823
|
$id: Lu,
|
|
@@ -4826,12 +4826,12 @@ const Zc = "https://json-schema.org/draft/2020-12/schema", xc = "https://json-sc
|
|
|
4826
4826
|
title: Wu,
|
|
4827
4827
|
type: Bu,
|
|
4828
4828
|
properties: Ju
|
|
4829
|
-
}, Gu = "https://json-schema.org/draft/2020-12/schema", Xu = "https://json-schema.org/draft/2020-12/meta/meta-data", Zu = { "https://json-schema.org/draft/2020-12/vocab/meta-data": !0 },
|
|
4829
|
+
}, Gu = "https://json-schema.org/draft/2020-12/schema", Xu = "https://json-schema.org/draft/2020-12/meta/meta-data", Zu = { "https://json-schema.org/draft/2020-12/vocab/meta-data": !0 }, Yu = "meta", xu = "Meta-data vocabulary meta-schema", Qu = ["object", "boolean"], el = { title: { type: "string" }, description: { type: "string" }, default: !0, deprecated: { type: "boolean", default: !1 }, readOnly: { type: "boolean", default: !1 }, writeOnly: { type: "boolean", default: !1 }, examples: { type: "array", items: !0 } }, tl = {
|
|
4830
4830
|
$schema: Gu,
|
|
4831
4831
|
$id: Xu,
|
|
4832
4832
|
$vocabulary: Zu,
|
|
4833
|
-
$dynamicAnchor:
|
|
4834
|
-
title:
|
|
4833
|
+
$dynamicAnchor: Yu,
|
|
4834
|
+
title: xu,
|
|
4835
4835
|
type: Qu,
|
|
4836
4836
|
properties: el
|
|
4837
4837
|
}, rl = "https://json-schema.org/draft/2020-12/schema", nl = "https://json-schema.org/draft/2020-12/meta/validation", al = { "https://json-schema.org/draft/2020-12/vocab/validation": !0 }, sl = "meta", il = "Validation vocabulary meta-schema", ol = ["object", "boolean"], cl = { type: { anyOf: [{ $ref: "#/$defs/simpleTypes" }, { type: "array", items: { $ref: "#/$defs/simpleTypes" }, minItems: 1, uniqueItems: !0 }] }, const: !0, enum: { type: "array", items: !0 }, multipleOf: { type: "number", exclusiveMinimum: 0 }, maximum: { type: "number" }, exclusiveMaximum: { type: "number" }, minimum: { type: "number" }, exclusiveMinimum: { type: "number" }, maxLength: { $ref: "#/$defs/nonNegativeInteger" }, minLength: { $ref: "#/$defs/nonNegativeIntegerDefault0" }, pattern: { type: "string", format: "regex" }, maxItems: { $ref: "#/$defs/nonNegativeInteger" }, minItems: { $ref: "#/$defs/nonNegativeIntegerDefault0" }, uniqueItems: { type: "boolean", default: !1 }, maxContains: { $ref: "#/$defs/nonNegativeInteger" }, minContains: { $ref: "#/$defs/nonNegativeInteger", default: 1 }, maxProperties: { $ref: "#/$defs/nonNegativeInteger" }, minProperties: { $ref: "#/$defs/nonNegativeIntegerDefault0" }, required: { $ref: "#/$defs/stringArray" }, dependentRequired: { type: "object", additionalProperties: { $ref: "#/$defs/stringArray" } } }, ul = { nonNegativeInteger: { type: "integer", minimum: 0 }, nonNegativeIntegerDefault0: { $ref: "#/$defs/nonNegativeInteger", default: 0 }, simpleTypes: { enum: ["array", "boolean", "integer", "null", "number", "object", "string"] }, stringArray: { type: "array", items: { type: "string" }, uniqueItems: !0, default: [] } }, ll = {
|
|
@@ -4844,10 +4844,10 @@ const Zc = "https://json-schema.org/draft/2020-12/schema", xc = "https://json-sc
|
|
|
4844
4844
|
properties: cl,
|
|
4845
4845
|
$defs: ul
|
|
4846
4846
|
};
|
|
4847
|
-
var
|
|
4847
|
+
var Va;
|
|
4848
4848
|
function dl() {
|
|
4849
|
-
if (
|
|
4850
|
-
|
|
4849
|
+
if (Va) return ar;
|
|
4850
|
+
Va = 1, Object.defineProperty(ar, "__esModule", { value: !0 });
|
|
4851
4851
|
const e = su, t = pu, r = wu, n = ku, s = zu, a = Hu, i = tl, c = ll, l = ["/properties"];
|
|
4852
4852
|
function p(m) {
|
|
4853
4853
|
return [
|
|
@@ -4866,9 +4866,9 @@ function dl() {
|
|
|
4866
4866
|
}
|
|
4867
4867
|
return ar.default = p, ar;
|
|
4868
4868
|
}
|
|
4869
|
-
var
|
|
4869
|
+
var Da;
|
|
4870
4870
|
function fl() {
|
|
4871
|
-
return
|
|
4871
|
+
return Da || (Da = 1, function(e, t) {
|
|
4872
4872
|
Object.defineProperty(t, "__esModule", { value: !0 }), t.MissingRefError = t.ValidationError = t.CodeGen = t.Name = t.nil = t.stringify = t.str = t._ = t.KeywordCxt = t.Ajv2020 = void 0;
|
|
4873
4873
|
const r = Jr(), n = Xc(), s = Zr(), a = dl(), i = "https://json-schema.org/draft/2020-12/schema";
|
|
4874
4874
|
class c extends r.default {
|
|
@@ -4927,8 +4927,8 @@ var sr = { exports: {} }, Cr = {}, za;
|
|
|
4927
4927
|
function hl() {
|
|
4928
4928
|
return za || (za = 1, function(e) {
|
|
4929
4929
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.formatNames = e.fastFormats = e.fullFormats = void 0;
|
|
4930
|
-
function t(I,
|
|
4931
|
-
return { validate: I, compare:
|
|
4930
|
+
function t(I, D) {
|
|
4931
|
+
return { validate: I, compare: D };
|
|
4932
4932
|
}
|
|
4933
4933
|
e.fullFormats = {
|
|
4934
4934
|
// date: http://tools.ietf.org/html/rfc3339#section-5.6
|
|
@@ -4952,7 +4952,7 @@ function hl() {
|
|
|
4952
4952
|
// optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html
|
|
4953
4953
|
ipv4: /^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,
|
|
4954
4954
|
ipv6: /^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,
|
|
4955
|
-
regex:
|
|
4955
|
+
regex: L,
|
|
4956
4956
|
// uuid: http://tools.ietf.org/html/rfc4122
|
|
4957
4957
|
uuid: /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,
|
|
4958
4958
|
// JSON-pointer: https://tools.ietf.org/html/rfc6901
|
|
@@ -4996,66 +4996,66 @@ function hl() {
|
|
|
4996
4996
|
}
|
|
4997
4997
|
const n = /^(\d\d\d\d)-(\d\d)-(\d\d)$/, s = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
4998
4998
|
function a(I) {
|
|
4999
|
-
const
|
|
5000
|
-
if (!
|
|
4999
|
+
const D = n.exec(I);
|
|
5000
|
+
if (!D)
|
|
5001
5001
|
return !1;
|
|
5002
|
-
const
|
|
5003
|
-
return W >= 1 && W <= 12 && ee >= 1 && ee <= (W === 2 && r(
|
|
5002
|
+
const U = +D[1], W = +D[2], ee = +D[3];
|
|
5003
|
+
return W >= 1 && W <= 12 && ee >= 1 && ee <= (W === 2 && r(U) ? 29 : s[W]);
|
|
5004
5004
|
}
|
|
5005
|
-
function i(I,
|
|
5006
|
-
if (I &&
|
|
5007
|
-
return I >
|
|
5005
|
+
function i(I, D) {
|
|
5006
|
+
if (I && D)
|
|
5007
|
+
return I > D ? 1 : I < D ? -1 : 0;
|
|
5008
5008
|
}
|
|
5009
5009
|
const c = /^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;
|
|
5010
5010
|
function l(I) {
|
|
5011
|
-
return function(
|
|
5012
|
-
const W = c.exec(
|
|
5011
|
+
return function(U) {
|
|
5012
|
+
const W = c.exec(U);
|
|
5013
5013
|
if (!W)
|
|
5014
5014
|
return !1;
|
|
5015
|
-
const ee = +W[1],
|
|
5016
|
-
if (M > 23 || O > 59 || I && !
|
|
5015
|
+
const ee = +W[1], oe = +W[2], re = +W[3], Z = W[4], se = W[5] === "-" ? -1 : 1, M = +(W[6] || 0), O = +(W[7] || 0);
|
|
5016
|
+
if (M > 23 || O > 59 || I && !Z)
|
|
5017
5017
|
return !1;
|
|
5018
|
-
if (ee <= 23 &&
|
|
5018
|
+
if (ee <= 23 && oe <= 59 && re < 60)
|
|
5019
5019
|
return !0;
|
|
5020
|
-
const C =
|
|
5021
|
-
return (k === 23 || k === -1) && (C === 59 || C === -1) &&
|
|
5020
|
+
const C = oe - O * se, k = ee - M * se - (C < 0 ? 1 : 0);
|
|
5021
|
+
return (k === 23 || k === -1) && (C === 59 || C === -1) && re < 61;
|
|
5022
5022
|
};
|
|
5023
5023
|
}
|
|
5024
|
-
function p(I,
|
|
5025
|
-
if (!(I &&
|
|
5024
|
+
function p(I, D) {
|
|
5025
|
+
if (!(I && D))
|
|
5026
5026
|
return;
|
|
5027
|
-
const
|
|
5028
|
-
if (
|
|
5029
|
-
return
|
|
5027
|
+
const U = (/* @__PURE__ */ new Date("2020-01-01T" + I)).valueOf(), W = (/* @__PURE__ */ new Date("2020-01-01T" + D)).valueOf();
|
|
5028
|
+
if (U && W)
|
|
5029
|
+
return U - W;
|
|
5030
5030
|
}
|
|
5031
|
-
function m(I,
|
|
5032
|
-
if (!(I &&
|
|
5031
|
+
function m(I, D) {
|
|
5032
|
+
if (!(I && D))
|
|
5033
5033
|
return;
|
|
5034
|
-
const
|
|
5035
|
-
if (
|
|
5036
|
-
return I =
|
|
5034
|
+
const U = c.exec(I), W = c.exec(D);
|
|
5035
|
+
if (U && W)
|
|
5036
|
+
return I = U[1] + U[2] + U[3], D = W[1] + W[2] + W[3], I > D ? 1 : I < D ? -1 : 0;
|
|
5037
5037
|
}
|
|
5038
5038
|
const b = /t|\s/i;
|
|
5039
5039
|
function g(I) {
|
|
5040
|
-
const
|
|
5040
|
+
const D = l(I);
|
|
5041
5041
|
return function(W) {
|
|
5042
5042
|
const ee = W.split(b);
|
|
5043
|
-
return ee.length === 2 && a(ee[0]) &&
|
|
5043
|
+
return ee.length === 2 && a(ee[0]) && D(ee[1]);
|
|
5044
5044
|
};
|
|
5045
5045
|
}
|
|
5046
|
-
function w(I,
|
|
5047
|
-
if (!(I &&
|
|
5046
|
+
function w(I, D) {
|
|
5047
|
+
if (!(I && D))
|
|
5048
5048
|
return;
|
|
5049
|
-
const
|
|
5050
|
-
if (
|
|
5051
|
-
return
|
|
5049
|
+
const U = new Date(I).valueOf(), W = new Date(D).valueOf();
|
|
5050
|
+
if (U && W)
|
|
5051
|
+
return U - W;
|
|
5052
5052
|
}
|
|
5053
|
-
function S(I,
|
|
5054
|
-
if (!(I &&
|
|
5053
|
+
function S(I, D) {
|
|
5054
|
+
if (!(I && D))
|
|
5055
5055
|
return;
|
|
5056
|
-
const [
|
|
5057
|
-
if (
|
|
5058
|
-
return
|
|
5056
|
+
const [U, W] = I.split(b), [ee, oe] = D.split(b), re = i(U, ee);
|
|
5057
|
+
if (re !== void 0)
|
|
5058
|
+
return re || p(W, oe);
|
|
5059
5059
|
}
|
|
5060
5060
|
const h = /\/|:/, u = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
|
|
5061
5061
|
function f(I) {
|
|
@@ -5065,9 +5065,9 @@ function hl() {
|
|
|
5065
5065
|
function d(I) {
|
|
5066
5066
|
return o.lastIndex = 0, o.test(I);
|
|
5067
5067
|
}
|
|
5068
|
-
const y = -2147483648,
|
|
5068
|
+
const y = -2147483648, $ = 2 ** 31 - 1;
|
|
5069
5069
|
function _(I) {
|
|
5070
|
-
return Number.isInteger(I) && I <=
|
|
5070
|
+
return Number.isInteger(I) && I <= $ && I >= y;
|
|
5071
5071
|
}
|
|
5072
5072
|
function P(I) {
|
|
5073
5073
|
return Number.isInteger(I);
|
|
@@ -5076,7 +5076,7 @@ function hl() {
|
|
|
5076
5076
|
return !0;
|
|
5077
5077
|
}
|
|
5078
5078
|
const q = /[^\\]\\Z/;
|
|
5079
|
-
function
|
|
5079
|
+
function L(I) {
|
|
5080
5080
|
if (q.test(I))
|
|
5081
5081
|
return !1;
|
|
5082
5082
|
try {
|
|
@@ -5125,12 +5125,12 @@ function yl() {
|
|
|
5125
5125
|
return;
|
|
5126
5126
|
if (typeof y != "object" || y instanceof RegExp || typeof y.compare != "function")
|
|
5127
5127
|
throw new Error(`"${b}": format "${d}" does not define "compare" function`);
|
|
5128
|
-
const
|
|
5128
|
+
const $ = l.scopeValue("formats", {
|
|
5129
5129
|
key: d,
|
|
5130
5130
|
ref: y,
|
|
5131
5131
|
code: w.code.formats ? (0, r._)`${w.code.formats}${(0, r.getProperty)(d)}` : void 0
|
|
5132
5132
|
});
|
|
5133
|
-
c.fail$data(o(
|
|
5133
|
+
c.fail$data(o($));
|
|
5134
5134
|
}
|
|
5135
5135
|
function o(d) {
|
|
5136
5136
|
return (0, r._)`${d}.compare(${p}, ${m}) ${s[b].fail} 0`;
|
|
@@ -5203,7 +5203,7 @@ function wl(e) {
|
|
|
5203
5203
|
return s.message = _l(r), t;
|
|
5204
5204
|
}, {});
|
|
5205
5205
|
}
|
|
5206
|
-
function
|
|
5206
|
+
function Yr(e) {
|
|
5207
5207
|
const t = wl(e);
|
|
5208
5208
|
return Ee.invalid(t);
|
|
5209
5209
|
}
|
|
@@ -5231,7 +5231,7 @@ function df() {
|
|
|
5231
5231
|
// WeakMap doesn't expose size for privacy/security
|
|
5232
5232
|
};
|
|
5233
5233
|
}
|
|
5234
|
-
function
|
|
5234
|
+
function xr(e, t) {
|
|
5235
5235
|
let r = cr.get(e);
|
|
5236
5236
|
r == null && (r = /* @__PURE__ */ new WeakMap(), cr.set(e, r));
|
|
5237
5237
|
const n = r.get(t);
|
|
@@ -5271,13 +5271,13 @@ function jl(e) {
|
|
|
5271
5271
|
const t = e.indexOf("#");
|
|
5272
5272
|
return t >= 0 ? e.slice(0, t) : e;
|
|
5273
5273
|
}
|
|
5274
|
-
function
|
|
5274
|
+
function Vr(e, t = !0) {
|
|
5275
5275
|
if (Array.isArray(e))
|
|
5276
|
-
return e.map((r) =>
|
|
5276
|
+
return e.map((r) => Vr(r, !1));
|
|
5277
5277
|
if (e != null && typeof e == "object") {
|
|
5278
5278
|
const r = e, n = {};
|
|
5279
5279
|
for (const [s, a] of Object.entries(r))
|
|
5280
|
-
!t && (s === "$id" || s === "$schema" || s === "$dynamicAnchor") || (n[s] =
|
|
5280
|
+
!t && (s === "$id" || s === "$schema" || s === "$dynamicAnchor") || (n[s] = Vr(a, !1));
|
|
5281
5281
|
return n;
|
|
5282
5282
|
}
|
|
5283
5283
|
return e;
|
|
@@ -5353,7 +5353,7 @@ async function Ol(e, t) {
|
|
|
5353
5353
|
"https://json-schema.org/draft/2019-09/schema",
|
|
5354
5354
|
"http://json-schema.org/draft-07/schema"
|
|
5355
5355
|
])).has(i)) {
|
|
5356
|
-
const m = await Ua(r, n, !1), b =
|
|
5356
|
+
const m = await Ua(r, n, !1), b = Vr(
|
|
5357
5357
|
e
|
|
5358
5358
|
);
|
|
5359
5359
|
try {
|
|
@@ -5546,7 +5546,7 @@ function Ml(e, t, r, n = []) {
|
|
|
5546
5546
|
if (!r)
|
|
5547
5547
|
return null;
|
|
5548
5548
|
try {
|
|
5549
|
-
if (
|
|
5549
|
+
if (xr(r, e)(t)) {
|
|
5550
5550
|
const i = e.title || "disallowed schema";
|
|
5551
5551
|
return {
|
|
5552
5552
|
path: n,
|
|
@@ -5559,7 +5559,7 @@ function Ml(e, t, r, n = []) {
|
|
|
5559
5559
|
return null;
|
|
5560
5560
|
}
|
|
5561
5561
|
}
|
|
5562
|
-
function
|
|
5562
|
+
function Vl(e, t, r, n = []) {
|
|
5563
5563
|
const s = [], a = [], i = Is(e, t, r);
|
|
5564
5564
|
i && s.push(i);
|
|
5565
5565
|
const c = Array.isArray(e.required) ? [...e.required] : [];
|
|
@@ -5596,7 +5596,7 @@ function Dl(e, t, r, n = []) {
|
|
|
5596
5596
|
function Is(e, t, r) {
|
|
5597
5597
|
if (!r || !e.if || typeof e.if != "object") return null;
|
|
5598
5598
|
try {
|
|
5599
|
-
if (
|
|
5599
|
+
if (xr(r, e.if)(t)) {
|
|
5600
5600
|
const a = e.then;
|
|
5601
5601
|
if (a && typeof a == "object")
|
|
5602
5602
|
return a;
|
|
@@ -5670,6 +5670,26 @@ class en {
|
|
|
5670
5670
|
schemaConflicts;
|
|
5671
5671
|
notViolations;
|
|
5672
5672
|
widgetRegistry;
|
|
5673
|
+
/**
|
|
5674
|
+
* Function to set the form's validation status.
|
|
5675
|
+
* Available for custom widgets that need to perform their own validation.
|
|
5676
|
+
*/
|
|
5677
|
+
setStatus;
|
|
5678
|
+
/**
|
|
5679
|
+
* Signal containing the entire form's current value.
|
|
5680
|
+
* Useful for cross-field validation or conditional rendering.
|
|
5681
|
+
*/
|
|
5682
|
+
formValue;
|
|
5683
|
+
/**
|
|
5684
|
+
* Current validation mode ('eager', 'onTouched', 'onSubmit').
|
|
5685
|
+
* Custom widgets may want to behave differently based on this.
|
|
5686
|
+
*/
|
|
5687
|
+
validationMode;
|
|
5688
|
+
/**
|
|
5689
|
+
* Signal indicating whether the form is currently submitting.
|
|
5690
|
+
* Widgets should typically disable during submission.
|
|
5691
|
+
*/
|
|
5692
|
+
submitting;
|
|
5673
5693
|
constructor(t) {
|
|
5674
5694
|
const {
|
|
5675
5695
|
schema: r,
|
|
@@ -5681,9 +5701,13 @@ class en {
|
|
|
5681
5701
|
suppressLabel: l,
|
|
5682
5702
|
schemaConflicts: p,
|
|
5683
5703
|
notViolations: m,
|
|
5684
|
-
widgetRegistry: b
|
|
5704
|
+
widgetRegistry: b,
|
|
5705
|
+
setStatus: g,
|
|
5706
|
+
formValue: w,
|
|
5707
|
+
validationMode: S,
|
|
5708
|
+
submitting: h
|
|
5685
5709
|
} = t;
|
|
5686
|
-
this.schema = r, this.definition = n, this.horizontal = s, this.path = a, this.ajv = i, this.isPropertyRequired = c ?? !1, this.suppressLabel = l ?? !1, this.schemaConflicts = p ?? [], this.notViolations = m ?? [], this.widgetRegistry = b;
|
|
5710
|
+
this.schema = r, this.definition = n, this.horizontal = s, this.path = a, this.ajv = i, this.isPropertyRequired = c ?? !1, this.suppressLabel = l ?? !1, this.schemaConflicts = p ?? [], this.notViolations = m ?? [], this.widgetRegistry = b, this.setStatus = g, this.formValue = w, this.validationMode = S, this.submitting = h;
|
|
5687
5711
|
}
|
|
5688
5712
|
with = (t) => new en({
|
|
5689
5713
|
schema: t.schema ?? this.schema,
|
|
@@ -5695,7 +5719,11 @@ class en {
|
|
|
5695
5719
|
suppressLabel: t.suppressLabel ?? this.suppressLabel,
|
|
5696
5720
|
schemaConflicts: t.schemaConflicts ?? this.schemaConflicts,
|
|
5697
5721
|
notViolations: t.notViolations ?? this.notViolations,
|
|
5698
|
-
widgetRegistry: t.widgetRegistry ?? this.widgetRegistry
|
|
5722
|
+
widgetRegistry: t.widgetRegistry ?? this.widgetRegistry,
|
|
5723
|
+
setStatus: t.setStatus ?? this.setStatus,
|
|
5724
|
+
formValue: t.formValue ?? this.formValue,
|
|
5725
|
+
validationMode: t.validationMode ?? this.validationMode,
|
|
5726
|
+
submitting: t.submitting ?? this.submitting
|
|
5699
5727
|
});
|
|
5700
5728
|
append = (t) => this.with({ path: [...this.path, t] });
|
|
5701
5729
|
get isRoot() {
|
|
@@ -5853,40 +5881,32 @@ function be({
|
|
|
5853
5881
|
controller: t,
|
|
5854
5882
|
resolved: r
|
|
5855
5883
|
}) {
|
|
5856
|
-
const n = r?.widget
|
|
5884
|
+
const n = r?.widget, s = {
|
|
5885
|
+
controller: t,
|
|
5886
|
+
ctx: e,
|
|
5887
|
+
options: r?.options,
|
|
5888
|
+
setStatus: e.setStatus,
|
|
5889
|
+
formValue: e.formValue,
|
|
5890
|
+
validationMode: e.validationMode,
|
|
5891
|
+
submitting: e.submitting
|
|
5892
|
+
};
|
|
5857
5893
|
if (n != null && e.widgetRegistry) {
|
|
5858
|
-
const
|
|
5859
|
-
if (
|
|
5860
|
-
return
|
|
5861
|
-
controller: t,
|
|
5862
|
-
ctx: e,
|
|
5863
|
-
options: r?.options
|
|
5864
|
-
});
|
|
5894
|
+
const i = e.widgetRegistry.get(n);
|
|
5895
|
+
if (i)
|
|
5896
|
+
return i.factory(s);
|
|
5865
5897
|
}
|
|
5866
5898
|
if (n != null) {
|
|
5867
|
-
const
|
|
5868
|
-
if (
|
|
5869
|
-
return
|
|
5870
|
-
controller: t,
|
|
5871
|
-
ctx: e,
|
|
5872
|
-
options: r?.options
|
|
5873
|
-
});
|
|
5899
|
+
const i = sn.get(n);
|
|
5900
|
+
if (i)
|
|
5901
|
+
return i.factory(s);
|
|
5874
5902
|
}
|
|
5875
5903
|
if (e.widgetRegistry) {
|
|
5876
|
-
const
|
|
5877
|
-
if (
|
|
5878
|
-
return
|
|
5879
|
-
controller: t,
|
|
5880
|
-
ctx: e,
|
|
5881
|
-
options: r?.options
|
|
5882
|
-
});
|
|
5904
|
+
const i = e.widgetRegistry.findBestWidget(e);
|
|
5905
|
+
if (i)
|
|
5906
|
+
return i.registration.factory(s);
|
|
5883
5907
|
}
|
|
5884
|
-
const
|
|
5885
|
-
return
|
|
5886
|
-
controller: t,
|
|
5887
|
-
ctx: e,
|
|
5888
|
-
options: r?.options
|
|
5889
|
-
}) : null;
|
|
5908
|
+
const a = sn.findBestWidget(e);
|
|
5909
|
+
return a ? a.registration.factory(s) : null;
|
|
5890
5910
|
}
|
|
5891
5911
|
function Ts(e) {
|
|
5892
5912
|
const {
|
|
@@ -5904,7 +5924,7 @@ function Ts(e) {
|
|
|
5904
5924
|
);
|
|
5905
5925
|
return hi({
|
|
5906
5926
|
options: m,
|
|
5907
|
-
value:
|
|
5927
|
+
value: ae.map(r, (b) => i(b)),
|
|
5908
5928
|
onChange: (b) => n(c(b)),
|
|
5909
5929
|
size: a
|
|
5910
5930
|
});
|
|
@@ -5934,7 +5954,7 @@ function qs({
|
|
|
5934
5954
|
) : n
|
|
5935
5955
|
});
|
|
5936
5956
|
}
|
|
5937
|
-
function
|
|
5957
|
+
function Dl(e, t) {
|
|
5938
5958
|
if (e === null) return t.includes("null") ? "null" : null;
|
|
5939
5959
|
switch (typeof e) {
|
|
5940
5960
|
case "string":
|
|
@@ -6060,7 +6080,7 @@ const Kl = (e) => {
|
|
|
6060
6080
|
const { value: t, onBlur: r, onChange: n, onInput: s, after: a, disabled: i, ...c } = e, l = as(t, i, n ?? s);
|
|
6061
6081
|
return Gs({
|
|
6062
6082
|
...c,
|
|
6063
|
-
value:
|
|
6083
|
+
value: ae.map(t, (p) => p ?? void 0),
|
|
6064
6084
|
onChange: n != null ? (p) => n(p ?? null) : void 0,
|
|
6065
6085
|
onInput: s != null ? (p) => s(p ?? null) : void 0,
|
|
6066
6086
|
onBlur: r,
|
|
@@ -6100,7 +6120,7 @@ function Wa({
|
|
|
6100
6120
|
placeholder: "HH:MM:SS"
|
|
6101
6121
|
});
|
|
6102
6122
|
case "password":
|
|
6103
|
-
return te(
|
|
6123
|
+
return te(xs, {
|
|
6104
6124
|
...t,
|
|
6105
6125
|
controller: de(r)
|
|
6106
6126
|
});
|
|
@@ -6122,7 +6142,7 @@ function Wa({
|
|
|
6122
6142
|
}
|
|
6123
6143
|
case "uri":
|
|
6124
6144
|
case "url":
|
|
6125
|
-
return te(
|
|
6145
|
+
return te(Ys, {
|
|
6126
6146
|
...t,
|
|
6127
6147
|
controller: de(r),
|
|
6128
6148
|
placeholder: "https://example.com"
|
|
@@ -6190,27 +6210,27 @@ function Wa({
|
|
|
6190
6210
|
});
|
|
6191
6211
|
}
|
|
6192
6212
|
}
|
|
6193
|
-
function
|
|
6213
|
+
function Dr({
|
|
6194
6214
|
ctx: e,
|
|
6195
6215
|
controller: t
|
|
6196
6216
|
}) {
|
|
6197
6217
|
if (tn(e))
|
|
6198
6218
|
return ke();
|
|
6199
|
-
const r = {
|
|
6219
|
+
const r = ye(e.definition, e.name), n = r?.widget, s = be({
|
|
6220
|
+
ctx: e,
|
|
6221
|
+
controller: t,
|
|
6222
|
+
resolved: r
|
|
6223
|
+
});
|
|
6224
|
+
if (s)
|
|
6225
|
+
return s;
|
|
6226
|
+
const a = {
|
|
6200
6227
|
...Ie({ ctx: e }),
|
|
6201
6228
|
placeholder: rt(e.definition, String),
|
|
6202
6229
|
disabled: rn(e)
|
|
6203
6230
|
};
|
|
6204
|
-
if (e.isNullable
|
|
6205
|
-
return Wa({ ctx: e, options:
|
|
6206
|
-
|
|
6207
|
-
ctx: e,
|
|
6208
|
-
controller: t,
|
|
6209
|
-
resolved: n
|
|
6210
|
-
});
|
|
6211
|
-
if (a)
|
|
6212
|
-
return a;
|
|
6213
|
-
if (s != null && [
|
|
6231
|
+
if ((e.isNullable || e.isOptional) && !e.shouldShowPresenceToggle)
|
|
6232
|
+
return Wa({ ctx: e, options: a, controller: t });
|
|
6233
|
+
if (n != null && [
|
|
6214
6234
|
"url",
|
|
6215
6235
|
"uri",
|
|
6216
6236
|
"uri-reference",
|
|
@@ -6223,32 +6243,32 @@ function Vr({
|
|
|
6223
6243
|
"markdown",
|
|
6224
6244
|
"time",
|
|
6225
6245
|
"color"
|
|
6226
|
-
].includes(
|
|
6227
|
-
return Wa({ ctx: e, options:
|
|
6228
|
-
switch (
|
|
6246
|
+
].includes(n))
|
|
6247
|
+
return Wa({ ctx: e, options: a, controller: t });
|
|
6248
|
+
switch (n) {
|
|
6229
6249
|
case "email":
|
|
6230
6250
|
return te(Ci, {
|
|
6231
|
-
...
|
|
6251
|
+
...a,
|
|
6232
6252
|
controller: Xe(t)
|
|
6233
6253
|
});
|
|
6234
6254
|
case "password":
|
|
6235
6255
|
return te(Ii, {
|
|
6236
|
-
...
|
|
6256
|
+
...a,
|
|
6237
6257
|
controller: Xe(t)
|
|
6238
6258
|
});
|
|
6239
6259
|
case "uuid":
|
|
6240
6260
|
return te(bi, {
|
|
6241
|
-
...
|
|
6261
|
+
...a,
|
|
6242
6262
|
controller: Xe(t)
|
|
6243
6263
|
});
|
|
6244
6264
|
case "textarea":
|
|
6245
6265
|
return te($i, {
|
|
6246
|
-
...
|
|
6266
|
+
...a,
|
|
6247
6267
|
controller: Xe(t)
|
|
6248
6268
|
});
|
|
6249
6269
|
default:
|
|
6250
6270
|
return te(ki, {
|
|
6251
|
-
...
|
|
6271
|
+
...a,
|
|
6252
6272
|
controller: Xe(t)
|
|
6253
6273
|
});
|
|
6254
6274
|
}
|
|
@@ -6287,7 +6307,7 @@ function ur({
|
|
|
6287
6307
|
max: r.maximum,
|
|
6288
6308
|
step: r.multipleOf,
|
|
6289
6309
|
disabled: rn(e)
|
|
6290
|
-
}, c = e.isNullable
|
|
6310
|
+
}, c = (e.isNullable || e.isOptional) && !e.shouldShowPresenceToggle;
|
|
6291
6311
|
switch (n.widget) {
|
|
6292
6312
|
case "rating":
|
|
6293
6313
|
const l = (typeof n.options?.max == "number" ? n.options.max : r.maximum) || 5;
|
|
@@ -6391,7 +6411,7 @@ function Fr({
|
|
|
6391
6411
|
...s,
|
|
6392
6412
|
controller: t
|
|
6393
6413
|
});
|
|
6394
|
-
return !e.isNullable
|
|
6414
|
+
return !e.isNullable && (!e.isOptional || e.shouldShowPresenceToggle) ? a : te(on, {
|
|
6395
6415
|
...s,
|
|
6396
6416
|
controller: t,
|
|
6397
6417
|
after: as(
|
|
@@ -6415,7 +6435,7 @@ function Ms({
|
|
|
6415
6435
|
});
|
|
6416
6436
|
}
|
|
6417
6437
|
let qr = /* @__PURE__ */ new WeakMap(), Ha = /* @__PURE__ */ new WeakMap();
|
|
6418
|
-
function
|
|
6438
|
+
function Vs(e, t) {
|
|
6419
6439
|
const r = typeof t == "object" && t != null ? t : null;
|
|
6420
6440
|
if (r != null) {
|
|
6421
6441
|
const i = qr.get(r)?.get(e);
|
|
@@ -6423,7 +6443,7 @@ function Ds(e, t) {
|
|
|
6423
6443
|
}
|
|
6424
6444
|
let n = e;
|
|
6425
6445
|
const s = /* @__PURE__ */ new Set();
|
|
6426
|
-
for (;
|
|
6446
|
+
for (; Ds(n); ) {
|
|
6427
6447
|
const a = n.$ref;
|
|
6428
6448
|
if (!a.startsWith("#")) {
|
|
6429
6449
|
console.warn(`resolveRef: external $ref not supported here: ${a}`);
|
|
@@ -6450,7 +6470,7 @@ function Ds(e, t) {
|
|
|
6450
6470
|
}
|
|
6451
6471
|
return n;
|
|
6452
6472
|
}
|
|
6453
|
-
function
|
|
6473
|
+
function Ds(e) {
|
|
6454
6474
|
return yr(e) && typeof e.$ref == "string";
|
|
6455
6475
|
}
|
|
6456
6476
|
function yr(e) {
|
|
@@ -6482,7 +6502,7 @@ function Fs(e, t, r) {
|
|
|
6482
6502
|
const { $ref: l, ...p } = c;
|
|
6483
6503
|
return { ...i, ...p };
|
|
6484
6504
|
};
|
|
6485
|
-
for (;
|
|
6505
|
+
for (; Ds(n); ) {
|
|
6486
6506
|
const i = n.$ref;
|
|
6487
6507
|
if (s.has(i)) {
|
|
6488
6508
|
console.warn(
|
|
@@ -6580,7 +6600,7 @@ function Gl({
|
|
|
6580
6600
|
controller: t,
|
|
6581
6601
|
content: r
|
|
6582
6602
|
}) {
|
|
6583
|
-
const n =
|
|
6603
|
+
const n = ae.map(t.signal, (i) => i !== void 0), s = e.widgetLabel ?? "Property", a = (i) => {
|
|
6584
6604
|
if (i) {
|
|
6585
6605
|
const c = e.default;
|
|
6586
6606
|
if (c !== void 0)
|
|
@@ -6725,7 +6745,7 @@ function Us(e, t) {
|
|
|
6725
6745
|
return !1;
|
|
6726
6746
|
}
|
|
6727
6747
|
}
|
|
6728
|
-
function
|
|
6748
|
+
function Yl(e, t) {
|
|
6729
6749
|
try {
|
|
6730
6750
|
if (typeof e == "string") {
|
|
6731
6751
|
const r = Xl(e);
|
|
@@ -6736,9 +6756,9 @@ function xl(e, t) {
|
|
|
6736
6756
|
return console.warn("Error evaluating visibility condition:", r), !0;
|
|
6737
6757
|
}
|
|
6738
6758
|
}
|
|
6739
|
-
function
|
|
6740
|
-
return
|
|
6741
|
-
(r) =>
|
|
6759
|
+
function xl(e, t) {
|
|
6760
|
+
return ce(t)(
|
|
6761
|
+
(r) => Yl(e, r)
|
|
6742
6762
|
);
|
|
6743
6763
|
}
|
|
6744
6764
|
const Xa = {
|
|
@@ -6754,7 +6774,7 @@ function Ql({
|
|
|
6754
6774
|
const s = Ls(e.definition);
|
|
6755
6775
|
if (!s)
|
|
6756
6776
|
return r;
|
|
6757
|
-
const a = { ...Xa, ...n }, i = ed(t), c =
|
|
6777
|
+
const a = { ...Xa, ...n }, i = ed(t), c = xl(s, i);
|
|
6758
6778
|
switch (a.clearOnHide && c.on((l) => {
|
|
6759
6779
|
!l && t.signal.value !== void 0 && t.change(void 0);
|
|
6760
6780
|
}), a.behavior) {
|
|
@@ -6818,7 +6838,7 @@ function rd({
|
|
|
6818
6838
|
const s = e.definition;
|
|
6819
6839
|
return ke(
|
|
6820
6840
|
ss(() => {
|
|
6821
|
-
|
|
6841
|
+
ae.get(t.signal) !== s.const && t.change(s.const);
|
|
6822
6842
|
}),
|
|
6823
6843
|
Si(li(e.widgetLabel, ": "), We(String(s.const)))
|
|
6824
6844
|
);
|
|
@@ -6850,7 +6870,7 @@ function nd(e, t, r) {
|
|
|
6850
6870
|
const S = (f) => {
|
|
6851
6871
|
const o = (f ?? "").trim();
|
|
6852
6872
|
if (!o || o === e || Object.prototype.hasOwnProperty.call(
|
|
6853
|
-
|
|
6873
|
+
ae.get(n.signal) ?? {},
|
|
6854
6874
|
o
|
|
6855
6875
|
))
|
|
6856
6876
|
return;
|
|
@@ -6860,24 +6880,24 @@ function nd(e, t, r) {
|
|
|
6860
6880
|
return;
|
|
6861
6881
|
}
|
|
6862
6882
|
g.set(null);
|
|
6863
|
-
const y = { ...
|
|
6864
|
-
delete y[e], y[o] =
|
|
6883
|
+
const y = { ...ae.get(n.signal) ?? {} }, $ = y[e];
|
|
6884
|
+
delete y[e], y[o] = $, n.change(y);
|
|
6865
6885
|
}, h = Wr(
|
|
6866
6886
|
Br,
|
|
6867
6887
|
(f) => ns({
|
|
6868
6888
|
size: "xs",
|
|
6869
6889
|
label: f.$.removeItem,
|
|
6870
6890
|
disabled: !c(
|
|
6871
|
-
Object.keys(
|
|
6891
|
+
Object.keys(ae.get(n.signal) ?? {}).length
|
|
6872
6892
|
),
|
|
6873
6893
|
onClick: () => {
|
|
6874
|
-
const o = Object.keys(
|
|
6894
|
+
const o = Object.keys(ae.get(n.signal) ?? {}).length;
|
|
6875
6895
|
if (!c(o)) return;
|
|
6876
|
-
const d = { ...
|
|
6896
|
+
const d = { ...ae.get(n.signal) ?? {} };
|
|
6877
6897
|
delete d[e], n.change(d);
|
|
6878
6898
|
}
|
|
6879
6899
|
})
|
|
6880
|
-
), u =
|
|
6900
|
+
), u = ae.map(
|
|
6881
6901
|
m.signal,
|
|
6882
6902
|
(f) => l && f != null
|
|
6883
6903
|
);
|
|
@@ -6888,7 +6908,7 @@ function nd(e, t, r) {
|
|
|
6888
6908
|
content: rs({
|
|
6889
6909
|
value: b,
|
|
6890
6910
|
onChange: S,
|
|
6891
|
-
disabled:
|
|
6911
|
+
disabled: ce(
|
|
6892
6912
|
n.disabled,
|
|
6893
6913
|
u
|
|
6894
6914
|
)((f, o) => f || o)
|
|
@@ -6904,7 +6924,7 @@ function nd(e, t, r) {
|
|
|
6904
6924
|
) : null
|
|
6905
6925
|
}),
|
|
6906
6926
|
J.div(
|
|
6907
|
-
|
|
6927
|
+
Ve({
|
|
6908
6928
|
ctx: s.with({ definition: w, suppressLabel: !0 }).append(e),
|
|
6909
6929
|
controller: m
|
|
6910
6930
|
})
|
|
@@ -6944,7 +6964,7 @@ function ad(e, t, r) {
|
|
|
6944
6964
|
const h = (o) => {
|
|
6945
6965
|
const d = (o ?? "").trim();
|
|
6946
6966
|
if (!d || d === e || Object.prototype.hasOwnProperty.call(
|
|
6947
|
-
|
|
6967
|
+
ae.get(n.signal) ?? {},
|
|
6948
6968
|
d
|
|
6949
6969
|
))
|
|
6950
6970
|
return;
|
|
@@ -6954,24 +6974,24 @@ function ad(e, t, r) {
|
|
|
6954
6974
|
return;
|
|
6955
6975
|
}
|
|
6956
6976
|
w.set(null);
|
|
6957
|
-
const
|
|
6958
|
-
delete
|
|
6977
|
+
const $ = { ...ae.get(n.signal) ?? {} }, _ = $[e];
|
|
6978
|
+
delete $[e], $[d] = _, n.change($);
|
|
6959
6979
|
}, u = Wr(
|
|
6960
6980
|
Br,
|
|
6961
6981
|
(o) => ns({
|
|
6962
6982
|
size: "xs",
|
|
6963
6983
|
label: o.$.removeItem,
|
|
6964
6984
|
disabled: !l(
|
|
6965
|
-
Object.keys(
|
|
6985
|
+
Object.keys(ae.get(n.signal) ?? {}).length
|
|
6966
6986
|
),
|
|
6967
6987
|
onClick: () => {
|
|
6968
|
-
const d = Object.keys(
|
|
6988
|
+
const d = Object.keys(ae.get(n.signal) ?? {}).length;
|
|
6969
6989
|
if (!l(d)) return;
|
|
6970
|
-
const y = { ...
|
|
6990
|
+
const y = { ...ae.get(n.signal) ?? {} };
|
|
6971
6991
|
delete y[e], n.change(y);
|
|
6972
6992
|
}
|
|
6973
6993
|
})
|
|
6974
|
-
), f =
|
|
6994
|
+
), f = ae.map(
|
|
6975
6995
|
b.signal,
|
|
6976
6996
|
(o) => p && o != null
|
|
6977
6997
|
);
|
|
@@ -6982,7 +7002,7 @@ function ad(e, t, r) {
|
|
|
6982
7002
|
content: rs({
|
|
6983
7003
|
value: g,
|
|
6984
7004
|
onChange: h,
|
|
6985
|
-
disabled:
|
|
7005
|
+
disabled: ce(
|
|
6986
7006
|
n.disabled,
|
|
6987
7007
|
f
|
|
6988
7008
|
)((o, d) => o || d)
|
|
@@ -7001,7 +7021,7 @@ function ad(e, t, r) {
|
|
|
7001
7021
|
)
|
|
7002
7022
|
}),
|
|
7003
7023
|
J.div(
|
|
7004
|
-
|
|
7024
|
+
Ve({
|
|
7005
7025
|
ctx: s.with({ definition: S, suppressLabel: !0 }).append(e),
|
|
7006
7026
|
controller: b
|
|
7007
7027
|
})
|
|
@@ -7048,7 +7068,7 @@ function cd({
|
|
|
7048
7068
|
cols: e = 1,
|
|
7049
7069
|
children: t
|
|
7050
7070
|
}) {
|
|
7051
|
-
const r = typeof e == "number" ? `bc-schema-grid bc-schema-grid--cols-${e}` :
|
|
7071
|
+
const r = typeof e == "number" ? `bc-schema-grid bc-schema-grid--cols-${e}` : ce(e)((n) => {
|
|
7052
7072
|
if (typeof n == "number")
|
|
7053
7073
|
return `bc-schema-grid bc-schema-grid--cols-${n}`;
|
|
7054
7074
|
if (n && typeof n == "object") {
|
|
@@ -7081,7 +7101,7 @@ function ud({
|
|
|
7081
7101
|
K.type("button"),
|
|
7082
7102
|
K.class("bc-tabs__tab"),
|
|
7083
7103
|
K.class(
|
|
7084
|
-
|
|
7104
|
+
ce(r)(
|
|
7085
7105
|
(i) => i === s ? "bc-tabs__tab--active" : ""
|
|
7086
7106
|
)
|
|
7087
7107
|
),
|
|
@@ -7121,7 +7141,7 @@ function ud({
|
|
|
7121
7141
|
([s, a]) => J.div(
|
|
7122
7142
|
K.class("bc-tabs__panel"),
|
|
7123
7143
|
K.class(
|
|
7124
|
-
|
|
7144
|
+
ce(r)(
|
|
7125
7145
|
(i) => i === s ? "bc-tabs__panel--active" : "bc-tabs__panel--hidden"
|
|
7126
7146
|
)
|
|
7127
7147
|
),
|
|
@@ -7164,7 +7184,7 @@ function dd({
|
|
|
7164
7184
|
return J.div(
|
|
7165
7185
|
K.class("bc-accordion"),
|
|
7166
7186
|
...r.map(([s, a]) => {
|
|
7167
|
-
const i =
|
|
7187
|
+
const i = ce(n)(
|
|
7168
7188
|
(c) => c.has(s)
|
|
7169
7189
|
);
|
|
7170
7190
|
return J.div(
|
|
@@ -7186,7 +7206,7 @@ function dd({
|
|
|
7186
7206
|
}),
|
|
7187
7207
|
J.span(s),
|
|
7188
7208
|
us({
|
|
7189
|
-
icon:
|
|
7209
|
+
icon: ce(i)(
|
|
7190
7210
|
(c) => c ? "chevron-up" : "chevron-down"
|
|
7191
7211
|
),
|
|
7192
7212
|
size: "sm"
|
|
@@ -7195,7 +7215,7 @@ function dd({
|
|
|
7195
7215
|
J.div(
|
|
7196
7216
|
K.class("bc-accordion__content"),
|
|
7197
7217
|
K.class(
|
|
7198
|
-
|
|
7218
|
+
ce(i)(
|
|
7199
7219
|
(c) => c ? "bc-accordion__content--open" : "bc-accordion__content--closed"
|
|
7200
7220
|
)
|
|
7201
7221
|
),
|
|
@@ -7223,7 +7243,7 @@ function fd({
|
|
|
7223
7243
|
tt.click(() => r.set(!r.value)),
|
|
7224
7244
|
J.span(e),
|
|
7225
7245
|
us({
|
|
7226
|
-
icon:
|
|
7246
|
+
icon: ce(r)(
|
|
7227
7247
|
(n) => n ? "chevron-up" : "chevron-down"
|
|
7228
7248
|
),
|
|
7229
7249
|
size: "sm"
|
|
@@ -7232,7 +7252,7 @@ function fd({
|
|
|
7232
7252
|
J.div(
|
|
7233
7253
|
K.class("bc-accordion__content"),
|
|
7234
7254
|
K.class(
|
|
7235
|
-
|
|
7255
|
+
ce(r)(
|
|
7236
7256
|
(n) => n ? "bc-accordion__content--open" : "bc-accordion__content--closed"
|
|
7237
7257
|
)
|
|
7238
7258
|
),
|
|
@@ -7321,7 +7341,7 @@ function Ks({
|
|
|
7321
7341
|
resolved: r
|
|
7322
7342
|
});
|
|
7323
7343
|
return n || fr(t.signal, (s) => {
|
|
7324
|
-
const a = e.definition, { effective: i, conflicts: c } =
|
|
7344
|
+
const a = e.definition, { effective: i, conflicts: c } = Vl(
|
|
7325
7345
|
a,
|
|
7326
7346
|
s,
|
|
7327
7347
|
e.ajv,
|
|
@@ -7335,25 +7355,25 @@ function Ks({
|
|
|
7335
7355
|
e.ajv
|
|
7336
7356
|
), h = g.filter((R) => !S.has(R)), u = g.filter(
|
|
7337
7357
|
(R) => S.has(R)
|
|
7338
|
-
), f = i.additionalProperties ?? !0, o = f !== !1, d = f === !0 || f === void 0 ? {} : f, y = i.minProperties ?? 0,
|
|
7358
|
+
), f = i.additionalProperties ?? !0, o = f !== !1, d = f === !0 || f === void 0 ? {} : f, y = i.minProperties ?? 0, $ = i.maxProperties ?? 1 / 0;
|
|
7339
7359
|
let _ = !0, P = null;
|
|
7340
7360
|
w === !1 ? (_ = !1, P = "No unevaluated properties are allowed by schema") : w && typeof w == "object" && (_ = !0);
|
|
7341
|
-
const N = o && _ && b.length <
|
|
7361
|
+
const N = o && _ && b.length < $, q = (R) => R > y, L = i.patternProperties ?? {}, I = Object.keys(L).filter(Boolean).map((R) => {
|
|
7342
7362
|
try {
|
|
7343
7363
|
return new RegExp(R);
|
|
7344
7364
|
} catch {
|
|
7345
7365
|
return null;
|
|
7346
7366
|
}
|
|
7347
|
-
}).filter((R) => R != null),
|
|
7367
|
+
}).filter((R) => R != null), D = i.propertyNames, U = (R) => {
|
|
7348
7368
|
const F = (R ?? "").trim();
|
|
7349
7369
|
if (F === "") return { ok: !1, message: "Key cannot be empty" };
|
|
7350
|
-
if (
|
|
7370
|
+
if (D === !1)
|
|
7351
7371
|
return { ok: !1, message: "No property names are allowed by schema" };
|
|
7352
|
-
if (
|
|
7372
|
+
if (D && typeof D == "object" && e.ajv)
|
|
7353
7373
|
try {
|
|
7354
|
-
const
|
|
7355
|
-
if (!
|
|
7356
|
-
return { ok: !1, message:
|
|
7374
|
+
const V = e.ajv.compile(D);
|
|
7375
|
+
if (!V(F))
|
|
7376
|
+
return { ok: !1, message: V.errors?.[0]?.message ?? "Invalid property name" };
|
|
7357
7377
|
} catch {
|
|
7358
7378
|
}
|
|
7359
7379
|
if (!o && !m.has(F)) {
|
|
@@ -7362,26 +7382,26 @@ function Ks({
|
|
|
7362
7382
|
if (!I.some((X) => X.test(F)))
|
|
7363
7383
|
return {
|
|
7364
7384
|
ok: !1,
|
|
7365
|
-
message: `Key must match one of: ${Object.keys(
|
|
7385
|
+
message: `Key must match one of: ${Object.keys(L).join(", ")}`
|
|
7366
7386
|
};
|
|
7367
7387
|
}
|
|
7368
7388
|
return { ok: !0 };
|
|
7369
|
-
}, W = i["x:ui"], ee = !!(W && typeof W == "object" && W.lockKeyAfterSet),
|
|
7389
|
+
}, W = i["x:ui"], ee = !!(W && typeof W == "object" && W.lockKeyAfterSet), oe = (R) => {
|
|
7370
7390
|
const F = rt(R, (X) => X);
|
|
7371
7391
|
if (F !== void 0) return F;
|
|
7372
|
-
const
|
|
7373
|
-
if (
|
|
7374
|
-
if (
|
|
7375
|
-
if (
|
|
7376
|
-
if (
|
|
7377
|
-
if (
|
|
7378
|
-
},
|
|
7379
|
-
const
|
|
7380
|
-
if (X(
|
|
7392
|
+
const V = R.type;
|
|
7393
|
+
if (V === "string") return "";
|
|
7394
|
+
if (V === "number" || V === "integer") return 0;
|
|
7395
|
+
if (V === "boolean") return !1;
|
|
7396
|
+
if (V === "array") return [];
|
|
7397
|
+
if (V === "object") return {};
|
|
7398
|
+
}, re = (R, F) => {
|
|
7399
|
+
const V = R, X = (E) => F.has(E) ? !1 : U(E).ok;
|
|
7400
|
+
if (X(V)) return V;
|
|
7381
7401
|
let G = 1;
|
|
7382
|
-
for (; F.has(
|
|
7383
|
-
return
|
|
7384
|
-
},
|
|
7402
|
+
for (; F.has(V + G) || !X(V + G); ) G++;
|
|
7403
|
+
return V + G;
|
|
7404
|
+
}, Z = Wr(
|
|
7385
7405
|
Br,
|
|
7386
7406
|
(R) => Ni(
|
|
7387
7407
|
{
|
|
@@ -7390,14 +7410,14 @@ function Ks({
|
|
|
7390
7410
|
onClick: () => {
|
|
7391
7411
|
if (!N) return;
|
|
7392
7412
|
const F = new Set(
|
|
7393
|
-
Object.keys(
|
|
7394
|
-
),
|
|
7395
|
-
if (!
|
|
7413
|
+
Object.keys(ae.get(t.signal) ?? {})
|
|
7414
|
+
), V = re("property", F);
|
|
7415
|
+
if (!U(V).ok) return;
|
|
7396
7416
|
let G = d;
|
|
7397
7417
|
w && typeof w == "object" && (G = w);
|
|
7398
|
-
const E =
|
|
7399
|
-
...
|
|
7400
|
-
[
|
|
7418
|
+
const E = oe(G), A = {
|
|
7419
|
+
...ae.get(t.signal) ?? {},
|
|
7420
|
+
[V]: E
|
|
7401
7421
|
};
|
|
7402
7422
|
t.change(A);
|
|
7403
7423
|
}
|
|
@@ -7405,7 +7425,7 @@ function Ks({
|
|
|
7405
7425
|
K.title(P),
|
|
7406
7426
|
R.$.addLabel
|
|
7407
7427
|
)
|
|
7408
|
-
),
|
|
7428
|
+
), se = sd(l), M = Ti(p).filter(
|
|
7409
7429
|
([, R]) => R !== !1
|
|
7410
7430
|
), C = [
|
|
7411
7431
|
...M.map(([R]) => R),
|
|
@@ -7414,57 +7434,57 @@ function Ks({
|
|
|
7414
7434
|
], k = [
|
|
7415
7435
|
// Known properties
|
|
7416
7436
|
...M.map(([R, F]) => {
|
|
7417
|
-
const
|
|
7418
|
-
return
|
|
7437
|
+
const V = R, X = t.field(V);
|
|
7438
|
+
return Ve({
|
|
7419
7439
|
ctx: l.with({
|
|
7420
7440
|
definition: F,
|
|
7421
|
-
isPropertyRequired: Array.isArray(i.required) ? i.required.includes(
|
|
7441
|
+
isPropertyRequired: Array.isArray(i.required) ? i.required.includes(V) : l.hasRequiredProperty(V),
|
|
7422
7442
|
// Ensure child fields show their own labels even when this object
|
|
7423
7443
|
// is rendered inside a union/combinator where labels are suppressed
|
|
7424
7444
|
suppressLabel: !1
|
|
7425
|
-
}).append(
|
|
7445
|
+
}).append(V),
|
|
7426
7446
|
controller: X
|
|
7427
7447
|
});
|
|
7428
7448
|
}),
|
|
7429
7449
|
// Evaluated additional keys (pattern-matched and truly additional)
|
|
7430
7450
|
...u.map((R) => {
|
|
7431
|
-
const F = I.some((
|
|
7451
|
+
const F = I.some((V) => V.test(R));
|
|
7432
7452
|
return nd(R, F, {
|
|
7433
7453
|
controller: t,
|
|
7434
7454
|
effCtx: l,
|
|
7435
|
-
patternProps:
|
|
7455
|
+
patternProps: L,
|
|
7436
7456
|
apSchema: d,
|
|
7437
7457
|
canRemove: q,
|
|
7438
7458
|
lockKeyAfterSet: ee,
|
|
7439
|
-
validatePropertyName:
|
|
7459
|
+
validatePropertyName: U
|
|
7440
7460
|
});
|
|
7441
7461
|
}),
|
|
7442
7462
|
// Unevaluated keys (use unevaluatedProperties schema if available)
|
|
7443
7463
|
...h.map((R) => {
|
|
7444
|
-
const F = I.some((
|
|
7464
|
+
const F = I.some((V) => V.test(R));
|
|
7445
7465
|
return ad(R, F, {
|
|
7446
7466
|
controller: t,
|
|
7447
7467
|
effCtx: l,
|
|
7448
|
-
patternProps:
|
|
7468
|
+
patternProps: L,
|
|
7449
7469
|
apSchema: d,
|
|
7450
7470
|
unevaluatedProps: w,
|
|
7451
7471
|
canRemove: q,
|
|
7452
7472
|
lockKeyAfterSet: ee,
|
|
7453
|
-
validatePropertyName:
|
|
7473
|
+
validatePropertyName: U
|
|
7454
7474
|
});
|
|
7455
7475
|
}),
|
|
7456
7476
|
// Add affordance
|
|
7457
|
-
o ?
|
|
7458
|
-
].filter(Boolean),
|
|
7459
|
-
|
|
7477
|
+
o ? Z : null
|
|
7478
|
+
].filter(Boolean), v = md(
|
|
7479
|
+
se,
|
|
7460
7480
|
l,
|
|
7461
7481
|
k,
|
|
7462
7482
|
C
|
|
7463
7483
|
);
|
|
7464
|
-
return !l.suppressLabel && l.name != null && (!
|
|
7484
|
+
return !l.suppressLabel && l.name != null && (!se || !["fieldset", "group"].includes(se.format || "")) ? nt({
|
|
7465
7485
|
...Ie({ ctx: l }),
|
|
7466
|
-
content:
|
|
7467
|
-
}) :
|
|
7486
|
+
content: v
|
|
7487
|
+
}) : v;
|
|
7468
7488
|
});
|
|
7469
7489
|
}
|
|
7470
7490
|
function pd(e, t, r) {
|
|
@@ -7480,7 +7500,7 @@ function pd(e, t, r) {
|
|
|
7480
7500
|
if (typeof m == "object" && m != null && "$ref" in m) {
|
|
7481
7501
|
const b = m.$ref;
|
|
7482
7502
|
if (typeof b == "string" && b.startsWith("#"))
|
|
7483
|
-
return
|
|
7503
|
+
return Vs(m, e.schema);
|
|
7484
7504
|
}
|
|
7485
7505
|
return m;
|
|
7486
7506
|
}), i = [];
|
|
@@ -7492,12 +7512,12 @@ function pd(e, t, r) {
|
|
|
7492
7512
|
}
|
|
7493
7513
|
if (r)
|
|
7494
7514
|
try {
|
|
7495
|
-
|
|
7515
|
+
xr(r, b)(t) && i.push(m);
|
|
7496
7516
|
} catch (g) {
|
|
7497
|
-
console.warn(`Failed to compile oneOf branch ${m}:`, g),
|
|
7517
|
+
console.warn(`Failed to compile oneOf branch ${m}:`, g), Ya(b, t) && i.push(m);
|
|
7498
7518
|
}
|
|
7499
7519
|
else
|
|
7500
|
-
|
|
7520
|
+
Ya(b, t) && i.push(m);
|
|
7501
7521
|
}
|
|
7502
7522
|
const c = i.length > 1, l = i.length === 0;
|
|
7503
7523
|
return {
|
|
@@ -7507,7 +7527,7 @@ function pd(e, t, r) {
|
|
|
7507
7527
|
hasNoMatch: l
|
|
7508
7528
|
};
|
|
7509
7529
|
}
|
|
7510
|
-
function
|
|
7530
|
+
function Ya(e, t) {
|
|
7511
7531
|
if ("const" in e)
|
|
7512
7532
|
return e.const === t;
|
|
7513
7533
|
if (Array.isArray(e.enum))
|
|
@@ -7543,7 +7563,7 @@ function yd(e, t, r = `Option ${t + 1}`) {
|
|
|
7543
7563
|
}
|
|
7544
7564
|
return "const" in e && typeof e.const == "string" ? e.const : e.type ? (Array.isArray(e.type) ? e.type : [e.type]).join(" | ") : r;
|
|
7545
7565
|
}
|
|
7546
|
-
function
|
|
7566
|
+
function xa(e, t, r) {
|
|
7547
7567
|
const n = pd(e, t, r);
|
|
7548
7568
|
return n.matchingBranch !== -1 ? n.matchingBranch : -1;
|
|
7549
7569
|
}
|
|
@@ -7670,7 +7690,7 @@ function ff({
|
|
|
7670
7690
|
definition: i,
|
|
7671
7691
|
schemaConflicts: [...e.schemaConflicts, ...c]
|
|
7672
7692
|
});
|
|
7673
|
-
return
|
|
7693
|
+
return Ve({
|
|
7674
7694
|
ctx: l,
|
|
7675
7695
|
controller: t
|
|
7676
7696
|
});
|
|
@@ -7681,7 +7701,7 @@ function Ws({
|
|
|
7681
7701
|
kind: r,
|
|
7682
7702
|
variants: n
|
|
7683
7703
|
}) {
|
|
7684
|
-
const s = n.map((h, u) => yd(h, u, `${r} ${u + 1}`)), a = typeof e.definition == "boolean" ? { discriminator: null, type: null } : gd(e.definition), i =
|
|
7704
|
+
const s = n.map((h, u) => yd(h, u, `${r} ${u + 1}`)), a = typeof e.definition == "boolean" ? { discriminator: null, type: null } : gd(e.definition), i = ce(
|
|
7685
7705
|
t.signal,
|
|
7686
7706
|
e.ajv
|
|
7687
7707
|
)((h, u) => {
|
|
@@ -7695,10 +7715,10 @@ function Ws({
|
|
|
7695
7715
|
if (f !== null)
|
|
7696
7716
|
return f;
|
|
7697
7717
|
}
|
|
7698
|
-
return
|
|
7718
|
+
return xa(e, h, u);
|
|
7699
7719
|
}
|
|
7700
|
-
return
|
|
7701
|
-
}), c =
|
|
7720
|
+
return xa(e, h, u);
|
|
7721
|
+
}), c = ae.get(i), l = Ne(c >= 0 ? c : 0);
|
|
7702
7722
|
t.onDispose(l.dispose);
|
|
7703
7723
|
let p = !1;
|
|
7704
7724
|
const m = i.on((h) => {
|
|
@@ -7715,9 +7735,9 @@ function Ws({
|
|
|
7715
7735
|
selected: l,
|
|
7716
7736
|
onChange: g
|
|
7717
7737
|
// auto mode chooses segmented for <=3
|
|
7718
|
-
}) : "", S = fr(l, (h) =>
|
|
7738
|
+
}) : "", S = fr(l, (h) => Ve({
|
|
7719
7739
|
ctx: e.with({
|
|
7720
|
-
definition: n[
|
|
7740
|
+
definition: n[ae.get(h)],
|
|
7721
7741
|
// Suppress inner labels only when combinator is nested (non-root)
|
|
7722
7742
|
suppressLabel: !e.isRoot
|
|
7723
7743
|
}),
|
|
@@ -7730,12 +7750,12 @@ function Ws({
|
|
|
7730
7750
|
inner: S
|
|
7731
7751
|
});
|
|
7732
7752
|
}
|
|
7733
|
-
function
|
|
7753
|
+
function Ve({
|
|
7734
7754
|
ctx: e,
|
|
7735
7755
|
controller: t
|
|
7736
7756
|
}) {
|
|
7737
7757
|
const r = typeof e.definition == "boolean" ? {} : e.definition;
|
|
7738
|
-
let n = r?.$ref ?
|
|
7758
|
+
let n = r?.$ref ? Vs(r, e.schema) : r, s = e.with({ definition: n });
|
|
7739
7759
|
if (n?.allOf != null) {
|
|
7740
7760
|
const i = n.allOf.filter(
|
|
7741
7761
|
(c) => typeof c == "object" && c !== null
|
|
@@ -7752,7 +7772,7 @@ function De({
|
|
|
7752
7772
|
}
|
|
7753
7773
|
let a = [...s.notViolations];
|
|
7754
7774
|
if (n?.not != null && typeof n.not == "object") {
|
|
7755
|
-
const i =
|
|
7775
|
+
const i = ae.get(t.signal), c = Ml(
|
|
7756
7776
|
n.not,
|
|
7757
7777
|
i,
|
|
7758
7778
|
s.ajv,
|
|
@@ -7859,7 +7879,7 @@ function De({
|
|
|
7859
7879
|
case "string":
|
|
7860
7880
|
return ie(
|
|
7861
7881
|
s,
|
|
7862
|
-
|
|
7882
|
+
Dr({
|
|
7863
7883
|
ctx: s,
|
|
7864
7884
|
controller: t
|
|
7865
7885
|
}),
|
|
@@ -7921,7 +7941,7 @@ function De({
|
|
|
7921
7941
|
t,
|
|
7922
7942
|
ie(
|
|
7923
7943
|
s,
|
|
7924
|
-
|
|
7944
|
+
Dr({
|
|
7925
7945
|
ctx: s,
|
|
7926
7946
|
controller: t
|
|
7927
7947
|
}),
|
|
@@ -8002,18 +8022,26 @@ function wd({
|
|
|
8002
8022
|
schema: e,
|
|
8003
8023
|
controller: t,
|
|
8004
8024
|
ajv: r,
|
|
8005
|
-
widgetRegistry: n
|
|
8025
|
+
widgetRegistry: n,
|
|
8026
|
+
setStatus: s,
|
|
8027
|
+
formValue: a,
|
|
8028
|
+
validationMode: i,
|
|
8029
|
+
submitting: c
|
|
8006
8030
|
}) {
|
|
8007
|
-
const
|
|
8031
|
+
const l = new en({
|
|
8008
8032
|
schema: e,
|
|
8009
8033
|
definition: e,
|
|
8010
8034
|
horizontal: !1,
|
|
8011
8035
|
isPropertyRequired: !1,
|
|
8012
8036
|
path: [],
|
|
8013
8037
|
ajv: r,
|
|
8014
|
-
widgetRegistry: n
|
|
8038
|
+
widgetRegistry: n,
|
|
8039
|
+
setStatus: s,
|
|
8040
|
+
formValue: a,
|
|
8041
|
+
validationMode: i,
|
|
8042
|
+
submitting: c
|
|
8015
8043
|
});
|
|
8016
|
-
return e === !0 ? lr({ ctx:
|
|
8044
|
+
return e === !0 ? lr({ ctx: l, controller: t }) : e === !1 ? ke() : Ve({ ctx: l, controller: t });
|
|
8017
8045
|
}
|
|
8018
8046
|
function he(e, t, r) {
|
|
8019
8047
|
return Ls(e.definition) ? Ql({
|
|
@@ -8061,13 +8089,13 @@ function Bs({
|
|
|
8061
8089
|
});
|
|
8062
8090
|
if (n)
|
|
8063
8091
|
return n;
|
|
8064
|
-
const s = e.definition, a = Sd(s), i =
|
|
8092
|
+
const s = e.definition, a = Sd(s), i = ce(t.signal)((g) => {
|
|
8065
8093
|
const w = g?.length ?? 0;
|
|
8066
8094
|
return !(s.maxItems != null && w >= s.maxItems || a.isTuple && w >= a.prefixItems.length && a.additionalItemsSchema === !1);
|
|
8067
|
-
}), c =
|
|
8095
|
+
}), c = ce(t.signal)((g) => {
|
|
8068
8096
|
const w = g?.length ?? 0;
|
|
8069
8097
|
return s.minItems == null || w > s.minItems;
|
|
8070
|
-
}), l =
|
|
8098
|
+
}), l = ce(t.signal)((g) => {
|
|
8071
8099
|
if (!s.uniqueItems || !g) return /* @__PURE__ */ new Set();
|
|
8072
8100
|
const w = /* @__PURE__ */ new Map(), S = /* @__PURE__ */ new Set();
|
|
8073
8101
|
for (let h = 0; h < g.length; h++) {
|
|
@@ -8075,7 +8103,7 @@ function Bs({
|
|
|
8075
8103
|
w.has(u) ? (S.add(w.get(u)), S.add(h)) : w.set(u, h);
|
|
8076
8104
|
}
|
|
8077
8105
|
return S;
|
|
8078
|
-
}), p =
|
|
8106
|
+
}), p = ce(t.signal)((g) => {
|
|
8079
8107
|
if (!s.contains || !g)
|
|
8080
8108
|
return { matchingIndices: /* @__PURE__ */ new Set(), count: 0, isValid: !0 };
|
|
8081
8109
|
const w = /* @__PURE__ */ new Set();
|
|
@@ -8091,15 +8119,15 @@ function Bs({
|
|
|
8091
8119
|
const o = s.contains, d = (y) => {
|
|
8092
8120
|
if (typeof o == "boolean") return o;
|
|
8093
8121
|
if (typeof o != "object" || o == null) return !1;
|
|
8094
|
-
const
|
|
8122
|
+
const $ = o, _ = $.type;
|
|
8095
8123
|
if (_ === "integer" || _ === "number")
|
|
8096
|
-
return !(typeof y != "number" || !Number.isFinite(y) || _ === "integer" && !Number.isInteger(y) || typeof
|
|
8124
|
+
return !(typeof y != "number" || !Number.isFinite(y) || _ === "integer" && !Number.isInteger(y) || typeof $.minimum == "number" && y < $.minimum || typeof $.exclusiveMinimum == "number" && y <= $.exclusiveMinimum || typeof $.maximum == "number" && y > $.maximum || typeof $.exclusiveMaximum == "number" && y >= $.exclusiveMaximum || typeof $.multipleOf == "number" && y % $.multipleOf !== 0);
|
|
8097
8125
|
if (_ === "string") {
|
|
8098
|
-
if (typeof y != "string" || typeof
|
|
8126
|
+
if (typeof y != "string" || typeof $.minLength == "number" && y.length < $.minLength || typeof $.maxLength == "number" && y.length > $.maxLength)
|
|
8099
8127
|
return !1;
|
|
8100
|
-
if (typeof
|
|
8128
|
+
if (typeof $.pattern == "string")
|
|
8101
8129
|
try {
|
|
8102
|
-
if (!new RegExp(
|
|
8130
|
+
if (!new RegExp($.pattern).test(y)) return !1;
|
|
8103
8131
|
} catch {
|
|
8104
8132
|
}
|
|
8105
8133
|
return !0;
|
|
@@ -8138,14 +8166,14 @@ function Bs({
|
|
|
8138
8166
|
controller: t,
|
|
8139
8167
|
// Always render add/remove controls but disable them when constraints forbid actions
|
|
8140
8168
|
showAdd: !0,
|
|
8141
|
-
addDisabled:
|
|
8169
|
+
addDisabled: ce(i)((g) => !g),
|
|
8142
8170
|
showRemove: !0,
|
|
8143
|
-
removeDisabled:
|
|
8171
|
+
removeDisabled: ce(c)((g) => !g),
|
|
8144
8172
|
element: (g) => {
|
|
8145
8173
|
const w = g.item, S = g.position.index;
|
|
8146
8174
|
let h, u;
|
|
8147
8175
|
a.isTuple && S < a.prefixItems.length ? (h = a.prefixItems[S], a.tupleLabels?.[S] ? u = a.tupleLabels[S] : typeof h == "object" && h.title ? u = h.title : u = `Item ${S + 1}`) : (h = a.additionalItemsSchema, a.isTuple && (u = `Additional Item ${S - a.prefixItems.length + 1}`));
|
|
8148
|
-
const f =
|
|
8176
|
+
const f = Ve({
|
|
8149
8177
|
ctx: e.with({ definition: h }).append(S),
|
|
8150
8178
|
controller: w
|
|
8151
8179
|
}), o = l.map((_) => _.has(S)), d = p.map(
|
|
@@ -8157,8 +8185,8 @@ function Bs({
|
|
|
8157
8185
|
We(K.class("bc-array-control__item-label"), u),
|
|
8158
8186
|
y
|
|
8159
8187
|
));
|
|
8160
|
-
const
|
|
8161
|
-
return s.uniqueItems &&
|
|
8188
|
+
const $ = [];
|
|
8189
|
+
return s.uniqueItems && $.push(
|
|
8162
8190
|
et(
|
|
8163
8191
|
o,
|
|
8164
8192
|
() => We(
|
|
@@ -8168,7 +8196,7 @@ function Bs({
|
|
|
8168
8196
|
"⚠️ Duplicate value"
|
|
8169
8197
|
)
|
|
8170
8198
|
)
|
|
8171
|
-
), s.contains &&
|
|
8199
|
+
), s.contains && $.push(
|
|
8172
8200
|
et(
|
|
8173
8201
|
d,
|
|
8174
8202
|
() => We(
|
|
@@ -8178,14 +8206,14 @@ function Bs({
|
|
|
8178
8206
|
"✓ Matches required pattern"
|
|
8179
8207
|
)
|
|
8180
8208
|
)
|
|
8181
|
-
),
|
|
8209
|
+
), $.length > 0 ? me(K.class("bc-stack--gap-1"), y, ...$) : y;
|
|
8182
8210
|
}
|
|
8183
8211
|
});
|
|
8184
8212
|
return s.contains && m ? me(
|
|
8185
8213
|
K.class("bc-stack--gap-2"),
|
|
8186
8214
|
b,
|
|
8187
8215
|
fr(
|
|
8188
|
-
|
|
8216
|
+
ce(
|
|
8189
8217
|
p,
|
|
8190
8218
|
m
|
|
8191
8219
|
)((g, w) => ({
|
|
@@ -8205,7 +8233,7 @@ function Pd(e) {
|
|
|
8205
8233
|
return e.map((t) => ({
|
|
8206
8234
|
key: t,
|
|
8207
8235
|
label: Kr(t),
|
|
8208
|
-
detect: (r) =>
|
|
8236
|
+
detect: (r) => Dl(r, [t]) === t,
|
|
8209
8237
|
convert: (r) => zl(r, t),
|
|
8210
8238
|
defaultValue: () => Fl(t)
|
|
8211
8239
|
}));
|
|
@@ -8244,7 +8272,7 @@ function Js({
|
|
|
8244
8272
|
}), w = (h) => {
|
|
8245
8273
|
b.switchToBranch(h, i.confirmBranchChange);
|
|
8246
8274
|
}, S = fr(b.activeBranch, (h) => {
|
|
8247
|
-
const u =
|
|
8275
|
+
const u = ae.get(h), f = b.getBranchController(u);
|
|
8248
8276
|
if (p && (u === "number" || u === "integer")) {
|
|
8249
8277
|
const d = s;
|
|
8250
8278
|
return te(Mr, {
|
|
@@ -8265,7 +8293,7 @@ function Js({
|
|
|
8265
8293
|
});
|
|
8266
8294
|
switch (u) {
|
|
8267
8295
|
case "string":
|
|
8268
|
-
return
|
|
8296
|
+
return Dr({
|
|
8269
8297
|
ctx: o,
|
|
8270
8298
|
controller: f
|
|
8271
8299
|
});
|
|
@@ -8403,7 +8431,7 @@ function Ed(e, t, r = !1) {
|
|
|
8403
8431
|
message: "Cross-field validation error"
|
|
8404
8432
|
});
|
|
8405
8433
|
}
|
|
8406
|
-
return n.length > 0 ?
|
|
8434
|
+
return n.length > 0 ? Yr(n) : Ee.valid;
|
|
8407
8435
|
}
|
|
8408
8436
|
function Od(e, t) {
|
|
8409
8437
|
if (e == null || typeof e != "object")
|
|
@@ -8523,7 +8551,7 @@ function kd(e, t, r, n) {
|
|
|
8523
8551
|
s.push(...i);
|
|
8524
8552
|
}
|
|
8525
8553
|
}
|
|
8526
|
-
return s.length > 0 ?
|
|
8554
|
+
return s.length > 0 ? Yr(s) : Ee.valid;
|
|
8527
8555
|
}
|
|
8528
8556
|
function Nd(e) {
|
|
8529
8557
|
if (e.type === "valid") return [];
|
|
@@ -8703,7 +8731,7 @@ function qd(e) {
|
|
|
8703
8731
|
if (n !== void 0)
|
|
8704
8732
|
return n;
|
|
8705
8733
|
}
|
|
8706
|
-
return
|
|
8734
|
+
return Vd(e);
|
|
8707
8735
|
}
|
|
8708
8736
|
function Md(e) {
|
|
8709
8737
|
const t = {};
|
|
@@ -8714,10 +8742,10 @@ function Md(e) {
|
|
|
8714
8742
|
}
|
|
8715
8743
|
return r ? t : void 0;
|
|
8716
8744
|
}
|
|
8717
|
-
function
|
|
8745
|
+
function Vd(e) {
|
|
8718
8746
|
switch (Kd(e)) {
|
|
8719
8747
|
case "object":
|
|
8720
|
-
return
|
|
8748
|
+
return Dd(e);
|
|
8721
8749
|
case "array":
|
|
8722
8750
|
return zd(e);
|
|
8723
8751
|
case "string":
|
|
@@ -8733,7 +8761,7 @@ function Dd(e) {
|
|
|
8733
8761
|
return;
|
|
8734
8762
|
}
|
|
8735
8763
|
}
|
|
8736
|
-
function
|
|
8764
|
+
function Dd(e) {
|
|
8737
8765
|
if (!e.properties)
|
|
8738
8766
|
return {};
|
|
8739
8767
|
const t = new Set(e.required ?? []), r = {};
|
|
@@ -8844,69 +8872,74 @@ function mf({
|
|
|
8844
8872
|
validationMode: a,
|
|
8845
8873
|
validateDebounceMs: i,
|
|
8846
8874
|
customWidgets: c,
|
|
8847
|
-
applySchemaDefaults: l = !0
|
|
8848
|
-
|
|
8849
|
-
|
|
8850
|
-
|
|
8851
|
-
|
|
8852
|
-
|
|
8853
|
-
|
|
8854
|
-
|
|
8875
|
+
applySchemaDefaults: l = !0,
|
|
8876
|
+
submitting: p
|
|
8877
|
+
}, m) {
|
|
8878
|
+
const b = t !== void 0 ? ae.get(t) : void 0, g = Be(e);
|
|
8879
|
+
let w;
|
|
8880
|
+
return t === void 0 ? w = g ?? {} : l ? w = Ei(
|
|
8881
|
+
g,
|
|
8882
|
+
b
|
|
8883
|
+
) : w = b, Ri(
|
|
8855
8884
|
Ol(e, {
|
|
8856
8885
|
externalSchemas: r,
|
|
8857
8886
|
refResolver: n,
|
|
8858
8887
|
sanitizeAdditional: s
|
|
8859
8888
|
}),
|
|
8860
|
-
(
|
|
8861
|
-
if (
|
|
8862
|
-
const { ajv:
|
|
8863
|
-
const
|
|
8864
|
-
let
|
|
8865
|
-
return
|
|
8866
|
-
|
|
8867
|
-
),
|
|
8889
|
+
(S) => {
|
|
8890
|
+
if (S.ok) {
|
|
8891
|
+
const { ajv: h, validate: u } = S.value, f = Rd(e), o = Cd(e), d = o.length > 0 ? new Td() : null, y = a ?? "onTouched", $ = (re) => {
|
|
8892
|
+
const Z = u(re);
|
|
8893
|
+
let se;
|
|
8894
|
+
return Z ? se = Ee.valid : se = Yr(
|
|
8895
|
+
u.errors ?? []
|
|
8896
|
+
), f ? kd(
|
|
8868
8897
|
re,
|
|
8869
8898
|
re,
|
|
8870
8899
|
// formData is the same as value for root-level validation
|
|
8871
|
-
|
|
8872
|
-
|
|
8873
|
-
) :
|
|
8874
|
-
}, { controller:
|
|
8875
|
-
initialValue:
|
|
8876
|
-
validationMode:
|
|
8900
|
+
f,
|
|
8901
|
+
u
|
|
8902
|
+
) : se;
|
|
8903
|
+
}, { controller: _, setStatus: P } = mi({
|
|
8904
|
+
initialValue: w,
|
|
8905
|
+
validationMode: y,
|
|
8877
8906
|
validateDebounceMs: i,
|
|
8878
|
-
validate:
|
|
8879
|
-
}),
|
|
8880
|
-
let
|
|
8881
|
-
const
|
|
8882
|
-
if (
|
|
8883
|
-
const
|
|
8884
|
-
|
|
8907
|
+
validate: y === "onSubmit" ? void 0 : $
|
|
8908
|
+
}), N = f ? Id(f) : null, q = s !== !1;
|
|
8909
|
+
let L = !1;
|
|
8910
|
+
const I = q ? _.signal.on((re) => {
|
|
8911
|
+
if (L) return;
|
|
8912
|
+
const Z = Jd(re);
|
|
8913
|
+
u(Z) && !Hd(Z, re) && (L = !0, _.change(Z), L = !1);
|
|
8885
8914
|
}) : () => {
|
|
8886
|
-
},
|
|
8887
|
-
|
|
8888
|
-
const
|
|
8889
|
-
|
|
8915
|
+
}, D = N ? _.signal.on((re, Z) => {
|
|
8916
|
+
Z != null && JSON.stringify(re) !== JSON.stringify(Z) && setTimeout(() => {
|
|
8917
|
+
const M = _.status.value;
|
|
8918
|
+
P(M);
|
|
8890
8919
|
}, 10);
|
|
8891
8920
|
}) : () => {
|
|
8892
|
-
},
|
|
8893
|
-
for (const
|
|
8894
|
-
|
|
8921
|
+
}, U = d && o.length > 0 ? _.signal.on((re) => {
|
|
8922
|
+
for (const Z of o)
|
|
8923
|
+
d.validateField(Z, re, re);
|
|
8895
8924
|
}) : () => {
|
|
8896
|
-
},
|
|
8897
|
-
|
|
8898
|
-
},
|
|
8899
|
-
Ai(
|
|
8925
|
+
}, W = () => {
|
|
8926
|
+
I(), D(), U(), d?.dispose(), _.dispose();
|
|
8927
|
+
}, ee = c ? Gd(c) : void 0, oe = ke(
|
|
8928
|
+
Ai(W),
|
|
8900
8929
|
wd({
|
|
8901
8930
|
schema: e,
|
|
8902
|
-
controller:
|
|
8903
|
-
ajv:
|
|
8904
|
-
widgetRegistry:
|
|
8931
|
+
controller: _,
|
|
8932
|
+
ajv: h,
|
|
8933
|
+
widgetRegistry: ee,
|
|
8934
|
+
setStatus: P,
|
|
8935
|
+
formValue: _.signal,
|
|
8936
|
+
validationMode: y,
|
|
8937
|
+
submitting: p
|
|
8905
8938
|
})
|
|
8906
8939
|
);
|
|
8907
|
-
return
|
|
8940
|
+
return m({ Form: oe, controller: _, setStatus: P });
|
|
8908
8941
|
}
|
|
8909
|
-
return J.div(K.class("bc-json-schema-form__error"),
|
|
8942
|
+
return J.div(K.class("bc-json-schema-form__error"), S.error);
|
|
8910
8943
|
}
|
|
8911
8944
|
);
|
|
8912
8945
|
}
|
|
@@ -8924,14 +8957,14 @@ function pf(e, t) {
|
|
|
8924
8957
|
function Xd(e) {
|
|
8925
8958
|
return e.map((t) => ({
|
|
8926
8959
|
message: Zd(t),
|
|
8927
|
-
path:
|
|
8960
|
+
path: Yd(t)
|
|
8928
8961
|
}));
|
|
8929
8962
|
}
|
|
8930
8963
|
function Zd(e) {
|
|
8931
8964
|
return e.message ?? `${e.keyword} validation failed`;
|
|
8932
8965
|
}
|
|
8933
|
-
function
|
|
8934
|
-
const t =
|
|
8966
|
+
function Yd(e) {
|
|
8967
|
+
const t = xd(e.instancePath || "");
|
|
8935
8968
|
if (e.keyword === "required") {
|
|
8936
8969
|
const r = e.params.missingProperty;
|
|
8937
8970
|
if (r != null) return [...t, r];
|
|
@@ -8946,7 +8979,7 @@ function xd(e) {
|
|
|
8946
8979
|
}
|
|
8947
8980
|
return t.length > 0 ? t : void 0;
|
|
8948
8981
|
}
|
|
8949
|
-
function
|
|
8982
|
+
function xd(e) {
|
|
8950
8983
|
return e ? e.split("/").slice(1).map((r) => r.replace(/~1/g, "/").replace(/~0/g, "~")).map((r) => Qd(r) ? Number(r) : r) : [];
|
|
8951
8984
|
}
|
|
8952
8985
|
function Qd(e) {
|
|
@@ -8962,23 +8995,23 @@ export {
|
|
|
8962
8995
|
wd as JSONSchemaControl,
|
|
8963
8996
|
td as JSONSchemaEnum,
|
|
8964
8997
|
mf as JSONSchemaForm,
|
|
8965
|
-
|
|
8998
|
+
Ve as JSONSchemaGenericControl,
|
|
8966
8999
|
zr as JSONSchemaInteger,
|
|
8967
9000
|
Ms as JSONSchemaNull,
|
|
8968
9001
|
ur as JSONSchemaNumber,
|
|
8969
9002
|
Ks as JSONSchemaObject,
|
|
8970
9003
|
_d as JSONSchemaOneOf,
|
|
8971
|
-
|
|
9004
|
+
Dr as JSONSchemaString,
|
|
8972
9005
|
Js as JSONSchemaUnion,
|
|
8973
9006
|
en as SchemaContext,
|
|
8974
|
-
|
|
9007
|
+
Yr as ajvErrorsToControllerValidation,
|
|
8975
9008
|
wl as ajvErrorsToDependencies,
|
|
8976
9009
|
_l as buildMessage,
|
|
8977
9010
|
bl as buildPath,
|
|
8978
9011
|
uf as clearCaches,
|
|
8979
9012
|
lf as clearCachesForAjv,
|
|
8980
|
-
|
|
8981
|
-
|
|
9013
|
+
xr as compileWithCache,
|
|
9014
|
+
Vl as composeEffectiveObjectSchema,
|
|
8982
9015
|
pf as createAJVStandardSchema,
|
|
8983
9016
|
gf as createDiagnosticWidget,
|
|
8984
9017
|
Is as evaluateIfThenElseOverlay,
|