@animaapp/anima-sdk-react 0.4.3 → 0.4.4
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 +214 -213
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -41,7 +41,7 @@ var va = Object.defineProperty, _a = Object.defineProperties, ba = Object.getOwn
|
|
|
41
41
|
for (var n of qs(e))
|
|
42
42
|
ka.call(e, n) && Hs(t, n, e[n]);
|
|
43
43
|
return t;
|
|
44
|
-
},
|
|
44
|
+
}, x = (t, e) => _a(t, ba(e)), ke = (t, e, n) => new Promise((s, r) => {
|
|
45
45
|
var a = (c) => {
|
|
46
46
|
try {
|
|
47
47
|
o(n.next(c));
|
|
@@ -67,14 +67,14 @@ class Gs extends Error {
|
|
|
67
67
|
super(), this.name = e, this.message = n, this.detail = r, this.status = s;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
const
|
|
71
|
-
class
|
|
70
|
+
const Ea = "Figma Token Issue";
|
|
71
|
+
class xa extends Error {
|
|
72
72
|
constructor({
|
|
73
73
|
fileKey: e,
|
|
74
74
|
reason: n,
|
|
75
75
|
cause: s
|
|
76
76
|
}) {
|
|
77
|
-
super(
|
|
77
|
+
super(Ea), this.fileKey = e, this.reason = n, this.cause = s;
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
const Sa = "Rate Limit Exceeded";
|
|
@@ -106,7 +106,7 @@ const Ia = (t, e) => {
|
|
|
106
106
|
if (((n = t == null ? void 0 : t.cause) == null ? void 0 : n.message) === "Fetch Error") {
|
|
107
107
|
const { err: s, status: r } = t.cause.body;
|
|
108
108
|
if (r === 403)
|
|
109
|
-
return new
|
|
109
|
+
return new xa({
|
|
110
110
|
fileKey: e,
|
|
111
111
|
reason: s,
|
|
112
112
|
cause: t
|
|
@@ -154,7 +154,7 @@ function Va() {
|
|
|
154
154
|
(function(n, s) {
|
|
155
155
|
t.exports = s();
|
|
156
156
|
})(za, function() {
|
|
157
|
-
var n = typeof Promise == "function", s = typeof self == "object" ? self : Fa, r = typeof Symbol != "undefined", a = typeof Map != "undefined", i = typeof Set != "undefined", o = typeof WeakMap != "undefined", c = typeof WeakSet != "undefined", u = typeof DataView != "undefined", h = r && typeof Symbol.iterator != "undefined", p = r && 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()), l = v && Object.getPrototypeOf((/* @__PURE__ */ new Map()).entries()), y = h && typeof Array.prototype[Symbol.iterator] == "function", m = y && Object.getPrototypeOf([][Symbol.iterator]()), W = h && typeof String.prototype[Symbol.iterator] == "function", R = W && Object.getPrototypeOf(""[Symbol.iterator]()), V = 8,
|
|
157
|
+
var n = typeof Promise == "function", s = typeof self == "object" ? self : Fa, r = typeof Symbol != "undefined", a = typeof Map != "undefined", i = typeof Set != "undefined", o = typeof WeakMap != "undefined", c = typeof WeakSet != "undefined", u = typeof DataView != "undefined", h = r && typeof Symbol.iterator != "undefined", p = r && 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()), l = v && Object.getPrototypeOf((/* @__PURE__ */ new Map()).entries()), y = h && typeof Array.prototype[Symbol.iterator] == "function", m = y && Object.getPrototypeOf([][Symbol.iterator]()), W = h && typeof String.prototype[Symbol.iterator] == "function", R = W && Object.getPrototypeOf(""[Symbol.iterator]()), V = 8, L = -1;
|
|
158
158
|
function q(j) {
|
|
159
159
|
var Z = typeof j;
|
|
160
160
|
if (Z !== "object")
|
|
@@ -188,8 +188,8 @@ function Va() {
|
|
|
188
188
|
var Se = p && j[Symbol.toStringTag];
|
|
189
189
|
if (typeof Se == "string")
|
|
190
190
|
return Se;
|
|
191
|
-
var
|
|
192
|
-
return
|
|
191
|
+
var $ = Object.getPrototypeOf(j);
|
|
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 && $ === l ? "Map Iterator" : i && $ === b ? "Set Iterator" : y && $ === m ? "Array Iterator" : W && $ === R ? "String Iterator" : $ === null ? "Object" : Object.prototype.toString.call(j).slice(V, L);
|
|
193
193
|
}
|
|
194
194
|
return q;
|
|
195
195
|
});
|
|
@@ -544,7 +544,7 @@ class nr extends Error {
|
|
|
544
544
|
}
|
|
545
545
|
}
|
|
546
546
|
}
|
|
547
|
-
class
|
|
547
|
+
class Et 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,7 +570,7 @@ function Xn() {
|
|
|
570
570
|
return Math.floor(Date.now() / 1e3).toString();
|
|
571
571
|
}
|
|
572
572
|
const bi = 5 * 60 * 1e3, wi = 1 * 1e3;
|
|
573
|
-
var Ge, ne, ge, Yn, Qn,
|
|
573
|
+
var Ge, ne, ge, Yn, Qn, xt;
|
|
574
574
|
class ki {
|
|
575
575
|
constructor({ fetch: e = globalThis.fetch.bind(globalThis), baseAddress: n }) {
|
|
576
576
|
de(this, ge), de(this, Ge), de(this, ne), this.baseAddress = n, J(this, Ge, e), J(this, ne, {}), this.plugins = [];
|
|
@@ -598,25 +598,25 @@ class ki {
|
|
|
598
598
|
post(e, n) {
|
|
599
599
|
return B(this, arguments, function* (s, r, a = {}) {
|
|
600
600
|
const i = kt(P(this, ne));
|
|
601
|
-
return J(this, ne, {}), _e(this, ge,
|
|
601
|
+
return J(this, ne, {}), _e(this, ge, xt).call(this, s, "POST", r, a, i);
|
|
602
602
|
});
|
|
603
603
|
}
|
|
604
604
|
put(e, n) {
|
|
605
605
|
return B(this, arguments, function* (s, r, a = {}) {
|
|
606
606
|
const i = kt(P(this, ne));
|
|
607
|
-
return J(this, ne, {}), _e(this, ge,
|
|
607
|
+
return J(this, ne, {}), _e(this, ge, xt).call(this, s, "PUT", r, a, i);
|
|
608
608
|
});
|
|
609
609
|
}
|
|
610
610
|
delete(e, n) {
|
|
611
611
|
return B(this, arguments, function* (s, r, a = {}) {
|
|
612
612
|
const i = kt(P(this, ne));
|
|
613
|
-
return J(this, ne, {}), _e(this, ge,
|
|
613
|
+
return J(this, ne, {}), _e(this, ge, xt).call(this, s, "DELETE", r, a, i);
|
|
614
614
|
});
|
|
615
615
|
}
|
|
616
616
|
patch(e, n) {
|
|
617
617
|
return B(this, arguments, function* (s, r, a = {}) {
|
|
618
618
|
const i = kt(P(this, ne));
|
|
619
|
-
return J(this, ne, {}), _e(this, ge,
|
|
619
|
+
return J(this, ne, {}), _e(this, ge, xt).call(this, s, "PATCH", r, a, i);
|
|
620
620
|
});
|
|
621
621
|
}
|
|
622
622
|
}
|
|
@@ -627,7 +627,7 @@ Ge = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /*
|
|
|
627
627
|
try {
|
|
628
628
|
return yield P(this, Ge).call(this, t, ae(ae({}, 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 Et({ canceled: (u = (c = e.abortSignal) == null ? void 0 : c.aborted) != null ? u : !1 }) : h;
|
|
631
631
|
}
|
|
632
632
|
}), { headers: r } = n != null ? n : {}, a = (c, u) => {
|
|
633
633
|
var h, p;
|
|
@@ -687,7 +687,7 @@ Ge = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /*
|
|
|
687
687
|
try {
|
|
688
688
|
p = yield P(this, Ge).call(this, u, ae(ae({}, 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 Et({ canceled: (s = i == null ? void 0 : i.aborted) != null ? s : !1 }) : b;
|
|
691
691
|
}
|
|
692
692
|
if (!p.ok) {
|
|
693
693
|
const b = yield p.text().catch();
|
|
@@ -709,9 +709,9 @@ Ge = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /*
|
|
|
709
709
|
}, c), m = (W = 0) => B(this, null, function* () {
|
|
710
710
|
if (i != null && i.aborted) {
|
|
711
711
|
clearTimeout(y), P(this, Ge).call(this, `${h}/${v}/cancel`, { method: "POST", headers: this.headers }).then(() => {
|
|
712
|
-
l(new
|
|
712
|
+
l(new Et({ canceled: !0 }));
|
|
713
713
|
}).catch((R) => {
|
|
714
|
-
l(new
|
|
714
|
+
l(new Et({ canceled: !1 }));
|
|
715
715
|
});
|
|
716
716
|
return;
|
|
717
717
|
}
|
|
@@ -735,7 +735,7 @@ Ge = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /*
|
|
|
735
735
|
m();
|
|
736
736
|
}));
|
|
737
737
|
});
|
|
738
|
-
},
|
|
738
|
+
}, xt = function(t, e, n, s, r) {
|
|
739
739
|
return B(this, null, function* () {
|
|
740
740
|
const { overrideBaseAddress: a, overrideDefaultHeaders: i } = s, o = a != null ? a : this.baseAddress;
|
|
741
741
|
let c = i != null ? i : this.headers;
|
|
@@ -748,7 +748,7 @@ Ge = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /*
|
|
|
748
748
|
}) : yield _e(this, ge, Yn).call(this, `${o}${t}`, r, { method: e, headers: c, body: u });
|
|
749
749
|
});
|
|
750
750
|
};
|
|
751
|
-
const sr = (t, e, n, s) => t instanceof
|
|
751
|
+
const sr = (t, e, n, s) => t instanceof Et ? t : new vi({ resource: e, api: String(n), args: s, cause: t }), In = (t, e) => new Proxy(e, {
|
|
752
752
|
get(n, s) {
|
|
753
753
|
return (...r) => {
|
|
754
754
|
var a;
|
|
@@ -770,7 +770,7 @@ const sr = (t, e, n, s) => t instanceof xt ? t : new vi({ resource: e, api: Stri
|
|
|
770
770
|
}
|
|
771
771
|
});
|
|
772
772
|
var St;
|
|
773
|
-
class
|
|
773
|
+
class Ei {
|
|
774
774
|
constructor(e) {
|
|
775
775
|
de(this, St), this.resourceName = "Files", J(this, St, e);
|
|
776
776
|
}
|
|
@@ -791,7 +791,7 @@ class xi {
|
|
|
791
791
|
}
|
|
792
792
|
}
|
|
793
793
|
St = /* @__PURE__ */ new WeakMap();
|
|
794
|
-
const
|
|
794
|
+
const xi = (t, e, n) => {
|
|
795
795
|
const s = e.sort();
|
|
796
796
|
return `${t}-${s.join("-")}-${n}`;
|
|
797
797
|
}, Si = (t) => t ? t.ts > Date.now() - 1e3 * 30 : !1;
|
|
@@ -806,7 +806,7 @@ class Oi {
|
|
|
806
806
|
*/
|
|
807
807
|
get(e) {
|
|
808
808
|
return B(this, arguments, function* ({ fileKey: n, nodeIds: s, format: r = "jpg", scale: a }) {
|
|
809
|
-
const i =
|
|
809
|
+
const i = xi(n, s, r), o = P(this, ve).cache.images.entries.get(i);
|
|
810
810
|
if (Si(o))
|
|
811
811
|
return o.result;
|
|
812
812
|
o && P(this, ve).cache.images.entries.delete(i);
|
|
@@ -862,7 +862,7 @@ class Ai extends ki {
|
|
|
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 Ei(this)), this.nodes = In(this, new Ti(this)), this.images = In(this, new Oi(this));
|
|
866
866
|
}
|
|
867
867
|
set token(e) {
|
|
868
868
|
if (!e.startsWith("figd_") && !e.startsWith("figu_"))
|
|
@@ -1120,11 +1120,11 @@ function ln() {
|
|
|
1120
1120
|
return Nr;
|
|
1121
1121
|
}
|
|
1122
1122
|
const fn = (t) => {
|
|
1123
|
-
const { data: e, path: n, errorMaps: s, issueData: r } = t, a = [...n, ...r.path || []], i =
|
|
1123
|
+
const { data: e, path: n, errorMaps: s, issueData: r } = t, a = [...n, ...r.path || []], i = x(d({}, r), {
|
|
1124
1124
|
path: a
|
|
1125
1125
|
});
|
|
1126
1126
|
if (r.message !== void 0)
|
|
1127
|
-
return
|
|
1127
|
+
return x(d({}, r), {
|
|
1128
1128
|
path: a,
|
|
1129
1129
|
message: r.message
|
|
1130
1130
|
});
|
|
@@ -1132,7 +1132,7 @@ const fn = (t) => {
|
|
|
1132
1132
|
const c = s.filter((u) => !!u).slice().reverse();
|
|
1133
1133
|
for (const u of c)
|
|
1134
1134
|
o = u(i, { data: e, defaultError: o }).message;
|
|
1135
|
-
return
|
|
1135
|
+
return x(d({}, r), {
|
|
1136
1136
|
path: a,
|
|
1137
1137
|
message: o
|
|
1138
1138
|
});
|
|
@@ -1214,7 +1214,7 @@ var w;
|
|
|
1214
1214
|
t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
1215
1215
|
})(w || (w = {}));
|
|
1216
1216
|
var Ot, Tt;
|
|
1217
|
-
class
|
|
1217
|
+
class Ee {
|
|
1218
1218
|
constructor(e, n, s, r) {
|
|
1219
1219
|
this._cachedPath = [], this.parent = e, this.data = n, this._path = s, this._key = r;
|
|
1220
1220
|
}
|
|
@@ -1384,7 +1384,7 @@ class T {
|
|
|
1384
1384
|
_refinement(e) {
|
|
1385
1385
|
return new ye({
|
|
1386
1386
|
schema: this,
|
|
1387
|
-
typeName:
|
|
1387
|
+
typeName: E.ZodEffects,
|
|
1388
1388
|
effect: { type: "refinement", refinement: e }
|
|
1389
1389
|
});
|
|
1390
1390
|
}
|
|
@@ -1420,37 +1420,37 @@ class T {
|
|
|
1420
1420
|
return Mt.create(this, e, this._def);
|
|
1421
1421
|
}
|
|
1422
1422
|
transform(e) {
|
|
1423
|
-
return new ye(
|
|
1423
|
+
return new ye(x(d({}, O(this._def)), {
|
|
1424
1424
|
schema: this,
|
|
1425
|
-
typeName:
|
|
1425
|
+
typeName: E.ZodEffects,
|
|
1426
1426
|
effect: { type: "transform", transform: e }
|
|
1427
1427
|
}));
|
|
1428
1428
|
}
|
|
1429
1429
|
default(e) {
|
|
1430
1430
|
const n = typeof e == "function" ? e : () => e;
|
|
1431
|
-
return new zt(
|
|
1431
|
+
return new zt(x(d({}, O(this._def)), {
|
|
1432
1432
|
innerType: this,
|
|
1433
1433
|
defaultValue: n,
|
|
1434
|
-
typeName:
|
|
1434
|
+
typeName: E.ZodDefault
|
|
1435
1435
|
}));
|
|
1436
1436
|
}
|
|
1437
1437
|
brand() {
|
|
1438
1438
|
return new Ns(d({
|
|
1439
|
-
typeName:
|
|
1439
|
+
typeName: E.ZodBranded,
|
|
1440
1440
|
type: this
|
|
1441
1441
|
}, O(this._def)));
|
|
1442
1442
|
}
|
|
1443
1443
|
catch(e) {
|
|
1444
1444
|
const n = typeof e == "function" ? e : () => e;
|
|
1445
|
-
return new Vt(
|
|
1445
|
+
return new Vt(x(d({}, O(this._def)), {
|
|
1446
1446
|
innerType: this,
|
|
1447
1447
|
catchValue: n,
|
|
1448
|
-
typeName:
|
|
1448
|
+
typeName: E.ZodCatch
|
|
1449
1449
|
}));
|
|
1450
1450
|
}
|
|
1451
1451
|
describe(e) {
|
|
1452
1452
|
const n = this.constructor;
|
|
1453
|
-
return new n(
|
|
1453
|
+
return new n(x(d({}, this._def), {
|
|
1454
1454
|
description: e
|
|
1455
1455
|
}));
|
|
1456
1456
|
}
|
|
@@ -1660,7 +1660,7 @@ class pe extends T {
|
|
|
1660
1660
|
}, w.errToObj(s)));
|
|
1661
1661
|
}
|
|
1662
1662
|
_addCheck(e) {
|
|
1663
|
-
return new pe(
|
|
1663
|
+
return new pe(x(d({}, this._def), {
|
|
1664
1664
|
checks: [...this._def.checks, e]
|
|
1665
1665
|
}));
|
|
1666
1666
|
}
|
|
@@ -1786,17 +1786,17 @@ class pe extends T {
|
|
|
1786
1786
|
return this.min(1, w.errToObj(e));
|
|
1787
1787
|
}
|
|
1788
1788
|
trim() {
|
|
1789
|
-
return new pe(
|
|
1789
|
+
return new pe(x(d({}, this._def), {
|
|
1790
1790
|
checks: [...this._def.checks, { kind: "trim" }]
|
|
1791
1791
|
}));
|
|
1792
1792
|
}
|
|
1793
1793
|
toLowerCase() {
|
|
1794
|
-
return new pe(
|
|
1794
|
+
return new pe(x(d({}, this._def), {
|
|
1795
1795
|
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
1796
1796
|
}));
|
|
1797
1797
|
}
|
|
1798
1798
|
toUpperCase() {
|
|
1799
|
-
return new pe(
|
|
1799
|
+
return new pe(x(d({}, this._def), {
|
|
1800
1800
|
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
1801
1801
|
}));
|
|
1802
1802
|
}
|
|
@@ -1865,7 +1865,7 @@ pe.create = (t) => {
|
|
|
1865
1865
|
var e;
|
|
1866
1866
|
return new pe(d({
|
|
1867
1867
|
checks: [],
|
|
1868
|
-
typeName:
|
|
1868
|
+
typeName: E.ZodString,
|
|
1869
1869
|
coerce: (e = t == null ? void 0 : t.coerce) !== null && e !== void 0 ? e : !1
|
|
1870
1870
|
}, O(t)));
|
|
1871
1871
|
};
|
|
@@ -1931,7 +1931,7 @@ class Le extends T {
|
|
|
1931
1931
|
return this.setLimit("max", e, !1, w.toString(n));
|
|
1932
1932
|
}
|
|
1933
1933
|
setLimit(e, n, s, r) {
|
|
1934
|
-
return new Le(
|
|
1934
|
+
return new Le(x(d({}, this._def), {
|
|
1935
1935
|
checks: [
|
|
1936
1936
|
...this._def.checks,
|
|
1937
1937
|
{
|
|
@@ -1944,7 +1944,7 @@ class Le extends T {
|
|
|
1944
1944
|
}));
|
|
1945
1945
|
}
|
|
1946
1946
|
_addCheck(e) {
|
|
1947
|
-
return new Le(
|
|
1947
|
+
return new Le(x(d({}, this._def), {
|
|
1948
1948
|
checks: [...this._def.checks, e]
|
|
1949
1949
|
}));
|
|
1950
1950
|
}
|
|
@@ -2039,7 +2039,7 @@ class Le extends T {
|
|
|
2039
2039
|
}
|
|
2040
2040
|
Le.create = (t) => new Le(d({
|
|
2041
2041
|
checks: [],
|
|
2042
|
-
typeName:
|
|
2042
|
+
typeName: E.ZodNumber,
|
|
2043
2043
|
coerce: (t == null ? void 0 : t.coerce) || !1
|
|
2044
2044
|
}, O(t)));
|
|
2045
2045
|
class $e extends T {
|
|
@@ -2098,7 +2098,7 @@ class $e extends T {
|
|
|
2098
2098
|
return this.setLimit("max", e, !1, w.toString(n));
|
|
2099
2099
|
}
|
|
2100
2100
|
setLimit(e, n, s, r) {
|
|
2101
|
-
return new $e(
|
|
2101
|
+
return new $e(x(d({}, this._def), {
|
|
2102
2102
|
checks: [
|
|
2103
2103
|
...this._def.checks,
|
|
2104
2104
|
{
|
|
@@ -2111,7 +2111,7 @@ class $e extends T {
|
|
|
2111
2111
|
}));
|
|
2112
2112
|
}
|
|
2113
2113
|
_addCheck(e) {
|
|
2114
|
-
return new $e(
|
|
2114
|
+
return new $e(x(d({}, this._def), {
|
|
2115
2115
|
checks: [...this._def.checks, e]
|
|
2116
2116
|
}));
|
|
2117
2117
|
}
|
|
@@ -2171,7 +2171,7 @@ $e.create = (t) => {
|
|
|
2171
2171
|
var e;
|
|
2172
2172
|
return new $e(d({
|
|
2173
2173
|
checks: [],
|
|
2174
|
-
typeName:
|
|
2174
|
+
typeName: E.ZodBigInt,
|
|
2175
2175
|
coerce: (e = t == null ? void 0 : t.coerce) !== null && e !== void 0 ? e : !1
|
|
2176
2176
|
}, O(t)));
|
|
2177
2177
|
};
|
|
@@ -2189,7 +2189,7 @@ class It extends T {
|
|
|
2189
2189
|
}
|
|
2190
2190
|
}
|
|
2191
2191
|
It.create = (t) => new It(d({
|
|
2192
|
-
typeName:
|
|
2192
|
+
typeName: E.ZodBoolean,
|
|
2193
2193
|
coerce: (t == null ? void 0 : t.coerce) || !1
|
|
2194
2194
|
}, O(t)));
|
|
2195
2195
|
class Qe extends T {
|
|
@@ -2232,7 +2232,7 @@ class Qe extends T {
|
|
|
2232
2232
|
};
|
|
2233
2233
|
}
|
|
2234
2234
|
_addCheck(e) {
|
|
2235
|
-
return new Qe(
|
|
2235
|
+
return new Qe(x(d({}, this._def), {
|
|
2236
2236
|
checks: [...this._def.checks, e]
|
|
2237
2237
|
}));
|
|
2238
2238
|
}
|
|
@@ -2266,7 +2266,7 @@ class Qe extends T {
|
|
|
2266
2266
|
Qe.create = (t) => new Qe(d({
|
|
2267
2267
|
checks: [],
|
|
2268
2268
|
coerce: (t == null ? void 0 : t.coerce) || !1,
|
|
2269
|
-
typeName:
|
|
2269
|
+
typeName: E.ZodDate
|
|
2270
2270
|
}, O(t)));
|
|
2271
2271
|
class mn extends T {
|
|
2272
2272
|
_parse(e) {
|
|
@@ -2282,7 +2282,7 @@ class mn extends T {
|
|
|
2282
2282
|
}
|
|
2283
2283
|
}
|
|
2284
2284
|
mn.create = (t) => new mn(d({
|
|
2285
|
-
typeName:
|
|
2285
|
+
typeName: E.ZodSymbol
|
|
2286
2286
|
}, O(t)));
|
|
2287
2287
|
class jt extends T {
|
|
2288
2288
|
_parse(e) {
|
|
@@ -2298,7 +2298,7 @@ class jt extends T {
|
|
|
2298
2298
|
}
|
|
2299
2299
|
}
|
|
2300
2300
|
jt.create = (t) => new jt(d({
|
|
2301
|
-
typeName:
|
|
2301
|
+
typeName: E.ZodUndefined
|
|
2302
2302
|
}, O(t)));
|
|
2303
2303
|
class Zt extends T {
|
|
2304
2304
|
_parse(e) {
|
|
@@ -2314,7 +2314,7 @@ class Zt extends T {
|
|
|
2314
2314
|
}
|
|
2315
2315
|
}
|
|
2316
2316
|
Zt.create = (t) => new Zt(d({
|
|
2317
|
-
typeName:
|
|
2317
|
+
typeName: E.ZodNull
|
|
2318
2318
|
}, O(t)));
|
|
2319
2319
|
class gt extends T {
|
|
2320
2320
|
constructor() {
|
|
@@ -2325,7 +2325,7 @@ class gt extends T {
|
|
|
2325
2325
|
}
|
|
2326
2326
|
}
|
|
2327
2327
|
gt.create = (t) => new gt(d({
|
|
2328
|
-
typeName:
|
|
2328
|
+
typeName: E.ZodAny
|
|
2329
2329
|
}, O(t)));
|
|
2330
2330
|
class Xe extends T {
|
|
2331
2331
|
constructor() {
|
|
@@ -2336,7 +2336,7 @@ class Xe extends T {
|
|
|
2336
2336
|
}
|
|
2337
2337
|
}
|
|
2338
2338
|
Xe.create = (t) => new Xe(d({
|
|
2339
|
-
typeName:
|
|
2339
|
+
typeName: E.ZodUnknown
|
|
2340
2340
|
}, O(t)));
|
|
2341
2341
|
class Pe extends T {
|
|
2342
2342
|
_parse(e) {
|
|
@@ -2349,7 +2349,7 @@ class Pe extends T {
|
|
|
2349
2349
|
}
|
|
2350
2350
|
}
|
|
2351
2351
|
Pe.create = (t) => new Pe(d({
|
|
2352
|
-
typeName:
|
|
2352
|
+
typeName: E.ZodNever
|
|
2353
2353
|
}, O(t)));
|
|
2354
2354
|
class yn extends T {
|
|
2355
2355
|
_parse(e) {
|
|
@@ -2365,7 +2365,7 @@ class yn extends T {
|
|
|
2365
2365
|
}
|
|
2366
2366
|
}
|
|
2367
2367
|
yn.create = (t) => new yn(d({
|
|
2368
|
-
typeName:
|
|
2368
|
+
typeName: E.ZodVoid
|
|
2369
2369
|
}, O(t)));
|
|
2370
2370
|
class me extends T {
|
|
2371
2371
|
_parse(e) {
|
|
@@ -2403,25 +2403,25 @@ class me extends T {
|
|
|
2403
2403
|
exact: !1,
|
|
2404
2404
|
message: r.maxLength.message
|
|
2405
2405
|
}), s.dirty()), n.common.async)
|
|
2406
|
-
return Promise.all([...n.data].map((i, o) => r.type._parseAsync(new
|
|
2407
|
-
const a = [...n.data].map((i, o) => r.type._parseSync(new
|
|
2406
|
+
return Promise.all([...n.data].map((i, o) => r.type._parseAsync(new Ee(n, i, n.path, o)))).then((i) => X.mergeArray(s, i));
|
|
2407
|
+
const a = [...n.data].map((i, o) => r.type._parseSync(new Ee(n, i, n.path, o)));
|
|
2408
2408
|
return X.mergeArray(s, a);
|
|
2409
2409
|
}
|
|
2410
2410
|
get element() {
|
|
2411
2411
|
return this._def.type;
|
|
2412
2412
|
}
|
|
2413
2413
|
min(e, n) {
|
|
2414
|
-
return new me(
|
|
2414
|
+
return new me(x(d({}, this._def), {
|
|
2415
2415
|
minLength: { value: e, message: w.toString(n) }
|
|
2416
2416
|
}));
|
|
2417
2417
|
}
|
|
2418
2418
|
max(e, n) {
|
|
2419
|
-
return new me(
|
|
2419
|
+
return new me(x(d({}, this._def), {
|
|
2420
2420
|
maxLength: { value: e, message: w.toString(n) }
|
|
2421
2421
|
}));
|
|
2422
2422
|
}
|
|
2423
2423
|
length(e, n) {
|
|
2424
|
-
return new me(
|
|
2424
|
+
return new me(x(d({}, this._def), {
|
|
2425
2425
|
exactLength: { value: e, message: w.toString(n) }
|
|
2426
2426
|
}));
|
|
2427
2427
|
}
|
|
@@ -2434,7 +2434,7 @@ me.create = (t, e) => new me(d({
|
|
|
2434
2434
|
minLength: null,
|
|
2435
2435
|
maxLength: null,
|
|
2436
2436
|
exactLength: null,
|
|
2437
|
-
typeName:
|
|
2437
|
+
typeName: E.ZodArray
|
|
2438
2438
|
}, O(e)));
|
|
2439
2439
|
function ct(t) {
|
|
2440
2440
|
if (t instanceof z) {
|
|
@@ -2443,12 +2443,12 @@ function ct(t) {
|
|
|
2443
2443
|
const s = t.shape[n];
|
|
2444
2444
|
e[n] = we.create(ct(s));
|
|
2445
2445
|
}
|
|
2446
|
-
return new z(
|
|
2446
|
+
return new z(x(d({}, t._def), {
|
|
2447
2447
|
shape: () => e
|
|
2448
2448
|
}));
|
|
2449
|
-
} else return t instanceof me ? new me(
|
|
2449
|
+
} else return t instanceof me ? new me(x(d({}, t._def), {
|
|
2450
2450
|
type: ct(t.element)
|
|
2451
|
-
})) : t instanceof we ? we.create(ct(t.unwrap())) : t instanceof We ? We.create(ct(t.unwrap())) : t instanceof
|
|
2451
|
+
})) : t instanceof we ? we.create(ct(t.unwrap())) : t instanceof We ? We.create(ct(t.unwrap())) : t instanceof xe ? xe.create(t.items.map((e) => ct(e))) : t;
|
|
2452
2452
|
}
|
|
2453
2453
|
class z extends T {
|
|
2454
2454
|
constructor() {
|
|
@@ -2478,7 +2478,7 @@ class z extends T {
|
|
|
2478
2478
|
const u = r[c], h = s.data[c];
|
|
2479
2479
|
o.push({
|
|
2480
2480
|
key: { status: "valid", value: c },
|
|
2481
|
-
value: u._parse(new
|
|
2481
|
+
value: u._parse(new Ee(s, h, s.path, c)),
|
|
2482
2482
|
alwaysSet: c in s.data
|
|
2483
2483
|
});
|
|
2484
2484
|
}
|
|
@@ -2503,7 +2503,7 @@ class z extends T {
|
|
|
2503
2503
|
o.push({
|
|
2504
2504
|
key: { status: "valid", value: u },
|
|
2505
2505
|
value: c._parse(
|
|
2506
|
-
new
|
|
2506
|
+
new Ee(s, h, s.path, u)
|
|
2507
2507
|
//, ctx.child(key), value, getParsedType(value)
|
|
2508
2508
|
),
|
|
2509
2509
|
alwaysSet: u in s.data
|
|
@@ -2527,7 +2527,7 @@ class z extends T {
|
|
|
2527
2527
|
return this._def.shape();
|
|
2528
2528
|
}
|
|
2529
2529
|
strict(e) {
|
|
2530
|
-
return w.errToObj, new z(d(
|
|
2530
|
+
return w.errToObj, new z(d(x(d({}, this._def), {
|
|
2531
2531
|
unknownKeys: "strict"
|
|
2532
2532
|
}), e !== void 0 ? {
|
|
2533
2533
|
errorMap: (n, s) => {
|
|
@@ -2542,12 +2542,12 @@ class z extends T {
|
|
|
2542
2542
|
} : {}));
|
|
2543
2543
|
}
|
|
2544
2544
|
strip() {
|
|
2545
|
-
return new z(
|
|
2545
|
+
return new z(x(d({}, this._def), {
|
|
2546
2546
|
unknownKeys: "strip"
|
|
2547
2547
|
}));
|
|
2548
2548
|
}
|
|
2549
2549
|
passthrough() {
|
|
2550
|
-
return new z(
|
|
2550
|
+
return new z(x(d({}, this._def), {
|
|
2551
2551
|
unknownKeys: "passthrough"
|
|
2552
2552
|
}));
|
|
2553
2553
|
}
|
|
@@ -2569,7 +2569,7 @@ class z extends T {
|
|
|
2569
2569
|
// }) as any;
|
|
2570
2570
|
// };
|
|
2571
2571
|
extend(e) {
|
|
2572
|
-
return new z(
|
|
2572
|
+
return new z(x(d({}, this._def), {
|
|
2573
2573
|
shape: () => d(d({}, this._def.shape()), e)
|
|
2574
2574
|
}));
|
|
2575
2575
|
}
|
|
@@ -2583,7 +2583,7 @@ class z extends T {
|
|
|
2583
2583
|
unknownKeys: e._def.unknownKeys,
|
|
2584
2584
|
catchall: e._def.catchall,
|
|
2585
2585
|
shape: () => d(d({}, this._def.shape()), e._def.shape()),
|
|
2586
|
-
typeName:
|
|
2586
|
+
typeName: E.ZodObject
|
|
2587
2587
|
});
|
|
2588
2588
|
}
|
|
2589
2589
|
// merge<
|
|
@@ -2646,7 +2646,7 @@ class z extends T {
|
|
|
2646
2646
|
// return merged;
|
|
2647
2647
|
// }
|
|
2648
2648
|
catchall(e) {
|
|
2649
|
-
return new z(
|
|
2649
|
+
return new z(x(d({}, this._def), {
|
|
2650
2650
|
catchall: e
|
|
2651
2651
|
}));
|
|
2652
2652
|
}
|
|
@@ -2654,7 +2654,7 @@ class z extends T {
|
|
|
2654
2654
|
const n = {};
|
|
2655
2655
|
return C.objectKeys(e).forEach((s) => {
|
|
2656
2656
|
e[s] && this.shape[s] && (n[s] = this.shape[s]);
|
|
2657
|
-
}), new z(
|
|
2657
|
+
}), new z(x(d({}, this._def), {
|
|
2658
2658
|
shape: () => n
|
|
2659
2659
|
}));
|
|
2660
2660
|
}
|
|
@@ -2662,7 +2662,7 @@ class z extends T {
|
|
|
2662
2662
|
const n = {};
|
|
2663
2663
|
return C.objectKeys(this.shape).forEach((s) => {
|
|
2664
2664
|
e[s] || (n[s] = this.shape[s]);
|
|
2665
|
-
}), new z(
|
|
2665
|
+
}), new z(x(d({}, this._def), {
|
|
2666
2666
|
shape: () => n
|
|
2667
2667
|
}));
|
|
2668
2668
|
}
|
|
@@ -2677,7 +2677,7 @@ class z extends T {
|
|
|
2677
2677
|
return C.objectKeys(this.shape).forEach((s) => {
|
|
2678
2678
|
const r = this.shape[s];
|
|
2679
2679
|
e && !e[s] ? n[s] = r : n[s] = r.optional();
|
|
2680
|
-
}), new z(
|
|
2680
|
+
}), new z(x(d({}, this._def), {
|
|
2681
2681
|
shape: () => n
|
|
2682
2682
|
}));
|
|
2683
2683
|
}
|
|
@@ -2692,7 +2692,7 @@ class z extends T {
|
|
|
2692
2692
|
r = r._def.innerType;
|
|
2693
2693
|
n[s] = r;
|
|
2694
2694
|
}
|
|
2695
|
-
}), new z(
|
|
2695
|
+
}), new z(x(d({}, this._def), {
|
|
2696
2696
|
shape: () => n
|
|
2697
2697
|
}));
|
|
2698
2698
|
}
|
|
@@ -2704,19 +2704,19 @@ z.create = (t, e) => new z(d({
|
|
|
2704
2704
|
shape: () => t,
|
|
2705
2705
|
unknownKeys: "strip",
|
|
2706
2706
|
catchall: Pe.create(),
|
|
2707
|
-
typeName:
|
|
2707
|
+
typeName: E.ZodObject
|
|
2708
2708
|
}, O(e)));
|
|
2709
2709
|
z.strictCreate = (t, e) => new z(d({
|
|
2710
2710
|
shape: () => t,
|
|
2711
2711
|
unknownKeys: "strict",
|
|
2712
2712
|
catchall: Pe.create(),
|
|
2713
|
-
typeName:
|
|
2713
|
+
typeName: E.ZodObject
|
|
2714
2714
|
}, O(e)));
|
|
2715
2715
|
z.lazycreate = (t, e) => new z(d({
|
|
2716
2716
|
shape: t,
|
|
2717
2717
|
unknownKeys: "strip",
|
|
2718
2718
|
catchall: Pe.create(),
|
|
2719
|
-
typeName:
|
|
2719
|
+
typeName: E.ZodObject
|
|
2720
2720
|
}, O(e)));
|
|
2721
2721
|
class Dt extends T {
|
|
2722
2722
|
_parse(e) {
|
|
@@ -2736,8 +2736,8 @@ class Dt extends T {
|
|
|
2736
2736
|
}
|
|
2737
2737
|
if (n.common.async)
|
|
2738
2738
|
return Promise.all(s.map((a) => ke(this, null, function* () {
|
|
2739
|
-
const i =
|
|
2740
|
-
common:
|
|
2739
|
+
const i = x(d({}, n), {
|
|
2740
|
+
common: x(d({}, n.common), {
|
|
2741
2741
|
issues: []
|
|
2742
2742
|
}),
|
|
2743
2743
|
parent: null
|
|
@@ -2755,8 +2755,8 @@ class Dt extends T {
|
|
|
2755
2755
|
let a;
|
|
2756
2756
|
const i = [];
|
|
2757
2757
|
for (const c of s) {
|
|
2758
|
-
const u =
|
|
2759
|
-
common:
|
|
2758
|
+
const u = x(d({}, n), {
|
|
2759
|
+
common: x(d({}, n.common), {
|
|
2760
2760
|
issues: []
|
|
2761
2761
|
}),
|
|
2762
2762
|
parent: null
|
|
@@ -2784,10 +2784,10 @@ class Dt extends T {
|
|
|
2784
2784
|
}
|
|
2785
2785
|
Dt.create = (t, e) => new Dt(d({
|
|
2786
2786
|
options: t,
|
|
2787
|
-
typeName:
|
|
2787
|
+
typeName: E.ZodUnion
|
|
2788
2788
|
}, O(e)));
|
|
2789
2789
|
const Ze = (t) => t instanceof $t ? Ze(t.schema) : t instanceof ye ? Ze(t.innerType()) : t instanceof Ft ? [t.value] : t instanceof Fe ? t.options : t instanceof Wt ? C.objectValues(t.enum) : t instanceof zt ? Ze(t._def.innerType) : t instanceof jt ? [void 0] : t instanceof Zt ? [null] : t instanceof we ? [void 0, ...Ze(t.unwrap())] : t instanceof We ? [null, ...Ze(t.unwrap())] : t instanceof Ns || t instanceof Ut ? Ze(t.unwrap()) : t instanceof Vt ? Ze(t._def.innerType) : [];
|
|
2790
|
-
class
|
|
2790
|
+
class En extends T {
|
|
2791
2791
|
_parse(e) {
|
|
2792
2792
|
const { ctx: n } = this._processInputParams(e);
|
|
2793
2793
|
if (n.parsedType !== _.object)
|
|
@@ -2840,8 +2840,8 @@ class xn extends T {
|
|
|
2840
2840
|
r.set(o, a);
|
|
2841
2841
|
}
|
|
2842
2842
|
}
|
|
2843
|
-
return new
|
|
2844
|
-
typeName:
|
|
2843
|
+
return new En(d({
|
|
2844
|
+
typeName: E.ZodDiscriminatedUnion,
|
|
2845
2845
|
discriminator: e,
|
|
2846
2846
|
options: n,
|
|
2847
2847
|
optionsMap: r
|
|
@@ -2909,9 +2909,9 @@ class Mt extends T {
|
|
|
2909
2909
|
Mt.create = (t, e, n) => new Mt(d({
|
|
2910
2910
|
left: t,
|
|
2911
2911
|
right: e,
|
|
2912
|
-
typeName:
|
|
2912
|
+
typeName: E.ZodIntersection
|
|
2913
2913
|
}, O(n)));
|
|
2914
|
-
class
|
|
2914
|
+
class xe extends T {
|
|
2915
2915
|
_parse(e) {
|
|
2916
2916
|
const { status: n, ctx: s } = this._processInputParams(e);
|
|
2917
2917
|
if (s.parsedType !== _.array)
|
|
@@ -2937,7 +2937,7 @@ class Ee extends T {
|
|
|
2937
2937
|
}), n.dirty());
|
|
2938
2938
|
const r = [...s.data].map((a, i) => {
|
|
2939
2939
|
const o = this._def.items[i] || this._def.rest;
|
|
2940
|
-
return o ? o._parse(new
|
|
2940
|
+
return o ? o._parse(new Ee(s, a, s.path, i)) : null;
|
|
2941
2941
|
}).filter((a) => !!a);
|
|
2942
2942
|
return s.common.async ? Promise.all(r).then((a) => X.mergeArray(n, a)) : X.mergeArray(n, r);
|
|
2943
2943
|
}
|
|
@@ -2945,17 +2945,17 @@ class Ee extends T {
|
|
|
2945
2945
|
return this._def.items;
|
|
2946
2946
|
}
|
|
2947
2947
|
rest(e) {
|
|
2948
|
-
return new
|
|
2948
|
+
return new xe(x(d({}, this._def), {
|
|
2949
2949
|
rest: e
|
|
2950
2950
|
}));
|
|
2951
2951
|
}
|
|
2952
2952
|
}
|
|
2953
|
-
|
|
2953
|
+
xe.create = (t, e) => {
|
|
2954
2954
|
if (!Array.isArray(t))
|
|
2955
2955
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2956
|
-
return new
|
|
2956
|
+
return new xe(d({
|
|
2957
2957
|
items: t,
|
|
2958
|
-
typeName:
|
|
2958
|
+
typeName: E.ZodTuple,
|
|
2959
2959
|
rest: null
|
|
2960
2960
|
}, O(e)));
|
|
2961
2961
|
};
|
|
@@ -2977,8 +2977,8 @@ class Lt extends T {
|
|
|
2977
2977
|
const r = [], a = this._def.keyType, i = this._def.valueType;
|
|
2978
2978
|
for (const o in s.data)
|
|
2979
2979
|
r.push({
|
|
2980
|
-
key: a._parse(new
|
|
2981
|
-
value: i._parse(new
|
|
2980
|
+
key: a._parse(new Ee(s, o, s.path, o)),
|
|
2981
|
+
value: i._parse(new Ee(s, s.data[o], s.path, o)),
|
|
2982
2982
|
alwaysSet: o in s.data
|
|
2983
2983
|
});
|
|
2984
2984
|
return s.common.async ? X.mergeObjectAsync(n, r) : X.mergeObjectSync(n, r);
|
|
@@ -2990,11 +2990,11 @@ class Lt extends T {
|
|
|
2990
2990
|
return n instanceof T ? new Lt(d({
|
|
2991
2991
|
keyType: e,
|
|
2992
2992
|
valueType: n,
|
|
2993
|
-
typeName:
|
|
2993
|
+
typeName: E.ZodRecord
|
|
2994
2994
|
}, O(s))) : new Lt(d({
|
|
2995
2995
|
keyType: pe.create(),
|
|
2996
2996
|
valueType: e,
|
|
2997
|
-
typeName:
|
|
2997
|
+
typeName: E.ZodRecord
|
|
2998
2998
|
}, O(n)));
|
|
2999
2999
|
}
|
|
3000
3000
|
}
|
|
@@ -3014,8 +3014,8 @@ class gn extends T {
|
|
|
3014
3014
|
received: s.parsedType
|
|
3015
3015
|
}), S;
|
|
3016
3016
|
const r = this._def.keyType, a = this._def.valueType, i = [...s.data.entries()].map(([o, c], u) => ({
|
|
3017
|
-
key: r._parse(new
|
|
3018
|
-
value: a._parse(new
|
|
3017
|
+
key: r._parse(new Ee(s, o, s.path, [u, "key"])),
|
|
3018
|
+
value: a._parse(new Ee(s, c, s.path, [u, "value"]))
|
|
3019
3019
|
}));
|
|
3020
3020
|
if (s.common.async) {
|
|
3021
3021
|
const o = /* @__PURE__ */ new Map();
|
|
@@ -3043,7 +3043,7 @@ class gn extends T {
|
|
|
3043
3043
|
gn.create = (t, e, n) => new gn(d({
|
|
3044
3044
|
valueType: e,
|
|
3045
3045
|
keyType: t,
|
|
3046
|
-
typeName:
|
|
3046
|
+
typeName: E.ZodMap
|
|
3047
3047
|
}, O(n)));
|
|
3048
3048
|
class et extends T {
|
|
3049
3049
|
_parse(e) {
|
|
@@ -3080,16 +3080,16 @@ class et extends T {
|
|
|
3080
3080
|
}
|
|
3081
3081
|
return { status: n.value, value: u };
|
|
3082
3082
|
}
|
|
3083
|
-
const o = [...s.data.values()].map((c, u) => a._parse(new
|
|
3083
|
+
const o = [...s.data.values()].map((c, u) => a._parse(new Ee(s, c, s.path, u)));
|
|
3084
3084
|
return s.common.async ? Promise.all(o).then((c) => i(c)) : i(o);
|
|
3085
3085
|
}
|
|
3086
3086
|
min(e, n) {
|
|
3087
|
-
return new et(
|
|
3087
|
+
return new et(x(d({}, this._def), {
|
|
3088
3088
|
minSize: { value: e, message: w.toString(n) }
|
|
3089
3089
|
}));
|
|
3090
3090
|
}
|
|
3091
3091
|
max(e, n) {
|
|
3092
|
-
return new et(
|
|
3092
|
+
return new et(x(d({}, this._def), {
|
|
3093
3093
|
maxSize: { value: e, message: w.toString(n) }
|
|
3094
3094
|
}));
|
|
3095
3095
|
}
|
|
@@ -3104,7 +3104,7 @@ et.create = (t, e) => new et(d({
|
|
|
3104
3104
|
valueType: t,
|
|
3105
3105
|
minSize: null,
|
|
3106
3106
|
maxSize: null,
|
|
3107
|
-
typeName:
|
|
3107
|
+
typeName: E.ZodSet
|
|
3108
3108
|
}, O(e)));
|
|
3109
3109
|
class ht extends T {
|
|
3110
3110
|
constructor() {
|
|
@@ -3183,12 +3183,12 @@ class ht extends T {
|
|
|
3183
3183
|
return this._def.returns;
|
|
3184
3184
|
}
|
|
3185
3185
|
args(...e) {
|
|
3186
|
-
return new ht(
|
|
3187
|
-
args:
|
|
3186
|
+
return new ht(x(d({}, this._def), {
|
|
3187
|
+
args: xe.create(e).rest(Xe.create())
|
|
3188
3188
|
}));
|
|
3189
3189
|
}
|
|
3190
3190
|
returns(e) {
|
|
3191
|
-
return new ht(
|
|
3191
|
+
return new ht(x(d({}, this._def), {
|
|
3192
3192
|
returns: e
|
|
3193
3193
|
}));
|
|
3194
3194
|
}
|
|
@@ -3200,9 +3200,9 @@ class ht extends T {
|
|
|
3200
3200
|
}
|
|
3201
3201
|
static create(e, n, s) {
|
|
3202
3202
|
return new ht(d({
|
|
3203
|
-
args: e ||
|
|
3203
|
+
args: e || xe.create([]).rest(Xe.create()),
|
|
3204
3204
|
returns: n || Xe.create(),
|
|
3205
|
-
typeName:
|
|
3205
|
+
typeName: E.ZodFunction
|
|
3206
3206
|
}, O(s)));
|
|
3207
3207
|
}
|
|
3208
3208
|
}
|
|
@@ -3217,7 +3217,7 @@ class $t extends T {
|
|
|
3217
3217
|
}
|
|
3218
3218
|
$t.create = (t, e) => new $t(d({
|
|
3219
3219
|
getter: t,
|
|
3220
|
-
typeName:
|
|
3220
|
+
typeName: E.ZodLazy
|
|
3221
3221
|
}, O(e)));
|
|
3222
3222
|
class Ft extends T {
|
|
3223
3223
|
_parse(e) {
|
|
@@ -3237,12 +3237,12 @@ class Ft extends T {
|
|
|
3237
3237
|
}
|
|
3238
3238
|
Ft.create = (t, e) => new Ft(d({
|
|
3239
3239
|
value: t,
|
|
3240
|
-
typeName:
|
|
3240
|
+
typeName: E.ZodLiteral
|
|
3241
3241
|
}, O(e)));
|
|
3242
3242
|
function Zr(t, e) {
|
|
3243
3243
|
return new Fe(d({
|
|
3244
3244
|
values: t,
|
|
3245
|
-
typeName:
|
|
3245
|
+
typeName: E.ZodEnum
|
|
3246
3246
|
}, O(e)));
|
|
3247
3247
|
}
|
|
3248
3248
|
class Fe extends T {
|
|
@@ -3329,7 +3329,7 @@ class Wt extends T {
|
|
|
3329
3329
|
Tt = /* @__PURE__ */ new WeakMap();
|
|
3330
3330
|
Wt.create = (t, e) => new Wt(d({
|
|
3331
3331
|
values: t,
|
|
3332
|
-
typeName:
|
|
3332
|
+
typeName: E.ZodNativeEnum
|
|
3333
3333
|
}, O(e)));
|
|
3334
3334
|
class vt extends T {
|
|
3335
3335
|
unwrap() {
|
|
@@ -3352,14 +3352,14 @@ class vt extends T {
|
|
|
3352
3352
|
}
|
|
3353
3353
|
vt.create = (t, e) => new vt(d({
|
|
3354
3354
|
type: t,
|
|
3355
|
-
typeName:
|
|
3355
|
+
typeName: E.ZodPromise
|
|
3356
3356
|
}, O(e)));
|
|
3357
3357
|
class ye extends T {
|
|
3358
3358
|
innerType() {
|
|
3359
3359
|
return this._def.schema;
|
|
3360
3360
|
}
|
|
3361
3361
|
sourceType() {
|
|
3362
|
-
return this._def.schema._def.typeName ===
|
|
3362
|
+
return this._def.schema._def.typeName === E.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
3363
3363
|
}
|
|
3364
3364
|
_parse(e) {
|
|
3365
3365
|
const { status: n, ctx: s } = this._processInputParams(e), r = this._def.effect || null, a = {
|
|
@@ -3433,13 +3433,13 @@ class ye extends T {
|
|
|
3433
3433
|
}
|
|
3434
3434
|
ye.create = (t, e, n) => new ye(d({
|
|
3435
3435
|
schema: t,
|
|
3436
|
-
typeName:
|
|
3436
|
+
typeName: E.ZodEffects,
|
|
3437
3437
|
effect: e
|
|
3438
3438
|
}, O(n)));
|
|
3439
3439
|
ye.createWithPreprocess = (t, e, n) => new ye(d({
|
|
3440
3440
|
schema: e,
|
|
3441
3441
|
effect: { type: "preprocess", transform: t },
|
|
3442
|
-
typeName:
|
|
3442
|
+
typeName: E.ZodEffects
|
|
3443
3443
|
}, O(n)));
|
|
3444
3444
|
class we extends T {
|
|
3445
3445
|
_parse(e) {
|
|
@@ -3451,7 +3451,7 @@ class we extends T {
|
|
|
3451
3451
|
}
|
|
3452
3452
|
we.create = (t, e) => new we(d({
|
|
3453
3453
|
innerType: t,
|
|
3454
|
-
typeName:
|
|
3454
|
+
typeName: E.ZodOptional
|
|
3455
3455
|
}, O(e)));
|
|
3456
3456
|
class We extends T {
|
|
3457
3457
|
_parse(e) {
|
|
@@ -3463,7 +3463,7 @@ class We extends T {
|
|
|
3463
3463
|
}
|
|
3464
3464
|
We.create = (t, e) => new We(d({
|
|
3465
3465
|
innerType: t,
|
|
3466
|
-
typeName:
|
|
3466
|
+
typeName: E.ZodNullable
|
|
3467
3467
|
}, O(e)));
|
|
3468
3468
|
class zt extends T {
|
|
3469
3469
|
_parse(e) {
|
|
@@ -3481,13 +3481,13 @@ class zt extends T {
|
|
|
3481
3481
|
}
|
|
3482
3482
|
zt.create = (t, e) => new zt(d({
|
|
3483
3483
|
innerType: t,
|
|
3484
|
-
typeName:
|
|
3484
|
+
typeName: E.ZodDefault,
|
|
3485
3485
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default
|
|
3486
3486
|
}, O(e)));
|
|
3487
3487
|
class Vt extends T {
|
|
3488
3488
|
_parse(e) {
|
|
3489
|
-
const { ctx: n } = this._processInputParams(e), s =
|
|
3490
|
-
common:
|
|
3489
|
+
const { ctx: n } = this._processInputParams(e), s = x(d({}, n), {
|
|
3490
|
+
common: x(d({}, n.common), {
|
|
3491
3491
|
issues: []
|
|
3492
3492
|
})
|
|
3493
3493
|
}), r = this._def.innerType._parse({
|
|
@@ -3519,7 +3519,7 @@ class Vt extends T {
|
|
|
3519
3519
|
}
|
|
3520
3520
|
Vt.create = (t, e) => new Vt(d({
|
|
3521
3521
|
innerType: t,
|
|
3522
|
-
typeName:
|
|
3522
|
+
typeName: E.ZodCatch,
|
|
3523
3523
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch
|
|
3524
3524
|
}, O(e)));
|
|
3525
3525
|
class vn extends T {
|
|
@@ -3536,7 +3536,7 @@ class vn extends T {
|
|
|
3536
3536
|
}
|
|
3537
3537
|
}
|
|
3538
3538
|
vn.create = (t) => new vn(d({
|
|
3539
|
-
typeName:
|
|
3539
|
+
typeName: E.ZodNaN
|
|
3540
3540
|
}, O(t)));
|
|
3541
3541
|
const eo = Symbol("zod_brand");
|
|
3542
3542
|
class Ns extends T {
|
|
@@ -3588,7 +3588,7 @@ class Jt extends T {
|
|
|
3588
3588
|
return new Jt({
|
|
3589
3589
|
in: e,
|
|
3590
3590
|
out: n,
|
|
3591
|
-
typeName:
|
|
3591
|
+
typeName: E.ZodPipeline
|
|
3592
3592
|
});
|
|
3593
3593
|
}
|
|
3594
3594
|
}
|
|
@@ -3603,7 +3603,7 @@ class Ut extends T {
|
|
|
3603
3603
|
}
|
|
3604
3604
|
Ut.create = (t, e) => new Ut(d({
|
|
3605
3605
|
innerType: t,
|
|
3606
|
-
typeName:
|
|
3606
|
+
typeName: E.ZodReadonly
|
|
3607
3607
|
}, O(e)));
|
|
3608
3608
|
function ar(t, e) {
|
|
3609
3609
|
const n = typeof t == "function" ? t(e) : typeof t == "string" ? { message: t } : t;
|
|
@@ -3618,34 +3618,34 @@ function Dr(t, e = {}, n) {
|
|
|
3618
3618
|
var u, h;
|
|
3619
3619
|
if (!c) {
|
|
3620
3620
|
const p = ar(e, s), k = (h = (u = p.fatal) !== null && u !== void 0 ? u : n) !== null && h !== void 0 ? h : !0;
|
|
3621
|
-
r.addIssue(
|
|
3621
|
+
r.addIssue(x(d({ code: "custom" }, p), { fatal: k }));
|
|
3622
3622
|
}
|
|
3623
3623
|
});
|
|
3624
3624
|
if (!o) {
|
|
3625
3625
|
const c = ar(e, s), u = (i = (a = c.fatal) !== null && a !== void 0 ? a : n) !== null && i !== void 0 ? i : !0;
|
|
3626
|
-
r.addIssue(
|
|
3626
|
+
r.addIssue(x(d({ code: "custom" }, c), { fatal: u }));
|
|
3627
3627
|
}
|
|
3628
3628
|
}) : gt.create();
|
|
3629
3629
|
}
|
|
3630
3630
|
const to = {
|
|
3631
3631
|
object: z.lazycreate
|
|
3632
3632
|
};
|
|
3633
|
-
var
|
|
3633
|
+
var E;
|
|
3634
3634
|
(function(t) {
|
|
3635
3635
|
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";
|
|
3636
|
-
})(
|
|
3636
|
+
})(E || (E = {}));
|
|
3637
3637
|
const no = (t, e = {
|
|
3638
3638
|
message: `Input not instance of ${t.name}`
|
|
3639
|
-
}) => Dr((n) => n instanceof t, e), Mr = pe.create, Lr = Le.create, so = vn.create, ro = $e.create, $r = It.create, ao = Qe.create, io = mn.create, oo = jt.create, co = Zt.create, uo = gt.create, lo = Xe.create, fo = Pe.create, ho = yn.create, po = me.create, mo = z.create, yo = z.strictCreate, go = Dt.create, vo =
|
|
3640
|
-
string: (t) => pe.create(
|
|
3641
|
-
number: (t) => Le.create(
|
|
3642
|
-
boolean: (t) => It.create(
|
|
3639
|
+
}) => Dr((n) => n instanceof t, e), Mr = pe.create, Lr = Le.create, so = vn.create, ro = $e.create, $r = It.create, ao = Qe.create, io = mn.create, oo = jt.create, co = Zt.create, uo = gt.create, lo = Xe.create, fo = Pe.create, ho = yn.create, po = me.create, mo = z.create, yo = z.strictCreate, go = Dt.create, vo = En.create, _o = Mt.create, bo = xe.create, wo = Lt.create, ko = gn.create, Eo = et.create, xo = ht.create, So = $t.create, Oo = Ft.create, To = Fe.create, Ao = Wt.create, Co = vt.create, ir = ye.create, No = we.create, Ro = We.create, Po = ye.createWithPreprocess, Io = Jt.create, jo = () => Mr().optional(), Zo = () => Lr().optional(), Do = () => $r().optional(), Mo = {
|
|
3640
|
+
string: (t) => pe.create(x(d({}, t), { coerce: !0 })),
|
|
3641
|
+
number: (t) => Le.create(x(d({}, t), { coerce: !0 })),
|
|
3642
|
+
boolean: (t) => It.create(x(d({}, t), {
|
|
3643
3643
|
coerce: !0
|
|
3644
3644
|
})),
|
|
3645
|
-
bigint: (t) => $e.create(
|
|
3646
|
-
date: (t) => Qe.create(
|
|
3645
|
+
bigint: (t) => $e.create(x(d({}, t), { coerce: !0 })),
|
|
3646
|
+
date: (t) => Qe.create(x(d({}, t), { coerce: !0 }))
|
|
3647
3647
|
}, Lo = S;
|
|
3648
|
-
var
|
|
3648
|
+
var M = /* @__PURE__ */ Object.freeze({
|
|
3649
3649
|
__proto__: null,
|
|
3650
3650
|
defaultErrorMap: yt,
|
|
3651
3651
|
setErrorMap: Ri,
|
|
@@ -3686,9 +3686,9 @@ var $ = /* @__PURE__ */ Object.freeze({
|
|
|
3686
3686
|
ZodArray: me,
|
|
3687
3687
|
ZodObject: z,
|
|
3688
3688
|
ZodUnion: Dt,
|
|
3689
|
-
ZodDiscriminatedUnion:
|
|
3689
|
+
ZodDiscriminatedUnion: En,
|
|
3690
3690
|
ZodIntersection: Mt,
|
|
3691
|
-
ZodTuple:
|
|
3691
|
+
ZodTuple: xe,
|
|
3692
3692
|
ZodRecord: Lt,
|
|
3693
3693
|
ZodMap: gn,
|
|
3694
3694
|
ZodSet: et,
|
|
@@ -3714,7 +3714,7 @@ var $ = /* @__PURE__ */ Object.freeze({
|
|
|
3714
3714
|
ZodSchema: T,
|
|
3715
3715
|
late: to,
|
|
3716
3716
|
get ZodFirstPartyTypeKind() {
|
|
3717
|
-
return
|
|
3717
|
+
return E;
|
|
3718
3718
|
},
|
|
3719
3719
|
coerce: Mo,
|
|
3720
3720
|
any: uo,
|
|
@@ -3725,7 +3725,7 @@ var $ = /* @__PURE__ */ Object.freeze({
|
|
|
3725
3725
|
discriminatedUnion: vo,
|
|
3726
3726
|
effect: ir,
|
|
3727
3727
|
enum: To,
|
|
3728
|
-
function:
|
|
3728
|
+
function: xo,
|
|
3729
3729
|
instanceof: no,
|
|
3730
3730
|
intersection: _o,
|
|
3731
3731
|
lazy: So,
|
|
@@ -3746,7 +3746,7 @@ var $ = /* @__PURE__ */ Object.freeze({
|
|
|
3746
3746
|
preprocess: Po,
|
|
3747
3747
|
promise: Co,
|
|
3748
3748
|
record: wo,
|
|
3749
|
-
set:
|
|
3749
|
+
set: Eo,
|
|
3750
3750
|
strictObject: yo,
|
|
3751
3751
|
string: Mr,
|
|
3752
3752
|
symbol: io,
|
|
@@ -3761,15 +3761,16 @@ var $ = /* @__PURE__ */ Object.freeze({
|
|
|
3761
3761
|
quotelessJson: Ni,
|
|
3762
3762
|
ZodError: ie
|
|
3763
3763
|
});
|
|
3764
|
-
|
|
3765
|
-
language:
|
|
3766
|
-
disableMarkedForExport:
|
|
3764
|
+
M.object({
|
|
3765
|
+
language: M.enum(["typescript", "javascript"]).optional(),
|
|
3766
|
+
disableMarkedForExport: M.boolean().optional(),
|
|
3767
|
+
allowAutoSelectFirstNode: M.boolean().optional().default(!0)
|
|
3767
3768
|
}).and(
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
framework:
|
|
3771
|
-
model:
|
|
3772
|
-
styling:
|
|
3769
|
+
M.union([
|
|
3770
|
+
M.object({
|
|
3771
|
+
framework: M.literal("react"),
|
|
3772
|
+
model: M.string().optional(),
|
|
3773
|
+
styling: M.enum([
|
|
3773
3774
|
"plain_css",
|
|
3774
3775
|
"css_modules",
|
|
3775
3776
|
"styled_components",
|
|
@@ -3778,24 +3779,24 @@ $.object({
|
|
|
3778
3779
|
"scss",
|
|
3779
3780
|
"inline_styles"
|
|
3780
3781
|
]),
|
|
3781
|
-
uiLibrary:
|
|
3782
|
-
responsivePages:
|
|
3783
|
-
|
|
3784
|
-
name:
|
|
3785
|
-
framesId:
|
|
3782
|
+
uiLibrary: M.enum(["mui", "antd", "radix", "shadcn"]).optional(),
|
|
3783
|
+
responsivePages: M.array(
|
|
3784
|
+
M.object({
|
|
3785
|
+
name: M.string(),
|
|
3786
|
+
framesId: M.array(M.string())
|
|
3786
3787
|
})
|
|
3787
3788
|
).optional(),
|
|
3788
|
-
enableUILibraryTheming:
|
|
3789
|
-
enableCompactStructure:
|
|
3790
|
-
enableDisplayScreenModelId:
|
|
3791
|
-
enableGeneratePackageLock:
|
|
3792
|
-
enableAutoSplit:
|
|
3793
|
-
autoSplitThreshold:
|
|
3789
|
+
enableUILibraryTheming: M.boolean().optional(),
|
|
3790
|
+
enableCompactStructure: M.boolean().optional(),
|
|
3791
|
+
enableDisplayScreenModelId: M.boolean().optional(),
|
|
3792
|
+
enableGeneratePackageLock: M.boolean().optional(),
|
|
3793
|
+
enableAutoSplit: M.boolean().optional(),
|
|
3794
|
+
autoSplitThreshold: M.number().optional()
|
|
3794
3795
|
}),
|
|
3795
|
-
|
|
3796
|
-
framework:
|
|
3797
|
-
styling:
|
|
3798
|
-
enableTranslation:
|
|
3796
|
+
M.object({
|
|
3797
|
+
framework: M.literal("html"),
|
|
3798
|
+
styling: M.enum(["plain_css", "inline_styles", "tailwind"]),
|
|
3799
|
+
enableTranslation: M.boolean().optional()
|
|
3799
3800
|
})
|
|
3800
3801
|
])
|
|
3801
3802
|
);
|
|
@@ -4226,19 +4227,19 @@ function zr(t) {
|
|
|
4226
4227
|
return n === Object ? !0 : typeof n == "function" && Function.toString.call(n) === Uo;
|
|
4227
4228
|
}
|
|
4228
4229
|
function bn(t, e) {
|
|
4229
|
-
|
|
4230
|
+
xn(t) === 0 ? Reflect.ownKeys(t).forEach((n) => {
|
|
4230
4231
|
e(n, t[n], t);
|
|
4231
4232
|
}) : t.forEach((n, s) => e(s, n, t));
|
|
4232
4233
|
}
|
|
4233
|
-
function
|
|
4234
|
+
function xn(t) {
|
|
4234
4235
|
const e = t[oe];
|
|
4235
4236
|
return e ? e.type_ : Array.isArray(t) ? 1 : Sn(t) ? 2 : On(t) ? 3 : 0;
|
|
4236
4237
|
}
|
|
4237
4238
|
function hs(t, e) {
|
|
4238
|
-
return
|
|
4239
|
+
return xn(t) === 2 ? t.has(e) : Object.prototype.hasOwnProperty.call(t, e);
|
|
4239
4240
|
}
|
|
4240
4241
|
function Vr(t, e, n) {
|
|
4241
|
-
const s =
|
|
4242
|
+
const s = xn(t);
|
|
4242
4243
|
s === 2 ? t.set(e, n) : s === 3 ? t.add(n) : t[e] = n;
|
|
4243
4244
|
}
|
|
4244
4245
|
function Bo(t, e) {
|
|
@@ -4285,7 +4286,7 @@ function ps(t, e) {
|
|
|
4285
4286
|
}
|
|
4286
4287
|
}
|
|
4287
4288
|
function Bt(t, e = !1) {
|
|
4288
|
-
return Tn(t) || bt(t) || !tt(t) || (
|
|
4289
|
+
return Tn(t) || bt(t) || !tt(t) || (xn(t) > 1 && (t.set = t.add = t.clear = t.delete = Ko), Object.freeze(t), e && Object.entries(t).forEach(([n, s]) => Bt(s, !0))), t;
|
|
4289
4290
|
}
|
|
4290
4291
|
function Ko() {
|
|
4291
4292
|
re(2);
|
|
@@ -4762,18 +4763,18 @@ const yr = {
|
|
|
4762
4763
|
const { filePath: y } = gr(
|
|
4763
4764
|
i.assetsStorage
|
|
4764
4765
|
), m = l.assets.map((R) => Ie(void 0, null, function* () {
|
|
4765
|
-
const
|
|
4766
|
+
const L = yield (yield fetch(R.url)).arrayBuffer();
|
|
4766
4767
|
return {
|
|
4767
4768
|
assetName: R.name,
|
|
4768
|
-
base64: ga(
|
|
4769
|
+
base64: ga(L)
|
|
4769
4770
|
};
|
|
4770
4771
|
})), W = yield Promise.allSettled(m);
|
|
4771
4772
|
for (const R of W) {
|
|
4772
4773
|
const V = {};
|
|
4773
4774
|
if (R.status === "fulfilled") {
|
|
4774
|
-
const { assetName:
|
|
4775
|
-
V[
|
|
4776
|
-
const j = y ? `${y}/${
|
|
4775
|
+
const { assetName: L, base64: q } = R.value;
|
|
4776
|
+
V[L] = q;
|
|
4777
|
+
const j = y ? `${y}/${L}` : L;
|
|
4777
4778
|
l.files[j] = {
|
|
4778
4779
|
content: q,
|
|
4779
4780
|
isBinary: !0
|
|
@@ -4956,7 +4957,7 @@ const Re = /* @__PURE__ */ new WeakMap(), Me = () => {
|
|
|
4956
4957
|
];
|
|
4957
4958
|
};
|
|
4958
4959
|
let ks = !0;
|
|
4959
|
-
const cc = () => ks, [
|
|
4960
|
+
const cc = () => ks, [Es, xs] = Xt && window.addEventListener ? [
|
|
4960
4961
|
window.addEventListener.bind(window),
|
|
4961
4962
|
window.removeEventListener.bind(window)
|
|
4962
4963
|
] : [
|
|
@@ -4965,16 +4966,16 @@ const cc = () => ks, [xs, Es] = Xt && window.addEventListener ? [
|
|
|
4965
4966
|
], uc = () => {
|
|
4966
4967
|
const t = ws && document.visibilityState;
|
|
4967
4968
|
return N(t) || t !== "hidden";
|
|
4968
|
-
}, dc = (t) => (ws && document.addEventListener("visibilitychange", t),
|
|
4969
|
-
ws && document.removeEventListener("visibilitychange", t),
|
|
4969
|
+
}, dc = (t) => (ws && document.addEventListener("visibilitychange", t), Es("focus", t), () => {
|
|
4970
|
+
ws && document.removeEventListener("visibilitychange", t), xs("focus", t);
|
|
4970
4971
|
}), lc = (t) => {
|
|
4971
4972
|
const e = () => {
|
|
4972
4973
|
ks = !0, t();
|
|
4973
4974
|
}, n = () => {
|
|
4974
4975
|
ks = !1;
|
|
4975
4976
|
};
|
|
4976
|
-
return
|
|
4977
|
-
|
|
4977
|
+
return Es("online", e), Es("offline", n), () => {
|
|
4978
|
+
xs("online", e), xs("offline", n);
|
|
4978
4979
|
};
|
|
4979
4980
|
}, fc = {
|
|
4980
4981
|
isOnline: cc,
|
|
@@ -4982,7 +4983,7 @@ const cc = () => ks, [xs, Es] = Xt && window.addEventListener ? [
|
|
|
4982
4983
|
}, hc = {
|
|
4983
4984
|
initFocus: dc,
|
|
4984
4985
|
initReconnect: lc
|
|
4985
|
-
},
|
|
4986
|
+
}, Er = !Gt.useId, Ht = !Xt || ic, pc = (t) => oc() ? window.requestAnimationFrame(t) : setTimeout(t, 1), Wn = Ht ? fa : ha, zn = typeof navigator != "undefined" && navigator.connection, xr = !Ht && zn && ([
|
|
4986
4987
|
"slow-2g",
|
|
4987
4988
|
"2g"
|
|
4988
4989
|
].includes(zn.effectiveType) || zn.saveData), sn = /* @__PURE__ */ new WeakMap(), Vn = (t, e) => bs.prototype.toString.call(t) === `[object ${e}]`;
|
|
@@ -5052,35 +5053,35 @@ function Yr(...t) {
|
|
|
5052
5053
|
};
|
|
5053
5054
|
if (t.length < 3)
|
|
5054
5055
|
return V();
|
|
5055
|
-
let
|
|
5056
|
+
let L = s, q;
|
|
5056
5057
|
const j = Os();
|
|
5057
5058
|
m[v] = [
|
|
5058
5059
|
j,
|
|
5059
5060
|
0
|
|
5060
5061
|
];
|
|
5061
|
-
const Z = !N(c), Se = b(),
|
|
5062
|
-
if (Z && (c = be(c) ? c(Ve,
|
|
5062
|
+
const Z = !N(c), Se = b(), $ = Se.data, st = Se._c, Ve = N(st) ? $ : st;
|
|
5063
|
+
if (Z && (c = be(c) ? c(Ve, $) : c, l({
|
|
5063
5064
|
data: c,
|
|
5064
5065
|
_c: Ve
|
|
5065
|
-
})), be(
|
|
5066
|
+
})), be(L))
|
|
5066
5067
|
try {
|
|
5067
|
-
|
|
5068
|
+
L = L(Ve);
|
|
5068
5069
|
} catch (le) {
|
|
5069
5070
|
q = le;
|
|
5070
5071
|
}
|
|
5071
|
-
if (
|
|
5072
|
-
if (
|
|
5072
|
+
if (L && Jr(L))
|
|
5073
|
+
if (L = yield L.catch((le) => {
|
|
5073
5074
|
q = le;
|
|
5074
5075
|
}), j !== m[v][0]) {
|
|
5075
5076
|
if (q) throw q;
|
|
5076
|
-
return
|
|
5077
|
+
return L;
|
|
5077
5078
|
} else q && Z && u(q) && (i = !0, l({
|
|
5078
5079
|
data: Ve,
|
|
5079
5080
|
_c: ee
|
|
5080
5081
|
}));
|
|
5081
5082
|
if (i && !q)
|
|
5082
5083
|
if (be(i)) {
|
|
5083
|
-
const le = i(
|
|
5084
|
+
const le = i(L, Ve);
|
|
5084
5085
|
l({
|
|
5085
5086
|
data: le,
|
|
5086
5087
|
error: ee,
|
|
@@ -5088,7 +5089,7 @@ function Yr(...t) {
|
|
|
5088
5089
|
});
|
|
5089
5090
|
} else
|
|
5090
5091
|
l({
|
|
5091
|
-
data:
|
|
5092
|
+
data: L,
|
|
5092
5093
|
error: ee,
|
|
5093
5094
|
_c: ee
|
|
5094
5095
|
});
|
|
@@ -5100,7 +5101,7 @@ function Yr(...t) {
|
|
|
5100
5101
|
if (h) throw q;
|
|
5101
5102
|
return;
|
|
5102
5103
|
}
|
|
5103
|
-
return
|
|
5104
|
+
return L;
|
|
5104
5105
|
});
|
|
5105
5106
|
}
|
|
5106
5107
|
});
|
|
@@ -5165,10 +5166,10 @@ const Sr = (t, e) => {
|
|
|
5165
5166
|
revalidateIfStale: !0,
|
|
5166
5167
|
shouldRetryOnError: !0,
|
|
5167
5168
|
// timeouts
|
|
5168
|
-
errorRetryInterval:
|
|
5169
|
+
errorRetryInterval: xr ? 1e4 : 5e3,
|
|
5169
5170
|
focusThrottleInterval: 5 * 1e3,
|
|
5170
5171
|
dedupingInterval: 2 * 1e3,
|
|
5171
|
-
loadingTimeout:
|
|
5172
|
+
loadingTimeout: xr ? 5e3 : 3e3,
|
|
5172
5173
|
// providers
|
|
5173
5174
|
compare: _c,
|
|
5174
5175
|
isPaused: () => !1,
|
|
@@ -5185,7 +5186,7 @@ const Sr = (t, e) => {
|
|
|
5185
5186
|
s && a && (n.use = s.concat(a)), r && i && (n.fallback = ze(r, i));
|
|
5186
5187
|
}
|
|
5187
5188
|
return n;
|
|
5188
|
-
},
|
|
5189
|
+
}, Ec = la({}), xc = "$inf$", ea = Xt && window.__SWR_DEVTOOLS_USE__, Sc = ea ? window.__SWR_DEVTOOLS_USE__ : [], Oc = () => {
|
|
5189
5190
|
ea && (window.__SWR_DEVTOOLS_REACT__ = Gt);
|
|
5190
5191
|
}, Tc = (t) => be(t[1]) ? [
|
|
5191
5192
|
t[0],
|
|
@@ -5195,9 +5196,9 @@ const Sr = (t, e) => {
|
|
|
5195
5196
|
t[0],
|
|
5196
5197
|
null,
|
|
5197
5198
|
(t[1] === null ? t[2] : t[1]) || {}
|
|
5198
|
-
], Ac = () => ze(wc, pa(
|
|
5199
|
+
], Ac = () => ze(wc, pa(Ec)), Cc = (t) => (e, n, s) => t(e, n && ((...a) => {
|
|
5199
5200
|
const [i] = js(e), [, , , o] = Re.get(Qr);
|
|
5200
|
-
if (i.startsWith(
|
|
5201
|
+
if (i.startsWith(xc))
|
|
5201
5202
|
return n(...a);
|
|
5202
5203
|
const c = o[i];
|
|
5203
5204
|
return N(c) ? n(...a) : (delete o[i], c);
|
|
@@ -5238,7 +5239,7 @@ const Un = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5238
5239
|
}), Bn = {
|
|
5239
5240
|
dedupe: !0
|
|
5240
5241
|
}, Ic = (t, e, n) => {
|
|
5241
|
-
const { cache: s, compare: r, suspense: a, fallbackData: i, revalidateOnMount: o, revalidateIfStale: c, refreshInterval: u, refreshWhenHidden: h, refreshWhenOffline: p, keepPreviousData: k } = n, [v, b, l, y] = Re.get(s), [m, W] = js(t), R = Ke(!1), V = Ke(!1),
|
|
5242
|
+
const { cache: s, compare: r, suspense: a, fallbackData: i, revalidateOnMount: o, revalidateIfStale: c, refreshInterval: u, refreshWhenHidden: h, refreshWhenOffline: p, keepPreviousData: k } = n, [v, b, l, y] = Re.get(s), [m, W] = js(t), R = Ke(!1), V = Ke(!1), L = Ke(m), q = Ke(e), j = Ke(n), Z = () => j.current, Se = () => Z().isVisible() && Z().isOnline(), [$, st, Ve, le] = Xr(s, m), rt = Ke({}).current, Yt = N(i) ? N(n.fallback) ? ee : n.fallback[m] : i, Zs = (D, I) => {
|
|
5242
5243
|
for (const G in rt) {
|
|
5243
5244
|
const U = G;
|
|
5244
5245
|
if (U === "data") {
|
|
@@ -5255,11 +5256,11 @@ const Un = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5255
5256
|
isValidating: !0,
|
|
5256
5257
|
isLoading: !0
|
|
5257
5258
|
}, Oe) : Oe;
|
|
5258
|
-
}, G =
|
|
5259
|
+
}, G = $(), U = le(), fe = I(G), ot = G === U ? fe : I(U);
|
|
5259
5260
|
let H = fe;
|
|
5260
5261
|
return [
|
|
5261
5262
|
() => {
|
|
5262
|
-
const Y = I(
|
|
5263
|
+
const Y = I($());
|
|
5263
5264
|
return Zs(Y, H) ? (H.data = Y.data, H.isLoading = Y.isLoading, H.isValidating = Y.isValidating, H.error = Y.error, H) : (H = Y, Y);
|
|
5264
5265
|
},
|
|
5265
5266
|
() => ot
|
|
@@ -5282,7 +5283,7 @@ const Un = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5282
5283
|
if (!m || !I || V.current || Z().isPaused())
|
|
5283
5284
|
return !1;
|
|
5284
5285
|
let G, U, fe = !0;
|
|
5285
|
-
const ot = D || {}, H = !l[m] || !ot.dedupe, Y = () =>
|
|
5286
|
+
const ot = D || {}, H = !l[m] || !ot.dedupe, Y = () => Er ? !V.current && m === L.current && R.current : m === L.current, Oe = {
|
|
5286
5287
|
isValidating: !1,
|
|
5287
5288
|
isLoading: !1
|
|
5288
5289
|
}, Ws = () => {
|
|
@@ -5293,9 +5294,9 @@ const Un = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5293
5294
|
}, Vs = {
|
|
5294
5295
|
isValidating: !0
|
|
5295
5296
|
};
|
|
5296
|
-
N(
|
|
5297
|
+
N($().data) && (Vs.isLoading = !0);
|
|
5297
5298
|
try {
|
|
5298
|
-
if (H && (st(Vs), n.loadingTimeout && N(
|
|
5299
|
+
if (H && (st(Vs), n.loadingTimeout && N($().data) && setTimeout(() => {
|
|
5299
5300
|
fe && Y() && Z().onLoadingSlow(m, n);
|
|
5300
5301
|
}, n.loadingTimeout), l[m] = [
|
|
5301
5302
|
I(W),
|
|
@@ -5309,7 +5310,7 @@ const Un = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5309
5310
|
U <= ue[1] || // case 3
|
|
5310
5311
|
ue[1] === 0))
|
|
5311
5312
|
return Ws(), H && Y() && Z().onDiscarded(m), !1;
|
|
5312
|
-
const Te =
|
|
5313
|
+
const Te = $().data;
|
|
5313
5314
|
Oe.data = r(Te, G) ? Te : G, H && Y() && Z().onSuccess(G, m, n);
|
|
5314
5315
|
} catch (ue) {
|
|
5315
5316
|
zs();
|
|
@@ -5341,7 +5342,7 @@ const Un = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5341
5342
|
]
|
|
5342
5343
|
), Fs = rn(
|
|
5343
5344
|
// Use callback to make sure `keyRef.current` returns latest result every time
|
|
5344
|
-
(...D) => Yr(s,
|
|
5345
|
+
(...D) => Yr(s, L.current, ...D),
|
|
5345
5346
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5346
5347
|
[]
|
|
5347
5348
|
);
|
|
@@ -5365,7 +5366,7 @@ const Un = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5365
5366
|
return wt(ot);
|
|
5366
5367
|
}
|
|
5367
5368
|
});
|
|
5368
|
-
return V.current = !1,
|
|
5369
|
+
return V.current = !1, L.current = m, R.current = !0, st({
|
|
5369
5370
|
_k: W
|
|
5370
5371
|
}), Ls && (N(Ue) || Ht ? D() : pc(D)), () => {
|
|
5371
5372
|
V.current = !0, U();
|
|
@@ -5375,11 +5376,11 @@ const Un = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5375
5376
|
]), Wn(() => {
|
|
5376
5377
|
let D;
|
|
5377
5378
|
function I() {
|
|
5378
|
-
const U = be(u) ? u(
|
|
5379
|
+
const U = be(u) ? u($().data) : u;
|
|
5379
5380
|
U && D !== -1 && (D = setTimeout(G, U));
|
|
5380
5381
|
}
|
|
5381
5382
|
function G() {
|
|
5382
|
-
|
|
5383
|
+
!$().error && (h || Z().isVisible()) && (p || Z().isOnline()) ? wt(Bn).then(I) : I();
|
|
5383
5384
|
}
|
|
5384
5385
|
return I(), () => {
|
|
5385
5386
|
D && (clearTimeout(D), D = -1);
|
|
@@ -5390,7 +5391,7 @@ const Un = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5390
5391
|
p,
|
|
5391
5392
|
m
|
|
5392
5393
|
]), ya(en), a && N(Ue) && m) {
|
|
5393
|
-
if (!
|
|
5394
|
+
if (!Er && Ht)
|
|
5394
5395
|
throw new Error("Fallback data is required when using Suspense in SSR.");
|
|
5395
5396
|
q.current = e, j.current = n, V.current = !1;
|
|
5396
5397
|
const D = y[m];
|