@yext/visual-editor 2.0.0-beta.7 → 2.0.0-beta.8
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/{SectionLibraryVisualEditorProvider-DKUR2CCF.js → SectionLibraryVisualEditorProvider-B4oMQHkI.js} +28492 -24776
- package/dist/cli/assets/directory-locator-source/sectionLibrarySupport.ts +4 -0
- package/dist/cli/yextve.js +1 -1
- package/dist/{locatorEntityTypes-CBKnACVV.d.ts → createYextFieldTransforms-CPEwasy9.d.ts} +239 -26
- package/dist/index.d.ts +26 -65
- package/dist/plugin/plugin.js +159 -146
- package/dist/section-library-support.js +107 -105
- package/dist/sectionLibrarySupport.d.ts +2 -2
- package/dist/visual-editor.css +1 -1
- package/dist/visual-editor.js +8959 -12366
- package/package.json +1 -1
package/dist/plugin/plugin.js
CHANGED
|
@@ -103,7 +103,7 @@ const Yn = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
|
|
|
103
103
|
function xe(e) {
|
|
104
104
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
105
105
|
}
|
|
106
|
-
const
|
|
106
|
+
const Eo = /* @__PURE__ */ It(() => {
|
|
107
107
|
if (F.jitless || typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
|
|
108
108
|
return !1;
|
|
109
109
|
try {
|
|
@@ -125,7 +125,7 @@ function ae(e) {
|
|
|
125
125
|
function Bn(e) {
|
|
126
126
|
return ae(e) ? { ...e } : Array.isArray(e) ? [...e] : e instanceof Map ? new Map(e) : e instanceof Set ? new Set(e) : e;
|
|
127
127
|
}
|
|
128
|
-
const
|
|
128
|
+
const So = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
|
|
129
129
|
function ce(e) {
|
|
130
130
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
131
131
|
}
|
|
@@ -133,7 +133,7 @@ function Q(e, t, n) {
|
|
|
133
133
|
const r = new e._zod.constr(t ?? e._zod.def);
|
|
134
134
|
return (!t || n?.parent) && (r._zod.parent = e), r;
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function E(e) {
|
|
137
137
|
const t = e;
|
|
138
138
|
if (!t)
|
|
139
139
|
return {};
|
|
@@ -305,7 +305,7 @@ function Po(e) {
|
|
|
305
305
|
}
|
|
306
306
|
return t;
|
|
307
307
|
}
|
|
308
|
-
function
|
|
308
|
+
function Se(...e) {
|
|
309
309
|
const [t, n, r] = e;
|
|
310
310
|
return typeof t == "string" ? {
|
|
311
311
|
message: t,
|
|
@@ -449,10 +449,10 @@ function h(e, t, n, r) {
|
|
|
449
449
|
}
|
|
450
450
|
if (m._zod.traits.add(e), t(m, p), a) {
|
|
451
451
|
const g = Object.getPrototypeOf(m), _ = m._zod.constr.prototype;
|
|
452
|
-
let
|
|
453
|
-
for (;
|
|
454
|
-
|
|
455
|
-
const z =
|
|
452
|
+
let S = g;
|
|
453
|
+
for (; S && S !== _; )
|
|
454
|
+
S = Object.getPrototypeOf(S);
|
|
455
|
+
const z = S ?? g;
|
|
456
456
|
a.has(z) || (a.add(z), No(z, s));
|
|
457
457
|
}
|
|
458
458
|
const f = d.prototype;
|
|
@@ -666,7 +666,7 @@ const hi = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d
|
|
|
666
666
|
function bi() {
|
|
667
667
|
return new RegExp(_i, "u");
|
|
668
668
|
}
|
|
669
|
-
const
|
|
669
|
+
const Ei = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Si = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/, vi = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/, Ti = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Ii = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, Oi = /^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/, wi = /^https?$/, Ri = /^\+[1-9]\d{6,14}$/, qn = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";
|
|
670
670
|
function $i(e) {
|
|
671
671
|
return new RegExp(`^${e}$`);
|
|
672
672
|
}
|
|
@@ -1206,13 +1206,13 @@ const is = /* @__PURE__ */ h("$ZodURL", (e, t) => {
|
|
|
1206
1206
|
}), ys = /* @__PURE__ */ h("$ZodISODuration", (e, t) => {
|
|
1207
1207
|
t.pattern ?? (t.pattern = hi), I.init(e, t);
|
|
1208
1208
|
}), gs = /* @__PURE__ */ h("$ZodIPv4", (e, t) => {
|
|
1209
|
-
t.pattern ?? (t.pattern =
|
|
1209
|
+
t.pattern ?? (t.pattern = Ei), I.init(e, t);
|
|
1210
1210
|
}), _s = /^[0-9a-fA-F:.]+$/;
|
|
1211
1211
|
function ir(e) {
|
|
1212
1212
|
return _s.test(e) ? or(`http://[${e}]`) : !1;
|
|
1213
1213
|
}
|
|
1214
1214
|
const bs = /* @__PURE__ */ h("$ZodIPv6", (e, t) => {
|
|
1215
|
-
t.pattern ?? (t.pattern =
|
|
1215
|
+
t.pattern ?? (t.pattern = Si), I.init(e, t), e._zod.check = (n) => {
|
|
1216
1216
|
ir(n.value) || n.issues.push({
|
|
1217
1217
|
code: "invalid_format",
|
|
1218
1218
|
format: "ipv6",
|
|
@@ -1221,10 +1221,10 @@ const bs = /* @__PURE__ */ h("$ZodIPv6", (e, t) => {
|
|
|
1221
1221
|
continue: !t.abort
|
|
1222
1222
|
});
|
|
1223
1223
|
};
|
|
1224
|
-
}),
|
|
1224
|
+
}), Es = /* @__PURE__ */ h("$ZodCIDRv4", (e, t) => {
|
|
1225
1225
|
t.pattern ?? (t.pattern = vi), I.init(e, t);
|
|
1226
1226
|
});
|
|
1227
|
-
function
|
|
1227
|
+
function Ss(e) {
|
|
1228
1228
|
const t = e.split("/");
|
|
1229
1229
|
if (t.length !== 2)
|
|
1230
1230
|
return !1;
|
|
@@ -1236,7 +1236,7 @@ function Es(e) {
|
|
|
1236
1236
|
}
|
|
1237
1237
|
const vs = /* @__PURE__ */ h("$ZodCIDRv6", (e, t) => {
|
|
1238
1238
|
t.pattern ?? (t.pattern = Ti), I.init(e, t), e._zod.check = (n) => {
|
|
1239
|
-
|
|
1239
|
+
Ss(n.value) || n.issues.push({
|
|
1240
1240
|
code: "invalid_format",
|
|
1241
1241
|
format: "cidrv6",
|
|
1242
1242
|
input: n.value,
|
|
@@ -1487,7 +1487,7 @@ const ks = /* @__PURE__ */ h("$ZodObject", (e, t) => {
|
|
|
1487
1487
|
}
|
|
1488
1488
|
if (_ === "__proto__")
|
|
1489
1489
|
continue;
|
|
1490
|
-
const
|
|
1490
|
+
const S = p[_], z = S._zod.optin, C = S._zod.optout, x = S._zod.run({ value: d[_], issues: [] }, u);
|
|
1491
1491
|
x instanceof Promise ? m.push(x.then((w) => Fe(w, l, _, d, z, C))) : Fe(x, l, _, d, z, C);
|
|
1492
1492
|
}
|
|
1493
1493
|
return s ? lr(m, d, l, u, o.value, e, f === !0) : m.length ? Promise.all(m).then(() => l) : l;
|
|
@@ -1495,7 +1495,7 @@ const ks = /* @__PURE__ */ h("$ZodObject", (e, t) => {
|
|
|
1495
1495
|
}), zs = /* @__PURE__ */ h("$ZodObjectJIT", (e, t) => {
|
|
1496
1496
|
ks.init(e, t);
|
|
1497
1497
|
const n = e._zod.parse, r = It(() => ur(t)), o = F.memoizer, i = (p) => {
|
|
1498
|
-
const f = r.value, g = f.symbolKeys, _ = new Ki(["payload", "ctx"], { shape: p, inst: e, memo: o, syms: g }),
|
|
1498
|
+
const f = r.value, g = f.symbolKeys, _ = new Ki(["payload", "ctx"], { shape: p, inst: e, memo: o, syms: g }), S = (w) => `shape[${w}]._zod.run({ value: input[${w}], issues: [] }, ctx)`, z = (w, T) => `
|
|
1499
1499
|
let ${w}_ab = false;
|
|
1500
1500
|
for (let i = 0; i < ${w}.issues.length; i++) {
|
|
1501
1501
|
const iss = ${w}.issues[i];
|
|
@@ -1517,7 +1517,7 @@ const ks = /* @__PURE__ */ h("$ZodObject", (e, t) => {
|
|
|
1517
1517
|
if (w === "__proto__")
|
|
1518
1518
|
continue;
|
|
1519
1519
|
const T = C[w], U = typeof w == "symbol" ? `syms[${g.indexOf(w)}]` : _o(w), tt = `${U} in input`, Zt = p[w], nt = Zt?._zod?.optin, Mt = nt !== void 0, oo = Zt?._zod?.optout === "optional";
|
|
1520
|
-
if (_.write(`const ${T} = ${
|
|
1520
|
+
if (_.write(`const ${T} = ${S(U)};`), Mt && oo) {
|
|
1521
1521
|
const io = nt === "optional" ? `${T}_present` : `${T}.value !== undefined || ${T}_present`;
|
|
1522
1522
|
_.write(`
|
|
1523
1523
|
const ${T}_present = ${tt};
|
|
@@ -1564,7 +1564,7 @@ const ks = /* @__PURE__ */ h("$ZodObject", (e, t) => {
|
|
|
1564
1564
|
return _.write("payload.value = newResult;"), _.write("return payload;"), _.compile();
|
|
1565
1565
|
};
|
|
1566
1566
|
let s;
|
|
1567
|
-
const a = xe, c = !F.jitless, u = c &&
|
|
1567
|
+
const a = xe, c = !F.jitless, u = c && Eo.value, d = t.catchall;
|
|
1568
1568
|
let m;
|
|
1569
1569
|
e._zod.parse = (p, f) => {
|
|
1570
1570
|
m ?? (m = r.value);
|
|
@@ -1805,7 +1805,7 @@ const xs = /* @__PURE__ */ h("$ZodRecord", (e, t) => {
|
|
|
1805
1805
|
R.init(e, t);
|
|
1806
1806
|
const n = ft(t.entries), r = new Set(n);
|
|
1807
1807
|
e._zod.values = r, v(e, "pattern", (o) => {
|
|
1808
|
-
const i = ft(o.def.entries).filter((s) =>
|
|
1808
|
+
const i = ft(o.def.entries).filter((s) => So.has(typeof s));
|
|
1809
1809
|
return new RegExp(i.length ? `^(${i.map((s) => ce(s.toString())).join("|")})$` : "^[^\\s\\S]$");
|
|
1810
1810
|
}), e._zod.parse = (o, i) => {
|
|
1811
1811
|
const s = o.value;
|
|
@@ -1962,7 +1962,7 @@ function rn(e, t, n, r) {
|
|
|
1962
1962
|
continue: !r._zod.def.abort
|
|
1963
1963
|
// params: inst._zod.def.params,
|
|
1964
1964
|
};
|
|
1965
|
-
r._zod.def.params && (o.params = r._zod.def.params), t.issues.push(
|
|
1965
|
+
r._zod.def.params && (o.params = r._zod.def.params), t.issues.push(Se(o));
|
|
1966
1966
|
}
|
|
1967
1967
|
}
|
|
1968
1968
|
class Ws extends Error {
|
|
@@ -2129,10 +2129,10 @@ const Re = [], ea = {
|
|
|
2129
2129
|
(t = e._zod).deferred ?? (t.deferred = []), e._zod.deferred.push(() => {
|
|
2130
2130
|
const s = e._zod.parse, a = (c, l) => {
|
|
2131
2131
|
if (n === void 0) {
|
|
2132
|
-
const
|
|
2133
|
-
if (
|
|
2132
|
+
const S = ze(e, /* @__PURE__ */ new Set());
|
|
2133
|
+
if (S === ye)
|
|
2134
2134
|
return e._zod.parse = s, e._zod.run === a && (e._zod.run = s), s(c, l);
|
|
2135
|
-
|
|
2135
|
+
S === _e || r ? n = !0 : r = !0;
|
|
2136
2136
|
}
|
|
2137
2137
|
const u = c.value;
|
|
2138
2138
|
if (!fr(u))
|
|
@@ -2148,7 +2148,7 @@ const Re = [], ea = {
|
|
|
2148
2148
|
const f = Re.length, g = s(c, l);
|
|
2149
2149
|
we = void 0;
|
|
2150
2150
|
const _ = Re.length > f ? Re.pop() : void 0;
|
|
2151
|
-
return g instanceof Promise ? g.then((
|
|
2151
|
+
return g instanceof Promise ? g.then((S) => (_ && (_.issues = S.issues.length ? st(S.issues) : on), S)) : (_ && (_.issues = g.issues.length ? st(g.issues) : on), g);
|
|
2152
2152
|
};
|
|
2153
2153
|
e._zod.parse = a, e._zod.run === s && (e._zod.run = a);
|
|
2154
2154
|
});
|
|
@@ -2293,7 +2293,7 @@ function mr(e) {
|
|
|
2293
2293
|
}
|
|
2294
2294
|
// @__NO_SIDE_EFFECTS__
|
|
2295
2295
|
function aa(e, t) {
|
|
2296
|
-
return new e(mr({ type: "string", ...
|
|
2296
|
+
return new e(mr({ type: "string", ...E(t) }));
|
|
2297
2297
|
}
|
|
2298
2298
|
// @__NO_SIDE_EFFECTS__
|
|
2299
2299
|
function ca(e, t) {
|
|
@@ -2302,7 +2302,7 @@ function ca(e, t) {
|
|
|
2302
2302
|
format: "email",
|
|
2303
2303
|
check: "string_format",
|
|
2304
2304
|
abort: !1,
|
|
2305
|
-
...
|
|
2305
|
+
...E(t)
|
|
2306
2306
|
});
|
|
2307
2307
|
}
|
|
2308
2308
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2312,7 +2312,7 @@ function ua(e, t) {
|
|
|
2312
2312
|
format: "guid",
|
|
2313
2313
|
check: "string_format",
|
|
2314
2314
|
abort: !1,
|
|
2315
|
-
...
|
|
2315
|
+
...E(t)
|
|
2316
2316
|
});
|
|
2317
2317
|
}
|
|
2318
2318
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2322,7 +2322,7 @@ function la(e, t) {
|
|
|
2322
2322
|
format: "uuid",
|
|
2323
2323
|
check: "string_format",
|
|
2324
2324
|
abort: !1,
|
|
2325
|
-
...
|
|
2325
|
+
...E(t)
|
|
2326
2326
|
});
|
|
2327
2327
|
}
|
|
2328
2328
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2333,7 +2333,7 @@ function da(e, t) {
|
|
|
2333
2333
|
check: "string_format",
|
|
2334
2334
|
abort: !1,
|
|
2335
2335
|
version: "v4",
|
|
2336
|
-
...
|
|
2336
|
+
...E(t)
|
|
2337
2337
|
});
|
|
2338
2338
|
}
|
|
2339
2339
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2344,7 +2344,7 @@ function fa(e, t) {
|
|
|
2344
2344
|
check: "string_format",
|
|
2345
2345
|
abort: !1,
|
|
2346
2346
|
version: "v6",
|
|
2347
|
-
...
|
|
2347
|
+
...E(t)
|
|
2348
2348
|
});
|
|
2349
2349
|
}
|
|
2350
2350
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2355,7 +2355,7 @@ function pa(e, t) {
|
|
|
2355
2355
|
check: "string_format",
|
|
2356
2356
|
abort: !1,
|
|
2357
2357
|
version: "v7",
|
|
2358
|
-
...
|
|
2358
|
+
...E(t)
|
|
2359
2359
|
});
|
|
2360
2360
|
}
|
|
2361
2361
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2365,7 +2365,7 @@ function ma(e, t) {
|
|
|
2365
2365
|
format: "url",
|
|
2366
2366
|
check: "string_format",
|
|
2367
2367
|
abort: !1,
|
|
2368
|
-
...
|
|
2368
|
+
...E(t)
|
|
2369
2369
|
});
|
|
2370
2370
|
}
|
|
2371
2371
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2375,7 +2375,7 @@ function ha(e, t) {
|
|
|
2375
2375
|
format: "emoji",
|
|
2376
2376
|
check: "string_format",
|
|
2377
2377
|
abort: !1,
|
|
2378
|
-
...
|
|
2378
|
+
...E(t)
|
|
2379
2379
|
});
|
|
2380
2380
|
}
|
|
2381
2381
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2385,7 +2385,7 @@ function ya(e, t) {
|
|
|
2385
2385
|
format: "nanoid",
|
|
2386
2386
|
check: "string_format",
|
|
2387
2387
|
abort: !1,
|
|
2388
|
-
...
|
|
2388
|
+
...E(t)
|
|
2389
2389
|
});
|
|
2390
2390
|
}
|
|
2391
2391
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2395,7 +2395,7 @@ function ga(e, t) {
|
|
|
2395
2395
|
format: "cuid",
|
|
2396
2396
|
check: "string_format",
|
|
2397
2397
|
abort: !1,
|
|
2398
|
-
...
|
|
2398
|
+
...E(t)
|
|
2399
2399
|
});
|
|
2400
2400
|
}
|
|
2401
2401
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2405,7 +2405,7 @@ function _a(e, t) {
|
|
|
2405
2405
|
format: "cuid2",
|
|
2406
2406
|
check: "string_format",
|
|
2407
2407
|
abort: !1,
|
|
2408
|
-
...
|
|
2408
|
+
...E(t)
|
|
2409
2409
|
});
|
|
2410
2410
|
}
|
|
2411
2411
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2415,27 +2415,27 @@ function ba(e, t) {
|
|
|
2415
2415
|
format: "ulid",
|
|
2416
2416
|
check: "string_format",
|
|
2417
2417
|
abort: !1,
|
|
2418
|
-
...
|
|
2418
|
+
...E(t)
|
|
2419
2419
|
});
|
|
2420
2420
|
}
|
|
2421
2421
|
// @__NO_SIDE_EFFECTS__
|
|
2422
|
-
function
|
|
2422
|
+
function Ea(e, t) {
|
|
2423
2423
|
return new e({
|
|
2424
2424
|
type: "string",
|
|
2425
2425
|
format: "xid",
|
|
2426
2426
|
check: "string_format",
|
|
2427
2427
|
abort: !1,
|
|
2428
|
-
...
|
|
2428
|
+
...E(t)
|
|
2429
2429
|
});
|
|
2430
2430
|
}
|
|
2431
2431
|
// @__NO_SIDE_EFFECTS__
|
|
2432
|
-
function
|
|
2432
|
+
function Sa(e, t) {
|
|
2433
2433
|
return new e({
|
|
2434
2434
|
type: "string",
|
|
2435
2435
|
format: "ksuid",
|
|
2436
2436
|
check: "string_format",
|
|
2437
2437
|
abort: !1,
|
|
2438
|
-
...
|
|
2438
|
+
...E(t)
|
|
2439
2439
|
});
|
|
2440
2440
|
}
|
|
2441
2441
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2445,7 +2445,7 @@ function va(e, t) {
|
|
|
2445
2445
|
format: "ipv4",
|
|
2446
2446
|
check: "string_format",
|
|
2447
2447
|
abort: !1,
|
|
2448
|
-
...
|
|
2448
|
+
...E(t)
|
|
2449
2449
|
});
|
|
2450
2450
|
}
|
|
2451
2451
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2455,7 +2455,7 @@ function Ta(e, t) {
|
|
|
2455
2455
|
format: "ipv6",
|
|
2456
2456
|
check: "string_format",
|
|
2457
2457
|
abort: !1,
|
|
2458
|
-
...
|
|
2458
|
+
...E(t)
|
|
2459
2459
|
});
|
|
2460
2460
|
}
|
|
2461
2461
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2465,7 +2465,7 @@ function Ia(e, t) {
|
|
|
2465
2465
|
format: "cidrv4",
|
|
2466
2466
|
check: "string_format",
|
|
2467
2467
|
abort: !1,
|
|
2468
|
-
...
|
|
2468
|
+
...E(t)
|
|
2469
2469
|
});
|
|
2470
2470
|
}
|
|
2471
2471
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2475,7 +2475,7 @@ function Oa(e, t) {
|
|
|
2475
2475
|
format: "cidrv6",
|
|
2476
2476
|
check: "string_format",
|
|
2477
2477
|
abort: !1,
|
|
2478
|
-
...
|
|
2478
|
+
...E(t)
|
|
2479
2479
|
});
|
|
2480
2480
|
}
|
|
2481
2481
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2485,7 +2485,7 @@ function wa(e, t) {
|
|
|
2485
2485
|
format: "base64",
|
|
2486
2486
|
check: "string_format",
|
|
2487
2487
|
abort: !1,
|
|
2488
|
-
...
|
|
2488
|
+
...E(t)
|
|
2489
2489
|
});
|
|
2490
2490
|
}
|
|
2491
2491
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2495,7 +2495,7 @@ function Ra(e, t) {
|
|
|
2495
2495
|
format: "base64url",
|
|
2496
2496
|
check: "string_format",
|
|
2497
2497
|
abort: !1,
|
|
2498
|
-
...
|
|
2498
|
+
...E(t)
|
|
2499
2499
|
});
|
|
2500
2500
|
}
|
|
2501
2501
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2505,7 +2505,7 @@ function $a(e, t) {
|
|
|
2505
2505
|
format: "e164",
|
|
2506
2506
|
check: "string_format",
|
|
2507
2507
|
abort: !1,
|
|
2508
|
-
...
|
|
2508
|
+
...E(t)
|
|
2509
2509
|
});
|
|
2510
2510
|
}
|
|
2511
2511
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2515,7 +2515,7 @@ function Ca(e, t) {
|
|
|
2515
2515
|
format: "jwt",
|
|
2516
2516
|
check: "string_format",
|
|
2517
2517
|
abort: !1,
|
|
2518
|
-
...
|
|
2518
|
+
...E(t)
|
|
2519
2519
|
});
|
|
2520
2520
|
}
|
|
2521
2521
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2527,7 +2527,7 @@ function Aa(e, t) {
|
|
|
2527
2527
|
offset: !1,
|
|
2528
2528
|
local: !1,
|
|
2529
2529
|
precision: null,
|
|
2530
|
-
...
|
|
2530
|
+
...E(t)
|
|
2531
2531
|
});
|
|
2532
2532
|
}
|
|
2533
2533
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2536,7 +2536,7 @@ function La(e, t) {
|
|
|
2536
2536
|
type: "string",
|
|
2537
2537
|
format: "date",
|
|
2538
2538
|
check: "string_format",
|
|
2539
|
-
...
|
|
2539
|
+
...E(t)
|
|
2540
2540
|
});
|
|
2541
2541
|
}
|
|
2542
2542
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2546,7 +2546,7 @@ function Pa(e, t) {
|
|
|
2546
2546
|
format: "time",
|
|
2547
2547
|
check: "string_format",
|
|
2548
2548
|
precision: null,
|
|
2549
|
-
...
|
|
2549
|
+
...E(t)
|
|
2550
2550
|
});
|
|
2551
2551
|
}
|
|
2552
2552
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2555,12 +2555,12 @@ function Na(e, t) {
|
|
|
2555
2555
|
type: "string",
|
|
2556
2556
|
format: "duration",
|
|
2557
2557
|
check: "string_format",
|
|
2558
|
-
...
|
|
2558
|
+
...E(t)
|
|
2559
2559
|
});
|
|
2560
2560
|
}
|
|
2561
2561
|
// @__NO_SIDE_EFFECTS__
|
|
2562
2562
|
function ka(e, t) {
|
|
2563
|
-
return new e(mr({ type: "number", checks: [], ...
|
|
2563
|
+
return new e(mr({ type: "number", checks: [], ...E(t) }));
|
|
2564
2564
|
}
|
|
2565
2565
|
// @__NO_SIDE_EFFECTS__
|
|
2566
2566
|
function za(e, t) {
|
|
@@ -2569,7 +2569,7 @@ function za(e, t) {
|
|
|
2569
2569
|
check: "number_format",
|
|
2570
2570
|
abort: !1,
|
|
2571
2571
|
format: "safeint",
|
|
2572
|
-
...
|
|
2572
|
+
...E(t)
|
|
2573
2573
|
});
|
|
2574
2574
|
}
|
|
2575
2575
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2582,14 +2582,14 @@ function Da(e) {
|
|
|
2582
2582
|
function ja(e, t) {
|
|
2583
2583
|
return new e({
|
|
2584
2584
|
type: "never",
|
|
2585
|
-
...
|
|
2585
|
+
...E(t)
|
|
2586
2586
|
});
|
|
2587
2587
|
}
|
|
2588
2588
|
// @__NO_SIDE_EFFECTS__
|
|
2589
2589
|
function an(e, t) {
|
|
2590
2590
|
return new Qn({
|
|
2591
2591
|
check: "less_than",
|
|
2592
|
-
...
|
|
2592
|
+
...E(t),
|
|
2593
2593
|
value: e,
|
|
2594
2594
|
inclusive: !1
|
|
2595
2595
|
});
|
|
@@ -2598,7 +2598,7 @@ function an(e, t) {
|
|
|
2598
2598
|
function at(e, t) {
|
|
2599
2599
|
return new Qn({
|
|
2600
2600
|
check: "less_than",
|
|
2601
|
-
...
|
|
2601
|
+
...E(t),
|
|
2602
2602
|
value: e,
|
|
2603
2603
|
inclusive: !0
|
|
2604
2604
|
});
|
|
@@ -2607,7 +2607,7 @@ function at(e, t) {
|
|
|
2607
2607
|
function cn(e, t) {
|
|
2608
2608
|
return new er({
|
|
2609
2609
|
check: "greater_than",
|
|
2610
|
-
...
|
|
2610
|
+
...E(t),
|
|
2611
2611
|
value: e,
|
|
2612
2612
|
inclusive: !1
|
|
2613
2613
|
});
|
|
@@ -2616,7 +2616,7 @@ function cn(e, t) {
|
|
|
2616
2616
|
function ct(e, t) {
|
|
2617
2617
|
return new er({
|
|
2618
2618
|
check: "greater_than",
|
|
2619
|
-
...
|
|
2619
|
+
...E(t),
|
|
2620
2620
|
value: e,
|
|
2621
2621
|
inclusive: !0
|
|
2622
2622
|
});
|
|
@@ -2625,7 +2625,7 @@ function ct(e, t) {
|
|
|
2625
2625
|
function un(e, t) {
|
|
2626
2626
|
return new Di({
|
|
2627
2627
|
check: "multiple_of",
|
|
2628
|
-
...
|
|
2628
|
+
...E(t),
|
|
2629
2629
|
value: e
|
|
2630
2630
|
});
|
|
2631
2631
|
}
|
|
@@ -2633,7 +2633,7 @@ function un(e, t) {
|
|
|
2633
2633
|
function hr(e, t) {
|
|
2634
2634
|
return new xi({
|
|
2635
2635
|
check: "max_length",
|
|
2636
|
-
...
|
|
2636
|
+
...E(t),
|
|
2637
2637
|
maximum: e
|
|
2638
2638
|
});
|
|
2639
2639
|
}
|
|
@@ -2641,7 +2641,7 @@ function hr(e, t) {
|
|
|
2641
2641
|
function Ue(e, t) {
|
|
2642
2642
|
return new Zi({
|
|
2643
2643
|
check: "min_length",
|
|
2644
|
-
...
|
|
2644
|
+
...E(t),
|
|
2645
2645
|
minimum: e
|
|
2646
2646
|
});
|
|
2647
2647
|
}
|
|
@@ -2649,7 +2649,7 @@ function Ue(e, t) {
|
|
|
2649
2649
|
function yr(e, t) {
|
|
2650
2650
|
return new Mi({
|
|
2651
2651
|
check: "length_equals",
|
|
2652
|
-
...
|
|
2652
|
+
...E(t),
|
|
2653
2653
|
length: e
|
|
2654
2654
|
});
|
|
2655
2655
|
}
|
|
@@ -2658,7 +2658,7 @@ function xa(e, t) {
|
|
|
2658
2658
|
return new Fi({
|
|
2659
2659
|
check: "string_format",
|
|
2660
2660
|
format: "regex",
|
|
2661
|
-
...
|
|
2661
|
+
...E(t),
|
|
2662
2662
|
pattern: e
|
|
2663
2663
|
});
|
|
2664
2664
|
}
|
|
@@ -2667,7 +2667,7 @@ function Za(e) {
|
|
|
2667
2667
|
return new Ui({
|
|
2668
2668
|
check: "string_format",
|
|
2669
2669
|
format: "lowercase",
|
|
2670
|
-
...
|
|
2670
|
+
...E(e)
|
|
2671
2671
|
});
|
|
2672
2672
|
}
|
|
2673
2673
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2675,7 +2675,7 @@ function Ma(e) {
|
|
|
2675
2675
|
return new Yi({
|
|
2676
2676
|
check: "string_format",
|
|
2677
2677
|
format: "uppercase",
|
|
2678
|
-
...
|
|
2678
|
+
...E(e)
|
|
2679
2679
|
});
|
|
2680
2680
|
}
|
|
2681
2681
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2683,7 +2683,7 @@ function Fa(e, t) {
|
|
|
2683
2683
|
return new Bi({
|
|
2684
2684
|
check: "string_format",
|
|
2685
2685
|
format: "includes",
|
|
2686
|
-
...
|
|
2686
|
+
...E(t),
|
|
2687
2687
|
includes: e
|
|
2688
2688
|
});
|
|
2689
2689
|
}
|
|
@@ -2692,7 +2692,7 @@ function Ua(e, t) {
|
|
|
2692
2692
|
return new Gi({
|
|
2693
2693
|
check: "string_format",
|
|
2694
2694
|
format: "starts_with",
|
|
2695
|
-
...
|
|
2695
|
+
...E(t),
|
|
2696
2696
|
prefix: e
|
|
2697
2697
|
});
|
|
2698
2698
|
}
|
|
@@ -2701,7 +2701,7 @@ function Ya(e, t) {
|
|
|
2701
2701
|
return new Ji({
|
|
2702
2702
|
check: "string_format",
|
|
2703
2703
|
format: "ends_with",
|
|
2704
|
-
...
|
|
2704
|
+
...E(t),
|
|
2705
2705
|
suffix: e
|
|
2706
2706
|
});
|
|
2707
2707
|
}
|
|
@@ -2740,7 +2740,7 @@ function Ha(e, t, n) {
|
|
|
2740
2740
|
// get element() {
|
|
2741
2741
|
// return element;
|
|
2742
2742
|
// },
|
|
2743
|
-
...
|
|
2743
|
+
...E(n)
|
|
2744
2744
|
});
|
|
2745
2745
|
}
|
|
2746
2746
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2749,17 +2749,17 @@ function Xa(e, t, n) {
|
|
|
2749
2749
|
type: "custom",
|
|
2750
2750
|
check: "custom",
|
|
2751
2751
|
fn: t,
|
|
2752
|
-
...
|
|
2752
|
+
...E(n)
|
|
2753
2753
|
});
|
|
2754
2754
|
}
|
|
2755
2755
|
// @__NO_SIDE_EFFECTS__
|
|
2756
2756
|
function Wa(e, t) {
|
|
2757
2757
|
const n = /* @__PURE__ */ qa((r) => (r.addIssue = (o) => {
|
|
2758
2758
|
if (typeof o == "string")
|
|
2759
|
-
r.issues.push(
|
|
2759
|
+
r.issues.push(Se(o, r.value, n._zod.def));
|
|
2760
2760
|
else {
|
|
2761
2761
|
const i = o;
|
|
2762
|
-
i.fatal && (i.continue = !1), i.code ?? (i.code = "custom"), "input" in i || (i.input = r.value), i.inst ?? (i.inst = n), i.continue ?? (i.continue = !n._zod.def.abort), r.issues.push(
|
|
2762
|
+
i.fatal && (i.continue = !1), i.code ?? (i.code = "custom"), "input" in i || (i.input = r.value), i.inst ?? (i.inst = n), i.continue ?? (i.continue = !n._zod.def.abort), r.issues.push(Se(i));
|
|
2763
2763
|
}
|
|
2764
2764
|
}, e(r.value, r)), t);
|
|
2765
2765
|
return n;
|
|
@@ -2768,7 +2768,7 @@ function Wa(e, t) {
|
|
|
2768
2768
|
function qa(e, t) {
|
|
2769
2769
|
const n = new D({
|
|
2770
2770
|
check: "custom",
|
|
2771
|
-
...
|
|
2771
|
+
...E(t)
|
|
2772
2772
|
});
|
|
2773
2773
|
return n._zod.check = e, n;
|
|
2774
2774
|
}
|
|
@@ -2934,7 +2934,7 @@ function br(e) {
|
|
|
2934
2934
|
}
|
|
2935
2935
|
delete e.anyOf, e.type = n.length === 1 ? n[0] : n;
|
|
2936
2936
|
}
|
|
2937
|
-
const
|
|
2937
|
+
const Er = /* @__PURE__ */ new Set(["type", "properties", "required", "additionalProperties"]), dn = ["oneOf", "anyOf"];
|
|
2938
2938
|
function fn(e) {
|
|
2939
2939
|
const t = e.additionalProperties;
|
|
2940
2940
|
return t === void 0 || t === !1 || typeof t != "object" || t === null ? null : Object.keys(t).length ? t : null;
|
|
@@ -2945,7 +2945,7 @@ function gt(e) {
|
|
|
2945
2945
|
if (typeof i != "object" || i.type !== "object")
|
|
2946
2946
|
return null;
|
|
2947
2947
|
for (const s in i)
|
|
2948
|
-
if (!
|
|
2948
|
+
if (!Er.has(s))
|
|
2949
2949
|
return null;
|
|
2950
2950
|
t.push(i);
|
|
2951
2951
|
}
|
|
@@ -2982,7 +2982,7 @@ function Qa(e) {
|
|
|
2982
2982
|
const t = e.allOf;
|
|
2983
2983
|
if (!Array.isArray(t) || t.length < 2)
|
|
2984
2984
|
return;
|
|
2985
|
-
for (const o of
|
|
2985
|
+
for (const o of Er)
|
|
2986
2986
|
if (o in e)
|
|
2987
2987
|
return;
|
|
2988
2988
|
const n = t.filter((o) => dn.some((i) => Array.isArray(o[i])));
|
|
@@ -3000,7 +3000,7 @@ function Qa(e) {
|
|
|
3000
3000
|
}
|
|
3001
3001
|
r && (delete e.allOf, be(e, r));
|
|
3002
3002
|
}
|
|
3003
|
-
function
|
|
3003
|
+
function Sr(e, t) {
|
|
3004
3004
|
const n = e.seen.get(t);
|
|
3005
3005
|
if (!n)
|
|
3006
3006
|
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
@@ -3134,10 +3134,10 @@ function k(e, t) {
|
|
|
3134
3134
|
}
|
|
3135
3135
|
const ec = (e, t = {}) => (n) => {
|
|
3136
3136
|
const r = gr({ ...n, processors: t });
|
|
3137
|
-
return A(e, r), _r(r, e),
|
|
3137
|
+
return A(e, r), _r(r, e), Sr(r, e);
|
|
3138
3138
|
}, Ye = (e, t, n = {}) => (r) => {
|
|
3139
3139
|
const { libraryOptions: o, target: i } = r ?? {}, s = gr({ ...o ?? {}, target: i, io: t, processors: n });
|
|
3140
|
-
return A(e, s), _r(s, e),
|
|
3140
|
+
return A(e, s), _r(s, e), Sr(s, e);
|
|
3141
3141
|
}, ue = (e, t, n) => {
|
|
3142
3142
|
(e[t] === void 0 || n > e[t]) && (e[t] = n);
|
|
3143
3143
|
}, le = (e, t, n) => {
|
|
@@ -3212,10 +3212,10 @@ const nc = {
|
|
|
3212
3212
|
const d = typeof l == "number" && l >= (i ?? Number.NEGATIVE_INFINITY), m = typeof c == "number" && c <= (s ?? Number.POSITIVE_INFINITY), p = t.target === "draft-04" || t.target === "openapi-3.0";
|
|
3213
3213
|
if (d ? p ? (o.minimum = l, o.exclusiveMinimum = !0) : o.exclusiveMinimum = l : typeof i == "number" && (o.minimum = i), m ? p ? (o.maximum = c, o.exclusiveMaximum = !0) : o.exclusiveMaximum = c : typeof s == "number" && (o.maximum = s), a) {
|
|
3214
3214
|
const f = /* @__PURE__ */ new Set();
|
|
3215
|
-
for (const
|
|
3216
|
-
Number.isFinite(
|
|
3215
|
+
for (const S of a)
|
|
3216
|
+
Number.isFinite(S) && S !== 0 ? f.add(Math.abs(S)) : W(e, t, o, r, `A multipleOf divisor of ${S} cannot be represented in JSON Schema`);
|
|
3217
3217
|
const [g, ..._] = f;
|
|
3218
|
-
g !== void 0 && (o.multipleOf = g), _.length && (o.allOf = [...o.allOf ?? [], ..._.map((
|
|
3218
|
+
g !== void 0 && (o.multipleOf = g), _.length && (o.allOf = [...o.allOf ?? [], ..._.map((S) => ({ multipleOf: S }))]);
|
|
3219
3219
|
}
|
|
3220
3220
|
}, sc = (e, t, n, r) => {
|
|
3221
3221
|
n.not = {};
|
|
@@ -3317,8 +3317,8 @@ function _t(e, t, n) {
|
|
|
3317
3317
|
const g = t[f];
|
|
3318
3318
|
if (!Array.isArray(g))
|
|
3319
3319
|
continue;
|
|
3320
|
-
const _ = g.map((
|
|
3321
|
-
_.some((
|
|
3320
|
+
const _ = g.map((S) => _t(e, S, n));
|
|
3321
|
+
_.some((S, z) => S !== g[z]) && (t = { ...t, [f]: _ });
|
|
3322
3322
|
}
|
|
3323
3323
|
const r = Array.isArray(t.type) ? t.type : [t.type], o = !r.includes("string") && r.some((f) => f === "number" || f === "integer"), i = t.enum ?? (t.const !== void 0 ? [t.const] : void 0);
|
|
3324
3324
|
if (!o && !i?.some((f) => typeof f == "number"))
|
|
@@ -3391,14 +3391,14 @@ function Rr(e, t, n, r, o) {
|
|
|
3391
3391
|
const s = JSON.stringify(e, (a, c) => typeof c != "bigint" ? c : (i = !0, null));
|
|
3392
3392
|
return i ? (W(t, n, r, o, "BigInt defaults cannot be represented in JSON Schema"), Dt) : JSON.parse(s);
|
|
3393
3393
|
}
|
|
3394
|
-
const
|
|
3394
|
+
const Ec = (e, t, n, r) => {
|
|
3395
3395
|
const o = e._zod.def;
|
|
3396
3396
|
A(o.innerType, t, r);
|
|
3397
3397
|
const i = t.seen.get(e);
|
|
3398
3398
|
i.ref = o.innerType;
|
|
3399
3399
|
const s = Rr(o.defaultValue, e, t, n, r);
|
|
3400
3400
|
s !== Dt && (n.default = s);
|
|
3401
|
-
},
|
|
3401
|
+
}, Sc = (e, t, n, r) => {
|
|
3402
3402
|
const o = e._zod.def;
|
|
3403
3403
|
A(o.innerType, t, r);
|
|
3404
3404
|
const i = t.seen.get(e);
|
|
@@ -3503,16 +3503,16 @@ const $ = /* @__PURE__ */ h("ZodType", (e, t) => (xc(), R.init(e, t), e.def = t,
|
|
|
3503
3503
|
return this.check(/* @__PURE__ */ pe(e));
|
|
3504
3504
|
},
|
|
3505
3505
|
optional() {
|
|
3506
|
-
return
|
|
3506
|
+
return En(this);
|
|
3507
3507
|
},
|
|
3508
3508
|
exactOptional() {
|
|
3509
3509
|
return bu(this);
|
|
3510
3510
|
},
|
|
3511
3511
|
nullable() {
|
|
3512
|
-
return
|
|
3512
|
+
return Sn(this);
|
|
3513
3513
|
},
|
|
3514
3514
|
nullish() {
|
|
3515
|
-
return Sn(
|
|
3515
|
+
return En(Sn(this));
|
|
3516
3516
|
},
|
|
3517
3517
|
nonoptional(e) {
|
|
3518
3518
|
return Ou(this, e);
|
|
@@ -3741,10 +3741,10 @@ const $ = /* @__PURE__ */ h("ZodType", (e, t) => (xc(), R.init(e, t), e.def = t,
|
|
|
3741
3741
|
return this.check(/* @__PURE__ */ Ra(iu, e));
|
|
3742
3742
|
},
|
|
3743
3743
|
xid(e) {
|
|
3744
|
-
return this.check(/* @__PURE__ */
|
|
3744
|
+
return this.check(/* @__PURE__ */ Ea(qc, e));
|
|
3745
3745
|
},
|
|
3746
3746
|
ksuid(e) {
|
|
3747
|
-
return this.check(/* @__PURE__ */
|
|
3747
|
+
return this.check(/* @__PURE__ */ Sa(Qc, e));
|
|
3748
3748
|
},
|
|
3749
3749
|
ipv4(e) {
|
|
3750
3750
|
return this.check(/* @__PURE__ */ va(eu, e));
|
|
@@ -3814,7 +3814,7 @@ const O = /* @__PURE__ */ h("ZodStringFormat", (e, t) => {
|
|
|
3814
3814
|
}), tu = /* @__PURE__ */ h("ZodIPv6", (e, t) => {
|
|
3815
3815
|
bs.init(e, t), O.init(e, t);
|
|
3816
3816
|
}), nu = /* @__PURE__ */ h("ZodCIDRv4", (e, t) => {
|
|
3817
|
-
|
|
3817
|
+
Es.init(e, t), O.init(e, t);
|
|
3818
3818
|
}), ru = /* @__PURE__ */ h("ZodCIDRv6", (e, t) => {
|
|
3819
3819
|
vs.init(e, t), O.init(e, t);
|
|
3820
3820
|
}), ou = /* @__PURE__ */ h("ZodBase64", (e, t) => {
|
|
@@ -3985,16 +3985,16 @@ function se(e, t) {
|
|
|
3985
3985
|
const n = {
|
|
3986
3986
|
type: "object",
|
|
3987
3987
|
shape: e ?? {},
|
|
3988
|
-
...
|
|
3988
|
+
...E(t)
|
|
3989
3989
|
};
|
|
3990
3990
|
return new Nr(n);
|
|
3991
3991
|
}
|
|
3992
|
-
function
|
|
3992
|
+
function Ee(e, t) {
|
|
3993
3993
|
return new Nr({
|
|
3994
3994
|
type: "object",
|
|
3995
3995
|
shape: e,
|
|
3996
3996
|
catchall: Lr(),
|
|
3997
|
-
...
|
|
3997
|
+
...E(t)
|
|
3998
3998
|
});
|
|
3999
3999
|
}
|
|
4000
4000
|
const fu = /* @__PURE__ */ h("ZodUnion", (e, t) => {
|
|
@@ -4004,7 +4004,7 @@ function pu(e, t) {
|
|
|
4004
4004
|
return new fu({
|
|
4005
4005
|
type: "union",
|
|
4006
4006
|
options: e,
|
|
4007
|
-
...
|
|
4007
|
+
...E(t)
|
|
4008
4008
|
});
|
|
4009
4009
|
}
|
|
4010
4010
|
const mu = /* @__PURE__ */ h("ZodIntersection", (e, t) => {
|
|
@@ -4025,15 +4025,15 @@ function kr(e, t, n) {
|
|
|
4025
4025
|
type: "record",
|
|
4026
4026
|
keyType: N(),
|
|
4027
4027
|
valueType: e,
|
|
4028
|
-
...
|
|
4028
|
+
...E(t)
|
|
4029
4029
|
}) : new bn({
|
|
4030
4030
|
type: "record",
|
|
4031
4031
|
keyType: e,
|
|
4032
4032
|
valueType: t,
|
|
4033
|
-
...
|
|
4033
|
+
...E(n)
|
|
4034
4034
|
});
|
|
4035
4035
|
}
|
|
4036
|
-
const
|
|
4036
|
+
const Et = /* @__PURE__ */ h("ZodEnum", (e, t) => {
|
|
4037
4037
|
Zs.init(e, t), $.init(e, t), e._zod.processJSONSchema = (r, o, i) => cc(e, r, o), e.enum = t.entries, e.options = [...e._zod.values];
|
|
4038
4038
|
const n = new Set(Object.keys(t.entries));
|
|
4039
4039
|
e.extract = (r, o) => {
|
|
@@ -4043,10 +4043,10 @@ const St = /* @__PURE__ */ h("ZodEnum", (e, t) => {
|
|
|
4043
4043
|
i[s] = t.entries[s];
|
|
4044
4044
|
else
|
|
4045
4045
|
throw new Error(`Key ${s} not found in enum`);
|
|
4046
|
-
return new
|
|
4046
|
+
return new Et({
|
|
4047
4047
|
...t,
|
|
4048
4048
|
checks: [],
|
|
4049
|
-
...
|
|
4049
|
+
...E(o),
|
|
4050
4050
|
entries: i
|
|
4051
4051
|
});
|
|
4052
4052
|
}, e.exclude = (r, o) => {
|
|
@@ -4056,20 +4056,20 @@ const St = /* @__PURE__ */ h("ZodEnum", (e, t) => {
|
|
|
4056
4056
|
delete i[s];
|
|
4057
4057
|
else
|
|
4058
4058
|
throw new Error(`Key ${s} not found in enum`);
|
|
4059
|
-
return new
|
|
4059
|
+
return new Et({
|
|
4060
4060
|
...t,
|
|
4061
4061
|
checks: [],
|
|
4062
|
-
...
|
|
4062
|
+
...E(o),
|
|
4063
4063
|
entries: i
|
|
4064
4064
|
});
|
|
4065
4065
|
};
|
|
4066
4066
|
});
|
|
4067
4067
|
function zr(e, t) {
|
|
4068
4068
|
const n = Array.isArray(e) ? Object.fromEntries(e.map((r) => [r, r])) : e;
|
|
4069
|
-
return new
|
|
4069
|
+
return new Et({
|
|
4070
4070
|
type: "enum",
|
|
4071
4071
|
entries: n,
|
|
4072
|
-
...
|
|
4072
|
+
...E(t)
|
|
4073
4073
|
});
|
|
4074
4074
|
}
|
|
4075
4075
|
const yu = /* @__PURE__ */ h("ZodLiteral", (e, t) => {
|
|
@@ -4085,7 +4085,7 @@ function De(e, t) {
|
|
|
4085
4085
|
return new yu({
|
|
4086
4086
|
type: "literal",
|
|
4087
4087
|
values: Array.isArray(e) ? e : [e],
|
|
4088
|
-
...
|
|
4088
|
+
...E(t)
|
|
4089
4089
|
});
|
|
4090
4090
|
}
|
|
4091
4091
|
const gu = /* @__PURE__ */ h("ZodTransform", (e, t) => {
|
|
@@ -4094,10 +4094,10 @@ const gu = /* @__PURE__ */ h("ZodTransform", (e, t) => {
|
|
|
4094
4094
|
throw new Xn(e.constructor.name);
|
|
4095
4095
|
n.addIssue = (i) => {
|
|
4096
4096
|
if (typeof i == "string")
|
|
4097
|
-
n.issues.push(
|
|
4097
|
+
n.issues.push(Se(i, n.value, t));
|
|
4098
4098
|
else {
|
|
4099
4099
|
const s = i;
|
|
4100
|
-
s.fatal && (s.continue = !1), s.code ?? (s.code = "custom"), "input" in s || (s.input = n.value), s.inst ?? (s.inst = e), n.issues.push(
|
|
4100
|
+
s.fatal && (s.continue = !1), s.code ?? (s.code = "custom"), "input" in s || (s.input = n.value), s.inst ?? (s.inst = e), n.issues.push(Se(s));
|
|
4101
4101
|
}
|
|
4102
4102
|
};
|
|
4103
4103
|
const o = t.transform(n.value, n);
|
|
@@ -4113,7 +4113,7 @@ function _u(e) {
|
|
|
4113
4113
|
const Dr = /* @__PURE__ */ h("ZodOptional", (e, t) => {
|
|
4114
4114
|
dr.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => $r(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
4115
4115
|
});
|
|
4116
|
-
function
|
|
4116
|
+
function En(e) {
|
|
4117
4117
|
return new Dr({
|
|
4118
4118
|
type: "optional",
|
|
4119
4119
|
innerType: e
|
|
@@ -4128,20 +4128,20 @@ function bu(e) {
|
|
|
4128
4128
|
innerType: e
|
|
4129
4129
|
});
|
|
4130
4130
|
}
|
|
4131
|
-
const
|
|
4131
|
+
const Eu = /* @__PURE__ */ h("ZodNullable", (e, t) => {
|
|
4132
4132
|
Ys.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => _c(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
4133
4133
|
});
|
|
4134
|
-
function
|
|
4135
|
-
return new
|
|
4134
|
+
function Sn(e) {
|
|
4135
|
+
return new Eu({
|
|
4136
4136
|
type: "nullable",
|
|
4137
4137
|
innerType: e
|
|
4138
4138
|
});
|
|
4139
4139
|
}
|
|
4140
|
-
const
|
|
4141
|
-
Bs.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) =>
|
|
4140
|
+
const Su = /* @__PURE__ */ h("ZodDefault", (e, t) => {
|
|
4141
|
+
Bs.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ec(e, n, r, o), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
|
|
4142
4142
|
});
|
|
4143
4143
|
function vu(e, t) {
|
|
4144
|
-
return new
|
|
4144
|
+
return new Su({
|
|
4145
4145
|
type: "default",
|
|
4146
4146
|
innerType: e,
|
|
4147
4147
|
get defaultValue() {
|
|
@@ -4150,7 +4150,7 @@ function vu(e, t) {
|
|
|
4150
4150
|
});
|
|
4151
4151
|
}
|
|
4152
4152
|
const Tu = /* @__PURE__ */ h("ZodPrefault", (e, t) => {
|
|
4153
|
-
Gs.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) =>
|
|
4153
|
+
Gs.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => Sc(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
4154
4154
|
});
|
|
4155
4155
|
function Iu(e, t) {
|
|
4156
4156
|
return new Tu({
|
|
@@ -4168,7 +4168,7 @@ function Ou(e, t) {
|
|
|
4168
4168
|
return new xr({
|
|
4169
4169
|
type: "nonoptional",
|
|
4170
4170
|
innerType: e,
|
|
4171
|
-
...
|
|
4171
|
+
...E(t)
|
|
4172
4172
|
});
|
|
4173
4173
|
}
|
|
4174
4174
|
const wu = /* @__PURE__ */ h("ZodCatch", (e, t) => {
|
|
@@ -4210,10 +4210,10 @@ function Pu(e, t = {}) {
|
|
|
4210
4210
|
function Nu(e, t) {
|
|
4211
4211
|
return /* @__PURE__ */ Wa(e, t);
|
|
4212
4212
|
}
|
|
4213
|
-
const Ae = de().int().positive(), ku =
|
|
4213
|
+
const Ae = de().int().positive(), ku = Ee({
|
|
4214
4214
|
/** Maximum duration of one model attempt, in milliseconds. */
|
|
4215
4215
|
attemptTimeoutMs: de().int().positive().max(2147483647),
|
|
4216
|
-
maxOutputTokens:
|
|
4216
|
+
maxOutputTokens: Ee({
|
|
4217
4217
|
/** Shared output allowance for fresh creation and whole-page updates. */
|
|
4218
4218
|
page: Ae,
|
|
4219
4219
|
/** Output allowance for translation decisions and explicit card counts. */
|
|
@@ -4259,16 +4259,16 @@ const Ae = de().int().positive(), ku = Se({
|
|
|
4259
4259
|
"componentDescriptions",
|
|
4260
4260
|
"recommendedSections",
|
|
4261
4261
|
"listGuidance"
|
|
4262
|
-
]), Du =
|
|
4262
|
+
]), Du = Ee({
|
|
4263
4263
|
contractVersion: De(1),
|
|
4264
|
-
prompts:
|
|
4264
|
+
prompts: Ee({
|
|
4265
4265
|
prepare: K(),
|
|
4266
4266
|
create: Tn(),
|
|
4267
4267
|
fullPageUpdate: Tn(),
|
|
4268
4268
|
plan: K(),
|
|
4269
4269
|
section: K()
|
|
4270
4270
|
}),
|
|
4271
|
-
context:
|
|
4271
|
+
context: Ee({
|
|
4272
4272
|
createLists: K(),
|
|
4273
4273
|
fullPageUpdateLists: K(),
|
|
4274
4274
|
createRecommendations: K(["sectionIds"]),
|
|
@@ -4378,7 +4378,7 @@ export default config;
|
|
|
4378
4378
|
).replaceAll('"__LOCAL_EDITOR_TEMPLATE_ID__"', JSON.stringify(n)).replaceAll('"__LOCAL_EDITOR_PAGE_SET_TYPE__"', JSON.stringify(r)).replaceAll(
|
|
4379
4379
|
'"__LOCAL_EDITOR_DATA_TEMPLATE_NAME__"',
|
|
4380
4380
|
JSON.stringify(Qe(n))
|
|
4381
|
-
), Ge = (e) => b.existsSync(e) ? b.readFileSync(e, "utf8").startsWith(Vu) : !1,
|
|
4381
|
+
), Ge = (e) => b.existsSync(e) ? b.readFileSync(e, "utf8").startsWith(Vu) : !1, St = (e) => !!e && typeof e == "object" && !Array.isArray(e), vt = (e, t) => {
|
|
4382
4382
|
try {
|
|
4383
4383
|
return JSON.parse(b.readFileSync(e, "utf8"));
|
|
4384
4384
|
} catch (n) {
|
|
@@ -4470,7 +4470,7 @@ const Yr = async (e, t, n) => {
|
|
|
4470
4470
|
}, Br = (e, t) => {
|
|
4471
4471
|
if (Array.isArray(t)) {
|
|
4472
4472
|
const n = t.filter(
|
|
4473
|
-
(o) =>
|
|
4473
|
+
(o) => St(o)
|
|
4474
4474
|
);
|
|
4475
4475
|
if (n.length > 0) {
|
|
4476
4476
|
const o = /* @__PURE__ */ new Map();
|
|
@@ -4494,7 +4494,7 @@ const Yr = async (e, t, n) => {
|
|
|
4494
4494
|
children: /* @__PURE__ */ new Map()
|
|
4495
4495
|
};
|
|
4496
4496
|
}
|
|
4497
|
-
if (
|
|
4497
|
+
if (St(t)) {
|
|
4498
4498
|
const n = nl(t);
|
|
4499
4499
|
return n ? {
|
|
4500
4500
|
name: e,
|
|
@@ -4570,7 +4570,7 @@ const Yr = async (e, t, n) => {
|
|
|
4570
4570
|
if (t.length !== 1 || t[0] !== "image")
|
|
4571
4571
|
return !1;
|
|
4572
4572
|
const n = e.image;
|
|
4573
|
-
return
|
|
4573
|
+
return St(n) && Vr(n);
|
|
4574
4574
|
}, il = (e) => (typeof e.label == "string" || typeof e.link == "string") && typeof e.linkType == "string", On = (e) => typeof e == "boolean" ? "type.boolean" : typeof e == "number" ? "type.number" : "type.string", sl = (e, t) => e ? t && e === "type.string" && t !== "type.string" ? t : e : t, Kr = (e) => e.split(".").map((t) => t.replace(/^c_/, "").replace(/[_-]+/g, " ").replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/\b\w/g, (n) => n.toUpperCase())).join(" > "), Te = "en", wn = "local-editor-locations", Hr = 100, re = (e, t) => ({
|
|
4575
4575
|
name: e,
|
|
4576
4576
|
slug: t
|
|
@@ -4802,14 +4802,14 @@ const Yr = async (e, t, n) => {
|
|
|
4802
4802
|
f,
|
|
4803
4803
|
s.env.YEXT_SEARCH_EXPERIENCE_KEY
|
|
4804
4804
|
));
|
|
4805
|
-
const
|
|
4805
|
+
const S = s.documents.filter((C) => C.layoutId === p.layoutId).flatMap((C) => {
|
|
4806
4806
|
try {
|
|
4807
4807
|
return [Rn(C)];
|
|
4808
4808
|
} catch {
|
|
4809
4809
|
return [];
|
|
4810
4810
|
}
|
|
4811
4811
|
}), z = el(
|
|
4812
|
-
|
|
4812
|
+
S,
|
|
4813
4813
|
s.layoutStreams[p.layoutId]
|
|
4814
4814
|
);
|
|
4815
4815
|
if (t.find((C) => C.metadata.id === p.layoutId)?.metadata.pageSetType === "DIRECTORY" && Array.isArray(f.dm_directoryChildren)) {
|
|
@@ -4819,7 +4819,7 @@ const Yr = async (e, t, n) => {
|
|
|
4819
4819
|
return [x];
|
|
4820
4820
|
if (typeof x != "string" && typeof x != "number")
|
|
4821
4821
|
return [];
|
|
4822
|
-
const w =
|
|
4822
|
+
const w = S.find((T) => String(T.uid) === String(x));
|
|
4823
4823
|
return w ? [w] : [];
|
|
4824
4824
|
}
|
|
4825
4825
|
);
|
|
@@ -5016,7 +5016,7 @@ const Yr = async (e, t, n) => {
|
|
|
5016
5016
|
return Array.from(n.values()).sort((r, o) => r.displayName.localeCompare(o.displayName));
|
|
5017
5017
|
}, $n = (e, t) => typeof e.locale == "string" && e.locale.length > 0 ? e.locale : t.match(/__(.+?)__[^_]+\.json$/)?.[1] ?? "en", dt = (e, t) => (typeof e.id == "string" || typeof e.id == "number") && String(e.id).length > 0 ? String(e.id) : t.match(/__([^_]+)\.json$/)?.[1] ?? t.replace(/\.json$/, ""), bl = async (e, t, n) => {
|
|
5018
5018
|
const r = new URL(e, "http://localhost");
|
|
5019
|
-
return
|
|
5019
|
+
return El(r) ? (await vl(t, n), !0) : Sl(r) ? (await Tl(t, r, n), !0) : !1;
|
|
5020
5020
|
}, P = (e, t, n = 200) => {
|
|
5021
5021
|
e.statusCode = n, e.setHeader("Content-Type", "application/json"), e.end(JSON.stringify(t));
|
|
5022
5022
|
}, Wr = async (e, t) => {
|
|
@@ -5043,7 +5043,7 @@ const Yr = async (e, t, n) => {
|
|
|
5043
5043
|
parseError: o instanceof Error ? o.message : String(o)
|
|
5044
5044
|
};
|
|
5045
5045
|
}
|
|
5046
|
-
},
|
|
5046
|
+
}, El = (e) => e.pathname === `${Mr}/manifest`, Sl = (e) => e.pathname === `${Mr}/document`, vl = async (e, t) => {
|
|
5047
5047
|
const n = await ll(
|
|
5048
5048
|
process.cwd(),
|
|
5049
5049
|
t
|
|
@@ -5582,7 +5582,7 @@ export default Edit;
|
|
|
5582
5582
|
`, Zl = `/* SECTION_LIBRARY_GENERATED_FILE */
|
|
5583
5583
|
import "@yext/visual-editor/style.css";
|
|
5584
5584
|
import "../index.css";
|
|
5585
|
-
import { type Data,
|
|
5585
|
+
import { type Data, resolveAllData } from "@puckeditor/core";
|
|
5586
5586
|
import { AnalyticsProvider, SchemaWrapper } from "@yext/pages-components";
|
|
5587
5587
|
import {
|
|
5588
5588
|
type GetHeadConfig,
|
|
@@ -5608,6 +5608,7 @@ import {
|
|
|
5608
5608
|
migrationRegistry,
|
|
5609
5609
|
type MigrationRegistry,
|
|
5610
5610
|
resolveUrlTemplate,
|
|
5611
|
+
VisualEditorRender,
|
|
5611
5612
|
} from "@yext/visual-editor";
|
|
5612
5613
|
import {
|
|
5613
5614
|
loadTranslationDictionary,
|
|
@@ -5735,6 +5736,17 @@ const SectionLibraryLayout: Template<TemplateRenderProps> = (props) => {
|
|
|
5735
5736
|
\`Section Library layout \${layoutId} has invalid layout data\`
|
|
5736
5737
|
);
|
|
5737
5738
|
}
|
|
5739
|
+
let requireAnalyticsOptIn = false;
|
|
5740
|
+
if (props.document.__?.visualEditorConfig) {
|
|
5741
|
+
try {
|
|
5742
|
+
requireAnalyticsOptIn =
|
|
5743
|
+
JSON.parse(props.document.__.visualEditorConfig)
|
|
5744
|
+
?.requireAnalyticsOptIn ?? false;
|
|
5745
|
+
} catch (e) {
|
|
5746
|
+
console.error("Failed to parse visualEditorConfig JSON:", e);
|
|
5747
|
+
}
|
|
5748
|
+
}
|
|
5749
|
+
|
|
5738
5750
|
return (
|
|
5739
5751
|
<>
|
|
5740
5752
|
{/* SECTION_LIBRARY_MAPBOX_ASSETS */}
|
|
@@ -5742,13 +5754,14 @@ const SectionLibraryLayout: Template<TemplateRenderProps> = (props) => {
|
|
|
5742
5754
|
apiKey={props.document?._env?.YEXT_PUBLIC_VISUAL_EDITOR_APP_API_KEY}
|
|
5743
5755
|
templateData={props}
|
|
5744
5756
|
currency="USD"
|
|
5757
|
+
requireOptIn={requireAnalyticsOptIn}
|
|
5745
5758
|
>
|
|
5746
5759
|
<SectionLibraryVisualEditorProvider
|
|
5747
5760
|
templateProps={props}
|
|
5748
5761
|
translationLoaders={translationLoaders}
|
|
5749
5762
|
>
|
|
5750
5763
|
<GTMBody>
|
|
5751
|
-
<
|
|
5764
|
+
<VisualEditorRender
|
|
5752
5765
|
config={sectionLibraryConfig}
|
|
5753
5766
|
data={data}
|
|
5754
5767
|
metadata={{ streamDocument: props.document }}
|
|
@@ -5870,7 +5883,7 @@ export default SectionLibraryLayout;
|
|
|
5870
5883
|
throw new Error(`${e} config must define a valid id`);
|
|
5871
5884
|
const l = s.getProperty("pageSetTypes"), u = l ? l.asKind(L.PropertyAssignment)?.getInitializer()?.asKind(L.ArrayLiteralExpression)?.getElements().map((f) => {
|
|
5872
5885
|
const g = f.asKind(L.StringLiteral)?.getLiteralValue(), _ = Qr.find(
|
|
5873
|
-
(
|
|
5886
|
+
(S) => S === g
|
|
5874
5887
|
);
|
|
5875
5888
|
if (!_)
|
|
5876
5889
|
throw new Error(
|
|
@@ -6052,10 +6065,10 @@ const Xl = (e) => {
|
|
|
6052
6065
|
"local-editor"
|
|
6053
6066
|
// generated Local Editor template ID
|
|
6054
6067
|
]), Ie = /^[A-Za-z0-9_-]+$/, ql = (e) => {
|
|
6055
|
-
const t = y.join(e, "src", "library"), n = [], r = (f, g, _,
|
|
6068
|
+
const t = y.join(e, "src", "library"), n = [], r = (f, g, _, S) => {
|
|
6056
6069
|
n.push({
|
|
6057
6070
|
category: "structure",
|
|
6058
|
-
...
|
|
6071
|
+
...S ? { severity: S } : {},
|
|
6059
6072
|
filePath: y.relative(e, f) || ".",
|
|
6060
6073
|
message: dd(_, e),
|
|
6061
6074
|
rule: g
|
|
@@ -6534,7 +6547,7 @@ const hd = [
|
|
|
6534
6547
|
), d = y.join(l, "i18n.ts"), m = [...u.generatedFiles], p = y.join(l, "catalog.js");
|
|
6535
6548
|
if (!oe(
|
|
6536
6549
|
p,
|
|
6537
|
-
|
|
6550
|
+
Sd(
|
|
6538
6551
|
e,
|
|
6539
6552
|
p,
|
|
6540
6553
|
a.sections,
|
|
@@ -6598,7 +6611,7 @@ const hd = [
|
|
|
6598
6611
|
)
|
|
6599
6612
|
) ? [g] : [];
|
|
6600
6613
|
})
|
|
6601
|
-
),
|
|
6614
|
+
), Ed(e, a.layouts), {
|
|
6602
6615
|
generatedFiles: m,
|
|
6603
6616
|
layouts: a.layouts,
|
|
6604
6617
|
manifestSource: `${JSON.stringify(
|
|
@@ -6692,7 +6705,7 @@ const hd = [
|
|
|
6692
6705
|
(r, o) => o.length - r.length
|
|
6693
6706
|
))
|
|
6694
6707
|
b.existsSync(n) && b.readdirSync(n).length === 0 && b.removeSync(n);
|
|
6695
|
-
},
|
|
6708
|
+
}, Ed = (e, t) => {
|
|
6696
6709
|
const n = y.join(e, ".template-manifest.json"), r = JSON.stringify(
|
|
6697
6710
|
{
|
|
6698
6711
|
templates: t.map((o) => ({
|
|
@@ -6707,7 +6720,7 @@ const hd = [
|
|
|
6707
6720
|
2
|
|
6708
6721
|
);
|
|
6709
6722
|
(!b.existsSync(n) || b.readFileSync(n, "utf8") !== r) && b.writeFileSync(n, r);
|
|
6710
|
-
},
|
|
6723
|
+
}, Sd = (e, t, n, r) => {
|
|
6711
6724
|
if (n.some((s) => s.id === "MainContent"))
|
|
6712
6725
|
throw new Error("MainContent is reserved for json-render composition.");
|
|
6713
6726
|
const o = n.map((s, a) => {
|
|
@@ -7105,12 +7118,12 @@ export default LocalEditor;
|
|
|
7105
7118
|
f.url,
|
|
7106
7119
|
g,
|
|
7107
7120
|
i
|
|
7108
|
-
).then((
|
|
7109
|
-
|
|
7110
|
-
}).catch((
|
|
7121
|
+
).then((S) => {
|
|
7122
|
+
S || _();
|
|
7123
|
+
}).catch((S) => {
|
|
7111
7124
|
P(
|
|
7112
7125
|
g,
|
|
7113
|
-
{ error:
|
|
7126
|
+
{ error: S instanceof Error ? S.message : String(S) },
|
|
7114
7127
|
500
|
|
7115
7128
|
);
|
|
7116
7129
|
});
|