@animaapp/anima-sdk-react 0.6.26 → 0.6.28
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/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +240 -240
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -34,14 +34,14 @@ const va = (t) => {
|
|
|
34
34
|
e += String.fromCharCode(n[s]);
|
|
35
35
|
return btoa(e);
|
|
36
36
|
};
|
|
37
|
-
var _a = Object.defineProperty, ba = Object.defineProperties, wa = Object.getOwnPropertyDescriptors, qr = Object.getOwnPropertySymbols, ka = Object.prototype.hasOwnProperty,
|
|
37
|
+
var _a = Object.defineProperty, ba = Object.defineProperties, wa = Object.getOwnPropertyDescriptors, qr = Object.getOwnPropertySymbols, ka = Object.prototype.hasOwnProperty, Sa = Object.prototype.propertyIsEnumerable, Hr = (t, e, n) => e in t ? _a(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, d = (t, e) => {
|
|
38
38
|
for (var n in e || (e = {}))
|
|
39
39
|
ka.call(e, n) && Hr(t, n, e[n]);
|
|
40
40
|
if (qr)
|
|
41
41
|
for (var n of qr(e))
|
|
42
|
-
|
|
42
|
+
Sa.call(e, n) && Hr(t, n, e[n]);
|
|
43
43
|
return t;
|
|
44
|
-
},
|
|
44
|
+
}, x = (t, e) => ba(t, wa(e)), Se = (t, e, n) => new Promise((r, s) => {
|
|
45
45
|
var a = (c) => {
|
|
46
46
|
try {
|
|
47
47
|
o(n.next(c));
|
|
@@ -67,14 +67,14 @@ class Gr extends Error {
|
|
|
67
67
|
super(), this.name = e, this.message = n, this.detail = s, this.status = r;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
const
|
|
70
|
+
const xa = "Figma Token Issue";
|
|
71
71
|
class Ea extends Error {
|
|
72
72
|
constructor({
|
|
73
73
|
fileKey: e,
|
|
74
74
|
reason: n,
|
|
75
75
|
cause: r
|
|
76
76
|
}) {
|
|
77
|
-
super(
|
|
77
|
+
super(xa), this.fileKey = e, this.reason = n, this.cause = r;
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
const Oa = "Rate Limit Exceeded";
|
|
@@ -154,7 +154,7 @@ function Va() {
|
|
|
154
154
|
(function(n, r) {
|
|
155
155
|
t.exports = r();
|
|
156
156
|
})(Ua, function() {
|
|
157
|
-
var n = typeof Promise == "function", r = typeof self == "object" ? self : Wa, s = typeof Symbol != "undefined", a = typeof Map != "undefined", i = typeof Set != "undefined", o = typeof WeakMap != "undefined", c = typeof WeakSet != "undefined", u = typeof DataView != "undefined", h = s && typeof Symbol.iterator != "undefined", p = s && typeof Symbol.toStringTag != "undefined", k = i && typeof Set.prototype.entries == "function", v = a && typeof Map.prototype.entries == "function", b = k && Object.getPrototypeOf((/* @__PURE__ */ new Set()).entries()), m = v && Object.getPrototypeOf((/* @__PURE__ */ new Map()).entries()), g = h && typeof Array.prototype[Symbol.iterator] == "function", l = g && Object.getPrototypeOf([][Symbol.iterator]()),
|
|
157
|
+
var n = typeof Promise == "function", r = typeof self == "object" ? self : Wa, s = typeof Symbol != "undefined", a = typeof Map != "undefined", i = typeof Set != "undefined", o = typeof WeakMap != "undefined", c = typeof WeakSet != "undefined", u = typeof DataView != "undefined", h = s && typeof Symbol.iterator != "undefined", p = s && typeof Symbol.toStringTag != "undefined", k = i && typeof Set.prototype.entries == "function", v = a && typeof Map.prototype.entries == "function", b = k && Object.getPrototypeOf((/* @__PURE__ */ new Set()).entries()), m = v && Object.getPrototypeOf((/* @__PURE__ */ new Map()).entries()), g = h && typeof Array.prototype[Symbol.iterator] == "function", l = g && Object.getPrototypeOf([][Symbol.iterator]()), O = h && typeof String.prototype[Symbol.iterator] == "function", I = O && Object.getPrototypeOf(""[Symbol.iterator]()), K = 8, Z = -1;
|
|
158
158
|
function U(D) {
|
|
159
159
|
var M = typeof D;
|
|
160
160
|
if (M !== "object")
|
|
@@ -189,7 +189,7 @@ function Va() {
|
|
|
189
189
|
if (typeof G == "string")
|
|
190
190
|
return G;
|
|
191
191
|
var $ = Object.getPrototypeOf(D);
|
|
192
|
-
return $ === RegExp.prototype ? "RegExp" : $ === Date.prototype ? "Date" : n && $ === Promise.prototype ? "Promise" : i && $ === Set.prototype ? "Set" : a && $ === Map.prototype ? "Map" : c && $ === WeakSet.prototype ? "WeakSet" : o && $ === WeakMap.prototype ? "WeakMap" : u && $ === DataView.prototype ? "DataView" : a && $ === m ? "Map Iterator" : i && $ === b ? "Set Iterator" : g && $ === l ? "Array Iterator" :
|
|
192
|
+
return $ === RegExp.prototype ? "RegExp" : $ === Date.prototype ? "Date" : n && $ === Promise.prototype ? "Promise" : i && $ === Set.prototype ? "Set" : a && $ === Map.prototype ? "Map" : c && $ === WeakSet.prototype ? "WeakSet" : o && $ === WeakMap.prototype ? "WeakMap" : u && $ === DataView.prototype ? "DataView" : a && $ === m ? "Map Iterator" : i && $ === b ? "Set Iterator" : g && $ === l ? "Array Iterator" : O && $ === I ? "String Iterator" : $ === null ? "Object" : Object.prototype.toString.call(D).slice(K, Z);
|
|
193
193
|
}
|
|
194
194
|
return U;
|
|
195
195
|
});
|
|
@@ -544,7 +544,7 @@ class ns extends Error {
|
|
|
544
544
|
}
|
|
545
545
|
}
|
|
546
546
|
}
|
|
547
|
-
class
|
|
547
|
+
class St extends Error {
|
|
548
548
|
constructor(e = {}) {
|
|
549
549
|
const { canceled: n = !1 } = e;
|
|
550
550
|
super("Abort Error"), this.name = "Abort Error", this.canceled = n;
|
|
@@ -570,8 +570,8 @@ function Xn() {
|
|
|
570
570
|
return Math.floor(Date.now() / 1e3).toString();
|
|
571
571
|
}
|
|
572
572
|
const wi = 5 * 60 * 1e3, ki = 1 * 1e3;
|
|
573
|
-
var Ge, re, ve, Yn, Qn,
|
|
574
|
-
class
|
|
573
|
+
var Ge, re, ve, Yn, Qn, xt;
|
|
574
|
+
class Si {
|
|
575
575
|
constructor({ fetch: e = globalThis.fetch.bind(globalThis), baseAddress: n }) {
|
|
576
576
|
le(this, ve), le(this, Ge), le(this, re), this.baseAddress = n, X(this, Ge, e), X(this, re, {}), this.plugins = [];
|
|
577
577
|
}
|
|
@@ -598,25 +598,25 @@ class xi {
|
|
|
598
598
|
post(e, n) {
|
|
599
599
|
return B(this, arguments, function* (r, s, a = {}) {
|
|
600
600
|
const i = kt(P(this, re));
|
|
601
|
-
return X(this, re, {}), be(this, ve,
|
|
601
|
+
return X(this, re, {}), be(this, ve, xt).call(this, r, "POST", s, a, i);
|
|
602
602
|
});
|
|
603
603
|
}
|
|
604
604
|
put(e, n) {
|
|
605
605
|
return B(this, arguments, function* (r, s, a = {}) {
|
|
606
606
|
const i = kt(P(this, re));
|
|
607
|
-
return X(this, re, {}), be(this, ve,
|
|
607
|
+
return X(this, re, {}), be(this, ve, xt).call(this, r, "PUT", s, a, i);
|
|
608
608
|
});
|
|
609
609
|
}
|
|
610
610
|
delete(e, n) {
|
|
611
611
|
return B(this, arguments, function* (r, s, a = {}) {
|
|
612
612
|
const i = kt(P(this, re));
|
|
613
|
-
return X(this, re, {}), be(this, ve,
|
|
613
|
+
return X(this, re, {}), be(this, ve, xt).call(this, r, "DELETE", s, a, i);
|
|
614
614
|
});
|
|
615
615
|
}
|
|
616
616
|
patch(e, n) {
|
|
617
617
|
return B(this, arguments, function* (r, s, a = {}) {
|
|
618
618
|
const i = kt(P(this, re));
|
|
619
|
-
return X(this, re, {}), be(this, ve,
|
|
619
|
+
return X(this, re, {}), be(this, ve, xt).call(this, r, "PATCH", s, a, i);
|
|
620
620
|
});
|
|
621
621
|
}
|
|
622
622
|
}
|
|
@@ -627,7 +627,7 @@ Ge = /* @__PURE__ */ new WeakMap(), re = /* @__PURE__ */ new WeakMap(), ve = /*
|
|
|
627
627
|
try {
|
|
628
628
|
return yield P(this, Ge).call(this, t, ie(ie({}, n), e.abortSignal && { signal: e.abortSignal }));
|
|
629
629
|
} catch (h) {
|
|
630
|
-
throw h instanceof Error && h.name === "AbortError" ? new
|
|
630
|
+
throw h instanceof Error && h.name === "AbortError" ? new St({ canceled: (u = (c = e.abortSignal) == null ? void 0 : c.aborted) != null ? u : !1 }) : h;
|
|
631
631
|
}
|
|
632
632
|
}), { headers: s } = n != null ? n : {}, a = (c, u) => {
|
|
633
633
|
var h, p;
|
|
@@ -687,7 +687,7 @@ Ge = /* @__PURE__ */ new WeakMap(), re = /* @__PURE__ */ new WeakMap(), ve = /*
|
|
|
687
687
|
try {
|
|
688
688
|
p = yield P(this, Ge).call(this, u, ie(ie({}, n), i && { signal: i }));
|
|
689
689
|
} catch (b) {
|
|
690
|
-
throw b instanceof Error && b.name === "AbortError" ? new
|
|
690
|
+
throw b instanceof Error && b.name === "AbortError" ? new St({ canceled: (r = i == null ? void 0 : i.aborted) != null ? r : !1 }) : b;
|
|
691
691
|
}
|
|
692
692
|
if (!p.ok) {
|
|
693
693
|
const b = yield p.text().catch();
|
|
@@ -706,12 +706,12 @@ Ge = /* @__PURE__ */ new WeakMap(), re = /* @__PURE__ */ new WeakMap(), ve = /*
|
|
|
706
706
|
return new Promise((b, m) => B(this, null, function* () {
|
|
707
707
|
const g = setTimeout(() => {
|
|
708
708
|
m(new Error("Job timed out"));
|
|
709
|
-
}, c), l = (
|
|
709
|
+
}, c), l = (O = 0) => B(this, null, function* () {
|
|
710
710
|
if (i != null && i.aborted) {
|
|
711
711
|
clearTimeout(g), P(this, Ge).call(this, `${h}/${v}/cancel`, { method: "POST", headers: this.headers }).then(() => {
|
|
712
|
-
m(new
|
|
712
|
+
m(new St({ canceled: !0 }));
|
|
713
713
|
}).catch((I) => {
|
|
714
|
-
m(new
|
|
714
|
+
m(new St({ canceled: !1 }));
|
|
715
715
|
});
|
|
716
716
|
return;
|
|
717
717
|
}
|
|
@@ -725,8 +725,8 @@ Ge = /* @__PURE__ */ new WeakMap(), re = /* @__PURE__ */ new WeakMap(), ve = /*
|
|
|
725
725
|
clearTimeout(g), m(new bi(I.response_json));
|
|
726
726
|
else {
|
|
727
727
|
a && a(I.response_json);
|
|
728
|
-
const K = o(
|
|
729
|
-
setTimeout(() => l(
|
|
728
|
+
const K = o(O);
|
|
729
|
+
setTimeout(() => l(O + 1), K);
|
|
730
730
|
}
|
|
731
731
|
} catch (I) {
|
|
732
732
|
m(I);
|
|
@@ -735,7 +735,7 @@ Ge = /* @__PURE__ */ new WeakMap(), re = /* @__PURE__ */ new WeakMap(), ve = /*
|
|
|
735
735
|
l();
|
|
736
736
|
}));
|
|
737
737
|
});
|
|
738
|
-
},
|
|
738
|
+
}, xt = function(t, e, n, r, s) {
|
|
739
739
|
return B(this, null, function* () {
|
|
740
740
|
const { overrideBaseAddress: a, overrideDefaultHeaders: i } = r, o = a != null ? a : this.baseAddress;
|
|
741
741
|
let c = i != null ? i : this.headers;
|
|
@@ -748,7 +748,7 @@ Ge = /* @__PURE__ */ new WeakMap(), re = /* @__PURE__ */ new WeakMap(), ve = /*
|
|
|
748
748
|
}) : yield be(this, ve, Yn).call(this, `${o}${t}`, s, { method: e, headers: c, body: u });
|
|
749
749
|
});
|
|
750
750
|
};
|
|
751
|
-
const rs = (t, e, n, r) => t instanceof
|
|
751
|
+
const rs = (t, e, n, r) => t instanceof St ? t : new _i({ resource: e, api: String(n), args: r, cause: t }), In = (t, e) => new Proxy(e, {
|
|
752
752
|
get(n, r) {
|
|
753
753
|
return (...s) => {
|
|
754
754
|
var a;
|
|
@@ -770,7 +770,7 @@ const rs = (t, e, n, r) => t instanceof xt ? t : new _i({ resource: e, api: Stri
|
|
|
770
770
|
}
|
|
771
771
|
});
|
|
772
772
|
var Et;
|
|
773
|
-
class
|
|
773
|
+
class xi {
|
|
774
774
|
constructor(e) {
|
|
775
775
|
le(this, Et), this.resourceName = "Files", X(this, Et, e);
|
|
776
776
|
}
|
|
@@ -852,7 +852,7 @@ class Ai {
|
|
|
852
852
|
}
|
|
853
853
|
cn = /* @__PURE__ */ new WeakMap();
|
|
854
854
|
var Pe;
|
|
855
|
-
class Ci extends
|
|
855
|
+
class Ci extends Si {
|
|
856
856
|
constructor({
|
|
857
857
|
baseAddress: e = "https://api.figma.com/",
|
|
858
858
|
fetch: n = globalThis.fetch.bind(globalThis)
|
|
@@ -862,7 +862,7 @@ class Ci extends xi {
|
|
|
862
862
|
entries: /* @__PURE__ */ new Map(),
|
|
863
863
|
pendingRequests: /* @__PURE__ */ new Map()
|
|
864
864
|
}
|
|
865
|
-
}, this.files = In(this, new
|
|
865
|
+
}, this.files = In(this, new xi(this)), this.nodes = In(this, new Ai(this)), this.images = In(this, new Ti(this));
|
|
866
866
|
}
|
|
867
867
|
set token(e) {
|
|
868
868
|
if (!e.startsWith("figd_") && !e.startsWith("figu_"))
|
|
@@ -880,7 +880,7 @@ class Ci extends xi {
|
|
|
880
880
|
}
|
|
881
881
|
}
|
|
882
882
|
Pe = /* @__PURE__ */ new WeakMap();
|
|
883
|
-
const Ni = (t) =>
|
|
883
|
+
const Ni = (t) => Se(void 0, [t], function* ({
|
|
884
884
|
fileKey: e,
|
|
885
885
|
authToken: n,
|
|
886
886
|
figmaRestApi: r = new Ci(),
|
|
@@ -1123,11 +1123,11 @@ function ln() {
|
|
|
1123
1123
|
return Rs;
|
|
1124
1124
|
}
|
|
1125
1125
|
const fn = (t) => {
|
|
1126
|
-
const { data: e, path: n, errorMaps: r, issueData: s } = t, a = [...n, ...s.path || []], i =
|
|
1126
|
+
const { data: e, path: n, errorMaps: r, issueData: s } = t, a = [...n, ...s.path || []], i = x(d({}, s), {
|
|
1127
1127
|
path: a
|
|
1128
1128
|
});
|
|
1129
1129
|
if (s.message !== void 0)
|
|
1130
|
-
return
|
|
1130
|
+
return x(d({}, s), {
|
|
1131
1131
|
path: a,
|
|
1132
1132
|
message: s.message
|
|
1133
1133
|
});
|
|
@@ -1135,7 +1135,7 @@ const fn = (t) => {
|
|
|
1135
1135
|
const c = r.filter((u) => !!u).slice().reverse();
|
|
1136
1136
|
for (const u of c)
|
|
1137
1137
|
o = u(i, { data: e, defaultError: o }).message;
|
|
1138
|
-
return
|
|
1138
|
+
return x(d({}, s), {
|
|
1139
1139
|
path: a,
|
|
1140
1140
|
message: o
|
|
1141
1141
|
});
|
|
@@ -1178,7 +1178,7 @@ class Y {
|
|
|
1178
1178
|
return { status: e.value, value: r };
|
|
1179
1179
|
}
|
|
1180
1180
|
static mergeObjectAsync(e, n) {
|
|
1181
|
-
return
|
|
1181
|
+
return Se(this, null, function* () {
|
|
1182
1182
|
const r = [];
|
|
1183
1183
|
for (const s of n) {
|
|
1184
1184
|
const a = yield s.key, i = yield s.value;
|
|
@@ -1217,7 +1217,7 @@ var w;
|
|
|
1217
1217
|
t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
1218
1218
|
})(w || (w = {}));
|
|
1219
1219
|
var Ot, Tt;
|
|
1220
|
-
class
|
|
1220
|
+
class xe {
|
|
1221
1221
|
constructor(e, n, r, s) {
|
|
1222
1222
|
this._cachedPath = [], this.parent = e, this.data = n, this._path = r, this._key = s;
|
|
1223
1223
|
}
|
|
@@ -1240,7 +1240,7 @@ const ss = (t, e) => {
|
|
|
1240
1240
|
}
|
|
1241
1241
|
};
|
|
1242
1242
|
};
|
|
1243
|
-
function
|
|
1243
|
+
function T(t) {
|
|
1244
1244
|
if (!t)
|
|
1245
1245
|
return {};
|
|
1246
1246
|
const { errorMap: e, invalid_type_error: n, required_error: r, description: s } = t;
|
|
@@ -1348,7 +1348,7 @@ class A {
|
|
|
1348
1348
|
});
|
|
1349
1349
|
}
|
|
1350
1350
|
parseAsync(e, n) {
|
|
1351
|
-
return
|
|
1351
|
+
return Se(this, null, function* () {
|
|
1352
1352
|
const r = yield this.safeParseAsync(e, n);
|
|
1353
1353
|
if (r.success)
|
|
1354
1354
|
return r.data;
|
|
@@ -1356,7 +1356,7 @@ class A {
|
|
|
1356
1356
|
});
|
|
1357
1357
|
}
|
|
1358
1358
|
safeParseAsync(e, n) {
|
|
1359
|
-
return
|
|
1359
|
+
return Se(this, null, function* () {
|
|
1360
1360
|
const r = {
|
|
1361
1361
|
common: {
|
|
1362
1362
|
issues: [],
|
|
@@ -1387,7 +1387,7 @@ class A {
|
|
|
1387
1387
|
_refinement(e) {
|
|
1388
1388
|
return new ge({
|
|
1389
1389
|
schema: this,
|
|
1390
|
-
typeName:
|
|
1390
|
+
typeName: S.ZodEffects,
|
|
1391
1391
|
effect: { type: "refinement", refinement: e }
|
|
1392
1392
|
});
|
|
1393
1393
|
}
|
|
@@ -1423,37 +1423,37 @@ class A {
|
|
|
1423
1423
|
return Mt.create(this, e, this._def);
|
|
1424
1424
|
}
|
|
1425
1425
|
transform(e) {
|
|
1426
|
-
return new ge(
|
|
1426
|
+
return new ge(x(d({}, T(this._def)), {
|
|
1427
1427
|
schema: this,
|
|
1428
|
-
typeName:
|
|
1428
|
+
typeName: S.ZodEffects,
|
|
1429
1429
|
effect: { type: "transform", transform: e }
|
|
1430
1430
|
}));
|
|
1431
1431
|
}
|
|
1432
1432
|
default(e) {
|
|
1433
1433
|
const n = typeof e == "function" ? e : () => e;
|
|
1434
|
-
return new zt(
|
|
1434
|
+
return new zt(x(d({}, T(this._def)), {
|
|
1435
1435
|
innerType: this,
|
|
1436
1436
|
defaultValue: n,
|
|
1437
|
-
typeName:
|
|
1437
|
+
typeName: S.ZodDefault
|
|
1438
1438
|
}));
|
|
1439
1439
|
}
|
|
1440
1440
|
brand() {
|
|
1441
1441
|
return new Nr(d({
|
|
1442
|
-
typeName:
|
|
1442
|
+
typeName: S.ZodBranded,
|
|
1443
1443
|
type: this
|
|
1444
|
-
},
|
|
1444
|
+
}, T(this._def)));
|
|
1445
1445
|
}
|
|
1446
1446
|
catch(e) {
|
|
1447
1447
|
const n = typeof e == "function" ? e : () => e;
|
|
1448
|
-
return new Ut(
|
|
1448
|
+
return new Ut(x(d({}, T(this._def)), {
|
|
1449
1449
|
innerType: this,
|
|
1450
1450
|
catchValue: n,
|
|
1451
|
-
typeName:
|
|
1451
|
+
typeName: S.ZodCatch
|
|
1452
1452
|
}));
|
|
1453
1453
|
}
|
|
1454
1454
|
describe(e) {
|
|
1455
1455
|
const n = this.constructor;
|
|
1456
|
-
return new n(
|
|
1456
|
+
return new n(x(d({}, this._def), {
|
|
1457
1457
|
description: e
|
|
1458
1458
|
}));
|
|
1459
1459
|
}
|
|
@@ -1663,7 +1663,7 @@ class me extends A {
|
|
|
1663
1663
|
}, w.errToObj(r)));
|
|
1664
1664
|
}
|
|
1665
1665
|
_addCheck(e) {
|
|
1666
|
-
return new me(
|
|
1666
|
+
return new me(x(d({}, this._def), {
|
|
1667
1667
|
checks: [...this._def.checks, e]
|
|
1668
1668
|
}));
|
|
1669
1669
|
}
|
|
@@ -1789,17 +1789,17 @@ class me extends A {
|
|
|
1789
1789
|
return this.min(1, w.errToObj(e));
|
|
1790
1790
|
}
|
|
1791
1791
|
trim() {
|
|
1792
|
-
return new me(
|
|
1792
|
+
return new me(x(d({}, this._def), {
|
|
1793
1793
|
checks: [...this._def.checks, { kind: "trim" }]
|
|
1794
1794
|
}));
|
|
1795
1795
|
}
|
|
1796
1796
|
toLowerCase() {
|
|
1797
|
-
return new me(
|
|
1797
|
+
return new me(x(d({}, this._def), {
|
|
1798
1798
|
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
1799
1799
|
}));
|
|
1800
1800
|
}
|
|
1801
1801
|
toUpperCase() {
|
|
1802
|
-
return new me(
|
|
1802
|
+
return new me(x(d({}, this._def), {
|
|
1803
1803
|
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
1804
1804
|
}));
|
|
1805
1805
|
}
|
|
@@ -1868,9 +1868,9 @@ me.create = (t) => {
|
|
|
1868
1868
|
var e;
|
|
1869
1869
|
return new me(d({
|
|
1870
1870
|
checks: [],
|
|
1871
|
-
typeName:
|
|
1871
|
+
typeName: S.ZodString,
|
|
1872
1872
|
coerce: (e = t == null ? void 0 : t.coerce) !== null && e !== void 0 ? e : !1
|
|
1873
|
-
},
|
|
1873
|
+
}, T(t)));
|
|
1874
1874
|
};
|
|
1875
1875
|
function eo(t, e) {
|
|
1876
1876
|
const n = (t.toString().split(".")[1] || "").length, r = (e.toString().split(".")[1] || "").length, s = n > r ? n : r, a = parseInt(t.toFixed(s).replace(".", "")), i = parseInt(e.toFixed(s).replace(".", ""));
|
|
@@ -1934,7 +1934,7 @@ class Le extends A {
|
|
|
1934
1934
|
return this.setLimit("max", e, !1, w.toString(n));
|
|
1935
1935
|
}
|
|
1936
1936
|
setLimit(e, n, r, s) {
|
|
1937
|
-
return new Le(
|
|
1937
|
+
return new Le(x(d({}, this._def), {
|
|
1938
1938
|
checks: [
|
|
1939
1939
|
...this._def.checks,
|
|
1940
1940
|
{
|
|
@@ -1947,7 +1947,7 @@ class Le extends A {
|
|
|
1947
1947
|
}));
|
|
1948
1948
|
}
|
|
1949
1949
|
_addCheck(e) {
|
|
1950
|
-
return new Le(
|
|
1950
|
+
return new Le(x(d({}, this._def), {
|
|
1951
1951
|
checks: [...this._def.checks, e]
|
|
1952
1952
|
}));
|
|
1953
1953
|
}
|
|
@@ -2042,9 +2042,9 @@ class Le extends A {
|
|
|
2042
2042
|
}
|
|
2043
2043
|
Le.create = (t) => new Le(d({
|
|
2044
2044
|
checks: [],
|
|
2045
|
-
typeName:
|
|
2045
|
+
typeName: S.ZodNumber,
|
|
2046
2046
|
coerce: (t == null ? void 0 : t.coerce) || !1
|
|
2047
|
-
},
|
|
2047
|
+
}, T(t)));
|
|
2048
2048
|
class $e extends A {
|
|
2049
2049
|
constructor() {
|
|
2050
2050
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
@@ -2101,7 +2101,7 @@ class $e extends A {
|
|
|
2101
2101
|
return this.setLimit("max", e, !1, w.toString(n));
|
|
2102
2102
|
}
|
|
2103
2103
|
setLimit(e, n, r, s) {
|
|
2104
|
-
return new $e(
|
|
2104
|
+
return new $e(x(d({}, this._def), {
|
|
2105
2105
|
checks: [
|
|
2106
2106
|
...this._def.checks,
|
|
2107
2107
|
{
|
|
@@ -2114,7 +2114,7 @@ class $e extends A {
|
|
|
2114
2114
|
}));
|
|
2115
2115
|
}
|
|
2116
2116
|
_addCheck(e) {
|
|
2117
|
-
return new $e(
|
|
2117
|
+
return new $e(x(d({}, this._def), {
|
|
2118
2118
|
checks: [...this._def.checks, e]
|
|
2119
2119
|
}));
|
|
2120
2120
|
}
|
|
@@ -2174,9 +2174,9 @@ $e.create = (t) => {
|
|
|
2174
2174
|
var e;
|
|
2175
2175
|
return new $e(d({
|
|
2176
2176
|
checks: [],
|
|
2177
|
-
typeName:
|
|
2177
|
+
typeName: S.ZodBigInt,
|
|
2178
2178
|
coerce: (e = t == null ? void 0 : t.coerce) !== null && e !== void 0 ? e : !1
|
|
2179
|
-
},
|
|
2179
|
+
}, T(t)));
|
|
2180
2180
|
};
|
|
2181
2181
|
class It extends A {
|
|
2182
2182
|
_parse(e) {
|
|
@@ -2192,9 +2192,9 @@ class It extends A {
|
|
|
2192
2192
|
}
|
|
2193
2193
|
}
|
|
2194
2194
|
It.create = (t) => new It(d({
|
|
2195
|
-
typeName:
|
|
2195
|
+
typeName: S.ZodBoolean,
|
|
2196
2196
|
coerce: (t == null ? void 0 : t.coerce) || !1
|
|
2197
|
-
},
|
|
2197
|
+
}, T(t)));
|
|
2198
2198
|
class Qe extends A {
|
|
2199
2199
|
_parse(e) {
|
|
2200
2200
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== _.date) {
|
|
@@ -2235,7 +2235,7 @@ class Qe extends A {
|
|
|
2235
2235
|
};
|
|
2236
2236
|
}
|
|
2237
2237
|
_addCheck(e) {
|
|
2238
|
-
return new Qe(
|
|
2238
|
+
return new Qe(x(d({}, this._def), {
|
|
2239
2239
|
checks: [...this._def.checks, e]
|
|
2240
2240
|
}));
|
|
2241
2241
|
}
|
|
@@ -2269,8 +2269,8 @@ class Qe extends A {
|
|
|
2269
2269
|
Qe.create = (t) => new Qe(d({
|
|
2270
2270
|
checks: [],
|
|
2271
2271
|
coerce: (t == null ? void 0 : t.coerce) || !1,
|
|
2272
|
-
typeName:
|
|
2273
|
-
},
|
|
2272
|
+
typeName: S.ZodDate
|
|
2273
|
+
}, T(t)));
|
|
2274
2274
|
class mn extends A {
|
|
2275
2275
|
_parse(e) {
|
|
2276
2276
|
if (this._getType(e) !== _.symbol) {
|
|
@@ -2285,8 +2285,8 @@ class mn extends A {
|
|
|
2285
2285
|
}
|
|
2286
2286
|
}
|
|
2287
2287
|
mn.create = (t) => new mn(d({
|
|
2288
|
-
typeName:
|
|
2289
|
-
},
|
|
2288
|
+
typeName: S.ZodSymbol
|
|
2289
|
+
}, T(t)));
|
|
2290
2290
|
class Pt extends A {
|
|
2291
2291
|
_parse(e) {
|
|
2292
2292
|
if (this._getType(e) !== _.undefined) {
|
|
@@ -2301,8 +2301,8 @@ class Pt extends A {
|
|
|
2301
2301
|
}
|
|
2302
2302
|
}
|
|
2303
2303
|
Pt.create = (t) => new Pt(d({
|
|
2304
|
-
typeName:
|
|
2305
|
-
},
|
|
2304
|
+
typeName: S.ZodUndefined
|
|
2305
|
+
}, T(t)));
|
|
2306
2306
|
class Zt extends A {
|
|
2307
2307
|
_parse(e) {
|
|
2308
2308
|
if (this._getType(e) !== _.null) {
|
|
@@ -2317,8 +2317,8 @@ class Zt extends A {
|
|
|
2317
2317
|
}
|
|
2318
2318
|
}
|
|
2319
2319
|
Zt.create = (t) => new Zt(d({
|
|
2320
|
-
typeName:
|
|
2321
|
-
},
|
|
2320
|
+
typeName: S.ZodNull
|
|
2321
|
+
}, T(t)));
|
|
2322
2322
|
class gt extends A {
|
|
2323
2323
|
constructor() {
|
|
2324
2324
|
super(...arguments), this._any = !0;
|
|
@@ -2328,8 +2328,8 @@ class gt extends A {
|
|
|
2328
2328
|
}
|
|
2329
2329
|
}
|
|
2330
2330
|
gt.create = (t) => new gt(d({
|
|
2331
|
-
typeName:
|
|
2332
|
-
},
|
|
2331
|
+
typeName: S.ZodAny
|
|
2332
|
+
}, T(t)));
|
|
2333
2333
|
class Xe extends A {
|
|
2334
2334
|
constructor() {
|
|
2335
2335
|
super(...arguments), this._unknown = !0;
|
|
@@ -2339,8 +2339,8 @@ class Xe extends A {
|
|
|
2339
2339
|
}
|
|
2340
2340
|
}
|
|
2341
2341
|
Xe.create = (t) => new Xe(d({
|
|
2342
|
-
typeName:
|
|
2343
|
-
},
|
|
2342
|
+
typeName: S.ZodUnknown
|
|
2343
|
+
}, T(t)));
|
|
2344
2344
|
class je extends A {
|
|
2345
2345
|
_parse(e) {
|
|
2346
2346
|
const n = this._getOrReturnCtx(e);
|
|
@@ -2352,8 +2352,8 @@ class je extends A {
|
|
|
2352
2352
|
}
|
|
2353
2353
|
}
|
|
2354
2354
|
je.create = (t) => new je(d({
|
|
2355
|
-
typeName:
|
|
2356
|
-
},
|
|
2355
|
+
typeName: S.ZodNever
|
|
2356
|
+
}, T(t)));
|
|
2357
2357
|
class yn extends A {
|
|
2358
2358
|
_parse(e) {
|
|
2359
2359
|
if (this._getType(e) !== _.undefined) {
|
|
@@ -2368,8 +2368,8 @@ class yn extends A {
|
|
|
2368
2368
|
}
|
|
2369
2369
|
}
|
|
2370
2370
|
yn.create = (t) => new yn(d({
|
|
2371
|
-
typeName:
|
|
2372
|
-
},
|
|
2371
|
+
typeName: S.ZodVoid
|
|
2372
|
+
}, T(t)));
|
|
2373
2373
|
class ye extends A {
|
|
2374
2374
|
_parse(e) {
|
|
2375
2375
|
const { ctx: n, status: r } = this._processInputParams(e), s = this._def;
|
|
@@ -2406,25 +2406,25 @@ class ye extends A {
|
|
|
2406
2406
|
exact: !1,
|
|
2407
2407
|
message: s.maxLength.message
|
|
2408
2408
|
}), r.dirty()), n.common.async)
|
|
2409
|
-
return Promise.all([...n.data].map((i, o) => s.type._parseAsync(new
|
|
2410
|
-
const a = [...n.data].map((i, o) => s.type._parseSync(new
|
|
2409
|
+
return Promise.all([...n.data].map((i, o) => s.type._parseAsync(new xe(n, i, n.path, o)))).then((i) => Y.mergeArray(r, i));
|
|
2410
|
+
const a = [...n.data].map((i, o) => s.type._parseSync(new xe(n, i, n.path, o)));
|
|
2411
2411
|
return Y.mergeArray(r, a);
|
|
2412
2412
|
}
|
|
2413
2413
|
get element() {
|
|
2414
2414
|
return this._def.type;
|
|
2415
2415
|
}
|
|
2416
2416
|
min(e, n) {
|
|
2417
|
-
return new ye(
|
|
2417
|
+
return new ye(x(d({}, this._def), {
|
|
2418
2418
|
minLength: { value: e, message: w.toString(n) }
|
|
2419
2419
|
}));
|
|
2420
2420
|
}
|
|
2421
2421
|
max(e, n) {
|
|
2422
|
-
return new ye(
|
|
2422
|
+
return new ye(x(d({}, this._def), {
|
|
2423
2423
|
maxLength: { value: e, message: w.toString(n) }
|
|
2424
2424
|
}));
|
|
2425
2425
|
}
|
|
2426
2426
|
length(e, n) {
|
|
2427
|
-
return new ye(
|
|
2427
|
+
return new ye(x(d({}, this._def), {
|
|
2428
2428
|
exactLength: { value: e, message: w.toString(n) }
|
|
2429
2429
|
}));
|
|
2430
2430
|
}
|
|
@@ -2437,8 +2437,8 @@ ye.create = (t, e) => new ye(d({
|
|
|
2437
2437
|
minLength: null,
|
|
2438
2438
|
maxLength: null,
|
|
2439
2439
|
exactLength: null,
|
|
2440
|
-
typeName:
|
|
2441
|
-
},
|
|
2440
|
+
typeName: S.ZodArray
|
|
2441
|
+
}, T(e)));
|
|
2442
2442
|
function ct(t) {
|
|
2443
2443
|
if (t instanceof z) {
|
|
2444
2444
|
const e = {};
|
|
@@ -2446,10 +2446,10 @@ function ct(t) {
|
|
|
2446
2446
|
const r = t.shape[n];
|
|
2447
2447
|
e[n] = ke.create(ct(r));
|
|
2448
2448
|
}
|
|
2449
|
-
return new z(
|
|
2449
|
+
return new z(x(d({}, t._def), {
|
|
2450
2450
|
shape: () => e
|
|
2451
2451
|
}));
|
|
2452
|
-
} else return t instanceof ye ? new ye(
|
|
2452
|
+
} else return t instanceof ye ? new ye(x(d({}, t._def), {
|
|
2453
2453
|
type: ct(t.element)
|
|
2454
2454
|
})) : t instanceof ke ? ke.create(ct(t.unwrap())) : t instanceof We ? We.create(ct(t.unwrap())) : t instanceof Ee ? Ee.create(t.items.map((e) => ct(e))) : t;
|
|
2455
2455
|
}
|
|
@@ -2481,7 +2481,7 @@ class z extends A {
|
|
|
2481
2481
|
const u = s[c], h = r.data[c];
|
|
2482
2482
|
o.push({
|
|
2483
2483
|
key: { status: "valid", value: c },
|
|
2484
|
-
value: u._parse(new
|
|
2484
|
+
value: u._parse(new xe(r, h, r.path, c)),
|
|
2485
2485
|
alwaysSet: c in r.data
|
|
2486
2486
|
});
|
|
2487
2487
|
}
|
|
@@ -2506,14 +2506,14 @@ class z extends A {
|
|
|
2506
2506
|
o.push({
|
|
2507
2507
|
key: { status: "valid", value: u },
|
|
2508
2508
|
value: c._parse(
|
|
2509
|
-
new
|
|
2509
|
+
new xe(r, h, r.path, u)
|
|
2510
2510
|
//, ctx.child(key), value, getParsedType(value)
|
|
2511
2511
|
),
|
|
2512
2512
|
alwaysSet: u in r.data
|
|
2513
2513
|
});
|
|
2514
2514
|
}
|
|
2515
2515
|
}
|
|
2516
|
-
return r.common.async ? Promise.resolve().then(() =>
|
|
2516
|
+
return r.common.async ? Promise.resolve().then(() => Se(this, null, function* () {
|
|
2517
2517
|
const c = [];
|
|
2518
2518
|
for (const u of o) {
|
|
2519
2519
|
const h = yield u.key, p = yield u.value;
|
|
@@ -2530,7 +2530,7 @@ class z extends A {
|
|
|
2530
2530
|
return this._def.shape();
|
|
2531
2531
|
}
|
|
2532
2532
|
strict(e) {
|
|
2533
|
-
return w.errToObj, new z(d(
|
|
2533
|
+
return w.errToObj, new z(d(x(d({}, this._def), {
|
|
2534
2534
|
unknownKeys: "strict"
|
|
2535
2535
|
}), e !== void 0 ? {
|
|
2536
2536
|
errorMap: (n, r) => {
|
|
@@ -2545,12 +2545,12 @@ class z extends A {
|
|
|
2545
2545
|
} : {}));
|
|
2546
2546
|
}
|
|
2547
2547
|
strip() {
|
|
2548
|
-
return new z(
|
|
2548
|
+
return new z(x(d({}, this._def), {
|
|
2549
2549
|
unknownKeys: "strip"
|
|
2550
2550
|
}));
|
|
2551
2551
|
}
|
|
2552
2552
|
passthrough() {
|
|
2553
|
-
return new z(
|
|
2553
|
+
return new z(x(d({}, this._def), {
|
|
2554
2554
|
unknownKeys: "passthrough"
|
|
2555
2555
|
}));
|
|
2556
2556
|
}
|
|
@@ -2572,7 +2572,7 @@ class z extends A {
|
|
|
2572
2572
|
// }) as any;
|
|
2573
2573
|
// };
|
|
2574
2574
|
extend(e) {
|
|
2575
|
-
return new z(
|
|
2575
|
+
return new z(x(d({}, this._def), {
|
|
2576
2576
|
shape: () => d(d({}, this._def.shape()), e)
|
|
2577
2577
|
}));
|
|
2578
2578
|
}
|
|
@@ -2586,7 +2586,7 @@ class z extends A {
|
|
|
2586
2586
|
unknownKeys: e._def.unknownKeys,
|
|
2587
2587
|
catchall: e._def.catchall,
|
|
2588
2588
|
shape: () => d(d({}, this._def.shape()), e._def.shape()),
|
|
2589
|
-
typeName:
|
|
2589
|
+
typeName: S.ZodObject
|
|
2590
2590
|
});
|
|
2591
2591
|
}
|
|
2592
2592
|
// merge<
|
|
@@ -2649,7 +2649,7 @@ class z extends A {
|
|
|
2649
2649
|
// return merged;
|
|
2650
2650
|
// }
|
|
2651
2651
|
catchall(e) {
|
|
2652
|
-
return new z(
|
|
2652
|
+
return new z(x(d({}, this._def), {
|
|
2653
2653
|
catchall: e
|
|
2654
2654
|
}));
|
|
2655
2655
|
}
|
|
@@ -2657,7 +2657,7 @@ class z extends A {
|
|
|
2657
2657
|
const n = {};
|
|
2658
2658
|
return N.objectKeys(e).forEach((r) => {
|
|
2659
2659
|
e[r] && this.shape[r] && (n[r] = this.shape[r]);
|
|
2660
|
-
}), new z(
|
|
2660
|
+
}), new z(x(d({}, this._def), {
|
|
2661
2661
|
shape: () => n
|
|
2662
2662
|
}));
|
|
2663
2663
|
}
|
|
@@ -2665,7 +2665,7 @@ class z extends A {
|
|
|
2665
2665
|
const n = {};
|
|
2666
2666
|
return N.objectKeys(this.shape).forEach((r) => {
|
|
2667
2667
|
e[r] || (n[r] = this.shape[r]);
|
|
2668
|
-
}), new z(
|
|
2668
|
+
}), new z(x(d({}, this._def), {
|
|
2669
2669
|
shape: () => n
|
|
2670
2670
|
}));
|
|
2671
2671
|
}
|
|
@@ -2680,7 +2680,7 @@ class z extends A {
|
|
|
2680
2680
|
return N.objectKeys(this.shape).forEach((r) => {
|
|
2681
2681
|
const s = this.shape[r];
|
|
2682
2682
|
e && !e[r] ? n[r] = s : n[r] = s.optional();
|
|
2683
|
-
}), new z(
|
|
2683
|
+
}), new z(x(d({}, this._def), {
|
|
2684
2684
|
shape: () => n
|
|
2685
2685
|
}));
|
|
2686
2686
|
}
|
|
@@ -2695,7 +2695,7 @@ class z extends A {
|
|
|
2695
2695
|
s = s._def.innerType;
|
|
2696
2696
|
n[r] = s;
|
|
2697
2697
|
}
|
|
2698
|
-
}), new z(
|
|
2698
|
+
}), new z(x(d({}, this._def), {
|
|
2699
2699
|
shape: () => n
|
|
2700
2700
|
}));
|
|
2701
2701
|
}
|
|
@@ -2707,20 +2707,20 @@ z.create = (t, e) => new z(d({
|
|
|
2707
2707
|
shape: () => t,
|
|
2708
2708
|
unknownKeys: "strip",
|
|
2709
2709
|
catchall: je.create(),
|
|
2710
|
-
typeName:
|
|
2711
|
-
},
|
|
2710
|
+
typeName: S.ZodObject
|
|
2711
|
+
}, T(e)));
|
|
2712
2712
|
z.strictCreate = (t, e) => new z(d({
|
|
2713
2713
|
shape: () => t,
|
|
2714
2714
|
unknownKeys: "strict",
|
|
2715
2715
|
catchall: je.create(),
|
|
2716
|
-
typeName:
|
|
2717
|
-
},
|
|
2716
|
+
typeName: S.ZodObject
|
|
2717
|
+
}, T(e)));
|
|
2718
2718
|
z.lazycreate = (t, e) => new z(d({
|
|
2719
2719
|
shape: t,
|
|
2720
2720
|
unknownKeys: "strip",
|
|
2721
2721
|
catchall: je.create(),
|
|
2722
|
-
typeName:
|
|
2723
|
-
},
|
|
2722
|
+
typeName: S.ZodObject
|
|
2723
|
+
}, T(e)));
|
|
2724
2724
|
class Dt extends A {
|
|
2725
2725
|
_parse(e) {
|
|
2726
2726
|
const { ctx: n } = this._processInputParams(e), r = this._def.options;
|
|
@@ -2738,9 +2738,9 @@ class Dt extends A {
|
|
|
2738
2738
|
}), E;
|
|
2739
2739
|
}
|
|
2740
2740
|
if (n.common.async)
|
|
2741
|
-
return Promise.all(r.map((a) =>
|
|
2742
|
-
const i =
|
|
2743
|
-
common:
|
|
2741
|
+
return Promise.all(r.map((a) => Se(this, null, function* () {
|
|
2742
|
+
const i = x(d({}, n), {
|
|
2743
|
+
common: x(d({}, n.common), {
|
|
2744
2744
|
issues: []
|
|
2745
2745
|
}),
|
|
2746
2746
|
parent: null
|
|
@@ -2758,8 +2758,8 @@ class Dt extends A {
|
|
|
2758
2758
|
let a;
|
|
2759
2759
|
const i = [];
|
|
2760
2760
|
for (const c of r) {
|
|
2761
|
-
const u =
|
|
2762
|
-
common:
|
|
2761
|
+
const u = x(d({}, n), {
|
|
2762
|
+
common: x(d({}, n.common), {
|
|
2763
2763
|
issues: []
|
|
2764
2764
|
}),
|
|
2765
2765
|
parent: null
|
|
@@ -2787,10 +2787,10 @@ class Dt extends A {
|
|
|
2787
2787
|
}
|
|
2788
2788
|
Dt.create = (t, e) => new Dt(d({
|
|
2789
2789
|
options: t,
|
|
2790
|
-
typeName:
|
|
2791
|
-
},
|
|
2790
|
+
typeName: S.ZodUnion
|
|
2791
|
+
}, T(e)));
|
|
2792
2792
|
const Ze = (t) => t instanceof $t ? Ze(t.schema) : t instanceof ge ? Ze(t.innerType()) : t instanceof Ft ? [t.value] : t instanceof Fe ? t.options : t instanceof Wt ? N.objectValues(t.enum) : t instanceof zt ? Ze(t._def.innerType) : t instanceof Pt ? [void 0] : t instanceof Zt ? [null] : t instanceof ke ? [void 0, ...Ze(t.unwrap())] : t instanceof We ? [null, ...Ze(t.unwrap())] : t instanceof Nr || t instanceof Vt ? Ze(t.unwrap()) : t instanceof Ut ? Ze(t._def.innerType) : [];
|
|
2793
|
-
class
|
|
2793
|
+
class Sn extends A {
|
|
2794
2794
|
_parse(e) {
|
|
2795
2795
|
const { ctx: n } = this._processInputParams(e);
|
|
2796
2796
|
if (n.parsedType !== _.object)
|
|
@@ -2843,12 +2843,12 @@ class xn extends A {
|
|
|
2843
2843
|
s.set(o, a);
|
|
2844
2844
|
}
|
|
2845
2845
|
}
|
|
2846
|
-
return new
|
|
2847
|
-
typeName:
|
|
2846
|
+
return new Sn(d({
|
|
2847
|
+
typeName: S.ZodDiscriminatedUnion,
|
|
2848
2848
|
discriminator: e,
|
|
2849
2849
|
options: n,
|
|
2850
2850
|
optionsMap: s
|
|
2851
|
-
},
|
|
2851
|
+
}, T(r)));
|
|
2852
2852
|
}
|
|
2853
2853
|
}
|
|
2854
2854
|
function sr(t, e) {
|
|
@@ -2912,8 +2912,8 @@ class Mt extends A {
|
|
|
2912
2912
|
Mt.create = (t, e, n) => new Mt(d({
|
|
2913
2913
|
left: t,
|
|
2914
2914
|
right: e,
|
|
2915
|
-
typeName:
|
|
2916
|
-
},
|
|
2915
|
+
typeName: S.ZodIntersection
|
|
2916
|
+
}, T(n)));
|
|
2917
2917
|
class Ee extends A {
|
|
2918
2918
|
_parse(e) {
|
|
2919
2919
|
const { status: n, ctx: r } = this._processInputParams(e);
|
|
@@ -2940,7 +2940,7 @@ class Ee extends A {
|
|
|
2940
2940
|
}), n.dirty());
|
|
2941
2941
|
const s = [...r.data].map((a, i) => {
|
|
2942
2942
|
const o = this._def.items[i] || this._def.rest;
|
|
2943
|
-
return o ? o._parse(new
|
|
2943
|
+
return o ? o._parse(new xe(r, a, r.path, i)) : null;
|
|
2944
2944
|
}).filter((a) => !!a);
|
|
2945
2945
|
return r.common.async ? Promise.all(s).then((a) => Y.mergeArray(n, a)) : Y.mergeArray(n, s);
|
|
2946
2946
|
}
|
|
@@ -2948,7 +2948,7 @@ class Ee extends A {
|
|
|
2948
2948
|
return this._def.items;
|
|
2949
2949
|
}
|
|
2950
2950
|
rest(e) {
|
|
2951
|
-
return new Ee(
|
|
2951
|
+
return new Ee(x(d({}, this._def), {
|
|
2952
2952
|
rest: e
|
|
2953
2953
|
}));
|
|
2954
2954
|
}
|
|
@@ -2958,9 +2958,9 @@ Ee.create = (t, e) => {
|
|
|
2958
2958
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2959
2959
|
return new Ee(d({
|
|
2960
2960
|
items: t,
|
|
2961
|
-
typeName:
|
|
2961
|
+
typeName: S.ZodTuple,
|
|
2962
2962
|
rest: null
|
|
2963
|
-
},
|
|
2963
|
+
}, T(e)));
|
|
2964
2964
|
};
|
|
2965
2965
|
class Lt extends A {
|
|
2966
2966
|
get keySchema() {
|
|
@@ -2980,8 +2980,8 @@ class Lt extends A {
|
|
|
2980
2980
|
const s = [], a = this._def.keyType, i = this._def.valueType;
|
|
2981
2981
|
for (const o in r.data)
|
|
2982
2982
|
s.push({
|
|
2983
|
-
key: a._parse(new
|
|
2984
|
-
value: i._parse(new
|
|
2983
|
+
key: a._parse(new xe(r, o, r.path, o)),
|
|
2984
|
+
value: i._parse(new xe(r, r.data[o], r.path, o)),
|
|
2985
2985
|
alwaysSet: o in r.data
|
|
2986
2986
|
});
|
|
2987
2987
|
return r.common.async ? Y.mergeObjectAsync(n, s) : Y.mergeObjectSync(n, s);
|
|
@@ -2993,12 +2993,12 @@ class Lt extends A {
|
|
|
2993
2993
|
return n instanceof A ? new Lt(d({
|
|
2994
2994
|
keyType: e,
|
|
2995
2995
|
valueType: n,
|
|
2996
|
-
typeName:
|
|
2997
|
-
},
|
|
2996
|
+
typeName: S.ZodRecord
|
|
2997
|
+
}, T(r))) : new Lt(d({
|
|
2998
2998
|
keyType: me.create(),
|
|
2999
2999
|
valueType: e,
|
|
3000
|
-
typeName:
|
|
3001
|
-
},
|
|
3000
|
+
typeName: S.ZodRecord
|
|
3001
|
+
}, T(n)));
|
|
3002
3002
|
}
|
|
3003
3003
|
}
|
|
3004
3004
|
class gn extends A {
|
|
@@ -3017,12 +3017,12 @@ class gn extends A {
|
|
|
3017
3017
|
received: r.parsedType
|
|
3018
3018
|
}), E;
|
|
3019
3019
|
const s = this._def.keyType, a = this._def.valueType, i = [...r.data.entries()].map(([o, c], u) => ({
|
|
3020
|
-
key: s._parse(new
|
|
3021
|
-
value: a._parse(new
|
|
3020
|
+
key: s._parse(new xe(r, o, r.path, [u, "key"])),
|
|
3021
|
+
value: a._parse(new xe(r, c, r.path, [u, "value"]))
|
|
3022
3022
|
}));
|
|
3023
3023
|
if (r.common.async) {
|
|
3024
3024
|
const o = /* @__PURE__ */ new Map();
|
|
3025
|
-
return Promise.resolve().then(() =>
|
|
3025
|
+
return Promise.resolve().then(() => Se(this, null, function* () {
|
|
3026
3026
|
for (const c of i) {
|
|
3027
3027
|
const u = yield c.key, h = yield c.value;
|
|
3028
3028
|
if (u.status === "aborted" || h.status === "aborted")
|
|
@@ -3046,8 +3046,8 @@ class gn extends A {
|
|
|
3046
3046
|
gn.create = (t, e, n) => new gn(d({
|
|
3047
3047
|
valueType: e,
|
|
3048
3048
|
keyType: t,
|
|
3049
|
-
typeName:
|
|
3050
|
-
},
|
|
3049
|
+
typeName: S.ZodMap
|
|
3050
|
+
}, T(n)));
|
|
3051
3051
|
class et extends A {
|
|
3052
3052
|
_parse(e) {
|
|
3053
3053
|
const { status: n, ctx: r } = this._processInputParams(e);
|
|
@@ -3083,16 +3083,16 @@ class et extends A {
|
|
|
3083
3083
|
}
|
|
3084
3084
|
return { status: n.value, value: u };
|
|
3085
3085
|
}
|
|
3086
|
-
const o = [...r.data.values()].map((c, u) => a._parse(new
|
|
3086
|
+
const o = [...r.data.values()].map((c, u) => a._parse(new xe(r, c, r.path, u)));
|
|
3087
3087
|
return r.common.async ? Promise.all(o).then((c) => i(c)) : i(o);
|
|
3088
3088
|
}
|
|
3089
3089
|
min(e, n) {
|
|
3090
|
-
return new et(
|
|
3090
|
+
return new et(x(d({}, this._def), {
|
|
3091
3091
|
minSize: { value: e, message: w.toString(n) }
|
|
3092
3092
|
}));
|
|
3093
3093
|
}
|
|
3094
3094
|
max(e, n) {
|
|
3095
|
-
return new et(
|
|
3095
|
+
return new et(x(d({}, this._def), {
|
|
3096
3096
|
maxSize: { value: e, message: w.toString(n) }
|
|
3097
3097
|
}));
|
|
3098
3098
|
}
|
|
@@ -3107,8 +3107,8 @@ et.create = (t, e) => new et(d({
|
|
|
3107
3107
|
valueType: t,
|
|
3108
3108
|
minSize: null,
|
|
3109
3109
|
maxSize: null,
|
|
3110
|
-
typeName:
|
|
3111
|
-
},
|
|
3110
|
+
typeName: S.ZodSet
|
|
3111
|
+
}, T(e)));
|
|
3112
3112
|
class ht extends A {
|
|
3113
3113
|
constructor() {
|
|
3114
3114
|
super(...arguments), this.validate = this.implement;
|
|
@@ -3157,7 +3157,7 @@ class ht extends A {
|
|
|
3157
3157
|
if (this._def.returns instanceof vt) {
|
|
3158
3158
|
const o = this;
|
|
3159
3159
|
return ne(function(...c) {
|
|
3160
|
-
return
|
|
3160
|
+
return Se(this, null, function* () {
|
|
3161
3161
|
const u = new oe([]), h = yield o._def.args.parseAsync(c, a).catch((k) => {
|
|
3162
3162
|
throw u.addIssue(r(c, k)), u;
|
|
3163
3163
|
}), p = yield Reflect.apply(i, this, h);
|
|
@@ -3186,12 +3186,12 @@ class ht extends A {
|
|
|
3186
3186
|
return this._def.returns;
|
|
3187
3187
|
}
|
|
3188
3188
|
args(...e) {
|
|
3189
|
-
return new ht(
|
|
3189
|
+
return new ht(x(d({}, this._def), {
|
|
3190
3190
|
args: Ee.create(e).rest(Xe.create())
|
|
3191
3191
|
}));
|
|
3192
3192
|
}
|
|
3193
3193
|
returns(e) {
|
|
3194
|
-
return new ht(
|
|
3194
|
+
return new ht(x(d({}, this._def), {
|
|
3195
3195
|
returns: e
|
|
3196
3196
|
}));
|
|
3197
3197
|
}
|
|
@@ -3205,8 +3205,8 @@ class ht extends A {
|
|
|
3205
3205
|
return new ht(d({
|
|
3206
3206
|
args: e || Ee.create([]).rest(Xe.create()),
|
|
3207
3207
|
returns: n || Xe.create(),
|
|
3208
|
-
typeName:
|
|
3209
|
-
},
|
|
3208
|
+
typeName: S.ZodFunction
|
|
3209
|
+
}, T(r)));
|
|
3210
3210
|
}
|
|
3211
3211
|
}
|
|
3212
3212
|
class $t extends A {
|
|
@@ -3220,8 +3220,8 @@ class $t extends A {
|
|
|
3220
3220
|
}
|
|
3221
3221
|
$t.create = (t, e) => new $t(d({
|
|
3222
3222
|
getter: t,
|
|
3223
|
-
typeName:
|
|
3224
|
-
},
|
|
3223
|
+
typeName: S.ZodLazy
|
|
3224
|
+
}, T(e)));
|
|
3225
3225
|
class Ft extends A {
|
|
3226
3226
|
_parse(e) {
|
|
3227
3227
|
if (e.data !== this._def.value) {
|
|
@@ -3240,13 +3240,13 @@ class Ft extends A {
|
|
|
3240
3240
|
}
|
|
3241
3241
|
Ft.create = (t, e) => new Ft(d({
|
|
3242
3242
|
value: t,
|
|
3243
|
-
typeName:
|
|
3244
|
-
},
|
|
3243
|
+
typeName: S.ZodLiteral
|
|
3244
|
+
}, T(e)));
|
|
3245
3245
|
function Ds(t, e) {
|
|
3246
3246
|
return new Fe(d({
|
|
3247
3247
|
values: t,
|
|
3248
|
-
typeName:
|
|
3249
|
-
},
|
|
3248
|
+
typeName: S.ZodEnum
|
|
3249
|
+
}, T(e)));
|
|
3250
3250
|
}
|
|
3251
3251
|
class Fe extends A {
|
|
3252
3252
|
constructor() {
|
|
@@ -3332,8 +3332,8 @@ class Wt extends A {
|
|
|
3332
3332
|
Tt = /* @__PURE__ */ new WeakMap();
|
|
3333
3333
|
Wt.create = (t, e) => new Wt(d({
|
|
3334
3334
|
values: t,
|
|
3335
|
-
typeName:
|
|
3336
|
-
},
|
|
3335
|
+
typeName: S.ZodNativeEnum
|
|
3336
|
+
}, T(e)));
|
|
3337
3337
|
class vt extends A {
|
|
3338
3338
|
unwrap() {
|
|
3339
3339
|
return this._def.type;
|
|
@@ -3355,14 +3355,14 @@ class vt extends A {
|
|
|
3355
3355
|
}
|
|
3356
3356
|
vt.create = (t, e) => new vt(d({
|
|
3357
3357
|
type: t,
|
|
3358
|
-
typeName:
|
|
3359
|
-
},
|
|
3358
|
+
typeName: S.ZodPromise
|
|
3359
|
+
}, T(e)));
|
|
3360
3360
|
class ge extends A {
|
|
3361
3361
|
innerType() {
|
|
3362
3362
|
return this._def.schema;
|
|
3363
3363
|
}
|
|
3364
3364
|
sourceType() {
|
|
3365
|
-
return this._def.schema._def.typeName ===
|
|
3365
|
+
return this._def.schema._def.typeName === S.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
3366
3366
|
}
|
|
3367
3367
|
_parse(e) {
|
|
3368
3368
|
const { status: n, ctx: r } = this._processInputParams(e), s = this._def.effect || null, a = {
|
|
@@ -3376,7 +3376,7 @@ class ge extends A {
|
|
|
3376
3376
|
if (a.addIssue = a.addIssue.bind(a), s.type === "preprocess") {
|
|
3377
3377
|
const i = s.transform(r.data, a);
|
|
3378
3378
|
if (r.common.async)
|
|
3379
|
-
return Promise.resolve(i).then((o) =>
|
|
3379
|
+
return Promise.resolve(i).then((o) => Se(this, null, function* () {
|
|
3380
3380
|
if (n.value === "aborted")
|
|
3381
3381
|
return E;
|
|
3382
3382
|
const c = yield this._def.schema._parseAsync({
|
|
@@ -3436,14 +3436,14 @@ class ge extends A {
|
|
|
3436
3436
|
}
|
|
3437
3437
|
ge.create = (t, e, n) => new ge(d({
|
|
3438
3438
|
schema: t,
|
|
3439
|
-
typeName:
|
|
3439
|
+
typeName: S.ZodEffects,
|
|
3440
3440
|
effect: e
|
|
3441
|
-
},
|
|
3441
|
+
}, T(n)));
|
|
3442
3442
|
ge.createWithPreprocess = (t, e, n) => new ge(d({
|
|
3443
3443
|
schema: e,
|
|
3444
3444
|
effect: { type: "preprocess", transform: t },
|
|
3445
|
-
typeName:
|
|
3446
|
-
},
|
|
3445
|
+
typeName: S.ZodEffects
|
|
3446
|
+
}, T(n)));
|
|
3447
3447
|
class ke extends A {
|
|
3448
3448
|
_parse(e) {
|
|
3449
3449
|
return this._getType(e) === _.undefined ? ne(void 0) : this._def.innerType._parse(e);
|
|
@@ -3454,8 +3454,8 @@ class ke extends A {
|
|
|
3454
3454
|
}
|
|
3455
3455
|
ke.create = (t, e) => new ke(d({
|
|
3456
3456
|
innerType: t,
|
|
3457
|
-
typeName:
|
|
3458
|
-
},
|
|
3457
|
+
typeName: S.ZodOptional
|
|
3458
|
+
}, T(e)));
|
|
3459
3459
|
class We extends A {
|
|
3460
3460
|
_parse(e) {
|
|
3461
3461
|
return this._getType(e) === _.null ? ne(null) : this._def.innerType._parse(e);
|
|
@@ -3466,8 +3466,8 @@ class We extends A {
|
|
|
3466
3466
|
}
|
|
3467
3467
|
We.create = (t, e) => new We(d({
|
|
3468
3468
|
innerType: t,
|
|
3469
|
-
typeName:
|
|
3470
|
-
},
|
|
3469
|
+
typeName: S.ZodNullable
|
|
3470
|
+
}, T(e)));
|
|
3471
3471
|
class zt extends A {
|
|
3472
3472
|
_parse(e) {
|
|
3473
3473
|
const { ctx: n } = this._processInputParams(e);
|
|
@@ -3484,13 +3484,13 @@ class zt extends A {
|
|
|
3484
3484
|
}
|
|
3485
3485
|
zt.create = (t, e) => new zt(d({
|
|
3486
3486
|
innerType: t,
|
|
3487
|
-
typeName:
|
|
3487
|
+
typeName: S.ZodDefault,
|
|
3488
3488
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default
|
|
3489
|
-
},
|
|
3489
|
+
}, T(e)));
|
|
3490
3490
|
class Ut extends A {
|
|
3491
3491
|
_parse(e) {
|
|
3492
|
-
const { ctx: n } = this._processInputParams(e), r =
|
|
3493
|
-
common:
|
|
3492
|
+
const { ctx: n } = this._processInputParams(e), r = x(d({}, n), {
|
|
3493
|
+
common: x(d({}, n.common), {
|
|
3494
3494
|
issues: []
|
|
3495
3495
|
})
|
|
3496
3496
|
}), s = this._def.innerType._parse({
|
|
@@ -3522,9 +3522,9 @@ class Ut extends A {
|
|
|
3522
3522
|
}
|
|
3523
3523
|
Ut.create = (t, e) => new Ut(d({
|
|
3524
3524
|
innerType: t,
|
|
3525
|
-
typeName:
|
|
3525
|
+
typeName: S.ZodCatch,
|
|
3526
3526
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch
|
|
3527
|
-
},
|
|
3527
|
+
}, T(e)));
|
|
3528
3528
|
class vn extends A {
|
|
3529
3529
|
_parse(e) {
|
|
3530
3530
|
if (this._getType(e) !== _.nan) {
|
|
@@ -3539,8 +3539,8 @@ class vn extends A {
|
|
|
3539
3539
|
}
|
|
3540
3540
|
}
|
|
3541
3541
|
vn.create = (t) => new vn(d({
|
|
3542
|
-
typeName:
|
|
3543
|
-
},
|
|
3542
|
+
typeName: S.ZodNaN
|
|
3543
|
+
}, T(t)));
|
|
3544
3544
|
const to = Symbol("zod_brand");
|
|
3545
3545
|
class Nr extends A {
|
|
3546
3546
|
_parse(e) {
|
|
@@ -3559,7 +3559,7 @@ class Jt extends A {
|
|
|
3559
3559
|
_parse(e) {
|
|
3560
3560
|
const { status: n, ctx: r } = this._processInputParams(e);
|
|
3561
3561
|
if (r.common.async)
|
|
3562
|
-
return
|
|
3562
|
+
return Se(this, null, function* () {
|
|
3563
3563
|
const s = yield this._def.in._parseAsync({
|
|
3564
3564
|
data: r.data,
|
|
3565
3565
|
path: r.path,
|
|
@@ -3591,7 +3591,7 @@ class Jt extends A {
|
|
|
3591
3591
|
return new Jt({
|
|
3592
3592
|
in: e,
|
|
3593
3593
|
out: n,
|
|
3594
|
-
typeName:
|
|
3594
|
+
typeName: S.ZodPipeline
|
|
3595
3595
|
});
|
|
3596
3596
|
}
|
|
3597
3597
|
}
|
|
@@ -3606,8 +3606,8 @@ class Vt extends A {
|
|
|
3606
3606
|
}
|
|
3607
3607
|
Vt.create = (t, e) => new Vt(d({
|
|
3608
3608
|
innerType: t,
|
|
3609
|
-
typeName:
|
|
3610
|
-
},
|
|
3609
|
+
typeName: S.ZodReadonly
|
|
3610
|
+
}, T(e)));
|
|
3611
3611
|
function as(t, e) {
|
|
3612
3612
|
const n = typeof t == "function" ? t(e) : typeof t == "string" ? { message: t } : t;
|
|
3613
3613
|
return typeof n == "string" ? { message: n } : n;
|
|
@@ -3621,32 +3621,32 @@ function Ms(t, e = {}, n) {
|
|
|
3621
3621
|
var u, h;
|
|
3622
3622
|
if (!c) {
|
|
3623
3623
|
const p = as(e, r), k = (h = (u = p.fatal) !== null && u !== void 0 ? u : n) !== null && h !== void 0 ? h : !0;
|
|
3624
|
-
s.addIssue(
|
|
3624
|
+
s.addIssue(x(d({ code: "custom" }, p), { fatal: k }));
|
|
3625
3625
|
}
|
|
3626
3626
|
});
|
|
3627
3627
|
if (!o) {
|
|
3628
3628
|
const c = as(e, r), u = (i = (a = c.fatal) !== null && a !== void 0 ? a : n) !== null && i !== void 0 ? i : !0;
|
|
3629
|
-
s.addIssue(
|
|
3629
|
+
s.addIssue(x(d({ code: "custom" }, c), { fatal: u }));
|
|
3630
3630
|
}
|
|
3631
3631
|
}) : gt.create();
|
|
3632
3632
|
}
|
|
3633
3633
|
const no = {
|
|
3634
3634
|
object: z.lazycreate
|
|
3635
3635
|
};
|
|
3636
|
-
var
|
|
3636
|
+
var S;
|
|
3637
3637
|
(function(t) {
|
|
3638
3638
|
t.ZodString = "ZodString", t.ZodNumber = "ZodNumber", t.ZodNaN = "ZodNaN", t.ZodBigInt = "ZodBigInt", t.ZodBoolean = "ZodBoolean", t.ZodDate = "ZodDate", t.ZodSymbol = "ZodSymbol", t.ZodUndefined = "ZodUndefined", t.ZodNull = "ZodNull", t.ZodAny = "ZodAny", t.ZodUnknown = "ZodUnknown", t.ZodNever = "ZodNever", t.ZodVoid = "ZodVoid", t.ZodArray = "ZodArray", t.ZodObject = "ZodObject", t.ZodUnion = "ZodUnion", t.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", t.ZodIntersection = "ZodIntersection", t.ZodTuple = "ZodTuple", t.ZodRecord = "ZodRecord", t.ZodMap = "ZodMap", t.ZodSet = "ZodSet", t.ZodFunction = "ZodFunction", t.ZodLazy = "ZodLazy", t.ZodLiteral = "ZodLiteral", t.ZodEnum = "ZodEnum", t.ZodEffects = "ZodEffects", t.ZodNativeEnum = "ZodNativeEnum", t.ZodOptional = "ZodOptional", t.ZodNullable = "ZodNullable", t.ZodDefault = "ZodDefault", t.ZodCatch = "ZodCatch", t.ZodPromise = "ZodPromise", t.ZodBranded = "ZodBranded", t.ZodPipeline = "ZodPipeline", t.ZodReadonly = "ZodReadonly";
|
|
3639
|
-
})(
|
|
3639
|
+
})(S || (S = {}));
|
|
3640
3640
|
const ro = (t, e = {
|
|
3641
3641
|
message: `Input not instance of ${t.name}`
|
|
3642
|
-
}) => Ms((n) => n instanceof t, e), Ls = me.create, $s = Le.create, so = vn.create, ao = $e.create, Fs = It.create, io = Qe.create, oo = mn.create, co = Pt.create, uo = Zt.create, lo = gt.create, fo = Xe.create, ho = je.create, po = yn.create, mo = ye.create, yo = z.create, go = z.strictCreate, vo = Dt.create, _o =
|
|
3643
|
-
string: (t) => me.create(
|
|
3644
|
-
number: (t) => Le.create(
|
|
3645
|
-
boolean: (t) => It.create(
|
|
3642
|
+
}) => Ms((n) => n instanceof t, e), Ls = me.create, $s = Le.create, so = vn.create, ao = $e.create, Fs = It.create, io = Qe.create, oo = mn.create, co = Pt.create, uo = Zt.create, lo = gt.create, fo = Xe.create, ho = je.create, po = yn.create, mo = ye.create, yo = z.create, go = z.strictCreate, vo = Dt.create, _o = Sn.create, bo = Mt.create, wo = Ee.create, ko = Lt.create, So = gn.create, xo = et.create, Eo = ht.create, Oo = $t.create, To = Ft.create, Ao = Fe.create, Co = Wt.create, No = vt.create, is = ge.create, Ro = ke.create, jo = We.create, Io = ge.createWithPreprocess, Po = Jt.create, Zo = () => Ls().optional(), Do = () => $s().optional(), Mo = () => Fs().optional(), Lo = {
|
|
3643
|
+
string: (t) => me.create(x(d({}, t), { coerce: !0 })),
|
|
3644
|
+
number: (t) => Le.create(x(d({}, t), { coerce: !0 })),
|
|
3645
|
+
boolean: (t) => It.create(x(d({}, t), {
|
|
3646
3646
|
coerce: !0
|
|
3647
3647
|
})),
|
|
3648
|
-
bigint: (t) => $e.create(
|
|
3649
|
-
date: (t) => Qe.create(
|
|
3648
|
+
bigint: (t) => $e.create(x(d({}, t), { coerce: !0 })),
|
|
3649
|
+
date: (t) => Qe.create(x(d({}, t), { coerce: !0 }))
|
|
3650
3650
|
}, $o = E;
|
|
3651
3651
|
var j = /* @__PURE__ */ Object.freeze({
|
|
3652
3652
|
__proto__: null,
|
|
@@ -3689,7 +3689,7 @@ var j = /* @__PURE__ */ Object.freeze({
|
|
|
3689
3689
|
ZodArray: ye,
|
|
3690
3690
|
ZodObject: z,
|
|
3691
3691
|
ZodUnion: Dt,
|
|
3692
|
-
ZodDiscriminatedUnion:
|
|
3692
|
+
ZodDiscriminatedUnion: Sn,
|
|
3693
3693
|
ZodIntersection: Mt,
|
|
3694
3694
|
ZodTuple: Ee,
|
|
3695
3695
|
ZodRecord: Lt,
|
|
@@ -3717,7 +3717,7 @@ var j = /* @__PURE__ */ Object.freeze({
|
|
|
3717
3717
|
ZodSchema: A,
|
|
3718
3718
|
late: no,
|
|
3719
3719
|
get ZodFirstPartyTypeKind() {
|
|
3720
|
-
return
|
|
3720
|
+
return S;
|
|
3721
3721
|
},
|
|
3722
3722
|
coerce: Lo,
|
|
3723
3723
|
any: lo,
|
|
@@ -3733,7 +3733,7 @@ var j = /* @__PURE__ */ Object.freeze({
|
|
|
3733
3733
|
intersection: bo,
|
|
3734
3734
|
lazy: Oo,
|
|
3735
3735
|
literal: To,
|
|
3736
|
-
map:
|
|
3736
|
+
map: So,
|
|
3737
3737
|
nan: so,
|
|
3738
3738
|
nativeEnum: Co,
|
|
3739
3739
|
never: ho,
|
|
@@ -3749,7 +3749,7 @@ var j = /* @__PURE__ */ Object.freeze({
|
|
|
3749
3749
|
preprocess: Io,
|
|
3750
3750
|
promise: No,
|
|
3751
3751
|
record: ko,
|
|
3752
|
-
set:
|
|
3752
|
+
set: xo,
|
|
3753
3753
|
strictObject: go,
|
|
3754
3754
|
string: Ls,
|
|
3755
3755
|
symbol: oo,
|
|
@@ -3823,10 +3823,10 @@ function Fo(t) {
|
|
|
3823
3823
|
const { onEvent: e = Zn, onError: n = Zn, onRetry: r = Zn, onComment: s } = t;
|
|
3824
3824
|
let a = "", i = !0, o, c = "", u = "";
|
|
3825
3825
|
function h(m) {
|
|
3826
|
-
const g = i ? m.replace(/^\xEF\xBB\xBF/, "") : m, [l,
|
|
3826
|
+
const g = i ? m.replace(/^\xEF\xBB\xBF/, "") : m, [l, O] = Wo(`${a}${g}`);
|
|
3827
3827
|
for (const I of l)
|
|
3828
3828
|
p(I);
|
|
3829
|
-
a =
|
|
3829
|
+
a = O, i = !1;
|
|
3830
3830
|
}
|
|
3831
3831
|
function p(m) {
|
|
3832
3832
|
if (m === "") {
|
|
@@ -3839,7 +3839,7 @@ function Fo(t) {
|
|
|
3839
3839
|
}
|
|
3840
3840
|
const g = m.indexOf(":");
|
|
3841
3841
|
if (g !== -1) {
|
|
3842
|
-
const l = m.slice(0, g),
|
|
3842
|
+
const l = m.slice(0, g), O = m[g + 1] === " " ? 2 : 1, I = m.slice(g + O);
|
|
3843
3843
|
k(l, I, m);
|
|
3844
3844
|
return;
|
|
3845
3845
|
}
|
|
@@ -4235,19 +4235,19 @@ function Us(t) {
|
|
|
4235
4235
|
return n === Object ? !0 : typeof n == "function" && Function.toString.call(n) === Ko;
|
|
4236
4236
|
}
|
|
4237
4237
|
function bn(t, e) {
|
|
4238
|
-
|
|
4238
|
+
xn(t) === 0 ? Reflect.ownKeys(t).forEach((n) => {
|
|
4239
4239
|
e(n, t[n], t);
|
|
4240
4240
|
}) : t.forEach((n, r) => e(r, n, t));
|
|
4241
4241
|
}
|
|
4242
|
-
function
|
|
4242
|
+
function xn(t) {
|
|
4243
4243
|
const e = t[ce];
|
|
4244
4244
|
return e ? e.type_ : Array.isArray(t) ? 1 : En(t) ? 2 : On(t) ? 3 : 0;
|
|
4245
4245
|
}
|
|
4246
4246
|
function hr(t, e) {
|
|
4247
|
-
return
|
|
4247
|
+
return xn(t) === 2 ? t.has(e) : Object.prototype.hasOwnProperty.call(t, e);
|
|
4248
4248
|
}
|
|
4249
4249
|
function Vs(t, e, n) {
|
|
4250
|
-
const r =
|
|
4250
|
+
const r = xn(t);
|
|
4251
4251
|
r === 2 ? t.set(e, n) : r === 3 ? t.add(n) : t[e] = n;
|
|
4252
4252
|
}
|
|
4253
4253
|
function Bo(t, e) {
|
|
@@ -4294,7 +4294,7 @@ function pr(t, e) {
|
|
|
4294
4294
|
}
|
|
4295
4295
|
}
|
|
4296
4296
|
function Kt(t, e = !1) {
|
|
4297
|
-
return Tn(t) || bt(t) || !tt(t) || (
|
|
4297
|
+
return Tn(t) || bt(t) || !tt(t) || (xn(t) > 1 && (t.set = t.add = t.clear = t.delete = qo), Object.freeze(t), e && Object.entries(t).forEach(([n, r]) => Kt(r, !0))), t;
|
|
4298
4298
|
}
|
|
4299
4299
|
function qo() {
|
|
4300
4300
|
ae(2);
|
|
@@ -4696,21 +4696,21 @@ const ys = 10, gs = {
|
|
|
4696
4696
|
const b = {};
|
|
4697
4697
|
c.addEventListener("start", (g) => {
|
|
4698
4698
|
const l = JSON.parse(g.data);
|
|
4699
|
-
b.sessionId = l.sessionId, r((
|
|
4700
|
-
|
|
4699
|
+
b.sessionId = l.sessionId, r((O) => {
|
|
4700
|
+
O.tasks.fetchDesign.status = "running", O.jobSessionId = l.sessionId;
|
|
4701
4701
|
});
|
|
4702
4702
|
}), c.addEventListener("queueing", (g) => {
|
|
4703
4703
|
const l = JSON.parse(
|
|
4704
4704
|
g.data
|
|
4705
4705
|
);
|
|
4706
|
-
r((
|
|
4707
|
-
|
|
4706
|
+
r((O) => {
|
|
4707
|
+
O.jobSessionId = l.payload.sessionId;
|
|
4708
4708
|
});
|
|
4709
4709
|
}), c.addEventListener("pre_codegen", (g) => {
|
|
4710
4710
|
JSON.parse(
|
|
4711
4711
|
g.data
|
|
4712
|
-
).message === "Anima model built" && r((
|
|
4713
|
-
|
|
4712
|
+
).message === "Anima model built" && r((O) => {
|
|
4713
|
+
O.tasks.fetchDesign.status = "finished", O.tasks.codeGeneration.status = "running", O.tasks.uploadAssets.status = "running";
|
|
4714
4714
|
});
|
|
4715
4715
|
}), c.addEventListener("figma_metadata", (g) => {
|
|
4716
4716
|
const l = JSON.parse(
|
|
@@ -4729,22 +4729,22 @@ const ys = 10, gs = {
|
|
|
4729
4729
|
const l = JSON.parse(
|
|
4730
4730
|
g.data
|
|
4731
4731
|
);
|
|
4732
|
-
l.payload.status === "success" && (b.files = l.payload.files), r((
|
|
4733
|
-
|
|
4732
|
+
l.payload.status === "success" && (b.files = l.payload.files), r((O) => {
|
|
4733
|
+
O.tasks.codeGeneration.progress = l.payload.progress, O.tasks.codeGeneration.status = "running";
|
|
4734
4734
|
});
|
|
4735
4735
|
}), c.addEventListener("progress_messages_updated", (g) => {
|
|
4736
4736
|
const l = JSON.parse(
|
|
4737
4737
|
g.data
|
|
4738
4738
|
);
|
|
4739
|
-
r((
|
|
4740
|
-
|
|
4739
|
+
r((O) => {
|
|
4740
|
+
O.progressMessages = l.payload.progressMessages;
|
|
4741
4741
|
});
|
|
4742
4742
|
}), c.addEventListener("job_status_updated", (g) => {
|
|
4743
4743
|
const l = JSON.parse(
|
|
4744
4744
|
g.data
|
|
4745
4745
|
);
|
|
4746
|
-
r((
|
|
4747
|
-
|
|
4746
|
+
r((O) => {
|
|
4747
|
+
O.jobStatus = l.payload.jobStatus;
|
|
4748
4748
|
});
|
|
4749
4749
|
}), c.addEventListener("codegen_completed", () => {
|
|
4750
4750
|
r((g) => {
|
|
@@ -4771,19 +4771,19 @@ const ys = 10, gs = {
|
|
|
4771
4771
|
`Experienced error during code generation (attempt ${m + 1} / ${ys})`,
|
|
4772
4772
|
g
|
|
4773
4773
|
);
|
|
4774
|
-
let l,
|
|
4774
|
+
let l, O, I = !1;
|
|
4775
4775
|
try {
|
|
4776
4776
|
if (g instanceof MessageEvent)
|
|
4777
4777
|
l = JSON.parse(g.data);
|
|
4778
4778
|
else {
|
|
4779
4779
|
const G = yield o;
|
|
4780
|
-
|
|
4780
|
+
O = G.status;
|
|
4781
4781
|
try {
|
|
4782
4782
|
l = yield G.json();
|
|
4783
4783
|
} catch ($) {
|
|
4784
4784
|
}
|
|
4785
4785
|
}
|
|
4786
|
-
(((U = l == null ? void 0 : l.payload) == null ? void 0 : U.name) === "Task Crashed" ||
|
|
4786
|
+
(((U = l == null ? void 0 : l.payload) == null ? void 0 : U.name) === "Task Crashed" || O === 429) && (I = !0);
|
|
4787
4787
|
} catch (G) {
|
|
4788
4788
|
}
|
|
4789
4789
|
const K = new Gr({
|
|
@@ -4802,8 +4802,8 @@ const ys = 10, gs = {
|
|
|
4802
4802
|
}));
|
|
4803
4803
|
})), c.addEventListener("done", (g) => {
|
|
4804
4804
|
const l = JSON.parse(g.data);
|
|
4805
|
-
b.tokenUsage = l.payload.tokenUsage, b.sessionId = l.payload.sessionId, r((
|
|
4806
|
-
|
|
4805
|
+
b.tokenUsage = l.payload.tokenUsage, b.sessionId = l.payload.sessionId, r((O) => {
|
|
4806
|
+
O.status = "success", O.result = b;
|
|
4807
4807
|
}), v({ result: b, error: null });
|
|
4808
4808
|
});
|
|
4809
4809
|
});
|
|
@@ -4818,8 +4818,8 @@ const ys = 10, gs = {
|
|
|
4818
4818
|
assetName: I.name,
|
|
4819
4819
|
base64: va(Z)
|
|
4820
4820
|
};
|
|
4821
|
-
})),
|
|
4822
|
-
for (const I of
|
|
4821
|
+
})), O = yield Promise.allSettled(l);
|
|
4822
|
+
for (const I of O) {
|
|
4823
4823
|
const K = {};
|
|
4824
4824
|
if (I.status === "fulfilled") {
|
|
4825
4825
|
const { assetName: Z, base64: U } = I.value;
|
|
@@ -4927,16 +4927,16 @@ function sc() {
|
|
|
4927
4927
|
g = i({
|
|
4928
4928
|
inst: { value: m, getSnapshot: b }
|
|
4929
4929
|
});
|
|
4930
|
-
var l = g[0].inst,
|
|
4930
|
+
var l = g[0].inst, O = g[1];
|
|
4931
4931
|
return c(
|
|
4932
4932
|
function() {
|
|
4933
|
-
l.value = m, l.getSnapshot = b, n(l) &&
|
|
4933
|
+
l.value = m, l.getSnapshot = b, n(l) && O({ inst: l });
|
|
4934
4934
|
},
|
|
4935
4935
|
[v, m, b]
|
|
4936
4936
|
), o(
|
|
4937
4937
|
function() {
|
|
4938
|
-
return n(l) &&
|
|
4939
|
-
n(l) &&
|
|
4938
|
+
return n(l) && O({ inst: l }), v(function() {
|
|
4939
|
+
n(l) && O({ inst: l });
|
|
4940
4940
|
});
|
|
4941
4941
|
},
|
|
4942
4942
|
[v]
|
|
@@ -4966,7 +4966,7 @@ function ac() {
|
|
|
4966
4966
|
}
|
|
4967
4967
|
var ic = ac();
|
|
4968
4968
|
const Hs = 0, Gs = 1, Js = 2, ks = 3;
|
|
4969
|
-
var
|
|
4969
|
+
var Ss = Object.prototype.hasOwnProperty;
|
|
4970
4970
|
function _r(t, e) {
|
|
4971
4971
|
var n, r;
|
|
4972
4972
|
if (t === e) return !0;
|
|
@@ -4981,7 +4981,7 @@ function _r(t, e) {
|
|
|
4981
4981
|
if (!n || typeof t == "object") {
|
|
4982
4982
|
r = 0;
|
|
4983
4983
|
for (n in t)
|
|
4984
|
-
if (
|
|
4984
|
+
if (Ss.call(t, n) && ++r && !Ss.call(e, n) || !(n in e) || !_r(t[n], e[n])) return !1;
|
|
4985
4985
|
return Object.keys(e).length === r;
|
|
4986
4986
|
}
|
|
4987
4987
|
}
|
|
@@ -5010,7 +5010,7 @@ const Re = /* @__PURE__ */ new WeakMap(), Me = () => {
|
|
|
5010
5010
|
];
|
|
5011
5011
|
};
|
|
5012
5012
|
let kr = !0;
|
|
5013
|
-
const uc = () => kr, [
|
|
5013
|
+
const uc = () => kr, [Sr, xr] = Xt && window.addEventListener ? [
|
|
5014
5014
|
window.addEventListener.bind(window),
|
|
5015
5015
|
window.removeEventListener.bind(window)
|
|
5016
5016
|
] : [
|
|
@@ -5019,16 +5019,16 @@ const uc = () => kr, [xr, Sr] = Xt && window.addEventListener ? [
|
|
|
5019
5019
|
], dc = () => {
|
|
5020
5020
|
const t = wr && document.visibilityState;
|
|
5021
5021
|
return R(t) || t !== "hidden";
|
|
5022
|
-
}, lc = (t) => (wr && document.addEventListener("visibilitychange", t),
|
|
5023
|
-
wr && document.removeEventListener("visibilitychange", t),
|
|
5022
|
+
}, lc = (t) => (wr && document.addEventListener("visibilitychange", t), Sr("focus", t), () => {
|
|
5023
|
+
wr && document.removeEventListener("visibilitychange", t), xr("focus", t);
|
|
5024
5024
|
}), fc = (t) => {
|
|
5025
5025
|
const e = () => {
|
|
5026
5026
|
kr = !0, t();
|
|
5027
5027
|
}, n = () => {
|
|
5028
5028
|
kr = !1;
|
|
5029
5029
|
};
|
|
5030
|
-
return
|
|
5031
|
-
|
|
5030
|
+
return Sr("online", e), Sr("offline", n), () => {
|
|
5031
|
+
xr("online", e), xr("offline", n);
|
|
5032
5032
|
};
|
|
5033
5033
|
}, hc = {
|
|
5034
5034
|
isOnline: uc,
|
|
@@ -5036,7 +5036,7 @@ const uc = () => kr, [xr, Sr] = Xt && window.addEventListener ? [
|
|
|
5036
5036
|
}, pc = {
|
|
5037
5037
|
initFocus: lc,
|
|
5038
5038
|
initReconnect: fc
|
|
5039
|
-
},
|
|
5039
|
+
}, xs = !Gt.useId, Ht = !Xt || oc, mc = (t) => cc() ? window.requestAnimationFrame(t) : setTimeout(t, 1), Wn = Ht ? ha : pa, zn = typeof navigator != "undefined" && navigator.connection, Es = !Ht && zn && ([
|
|
5040
5040
|
"slow-2g",
|
|
5041
5041
|
"2g"
|
|
5042
5042
|
].includes(zn.effectiveType) || zn.saveData), rn = /* @__PURE__ */ new WeakMap(), Un = (t, e) => br.prototype.toString.call(t) === `[object ${e}]`;
|
|
@@ -5100,9 +5100,9 @@ function Qs(...t) {
|
|
|
5100
5100
|
return Ie(this, null, function* () {
|
|
5101
5101
|
const [v] = Pr(k);
|
|
5102
5102
|
if (!v) return;
|
|
5103
|
-
const [b, m] = Ys(e, v), [g, l,
|
|
5103
|
+
const [b, m] = Ys(e, v), [g, l, O, I] = Re.get(e), K = () => {
|
|
5104
5104
|
const fe = g[v];
|
|
5105
|
-
return (we(a.revalidate) ? a.revalidate(b().data, k) : a.revalidate !== !1) && (delete
|
|
5105
|
+
return (we(a.revalidate) ? a.revalidate(b().data, k) : a.revalidate !== !1) && (delete O[v], delete I[v], fe && fe[0]) ? fe[0](Js).then(() => b().data) : b().data;
|
|
5106
5106
|
};
|
|
5107
5107
|
if (t.length < 3)
|
|
5108
5108
|
return K();
|
|
@@ -5232,14 +5232,14 @@ const Os = (t, e) => {
|
|
|
5232
5232
|
},
|
|
5233
5233
|
// use web preset by default
|
|
5234
5234
|
hc
|
|
5235
|
-
),
|
|
5235
|
+
), Sc = (t, e) => {
|
|
5236
5236
|
const n = ze(t, e);
|
|
5237
5237
|
if (e) {
|
|
5238
5238
|
const { use: r, fallback: s } = t, { use: a, fallback: i } = e;
|
|
5239
5239
|
r && a && (n.use = r.concat(a)), s && i && (n.fallback = ze(s, i));
|
|
5240
5240
|
}
|
|
5241
5241
|
return n;
|
|
5242
|
-
},
|
|
5242
|
+
}, xc = fa({}), Ec = "$inf$", ta = Xt && window.__SWR_DEVTOOLS_USE__, Oc = ta ? window.__SWR_DEVTOOLS_USE__ : [], Tc = () => {
|
|
5243
5243
|
ta && (window.__SWR_DEVTOOLS_REACT__ = Gt);
|
|
5244
5244
|
}, Ac = (t) => we(t[1]) ? [
|
|
5245
5245
|
t[0],
|
|
@@ -5249,14 +5249,14 @@ const Os = (t, e) => {
|
|
|
5249
5249
|
t[0],
|
|
5250
5250
|
null,
|
|
5251
5251
|
(t[1] === null ? t[2] : t[1]) || {}
|
|
5252
|
-
], Cc = () => ze(kc, ma(
|
|
5252
|
+
], Cc = () => ze(kc, ma(xc)), Nc = (t) => (e, n, r) => t(e, n && ((...a) => {
|
|
5253
5253
|
const [i] = Pr(e), [, , , o] = Re.get(ea);
|
|
5254
5254
|
if (i.startsWith(Ec))
|
|
5255
5255
|
return n(...a);
|
|
5256
5256
|
const c = o[i];
|
|
5257
5257
|
return R(c) ? n(...a) : (delete o[i], c);
|
|
5258
5258
|
}), r), Rc = Oc.concat(Nc), jc = (t) => function(...n) {
|
|
5259
|
-
const r = Cc(), [s, a, i] = Ac(n), o =
|
|
5259
|
+
const r = Cc(), [s, a, i] = Ac(n), o = Sc(r, i);
|
|
5260
5260
|
let c = t;
|
|
5261
5261
|
const { use: u } = o, h = (u || []).concat(Rc);
|
|
5262
5262
|
for (let p = h.length; p--; )
|
|
@@ -5292,7 +5292,7 @@ const Vn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5292
5292
|
}), Kn = {
|
|
5293
5293
|
dedupe: !0
|
|
5294
5294
|
}, Pc = (t, e, n) => {
|
|
5295
|
-
const { cache: r, compare: s, suspense: a, fallbackData: i, revalidateOnMount: o, revalidateIfStale: c, refreshInterval: u, refreshWhenHidden: h, refreshWhenOffline: p, keepPreviousData: k } = n, [v, b, m, g] = Re.get(r), [l,
|
|
5295
|
+
const { cache: r, compare: s, suspense: a, fallbackData: i, revalidateOnMount: o, revalidateIfStale: c, refreshInterval: u, refreshWhenHidden: h, refreshWhenOffline: p, keepPreviousData: k } = n, [v, b, m, g] = Re.get(r), [l, O] = Pr(t), I = Be(!1), K = Be(!1), Z = Be(l), U = Be(e), D = Be(n), M = () => D.current, G = () => M().isVisible() && M().isOnline(), [$, rt, Ue, fe] = Ys(r, l), st = Be({}).current, Yt = R(i) ? R(n.fallback) ? te : n.fallback[l] : i, Zr = (F, L) => {
|
|
5296
5296
|
for (const J in st) {
|
|
5297
5297
|
const V = J;
|
|
5298
5298
|
if (V === "data") {
|
|
@@ -5336,7 +5336,7 @@ const Vn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5336
5336
|
if (!l || !L || K.current || M().isPaused())
|
|
5337
5337
|
return !1;
|
|
5338
5338
|
let J, V, he = !0;
|
|
5339
|
-
const ot = F || {}, H = !m[l] || !ot.dedupe, Q = () =>
|
|
5339
|
+
const ot = F || {}, H = !m[l] || !ot.dedupe, Q = () => xs ? !K.current && l === Z.current && I.current : l === Z.current, Oe = {
|
|
5340
5340
|
isValidating: !1,
|
|
5341
5341
|
isLoading: !1
|
|
5342
5342
|
}, Wr = () => {
|
|
@@ -5352,7 +5352,7 @@ const Vn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5352
5352
|
if (H && (rt(Ur), n.loadingTimeout && R($().data) && setTimeout(() => {
|
|
5353
5353
|
he && Q() && M().onLoadingSlow(l, n);
|
|
5354
5354
|
}, n.loadingTimeout), m[l] = [
|
|
5355
|
-
L(
|
|
5355
|
+
L(O),
|
|
5356
5356
|
Or()
|
|
5357
5357
|
]), [J, V] = m[l], J = yield J, H && setTimeout(zr, n.dedupingInterval), !m[l] || m[l][1] !== V)
|
|
5358
5358
|
return H && Q() && M().onDiscarded(l), !1;
|
|
@@ -5420,7 +5420,7 @@ const Vn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5420
5420
|
}
|
|
5421
5421
|
});
|
|
5422
5422
|
return K.current = !1, Z.current = l, I.current = !0, rt({
|
|
5423
|
-
_k:
|
|
5423
|
+
_k: O
|
|
5424
5424
|
}), Lr && (R(Ve) || Ht ? F() : mc(F)), () => {
|
|
5425
5425
|
K.current = !0, V();
|
|
5426
5426
|
};
|
|
@@ -5444,7 +5444,7 @@ const Vn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5444
5444
|
p,
|
|
5445
5445
|
l
|
|
5446
5446
|
]), ga(en), a && R(Ve) && l) {
|
|
5447
|
-
if (!
|
|
5447
|
+
if (!xs && Ht)
|
|
5448
5448
|
throw new Error("Fallback data is required when using Suspense in SSR.");
|
|
5449
5449
|
U.current = e, D.current = n, K.current = !1;
|
|
5450
5450
|
const F = g[l];
|