@gengage/assistant-fe 0.1.5 → 0.1.7
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/README.md +100 -0
- package/dist/assistant-fe.css +1 -1
- package/dist/chat/components/AIGroupingCards.d.ts.map +1 -1
- package/dist/chat/components/AITopPicks.d.ts.map +1 -1
- package/dist/chat/components/ChatDrawer.d.ts +12 -4
- package/dist/chat/components/ChatDrawer.d.ts.map +1 -1
- package/dist/chat/components/ComparisonTable.d.ts +2 -7
- package/dist/chat/components/ComparisonTable.d.ts.map +1 -1
- package/dist/chat/components/productMentionLinker.d.ts.map +1 -1
- package/dist/chat/index.d.ts +14 -1
- package/dist/chat/index.d.ts.map +1 -1
- package/dist/chat/locales/en.d.ts.map +1 -1
- package/dist/chat/locales/tr.d.ts.map +1 -1
- package/dist/chat/panel-manager.d.ts +6 -2
- package/dist/chat/panel-manager.d.ts.map +1 -1
- package/dist/chat/session-persistence.d.ts +1 -0
- package/dist/chat/session-persistence.d.ts.map +1 -1
- package/dist/chat/types.d.ts +4 -2
- package/dist/chat/types.d.ts.map +1 -1
- package/dist/chat.cjs +1 -1
- package/dist/chat.iife.js +29 -29
- package/dist/chat.iife.js.map +1 -1
- package/dist/chat.js +2 -2
- package/dist/common/events.d.ts.map +1 -1
- package/dist/common/index.d.ts +2 -0
- package/dist/common/index.d.ts.map +1 -1
- package/dist/common/indexed-db.d.ts +2 -0
- package/dist/common/indexed-db.d.ts.map +1 -1
- package/dist/common/native-webview.d.ts +61 -0
- package/dist/common/native-webview.d.ts.map +1 -0
- package/dist/common/overlay.d.ts +5 -0
- package/dist/common/overlay.d.ts.map +1 -1
- package/dist/common/v1-protocol-adapter.d.ts.map +1 -1
- package/dist/common.cjs +1 -1
- package/dist/common.cjs.map +1 -1
- package/dist/common.js +197 -426
- package/dist/common.js.map +1 -1
- package/dist/index-1yPxOqAw.cjs +13 -0
- package/dist/index-1yPxOqAw.cjs.map +1 -0
- package/dist/index-BH-V2lWn.js +510 -0
- package/dist/index-BH-V2lWn.js.map +1 -0
- package/dist/index-BelS6Vnv.cjs +2 -0
- package/dist/index-BelS6Vnv.cjs.map +1 -0
- package/dist/index-CERWfDdF.js +4571 -0
- package/dist/index-CERWfDdF.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +55 -50
- package/dist/index.js.map +1 -1
- package/dist/native/index.d.ts +3 -0
- package/dist/native/index.d.ts.map +1 -0
- package/dist/native.cjs +2 -0
- package/dist/native.cjs.map +1 -0
- package/dist/native.iife.js +97 -0
- package/dist/native.iife.js.map +1 -0
- package/dist/native.js +9 -0
- package/dist/native.js.map +1 -0
- package/dist/qna/components/TextInput.d.ts.map +1 -1
- package/dist/qna/components/renderUISpec.d.ts.map +1 -1
- package/dist/qna/index.d.ts +1 -0
- package/dist/qna/index.d.ts.map +1 -1
- package/dist/qna/types.d.ts +1 -1
- package/dist/qna/types.d.ts.map +1 -1
- package/dist/qna.cjs +1 -1
- package/dist/qna.cjs.map +1 -1
- package/dist/qna.css +1 -1
- package/dist/qna.iife.js +20 -20
- package/dist/qna.iife.js.map +1 -1
- package/dist/qna.js +92 -80
- package/dist/qna.js.map +1 -1
- package/dist/schemas-DHzfUzwA.cjs +86 -0
- package/dist/schemas-DHzfUzwA.cjs.map +1 -0
- package/dist/{schemas-B9GN-J3e.js → schemas-yF4IOEUi.js} +1088 -987
- package/dist/schemas-yF4IOEUi.js.map +1 -0
- package/dist/simrel/components/ProductCard.d.ts.map +1 -1
- package/dist/simrel.cjs +1 -1
- package/dist/simrel.cjs.map +1 -1
- package/dist/simrel.css +1 -1
- package/dist/simrel.iife.js +20 -20
- package/dist/simrel.iife.js.map +1 -1
- package/dist/simrel.js +218 -214
- package/dist/simrel.js.map +1 -1
- package/package.json +9 -2
- package/dist/index-eefqsSOT.cjs +0 -13
- package/dist/index-eefqsSOT.cjs.map +0 -1
- package/dist/index-kp84NL1R.js +0 -4399
- package/dist/index-kp84NL1R.js.map +0 -1
- package/dist/schemas-B9GN-J3e.js.map +0 -1
- package/dist/schemas-tCxs1sED.cjs +0 -86
- package/dist/schemas-tCxs1sED.cjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const Dt = ({ element: e, renderElement: t }) => {
|
|
2
2
|
if (!e.children || e.children.length === 0)
|
|
3
3
|
return null;
|
|
4
4
|
const n = document.createElement("div");
|
|
@@ -8,10 +8,10 @@ const jt = ({ element: e, renderElement: t }) => {
|
|
|
8
8
|
}
|
|
9
9
|
return n;
|
|
10
10
|
};
|
|
11
|
-
function
|
|
11
|
+
function Fa(e) {
|
|
12
12
|
const t = document.createElement("div");
|
|
13
13
|
if (t.className = e.containerClassName, !e.spec.elements[e.spec.root]) return t;
|
|
14
|
-
const r = e.unknownRenderer ??
|
|
14
|
+
const r = e.unknownRenderer ?? Dt, o = (s) => {
|
|
15
15
|
const a = e.spec.elements[s];
|
|
16
16
|
if (!a) return null;
|
|
17
17
|
const c = e.registry[a.type];
|
|
@@ -31,14 +31,14 @@ function Da(e) {
|
|
|
31
31
|
}, i = o(e.spec.root);
|
|
32
32
|
return i && t.appendChild(i), t;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function xa(e, t) {
|
|
35
35
|
if (!t) return e;
|
|
36
36
|
const n = { ...e };
|
|
37
37
|
for (const [r, o] of Object.entries(t))
|
|
38
38
|
o && (n[r] = o);
|
|
39
39
|
return n;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function Ja(e, t) {
|
|
42
42
|
const n = {
|
|
43
43
|
event_name: "stream.start",
|
|
44
44
|
account_id: e.account_id,
|
|
@@ -51,7 +51,7 @@ function La(e, t) {
|
|
|
51
51
|
};
|
|
52
52
|
return e.view_id !== void 0 && (n.view_id = e.view_id), e.user_id !== void 0 && (n.user_id = e.user_id), t.widget !== void 0 && (n.widget = t.widget), e.page_type !== void 0 && (n.page_type = e.page_type), e.sku !== void 0 && (n.sku = e.sku), n;
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function qa(e, t) {
|
|
55
55
|
const n = {
|
|
56
56
|
request_id: t.request_id,
|
|
57
57
|
chunk_index: t.chunk_index
|
|
@@ -66,7 +66,7 @@ function Ua(e, t) {
|
|
|
66
66
|
};
|
|
67
67
|
return e.view_id !== void 0 && (r.view_id = e.view_id), e.user_id !== void 0 && (r.user_id = e.user_id), t.widget !== void 0 && (r.widget = t.widget), e.page_type !== void 0 && (r.page_type = e.page_type), e.sku !== void 0 && (r.sku = e.sku), r;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function Va(e, t) {
|
|
70
70
|
const n = {
|
|
71
71
|
event_name: "stream.ui_spec",
|
|
72
72
|
account_id: e.account_id,
|
|
@@ -80,7 +80,7 @@ function Ma(e, t) {
|
|
|
80
80
|
};
|
|
81
81
|
return e.view_id !== void 0 && (n.view_id = e.view_id), e.user_id !== void 0 && (n.user_id = e.user_id), t.widget !== void 0 && (n.widget = t.widget), e.page_type !== void 0 && (n.page_type = e.page_type), e.sku !== void 0 && (n.sku = e.sku), n;
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function Ga(e, t) {
|
|
84
84
|
const n = {
|
|
85
85
|
event_name: "stream.done",
|
|
86
86
|
account_id: e.account_id,
|
|
@@ -94,7 +94,7 @@ function Fa(e, t) {
|
|
|
94
94
|
};
|
|
95
95
|
return e.view_id !== void 0 && (n.view_id = e.view_id), e.user_id !== void 0 && (n.user_id = e.user_id), t.widget !== void 0 && (n.widget = t.widget), e.page_type !== void 0 && (n.page_type = e.page_type), e.sku !== void 0 && (n.sku = e.sku), n;
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function Ba(e, t) {
|
|
98
98
|
const n = {
|
|
99
99
|
event_name: "stream.error",
|
|
100
100
|
account_id: e.account_id,
|
|
@@ -108,7 +108,7 @@ function Ja(e, t) {
|
|
|
108
108
|
};
|
|
109
109
|
return e.view_id !== void 0 && (n.view_id = e.view_id), e.user_id !== void 0 && (n.user_id = e.user_id), t.widget !== void 0 && (n.widget = t.widget), e.page_type !== void 0 && (n.page_type = e.page_type), e.sku !== void 0 && (n.sku = e.sku), n;
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function Wa(e, t) {
|
|
112
112
|
const n = {
|
|
113
113
|
model: t.model,
|
|
114
114
|
prompt_tokens: t.prompt_tokens,
|
|
@@ -125,7 +125,7 @@ function xa(e, t) {
|
|
|
125
125
|
};
|
|
126
126
|
return e.view_id !== void 0 && (r.view_id = e.view_id), e.user_id !== void 0 && (r.user_id = e.user_id), e.page_type !== void 0 && (r.page_type = e.page_type), e.sku !== void 0 && (r.sku = e.sku), r;
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function Ha(e, t) {
|
|
129
129
|
const n = {
|
|
130
130
|
event_name: "metering.increment",
|
|
131
131
|
account_id: e.account_id,
|
|
@@ -153,7 +153,7 @@ function Lt(e, t) {
|
|
|
153
153
|
};
|
|
154
154
|
return e.view_id !== void 0 && (n.view_id = e.view_id), e.user_id !== void 0 && (n.user_id = e.user_id), e.page_type !== void 0 && (n.page_type = e.page_type), e.sku !== void 0 && (n.sku = e.sku), n;
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function Ka(e, t) {
|
|
157
157
|
const n = {
|
|
158
158
|
event_name: "chat.history.snapshot",
|
|
159
159
|
account_id: e.account_id,
|
|
@@ -167,7 +167,7 @@ function Va(e, t) {
|
|
|
167
167
|
};
|
|
168
168
|
return e.view_id !== void 0 && (n.view_id = e.view_id), e.user_id !== void 0 && (n.user_id = e.user_id), e.page_type !== void 0 && (n.page_type = e.page_type), e.sku !== void 0 && (n.sku = e.sku), n;
|
|
169
169
|
}
|
|
170
|
-
function
|
|
170
|
+
function Ya(e, t) {
|
|
171
171
|
const n = {
|
|
172
172
|
event_name: "widget.history.snapshot",
|
|
173
173
|
account_id: e.account_id,
|
|
@@ -182,7 +182,7 @@ function Ba(e, t) {
|
|
|
182
182
|
};
|
|
183
183
|
return e.view_id !== void 0 && (n.view_id = e.view_id), e.user_id !== void 0 && (n.user_id = e.user_id), e.page_type !== void 0 && (n.page_type = e.page_type), e.sku !== void 0 && (n.sku = e.sku), n;
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function Qa(e, t) {
|
|
186
186
|
const n = {
|
|
187
187
|
event_name: "basket.add",
|
|
188
188
|
account_id: e.account_id,
|
|
@@ -234,44 +234,96 @@ function Mt(e, t) {
|
|
|
234
234
|
};
|
|
235
235
|
return e.view_id !== void 0 && (n.view_id = e.view_id), e.user_id !== void 0 && (n.user_id = e.user_id), e.page_type !== void 0 && (n.page_type = e.page_type), e.sku !== void 0 && (n.sku = e.sku), n;
|
|
236
236
|
}
|
|
237
|
-
function
|
|
237
|
+
function Xa(e, t) {
|
|
238
238
|
window.dispatchEvent(new CustomEvent(e, { detail: t, bubbles: !1 }));
|
|
239
239
|
}
|
|
240
|
-
function
|
|
240
|
+
function ee(e, t) {
|
|
241
241
|
const n = (r) => {
|
|
242
242
|
t(r.detail);
|
|
243
243
|
};
|
|
244
244
|
return window.addEventListener(e, n), () => window.removeEventListener(e, n);
|
|
245
245
|
}
|
|
246
|
-
function
|
|
246
|
+
function Ft(e) {
|
|
247
|
+
if (e.type !== "user_message" && e.type !== "inputText") return null;
|
|
248
|
+
if (typeof e.payload == "string" && e.payload.trim().length > 0)
|
|
249
|
+
return e.payload.trim();
|
|
250
|
+
if (typeof e.payload == "object" && e.payload !== null && typeof e.payload.text == "string") {
|
|
251
|
+
const t = String(e.payload.text).trim();
|
|
252
|
+
if (t.length > 0) return t;
|
|
253
|
+
}
|
|
254
|
+
return typeof e.title == "string" && e.title.trim().length > 0 ? e.title.trim() : null;
|
|
255
|
+
}
|
|
256
|
+
function ec(e) {
|
|
247
257
|
let t = !1;
|
|
248
|
-
|
|
249
|
-
|
|
258
|
+
const n = [];
|
|
259
|
+
let r = 0, o = null, i = 0;
|
|
260
|
+
const s = 100, a = 5e3;
|
|
261
|
+
function c() {
|
|
262
|
+
return window.gengage?.chat ?? null;
|
|
263
|
+
}
|
|
264
|
+
function u() {
|
|
265
|
+
t || (console.warn(
|
|
250
266
|
"[gengage] QNA tried to open chat, but chat widget is not initialized. Ensure GengageChat is initialized before calling wireQNAToChat()."
|
|
251
|
-
), t = !0), e?.onChatUnavailable?.()
|
|
267
|
+
), t = !0), e?.onChatUnavailable?.();
|
|
268
|
+
}
|
|
269
|
+
function l(m, k) {
|
|
270
|
+
const I = Ft(k);
|
|
271
|
+
if (I && m.sendMessage) {
|
|
272
|
+
m.open?.(), m.sendMessage(I);
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
m.openWithAction?.(k);
|
|
276
|
+
}
|
|
277
|
+
function f() {
|
|
278
|
+
o !== null && (window.clearInterval(o), o = null);
|
|
279
|
+
}
|
|
280
|
+
function p() {
|
|
281
|
+
const m = c();
|
|
282
|
+
if (!m) return !1;
|
|
283
|
+
if (r > 0 && (m.open?.(), r = 0), n.length > 0) {
|
|
284
|
+
const k = n.splice(0, n.length);
|
|
285
|
+
for (const I of k)
|
|
286
|
+
l(m, I);
|
|
287
|
+
}
|
|
288
|
+
return f(), !0;
|
|
289
|
+
}
|
|
290
|
+
function g() {
|
|
291
|
+
o === null && (i = Date.now(), o = window.setInterval(() => {
|
|
292
|
+
p() || Date.now() - i >= a && (n.length = 0, r = 0, f());
|
|
293
|
+
}, s));
|
|
252
294
|
}
|
|
253
|
-
const
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
295
|
+
const y = ee("gengage:qna:action", (m) => {
|
|
296
|
+
const k = c();
|
|
297
|
+
if (k) {
|
|
298
|
+
l(k, m);
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
u(), n.length >= 20 && n.shift(), n.push(m), g();
|
|
302
|
+
}), _ = ee("gengage:qna:open-chat", () => {
|
|
303
|
+
const m = c();
|
|
304
|
+
if (m) {
|
|
305
|
+
m.open?.();
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
u(), r += 1, g();
|
|
257
309
|
});
|
|
258
310
|
return () => {
|
|
259
|
-
|
|
311
|
+
y(), _(), n.length = 0, r = 0, f();
|
|
260
312
|
};
|
|
261
313
|
}
|
|
262
|
-
function
|
|
263
|
-
return
|
|
314
|
+
function tc() {
|
|
315
|
+
return ee("gengage:similar:product-click", ({ sku: e, url: t, sessionId: n }) => {
|
|
264
316
|
n && window.gengage?.chat?.saveSession(n, e), window.location.href = t;
|
|
265
317
|
});
|
|
266
318
|
}
|
|
267
|
-
function
|
|
319
|
+
function xt() {
|
|
268
320
|
const t = window.__gengageSessionId ?? sessionStorage.getItem("gengage_session_id") ?? null ?? crypto.randomUUID();
|
|
269
321
|
return window.__gengageSessionId = t, sessionStorage.setItem("gengage_session_id", t), window.gengage || (window.gengage = {}), window.gengage.sessionId = t, t;
|
|
270
322
|
}
|
|
271
|
-
function
|
|
323
|
+
function nc() {
|
|
272
324
|
return window.gengage?.pageContext ?? null;
|
|
273
325
|
}
|
|
274
|
-
function
|
|
326
|
+
function rc(e) {
|
|
275
327
|
window.gengage || (window.gengage = {}), window.gengage.pageContext = {
|
|
276
328
|
pageType: "other",
|
|
277
329
|
...window.gengage.pageContext,
|
|
@@ -280,7 +332,7 @@ function Qa(e) {
|
|
|
280
332
|
}
|
|
281
333
|
function Jt(e) {
|
|
282
334
|
return {
|
|
283
|
-
sessionId: e?.sessionId ??
|
|
335
|
+
sessionId: e?.sessionId ?? xt(),
|
|
284
336
|
...e
|
|
285
337
|
};
|
|
286
338
|
}
|
|
@@ -298,41 +350,41 @@ const Ee = {
|
|
|
298
350
|
"--gengage-qna-input-radius": "14px",
|
|
299
351
|
"--gengage-simrel-card-radius": "14px"
|
|
300
352
|
};
|
|
301
|
-
function
|
|
353
|
+
function qt(e) {
|
|
302
354
|
return e ? { ...Ee, ...e } : { ...Ee };
|
|
303
355
|
}
|
|
304
|
-
const
|
|
305
|
-
let Te = !1,
|
|
306
|
-
function
|
|
356
|
+
const D = "gengage-global-toast-root", Ze = "gengage-global-toast-style", _e = "gengage-global-toast-root--visible", Vt = 4200, Gt = 1500, Bt = 15e3;
|
|
357
|
+
let Te = !1, J = null;
|
|
358
|
+
function oc(e) {
|
|
307
359
|
return typeof e == "string" && e.toLowerCase().startsWith("tr") ? "Baglanti sorunu olustu. Lutfen tekrar deneyin." : "Connection issue. Please try again.";
|
|
308
360
|
}
|
|
309
|
-
function
|
|
310
|
-
Te || typeof window > "u" || typeof document > "u" || (Te = !0,
|
|
311
|
-
|
|
361
|
+
function Wt() {
|
|
362
|
+
Te || typeof window > "u" || typeof document > "u" || (Te = !0, ee("gengage:global:error", (e) => {
|
|
363
|
+
Ht(e);
|
|
312
364
|
}));
|
|
313
365
|
}
|
|
314
|
-
function
|
|
366
|
+
function Ht(e) {
|
|
315
367
|
if (typeof document > "u") return;
|
|
316
368
|
const t = e.message.trim();
|
|
317
369
|
if (!t) return;
|
|
318
|
-
|
|
319
|
-
const n =
|
|
370
|
+
en();
|
|
371
|
+
const n = Qt();
|
|
320
372
|
n.innerHTML = "";
|
|
321
373
|
const r = document.createElement("section");
|
|
322
374
|
r.className = "gengage-global-toast gengage-global-toast--error", r.setAttribute("role", "status"), r.setAttribute("aria-live", "polite");
|
|
323
375
|
const o = document.createElement("div");
|
|
324
|
-
o.className = "gengage-global-toast-title", o.textContent =
|
|
376
|
+
o.className = "gengage-global-toast-title", o.textContent = Yt(e.source);
|
|
325
377
|
const i = document.createElement("div");
|
|
326
|
-
i.className = "gengage-global-toast-message", i.textContent = t, r.appendChild(o), r.appendChild(i), n.appendChild(r), n.classList.add(_e),
|
|
327
|
-
|
|
328
|
-
},
|
|
378
|
+
i.className = "gengage-global-toast-message", i.textContent = t, r.appendChild(o), r.appendChild(i), n.appendChild(r), n.classList.add(_e), J && (clearTimeout(J), J = null), J = setTimeout(() => {
|
|
379
|
+
Kt();
|
|
380
|
+
}, Xt(e.durationMs));
|
|
329
381
|
}
|
|
330
|
-
function
|
|
382
|
+
function Kt() {
|
|
331
383
|
if (typeof document > "u") return;
|
|
332
|
-
const e = document.getElementById(
|
|
333
|
-
e && (e.classList.remove(_e), e.innerHTML = "",
|
|
384
|
+
const e = document.getElementById(D);
|
|
385
|
+
e && (e.classList.remove(_e), e.innerHTML = "", J && (clearTimeout(J), J = null));
|
|
334
386
|
}
|
|
335
|
-
function
|
|
387
|
+
function Yt(e) {
|
|
336
388
|
switch (e) {
|
|
337
389
|
case "chat":
|
|
338
390
|
return "Chat warning";
|
|
@@ -344,30 +396,30 @@ function Kt(e) {
|
|
|
344
396
|
return "Connection warning";
|
|
345
397
|
}
|
|
346
398
|
}
|
|
347
|
-
function
|
|
348
|
-
const e = document.getElementById(
|
|
399
|
+
function Qt() {
|
|
400
|
+
const e = document.getElementById(D);
|
|
349
401
|
if (e instanceof HTMLElement) return e;
|
|
350
402
|
const t = document.createElement("div");
|
|
351
|
-
return t.id =
|
|
403
|
+
return t.id = D, t.className = "gengage-global-toast-root", document.body.appendChild(t), t;
|
|
352
404
|
}
|
|
353
|
-
function
|
|
354
|
-
return typeof e != "number" || !Number.isFinite(e) ?
|
|
405
|
+
function Xt(e) {
|
|
406
|
+
return typeof e != "number" || !Number.isFinite(e) ? Vt : Math.min(Bt, Math.max(Gt, Math.round(e)));
|
|
355
407
|
}
|
|
356
|
-
function
|
|
408
|
+
function en() {
|
|
357
409
|
if (document.getElementById(Ze)) return;
|
|
358
410
|
const e = document.createElement("style");
|
|
359
411
|
e.id = Ze, e.textContent = `
|
|
360
|
-
#${
|
|
412
|
+
#${D} {
|
|
361
413
|
position: fixed;
|
|
362
414
|
top: 16px;
|
|
363
415
|
right: 16px;
|
|
364
416
|
z-index: 2147483646;
|
|
365
417
|
pointer-events: none;
|
|
366
418
|
}
|
|
367
|
-
#${
|
|
419
|
+
#${D}.${_e} {
|
|
368
420
|
pointer-events: auto;
|
|
369
421
|
}
|
|
370
|
-
#${
|
|
422
|
+
#${D} .gengage-global-toast {
|
|
371
423
|
min-width: 260px;
|
|
372
424
|
max-width: min(92vw, 420px);
|
|
373
425
|
border-radius: 12px;
|
|
@@ -382,12 +434,12 @@ function Xt() {
|
|
|
382
434
|
line-height: 1.4;
|
|
383
435
|
animation: gengage-global-toast-in 180ms ease-out forwards;
|
|
384
436
|
}
|
|
385
|
-
#${
|
|
437
|
+
#${D} .gengage-global-toast-title {
|
|
386
438
|
margin: 0 0 4px;
|
|
387
439
|
font-size: 12px;
|
|
388
440
|
font-weight: 700;
|
|
389
441
|
}
|
|
390
|
-
#${
|
|
442
|
+
#${D} .gengage-global-toast-message {
|
|
391
443
|
margin: 0;
|
|
392
444
|
font-weight: 500;
|
|
393
445
|
}
|
|
@@ -403,7 +455,7 @@ function Xt() {
|
|
|
403
455
|
}
|
|
404
456
|
`, document.head.appendChild(e);
|
|
405
457
|
}
|
|
406
|
-
class
|
|
458
|
+
class ic {
|
|
407
459
|
constructor() {
|
|
408
460
|
this.isVisible = !1, this.isInitialised = !1, this._handlers = /* @__PURE__ */ new Map(), this._cleanups = [], this._ownsRoot = !1, this._destroying = !1;
|
|
409
461
|
}
|
|
@@ -415,13 +467,13 @@ class ec {
|
|
|
415
467
|
console.warn("[gengage] Widget already initialised. Call update() instead.");
|
|
416
468
|
return;
|
|
417
469
|
}
|
|
418
|
-
const n =
|
|
470
|
+
const n = qt(t.theme);
|
|
419
471
|
this.config = {
|
|
420
472
|
...t,
|
|
421
473
|
theme: n,
|
|
422
474
|
session: Jt(t.session)
|
|
423
|
-
}, this.root = this._resolveMount(t.mountTarget), this._applyTheme(n),
|
|
424
|
-
const r =
|
|
475
|
+
}, this.root = this._resolveMount(t.mountTarget), this._applyTheme(n), Wt();
|
|
476
|
+
const r = ee("gengage:context:update", (o) => this.update(o));
|
|
425
477
|
this._cleanups.push(r);
|
|
426
478
|
try {
|
|
427
479
|
await this.onInit(this.config);
|
|
@@ -498,19 +550,19 @@ class ec {
|
|
|
498
550
|
if (t) {
|
|
499
551
|
for (const [n, r] of Object.entries(t))
|
|
500
552
|
if (r !== void 0) {
|
|
501
|
-
const o = n.startsWith("--") ? n : `--gengage-${
|
|
553
|
+
const o = n.startsWith("--") ? n : `--gengage-${tn(n)}`;
|
|
502
554
|
this.root.style.setProperty(o, r);
|
|
503
555
|
}
|
|
504
556
|
}
|
|
505
557
|
}
|
|
506
558
|
}
|
|
507
|
-
function
|
|
559
|
+
function tn(e) {
|
|
508
560
|
return e.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
509
561
|
}
|
|
510
562
|
function Ie(e) {
|
|
511
563
|
return typeof e == "object" && e !== null && typeof e.type == "string";
|
|
512
564
|
}
|
|
513
|
-
function
|
|
565
|
+
function nn(e) {
|
|
514
566
|
const t = [];
|
|
515
567
|
let n = 0, r = !1, o = !1, i = 0;
|
|
516
568
|
for (let s = 0; s < e.length; s++) {
|
|
@@ -540,7 +592,7 @@ function Oe(e, t) {
|
|
|
540
592
|
const o = JSON.parse(r);
|
|
541
593
|
return Ie(o) ? (t.onEvent(o), o.type === "done" ? (t.onDone?.(), !0) : !1) : !1;
|
|
542
594
|
} catch {
|
|
543
|
-
const o =
|
|
595
|
+
const o = nn(r);
|
|
544
596
|
if (o.length > 1) {
|
|
545
597
|
for (const i of o)
|
|
546
598
|
try {
|
|
@@ -555,7 +607,7 @@ function Oe(e, t) {
|
|
|
555
607
|
return !1;
|
|
556
608
|
}
|
|
557
609
|
}
|
|
558
|
-
async function
|
|
610
|
+
async function rn(e, t) {
|
|
559
611
|
if (!e.ok) {
|
|
560
612
|
t.onError?.(new Error(`HTTP ${e.status}: ${e.statusText}`));
|
|
561
613
|
return;
|
|
@@ -573,23 +625,23 @@ async function nn(e, t) {
|
|
|
573
625
|
const c = n.read();
|
|
574
626
|
let u;
|
|
575
627
|
const l = await (i > 0 ? Promise.race([
|
|
576
|
-
c.then((
|
|
577
|
-
new Promise((
|
|
578
|
-
u = setTimeout(() =>
|
|
628
|
+
c.then((y) => (clearTimeout(u), y)),
|
|
629
|
+
new Promise((y) => {
|
|
630
|
+
u = setTimeout(() => y(s), i);
|
|
579
631
|
})
|
|
580
632
|
]) : c);
|
|
581
633
|
if (l === s) {
|
|
582
634
|
a = !0, await n.cancel();
|
|
583
635
|
break;
|
|
584
636
|
}
|
|
585
|
-
const { done: f, value:
|
|
637
|
+
const { done: f, value: p } = l;
|
|
586
638
|
if (f) break;
|
|
587
|
-
o += r.decode(
|
|
588
|
-
const
|
|
639
|
+
o += r.decode(p, { stream: !0 });
|
|
640
|
+
const g = o.split(`
|
|
589
641
|
`);
|
|
590
|
-
o =
|
|
591
|
-
for (const
|
|
592
|
-
if (Oe(
|
|
642
|
+
o = g.pop() ?? "";
|
|
643
|
+
for (const y of g)
|
|
644
|
+
if (Oe(y, t)) return;
|
|
593
645
|
}
|
|
594
646
|
if (o.trim() && Oe(o, t))
|
|
595
647
|
return;
|
|
@@ -601,8 +653,8 @@ async function nn(e, t) {
|
|
|
601
653
|
}
|
|
602
654
|
t.onDone?.();
|
|
603
655
|
}
|
|
604
|
-
function
|
|
605
|
-
const r = new AbortController(), o = n.signal ?
|
|
656
|
+
function sc(e, t, n) {
|
|
657
|
+
const r = new AbortController(), o = n.signal ? on([n.signal, r.signal]) : r.signal;
|
|
606
658
|
return fetch(e, {
|
|
607
659
|
method: "POST",
|
|
608
660
|
headers: {
|
|
@@ -611,11 +663,11 @@ function tc(e, t, n) {
|
|
|
611
663
|
},
|
|
612
664
|
body: JSON.stringify(t),
|
|
613
665
|
signal: o
|
|
614
|
-
}).then((i) =>
|
|
666
|
+
}).then((i) => rn(i, { ...n, signal: o })).catch((i) => {
|
|
615
667
|
i instanceof DOMException && i.name === "AbortError" || n.onError?.(i instanceof Error ? i : new Error(String(i)));
|
|
616
668
|
}), r;
|
|
617
669
|
}
|
|
618
|
-
function
|
|
670
|
+
function on(e) {
|
|
619
671
|
const t = new AbortController(), n = [];
|
|
620
672
|
for (const r of e) {
|
|
621
673
|
if (r.aborted)
|
|
@@ -631,84 +683,84 @@ function rn(e) {
|
|
|
631
683
|
{ once: !0 }
|
|
632
684
|
), t.signal;
|
|
633
685
|
}
|
|
634
|
-
function
|
|
686
|
+
function ac(e) {
|
|
635
687
|
if (typeof e.type != "string") return null;
|
|
636
|
-
if (
|
|
688
|
+
if (sn(e))
|
|
637
689
|
return e;
|
|
638
690
|
const n = e;
|
|
639
691
|
switch (n.type) {
|
|
640
692
|
case "outputText":
|
|
641
|
-
return sn(n);
|
|
642
|
-
case "suggestedActions":
|
|
643
693
|
return an(n);
|
|
644
|
-
case "
|
|
694
|
+
case "suggestedActions":
|
|
645
695
|
return cn(n);
|
|
646
|
-
case "
|
|
696
|
+
case "productList":
|
|
647
697
|
return un(n);
|
|
648
|
-
case "
|
|
698
|
+
case "productDetails":
|
|
649
699
|
return dn(n);
|
|
650
|
-
case "
|
|
700
|
+
case "productDetailsSimilars":
|
|
651
701
|
return ln(n);
|
|
652
|
-
case "
|
|
702
|
+
case "comparisonTable":
|
|
653
703
|
return fn(n);
|
|
704
|
+
case "context":
|
|
705
|
+
return mn(n);
|
|
654
706
|
case "chatStreamEnd":
|
|
655
|
-
return
|
|
707
|
+
return _n();
|
|
656
708
|
case "loading":
|
|
657
|
-
return
|
|
709
|
+
return yn(n);
|
|
658
710
|
case "panelLoading":
|
|
659
|
-
return
|
|
711
|
+
return vn(n);
|
|
660
712
|
case "similarLoading":
|
|
661
|
-
return
|
|
713
|
+
return wn(n);
|
|
662
714
|
case "redirect":
|
|
663
|
-
return
|
|
715
|
+
return bn(n);
|
|
664
716
|
case "error":
|
|
665
|
-
return
|
|
717
|
+
return kn(n);
|
|
666
718
|
case "dummy":
|
|
667
|
-
return
|
|
719
|
+
return zn();
|
|
668
720
|
case "launcherAction":
|
|
669
|
-
return
|
|
721
|
+
return $n(n);
|
|
670
722
|
case "text":
|
|
671
723
|
return ye(n);
|
|
672
724
|
case "productItem":
|
|
673
|
-
return
|
|
725
|
+
return Sn(n);
|
|
674
726
|
case "text_image":
|
|
675
727
|
return tt(n);
|
|
676
728
|
case "quick_qna":
|
|
677
729
|
return nt(n);
|
|
678
730
|
case "reviewHighlights":
|
|
679
|
-
return
|
|
731
|
+
return En(n);
|
|
680
732
|
case "aiProductSuggestions":
|
|
681
|
-
return
|
|
733
|
+
return In(n);
|
|
682
734
|
case "aiProductGroupings":
|
|
683
|
-
return
|
|
735
|
+
return On(n);
|
|
684
736
|
case "aiSuggestedSearches":
|
|
685
|
-
return
|
|
737
|
+
return Pn(n);
|
|
686
738
|
case "prosAndCons":
|
|
687
|
-
return
|
|
739
|
+
return Zn(n);
|
|
688
740
|
case "getGroundingReview":
|
|
689
|
-
return
|
|
741
|
+
return An(n);
|
|
690
742
|
case "voice":
|
|
691
|
-
return
|
|
743
|
+
return Cn(n);
|
|
692
744
|
case "visitorDataResponse":
|
|
693
|
-
return
|
|
745
|
+
return Tn(n);
|
|
694
746
|
case "productListPreview":
|
|
695
|
-
return
|
|
747
|
+
return Nn();
|
|
696
748
|
case "groupList":
|
|
697
|
-
return
|
|
749
|
+
return Rn(n);
|
|
698
750
|
case "formGetInfo":
|
|
699
751
|
case "formTestDrive":
|
|
700
752
|
case "formServiceRequest":
|
|
701
753
|
case "launchFormPage":
|
|
702
|
-
return
|
|
754
|
+
return jn(n);
|
|
703
755
|
case "launcherContent":
|
|
704
|
-
return
|
|
756
|
+
return Ln(n);
|
|
705
757
|
case "handoff":
|
|
706
|
-
return
|
|
758
|
+
return Dn(n);
|
|
707
759
|
default:
|
|
708
760
|
return null;
|
|
709
761
|
}
|
|
710
762
|
}
|
|
711
|
-
function
|
|
763
|
+
function sn(e) {
|
|
712
764
|
const t = e.type;
|
|
713
765
|
if (typeof t != "string") return !1;
|
|
714
766
|
switch (t) {
|
|
@@ -719,11 +771,11 @@ function on(e) {
|
|
|
719
771
|
case "ui_spec": {
|
|
720
772
|
const n = e.widget;
|
|
721
773
|
if (n !== "chat" && n !== "qna" && n !== "simrel") return !1;
|
|
722
|
-
const r =
|
|
723
|
-
return r ? typeof r.root == "string" &&
|
|
774
|
+
const r = j(e.spec);
|
|
775
|
+
return r ? typeof r.root == "string" && j(r.elements) !== null : !1;
|
|
724
776
|
}
|
|
725
777
|
case "action": {
|
|
726
|
-
const n =
|
|
778
|
+
const n = j(e.action);
|
|
727
779
|
return n !== null && typeof n.kind == "string";
|
|
728
780
|
}
|
|
729
781
|
case "error":
|
|
@@ -734,8 +786,8 @@ function on(e) {
|
|
|
734
786
|
return !1;
|
|
735
787
|
}
|
|
736
788
|
}
|
|
737
|
-
function
|
|
738
|
-
const t =
|
|
789
|
+
function an(e) {
|
|
790
|
+
const t = w(e.payload.text, e.payload.plain_text) ?? "", n = w(e.payload.plain_text, e.payload.text) ?? t;
|
|
739
791
|
if (e.payload.is_error)
|
|
740
792
|
return {
|
|
741
793
|
type: "error",
|
|
@@ -755,9 +807,9 @@ function sn(e) {
|
|
|
755
807
|
const s = e.payload.conversation_mode;
|
|
756
808
|
return typeof s == "string" && s && (r.conversationMode = s), r;
|
|
757
809
|
}
|
|
758
|
-
function
|
|
810
|
+
function cn(e) {
|
|
759
811
|
const t = (e.payload.actions ?? []).map((n) => {
|
|
760
|
-
const r =
|
|
812
|
+
const r = w(n.title) ?? "", o = R(n.requestDetails, r), i = o ? {
|
|
761
813
|
label: r,
|
|
762
814
|
action: o
|
|
763
815
|
} : null;
|
|
@@ -765,13 +817,13 @@ function an(e) {
|
|
|
765
817
|
});
|
|
766
818
|
return rt(t.filter(it), "chat");
|
|
767
819
|
}
|
|
768
|
-
function
|
|
820
|
+
function un(e) {
|
|
769
821
|
const t = ot(e.payload.product_list ?? [], "chat");
|
|
770
822
|
t.panelHint = "panel";
|
|
771
823
|
const n = t.spec.elements[t.spec.root];
|
|
772
|
-
return n && (typeof e.payload.offset == "number" && (n.props = { ...n.props, offset: e.payload.offset }), typeof e.payload.end_of_list == "boolean" && (n.props = { ...n.props, endOfList: e.payload.end_of_list })), t;
|
|
824
|
+
return n && (typeof e.payload.offset == "number" && (n.props = { ...n.props, offset: e.payload.offset }), typeof e.payload.end_of_list == "boolean" && (n.props = { ...n.props, endOfList: e.payload.end_of_list }), typeof e.payload.title == "string" && (n.props = { ...n.props, panelTitle: e.payload.title })), t;
|
|
773
825
|
}
|
|
774
|
-
function
|
|
826
|
+
function dn(e) {
|
|
775
827
|
const t = e.payload.productDetails;
|
|
776
828
|
return t ? {
|
|
777
829
|
type: "ui_spec",
|
|
@@ -781,59 +833,57 @@ function un(e) {
|
|
|
781
833
|
elements: {
|
|
782
834
|
root: {
|
|
783
835
|
type: "ProductDetailsPanel",
|
|
784
|
-
props: { product:
|
|
836
|
+
props: { product: M(t) }
|
|
785
837
|
}
|
|
786
838
|
}
|
|
787
839
|
},
|
|
788
840
|
panelHint: "panel"
|
|
789
|
-
} :
|
|
841
|
+
} : Mn("chat");
|
|
790
842
|
}
|
|
791
|
-
function
|
|
843
|
+
function ln(e) {
|
|
792
844
|
const t = ot(e.payload.similarProducts ?? [], "chat"), n = t.spec.elements[t.spec.root];
|
|
793
845
|
return n && (n.props = { ...n.props, similarsAppend: !0 }), { ...t, panelHint: "panel" };
|
|
794
846
|
}
|
|
795
|
-
function
|
|
796
|
-
const t = e.payload.multiple_product_details ?? [], n = e.payload
|
|
847
|
+
function fn(e) {
|
|
848
|
+
const t = e.payload.multiple_product_details ?? [], n = e.payload, r = {
|
|
849
|
+
key_differences: n.key_differences,
|
|
850
|
+
recommended_choice: n.recommended_choice,
|
|
851
|
+
recommended_choice_sku: n.recommended_choice_sku,
|
|
852
|
+
special_considerations: n.special_considerations,
|
|
853
|
+
criteria_view: n.criteria_view,
|
|
854
|
+
criteria_view_short: n.criteria_view_short,
|
|
855
|
+
compared_field_names: n.compared_field_names,
|
|
856
|
+
winner_product: n.winner_product,
|
|
857
|
+
winner_hits: n.winner_hits,
|
|
858
|
+
...e.payload.product_comparison_framework ?? {}
|
|
859
|
+
}, o = e.payload.table, i = e.payload.features_list, s = [];
|
|
797
860
|
for (const m of t) {
|
|
798
|
-
const
|
|
799
|
-
|
|
861
|
+
const k = M(m);
|
|
862
|
+
s.push(k);
|
|
800
863
|
}
|
|
801
|
-
const
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
const a = s ? o.find((m) => m.sku === s) ?? o[0] : o[0], c = [];
|
|
814
|
-
if (Array.isArray(n?.key_differences))
|
|
815
|
-
for (const m of n.key_differences)
|
|
816
|
-
typeof m == "string" && c.push(m);
|
|
817
|
-
const u = [];
|
|
818
|
-
if (n?.special_considerations)
|
|
819
|
-
for (const m of n.special_considerations)
|
|
820
|
-
typeof m == "string" && u.push(m);
|
|
821
|
-
const l = n?.recommended_choice, f = n?.winner_hits, g = {};
|
|
822
|
-
for (const m of o) {
|
|
823
|
-
const v = m.sku;
|
|
824
|
-
v && (g[v] = {
|
|
825
|
-
title: m.name ?? v,
|
|
864
|
+
const a = pn(o, s, r, i);
|
|
865
|
+
let c;
|
|
866
|
+
r?.recommended_choice_sku ? c = r.recommended_choice_sku : r?.winner_product && r.winner_product.length > 0 && (c = r.winner_product[0]?.product_detail?.sku ?? r.winner_product[0]?.sku);
|
|
867
|
+
const u = c ? s.find((m) => m.sku === c) ?? s[0] : s[0], l = [];
|
|
868
|
+
if (Array.isArray(r?.key_differences))
|
|
869
|
+
for (const m of r.key_differences)
|
|
870
|
+
typeof m == "string" && l.push(m);
|
|
871
|
+
const f = qn(r?.special_considerations), p = r?.recommended_choice, g = r?.winner_hits, y = {};
|
|
872
|
+
for (const m of s) {
|
|
873
|
+
const k = m.sku;
|
|
874
|
+
k && (y[k] = {
|
|
875
|
+
title: m.name ?? k,
|
|
826
876
|
type: "launchSingleProduct",
|
|
827
|
-
payload: { sku:
|
|
877
|
+
payload: { sku: k }
|
|
828
878
|
});
|
|
829
879
|
}
|
|
830
|
-
const
|
|
831
|
-
products:
|
|
832
|
-
attributes:
|
|
833
|
-
highlights:
|
|
834
|
-
productActions:
|
|
880
|
+
const _ = {
|
|
881
|
+
products: s,
|
|
882
|
+
attributes: a,
|
|
883
|
+
highlights: l,
|
|
884
|
+
productActions: y
|
|
835
885
|
};
|
|
836
|
-
return
|
|
886
|
+
return u && (_.recommended = u), f.length > 0 && (_.specialCases = f), p && (_.recommendedText = p), g && (_.winnerHits = g), typeof r?.key_differences == "string" && (_.keyDifferencesHtml = r.key_differences), r?.special_considerations && (_.specialConsiderations = r.special_considerations), {
|
|
837
887
|
type: "ui_spec",
|
|
838
888
|
widget: "chat",
|
|
839
889
|
spec: {
|
|
@@ -841,14 +891,56 @@ function ln(e) {
|
|
|
841
891
|
elements: {
|
|
842
892
|
root: {
|
|
843
893
|
type: "ComparisonTable",
|
|
844
|
-
props:
|
|
894
|
+
props: _
|
|
845
895
|
}
|
|
846
896
|
}
|
|
847
897
|
},
|
|
848
898
|
panelHint: "panel"
|
|
849
899
|
};
|
|
850
900
|
}
|
|
851
|
-
function
|
|
901
|
+
function pn(e, t, n, r) {
|
|
902
|
+
if (!e) return [];
|
|
903
|
+
const o = Object.entries(e);
|
|
904
|
+
if (o.length === 0) return [];
|
|
905
|
+
const i = o[0]?.[1];
|
|
906
|
+
if (Array.isArray(i)) {
|
|
907
|
+
const p = n.criteria_view ?? n.criteria_view_short ?? {}, g = n.compared_field_names ?? Object.keys(e), y = [];
|
|
908
|
+
for (const _ of g) {
|
|
909
|
+
const m = e[_];
|
|
910
|
+
if (!m || !Array.isArray(m)) continue;
|
|
911
|
+
const k = p[_] ?? _;
|
|
912
|
+
y.push({ label: k, values: m.map((I) => typeof I == "string" ? I : String(I ?? "")) });
|
|
913
|
+
}
|
|
914
|
+
return y;
|
|
915
|
+
}
|
|
916
|
+
const s = e, a = t.map((p) => String(p.sku ?? "")).filter((p) => p.length > 0), c = n.criteria_view ?? n.criteria_view_short ?? {}, l = (r && r.length > 0 ? r : n.compared_field_names && n.compared_field_names.length > 0 ? n.compared_field_names : gn(s)).filter(
|
|
917
|
+
(p) => p !== "name" && p !== "name_short" && !p.endsWith("_short")
|
|
918
|
+
), f = [];
|
|
919
|
+
for (const p of l) {
|
|
920
|
+
const g = a.map((_) => {
|
|
921
|
+
const m = s[_];
|
|
922
|
+
if (!m || typeof m != "object") return "";
|
|
923
|
+
const k = m[`${p}_short`], I = m[p];
|
|
924
|
+
return hn(k ?? I);
|
|
925
|
+
});
|
|
926
|
+
if (g.every((_) => _.length === 0)) continue;
|
|
927
|
+
const y = c[p] ?? p;
|
|
928
|
+
f.push({ label: y, values: g });
|
|
929
|
+
}
|
|
930
|
+
return f;
|
|
931
|
+
}
|
|
932
|
+
function gn(e) {
|
|
933
|
+
const t = [], n = /* @__PURE__ */ new Set();
|
|
934
|
+
for (const r of Object.values(e))
|
|
935
|
+
if (!(!r || typeof r != "object"))
|
|
936
|
+
for (const o of Object.keys(r))
|
|
937
|
+
n.has(o) || (n.add(o), t.push(o));
|
|
938
|
+
return t;
|
|
939
|
+
}
|
|
940
|
+
function hn(e) {
|
|
941
|
+
return typeof e == "string" ? e : typeof e == "number" || typeof e == "boolean" ? String(e) : "";
|
|
942
|
+
}
|
|
943
|
+
function mn(e) {
|
|
852
944
|
return {
|
|
853
945
|
type: "metadata",
|
|
854
946
|
sessionId: "",
|
|
@@ -860,10 +952,10 @@ function fn(e) {
|
|
|
860
952
|
}
|
|
861
953
|
};
|
|
862
954
|
}
|
|
863
|
-
function
|
|
955
|
+
function _n() {
|
|
864
956
|
return { type: "done" };
|
|
865
957
|
}
|
|
866
|
-
function
|
|
958
|
+
function yn(e) {
|
|
867
959
|
return {
|
|
868
960
|
type: "metadata",
|
|
869
961
|
sessionId: "",
|
|
@@ -876,7 +968,7 @@ function gn(e) {
|
|
|
876
968
|
}
|
|
877
969
|
};
|
|
878
970
|
}
|
|
879
|
-
function
|
|
971
|
+
function vn(e) {
|
|
880
972
|
return {
|
|
881
973
|
type: "metadata",
|
|
882
974
|
sessionId: "",
|
|
@@ -889,7 +981,7 @@ function hn(e) {
|
|
|
889
981
|
}
|
|
890
982
|
};
|
|
891
983
|
}
|
|
892
|
-
function
|
|
984
|
+
function wn(e) {
|
|
893
985
|
return {
|
|
894
986
|
type: "metadata",
|
|
895
987
|
sessionId: "",
|
|
@@ -902,8 +994,8 @@ function mn(e) {
|
|
|
902
994
|
}
|
|
903
995
|
};
|
|
904
996
|
}
|
|
905
|
-
function
|
|
906
|
-
const t =
|
|
997
|
+
function bn(e) {
|
|
998
|
+
const t = w(e.payload.url);
|
|
907
999
|
return t ? {
|
|
908
1000
|
type: "action",
|
|
909
1001
|
action: {
|
|
@@ -917,18 +1009,18 @@ function _n(e) {
|
|
|
917
1009
|
model: "",
|
|
918
1010
|
meta: {
|
|
919
1011
|
redirect: e.payload,
|
|
920
|
-
redirectTarget:
|
|
1012
|
+
redirectTarget: w(e.payload.to)
|
|
921
1013
|
}
|
|
922
1014
|
};
|
|
923
1015
|
}
|
|
924
|
-
function
|
|
1016
|
+
function kn(e) {
|
|
925
1017
|
return {
|
|
926
1018
|
type: "error",
|
|
927
1019
|
code: "BACKEND_ERROR",
|
|
928
|
-
message:
|
|
1020
|
+
message: w(e.payload?.text, e.payload?.message, e.payload?.error) ?? "Backend returned an error"
|
|
929
1021
|
};
|
|
930
1022
|
}
|
|
931
|
-
function
|
|
1023
|
+
function zn(e) {
|
|
932
1024
|
return {
|
|
933
1025
|
type: "metadata",
|
|
934
1026
|
sessionId: "",
|
|
@@ -938,7 +1030,7 @@ function vn(e) {
|
|
|
938
1030
|
}
|
|
939
1031
|
};
|
|
940
1032
|
}
|
|
941
|
-
function
|
|
1033
|
+
function $n(e) {
|
|
942
1034
|
const t = e.payload ?? {};
|
|
943
1035
|
if (Array.isArray(t.action_list)) {
|
|
944
1036
|
const i = {
|
|
@@ -948,7 +1040,7 @@ function wn(e) {
|
|
|
948
1040
|
payload: i
|
|
949
1041
|
});
|
|
950
1042
|
}
|
|
951
|
-
const r =
|
|
1043
|
+
const r = j(t.action);
|
|
952
1044
|
if (r) {
|
|
953
1045
|
const i = {
|
|
954
1046
|
action: r
|
|
@@ -959,7 +1051,7 @@ function wn(e) {
|
|
|
959
1051
|
}
|
|
960
1052
|
const o = typeof t.text == "string" ? t.text : "";
|
|
961
1053
|
if (o) {
|
|
962
|
-
const i = { text: o }, s = typeof t.type == "string" ? t.type : void 0, a = typeof t.theme == "string" ? t.theme : void 0, c =
|
|
1054
|
+
const i = { text: o }, s = typeof t.type == "string" ? t.type : void 0, a = typeof t.theme == "string" ? t.theme : void 0, c = j(t.payload) ?? void 0;
|
|
963
1055
|
return s !== void 0 && (i.type = s), c !== void 0 && (i.payload = c), a !== void 0 && (i.theme = a), ye({
|
|
964
1056
|
payload: i
|
|
965
1057
|
});
|
|
@@ -975,7 +1067,7 @@ function wn(e) {
|
|
|
975
1067
|
}
|
|
976
1068
|
function ye(e) {
|
|
977
1069
|
const t = {
|
|
978
|
-
text:
|
|
1070
|
+
text: w(e.payload.text) ?? ""
|
|
979
1071
|
};
|
|
980
1072
|
return typeof e.payload.theme == "string" && (t.theme = e.payload.theme), e.payload.payload !== void 0 && (t.payload = e.payload.payload), {
|
|
981
1073
|
type: "ui_spec",
|
|
@@ -991,11 +1083,11 @@ function ye(e) {
|
|
|
991
1083
|
}
|
|
992
1084
|
};
|
|
993
1085
|
}
|
|
994
|
-
function
|
|
995
|
-
return
|
|
1086
|
+
function Sn(e) {
|
|
1087
|
+
return Un(e.payload, "qna");
|
|
996
1088
|
}
|
|
997
1089
|
function tt(e) {
|
|
998
|
-
const t =
|
|
1090
|
+
const t = w(e.payload.text) ?? "", n = R(e.payload.action, t);
|
|
999
1091
|
if (n) {
|
|
1000
1092
|
const o = {
|
|
1001
1093
|
label: t || n.title,
|
|
@@ -1024,7 +1116,7 @@ function tt(e) {
|
|
|
1024
1116
|
}
|
|
1025
1117
|
function nt(e) {
|
|
1026
1118
|
const t = (e.payload.action_list ?? []).map((n) => {
|
|
1027
|
-
const r =
|
|
1119
|
+
const r = w(n.title) ?? "", o = R(n.requestDetails, r), i = o ? {
|
|
1028
1120
|
label: r,
|
|
1029
1121
|
action: o
|
|
1030
1122
|
} : null;
|
|
@@ -1032,7 +1124,7 @@ function nt(e) {
|
|
|
1032
1124
|
});
|
|
1033
1125
|
return rt(t.filter(it), "qna");
|
|
1034
1126
|
}
|
|
1035
|
-
function
|
|
1127
|
+
function En(e) {
|
|
1036
1128
|
const n = { reviews: (e.payload.reviews ?? []).map((r) => {
|
|
1037
1129
|
const o = {};
|
|
1038
1130
|
return typeof r.review_class == "string" && (o.review_class = r.review_class), typeof r.review_text == "string" && (o.review_text = r.review_text), (typeof r.review_rating == "string" || typeof r.review_rating == "number") && (o.review_rating = r.review_rating), typeof r.review_tag == "string" && (o.review_tag = r.review_tag), o;
|
|
@@ -1051,7 +1143,7 @@ function kn(e) {
|
|
|
1051
1143
|
}
|
|
1052
1144
|
};
|
|
1053
1145
|
}
|
|
1054
|
-
function
|
|
1146
|
+
function Zn(e) {
|
|
1055
1147
|
const t = {};
|
|
1056
1148
|
return Array.isArray(e.payload.pros) && (t.pros = e.payload.pros), Array.isArray(e.payload.cons) && (t.cons = e.payload.cons), typeof e.payload.product_name == "string" && (t.productName = e.payload.product_name), {
|
|
1057
1149
|
type: "ui_spec",
|
|
@@ -1067,7 +1159,7 @@ function zn(e) {
|
|
|
1067
1159
|
}
|
|
1068
1160
|
};
|
|
1069
1161
|
}
|
|
1070
|
-
function
|
|
1162
|
+
function Tn(e) {
|
|
1071
1163
|
return {
|
|
1072
1164
|
type: "metadata",
|
|
1073
1165
|
sessionId: "",
|
|
@@ -1077,14 +1169,14 @@ function $n(e) {
|
|
|
1077
1169
|
}
|
|
1078
1170
|
};
|
|
1079
1171
|
}
|
|
1080
|
-
function
|
|
1172
|
+
function In(e) {
|
|
1081
1173
|
const t = e.payload.product_suggestions ?? [], n = [];
|
|
1082
1174
|
for (let r = 0; r < t.length; r++) {
|
|
1083
1175
|
const o = t[r];
|
|
1084
1176
|
if (!o) continue;
|
|
1085
|
-
const i =
|
|
1177
|
+
const i = Fn(o);
|
|
1086
1178
|
if (!i) continue;
|
|
1087
|
-
const s = { product: i }, a =
|
|
1179
|
+
const s = { product: i }, a = R(o.requestDetails, i.name);
|
|
1088
1180
|
a && (s.action = a), typeof o.role == "string" && (s.role = o.role), typeof o.reason == "string" && (s.reason = o.reason), typeof o.review_highlight == "string" && (s.reviewHighlight = o.review_highlight), Array.isArray(o.labels) && (s.labels = o.labels), typeof o.expert_quality_score == "number" && (s.expertQualityScore = o.expert_quality_score), n.push(s);
|
|
1089
1181
|
}
|
|
1090
1182
|
return n.length === 0 ? {
|
|
@@ -1108,12 +1200,12 @@ function Sn(e) {
|
|
|
1108
1200
|
}
|
|
1109
1201
|
};
|
|
1110
1202
|
}
|
|
1111
|
-
function
|
|
1203
|
+
function On(e) {
|
|
1112
1204
|
const t = e.payload.product_groupings ?? [], n = [];
|
|
1113
1205
|
for (let r = 0; r < t.length; r++) {
|
|
1114
1206
|
const o = t[r];
|
|
1115
1207
|
if (!o) continue;
|
|
1116
|
-
const i =
|
|
1208
|
+
const i = w(o.name) ?? "", s = o.sku && o.sku.length > 0 ? { type: "findSimilar", payload: { sku: o.sku } } : void 0, a = R(o.requestDetails ?? s, i);
|
|
1117
1209
|
if (!a) continue;
|
|
1118
1210
|
const c = { name: i, action: a };
|
|
1119
1211
|
if (Array.isArray(o.labels)) {
|
|
@@ -1143,21 +1235,23 @@ function En(e) {
|
|
|
1143
1235
|
}
|
|
1144
1236
|
};
|
|
1145
1237
|
}
|
|
1146
|
-
function
|
|
1238
|
+
function Pn(e) {
|
|
1147
1239
|
const t = e.payload.suggested_searches ?? [], n = [];
|
|
1148
1240
|
for (let r = 0; r < t.length; r++) {
|
|
1149
1241
|
const o = t[r];
|
|
1150
1242
|
if (!o) continue;
|
|
1151
|
-
const i =
|
|
1152
|
-
a && (s.text = a)
|
|
1153
|
-
const c =
|
|
1154
|
-
|
|
1155
|
-
const
|
|
1156
|
-
|
|
1157
|
-
const
|
|
1158
|
-
|
|
1159
|
-
const
|
|
1160
|
-
|
|
1243
|
+
const i = w(o.short_name, o.chosen_attribute, o.detailed_user_message) ?? `Arama ${r + 1}`, s = {}, a = w(o.detailed_user_message);
|
|
1244
|
+
a && (s.text = a);
|
|
1245
|
+
const c = j(o.requestDetails), u = j(c?.payload), l = u?.group_skus;
|
|
1246
|
+
o.group_skus && Array.isArray(o.group_skus) ? s.group_skus = o.group_skus : Array.isArray(l) && (s.group_skus = l.filter((I) => typeof I == "string"));
|
|
1247
|
+
const f = w(o.sku, o.representative_product_sku, u?.sku);
|
|
1248
|
+
f && (s.sku = f), s.is_suggested_text = 1;
|
|
1249
|
+
const p = { type: "inputText", payload: s }, g = R(o.requestDetails, i), y = g?.type === "findSimilar" && typeof s.text == "string" ? R(p, i) : g ?? R(p, i);
|
|
1250
|
+
if (!y) continue;
|
|
1251
|
+
const _ = { shortName: i, action: y }, m = w(o.detailed_user_message);
|
|
1252
|
+
m && m !== i && (_.detailedMessage = m);
|
|
1253
|
+
const k = w(o.why_different);
|
|
1254
|
+
k && (_.whyDifferent = k), typeof o.image == "string" && (_.image = o.image), n.push(_);
|
|
1161
1255
|
}
|
|
1162
1256
|
return n.length === 0 ? {
|
|
1163
1257
|
type: "metadata",
|
|
@@ -1180,10 +1274,10 @@ function Zn(e) {
|
|
|
1180
1274
|
}
|
|
1181
1275
|
};
|
|
1182
1276
|
}
|
|
1183
|
-
function
|
|
1184
|
-
const t =
|
|
1277
|
+
function An(e) {
|
|
1278
|
+
const t = R(
|
|
1185
1279
|
e.payload.requestDetails,
|
|
1186
|
-
|
|
1280
|
+
w(e.payload.review_count, e.payload.text, e.payload.title) ?? "Urun yorumlarini goster"
|
|
1187
1281
|
);
|
|
1188
1282
|
if (!t)
|
|
1189
1283
|
return {
|
|
@@ -1209,7 +1303,7 @@ function Tn(e) {
|
|
|
1209
1303
|
}
|
|
1210
1304
|
};
|
|
1211
1305
|
}
|
|
1212
|
-
function
|
|
1306
|
+
function Nn() {
|
|
1213
1307
|
return {
|
|
1214
1308
|
type: "metadata",
|
|
1215
1309
|
sessionId: "",
|
|
@@ -1219,7 +1313,7 @@ function In() {
|
|
|
1219
1313
|
}
|
|
1220
1314
|
};
|
|
1221
1315
|
}
|
|
1222
|
-
function
|
|
1316
|
+
function Cn(e) {
|
|
1223
1317
|
return {
|
|
1224
1318
|
type: "metadata",
|
|
1225
1319
|
sessionId: "",
|
|
@@ -1229,17 +1323,17 @@ function On(e) {
|
|
|
1229
1323
|
}
|
|
1230
1324
|
};
|
|
1231
1325
|
}
|
|
1232
|
-
function
|
|
1326
|
+
function Rn(e) {
|
|
1233
1327
|
const t = e.payload.group_list ?? [], n = [];
|
|
1234
1328
|
for (const o of t) {
|
|
1235
|
-
const i = o.group_name ?? "", s = (o.product_list ?? []).map(
|
|
1329
|
+
const i = o.group_name ?? "", s = (o.product_list ?? []).map(M);
|
|
1236
1330
|
n.push({ groupName: i, products: s });
|
|
1237
1331
|
}
|
|
1238
1332
|
const r = [];
|
|
1239
1333
|
for (const o of e.payload.filter_tags ?? []) {
|
|
1240
1334
|
const i = o.title ?? "";
|
|
1241
1335
|
if (!i) continue;
|
|
1242
|
-
const s =
|
|
1336
|
+
const s = R(o.requestDetails, i), a = { title: i };
|
|
1243
1337
|
s && (a.action = s), r.push(a);
|
|
1244
1338
|
}
|
|
1245
1339
|
return {
|
|
@@ -1257,7 +1351,7 @@ function Pn(e) {
|
|
|
1257
1351
|
panelHint: "panel"
|
|
1258
1352
|
};
|
|
1259
1353
|
}
|
|
1260
|
-
function
|
|
1354
|
+
function jn(e) {
|
|
1261
1355
|
return {
|
|
1262
1356
|
type: "metadata",
|
|
1263
1357
|
sessionId: "",
|
|
@@ -1268,7 +1362,7 @@ function An(e) {
|
|
|
1268
1362
|
}
|
|
1269
1363
|
};
|
|
1270
1364
|
}
|
|
1271
|
-
function
|
|
1365
|
+
function Dn(e) {
|
|
1272
1366
|
const t = {};
|
|
1273
1367
|
return typeof e.payload?.summary == "string" && (t.summary = e.payload.summary), Array.isArray(e.payload?.products_discussed) && (t.products_discussed = e.payload.products_discussed), typeof e.payload?.user_sentiment == "string" && (t.user_sentiment = e.payload.user_sentiment), {
|
|
1274
1368
|
type: "ui_spec",
|
|
@@ -1284,7 +1378,7 @@ function Nn(e) {
|
|
|
1284
1378
|
}
|
|
1285
1379
|
};
|
|
1286
1380
|
}
|
|
1287
|
-
function
|
|
1381
|
+
function Ln(e) {
|
|
1288
1382
|
return {
|
|
1289
1383
|
type: "metadata",
|
|
1290
1384
|
sessionId: "",
|
|
@@ -1336,7 +1430,7 @@ function ot(e, t) {
|
|
|
1336
1430
|
const s = `product-${o}`;
|
|
1337
1431
|
r.push(s), n[s] = {
|
|
1338
1432
|
type: "ProductCard",
|
|
1339
|
-
props: { product:
|
|
1433
|
+
props: { product: M(i), index: o }
|
|
1340
1434
|
};
|
|
1341
1435
|
}
|
|
1342
1436
|
return n.root = {
|
|
@@ -1349,7 +1443,7 @@ function ot(e, t) {
|
|
|
1349
1443
|
spec: { root: "root", elements: n }
|
|
1350
1444
|
};
|
|
1351
1445
|
}
|
|
1352
|
-
function
|
|
1446
|
+
function Un(e, t) {
|
|
1353
1447
|
return {
|
|
1354
1448
|
type: "ui_spec",
|
|
1355
1449
|
widget: t,
|
|
@@ -1358,13 +1452,13 @@ function Rn(e, t) {
|
|
|
1358
1452
|
elements: {
|
|
1359
1453
|
root: {
|
|
1360
1454
|
type: "ProductCard",
|
|
1361
|
-
props: { product:
|
|
1455
|
+
props: { product: M(e), index: 0 }
|
|
1362
1456
|
}
|
|
1363
1457
|
}
|
|
1364
1458
|
}
|
|
1365
1459
|
};
|
|
1366
1460
|
}
|
|
1367
|
-
function
|
|
1461
|
+
function Mn(e) {
|
|
1368
1462
|
return {
|
|
1369
1463
|
type: "ui_spec",
|
|
1370
1464
|
widget: e,
|
|
@@ -1380,40 +1474,40 @@ function Dn(e) {
|
|
|
1380
1474
|
}
|
|
1381
1475
|
};
|
|
1382
1476
|
}
|
|
1383
|
-
function
|
|
1384
|
-
const t =
|
|
1385
|
-
return
|
|
1477
|
+
function Fn(e) {
|
|
1478
|
+
const t = w(e.sku), n = w(e.short_name), r = j(e.product_item) ?? e;
|
|
1479
|
+
return xn(r, t, n);
|
|
1386
1480
|
}
|
|
1387
|
-
function
|
|
1388
|
-
const r =
|
|
1481
|
+
function xn(e, t, n) {
|
|
1482
|
+
const r = w(e.sku, t), o = w(e.name, n);
|
|
1389
1483
|
if (!r || !o) return null;
|
|
1390
1484
|
const i = {
|
|
1391
1485
|
sku: r,
|
|
1392
1486
|
name: o
|
|
1393
|
-
}, s =
|
|
1487
|
+
}, s = w(e.brand);
|
|
1394
1488
|
s && (i.brand = s);
|
|
1395
|
-
const a =
|
|
1489
|
+
const a = w(e.url);
|
|
1396
1490
|
a && (i.url = a);
|
|
1397
|
-
const c =
|
|
1491
|
+
const c = Jn(e.images);
|
|
1398
1492
|
if (c.length > 0)
|
|
1399
1493
|
i.images = c;
|
|
1400
1494
|
else {
|
|
1401
|
-
const
|
|
1402
|
-
|
|
1495
|
+
const y = w(e.image, e.image_url, e.imageUrl);
|
|
1496
|
+
y && (i.images = [y]);
|
|
1403
1497
|
}
|
|
1404
|
-
const u =
|
|
1498
|
+
const u = Y(e.price_discounted);
|
|
1405
1499
|
u !== void 0 && (i.price_discounted = u);
|
|
1406
|
-
const l =
|
|
1500
|
+
const l = Y(e.price);
|
|
1407
1501
|
l !== void 0 && (i.price = l);
|
|
1408
|
-
const f =
|
|
1502
|
+
const f = Y(e.rating);
|
|
1409
1503
|
f !== void 0 && (i.rating = f);
|
|
1410
|
-
const
|
|
1411
|
-
|
|
1412
|
-
const
|
|
1413
|
-
return
|
|
1504
|
+
const p = Y(e.review_count) ?? Y(e.reviewCount);
|
|
1505
|
+
p !== void 0 && (i.review_count = p);
|
|
1506
|
+
const g = w(e.cart_code, e.cartCode);
|
|
1507
|
+
return g && (i.cart_code = g), typeof e.in_stock == "boolean" && (i.in_stock = e.in_stock), typeof e.inStock == "boolean" && (i.in_stock = e.inStock), M(i);
|
|
1414
1508
|
}
|
|
1415
|
-
function
|
|
1416
|
-
const n =
|
|
1509
|
+
function R(e, t) {
|
|
1510
|
+
const n = j(e);
|
|
1417
1511
|
if (!n) return null;
|
|
1418
1512
|
const r = n.type;
|
|
1419
1513
|
if (typeof r != "string" || r.length === 0) return null;
|
|
@@ -1423,20 +1517,27 @@ function D(e, t) {
|
|
|
1423
1517
|
};
|
|
1424
1518
|
return n.payload !== void 0 && (o.payload = n.payload), o;
|
|
1425
1519
|
}
|
|
1426
|
-
function
|
|
1520
|
+
function j(e) {
|
|
1427
1521
|
return !e || typeof e != "object" || Array.isArray(e) ? null : e;
|
|
1428
1522
|
}
|
|
1429
|
-
function
|
|
1523
|
+
function w(...e) {
|
|
1430
1524
|
for (const t of e)
|
|
1431
1525
|
if (typeof t == "string") {
|
|
1432
1526
|
const n = t.trim();
|
|
1433
1527
|
if (n.length > 0) return n;
|
|
1434
1528
|
}
|
|
1435
1529
|
}
|
|
1436
|
-
function
|
|
1530
|
+
function Jn(e) {
|
|
1437
1531
|
return Array.isArray(e) ? e.filter((t) => typeof t == "string" && t.length > 0) : [];
|
|
1438
1532
|
}
|
|
1439
|
-
function
|
|
1533
|
+
function qn(e) {
|
|
1534
|
+
if (typeof e == "string") {
|
|
1535
|
+
const t = e.trim();
|
|
1536
|
+
return t ? [t] : [];
|
|
1537
|
+
}
|
|
1538
|
+
return Array.isArray(e) ? e.filter((t) => typeof t == "string").map((t) => t.trim()).filter((t) => t.length > 0) : [];
|
|
1539
|
+
}
|
|
1540
|
+
function Y(e) {
|
|
1440
1541
|
if (typeof e == "number" && Number.isFinite(e)) return e;
|
|
1441
1542
|
if (typeof e == "string") {
|
|
1442
1543
|
let t;
|
|
@@ -1448,162 +1549,162 @@ function K(e) {
|
|
|
1448
1549
|
function it(e) {
|
|
1449
1550
|
return e != null;
|
|
1450
1551
|
}
|
|
1451
|
-
function
|
|
1552
|
+
function M(e) {
|
|
1452
1553
|
const t = e.price_discounted != null && e.price_discounted > 0 ? e.price_discounted : e.price, n = e.price_discounted != null && e.price_discounted > 0 && e.price != null ? e.price : void 0;
|
|
1453
1554
|
let r;
|
|
1454
1555
|
n != null && t != null && n > 0 && (r = Math.round((n - t) / n * 100));
|
|
1455
|
-
const o =
|
|
1556
|
+
const o = w(e.brand), i = w(e.name) ?? e.sku, s = o && !i.toLowerCase().startsWith(o.toLowerCase()) ? `${o} ${i}` : i, a = {
|
|
1456
1557
|
sku: e.sku,
|
|
1457
1558
|
name: s,
|
|
1458
|
-
url:
|
|
1559
|
+
url: w(e.url) ?? ""
|
|
1459
1560
|
}, c = e.images?.[0];
|
|
1460
1561
|
return c && (a.imageUrl = c), e.images && e.images.length > 1 && (a.images = e.images), t != null && (a.price = String(t)), n != null && (a.originalPrice = String(n)), r !== void 0 && (a.discountPercent = r), o !== void 0 && (a.brand = o), e.rating !== void 0 && (a.rating = e.rating), e.review_count !== void 0 && (a.reviewCount = e.review_count), e.cart_code !== void 0 && (a.cartCode = e.cart_code), e.in_stock !== void 0 && (a.inStock = e.in_stock), e.variants && e.variants.length > 0 && (a.variants = e.variants), e.discount_reason !== void 0 && (a.discountReason = e.discount_reason), e.promotions && e.promotions.length > 0 && (a.promotions = e.promotions), a;
|
|
1461
1562
|
}
|
|
1462
|
-
function
|
|
1463
|
-
return e.results.map(
|
|
1563
|
+
function cc(e) {
|
|
1564
|
+
return e.results.map(M);
|
|
1464
1565
|
}
|
|
1465
|
-
function
|
|
1566
|
+
function uc(e) {
|
|
1466
1567
|
return e.product_groupings.map((t) => {
|
|
1467
1568
|
const n = {
|
|
1468
1569
|
name: t.name,
|
|
1469
|
-
products: (t.group_products ?? []).map(
|
|
1570
|
+
products: (t.group_products ?? []).map(M)
|
|
1470
1571
|
};
|
|
1471
1572
|
return t.highlight !== void 0 && (n.highlight = t.highlight), n;
|
|
1472
1573
|
});
|
|
1473
1574
|
}
|
|
1474
|
-
const
|
|
1575
|
+
const Vn = {
|
|
1475
1576
|
process_action: "/process_action",
|
|
1476
1577
|
launcher_action: "/launcher_action",
|
|
1477
1578
|
similar_products: "/similar_products",
|
|
1478
1579
|
product_groupings: "/product_groupings",
|
|
1479
1580
|
proactive_action: "/proactive_action"
|
|
1480
|
-
},
|
|
1581
|
+
}, Gn = {
|
|
1481
1582
|
process_action: "/message",
|
|
1482
1583
|
launcher_action: "/message"
|
|
1483
1584
|
};
|
|
1484
|
-
function
|
|
1585
|
+
function Bn(e) {
|
|
1485
1586
|
if (e === void 0)
|
|
1486
1587
|
throw new Error("[gengage] middlewareUrl is required. Pass your Gengage backend URL in widget config.");
|
|
1487
1588
|
const t = e.trim();
|
|
1488
1589
|
return t === "" ? "" : t.replace(/\/+$/, "");
|
|
1489
1590
|
}
|
|
1490
|
-
function
|
|
1491
|
-
const n =
|
|
1591
|
+
function dc(e, t) {
|
|
1592
|
+
const n = Bn(t?.middlewareUrl);
|
|
1492
1593
|
if (t.backendType === "acap") {
|
|
1493
|
-
const r = t.accountId ?? "", o =
|
|
1594
|
+
const r = t.accountId ?? "", o = Gn[e];
|
|
1494
1595
|
if (o)
|
|
1495
1596
|
return `${n}/api/chat/${r}${o}`;
|
|
1496
1597
|
}
|
|
1497
|
-
return `${n}/chat${
|
|
1598
|
+
return `${n}/chat${Vn[e]}`;
|
|
1498
1599
|
}
|
|
1499
|
-
function
|
|
1600
|
+
function Wn() {
|
|
1500
1601
|
return typeof window < "u" && Array.isArray(window.dataLayer);
|
|
1501
1602
|
}
|
|
1502
|
-
function
|
|
1603
|
+
function Z(e, t) {
|
|
1503
1604
|
const n = {
|
|
1504
1605
|
event: e,
|
|
1505
1606
|
...t
|
|
1506
1607
|
};
|
|
1507
|
-
|
|
1608
|
+
Wn() && window.dataLayer.push(n);
|
|
1508
1609
|
}
|
|
1509
|
-
function
|
|
1510
|
-
|
|
1610
|
+
function Hn(e) {
|
|
1611
|
+
Z("gengage-on-init", { gengage_widget: e });
|
|
1511
1612
|
}
|
|
1512
1613
|
function Pe(e) {
|
|
1513
|
-
|
|
1614
|
+
Z("gengage-show", { gengage_widget: e });
|
|
1514
1615
|
}
|
|
1515
|
-
function
|
|
1516
|
-
|
|
1616
|
+
function Kn(e) {
|
|
1617
|
+
Z("gengage-hide", { gengage_widget: e });
|
|
1517
1618
|
}
|
|
1518
|
-
function
|
|
1519
|
-
|
|
1619
|
+
function Yn(e, t) {
|
|
1620
|
+
Z("gengage-suggested-question", {
|
|
1520
1621
|
gengage_question_title: e,
|
|
1521
1622
|
gengage_action_type: t
|
|
1522
1623
|
});
|
|
1523
1624
|
}
|
|
1524
|
-
function
|
|
1525
|
-
|
|
1625
|
+
function lc(e) {
|
|
1626
|
+
Z("gengage-find-similars", { gengage_sku: e });
|
|
1526
1627
|
}
|
|
1527
|
-
function
|
|
1528
|
-
|
|
1628
|
+
function fc(e) {
|
|
1629
|
+
Z("gengage-compare-preselection", { gengage_sku: e });
|
|
1529
1630
|
}
|
|
1530
|
-
function
|
|
1531
|
-
|
|
1631
|
+
function pc(e) {
|
|
1632
|
+
Z("gengage-compare-selected", {
|
|
1532
1633
|
gengage_skus: e,
|
|
1533
1634
|
gengage_product_count: e.length
|
|
1534
1635
|
});
|
|
1535
1636
|
}
|
|
1536
|
-
function
|
|
1537
|
-
|
|
1637
|
+
function gc() {
|
|
1638
|
+
Z("gengage-compare-clear");
|
|
1538
1639
|
}
|
|
1539
|
-
function
|
|
1540
|
-
|
|
1640
|
+
function hc(e) {
|
|
1641
|
+
Z("gengage-compare-received", {
|
|
1541
1642
|
gengage_product_count: e
|
|
1542
1643
|
});
|
|
1543
1644
|
}
|
|
1544
|
-
function
|
|
1545
|
-
|
|
1645
|
+
function mc(e) {
|
|
1646
|
+
Z("gengage-like-product", { gengage_sku: e });
|
|
1546
1647
|
}
|
|
1547
|
-
function
|
|
1548
|
-
|
|
1648
|
+
function _c() {
|
|
1649
|
+
Z("gengage-like-list");
|
|
1549
1650
|
}
|
|
1550
|
-
function
|
|
1551
|
-
|
|
1651
|
+
function yc(e, t) {
|
|
1652
|
+
Z("gengage-search", {
|
|
1552
1653
|
gengage_search_query: e,
|
|
1553
1654
|
gengage_result_count: t
|
|
1554
1655
|
});
|
|
1555
1656
|
}
|
|
1556
|
-
function
|
|
1557
|
-
|
|
1657
|
+
function Qn(e, t) {
|
|
1658
|
+
Z("gengage-product-detail", {
|
|
1558
1659
|
gengage_sku: e,
|
|
1559
1660
|
gengage_product_name: t
|
|
1560
1661
|
});
|
|
1561
1662
|
}
|
|
1562
1663
|
function Ae(e, t) {
|
|
1563
|
-
|
|
1664
|
+
Z("gengage-cart-add", {
|
|
1564
1665
|
gengage_sku: e,
|
|
1565
1666
|
gengage_quantity: t
|
|
1566
1667
|
});
|
|
1567
1668
|
}
|
|
1568
|
-
function
|
|
1569
|
-
|
|
1669
|
+
function vc() {
|
|
1670
|
+
Z("gengage-message-sent");
|
|
1570
1671
|
}
|
|
1571
|
-
function
|
|
1572
|
-
|
|
1672
|
+
function wc() {
|
|
1673
|
+
Z("gengage-message-received");
|
|
1573
1674
|
}
|
|
1574
|
-
function
|
|
1575
|
-
|
|
1675
|
+
function bc() {
|
|
1676
|
+
Z("gengage-conversation-start");
|
|
1576
1677
|
}
|
|
1577
|
-
function
|
|
1578
|
-
|
|
1678
|
+
function Xn() {
|
|
1679
|
+
Z("gengage-voice-input");
|
|
1579
1680
|
}
|
|
1580
|
-
function
|
|
1581
|
-
|
|
1681
|
+
function er(e, t) {
|
|
1682
|
+
Z("gengage-error", { gengage_widget: e, gengage_error: t });
|
|
1582
1683
|
}
|
|
1583
|
-
let
|
|
1584
|
-
function
|
|
1684
|
+
let Q = null;
|
|
1685
|
+
function kc() {
|
|
1585
1686
|
if (typeof window > "u") return () => {
|
|
1586
1687
|
};
|
|
1587
|
-
if (
|
|
1688
|
+
if (Q) return Q;
|
|
1588
1689
|
const e = [];
|
|
1589
1690
|
function t(n, r) {
|
|
1590
1691
|
const o = (i) => r(i.detail);
|
|
1591
1692
|
window.addEventListener(n, o), e.push(() => window.removeEventListener(n, o));
|
|
1592
1693
|
}
|
|
1593
|
-
return t("gengage:chat:open", () => Pe("chat")), t("gengage:chat:close", () =>
|
|
1694
|
+
return t("gengage:chat:open", () => Pe("chat")), t("gengage:chat:close", () => Kn("chat")), t("gengage:chat:ready", () => Hn("chat")), t("gengage:chat:add-to-cart", ({ sku: n, quantity: r }) => {
|
|
1594
1695
|
Ae(n, r);
|
|
1595
1696
|
}), t("gengage:similar:add-to-cart", ({ sku: n, quantity: r }) => {
|
|
1596
1697
|
Ae(n, r);
|
|
1597
1698
|
}), t("gengage:similar:product-click", ({ sku: n }) => {
|
|
1598
|
-
|
|
1699
|
+
Qn(n);
|
|
1599
1700
|
}), t("gengage:qna:action", ({ title: n, type: r }) => {
|
|
1600
|
-
|
|
1601
|
-
}), t("gengage:chat:voice", () =>
|
|
1602
|
-
|
|
1603
|
-
}),
|
|
1701
|
+
Yn(n, r);
|
|
1702
|
+
}), t("gengage:chat:voice", () => Xn()), t("gengage:qna:open-chat", () => Pe("chat")), t("gengage:global:error", ({ source: n, message: r }) => {
|
|
1703
|
+
er(n, r);
|
|
1704
|
+
}), Q = () => {
|
|
1604
1705
|
for (const n of e) n();
|
|
1605
|
-
e.length = 0,
|
|
1606
|
-
},
|
|
1706
|
+
e.length = 0, Q = null;
|
|
1707
|
+
}, Q;
|
|
1607
1708
|
}
|
|
1608
1709
|
function d(e, t, n) {
|
|
1609
1710
|
function r(a, c) {
|
|
@@ -1619,8 +1720,8 @@ function d(e, t, n) {
|
|
|
1619
1720
|
a._zod.traits.add(e), t(a, c);
|
|
1620
1721
|
const u = s.prototype, l = Object.keys(u);
|
|
1621
1722
|
for (let f = 0; f < l.length; f++) {
|
|
1622
|
-
const
|
|
1623
|
-
|
|
1723
|
+
const p = l[f];
|
|
1724
|
+
p in a || (a[p] = u[p].bind(a));
|
|
1624
1725
|
}
|
|
1625
1726
|
}
|
|
1626
1727
|
const o = n?.Parent ?? Object;
|
|
@@ -1639,7 +1740,7 @@ function d(e, t, n) {
|
|
|
1639
1740
|
value: (a) => n?.Parent && a instanceof n.Parent ? !0 : a?._zod?.traits?.has(e)
|
|
1640
1741
|
}), Object.defineProperty(s, "name", { value: e }), s;
|
|
1641
1742
|
}
|
|
1642
|
-
class
|
|
1743
|
+
class B extends Error {
|
|
1643
1744
|
constructor() {
|
|
1644
1745
|
super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
|
|
1645
1746
|
}
|
|
@@ -1650,7 +1751,7 @@ class st extends Error {
|
|
|
1650
1751
|
}
|
|
1651
1752
|
}
|
|
1652
1753
|
const at = {};
|
|
1653
|
-
function
|
|
1754
|
+
function L(e) {
|
|
1654
1755
|
return at;
|
|
1655
1756
|
}
|
|
1656
1757
|
function ct(e) {
|
|
@@ -1677,7 +1778,7 @@ function be(e) {
|
|
|
1677
1778
|
const t = e.startsWith("^") ? 1 : 0, n = e.endsWith("$") ? e.length - 1 : e.length;
|
|
1678
1779
|
return e.slice(t, n);
|
|
1679
1780
|
}
|
|
1680
|
-
function
|
|
1781
|
+
function tr(e, t) {
|
|
1681
1782
|
const n = (e.toString().split(".")[1] || "").length, r = t.toString();
|
|
1682
1783
|
let o = (r.split(".")[1] || "").length;
|
|
1683
1784
|
if (o === 0 && /\d?e-\d?/.test(r)) {
|
|
@@ -1688,7 +1789,7 @@ function Kn(e, t) {
|
|
|
1688
1789
|
return s % a / 10 ** i;
|
|
1689
1790
|
}
|
|
1690
1791
|
const Ne = /* @__PURE__ */ Symbol("evaluating");
|
|
1691
|
-
function
|
|
1792
|
+
function v(e, t, n) {
|
|
1692
1793
|
let r;
|
|
1693
1794
|
Object.defineProperty(e, t, {
|
|
1694
1795
|
get() {
|
|
@@ -1704,7 +1805,7 @@ function _(e, t, n) {
|
|
|
1704
1805
|
configurable: !0
|
|
1705
1806
|
});
|
|
1706
1807
|
}
|
|
1707
|
-
function
|
|
1808
|
+
function q(e, t, n) {
|
|
1708
1809
|
Object.defineProperty(e, t, {
|
|
1709
1810
|
value: n,
|
|
1710
1811
|
writable: !0,
|
|
@@ -1712,7 +1813,7 @@ function J(e, t, n) {
|
|
|
1712
1813
|
configurable: !0
|
|
1713
1814
|
});
|
|
1714
1815
|
}
|
|
1715
|
-
function
|
|
1816
|
+
function F(...e) {
|
|
1716
1817
|
const t = {};
|
|
1717
1818
|
for (const n of e) {
|
|
1718
1819
|
const r = Object.getOwnPropertyDescriptors(n);
|
|
@@ -1723,15 +1824,15 @@ function L(...e) {
|
|
|
1723
1824
|
function Ce(e) {
|
|
1724
1825
|
return JSON.stringify(e);
|
|
1725
1826
|
}
|
|
1726
|
-
function
|
|
1827
|
+
function nr(e) {
|
|
1727
1828
|
return e.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
1728
1829
|
}
|
|
1729
1830
|
const ut = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
|
|
1730
1831
|
};
|
|
1731
|
-
function
|
|
1832
|
+
function ie(e) {
|
|
1732
1833
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
1733
1834
|
}
|
|
1734
|
-
const
|
|
1835
|
+
const rr = ve(() => {
|
|
1735
1836
|
if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
|
|
1736
1837
|
return !1;
|
|
1737
1838
|
try {
|
|
@@ -1741,23 +1842,23 @@ const Qn = ve(() => {
|
|
|
1741
1842
|
return !1;
|
|
1742
1843
|
}
|
|
1743
1844
|
});
|
|
1744
|
-
function
|
|
1745
|
-
if (
|
|
1845
|
+
function W(e) {
|
|
1846
|
+
if (ie(e) === !1)
|
|
1746
1847
|
return !1;
|
|
1747
1848
|
const t = e.constructor;
|
|
1748
1849
|
if (t === void 0 || typeof t != "function")
|
|
1749
1850
|
return !0;
|
|
1750
1851
|
const n = t.prototype;
|
|
1751
|
-
return !(
|
|
1852
|
+
return !(ie(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
|
|
1752
1853
|
}
|
|
1753
1854
|
function dt(e) {
|
|
1754
|
-
return
|
|
1855
|
+
return W(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
|
|
1755
1856
|
}
|
|
1756
|
-
const
|
|
1757
|
-
function
|
|
1857
|
+
const or = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
|
|
1858
|
+
function H(e) {
|
|
1758
1859
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1759
1860
|
}
|
|
1760
|
-
function
|
|
1861
|
+
function x(e, t, n) {
|
|
1761
1862
|
const r = new e._zod.constr(t ?? e._zod.def);
|
|
1762
1863
|
return (!t || n?.parent) && (r._zod.parent = e), r;
|
|
1763
1864
|
}
|
|
@@ -1774,21 +1875,21 @@ function h(e) {
|
|
|
1774
1875
|
}
|
|
1775
1876
|
return delete t.message, typeof t.error == "string" ? { ...t, error: () => t.error } : t;
|
|
1776
1877
|
}
|
|
1777
|
-
function
|
|
1878
|
+
function ir(e) {
|
|
1778
1879
|
return Object.keys(e).filter((t) => e[t]._zod.optin === "optional" && e[t]._zod.optout === "optional");
|
|
1779
1880
|
}
|
|
1780
|
-
const
|
|
1881
|
+
const sr = {
|
|
1781
1882
|
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
1782
1883
|
int32: [-2147483648, 2147483647],
|
|
1783
1884
|
uint32: [0, 4294967295],
|
|
1784
1885
|
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
1785
1886
|
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
1786
1887
|
};
|
|
1787
|
-
function
|
|
1888
|
+
function ar(e, t) {
|
|
1788
1889
|
const n = e._zod.def, r = n.checks;
|
|
1789
1890
|
if (r && r.length > 0)
|
|
1790
1891
|
throw new Error(".pick() cannot be used on object schemas containing refinements");
|
|
1791
|
-
const i =
|
|
1892
|
+
const i = F(e._zod.def, {
|
|
1792
1893
|
get shape() {
|
|
1793
1894
|
const s = {};
|
|
1794
1895
|
for (const a in t) {
|
|
@@ -1796,17 +1897,17 @@ function nr(e, t) {
|
|
|
1796
1897
|
throw new Error(`Unrecognized key: "${a}"`);
|
|
1797
1898
|
t[a] && (s[a] = n.shape[a]);
|
|
1798
1899
|
}
|
|
1799
|
-
return
|
|
1900
|
+
return q(this, "shape", s), s;
|
|
1800
1901
|
},
|
|
1801
1902
|
checks: []
|
|
1802
1903
|
});
|
|
1803
|
-
return
|
|
1904
|
+
return x(e, i);
|
|
1804
1905
|
}
|
|
1805
|
-
function
|
|
1906
|
+
function cr(e, t) {
|
|
1806
1907
|
const n = e._zod.def, r = n.checks;
|
|
1807
1908
|
if (r && r.length > 0)
|
|
1808
1909
|
throw new Error(".omit() cannot be used on object schemas containing refinements");
|
|
1809
|
-
const i =
|
|
1910
|
+
const i = F(e._zod.def, {
|
|
1810
1911
|
get shape() {
|
|
1811
1912
|
const s = { ...e._zod.def.shape };
|
|
1812
1913
|
for (const a in t) {
|
|
@@ -1814,14 +1915,14 @@ function rr(e, t) {
|
|
|
1814
1915
|
throw new Error(`Unrecognized key: "${a}"`);
|
|
1815
1916
|
t[a] && delete s[a];
|
|
1816
1917
|
}
|
|
1817
|
-
return
|
|
1918
|
+
return q(this, "shape", s), s;
|
|
1818
1919
|
},
|
|
1819
1920
|
checks: []
|
|
1820
1921
|
});
|
|
1821
|
-
return
|
|
1922
|
+
return x(e, i);
|
|
1822
1923
|
}
|
|
1823
|
-
function
|
|
1824
|
-
if (!
|
|
1924
|
+
function ur(e, t) {
|
|
1925
|
+
if (!W(t))
|
|
1825
1926
|
throw new Error("Invalid input to extend: expected a plain object");
|
|
1826
1927
|
const n = e._zod.def.checks;
|
|
1827
1928
|
if (n && n.length > 0) {
|
|
@@ -1830,30 +1931,30 @@ function or(e, t) {
|
|
|
1830
1931
|
if (Object.getOwnPropertyDescriptor(i, s) !== void 0)
|
|
1831
1932
|
throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
1832
1933
|
}
|
|
1833
|
-
const o =
|
|
1934
|
+
const o = F(e._zod.def, {
|
|
1834
1935
|
get shape() {
|
|
1835
1936
|
const i = { ...e._zod.def.shape, ...t };
|
|
1836
|
-
return
|
|
1937
|
+
return q(this, "shape", i), i;
|
|
1837
1938
|
}
|
|
1838
1939
|
});
|
|
1839
|
-
return
|
|
1940
|
+
return x(e, o);
|
|
1840
1941
|
}
|
|
1841
|
-
function
|
|
1842
|
-
if (!
|
|
1942
|
+
function dr(e, t) {
|
|
1943
|
+
if (!W(t))
|
|
1843
1944
|
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
1844
|
-
const n =
|
|
1945
|
+
const n = F(e._zod.def, {
|
|
1845
1946
|
get shape() {
|
|
1846
1947
|
const r = { ...e._zod.def.shape, ...t };
|
|
1847
|
-
return
|
|
1948
|
+
return q(this, "shape", r), r;
|
|
1848
1949
|
}
|
|
1849
1950
|
});
|
|
1850
|
-
return
|
|
1951
|
+
return x(e, n);
|
|
1851
1952
|
}
|
|
1852
|
-
function
|
|
1853
|
-
const n =
|
|
1953
|
+
function lr(e, t) {
|
|
1954
|
+
const n = F(e._zod.def, {
|
|
1854
1955
|
get shape() {
|
|
1855
1956
|
const r = { ...e._zod.def.shape, ...t._zod.def.shape };
|
|
1856
|
-
return
|
|
1957
|
+
return q(this, "shape", r), r;
|
|
1857
1958
|
},
|
|
1858
1959
|
get catchall() {
|
|
1859
1960
|
return t._zod.def.catchall;
|
|
@@ -1861,13 +1962,13 @@ function sr(e, t) {
|
|
|
1861
1962
|
checks: []
|
|
1862
1963
|
// delete existing checks
|
|
1863
1964
|
});
|
|
1864
|
-
return
|
|
1965
|
+
return x(e, n);
|
|
1865
1966
|
}
|
|
1866
|
-
function
|
|
1967
|
+
function fr(e, t, n) {
|
|
1867
1968
|
const o = t._zod.def.checks;
|
|
1868
1969
|
if (o && o.length > 0)
|
|
1869
1970
|
throw new Error(".partial() cannot be used on object schemas containing refinements");
|
|
1870
|
-
const s =
|
|
1971
|
+
const s = F(t._zod.def, {
|
|
1871
1972
|
get shape() {
|
|
1872
1973
|
const a = t._zod.def.shape, c = { ...a };
|
|
1873
1974
|
if (n)
|
|
@@ -1885,14 +1986,14 @@ function ar(e, t, n) {
|
|
|
1885
1986
|
type: "optional",
|
|
1886
1987
|
innerType: a[u]
|
|
1887
1988
|
}) : a[u];
|
|
1888
|
-
return
|
|
1989
|
+
return q(this, "shape", c), c;
|
|
1889
1990
|
},
|
|
1890
1991
|
checks: []
|
|
1891
1992
|
});
|
|
1892
|
-
return
|
|
1993
|
+
return x(t, s);
|
|
1893
1994
|
}
|
|
1894
|
-
function
|
|
1895
|
-
const r =
|
|
1995
|
+
function pr(e, t, n) {
|
|
1996
|
+
const r = F(t._zod.def, {
|
|
1896
1997
|
get shape() {
|
|
1897
1998
|
const o = t._zod.def.shape, i = { ...o };
|
|
1898
1999
|
if (n)
|
|
@@ -1910,12 +2011,12 @@ function cr(e, t, n) {
|
|
|
1910
2011
|
type: "nonoptional",
|
|
1911
2012
|
innerType: o[s]
|
|
1912
2013
|
});
|
|
1913
|
-
return
|
|
2014
|
+
return q(this, "shape", i), i;
|
|
1914
2015
|
}
|
|
1915
2016
|
});
|
|
1916
|
-
return
|
|
2017
|
+
return x(t, r);
|
|
1917
2018
|
}
|
|
1918
|
-
function
|
|
2019
|
+
function V(e, t = 0) {
|
|
1919
2020
|
if (e.aborted === !0)
|
|
1920
2021
|
return !0;
|
|
1921
2022
|
for (let n = t; n < e.issues.length; n++)
|
|
@@ -1923,19 +2024,19 @@ function x(e, t = 0) {
|
|
|
1923
2024
|
return !0;
|
|
1924
2025
|
return !1;
|
|
1925
2026
|
}
|
|
1926
|
-
function
|
|
2027
|
+
function G(e, t) {
|
|
1927
2028
|
return t.map((n) => {
|
|
1928
2029
|
var r;
|
|
1929
2030
|
return (r = n).path ?? (r.path = []), n.path.unshift(e), n;
|
|
1930
2031
|
});
|
|
1931
2032
|
}
|
|
1932
|
-
function
|
|
2033
|
+
function ne(e) {
|
|
1933
2034
|
return typeof e == "string" ? e : e?.message;
|
|
1934
2035
|
}
|
|
1935
|
-
function
|
|
2036
|
+
function U(e, t, n) {
|
|
1936
2037
|
const r = { ...e, path: e.path ?? [] };
|
|
1937
2038
|
if (!e.message) {
|
|
1938
|
-
const o =
|
|
2039
|
+
const o = ne(e.inst?._zod.def?.error?.(e)) ?? ne(t?.error?.(e)) ?? ne(n.customError?.(e)) ?? ne(n.localeError?.(e)) ?? "Invalid input";
|
|
1939
2040
|
r.message = o;
|
|
1940
2041
|
}
|
|
1941
2042
|
return delete r.inst, delete r.continue, t?.reportInput || delete r.input, r;
|
|
@@ -1943,7 +2044,7 @@ function R(e, t, n) {
|
|
|
1943
2044
|
function ke(e) {
|
|
1944
2045
|
return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
|
|
1945
2046
|
}
|
|
1946
|
-
function
|
|
2047
|
+
function te(...e) {
|
|
1947
2048
|
const [t, n, r] = e;
|
|
1948
2049
|
return typeof t == "string" ? {
|
|
1949
2050
|
message: t,
|
|
@@ -1964,13 +2065,13 @@ const lt = (e, t) => {
|
|
|
1964
2065
|
enumerable: !1
|
|
1965
2066
|
});
|
|
1966
2067
|
}, ft = d("$ZodError", lt), pt = d("$ZodError", lt, { Parent: Error });
|
|
1967
|
-
function
|
|
2068
|
+
function gr(e, t = (n) => n.message) {
|
|
1968
2069
|
const n = {}, r = [];
|
|
1969
2070
|
for (const o of e.issues)
|
|
1970
2071
|
o.path.length > 0 ? (n[o.path[0]] = n[o.path[0]] || [], n[o.path[0]].push(t(o))) : r.push(t(o));
|
|
1971
2072
|
return { formErrors: r, fieldErrors: n };
|
|
1972
2073
|
}
|
|
1973
|
-
function
|
|
2074
|
+
function hr(e, t = (n) => n.message) {
|
|
1974
2075
|
const n = { _errors: [] }, r = (o) => {
|
|
1975
2076
|
for (const i of o.issues)
|
|
1976
2077
|
if (i.code === "invalid_union" && i.errors.length)
|
|
@@ -1994,9 +2095,9 @@ function dr(e, t = (n) => n.message) {
|
|
|
1994
2095
|
const ze = (e) => (t, n, r, o) => {
|
|
1995
2096
|
const i = r ? Object.assign(r, { async: !1 }) : { async: !1 }, s = t._zod.run({ value: n, issues: [] }, i);
|
|
1996
2097
|
if (s instanceof Promise)
|
|
1997
|
-
throw new
|
|
2098
|
+
throw new B();
|
|
1998
2099
|
if (s.issues.length) {
|
|
1999
|
-
const a = new (o?.Err ?? e)(s.issues.map((c) =>
|
|
2100
|
+
const a = new (o?.Err ?? e)(s.issues.map((c) => U(c, i, L())));
|
|
2000
2101
|
throw ut(a, o?.callee), a;
|
|
2001
2102
|
}
|
|
2002
2103
|
return s.value;
|
|
@@ -2004,59 +2105,59 @@ const ze = (e) => (t, n, r, o) => {
|
|
|
2004
2105
|
const i = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
2005
2106
|
let s = t._zod.run({ value: n, issues: [] }, i);
|
|
2006
2107
|
if (s instanceof Promise && (s = await s), s.issues.length) {
|
|
2007
|
-
const a = new (o?.Err ?? e)(s.issues.map((c) =>
|
|
2108
|
+
const a = new (o?.Err ?? e)(s.issues.map((c) => U(c, i, L())));
|
|
2008
2109
|
throw ut(a, o?.callee), a;
|
|
2009
2110
|
}
|
|
2010
2111
|
return s.value;
|
|
2011
|
-
},
|
|
2112
|
+
}, ue = (e) => (t, n, r) => {
|
|
2012
2113
|
const o = r ? { ...r, async: !1 } : { async: !1 }, i = t._zod.run({ value: n, issues: [] }, o);
|
|
2013
2114
|
if (i instanceof Promise)
|
|
2014
|
-
throw new
|
|
2115
|
+
throw new B();
|
|
2015
2116
|
return i.issues.length ? {
|
|
2016
2117
|
success: !1,
|
|
2017
|
-
error: new (e ?? ft)(i.issues.map((s) =>
|
|
2118
|
+
error: new (e ?? ft)(i.issues.map((s) => U(s, o, L())))
|
|
2018
2119
|
} : { success: !0, data: i.value };
|
|
2019
|
-
},
|
|
2120
|
+
}, mr = /* @__PURE__ */ ue(pt), de = (e) => async (t, n, r) => {
|
|
2020
2121
|
const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
2021
2122
|
let i = t._zod.run({ value: n, issues: [] }, o);
|
|
2022
2123
|
return i instanceof Promise && (i = await i), i.issues.length ? {
|
|
2023
2124
|
success: !1,
|
|
2024
|
-
error: new e(i.issues.map((s) =>
|
|
2125
|
+
error: new e(i.issues.map((s) => U(s, o, L())))
|
|
2025
2126
|
} : { success: !0, data: i.value };
|
|
2026
|
-
},
|
|
2127
|
+
}, _r = /* @__PURE__ */ de(pt), yr = (e) => (t, n, r) => {
|
|
2027
2128
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
2028
2129
|
return ze(e)(t, n, o);
|
|
2029
|
-
},
|
|
2130
|
+
}, vr = (e) => (t, n, r) => ze(e)(t, n, r), wr = (e) => async (t, n, r) => {
|
|
2030
2131
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
2031
2132
|
return $e(e)(t, n, o);
|
|
2032
|
-
},
|
|
2033
|
-
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
2034
|
-
return ce(e)(t, n, o);
|
|
2035
|
-
}, yr = (e) => (t, n, r) => ce(e)(t, n, r), vr = (e) => async (t, n, r) => {
|
|
2133
|
+
}, br = (e) => async (t, n, r) => $e(e)(t, n, r), kr = (e) => (t, n, r) => {
|
|
2036
2134
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
2037
2135
|
return ue(e)(t, n, o);
|
|
2038
|
-
},
|
|
2039
|
-
|
|
2040
|
-
return
|
|
2136
|
+
}, zr = (e) => (t, n, r) => ue(e)(t, n, r), $r = (e) => async (t, n, r) => {
|
|
2137
|
+
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
2138
|
+
return de(e)(t, n, o);
|
|
2139
|
+
}, Sr = (e) => async (t, n, r) => de(e)(t, n, r), Er = /^[cC][^\s-]{8,}$/, Zr = /^[0-9a-z]+$/, Tr = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, Ir = /^[0-9a-vA-V]{20}$/, Or = /^[A-Za-z0-9]{27}$/, Pr = /^[a-zA-Z0-9_-]{21}$/, Ar = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, Nr = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, Re = (e) => e ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, Cr = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Rr = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
2140
|
+
function jr() {
|
|
2141
|
+
return new RegExp(Rr, "u");
|
|
2041
2142
|
}
|
|
2042
|
-
const
|
|
2143
|
+
const Dr = /^(?:(?: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])$/, Lr = /^(([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}|:))$/, Ur = /^((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])$/, Mr = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Fr = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, gt = /^[A-Za-z0-9_-]*$/, xr = /^\+[1-9]\d{6,14}$/, ht = "(?:(?:\\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])))", Jr = /* @__PURE__ */ new RegExp(`^${ht}$`);
|
|
2043
2144
|
function mt(e) {
|
|
2044
2145
|
const t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
|
|
2045
2146
|
return typeof e.precision == "number" ? e.precision === -1 ? `${t}` : e.precision === 0 ? `${t}:[0-5]\\d` : `${t}:[0-5]\\d\\.\\d{${e.precision}}` : `${t}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
2046
2147
|
}
|
|
2047
|
-
function
|
|
2148
|
+
function qr(e) {
|
|
2048
2149
|
return new RegExp(`^${mt(e)}$`);
|
|
2049
2150
|
}
|
|
2050
|
-
function
|
|
2151
|
+
function Vr(e) {
|
|
2051
2152
|
const t = mt({ precision: e.precision }), n = ["Z"];
|
|
2052
2153
|
e.local && n.push(""), e.offset && n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
|
|
2053
2154
|
const r = `${t}(?:${n.join("|")})`;
|
|
2054
2155
|
return new RegExp(`^${ht}T(?:${r})$`);
|
|
2055
2156
|
}
|
|
2056
|
-
const
|
|
2157
|
+
const Gr = (e) => {
|
|
2057
2158
|
const t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
|
|
2058
2159
|
return new RegExp(`^${t}$`);
|
|
2059
|
-
},
|
|
2160
|
+
}, Br = /^-?\d+$/, _t = /^-?\d+(?:\.\d+)?$/, Wr = /^(?:true|false)$/i, Hr = /^[^A-Z]*$/, Kr = /^[^a-z]*$/, P = /* @__PURE__ */ d("$ZodCheck", (e, t) => {
|
|
2060
2161
|
var n;
|
|
2061
2162
|
e._zod ?? (e._zod = {}), e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []);
|
|
2062
2163
|
}), yt = {
|
|
@@ -2064,7 +2165,7 @@ const Fr = (e) => {
|
|
|
2064
2165
|
bigint: "bigint",
|
|
2065
2166
|
object: "date"
|
|
2066
2167
|
}, vt = /* @__PURE__ */ d("$ZodCheckLessThan", (e, t) => {
|
|
2067
|
-
|
|
2168
|
+
P.init(e, t);
|
|
2068
2169
|
const n = yt[typeof t.value];
|
|
2069
2170
|
e._zod.onattach.push((r) => {
|
|
2070
2171
|
const o = r._zod.bag, i = (t.inclusive ? o.maximum : o.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
@@ -2081,7 +2182,7 @@ const Fr = (e) => {
|
|
|
2081
2182
|
});
|
|
2082
2183
|
};
|
|
2083
2184
|
}), wt = /* @__PURE__ */ d("$ZodCheckGreaterThan", (e, t) => {
|
|
2084
|
-
|
|
2185
|
+
P.init(e, t);
|
|
2085
2186
|
const n = yt[typeof t.value];
|
|
2086
2187
|
e._zod.onattach.push((r) => {
|
|
2087
2188
|
const o = r._zod.bag, i = (t.inclusive ? o.minimum : o.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
@@ -2097,14 +2198,14 @@ const Fr = (e) => {
|
|
|
2097
2198
|
continue: !t.abort
|
|
2098
2199
|
});
|
|
2099
2200
|
};
|
|
2100
|
-
}),
|
|
2101
|
-
|
|
2201
|
+
}), Yr = /* @__PURE__ */ d("$ZodCheckMultipleOf", (e, t) => {
|
|
2202
|
+
P.init(e, t), e._zod.onattach.push((n) => {
|
|
2102
2203
|
var r;
|
|
2103
2204
|
(r = n._zod.bag).multipleOf ?? (r.multipleOf = t.value);
|
|
2104
2205
|
}), e._zod.check = (n) => {
|
|
2105
2206
|
if (typeof n.value != typeof t.value)
|
|
2106
2207
|
throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
2107
|
-
(typeof n.value == "bigint" ? n.value % t.value === BigInt(0) :
|
|
2208
|
+
(typeof n.value == "bigint" ? n.value % t.value === BigInt(0) : tr(n.value, t.value) === 0) || n.issues.push({
|
|
2108
2209
|
origin: typeof n.value,
|
|
2109
2210
|
code: "not_multiple_of",
|
|
2110
2211
|
divisor: t.value,
|
|
@@ -2113,12 +2214,12 @@ const Fr = (e) => {
|
|
|
2113
2214
|
continue: !t.abort
|
|
2114
2215
|
});
|
|
2115
2216
|
};
|
|
2116
|
-
}),
|
|
2117
|
-
|
|
2118
|
-
const n = t.format?.includes("int"), r = n ? "int" : "number", [o, i] =
|
|
2217
|
+
}), Qr = /* @__PURE__ */ d("$ZodCheckNumberFormat", (e, t) => {
|
|
2218
|
+
P.init(e, t), t.format = t.format || "float64";
|
|
2219
|
+
const n = t.format?.includes("int"), r = n ? "int" : "number", [o, i] = sr[t.format];
|
|
2119
2220
|
e._zod.onattach.push((s) => {
|
|
2120
2221
|
const a = s._zod.bag;
|
|
2121
|
-
a.format = t.format, a.minimum = o, a.maximum = i, n && (a.pattern =
|
|
2222
|
+
a.format = t.format, a.minimum = o, a.maximum = i, n && (a.pattern = Br);
|
|
2122
2223
|
}), e._zod.check = (s) => {
|
|
2123
2224
|
const a = s.value;
|
|
2124
2225
|
if (n) {
|
|
@@ -2174,9 +2275,9 @@ const Fr = (e) => {
|
|
|
2174
2275
|
continue: !t.abort
|
|
2175
2276
|
});
|
|
2176
2277
|
};
|
|
2177
|
-
}),
|
|
2278
|
+
}), Xr = /* @__PURE__ */ d("$ZodCheckMaxLength", (e, t) => {
|
|
2178
2279
|
var n;
|
|
2179
|
-
|
|
2280
|
+
P.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
2180
2281
|
const o = r.value;
|
|
2181
2282
|
return !we(o) && o.length !== void 0;
|
|
2182
2283
|
}), e._zod.onattach.push((r) => {
|
|
@@ -2197,9 +2298,9 @@ const Fr = (e) => {
|
|
|
2197
2298
|
continue: !t.abort
|
|
2198
2299
|
});
|
|
2199
2300
|
};
|
|
2200
|
-
}),
|
|
2301
|
+
}), eo = /* @__PURE__ */ d("$ZodCheckMinLength", (e, t) => {
|
|
2201
2302
|
var n;
|
|
2202
|
-
|
|
2303
|
+
P.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
2203
2304
|
const o = r.value;
|
|
2204
2305
|
return !we(o) && o.length !== void 0;
|
|
2205
2306
|
}), e._zod.onattach.push((r) => {
|
|
@@ -2220,9 +2321,9 @@ const Fr = (e) => {
|
|
|
2220
2321
|
continue: !t.abort
|
|
2221
2322
|
});
|
|
2222
2323
|
};
|
|
2223
|
-
}),
|
|
2324
|
+
}), to = /* @__PURE__ */ d("$ZodCheckLengthEquals", (e, t) => {
|
|
2224
2325
|
var n;
|
|
2225
|
-
|
|
2326
|
+
P.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
2226
2327
|
const o = r.value;
|
|
2227
2328
|
return !we(o) && o.length !== void 0;
|
|
2228
2329
|
}), e._zod.onattach.push((r) => {
|
|
@@ -2243,9 +2344,9 @@ const Fr = (e) => {
|
|
|
2243
2344
|
continue: !t.abort
|
|
2244
2345
|
});
|
|
2245
2346
|
};
|
|
2246
|
-
}),
|
|
2347
|
+
}), le = /* @__PURE__ */ d("$ZodCheckStringFormat", (e, t) => {
|
|
2247
2348
|
var n, r;
|
|
2248
|
-
|
|
2349
|
+
P.init(e, t), e._zod.onattach.push((o) => {
|
|
2249
2350
|
const i = o._zod.bag;
|
|
2250
2351
|
i.format = t.format, t.pattern && (i.patterns ?? (i.patterns = /* @__PURE__ */ new Set()), i.patterns.add(t.pattern));
|
|
2251
2352
|
}), t.pattern ? (n = e._zod).check ?? (n.check = (o) => {
|
|
@@ -2260,8 +2361,8 @@ const Fr = (e) => {
|
|
|
2260
2361
|
});
|
|
2261
2362
|
}) : (r = e._zod).check ?? (r.check = () => {
|
|
2262
2363
|
});
|
|
2263
|
-
}),
|
|
2264
|
-
|
|
2364
|
+
}), no = /* @__PURE__ */ d("$ZodCheckRegex", (e, t) => {
|
|
2365
|
+
le.init(e, t), e._zod.check = (n) => {
|
|
2265
2366
|
t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
|
|
2266
2367
|
origin: "string",
|
|
2267
2368
|
code: "invalid_format",
|
|
@@ -2272,13 +2373,13 @@ const Fr = (e) => {
|
|
|
2272
2373
|
continue: !t.abort
|
|
2273
2374
|
});
|
|
2274
2375
|
};
|
|
2275
|
-
}),
|
|
2276
|
-
t.pattern ?? (t.pattern =
|
|
2277
|
-
}),
|
|
2278
|
-
t.pattern ?? (t.pattern =
|
|
2279
|
-
}),
|
|
2280
|
-
|
|
2281
|
-
const n =
|
|
2376
|
+
}), ro = /* @__PURE__ */ d("$ZodCheckLowerCase", (e, t) => {
|
|
2377
|
+
t.pattern ?? (t.pattern = Hr), le.init(e, t);
|
|
2378
|
+
}), oo = /* @__PURE__ */ d("$ZodCheckUpperCase", (e, t) => {
|
|
2379
|
+
t.pattern ?? (t.pattern = Kr), le.init(e, t);
|
|
2380
|
+
}), io = /* @__PURE__ */ d("$ZodCheckIncludes", (e, t) => {
|
|
2381
|
+
P.init(e, t);
|
|
2382
|
+
const n = H(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
|
|
2282
2383
|
t.pattern = r, e._zod.onattach.push((o) => {
|
|
2283
2384
|
const i = o._zod.bag;
|
|
2284
2385
|
i.patterns ?? (i.patterns = /* @__PURE__ */ new Set()), i.patterns.add(r);
|
|
@@ -2293,9 +2394,9 @@ const Fr = (e) => {
|
|
|
2293
2394
|
continue: !t.abort
|
|
2294
2395
|
});
|
|
2295
2396
|
};
|
|
2296
|
-
}),
|
|
2297
|
-
|
|
2298
|
-
const n = new RegExp(`^${
|
|
2397
|
+
}), so = /* @__PURE__ */ d("$ZodCheckStartsWith", (e, t) => {
|
|
2398
|
+
P.init(e, t);
|
|
2399
|
+
const n = new RegExp(`^${H(t.prefix)}.*`);
|
|
2299
2400
|
t.pattern ?? (t.pattern = n), e._zod.onattach.push((r) => {
|
|
2300
2401
|
const o = r._zod.bag;
|
|
2301
2402
|
o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(n);
|
|
@@ -2310,9 +2411,9 @@ const Fr = (e) => {
|
|
|
2310
2411
|
continue: !t.abort
|
|
2311
2412
|
});
|
|
2312
2413
|
};
|
|
2313
|
-
}),
|
|
2314
|
-
|
|
2315
|
-
const n = new RegExp(`.*${
|
|
2414
|
+
}), ao = /* @__PURE__ */ d("$ZodCheckEndsWith", (e, t) => {
|
|
2415
|
+
P.init(e, t);
|
|
2416
|
+
const n = new RegExp(`.*${H(t.suffix)}$`);
|
|
2316
2417
|
t.pattern ?? (t.pattern = n), e._zod.onattach.push((r) => {
|
|
2317
2418
|
const o = r._zod.bag;
|
|
2318
2419
|
o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(n);
|
|
@@ -2327,12 +2428,12 @@ const Fr = (e) => {
|
|
|
2327
2428
|
continue: !t.abort
|
|
2328
2429
|
});
|
|
2329
2430
|
};
|
|
2330
|
-
}),
|
|
2331
|
-
|
|
2431
|
+
}), co = /* @__PURE__ */ d("$ZodCheckOverwrite", (e, t) => {
|
|
2432
|
+
P.init(e, t), e._zod.check = (n) => {
|
|
2332
2433
|
n.value = t.tx(n.value);
|
|
2333
2434
|
};
|
|
2334
2435
|
});
|
|
2335
|
-
class
|
|
2436
|
+
class uo {
|
|
2336
2437
|
constructor(t = []) {
|
|
2337
2438
|
this.content = [], this.indent = 0, this && (this.args = t);
|
|
2338
2439
|
}
|
|
@@ -2355,13 +2456,13 @@ class oo {
|
|
|
2355
2456
|
`));
|
|
2356
2457
|
}
|
|
2357
2458
|
}
|
|
2358
|
-
const
|
|
2459
|
+
const lo = {
|
|
2359
2460
|
major: 4,
|
|
2360
2461
|
minor: 3,
|
|
2361
2462
|
patch: 6
|
|
2362
|
-
},
|
|
2463
|
+
}, z = /* @__PURE__ */ d("$ZodType", (e, t) => {
|
|
2363
2464
|
var n;
|
|
2364
|
-
e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version =
|
|
2465
|
+
e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = lo;
|
|
2365
2466
|
const r = [...e._zod.def.checks ?? []];
|
|
2366
2467
|
e._zod.traits.has("$ZodCheck") && r.unshift(e);
|
|
2367
2468
|
for (const o of r)
|
|
@@ -2373,34 +2474,34 @@ const io = {
|
|
|
2373
2474
|
});
|
|
2374
2475
|
else {
|
|
2375
2476
|
const o = (s, a, c) => {
|
|
2376
|
-
let u =
|
|
2477
|
+
let u = V(s), l;
|
|
2377
2478
|
for (const f of a) {
|
|
2378
2479
|
if (f._zod.def.when) {
|
|
2379
2480
|
if (!f._zod.def.when(s))
|
|
2380
2481
|
continue;
|
|
2381
2482
|
} else if (u)
|
|
2382
2483
|
continue;
|
|
2383
|
-
const
|
|
2384
|
-
if (
|
|
2385
|
-
throw new
|
|
2386
|
-
if (l ||
|
|
2484
|
+
const p = s.issues.length, g = f._zod.check(s);
|
|
2485
|
+
if (g instanceof Promise && c?.async === !1)
|
|
2486
|
+
throw new B();
|
|
2487
|
+
if (l || g instanceof Promise)
|
|
2387
2488
|
l = (l ?? Promise.resolve()).then(async () => {
|
|
2388
|
-
await
|
|
2489
|
+
await g, s.issues.length !== p && (u || (u = V(s, p)));
|
|
2389
2490
|
});
|
|
2390
2491
|
else {
|
|
2391
|
-
if (s.issues.length ===
|
|
2492
|
+
if (s.issues.length === p)
|
|
2392
2493
|
continue;
|
|
2393
|
-
u || (u =
|
|
2494
|
+
u || (u = V(s, p));
|
|
2394
2495
|
}
|
|
2395
2496
|
}
|
|
2396
2497
|
return l ? l.then(() => s) : s;
|
|
2397
2498
|
}, i = (s, a, c) => {
|
|
2398
|
-
if (
|
|
2499
|
+
if (V(s))
|
|
2399
2500
|
return s.aborted = !0, s;
|
|
2400
2501
|
const u = o(a, r, c);
|
|
2401
2502
|
if (u instanceof Promise) {
|
|
2402
2503
|
if (c.async === !1)
|
|
2403
|
-
throw new
|
|
2504
|
+
throw new B();
|
|
2404
2505
|
return u.then((l) => e._zod.parse(l, c));
|
|
2405
2506
|
}
|
|
2406
2507
|
return e._zod.parse(u, c);
|
|
@@ -2415,26 +2516,26 @@ const io = {
|
|
|
2415
2516
|
const c = e._zod.parse(s, a);
|
|
2416
2517
|
if (c instanceof Promise) {
|
|
2417
2518
|
if (a.async === !1)
|
|
2418
|
-
throw new
|
|
2519
|
+
throw new B();
|
|
2419
2520
|
return c.then((u) => o(u, r, a));
|
|
2420
2521
|
}
|
|
2421
2522
|
return o(c, r, a);
|
|
2422
2523
|
};
|
|
2423
2524
|
}
|
|
2424
|
-
|
|
2525
|
+
v(e, "~standard", () => ({
|
|
2425
2526
|
validate: (o) => {
|
|
2426
2527
|
try {
|
|
2427
|
-
const i =
|
|
2528
|
+
const i = mr(e, o);
|
|
2428
2529
|
return i.success ? { value: i.data } : { issues: i.error?.issues };
|
|
2429
2530
|
} catch {
|
|
2430
|
-
return
|
|
2531
|
+
return _r(e, o).then((s) => s.success ? { value: s.data } : { issues: s.error?.issues });
|
|
2431
2532
|
}
|
|
2432
2533
|
},
|
|
2433
2534
|
vendor: "zod",
|
|
2434
2535
|
version: 1
|
|
2435
2536
|
}));
|
|
2436
2537
|
}), Se = /* @__PURE__ */ d("$ZodString", (e, t) => {
|
|
2437
|
-
|
|
2538
|
+
z.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? Gr(e._zod.bag), e._zod.parse = (n, r) => {
|
|
2438
2539
|
if (t.coerce)
|
|
2439
2540
|
try {
|
|
2440
2541
|
n.value = String(n.value);
|
|
@@ -2447,11 +2548,11 @@ const io = {
|
|
|
2447
2548
|
inst: e
|
|
2448
2549
|
}), n;
|
|
2449
2550
|
};
|
|
2450
|
-
}),
|
|
2451
|
-
|
|
2452
|
-
}),
|
|
2453
|
-
t.pattern ?? (t.pattern =
|
|
2454
|
-
}),
|
|
2551
|
+
}), b = /* @__PURE__ */ d("$ZodStringFormat", (e, t) => {
|
|
2552
|
+
le.init(e, t), Se.init(e, t);
|
|
2553
|
+
}), fo = /* @__PURE__ */ d("$ZodGUID", (e, t) => {
|
|
2554
|
+
t.pattern ?? (t.pattern = Nr), b.init(e, t);
|
|
2555
|
+
}), po = /* @__PURE__ */ d("$ZodUUID", (e, t) => {
|
|
2455
2556
|
if (t.version) {
|
|
2456
2557
|
const r = {
|
|
2457
2558
|
v1: 1,
|
|
@@ -2468,11 +2569,11 @@ const io = {
|
|
|
2468
2569
|
t.pattern ?? (t.pattern = Re(r));
|
|
2469
2570
|
} else
|
|
2470
2571
|
t.pattern ?? (t.pattern = Re());
|
|
2471
|
-
|
|
2472
|
-
}),
|
|
2473
|
-
t.pattern ?? (t.pattern =
|
|
2474
|
-
}),
|
|
2475
|
-
|
|
2572
|
+
b.init(e, t);
|
|
2573
|
+
}), go = /* @__PURE__ */ d("$ZodEmail", (e, t) => {
|
|
2574
|
+
t.pattern ?? (t.pattern = Cr), b.init(e, t);
|
|
2575
|
+
}), ho = /* @__PURE__ */ d("$ZodURL", (e, t) => {
|
|
2576
|
+
b.init(e, t), e._zod.check = (n) => {
|
|
2476
2577
|
try {
|
|
2477
2578
|
const r = n.value.trim(), o = new URL(r);
|
|
2478
2579
|
t.hostname && (t.hostname.lastIndex = 0, t.hostname.test(o.hostname) || n.issues.push({
|
|
@@ -2503,32 +2604,32 @@ const io = {
|
|
|
2503
2604
|
});
|
|
2504
2605
|
}
|
|
2505
2606
|
};
|
|
2506
|
-
}),
|
|
2507
|
-
t.pattern ?? (t.pattern =
|
|
2508
|
-
}),
|
|
2509
|
-
t.pattern ?? (t.pattern =
|
|
2510
|
-
}),
|
|
2511
|
-
t.pattern ?? (t.pattern =
|
|
2512
|
-
}),
|
|
2513
|
-
t.pattern ?? (t.pattern =
|
|
2514
|
-
}),
|
|
2515
|
-
t.pattern ?? (t.pattern =
|
|
2516
|
-
}),
|
|
2517
|
-
t.pattern ?? (t.pattern =
|
|
2518
|
-
}),
|
|
2519
|
-
t.pattern ?? (t.pattern =
|
|
2520
|
-
}),
|
|
2521
|
-
t.pattern ?? (t.pattern =
|
|
2522
|
-
}),
|
|
2523
|
-
t.pattern ?? (t.pattern =
|
|
2524
|
-
}),
|
|
2525
|
-
t.pattern ?? (t.pattern =
|
|
2526
|
-
}),
|
|
2527
|
-
t.pattern ?? (t.pattern =
|
|
2528
|
-
}),
|
|
2529
|
-
t.pattern ?? (t.pattern =
|
|
2530
|
-
}),
|
|
2531
|
-
t.pattern ?? (t.pattern =
|
|
2607
|
+
}), mo = /* @__PURE__ */ d("$ZodEmoji", (e, t) => {
|
|
2608
|
+
t.pattern ?? (t.pattern = jr()), b.init(e, t);
|
|
2609
|
+
}), _o = /* @__PURE__ */ d("$ZodNanoID", (e, t) => {
|
|
2610
|
+
t.pattern ?? (t.pattern = Pr), b.init(e, t);
|
|
2611
|
+
}), yo = /* @__PURE__ */ d("$ZodCUID", (e, t) => {
|
|
2612
|
+
t.pattern ?? (t.pattern = Er), b.init(e, t);
|
|
2613
|
+
}), vo = /* @__PURE__ */ d("$ZodCUID2", (e, t) => {
|
|
2614
|
+
t.pattern ?? (t.pattern = Zr), b.init(e, t);
|
|
2615
|
+
}), wo = /* @__PURE__ */ d("$ZodULID", (e, t) => {
|
|
2616
|
+
t.pattern ?? (t.pattern = Tr), b.init(e, t);
|
|
2617
|
+
}), bo = /* @__PURE__ */ d("$ZodXID", (e, t) => {
|
|
2618
|
+
t.pattern ?? (t.pattern = Ir), b.init(e, t);
|
|
2619
|
+
}), ko = /* @__PURE__ */ d("$ZodKSUID", (e, t) => {
|
|
2620
|
+
t.pattern ?? (t.pattern = Or), b.init(e, t);
|
|
2621
|
+
}), zo = /* @__PURE__ */ d("$ZodISODateTime", (e, t) => {
|
|
2622
|
+
t.pattern ?? (t.pattern = Vr(t)), b.init(e, t);
|
|
2623
|
+
}), $o = /* @__PURE__ */ d("$ZodISODate", (e, t) => {
|
|
2624
|
+
t.pattern ?? (t.pattern = Jr), b.init(e, t);
|
|
2625
|
+
}), So = /* @__PURE__ */ d("$ZodISOTime", (e, t) => {
|
|
2626
|
+
t.pattern ?? (t.pattern = qr(t)), b.init(e, t);
|
|
2627
|
+
}), Eo = /* @__PURE__ */ d("$ZodISODuration", (e, t) => {
|
|
2628
|
+
t.pattern ?? (t.pattern = Ar), b.init(e, t);
|
|
2629
|
+
}), Zo = /* @__PURE__ */ d("$ZodIPv4", (e, t) => {
|
|
2630
|
+
t.pattern ?? (t.pattern = Dr), b.init(e, t), e._zod.bag.format = "ipv4";
|
|
2631
|
+
}), To = /* @__PURE__ */ d("$ZodIPv6", (e, t) => {
|
|
2632
|
+
t.pattern ?? (t.pattern = Lr), b.init(e, t), e._zod.bag.format = "ipv6", e._zod.check = (n) => {
|
|
2532
2633
|
try {
|
|
2533
2634
|
new URL(`http://[${n.value}]`);
|
|
2534
2635
|
} catch {
|
|
@@ -2541,10 +2642,10 @@ const io = {
|
|
|
2541
2642
|
});
|
|
2542
2643
|
}
|
|
2543
2644
|
};
|
|
2544
|
-
}),
|
|
2545
|
-
t.pattern ?? (t.pattern =
|
|
2546
|
-
}),
|
|
2547
|
-
t.pattern ?? (t.pattern =
|
|
2645
|
+
}), Io = /* @__PURE__ */ d("$ZodCIDRv4", (e, t) => {
|
|
2646
|
+
t.pattern ?? (t.pattern = Ur), b.init(e, t);
|
|
2647
|
+
}), Oo = /* @__PURE__ */ d("$ZodCIDRv6", (e, t) => {
|
|
2648
|
+
t.pattern ?? (t.pattern = Mr), b.init(e, t), e._zod.check = (n) => {
|
|
2548
2649
|
const r = n.value.split("/");
|
|
2549
2650
|
try {
|
|
2550
2651
|
if (r.length !== 2)
|
|
@@ -2580,8 +2681,8 @@ function bt(e) {
|
|
|
2580
2681
|
return !1;
|
|
2581
2682
|
}
|
|
2582
2683
|
}
|
|
2583
|
-
const
|
|
2584
|
-
t.pattern ?? (t.pattern =
|
|
2684
|
+
const Po = /* @__PURE__ */ d("$ZodBase64", (e, t) => {
|
|
2685
|
+
t.pattern ?? (t.pattern = Fr), b.init(e, t), e._zod.bag.contentEncoding = "base64", e._zod.check = (n) => {
|
|
2585
2686
|
bt(n.value) || n.issues.push({
|
|
2586
2687
|
code: "invalid_format",
|
|
2587
2688
|
format: "base64",
|
|
@@ -2591,15 +2692,15 @@ const Eo = /* @__PURE__ */ d("$ZodBase64", (e, t) => {
|
|
|
2591
2692
|
});
|
|
2592
2693
|
};
|
|
2593
2694
|
});
|
|
2594
|
-
function
|
|
2695
|
+
function Ao(e) {
|
|
2595
2696
|
if (!gt.test(e))
|
|
2596
2697
|
return !1;
|
|
2597
2698
|
const t = e.replace(/[-_]/g, (r) => r === "-" ? "+" : "/"), n = t.padEnd(Math.ceil(t.length / 4) * 4, "=");
|
|
2598
2699
|
return bt(n);
|
|
2599
2700
|
}
|
|
2600
|
-
const
|
|
2601
|
-
t.pattern ?? (t.pattern = gt),
|
|
2602
|
-
|
|
2701
|
+
const No = /* @__PURE__ */ d("$ZodBase64URL", (e, t) => {
|
|
2702
|
+
t.pattern ?? (t.pattern = gt), b.init(e, t), e._zod.bag.contentEncoding = "base64url", e._zod.check = (n) => {
|
|
2703
|
+
Ao(n.value) || n.issues.push({
|
|
2603
2704
|
code: "invalid_format",
|
|
2604
2705
|
format: "base64url",
|
|
2605
2706
|
input: n.value,
|
|
@@ -2607,10 +2708,10 @@ const To = /* @__PURE__ */ d("$ZodBase64URL", (e, t) => {
|
|
|
2607
2708
|
continue: !t.abort
|
|
2608
2709
|
});
|
|
2609
2710
|
};
|
|
2610
|
-
}),
|
|
2611
|
-
t.pattern ?? (t.pattern =
|
|
2711
|
+
}), Co = /* @__PURE__ */ d("$ZodE164", (e, t) => {
|
|
2712
|
+
t.pattern ?? (t.pattern = xr), b.init(e, t);
|
|
2612
2713
|
});
|
|
2613
|
-
function
|
|
2714
|
+
function Ro(e, t = null) {
|
|
2614
2715
|
try {
|
|
2615
2716
|
const n = e.split(".");
|
|
2616
2717
|
if (n.length !== 3)
|
|
@@ -2624,9 +2725,9 @@ function Oo(e, t = null) {
|
|
|
2624
2725
|
return !1;
|
|
2625
2726
|
}
|
|
2626
2727
|
}
|
|
2627
|
-
const
|
|
2628
|
-
|
|
2629
|
-
|
|
2728
|
+
const jo = /* @__PURE__ */ d("$ZodJWT", (e, t) => {
|
|
2729
|
+
b.init(e, t), e._zod.check = (n) => {
|
|
2730
|
+
Ro(n.value, t.alg) || n.issues.push({
|
|
2630
2731
|
code: "invalid_format",
|
|
2631
2732
|
format: "jwt",
|
|
2632
2733
|
input: n.value,
|
|
@@ -2635,7 +2736,7 @@ const Po = /* @__PURE__ */ d("$ZodJWT", (e, t) => {
|
|
|
2635
2736
|
});
|
|
2636
2737
|
};
|
|
2637
2738
|
}), kt = /* @__PURE__ */ d("$ZodNumber", (e, t) => {
|
|
2638
|
-
|
|
2739
|
+
z.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? _t, e._zod.parse = (n, r) => {
|
|
2639
2740
|
if (t.coerce)
|
|
2640
2741
|
try {
|
|
2641
2742
|
n.value = Number(n.value);
|
|
@@ -2653,10 +2754,10 @@ const Po = /* @__PURE__ */ d("$ZodJWT", (e, t) => {
|
|
|
2653
2754
|
...i ? { received: i } : {}
|
|
2654
2755
|
}), n;
|
|
2655
2756
|
};
|
|
2656
|
-
}),
|
|
2657
|
-
|
|
2658
|
-
}),
|
|
2659
|
-
|
|
2757
|
+
}), Do = /* @__PURE__ */ d("$ZodNumberFormat", (e, t) => {
|
|
2758
|
+
Qr.init(e, t), kt.init(e, t);
|
|
2759
|
+
}), Lo = /* @__PURE__ */ d("$ZodBoolean", (e, t) => {
|
|
2760
|
+
z.init(e, t), e._zod.pattern = Wr, e._zod.parse = (n, r) => {
|
|
2660
2761
|
if (t.coerce)
|
|
2661
2762
|
try {
|
|
2662
2763
|
n.value = !!n.value;
|
|
@@ -2670,21 +2771,21 @@ const Po = /* @__PURE__ */ d("$ZodJWT", (e, t) => {
|
|
|
2670
2771
|
inst: e
|
|
2671
2772
|
}), n;
|
|
2672
2773
|
};
|
|
2673
|
-
}),
|
|
2674
|
-
|
|
2675
|
-
}),
|
|
2676
|
-
|
|
2774
|
+
}), Uo = /* @__PURE__ */ d("$ZodUnknown", (e, t) => {
|
|
2775
|
+
z.init(e, t), e._zod.parse = (n) => n;
|
|
2776
|
+
}), Mo = /* @__PURE__ */ d("$ZodNever", (e, t) => {
|
|
2777
|
+
z.init(e, t), e._zod.parse = (n, r) => (n.issues.push({
|
|
2677
2778
|
expected: "never",
|
|
2678
2779
|
code: "invalid_type",
|
|
2679
2780
|
input: n.value,
|
|
2680
2781
|
inst: e
|
|
2681
2782
|
}), n);
|
|
2682
2783
|
});
|
|
2683
|
-
function
|
|
2684
|
-
e.issues.length && t.issues.push(...
|
|
2784
|
+
function je(e, t, n) {
|
|
2785
|
+
e.issues.length && t.issues.push(...G(n, e.issues)), t.value[n] = e.value;
|
|
2685
2786
|
}
|
|
2686
|
-
const
|
|
2687
|
-
|
|
2787
|
+
const Fo = /* @__PURE__ */ d("$ZodArray", (e, t) => {
|
|
2788
|
+
z.init(e, t), e._zod.parse = (n, r) => {
|
|
2688
2789
|
const o = n.value;
|
|
2689
2790
|
if (!Array.isArray(o))
|
|
2690
2791
|
return n.issues.push({
|
|
@@ -2700,16 +2801,16 @@ const Do = /* @__PURE__ */ d("$ZodArray", (e, t) => {
|
|
|
2700
2801
|
value: a,
|
|
2701
2802
|
issues: []
|
|
2702
2803
|
}, r);
|
|
2703
|
-
c instanceof Promise ? i.push(c.then((u) =>
|
|
2804
|
+
c instanceof Promise ? i.push(c.then((u) => je(u, n, s))) : je(c, n, s);
|
|
2704
2805
|
}
|
|
2705
2806
|
return i.length ? Promise.all(i).then(() => n) : n;
|
|
2706
2807
|
};
|
|
2707
2808
|
});
|
|
2708
|
-
function
|
|
2809
|
+
function se(e, t, n, r, o) {
|
|
2709
2810
|
if (e.issues.length) {
|
|
2710
2811
|
if (o && !(n in r))
|
|
2711
2812
|
return;
|
|
2712
|
-
t.issues.push(...
|
|
2813
|
+
t.issues.push(...G(n, e.issues));
|
|
2713
2814
|
}
|
|
2714
2815
|
e.value === void 0 ? n in r && (t.value[n] = void 0) : t.value[n] = e.value;
|
|
2715
2816
|
}
|
|
@@ -2718,7 +2819,7 @@ function zt(e) {
|
|
|
2718
2819
|
for (const r of t)
|
|
2719
2820
|
if (!e.shape?.[r]?._zod?.traits?.has("$ZodType"))
|
|
2720
2821
|
throw new Error(`Invalid element at key "${r}": expected a Zod schema`);
|
|
2721
|
-
const n =
|
|
2822
|
+
const n = ir(e.shape);
|
|
2722
2823
|
return {
|
|
2723
2824
|
...e,
|
|
2724
2825
|
keys: t,
|
|
@@ -2736,8 +2837,8 @@ function $t(e, t, n, r, o, i) {
|
|
|
2736
2837
|
s.push(f);
|
|
2737
2838
|
continue;
|
|
2738
2839
|
}
|
|
2739
|
-
const
|
|
2740
|
-
|
|
2840
|
+
const p = c.run({ value: t[f], issues: [] }, r);
|
|
2841
|
+
p instanceof Promise ? e.push(p.then((g) => se(g, n, f, t, l))) : se(p, n, f, t, l);
|
|
2741
2842
|
}
|
|
2742
2843
|
return s.length && n.issues.push({
|
|
2743
2844
|
code: "unrecognized_keys",
|
|
@@ -2746,8 +2847,8 @@ function $t(e, t, n, r, o, i) {
|
|
|
2746
2847
|
inst: i
|
|
2747
2848
|
}), e.length ? Promise.all(e).then(() => n) : n;
|
|
2748
2849
|
}
|
|
2749
|
-
const
|
|
2750
|
-
if (
|
|
2850
|
+
const xo = /* @__PURE__ */ d("$ZodObject", (e, t) => {
|
|
2851
|
+
if (z.init(e, t), !Object.getOwnPropertyDescriptor(t, "shape")?.get) {
|
|
2751
2852
|
const a = t.shape;
|
|
2752
2853
|
Object.defineProperty(t, "shape", {
|
|
2753
2854
|
get: () => {
|
|
@@ -2759,7 +2860,7 @@ const jo = /* @__PURE__ */ d("$ZodObject", (e, t) => {
|
|
|
2759
2860
|
});
|
|
2760
2861
|
}
|
|
2761
2862
|
const r = ve(() => zt(t));
|
|
2762
|
-
|
|
2863
|
+
v(e._zod, "propValues", () => {
|
|
2763
2864
|
const a = t.shape, c = {};
|
|
2764
2865
|
for (const u in a) {
|
|
2765
2866
|
const l = a[u]._zod;
|
|
@@ -2771,7 +2872,7 @@ const jo = /* @__PURE__ */ d("$ZodObject", (e, t) => {
|
|
|
2771
2872
|
}
|
|
2772
2873
|
return c;
|
|
2773
2874
|
});
|
|
2774
|
-
const o =
|
|
2875
|
+
const o = ie, i = t.catchall;
|
|
2775
2876
|
let s;
|
|
2776
2877
|
e._zod.parse = (a, c) => {
|
|
2777
2878
|
s ?? (s = r.value);
|
|
@@ -2785,98 +2886,98 @@ const jo = /* @__PURE__ */ d("$ZodObject", (e, t) => {
|
|
|
2785
2886
|
}), a;
|
|
2786
2887
|
a.value = {};
|
|
2787
2888
|
const l = [], f = s.shape;
|
|
2788
|
-
for (const
|
|
2789
|
-
const
|
|
2790
|
-
|
|
2889
|
+
for (const p of s.keys) {
|
|
2890
|
+
const g = f[p], y = g._zod.optout === "optional", _ = g._zod.run({ value: u[p], issues: [] }, c);
|
|
2891
|
+
_ instanceof Promise ? l.push(_.then((m) => se(m, a, p, u, y))) : se(_, a, p, u, y);
|
|
2791
2892
|
}
|
|
2792
2893
|
return i ? $t(l, u, a, c, r.value, e) : l.length ? Promise.all(l).then(() => a) : a;
|
|
2793
2894
|
};
|
|
2794
|
-
}),
|
|
2795
|
-
|
|
2796
|
-
const n = e._zod.parse, r = ve(() => zt(t)), o = (
|
|
2797
|
-
const
|
|
2798
|
-
const
|
|
2799
|
-
return `shape[${
|
|
2895
|
+
}), Jo = /* @__PURE__ */ d("$ZodObjectJIT", (e, t) => {
|
|
2896
|
+
xo.init(e, t);
|
|
2897
|
+
const n = e._zod.parse, r = ve(() => zt(t)), o = (p) => {
|
|
2898
|
+
const g = new uo(["shape", "payload", "ctx"]), y = r.value, _ = (C) => {
|
|
2899
|
+
const O = Ce(C);
|
|
2900
|
+
return `shape[${O}]._zod.run({ value: input[${O}], issues: [] }, ctx)`;
|
|
2800
2901
|
};
|
|
2801
|
-
|
|
2802
|
-
const
|
|
2803
|
-
let
|
|
2804
|
-
for (const
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
for (const
|
|
2808
|
-
const
|
|
2809
|
-
|
|
2810
|
-
if (${
|
|
2811
|
-
if (${
|
|
2812
|
-
payload.issues = payload.issues.concat(${
|
|
2902
|
+
g.write("const input = payload.value;");
|
|
2903
|
+
const m = /* @__PURE__ */ Object.create(null);
|
|
2904
|
+
let k = 0;
|
|
2905
|
+
for (const C of y.keys)
|
|
2906
|
+
m[C] = `key_${k++}`;
|
|
2907
|
+
g.write("const newResult = {};");
|
|
2908
|
+
for (const C of y.keys) {
|
|
2909
|
+
const O = m[C], N = Ce(C), jt = p[C]?._zod?.optout === "optional";
|
|
2910
|
+
g.write(`const ${O} = ${_(C)};`), jt ? g.write(`
|
|
2911
|
+
if (${O}.issues.length) {
|
|
2912
|
+
if (${N} in input) {
|
|
2913
|
+
payload.issues = payload.issues.concat(${O}.issues.map(iss => ({
|
|
2813
2914
|
...iss,
|
|
2814
|
-
path: iss.path ? [${
|
|
2915
|
+
path: iss.path ? [${N}, ...iss.path] : [${N}]
|
|
2815
2916
|
})));
|
|
2816
2917
|
}
|
|
2817
2918
|
}
|
|
2818
2919
|
|
|
2819
|
-
if (${
|
|
2820
|
-
if (${
|
|
2821
|
-
newResult[${
|
|
2920
|
+
if (${O}.value === undefined) {
|
|
2921
|
+
if (${N} in input) {
|
|
2922
|
+
newResult[${N}] = undefined;
|
|
2822
2923
|
}
|
|
2823
2924
|
} else {
|
|
2824
|
-
newResult[${
|
|
2925
|
+
newResult[${N}] = ${O}.value;
|
|
2825
2926
|
}
|
|
2826
2927
|
|
|
2827
|
-
`) :
|
|
2828
|
-
if (${
|
|
2829
|
-
payload.issues = payload.issues.concat(${
|
|
2928
|
+
`) : g.write(`
|
|
2929
|
+
if (${O}.issues.length) {
|
|
2930
|
+
payload.issues = payload.issues.concat(${O}.issues.map(iss => ({
|
|
2830
2931
|
...iss,
|
|
2831
|
-
path: iss.path ? [${
|
|
2932
|
+
path: iss.path ? [${N}, ...iss.path] : [${N}]
|
|
2832
2933
|
})));
|
|
2833
2934
|
}
|
|
2834
2935
|
|
|
2835
|
-
if (${
|
|
2836
|
-
if (${
|
|
2837
|
-
newResult[${
|
|
2936
|
+
if (${O}.value === undefined) {
|
|
2937
|
+
if (${N} in input) {
|
|
2938
|
+
newResult[${N}] = undefined;
|
|
2838
2939
|
}
|
|
2839
2940
|
} else {
|
|
2840
|
-
newResult[${
|
|
2941
|
+
newResult[${N}] = ${O}.value;
|
|
2841
2942
|
}
|
|
2842
2943
|
|
|
2843
2944
|
`);
|
|
2844
2945
|
}
|
|
2845
|
-
|
|
2846
|
-
const
|
|
2847
|
-
return (
|
|
2946
|
+
g.write("payload.value = newResult;"), g.write("return payload;");
|
|
2947
|
+
const I = g.compile();
|
|
2948
|
+
return (C, O) => I(p, C, O);
|
|
2848
2949
|
};
|
|
2849
2950
|
let i;
|
|
2850
|
-
const s =
|
|
2951
|
+
const s = ie, a = !at.jitless, u = a && rr.value, l = t.catchall;
|
|
2851
2952
|
let f;
|
|
2852
|
-
e._zod.parse = (
|
|
2953
|
+
e._zod.parse = (p, g) => {
|
|
2853
2954
|
f ?? (f = r.value);
|
|
2854
|
-
const
|
|
2855
|
-
return s(
|
|
2955
|
+
const y = p.value;
|
|
2956
|
+
return s(y) ? a && u && g?.async === !1 && g.jitless !== !0 ? (i || (i = o(t.shape)), p = i(p, g), l ? $t([], y, p, g, f, e) : p) : n(p, g) : (p.issues.push({
|
|
2856
2957
|
expected: "object",
|
|
2857
2958
|
code: "invalid_type",
|
|
2858
|
-
input:
|
|
2959
|
+
input: y,
|
|
2859
2960
|
inst: e
|
|
2860
|
-
}),
|
|
2961
|
+
}), p);
|
|
2861
2962
|
};
|
|
2862
2963
|
});
|
|
2863
|
-
function
|
|
2964
|
+
function De(e, t, n, r) {
|
|
2864
2965
|
for (const i of e)
|
|
2865
2966
|
if (i.issues.length === 0)
|
|
2866
2967
|
return t.value = i.value, t;
|
|
2867
|
-
const o = e.filter((i) => !
|
|
2968
|
+
const o = e.filter((i) => !V(i));
|
|
2868
2969
|
return o.length === 1 ? (t.value = o[0].value, o[0]) : (t.issues.push({
|
|
2869
2970
|
code: "invalid_union",
|
|
2870
2971
|
input: t.value,
|
|
2871
2972
|
inst: n,
|
|
2872
|
-
errors: e.map((i) => i.issues.map((s) =>
|
|
2973
|
+
errors: e.map((i) => i.issues.map((s) => U(s, r, L())))
|
|
2873
2974
|
}), t);
|
|
2874
2975
|
}
|
|
2875
|
-
const
|
|
2876
|
-
|
|
2976
|
+
const qo = /* @__PURE__ */ d("$ZodUnion", (e, t) => {
|
|
2977
|
+
z.init(e, t), v(e._zod, "optin", () => t.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0), v(e._zod, "optout", () => t.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0), v(e._zod, "values", () => {
|
|
2877
2978
|
if (t.options.every((o) => o._zod.values))
|
|
2878
2979
|
return new Set(t.options.flatMap((o) => Array.from(o._zod.values)));
|
|
2879
|
-
}),
|
|
2980
|
+
}), v(e._zod, "pattern", () => {
|
|
2880
2981
|
if (t.options.every((o) => o._zod.pattern)) {
|
|
2881
2982
|
const o = t.options.map((i) => i._zod.pattern);
|
|
2882
2983
|
return new RegExp(`^(${o.map((i) => be(i.source)).join("|")})$`);
|
|
@@ -2901,10 +3002,10 @@ const Uo = /* @__PURE__ */ d("$ZodUnion", (e, t) => {
|
|
|
2901
3002
|
a.push(u);
|
|
2902
3003
|
}
|
|
2903
3004
|
}
|
|
2904
|
-
return s ? Promise.all(a).then((c) =>
|
|
3005
|
+
return s ? Promise.all(a).then((c) => De(c, o, e, i)) : De(a, o, e, i);
|
|
2905
3006
|
};
|
|
2906
|
-
}),
|
|
2907
|
-
|
|
3007
|
+
}), Vo = /* @__PURE__ */ d("$ZodIntersection", (e, t) => {
|
|
3008
|
+
z.init(e, t), e._zod.parse = (n, r) => {
|
|
2908
3009
|
const o = n.value, i = t.left._zod.run({ value: o, issues: [] }, r), s = t.right._zod.run({ value: o, issues: [] }, r);
|
|
2909
3010
|
return i instanceof Promise || s instanceof Promise ? Promise.all([i, s]).then(([c, u]) => Le(n, c, u)) : Le(n, i, s);
|
|
2910
3011
|
};
|
|
@@ -2914,7 +3015,7 @@ function he(e, t) {
|
|
|
2914
3015
|
return { valid: !0, data: e };
|
|
2915
3016
|
if (e instanceof Date && t instanceof Date && +e == +t)
|
|
2916
3017
|
return { valid: !0, data: e };
|
|
2917
|
-
if (
|
|
3018
|
+
if (W(e) && W(t)) {
|
|
2918
3019
|
const n = Object.keys(t), r = Object.keys(e).filter((i) => n.indexOf(i) !== -1), o = { ...e, ...t };
|
|
2919
3020
|
for (const i of r) {
|
|
2920
3021
|
const s = he(e[i], t[i]);
|
|
@@ -2961,17 +3062,17 @@ function Le(e, t, n) {
|
|
|
2961
3062
|
else
|
|
2962
3063
|
e.issues.push(a);
|
|
2963
3064
|
const i = [...r].filter(([, a]) => a.l && a.r).map(([a]) => a);
|
|
2964
|
-
if (i.length && o && e.issues.push({ ...o, keys: i }),
|
|
3065
|
+
if (i.length && o && e.issues.push({ ...o, keys: i }), V(e))
|
|
2965
3066
|
return e;
|
|
2966
3067
|
const s = he(t.value, n.value);
|
|
2967
3068
|
if (!s.valid)
|
|
2968
3069
|
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);
|
|
2969
3070
|
return e.value = s.data, e;
|
|
2970
3071
|
}
|
|
2971
|
-
const
|
|
2972
|
-
|
|
3072
|
+
const Go = /* @__PURE__ */ d("$ZodRecord", (e, t) => {
|
|
3073
|
+
z.init(e, t), e._zod.parse = (n, r) => {
|
|
2973
3074
|
const o = n.value;
|
|
2974
|
-
if (!
|
|
3075
|
+
if (!W(o))
|
|
2975
3076
|
return n.issues.push({
|
|
2976
3077
|
expected: "record",
|
|
2977
3078
|
code: "invalid_type",
|
|
@@ -2987,8 +3088,8 @@ const Fo = /* @__PURE__ */ d("$ZodRecord", (e, t) => {
|
|
|
2987
3088
|
a.add(typeof u == "number" ? u.toString() : u);
|
|
2988
3089
|
const l = t.valueType._zod.run({ value: o[u], issues: [] }, r);
|
|
2989
3090
|
l instanceof Promise ? i.push(l.then((f) => {
|
|
2990
|
-
f.issues.length && n.issues.push(...
|
|
2991
|
-
})) : (l.issues.length && n.issues.push(...
|
|
3091
|
+
f.issues.length && n.issues.push(...G(u, f.issues)), n.value[u] = f.value;
|
|
3092
|
+
})) : (l.issues.length && n.issues.push(...G(u, l.issues)), n.value[u] = l.value);
|
|
2992
3093
|
}
|
|
2993
3094
|
let c;
|
|
2994
3095
|
for (const u in o)
|
|
@@ -3017,7 +3118,7 @@ const Fo = /* @__PURE__ */ d("$ZodRecord", (e, t) => {
|
|
|
3017
3118
|
t.mode === "loose" ? n.value[a] = o[a] : n.issues.push({
|
|
3018
3119
|
code: "invalid_key",
|
|
3019
3120
|
origin: "record",
|
|
3020
|
-
issues: c.issues.map((f) =>
|
|
3121
|
+
issues: c.issues.map((f) => U(f, r, L())),
|
|
3021
3122
|
input: a,
|
|
3022
3123
|
path: [a],
|
|
3023
3124
|
inst: e
|
|
@@ -3026,16 +3127,16 @@ const Fo = /* @__PURE__ */ d("$ZodRecord", (e, t) => {
|
|
|
3026
3127
|
}
|
|
3027
3128
|
const l = t.valueType._zod.run({ value: o[a], issues: [] }, r);
|
|
3028
3129
|
l instanceof Promise ? i.push(l.then((f) => {
|
|
3029
|
-
f.issues.length && n.issues.push(...
|
|
3030
|
-
})) : (l.issues.length && n.issues.push(...
|
|
3130
|
+
f.issues.length && n.issues.push(...G(a, f.issues)), n.value[c.value] = f.value;
|
|
3131
|
+
})) : (l.issues.length && n.issues.push(...G(a, l.issues)), n.value[c.value] = l.value);
|
|
3031
3132
|
}
|
|
3032
3133
|
}
|
|
3033
3134
|
return i.length ? Promise.all(i).then(() => n) : n;
|
|
3034
3135
|
};
|
|
3035
|
-
}),
|
|
3036
|
-
|
|
3136
|
+
}), Bo = /* @__PURE__ */ d("$ZodEnum", (e, t) => {
|
|
3137
|
+
z.init(e, t);
|
|
3037
3138
|
const n = ct(t.entries), r = new Set(n);
|
|
3038
|
-
e._zod.values = r, e._zod.pattern = new RegExp(`^(${n.filter((o) =>
|
|
3139
|
+
e._zod.values = r, e._zod.pattern = new RegExp(`^(${n.filter((o) => or.has(typeof o)).map((o) => typeof o == "string" ? H(o) : o.toString()).join("|")})$`), e._zod.parse = (o, i) => {
|
|
3039
3140
|
const s = o.value;
|
|
3040
3141
|
return r.has(s) || o.issues.push({
|
|
3041
3142
|
code: "invalid_value",
|
|
@@ -3044,11 +3145,11 @@ const Fo = /* @__PURE__ */ d("$ZodRecord", (e, t) => {
|
|
|
3044
3145
|
inst: e
|
|
3045
3146
|
}), o;
|
|
3046
3147
|
};
|
|
3047
|
-
}),
|
|
3048
|
-
if (
|
|
3148
|
+
}), Wo = /* @__PURE__ */ d("$ZodLiteral", (e, t) => {
|
|
3149
|
+
if (z.init(e, t), t.values.length === 0)
|
|
3049
3150
|
throw new Error("Cannot create literal schema with no valid values");
|
|
3050
3151
|
const n = new Set(t.values);
|
|
3051
|
-
e._zod.values = n, e._zod.pattern = new RegExp(`^(${t.values.map((r) => typeof r == "string" ?
|
|
3152
|
+
e._zod.values = n, e._zod.pattern = new RegExp(`^(${t.values.map((r) => typeof r == "string" ? H(r) : r ? H(r.toString()) : String(r)).join("|")})$`), e._zod.parse = (r, o) => {
|
|
3052
3153
|
const i = r.value;
|
|
3053
3154
|
return n.has(i) || r.issues.push({
|
|
3054
3155
|
code: "invalid_value",
|
|
@@ -3057,15 +3158,15 @@ const Fo = /* @__PURE__ */ d("$ZodRecord", (e, t) => {
|
|
|
3057
3158
|
inst: e
|
|
3058
3159
|
}), r;
|
|
3059
3160
|
};
|
|
3060
|
-
}),
|
|
3061
|
-
|
|
3161
|
+
}), Ho = /* @__PURE__ */ d("$ZodTransform", (e, t) => {
|
|
3162
|
+
z.init(e, t), e._zod.parse = (n, r) => {
|
|
3062
3163
|
if (r.direction === "backward")
|
|
3063
3164
|
throw new st(e.constructor.name);
|
|
3064
3165
|
const o = t.transform(n.value, n);
|
|
3065
3166
|
if (r.async)
|
|
3066
3167
|
return (o instanceof Promise ? o : Promise.resolve(o)).then((s) => (n.value = s, n));
|
|
3067
3168
|
if (o instanceof Promise)
|
|
3068
|
-
throw new
|
|
3169
|
+
throw new B();
|
|
3069
3170
|
return n.value = o, n;
|
|
3070
3171
|
};
|
|
3071
3172
|
});
|
|
@@ -3073,7 +3174,7 @@ function Ue(e, t) {
|
|
|
3073
3174
|
return e.issues.length && t === void 0 ? { issues: [], value: void 0 } : e;
|
|
3074
3175
|
}
|
|
3075
3176
|
const St = /* @__PURE__ */ d("$ZodOptional", (e, t) => {
|
|
3076
|
-
|
|
3177
|
+
z.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", v(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), v(e._zod, "pattern", () => {
|
|
3077
3178
|
const n = t.innerType._zod.pattern;
|
|
3078
3179
|
return n ? new RegExp(`^(${be(n.source)})?$`) : void 0;
|
|
3079
3180
|
}), e._zod.parse = (n, r) => {
|
|
@@ -3083,15 +3184,15 @@ const St = /* @__PURE__ */ d("$ZodOptional", (e, t) => {
|
|
|
3083
3184
|
}
|
|
3084
3185
|
return n.value === void 0 ? n : t.innerType._zod.run(n, r);
|
|
3085
3186
|
};
|
|
3086
|
-
}),
|
|
3087
|
-
St.init(e, t),
|
|
3088
|
-
}),
|
|
3089
|
-
|
|
3187
|
+
}), Ko = /* @__PURE__ */ d("$ZodExactOptional", (e, t) => {
|
|
3188
|
+
St.init(e, t), v(e._zod, "values", () => t.innerType._zod.values), v(e._zod, "pattern", () => t.innerType._zod.pattern), e._zod.parse = (n, r) => t.innerType._zod.run(n, r);
|
|
3189
|
+
}), Yo = /* @__PURE__ */ d("$ZodNullable", (e, t) => {
|
|
3190
|
+
z.init(e, t), v(e._zod, "optin", () => t.innerType._zod.optin), v(e._zod, "optout", () => t.innerType._zod.optout), v(e._zod, "pattern", () => {
|
|
3090
3191
|
const n = t.innerType._zod.pattern;
|
|
3091
3192
|
return n ? new RegExp(`^(${be(n.source)}|null)$`) : void 0;
|
|
3092
|
-
}),
|
|
3093
|
-
}),
|
|
3094
|
-
|
|
3193
|
+
}), v(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (n, r) => n.value === null ? n : t.innerType._zod.run(n, r);
|
|
3194
|
+
}), Qo = /* @__PURE__ */ d("$ZodDefault", (e, t) => {
|
|
3195
|
+
z.init(e, t), e._zod.optin = "optional", v(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
|
|
3095
3196
|
if (r.direction === "backward")
|
|
3096
3197
|
return t.innerType._zod.run(n, r);
|
|
3097
3198
|
if (n.value === void 0)
|
|
@@ -3103,10 +3204,10 @@ const St = /* @__PURE__ */ d("$ZodOptional", (e, t) => {
|
|
|
3103
3204
|
function Me(e, t) {
|
|
3104
3205
|
return e.value === void 0 && (e.value = t.defaultValue), e;
|
|
3105
3206
|
}
|
|
3106
|
-
const
|
|
3107
|
-
|
|
3108
|
-
}),
|
|
3109
|
-
|
|
3207
|
+
const Xo = /* @__PURE__ */ d("$ZodPrefault", (e, t) => {
|
|
3208
|
+
z.init(e, t), e._zod.optin = "optional", v(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => (r.direction === "backward" || n.value === void 0 && (n.value = t.defaultValue), t.innerType._zod.run(n, r));
|
|
3209
|
+
}), ei = /* @__PURE__ */ d("$ZodNonOptional", (e, t) => {
|
|
3210
|
+
z.init(e, t), v(e._zod, "values", () => {
|
|
3110
3211
|
const n = t.innerType._zod.values;
|
|
3111
3212
|
return n ? new Set([...n].filter((r) => r !== void 0)) : void 0;
|
|
3112
3213
|
}), e._zod.parse = (n, r) => {
|
|
@@ -3122,58 +3223,58 @@ function Fe(e, t) {
|
|
|
3122
3223
|
inst: t
|
|
3123
3224
|
}), e;
|
|
3124
3225
|
}
|
|
3125
|
-
const
|
|
3126
|
-
|
|
3226
|
+
const ti = /* @__PURE__ */ d("$ZodCatch", (e, t) => {
|
|
3227
|
+
z.init(e, t), v(e._zod, "optin", () => t.innerType._zod.optin), v(e._zod, "optout", () => t.innerType._zod.optout), v(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
|
|
3127
3228
|
if (r.direction === "backward")
|
|
3128
3229
|
return t.innerType._zod.run(n, r);
|
|
3129
3230
|
const o = t.innerType._zod.run(n, r);
|
|
3130
3231
|
return o instanceof Promise ? o.then((i) => (n.value = i.value, i.issues.length && (n.value = t.catchValue({
|
|
3131
3232
|
...n,
|
|
3132
3233
|
error: {
|
|
3133
|
-
issues: i.issues.map((s) =>
|
|
3234
|
+
issues: i.issues.map((s) => U(s, r, L()))
|
|
3134
3235
|
},
|
|
3135
3236
|
input: n.value
|
|
3136
3237
|
}), n.issues = []), n)) : (n.value = o.value, o.issues.length && (n.value = t.catchValue({
|
|
3137
3238
|
...n,
|
|
3138
3239
|
error: {
|
|
3139
|
-
issues: o.issues.map((i) =>
|
|
3240
|
+
issues: o.issues.map((i) => U(i, r, L()))
|
|
3140
3241
|
},
|
|
3141
3242
|
input: n.value
|
|
3142
3243
|
}), n.issues = []), n);
|
|
3143
3244
|
};
|
|
3144
|
-
}),
|
|
3145
|
-
|
|
3245
|
+
}), ni = /* @__PURE__ */ d("$ZodPipe", (e, t) => {
|
|
3246
|
+
z.init(e, t), v(e._zod, "values", () => t.in._zod.values), v(e._zod, "optin", () => t.in._zod.optin), v(e._zod, "optout", () => t.out._zod.optout), v(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (n, r) => {
|
|
3146
3247
|
if (r.direction === "backward") {
|
|
3147
3248
|
const i = t.out._zod.run(n, r);
|
|
3148
|
-
return i instanceof Promise ? i.then((s) =>
|
|
3249
|
+
return i instanceof Promise ? i.then((s) => re(s, t.in, r)) : re(i, t.in, r);
|
|
3149
3250
|
}
|
|
3150
3251
|
const o = t.in._zod.run(n, r);
|
|
3151
|
-
return o instanceof Promise ? o.then((i) =>
|
|
3252
|
+
return o instanceof Promise ? o.then((i) => re(i, t.out, r)) : re(o, t.out, r);
|
|
3152
3253
|
};
|
|
3153
3254
|
});
|
|
3154
|
-
function
|
|
3255
|
+
function re(e, t, n) {
|
|
3155
3256
|
return e.issues.length ? (e.aborted = !0, e) : t._zod.run({ value: e.value, issues: e.issues }, n);
|
|
3156
3257
|
}
|
|
3157
|
-
const
|
|
3158
|
-
|
|
3258
|
+
const ri = /* @__PURE__ */ d("$ZodReadonly", (e, t) => {
|
|
3259
|
+
z.init(e, t), v(e._zod, "propValues", () => t.innerType._zod.propValues), v(e._zod, "values", () => t.innerType._zod.values), v(e._zod, "optin", () => t.innerType?._zod?.optin), v(e._zod, "optout", () => t.innerType?._zod?.optout), e._zod.parse = (n, r) => {
|
|
3159
3260
|
if (r.direction === "backward")
|
|
3160
3261
|
return t.innerType._zod.run(n, r);
|
|
3161
3262
|
const o = t.innerType._zod.run(n, r);
|
|
3162
|
-
return o instanceof Promise ? o.then(
|
|
3263
|
+
return o instanceof Promise ? o.then(xe) : xe(o);
|
|
3163
3264
|
};
|
|
3164
3265
|
});
|
|
3165
|
-
function
|
|
3266
|
+
function xe(e) {
|
|
3166
3267
|
return e.value = Object.freeze(e.value), e;
|
|
3167
3268
|
}
|
|
3168
|
-
const
|
|
3169
|
-
|
|
3269
|
+
const oi = /* @__PURE__ */ d("$ZodCustom", (e, t) => {
|
|
3270
|
+
P.init(e, t), z.init(e, t), e._zod.parse = (n, r) => n, e._zod.check = (n) => {
|
|
3170
3271
|
const r = n.value, o = t.fn(r);
|
|
3171
3272
|
if (o instanceof Promise)
|
|
3172
|
-
return o.then((i) =>
|
|
3173
|
-
|
|
3273
|
+
return o.then((i) => Je(i, n, r, e));
|
|
3274
|
+
Je(o, n, r, e);
|
|
3174
3275
|
};
|
|
3175
3276
|
});
|
|
3176
|
-
function
|
|
3277
|
+
function Je(e, t, n, r) {
|
|
3177
3278
|
if (!e) {
|
|
3178
3279
|
const o = {
|
|
3179
3280
|
code: "custom",
|
|
@@ -3185,11 +3286,11 @@ function xe(e, t, n, r) {
|
|
|
3185
3286
|
continue: !r._zod.def.abort
|
|
3186
3287
|
// params: inst._zod.def.params,
|
|
3187
3288
|
};
|
|
3188
|
-
r._zod.def.params && (o.params = r._zod.def.params), t.issues.push(
|
|
3289
|
+
r._zod.def.params && (o.params = r._zod.def.params), t.issues.push(te(o));
|
|
3189
3290
|
}
|
|
3190
3291
|
}
|
|
3191
3292
|
var qe;
|
|
3192
|
-
class
|
|
3293
|
+
class ii {
|
|
3193
3294
|
constructor() {
|
|
3194
3295
|
this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
|
|
3195
3296
|
}
|
|
@@ -3218,20 +3319,20 @@ class ei {
|
|
|
3218
3319
|
return this._map.has(t);
|
|
3219
3320
|
}
|
|
3220
3321
|
}
|
|
3221
|
-
function
|
|
3222
|
-
return new
|
|
3322
|
+
function si() {
|
|
3323
|
+
return new ii();
|
|
3223
3324
|
}
|
|
3224
|
-
(qe = globalThis).__zod_globalRegistry ?? (qe.__zod_globalRegistry =
|
|
3225
|
-
const
|
|
3325
|
+
(qe = globalThis).__zod_globalRegistry ?? (qe.__zod_globalRegistry = si());
|
|
3326
|
+
const X = globalThis.__zod_globalRegistry;
|
|
3226
3327
|
// @__NO_SIDE_EFFECTS__
|
|
3227
|
-
function
|
|
3328
|
+
function ai(e, t) {
|
|
3228
3329
|
return new e({
|
|
3229
3330
|
type: "string",
|
|
3230
3331
|
...h(t)
|
|
3231
3332
|
});
|
|
3232
3333
|
}
|
|
3233
3334
|
// @__NO_SIDE_EFFECTS__
|
|
3234
|
-
function
|
|
3335
|
+
function ci(e, t) {
|
|
3235
3336
|
return new e({
|
|
3236
3337
|
type: "string",
|
|
3237
3338
|
format: "email",
|
|
@@ -3251,7 +3352,7 @@ function Ve(e, t) {
|
|
|
3251
3352
|
});
|
|
3252
3353
|
}
|
|
3253
3354
|
// @__NO_SIDE_EFFECTS__
|
|
3254
|
-
function
|
|
3355
|
+
function ui(e, t) {
|
|
3255
3356
|
return new e({
|
|
3256
3357
|
type: "string",
|
|
3257
3358
|
format: "uuid",
|
|
@@ -3261,7 +3362,7 @@ function oi(e, t) {
|
|
|
3261
3362
|
});
|
|
3262
3363
|
}
|
|
3263
3364
|
// @__NO_SIDE_EFFECTS__
|
|
3264
|
-
function
|
|
3365
|
+
function di(e, t) {
|
|
3265
3366
|
return new e({
|
|
3266
3367
|
type: "string",
|
|
3267
3368
|
format: "uuid",
|
|
@@ -3272,7 +3373,7 @@ function ii(e, t) {
|
|
|
3272
3373
|
});
|
|
3273
3374
|
}
|
|
3274
3375
|
// @__NO_SIDE_EFFECTS__
|
|
3275
|
-
function
|
|
3376
|
+
function li(e, t) {
|
|
3276
3377
|
return new e({
|
|
3277
3378
|
type: "string",
|
|
3278
3379
|
format: "uuid",
|
|
@@ -3283,7 +3384,7 @@ function si(e, t) {
|
|
|
3283
3384
|
});
|
|
3284
3385
|
}
|
|
3285
3386
|
// @__NO_SIDE_EFFECTS__
|
|
3286
|
-
function
|
|
3387
|
+
function fi(e, t) {
|
|
3287
3388
|
return new e({
|
|
3288
3389
|
type: "string",
|
|
3289
3390
|
format: "uuid",
|
|
@@ -3294,7 +3395,7 @@ function ai(e, t) {
|
|
|
3294
3395
|
});
|
|
3295
3396
|
}
|
|
3296
3397
|
// @__NO_SIDE_EFFECTS__
|
|
3297
|
-
function
|
|
3398
|
+
function pi(e, t) {
|
|
3298
3399
|
return new e({
|
|
3299
3400
|
type: "string",
|
|
3300
3401
|
format: "url",
|
|
@@ -3304,7 +3405,7 @@ function ci(e, t) {
|
|
|
3304
3405
|
});
|
|
3305
3406
|
}
|
|
3306
3407
|
// @__NO_SIDE_EFFECTS__
|
|
3307
|
-
function
|
|
3408
|
+
function gi(e, t) {
|
|
3308
3409
|
return new e({
|
|
3309
3410
|
type: "string",
|
|
3310
3411
|
format: "emoji",
|
|
@@ -3314,7 +3415,7 @@ function ui(e, t) {
|
|
|
3314
3415
|
});
|
|
3315
3416
|
}
|
|
3316
3417
|
// @__NO_SIDE_EFFECTS__
|
|
3317
|
-
function
|
|
3418
|
+
function hi(e, t) {
|
|
3318
3419
|
return new e({
|
|
3319
3420
|
type: "string",
|
|
3320
3421
|
format: "nanoid",
|
|
@@ -3324,7 +3425,7 @@ function di(e, t) {
|
|
|
3324
3425
|
});
|
|
3325
3426
|
}
|
|
3326
3427
|
// @__NO_SIDE_EFFECTS__
|
|
3327
|
-
function
|
|
3428
|
+
function mi(e, t) {
|
|
3328
3429
|
return new e({
|
|
3329
3430
|
type: "string",
|
|
3330
3431
|
format: "cuid",
|
|
@@ -3334,7 +3435,7 @@ function li(e, t) {
|
|
|
3334
3435
|
});
|
|
3335
3436
|
}
|
|
3336
3437
|
// @__NO_SIDE_EFFECTS__
|
|
3337
|
-
function
|
|
3438
|
+
function _i(e, t) {
|
|
3338
3439
|
return new e({
|
|
3339
3440
|
type: "string",
|
|
3340
3441
|
format: "cuid2",
|
|
@@ -3344,7 +3445,7 @@ function fi(e, t) {
|
|
|
3344
3445
|
});
|
|
3345
3446
|
}
|
|
3346
3447
|
// @__NO_SIDE_EFFECTS__
|
|
3347
|
-
function
|
|
3448
|
+
function yi(e, t) {
|
|
3348
3449
|
return new e({
|
|
3349
3450
|
type: "string",
|
|
3350
3451
|
format: "ulid",
|
|
@@ -3354,7 +3455,7 @@ function pi(e, t) {
|
|
|
3354
3455
|
});
|
|
3355
3456
|
}
|
|
3356
3457
|
// @__NO_SIDE_EFFECTS__
|
|
3357
|
-
function
|
|
3458
|
+
function vi(e, t) {
|
|
3358
3459
|
return new e({
|
|
3359
3460
|
type: "string",
|
|
3360
3461
|
format: "xid",
|
|
@@ -3364,7 +3465,7 @@ function gi(e, t) {
|
|
|
3364
3465
|
});
|
|
3365
3466
|
}
|
|
3366
3467
|
// @__NO_SIDE_EFFECTS__
|
|
3367
|
-
function
|
|
3468
|
+
function wi(e, t) {
|
|
3368
3469
|
return new e({
|
|
3369
3470
|
type: "string",
|
|
3370
3471
|
format: "ksuid",
|
|
@@ -3374,7 +3475,7 @@ function hi(e, t) {
|
|
|
3374
3475
|
});
|
|
3375
3476
|
}
|
|
3376
3477
|
// @__NO_SIDE_EFFECTS__
|
|
3377
|
-
function
|
|
3478
|
+
function bi(e, t) {
|
|
3378
3479
|
return new e({
|
|
3379
3480
|
type: "string",
|
|
3380
3481
|
format: "ipv4",
|
|
@@ -3384,7 +3485,7 @@ function mi(e, t) {
|
|
|
3384
3485
|
});
|
|
3385
3486
|
}
|
|
3386
3487
|
// @__NO_SIDE_EFFECTS__
|
|
3387
|
-
function
|
|
3488
|
+
function ki(e, t) {
|
|
3388
3489
|
return new e({
|
|
3389
3490
|
type: "string",
|
|
3390
3491
|
format: "ipv6",
|
|
@@ -3394,7 +3495,7 @@ function _i(e, t) {
|
|
|
3394
3495
|
});
|
|
3395
3496
|
}
|
|
3396
3497
|
// @__NO_SIDE_EFFECTS__
|
|
3397
|
-
function
|
|
3498
|
+
function zi(e, t) {
|
|
3398
3499
|
return new e({
|
|
3399
3500
|
type: "string",
|
|
3400
3501
|
format: "cidrv4",
|
|
@@ -3404,7 +3505,7 @@ function yi(e, t) {
|
|
|
3404
3505
|
});
|
|
3405
3506
|
}
|
|
3406
3507
|
// @__NO_SIDE_EFFECTS__
|
|
3407
|
-
function
|
|
3508
|
+
function $i(e, t) {
|
|
3408
3509
|
return new e({
|
|
3409
3510
|
type: "string",
|
|
3410
3511
|
format: "cidrv6",
|
|
@@ -3414,7 +3515,7 @@ function vi(e, t) {
|
|
|
3414
3515
|
});
|
|
3415
3516
|
}
|
|
3416
3517
|
// @__NO_SIDE_EFFECTS__
|
|
3417
|
-
function
|
|
3518
|
+
function Si(e, t) {
|
|
3418
3519
|
return new e({
|
|
3419
3520
|
type: "string",
|
|
3420
3521
|
format: "base64",
|
|
@@ -3424,7 +3525,7 @@ function wi(e, t) {
|
|
|
3424
3525
|
});
|
|
3425
3526
|
}
|
|
3426
3527
|
// @__NO_SIDE_EFFECTS__
|
|
3427
|
-
function
|
|
3528
|
+
function Ei(e, t) {
|
|
3428
3529
|
return new e({
|
|
3429
3530
|
type: "string",
|
|
3430
3531
|
format: "base64url",
|
|
@@ -3434,7 +3535,7 @@ function bi(e, t) {
|
|
|
3434
3535
|
});
|
|
3435
3536
|
}
|
|
3436
3537
|
// @__NO_SIDE_EFFECTS__
|
|
3437
|
-
function
|
|
3538
|
+
function Zi(e, t) {
|
|
3438
3539
|
return new e({
|
|
3439
3540
|
type: "string",
|
|
3440
3541
|
format: "e164",
|
|
@@ -3444,7 +3545,7 @@ function ki(e, t) {
|
|
|
3444
3545
|
});
|
|
3445
3546
|
}
|
|
3446
3547
|
// @__NO_SIDE_EFFECTS__
|
|
3447
|
-
function
|
|
3548
|
+
function Ti(e, t) {
|
|
3448
3549
|
return new e({
|
|
3449
3550
|
type: "string",
|
|
3450
3551
|
format: "jwt",
|
|
@@ -3454,7 +3555,7 @@ function zi(e, t) {
|
|
|
3454
3555
|
});
|
|
3455
3556
|
}
|
|
3456
3557
|
// @__NO_SIDE_EFFECTS__
|
|
3457
|
-
function
|
|
3558
|
+
function Ii(e, t) {
|
|
3458
3559
|
return new e({
|
|
3459
3560
|
type: "string",
|
|
3460
3561
|
format: "datetime",
|
|
@@ -3466,7 +3567,7 @@ function $i(e, t) {
|
|
|
3466
3567
|
});
|
|
3467
3568
|
}
|
|
3468
3569
|
// @__NO_SIDE_EFFECTS__
|
|
3469
|
-
function
|
|
3570
|
+
function Oi(e, t) {
|
|
3470
3571
|
return new e({
|
|
3471
3572
|
type: "string",
|
|
3472
3573
|
format: "date",
|
|
@@ -3475,7 +3576,7 @@ function Si(e, t) {
|
|
|
3475
3576
|
});
|
|
3476
3577
|
}
|
|
3477
3578
|
// @__NO_SIDE_EFFECTS__
|
|
3478
|
-
function
|
|
3579
|
+
function Pi(e, t) {
|
|
3479
3580
|
return new e({
|
|
3480
3581
|
type: "string",
|
|
3481
3582
|
format: "time",
|
|
@@ -3485,7 +3586,7 @@ function Ei(e, t) {
|
|
|
3485
3586
|
});
|
|
3486
3587
|
}
|
|
3487
3588
|
// @__NO_SIDE_EFFECTS__
|
|
3488
|
-
function
|
|
3589
|
+
function Ai(e, t) {
|
|
3489
3590
|
return new e({
|
|
3490
3591
|
type: "string",
|
|
3491
3592
|
format: "duration",
|
|
@@ -3494,7 +3595,7 @@ function Zi(e, t) {
|
|
|
3494
3595
|
});
|
|
3495
3596
|
}
|
|
3496
3597
|
// @__NO_SIDE_EFFECTS__
|
|
3497
|
-
function
|
|
3598
|
+
function Ni(e, t) {
|
|
3498
3599
|
return new e({
|
|
3499
3600
|
type: "number",
|
|
3500
3601
|
checks: [],
|
|
@@ -3502,7 +3603,7 @@ function Ti(e, t) {
|
|
|
3502
3603
|
});
|
|
3503
3604
|
}
|
|
3504
3605
|
// @__NO_SIDE_EFFECTS__
|
|
3505
|
-
function
|
|
3606
|
+
function Ci(e, t) {
|
|
3506
3607
|
return new e({
|
|
3507
3608
|
type: "number",
|
|
3508
3609
|
check: "number_format",
|
|
@@ -3512,27 +3613,27 @@ function Ii(e, t) {
|
|
|
3512
3613
|
});
|
|
3513
3614
|
}
|
|
3514
3615
|
// @__NO_SIDE_EFFECTS__
|
|
3515
|
-
function
|
|
3616
|
+
function Ri(e, t) {
|
|
3516
3617
|
return new e({
|
|
3517
3618
|
type: "boolean",
|
|
3518
3619
|
...h(t)
|
|
3519
3620
|
});
|
|
3520
3621
|
}
|
|
3521
3622
|
// @__NO_SIDE_EFFECTS__
|
|
3522
|
-
function
|
|
3623
|
+
function ji(e) {
|
|
3523
3624
|
return new e({
|
|
3524
3625
|
type: "unknown"
|
|
3525
3626
|
});
|
|
3526
3627
|
}
|
|
3527
3628
|
// @__NO_SIDE_EFFECTS__
|
|
3528
|
-
function
|
|
3629
|
+
function Di(e, t) {
|
|
3529
3630
|
return new e({
|
|
3530
3631
|
type: "never",
|
|
3531
3632
|
...h(t)
|
|
3532
3633
|
});
|
|
3533
3634
|
}
|
|
3534
3635
|
// @__NO_SIDE_EFFECTS__
|
|
3535
|
-
function
|
|
3636
|
+
function Ge(e, t) {
|
|
3536
3637
|
return new vt({
|
|
3537
3638
|
check: "less_than",
|
|
3538
3639
|
...h(t),
|
|
@@ -3550,7 +3651,7 @@ function fe(e, t) {
|
|
|
3550
3651
|
});
|
|
3551
3652
|
}
|
|
3552
3653
|
// @__NO_SIDE_EFFECTS__
|
|
3553
|
-
function
|
|
3654
|
+
function Be(e, t) {
|
|
3554
3655
|
return new wt({
|
|
3555
3656
|
check: "greater_than",
|
|
3556
3657
|
...h(t),
|
|
@@ -3569,7 +3670,7 @@ function pe(e, t) {
|
|
|
3569
3670
|
}
|
|
3570
3671
|
// @__NO_SIDE_EFFECTS__
|
|
3571
3672
|
function We(e, t) {
|
|
3572
|
-
return new
|
|
3673
|
+
return new Yr({
|
|
3573
3674
|
check: "multiple_of",
|
|
3574
3675
|
...h(t),
|
|
3575
3676
|
value: e
|
|
@@ -3577,15 +3678,15 @@ function We(e, t) {
|
|
|
3577
3678
|
}
|
|
3578
3679
|
// @__NO_SIDE_EFFECTS__
|
|
3579
3680
|
function Et(e, t) {
|
|
3580
|
-
return new
|
|
3681
|
+
return new Xr({
|
|
3581
3682
|
check: "max_length",
|
|
3582
3683
|
...h(t),
|
|
3583
3684
|
maximum: e
|
|
3584
3685
|
});
|
|
3585
3686
|
}
|
|
3586
3687
|
// @__NO_SIDE_EFFECTS__
|
|
3587
|
-
function
|
|
3588
|
-
return new
|
|
3688
|
+
function ae(e, t) {
|
|
3689
|
+
return new eo({
|
|
3589
3690
|
check: "min_length",
|
|
3590
3691
|
...h(t),
|
|
3591
3692
|
minimum: e
|
|
@@ -3593,15 +3694,15 @@ function se(e, t) {
|
|
|
3593
3694
|
}
|
|
3594
3695
|
// @__NO_SIDE_EFFECTS__
|
|
3595
3696
|
function Zt(e, t) {
|
|
3596
|
-
return new
|
|
3697
|
+
return new to({
|
|
3597
3698
|
check: "length_equals",
|
|
3598
3699
|
...h(t),
|
|
3599
3700
|
length: e
|
|
3600
3701
|
});
|
|
3601
3702
|
}
|
|
3602
3703
|
// @__NO_SIDE_EFFECTS__
|
|
3603
|
-
function
|
|
3604
|
-
return new
|
|
3704
|
+
function Li(e, t) {
|
|
3705
|
+
return new no({
|
|
3605
3706
|
check: "string_format",
|
|
3606
3707
|
format: "regex",
|
|
3607
3708
|
...h(t),
|
|
@@ -3609,24 +3710,24 @@ function Ni(e, t) {
|
|
|
3609
3710
|
});
|
|
3610
3711
|
}
|
|
3611
3712
|
// @__NO_SIDE_EFFECTS__
|
|
3612
|
-
function
|
|
3613
|
-
return new
|
|
3713
|
+
function Ui(e) {
|
|
3714
|
+
return new ro({
|
|
3614
3715
|
check: "string_format",
|
|
3615
3716
|
format: "lowercase",
|
|
3616
3717
|
...h(e)
|
|
3617
3718
|
});
|
|
3618
3719
|
}
|
|
3619
3720
|
// @__NO_SIDE_EFFECTS__
|
|
3620
|
-
function
|
|
3621
|
-
return new
|
|
3721
|
+
function Mi(e) {
|
|
3722
|
+
return new oo({
|
|
3622
3723
|
check: "string_format",
|
|
3623
3724
|
format: "uppercase",
|
|
3624
3725
|
...h(e)
|
|
3625
3726
|
});
|
|
3626
3727
|
}
|
|
3627
3728
|
// @__NO_SIDE_EFFECTS__
|
|
3628
|
-
function
|
|
3629
|
-
return new
|
|
3729
|
+
function Fi(e, t) {
|
|
3730
|
+
return new io({
|
|
3630
3731
|
check: "string_format",
|
|
3631
3732
|
format: "includes",
|
|
3632
3733
|
...h(t),
|
|
@@ -3634,8 +3735,8 @@ function Di(e, t) {
|
|
|
3634
3735
|
});
|
|
3635
3736
|
}
|
|
3636
3737
|
// @__NO_SIDE_EFFECTS__
|
|
3637
|
-
function
|
|
3638
|
-
return new
|
|
3738
|
+
function xi(e, t) {
|
|
3739
|
+
return new so({
|
|
3639
3740
|
check: "string_format",
|
|
3640
3741
|
format: "starts_with",
|
|
3641
3742
|
...h(t),
|
|
@@ -3643,8 +3744,8 @@ function ji(e, t) {
|
|
|
3643
3744
|
});
|
|
3644
3745
|
}
|
|
3645
3746
|
// @__NO_SIDE_EFFECTS__
|
|
3646
|
-
function
|
|
3647
|
-
return new
|
|
3747
|
+
function Ji(e, t) {
|
|
3748
|
+
return new ao({
|
|
3648
3749
|
check: "string_format",
|
|
3649
3750
|
format: "ends_with",
|
|
3650
3751
|
...h(t),
|
|
@@ -3652,34 +3753,34 @@ function Li(e, t) {
|
|
|
3652
3753
|
});
|
|
3653
3754
|
}
|
|
3654
3755
|
// @__NO_SIDE_EFFECTS__
|
|
3655
|
-
function
|
|
3656
|
-
return new
|
|
3756
|
+
function K(e) {
|
|
3757
|
+
return new co({
|
|
3657
3758
|
check: "overwrite",
|
|
3658
3759
|
tx: e
|
|
3659
3760
|
});
|
|
3660
3761
|
}
|
|
3661
3762
|
// @__NO_SIDE_EFFECTS__
|
|
3662
|
-
function
|
|
3663
|
-
return /* @__PURE__ */
|
|
3763
|
+
function qi(e) {
|
|
3764
|
+
return /* @__PURE__ */ K((t) => t.normalize(e));
|
|
3664
3765
|
}
|
|
3665
3766
|
// @__NO_SIDE_EFFECTS__
|
|
3666
|
-
function
|
|
3667
|
-
return /* @__PURE__ */
|
|
3767
|
+
function Vi() {
|
|
3768
|
+
return /* @__PURE__ */ K((e) => e.trim());
|
|
3668
3769
|
}
|
|
3669
3770
|
// @__NO_SIDE_EFFECTS__
|
|
3670
|
-
function
|
|
3671
|
-
return /* @__PURE__ */
|
|
3771
|
+
function Gi() {
|
|
3772
|
+
return /* @__PURE__ */ K((e) => e.toLowerCase());
|
|
3672
3773
|
}
|
|
3673
3774
|
// @__NO_SIDE_EFFECTS__
|
|
3674
|
-
function
|
|
3675
|
-
return /* @__PURE__ */
|
|
3775
|
+
function Bi() {
|
|
3776
|
+
return /* @__PURE__ */ K((e) => e.toUpperCase());
|
|
3676
3777
|
}
|
|
3677
3778
|
// @__NO_SIDE_EFFECTS__
|
|
3678
|
-
function
|
|
3679
|
-
return /* @__PURE__ */
|
|
3779
|
+
function Wi() {
|
|
3780
|
+
return /* @__PURE__ */ K((e) => nr(e));
|
|
3680
3781
|
}
|
|
3681
3782
|
// @__NO_SIDE_EFFECTS__
|
|
3682
|
-
function
|
|
3783
|
+
function Hi(e, t, n) {
|
|
3683
3784
|
return new e({
|
|
3684
3785
|
type: "array",
|
|
3685
3786
|
element: t,
|
|
@@ -3690,7 +3791,7 @@ function qi(e, t, n) {
|
|
|
3690
3791
|
});
|
|
3691
3792
|
}
|
|
3692
3793
|
// @__NO_SIDE_EFFECTS__
|
|
3693
|
-
function
|
|
3794
|
+
function Ki(e, t, n) {
|
|
3694
3795
|
return new e({
|
|
3695
3796
|
type: "custom",
|
|
3696
3797
|
check: "custom",
|
|
@@ -3699,20 +3800,20 @@ function Vi(e, t, n) {
|
|
|
3699
3800
|
});
|
|
3700
3801
|
}
|
|
3701
3802
|
// @__NO_SIDE_EFFECTS__
|
|
3702
|
-
function
|
|
3703
|
-
const t = /* @__PURE__ */
|
|
3803
|
+
function Yi(e) {
|
|
3804
|
+
const t = /* @__PURE__ */ Qi((n) => (n.addIssue = (r) => {
|
|
3704
3805
|
if (typeof r == "string")
|
|
3705
|
-
n.issues.push(
|
|
3806
|
+
n.issues.push(te(r, n.value, t._zod.def));
|
|
3706
3807
|
else {
|
|
3707
3808
|
const o = r;
|
|
3708
|
-
o.fatal && (o.continue = !1), o.code ?? (o.code = "custom"), o.input ?? (o.input = n.value), o.inst ?? (o.inst = t), o.continue ?? (o.continue = !t._zod.def.abort), n.issues.push(
|
|
3809
|
+
o.fatal && (o.continue = !1), o.code ?? (o.code = "custom"), o.input ?? (o.input = n.value), o.inst ?? (o.inst = t), o.continue ?? (o.continue = !t._zod.def.abort), n.issues.push(te(o));
|
|
3709
3810
|
}
|
|
3710
3811
|
}, e(n.value, n)));
|
|
3711
3812
|
return t;
|
|
3712
3813
|
}
|
|
3713
3814
|
// @__NO_SIDE_EFFECTS__
|
|
3714
|
-
function
|
|
3715
|
-
const n = new
|
|
3815
|
+
function Qi(e, t) {
|
|
3816
|
+
const n = new P({
|
|
3716
3817
|
check: "custom",
|
|
3717
3818
|
...h(t)
|
|
3718
3819
|
});
|
|
@@ -3722,7 +3823,7 @@ function Tt(e) {
|
|
|
3722
3823
|
let t = e?.target ?? "draft-2020-12";
|
|
3723
3824
|
return t === "draft-4" && (t = "draft-04"), t === "draft-7" && (t = "draft-07"), {
|
|
3724
3825
|
processors: e.processors ?? {},
|
|
3725
|
-
metadataRegistry: e?.metadata ??
|
|
3826
|
+
metadataRegistry: e?.metadata ?? X,
|
|
3726
3827
|
target: t,
|
|
3727
3828
|
unrepresentable: e?.unrepresentable ?? "throw",
|
|
3728
3829
|
override: e?.override ?? (() => {
|
|
@@ -3735,7 +3836,7 @@ function Tt(e) {
|
|
|
3735
3836
|
external: e?.external ?? void 0
|
|
3736
3837
|
};
|
|
3737
3838
|
}
|
|
3738
|
-
function
|
|
3839
|
+
function E(e, t, n = { path: [], schemaPath: [] }) {
|
|
3739
3840
|
var r;
|
|
3740
3841
|
const o = e._zod.def, i = t.seen.get(e);
|
|
3741
3842
|
if (i)
|
|
@@ -3754,16 +3855,16 @@ function $(e, t, n = { path: [], schemaPath: [] }) {
|
|
|
3754
3855
|
if (e._zod.processJSONSchema)
|
|
3755
3856
|
e._zod.processJSONSchema(t, s.schema, l);
|
|
3756
3857
|
else {
|
|
3757
|
-
const
|
|
3758
|
-
if (!
|
|
3858
|
+
const p = s.schema, g = t.processors[o.type];
|
|
3859
|
+
if (!g)
|
|
3759
3860
|
throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);
|
|
3760
|
-
|
|
3861
|
+
g(e, t, p, l);
|
|
3761
3862
|
}
|
|
3762
3863
|
const f = e._zod.parent;
|
|
3763
|
-
f && (s.ref || (s.ref = f),
|
|
3864
|
+
f && (s.ref || (s.ref = f), E(f, t, l), t.seen.get(f).isParent = !0);
|
|
3764
3865
|
}
|
|
3765
3866
|
const c = t.metadataRegistry.get(e);
|
|
3766
|
-
return c && Object.assign(s.schema, c), t.io === "input" &&
|
|
3867
|
+
return c && Object.assign(s.schema, c), t.io === "input" && T(e) && (delete s.schema.examples, delete s.schema.default), t.io === "input" && s.schema._prefault && ((r = s.schema).default ?? (r.default = s.schema._prefault)), delete s.schema._prefault, t.seen.get(e).schema;
|
|
3767
3868
|
}
|
|
3768
3869
|
function It(e, t) {
|
|
3769
3870
|
const n = e.seen.get(t);
|
|
@@ -3782,11 +3883,11 @@ function It(e, t) {
|
|
|
3782
3883
|
const o = (s) => {
|
|
3783
3884
|
const a = e.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
3784
3885
|
if (e.external) {
|
|
3785
|
-
const f = e.external.registry.get(s[0])?.id,
|
|
3886
|
+
const f = e.external.registry.get(s[0])?.id, p = e.external.uri ?? ((y) => y);
|
|
3786
3887
|
if (f)
|
|
3787
|
-
return { ref:
|
|
3788
|
-
const
|
|
3789
|
-
return s[1].defId =
|
|
3888
|
+
return { ref: p(f) };
|
|
3889
|
+
const g = s[1].defId ?? s[1].schema.id ?? `schema${e.counter++}`;
|
|
3890
|
+
return s[1].defId = g, { defId: g, ref: `${p("__shared")}#/${a}/${g}` };
|
|
3790
3891
|
}
|
|
3791
3892
|
if (s[1] === n)
|
|
3792
3893
|
return { ref: "#" };
|
|
@@ -3848,21 +3949,21 @@ function Ot(e, t) {
|
|
|
3848
3949
|
const c = a.def ?? a.schema, u = { ...c }, l = a.ref;
|
|
3849
3950
|
if (a.ref = null, l) {
|
|
3850
3951
|
r(l);
|
|
3851
|
-
const
|
|
3852
|
-
if (
|
|
3853
|
-
for (const
|
|
3854
|
-
|
|
3855
|
-
if (
|
|
3856
|
-
for (const
|
|
3857
|
-
|
|
3952
|
+
const p = e.seen.get(l), g = p.schema;
|
|
3953
|
+
if (g.$ref && (e.target === "draft-07" || e.target === "draft-04" || e.target === "openapi-3.0") ? (c.allOf = c.allOf ?? [], c.allOf.push(g)) : Object.assign(c, g), Object.assign(c, u), s._zod.parent === l)
|
|
3954
|
+
for (const _ in c)
|
|
3955
|
+
_ === "$ref" || _ === "allOf" || _ in u || delete c[_];
|
|
3956
|
+
if (g.$ref && p.def)
|
|
3957
|
+
for (const _ in c)
|
|
3958
|
+
_ === "$ref" || _ === "allOf" || _ in p.def && JSON.stringify(c[_]) === JSON.stringify(p.def[_]) && delete c[_];
|
|
3858
3959
|
}
|
|
3859
3960
|
const f = s._zod.parent;
|
|
3860
3961
|
if (f && f !== l) {
|
|
3861
3962
|
r(f);
|
|
3862
|
-
const
|
|
3863
|
-
if (
|
|
3864
|
-
for (const
|
|
3865
|
-
|
|
3963
|
+
const p = e.seen.get(f);
|
|
3964
|
+
if (p?.schema.$ref && (c.$ref = p.schema.$ref, p.def))
|
|
3965
|
+
for (const g in c)
|
|
3966
|
+
g === "$ref" || g === "allOf" || g in p.def && JSON.stringify(c[g]) === JSON.stringify(p.def[g]) && delete c[g];
|
|
3866
3967
|
}
|
|
3867
3968
|
e.override({
|
|
3868
3969
|
zodSchema: s,
|
|
@@ -3892,8 +3993,8 @@ function Ot(e, t) {
|
|
|
3892
3993
|
value: {
|
|
3893
3994
|
...t["~standard"],
|
|
3894
3995
|
jsonSchema: {
|
|
3895
|
-
input:
|
|
3896
|
-
output:
|
|
3996
|
+
input: ce(t, "input", e.processors),
|
|
3997
|
+
output: ce(t, "output", e.processors)
|
|
3897
3998
|
}
|
|
3898
3999
|
},
|
|
3899
4000
|
enumerable: !1,
|
|
@@ -3903,7 +4004,7 @@ function Ot(e, t) {
|
|
|
3903
4004
|
throw new Error("Error converting schema to JSON.");
|
|
3904
4005
|
}
|
|
3905
4006
|
}
|
|
3906
|
-
function
|
|
4007
|
+
function T(e, t) {
|
|
3907
4008
|
const n = t ?? { seen: /* @__PURE__ */ new Set() };
|
|
3908
4009
|
if (n.seen.has(e))
|
|
3909
4010
|
return !1;
|
|
@@ -3912,57 +4013,57 @@ function E(e, t) {
|
|
|
3912
4013
|
if (r.type === "transform")
|
|
3913
4014
|
return !0;
|
|
3914
4015
|
if (r.type === "array")
|
|
3915
|
-
return
|
|
4016
|
+
return T(r.element, n);
|
|
3916
4017
|
if (r.type === "set")
|
|
3917
|
-
return
|
|
4018
|
+
return T(r.valueType, n);
|
|
3918
4019
|
if (r.type === "lazy")
|
|
3919
|
-
return
|
|
4020
|
+
return T(r.getter(), n);
|
|
3920
4021
|
if (r.type === "promise" || r.type === "optional" || r.type === "nonoptional" || r.type === "nullable" || r.type === "readonly" || r.type === "default" || r.type === "prefault")
|
|
3921
|
-
return
|
|
4022
|
+
return T(r.innerType, n);
|
|
3922
4023
|
if (r.type === "intersection")
|
|
3923
|
-
return
|
|
4024
|
+
return T(r.left, n) || T(r.right, n);
|
|
3924
4025
|
if (r.type === "record" || r.type === "map")
|
|
3925
|
-
return
|
|
4026
|
+
return T(r.keyType, n) || T(r.valueType, n);
|
|
3926
4027
|
if (r.type === "pipe")
|
|
3927
|
-
return
|
|
4028
|
+
return T(r.in, n) || T(r.out, n);
|
|
3928
4029
|
if (r.type === "object") {
|
|
3929
4030
|
for (const o in r.shape)
|
|
3930
|
-
if (
|
|
4031
|
+
if (T(r.shape[o], n))
|
|
3931
4032
|
return !0;
|
|
3932
4033
|
return !1;
|
|
3933
4034
|
}
|
|
3934
4035
|
if (r.type === "union") {
|
|
3935
4036
|
for (const o of r.options)
|
|
3936
|
-
if (
|
|
4037
|
+
if (T(o, n))
|
|
3937
4038
|
return !0;
|
|
3938
4039
|
return !1;
|
|
3939
4040
|
}
|
|
3940
4041
|
if (r.type === "tuple") {
|
|
3941
4042
|
for (const o of r.items)
|
|
3942
|
-
if (
|
|
4043
|
+
if (T(o, n))
|
|
3943
4044
|
return !0;
|
|
3944
|
-
return !!(r.rest &&
|
|
4045
|
+
return !!(r.rest && T(r.rest, n));
|
|
3945
4046
|
}
|
|
3946
4047
|
return !1;
|
|
3947
4048
|
}
|
|
3948
|
-
const
|
|
4049
|
+
const Xi = (e, t = {}) => (n) => {
|
|
3949
4050
|
const r = Tt({ ...n, processors: t });
|
|
3950
|
-
return
|
|
3951
|
-
},
|
|
4051
|
+
return E(e, r), It(r, e), Ot(r, e);
|
|
4052
|
+
}, ce = (e, t, n = {}) => (r) => {
|
|
3952
4053
|
const { libraryOptions: o, target: i } = r ?? {}, s = Tt({ ...o ?? {}, target: i, io: t, processors: n });
|
|
3953
|
-
return
|
|
3954
|
-
},
|
|
4054
|
+
return E(e, s), It(s, e), Ot(s, e);
|
|
4055
|
+
}, es = {
|
|
3955
4056
|
guid: "uuid",
|
|
3956
4057
|
url: "uri",
|
|
3957
4058
|
datetime: "date-time",
|
|
3958
4059
|
json_string: "json-string",
|
|
3959
4060
|
regex: ""
|
|
3960
4061
|
// do not set
|
|
3961
|
-
},
|
|
4062
|
+
}, ts = (e, t, n, r) => {
|
|
3962
4063
|
const o = n;
|
|
3963
4064
|
o.type = "string";
|
|
3964
4065
|
const { minimum: i, maximum: s, format: a, patterns: c, contentEncoding: u } = e._zod.bag;
|
|
3965
|
-
if (typeof i == "number" && (o.minLength = i), typeof s == "number" && (o.maxLength = s), a && (o.format =
|
|
4066
|
+
if (typeof i == "number" && (o.minLength = i), typeof s == "number" && (o.maxLength = s), a && (o.format = es[a] ?? a, o.format === "" && delete o.format, a === "time" && delete o.format), u && (o.contentEncoding = u), c && c.size > 0) {
|
|
3966
4067
|
const l = [...c];
|
|
3967
4068
|
l.length === 1 ? o.pattern = l[0].source : l.length > 1 && (o.allOf = [
|
|
3968
4069
|
...l.map((f) => ({
|
|
@@ -3971,18 +4072,18 @@ const Wi = (e, t = {}) => (n) => {
|
|
|
3971
4072
|
}))
|
|
3972
4073
|
]);
|
|
3973
4074
|
}
|
|
3974
|
-
},
|
|
4075
|
+
}, ns = (e, t, n, r) => {
|
|
3975
4076
|
const o = n, { minimum: i, maximum: s, format: a, multipleOf: c, exclusiveMaximum: u, exclusiveMinimum: l } = e._zod.bag;
|
|
3976
4077
|
typeof a == "string" && a.includes("int") ? o.type = "integer" : o.type = "number", typeof l == "number" && (t.target === "draft-04" || t.target === "openapi-3.0" ? (o.minimum = l, o.exclusiveMinimum = !0) : o.exclusiveMinimum = l), typeof i == "number" && (o.minimum = i, typeof l == "number" && t.target !== "draft-04" && (l >= i ? delete o.minimum : delete o.exclusiveMinimum)), typeof u == "number" && (t.target === "draft-04" || t.target === "openapi-3.0" ? (o.maximum = u, o.exclusiveMaximum = !0) : o.exclusiveMaximum = u), typeof s == "number" && (o.maximum = s, typeof u == "number" && t.target !== "draft-04" && (u <= s ? delete o.maximum : delete o.exclusiveMaximum)), typeof c == "number" && (o.multipleOf = c);
|
|
3977
|
-
},
|
|
4078
|
+
}, rs = (e, t, n, r) => {
|
|
3978
4079
|
n.type = "boolean";
|
|
3979
|
-
},
|
|
4080
|
+
}, os = (e, t, n, r) => {
|
|
3980
4081
|
n.not = {};
|
|
3981
|
-
},
|
|
3982
|
-
},
|
|
4082
|
+
}, is = (e, t, n, r) => {
|
|
4083
|
+
}, ss = (e, t, n, r) => {
|
|
3983
4084
|
const o = e._zod.def, i = ct(o.entries);
|
|
3984
4085
|
i.every((s) => typeof s == "number") && (n.type = "number"), i.every((s) => typeof s == "string") && (n.type = "string"), n.enum = i;
|
|
3985
|
-
},
|
|
4086
|
+
}, as = (e, t, n, r) => {
|
|
3986
4087
|
const o = e._zod.def, i = [];
|
|
3987
4088
|
for (const s of o.values)
|
|
3988
4089
|
if (s === void 0) {
|
|
@@ -3999,21 +4100,21 @@ const Wi = (e, t = {}) => (n) => {
|
|
|
3999
4100
|
n.type = s === null ? "null" : typeof s, t.target === "draft-04" || t.target === "openapi-3.0" ? n.enum = [s] : n.const = s;
|
|
4000
4101
|
} else
|
|
4001
4102
|
i.every((s) => typeof s == "number") && (n.type = "number"), i.every((s) => typeof s == "string") && (n.type = "string"), i.every((s) => typeof s == "boolean") && (n.type = "boolean"), i.every((s) => s === null) && (n.type = "null"), n.enum = i;
|
|
4002
|
-
},
|
|
4103
|
+
}, cs = (e, t, n, r) => {
|
|
4003
4104
|
if (t.unrepresentable === "throw")
|
|
4004
4105
|
throw new Error("Custom types cannot be represented in JSON Schema");
|
|
4005
|
-
},
|
|
4106
|
+
}, us = (e, t, n, r) => {
|
|
4006
4107
|
if (t.unrepresentable === "throw")
|
|
4007
4108
|
throw new Error("Transforms cannot be represented in JSON Schema");
|
|
4008
|
-
},
|
|
4109
|
+
}, ds = (e, t, n, r) => {
|
|
4009
4110
|
const o = n, i = e._zod.def, { minimum: s, maximum: a } = e._zod.bag;
|
|
4010
|
-
typeof s == "number" && (o.minItems = s), typeof a == "number" && (o.maxItems = a), o.type = "array", o.items =
|
|
4011
|
-
},
|
|
4111
|
+
typeof s == "number" && (o.minItems = s), typeof a == "number" && (o.maxItems = a), o.type = "array", o.items = E(i.element, t, { ...r, path: [...r.path, "items"] });
|
|
4112
|
+
}, ls = (e, t, n, r) => {
|
|
4012
4113
|
const o = n, i = e._zod.def;
|
|
4013
4114
|
o.type = "object", o.properties = {};
|
|
4014
4115
|
const s = i.shape;
|
|
4015
4116
|
for (const u in s)
|
|
4016
|
-
o.properties[u] =
|
|
4117
|
+
o.properties[u] = E(s[u], t, {
|
|
4017
4118
|
...r,
|
|
4018
4119
|
path: [...r.path, "properties", u]
|
|
4019
4120
|
});
|
|
@@ -4021,21 +4122,21 @@ const Wi = (e, t = {}) => (n) => {
|
|
|
4021
4122
|
const l = i.shape[u]._zod;
|
|
4022
4123
|
return t.io === "input" ? l.optin === void 0 : l.optout === void 0;
|
|
4023
4124
|
}));
|
|
4024
|
-
c.size > 0 && (o.required = Array.from(c)), i.catchall?._zod.def.type === "never" ? o.additionalProperties = !1 : i.catchall ? i.catchall && (o.additionalProperties =
|
|
4125
|
+
c.size > 0 && (o.required = Array.from(c)), i.catchall?._zod.def.type === "never" ? o.additionalProperties = !1 : i.catchall ? i.catchall && (o.additionalProperties = E(i.catchall, t, {
|
|
4025
4126
|
...r,
|
|
4026
4127
|
path: [...r.path, "additionalProperties"]
|
|
4027
4128
|
})) : t.io === "output" && (o.additionalProperties = !1);
|
|
4028
|
-
},
|
|
4029
|
-
const o = e._zod.def, i = o.inclusive === !1, s = o.options.map((a, c) =>
|
|
4129
|
+
}, fs = (e, t, n, r) => {
|
|
4130
|
+
const o = e._zod.def, i = o.inclusive === !1, s = o.options.map((a, c) => E(a, t, {
|
|
4030
4131
|
...r,
|
|
4031
4132
|
path: [...r.path, i ? "oneOf" : "anyOf", c]
|
|
4032
4133
|
}));
|
|
4033
4134
|
i ? n.oneOf = s : n.anyOf = s;
|
|
4034
|
-
},
|
|
4035
|
-
const o = e._zod.def, i =
|
|
4135
|
+
}, ps = (e, t, n, r) => {
|
|
4136
|
+
const o = e._zod.def, i = E(o.left, t, {
|
|
4036
4137
|
...r,
|
|
4037
4138
|
path: [...r.path, "allOf", 0]
|
|
4038
|
-
}), s =
|
|
4139
|
+
}), s = E(o.right, t, {
|
|
4039
4140
|
...r,
|
|
4040
4141
|
path: [...r.path, "allOf", 1]
|
|
4041
4142
|
}), a = (u) => "allOf" in u && Object.keys(u).length === 1, c = [
|
|
@@ -4043,12 +4144,12 @@ const Wi = (e, t = {}) => (n) => {
|
|
|
4043
4144
|
...a(s) ? s.allOf : [s]
|
|
4044
4145
|
];
|
|
4045
4146
|
n.allOf = c;
|
|
4046
|
-
},
|
|
4147
|
+
}, gs = (e, t, n, r) => {
|
|
4047
4148
|
const o = n, i = e._zod.def;
|
|
4048
4149
|
o.type = "object";
|
|
4049
4150
|
const s = i.keyType, c = s._zod.bag?.patterns;
|
|
4050
4151
|
if (i.mode === "loose" && c && c.size > 0) {
|
|
4051
|
-
const l =
|
|
4152
|
+
const l = E(i.valueType, t, {
|
|
4052
4153
|
...r,
|
|
4053
4154
|
path: [...r.path, "patternProperties", "*"]
|
|
4054
4155
|
});
|
|
@@ -4056,10 +4157,10 @@ const Wi = (e, t = {}) => (n) => {
|
|
|
4056
4157
|
for (const f of c)
|
|
4057
4158
|
o.patternProperties[f.source] = l;
|
|
4058
4159
|
} else
|
|
4059
|
-
(t.target === "draft-07" || t.target === "draft-2020-12") && (o.propertyNames =
|
|
4160
|
+
(t.target === "draft-07" || t.target === "draft-2020-12") && (o.propertyNames = E(i.keyType, t, {
|
|
4060
4161
|
...r,
|
|
4061
4162
|
path: [...r.path, "propertyNames"]
|
|
4062
|
-
})), o.additionalProperties =
|
|
4163
|
+
})), o.additionalProperties = E(i.valueType, t, {
|
|
4063
4164
|
...r,
|
|
4064
4165
|
path: [...r.path, "additionalProperties"]
|
|
4065
4166
|
});
|
|
@@ -4068,27 +4169,27 @@ const Wi = (e, t = {}) => (n) => {
|
|
|
4068
4169
|
const l = [...u].filter((f) => typeof f == "string" || typeof f == "number");
|
|
4069
4170
|
l.length > 0 && (o.required = l);
|
|
4070
4171
|
}
|
|
4071
|
-
},
|
|
4072
|
-
const o = e._zod.def, i =
|
|
4172
|
+
}, hs = (e, t, n, r) => {
|
|
4173
|
+
const o = e._zod.def, i = E(o.innerType, t, r), s = t.seen.get(e);
|
|
4073
4174
|
t.target === "openapi-3.0" ? (s.ref = o.innerType, n.nullable = !0) : n.anyOf = [i, { type: "null" }];
|
|
4074
|
-
},
|
|
4175
|
+
}, ms = (e, t, n, r) => {
|
|
4075
4176
|
const o = e._zod.def;
|
|
4076
|
-
|
|
4177
|
+
E(o.innerType, t, r);
|
|
4077
4178
|
const i = t.seen.get(e);
|
|
4078
4179
|
i.ref = o.innerType;
|
|
4079
|
-
},
|
|
4180
|
+
}, _s = (e, t, n, r) => {
|
|
4080
4181
|
const o = e._zod.def;
|
|
4081
|
-
|
|
4182
|
+
E(o.innerType, t, r);
|
|
4082
4183
|
const i = t.seen.get(e);
|
|
4083
4184
|
i.ref = o.innerType, n.default = JSON.parse(JSON.stringify(o.defaultValue));
|
|
4084
|
-
},
|
|
4185
|
+
}, ys = (e, t, n, r) => {
|
|
4085
4186
|
const o = e._zod.def;
|
|
4086
|
-
|
|
4187
|
+
E(o.innerType, t, r);
|
|
4087
4188
|
const i = t.seen.get(e);
|
|
4088
4189
|
i.ref = o.innerType, t.io === "input" && (n._prefault = JSON.parse(JSON.stringify(o.defaultValue)));
|
|
4089
|
-
},
|
|
4190
|
+
}, vs = (e, t, n, r) => {
|
|
4090
4191
|
const o = e._zod.def;
|
|
4091
|
-
|
|
4192
|
+
E(o.innerType, t, r);
|
|
4092
4193
|
const i = t.seen.get(e);
|
|
4093
4194
|
i.ref = o.innerType;
|
|
4094
4195
|
let s;
|
|
@@ -4098,53 +4199,53 @@ const Wi = (e, t = {}) => (n) => {
|
|
|
4098
4199
|
throw new Error("Dynamic catch values are not supported in JSON Schema");
|
|
4099
4200
|
}
|
|
4100
4201
|
n.default = s;
|
|
4101
|
-
},
|
|
4202
|
+
}, ws = (e, t, n, r) => {
|
|
4102
4203
|
const o = e._zod.def, i = t.io === "input" ? o.in._zod.def.type === "transform" ? o.out : o.in : o.out;
|
|
4103
|
-
|
|
4204
|
+
E(i, t, r);
|
|
4104
4205
|
const s = t.seen.get(e);
|
|
4105
4206
|
s.ref = i;
|
|
4106
|
-
},
|
|
4207
|
+
}, bs = (e, t, n, r) => {
|
|
4107
4208
|
const o = e._zod.def;
|
|
4108
|
-
|
|
4209
|
+
E(o.innerType, t, r);
|
|
4109
4210
|
const i = t.seen.get(e);
|
|
4110
4211
|
i.ref = o.innerType, n.readOnly = !0;
|
|
4111
4212
|
}, Pt = (e, t, n, r) => {
|
|
4112
4213
|
const o = e._zod.def;
|
|
4113
|
-
|
|
4214
|
+
E(o.innerType, t, r);
|
|
4114
4215
|
const i = t.seen.get(e);
|
|
4115
4216
|
i.ref = o.innerType;
|
|
4116
|
-
},
|
|
4117
|
-
|
|
4217
|
+
}, ks = /* @__PURE__ */ d("ZodISODateTime", (e, t) => {
|
|
4218
|
+
zo.init(e, t), S.init(e, t);
|
|
4118
4219
|
});
|
|
4119
|
-
function
|
|
4120
|
-
return /* @__PURE__ */
|
|
4220
|
+
function zs(e) {
|
|
4221
|
+
return /* @__PURE__ */ Ii(ks, e);
|
|
4121
4222
|
}
|
|
4122
|
-
const
|
|
4123
|
-
|
|
4223
|
+
const $s = /* @__PURE__ */ d("ZodISODate", (e, t) => {
|
|
4224
|
+
$o.init(e, t), S.init(e, t);
|
|
4124
4225
|
});
|
|
4125
|
-
function
|
|
4126
|
-
return /* @__PURE__ */
|
|
4226
|
+
function Ss(e) {
|
|
4227
|
+
return /* @__PURE__ */ Oi($s, e);
|
|
4127
4228
|
}
|
|
4128
|
-
const
|
|
4129
|
-
|
|
4229
|
+
const Es = /* @__PURE__ */ d("ZodISOTime", (e, t) => {
|
|
4230
|
+
So.init(e, t), S.init(e, t);
|
|
4130
4231
|
});
|
|
4131
|
-
function
|
|
4132
|
-
return /* @__PURE__ */
|
|
4232
|
+
function Zs(e) {
|
|
4233
|
+
return /* @__PURE__ */ Pi(Es, e);
|
|
4133
4234
|
}
|
|
4134
|
-
const
|
|
4135
|
-
|
|
4235
|
+
const Ts = /* @__PURE__ */ d("ZodISODuration", (e, t) => {
|
|
4236
|
+
Eo.init(e, t), S.init(e, t);
|
|
4136
4237
|
});
|
|
4137
|
-
function
|
|
4138
|
-
return /* @__PURE__ */
|
|
4238
|
+
function Is(e) {
|
|
4239
|
+
return /* @__PURE__ */ Ai(Ts, e);
|
|
4139
4240
|
}
|
|
4140
|
-
const
|
|
4241
|
+
const Os = (e, t) => {
|
|
4141
4242
|
ft.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
|
|
4142
4243
|
format: {
|
|
4143
|
-
value: (n) =>
|
|
4244
|
+
value: (n) => hr(e, n)
|
|
4144
4245
|
// enumerable: false,
|
|
4145
4246
|
},
|
|
4146
4247
|
flatten: {
|
|
4147
|
-
value: (n) =>
|
|
4248
|
+
value: (n) => gr(e, n)
|
|
4148
4249
|
// enumerable: false,
|
|
4149
4250
|
},
|
|
4150
4251
|
addIssue: {
|
|
@@ -4166,157 +4267,157 @@ const Ss = (e, t) => {
|
|
|
4166
4267
|
// enumerable: false,
|
|
4167
4268
|
}
|
|
4168
4269
|
});
|
|
4169
|
-
},
|
|
4270
|
+
}, A = d("ZodError", Os, {
|
|
4170
4271
|
Parent: Error
|
|
4171
|
-
}),
|
|
4272
|
+
}), Ps = /* @__PURE__ */ ze(A), As = /* @__PURE__ */ $e(A), Ns = /* @__PURE__ */ ue(A), Cs = /* @__PURE__ */ de(A), Rs = /* @__PURE__ */ yr(A), js = /* @__PURE__ */ vr(A), Ds = /* @__PURE__ */ wr(A), Ls = /* @__PURE__ */ br(A), Us = /* @__PURE__ */ kr(A), Ms = /* @__PURE__ */ zr(A), Fs = /* @__PURE__ */ $r(A), xs = /* @__PURE__ */ Sr(A), $ = /* @__PURE__ */ d("ZodType", (e, t) => (z.init(e, t), Object.assign(e["~standard"], {
|
|
4172
4273
|
jsonSchema: {
|
|
4173
|
-
input:
|
|
4174
|
-
output:
|
|
4274
|
+
input: ce(e, "input"),
|
|
4275
|
+
output: ce(e, "output")
|
|
4175
4276
|
}
|
|
4176
|
-
}), e.toJSONSchema =
|
|
4277
|
+
}), e.toJSONSchema = Xi(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(F(t, {
|
|
4177
4278
|
checks: [
|
|
4178
4279
|
...t.checks ?? [],
|
|
4179
4280
|
...n.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
|
|
4180
4281
|
]
|
|
4181
4282
|
}), {
|
|
4182
4283
|
parent: !0
|
|
4183
|
-
}), e.with = e.check, e.clone = (n, r) =>
|
|
4284
|
+
}), e.with = e.check, e.clone = (n, r) => x(e, n, r), e.brand = () => e, e.register = ((n, r) => (n.add(e, r), e)), e.parse = (n, r) => Ps(e, n, r, { callee: e.parse }), e.safeParse = (n, r) => Ns(e, n, r), e.parseAsync = async (n, r) => As(e, n, r, { callee: e.parseAsync }), e.safeParseAsync = async (n, r) => Cs(e, n, r), e.spa = e.safeParseAsync, e.encode = (n, r) => Rs(e, n, r), e.decode = (n, r) => js(e, n, r), e.encodeAsync = async (n, r) => Ds(e, n, r), e.decodeAsync = async (n, r) => Ls(e, n, r), e.safeEncode = (n, r) => Us(e, n, r), e.safeDecode = (n, r) => Ms(e, n, r), e.safeEncodeAsync = async (n, r) => Fs(e, n, r), e.safeDecodeAsync = async (n, r) => xs(e, n, r), e.refine = (n, r) => e.check(La(n, r)), e.superRefine = (n) => e.check(Ua(n)), e.overwrite = (n) => e.check(/* @__PURE__ */ K(n)), e.optional = () => Qe(e), e.exactOptional = () => Sa(e), e.nullable = () => Xe(e), e.nullish = () => Qe(Xe(e)), e.nonoptional = (n) => Pa(e, n), e.array = () => pa(e), e.or = (n) => ma([e, n]), e.and = (n) => ya(e, n), e.transform = (n) => et(e, za(n)), e.default = (n) => Ta(e, n), e.prefault = (n) => Oa(e, n), e.catch = (n) => Na(e, n), e.pipe = (n) => et(e, n), e.readonly = () => ja(e), e.describe = (n) => {
|
|
4184
4285
|
const r = e.clone();
|
|
4185
|
-
return
|
|
4286
|
+
return X.add(r, { description: n }), r;
|
|
4186
4287
|
}, Object.defineProperty(e, "description", {
|
|
4187
4288
|
get() {
|
|
4188
|
-
return
|
|
4289
|
+
return X.get(e)?.description;
|
|
4189
4290
|
},
|
|
4190
4291
|
configurable: !0
|
|
4191
4292
|
}), e.meta = (...n) => {
|
|
4192
4293
|
if (n.length === 0)
|
|
4193
|
-
return
|
|
4294
|
+
return X.get(e);
|
|
4194
4295
|
const r = e.clone();
|
|
4195
|
-
return
|
|
4296
|
+
return X.add(r, n[0]), r;
|
|
4196
4297
|
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e.apply = (n) => n(e), e)), At = /* @__PURE__ */ d("_ZodString", (e, t) => {
|
|
4197
|
-
Se.init(e, t),
|
|
4298
|
+
Se.init(e, t), $.init(e, t), e._zod.processJSONSchema = (r, o, i) => ts(e, r, o);
|
|
4198
4299
|
const n = e._zod.bag;
|
|
4199
|
-
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...r) => e.check(/* @__PURE__ */
|
|
4200
|
-
}),
|
|
4201
|
-
Se.init(e, t), At.init(e, t), e.email = (n) => e.check(/* @__PURE__ */
|
|
4300
|
+
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...r) => e.check(/* @__PURE__ */ Li(...r)), e.includes = (...r) => e.check(/* @__PURE__ */ Fi(...r)), e.startsWith = (...r) => e.check(/* @__PURE__ */ xi(...r)), e.endsWith = (...r) => e.check(/* @__PURE__ */ Ji(...r)), e.min = (...r) => e.check(/* @__PURE__ */ ae(...r)), e.max = (...r) => e.check(/* @__PURE__ */ Et(...r)), e.length = (...r) => e.check(/* @__PURE__ */ Zt(...r)), e.nonempty = (...r) => e.check(/* @__PURE__ */ ae(1, ...r)), e.lowercase = (r) => e.check(/* @__PURE__ */ Ui(r)), e.uppercase = (r) => e.check(/* @__PURE__ */ Mi(r)), e.trim = () => e.check(/* @__PURE__ */ Vi()), e.normalize = (...r) => e.check(/* @__PURE__ */ qi(...r)), e.toLowerCase = () => e.check(/* @__PURE__ */ Gi()), e.toUpperCase = () => e.check(/* @__PURE__ */ Bi()), e.slugify = () => e.check(/* @__PURE__ */ Wi());
|
|
4301
|
+
}), Js = /* @__PURE__ */ d("ZodString", (e, t) => {
|
|
4302
|
+
Se.init(e, t), At.init(e, t), e.email = (n) => e.check(/* @__PURE__ */ ci(qs, n)), e.url = (n) => e.check(/* @__PURE__ */ pi(Vs, n)), e.jwt = (n) => e.check(/* @__PURE__ */ Ti(sa, n)), e.emoji = (n) => e.check(/* @__PURE__ */ gi(Gs, n)), e.guid = (n) => e.check(/* @__PURE__ */ Ve(He, n)), e.uuid = (n) => e.check(/* @__PURE__ */ ui(oe, n)), e.uuidv4 = (n) => e.check(/* @__PURE__ */ di(oe, n)), e.uuidv6 = (n) => e.check(/* @__PURE__ */ li(oe, n)), e.uuidv7 = (n) => e.check(/* @__PURE__ */ fi(oe, n)), e.nanoid = (n) => e.check(/* @__PURE__ */ hi(Bs, n)), e.guid = (n) => e.check(/* @__PURE__ */ Ve(He, n)), e.cuid = (n) => e.check(/* @__PURE__ */ mi(Ws, n)), e.cuid2 = (n) => e.check(/* @__PURE__ */ _i(Hs, n)), e.ulid = (n) => e.check(/* @__PURE__ */ yi(Ks, n)), e.base64 = (n) => e.check(/* @__PURE__ */ Si(ra, n)), e.base64url = (n) => e.check(/* @__PURE__ */ Ei(oa, n)), e.xid = (n) => e.check(/* @__PURE__ */ vi(Ys, n)), e.ksuid = (n) => e.check(/* @__PURE__ */ wi(Qs, n)), e.ipv4 = (n) => e.check(/* @__PURE__ */ bi(Xs, n)), e.ipv6 = (n) => e.check(/* @__PURE__ */ ki(ea, n)), e.cidrv4 = (n) => e.check(/* @__PURE__ */ zi(ta, n)), e.cidrv6 = (n) => e.check(/* @__PURE__ */ $i(na, n)), e.e164 = (n) => e.check(/* @__PURE__ */ Zi(ia, n)), e.datetime = (n) => e.check(zs(n)), e.date = (n) => e.check(Ss(n)), e.time = (n) => e.check(Zs(n)), e.duration = (n) => e.check(Is(n));
|
|
4202
4303
|
});
|
|
4203
|
-
function
|
|
4204
|
-
return /* @__PURE__ */
|
|
4304
|
+
function zc(e) {
|
|
4305
|
+
return /* @__PURE__ */ ai(Js, e);
|
|
4205
4306
|
}
|
|
4206
|
-
const
|
|
4207
|
-
|
|
4208
|
-
}),
|
|
4209
|
-
|
|
4307
|
+
const S = /* @__PURE__ */ d("ZodStringFormat", (e, t) => {
|
|
4308
|
+
b.init(e, t), At.init(e, t);
|
|
4309
|
+
}), qs = /* @__PURE__ */ d("ZodEmail", (e, t) => {
|
|
4310
|
+
go.init(e, t), S.init(e, t);
|
|
4210
4311
|
}), He = /* @__PURE__ */ d("ZodGUID", (e, t) => {
|
|
4211
|
-
|
|
4212
|
-
}),
|
|
4213
|
-
|
|
4214
|
-
}),
|
|
4215
|
-
|
|
4216
|
-
}),
|
|
4217
|
-
|
|
4218
|
-
}),
|
|
4219
|
-
|
|
4220
|
-
}),
|
|
4221
|
-
|
|
4222
|
-
}),
|
|
4223
|
-
|
|
4224
|
-
}),
|
|
4225
|
-
|
|
4226
|
-
}),
|
|
4227
|
-
|
|
4228
|
-
}),
|
|
4229
|
-
|
|
4230
|
-
}),
|
|
4231
|
-
|
|
4232
|
-
}),
|
|
4233
|
-
|
|
4234
|
-
}),
|
|
4235
|
-
|
|
4236
|
-
}),
|
|
4237
|
-
|
|
4238
|
-
}),
|
|
4239
|
-
|
|
4240
|
-
}),
|
|
4241
|
-
|
|
4242
|
-
}),
|
|
4243
|
-
|
|
4244
|
-
}),
|
|
4245
|
-
|
|
4312
|
+
fo.init(e, t), S.init(e, t);
|
|
4313
|
+
}), oe = /* @__PURE__ */ d("ZodUUID", (e, t) => {
|
|
4314
|
+
po.init(e, t), S.init(e, t);
|
|
4315
|
+
}), Vs = /* @__PURE__ */ d("ZodURL", (e, t) => {
|
|
4316
|
+
ho.init(e, t), S.init(e, t);
|
|
4317
|
+
}), Gs = /* @__PURE__ */ d("ZodEmoji", (e, t) => {
|
|
4318
|
+
mo.init(e, t), S.init(e, t);
|
|
4319
|
+
}), Bs = /* @__PURE__ */ d("ZodNanoID", (e, t) => {
|
|
4320
|
+
_o.init(e, t), S.init(e, t);
|
|
4321
|
+
}), Ws = /* @__PURE__ */ d("ZodCUID", (e, t) => {
|
|
4322
|
+
yo.init(e, t), S.init(e, t);
|
|
4323
|
+
}), Hs = /* @__PURE__ */ d("ZodCUID2", (e, t) => {
|
|
4324
|
+
vo.init(e, t), S.init(e, t);
|
|
4325
|
+
}), Ks = /* @__PURE__ */ d("ZodULID", (e, t) => {
|
|
4326
|
+
wo.init(e, t), S.init(e, t);
|
|
4327
|
+
}), Ys = /* @__PURE__ */ d("ZodXID", (e, t) => {
|
|
4328
|
+
bo.init(e, t), S.init(e, t);
|
|
4329
|
+
}), Qs = /* @__PURE__ */ d("ZodKSUID", (e, t) => {
|
|
4330
|
+
ko.init(e, t), S.init(e, t);
|
|
4331
|
+
}), Xs = /* @__PURE__ */ d("ZodIPv4", (e, t) => {
|
|
4332
|
+
Zo.init(e, t), S.init(e, t);
|
|
4333
|
+
}), ea = /* @__PURE__ */ d("ZodIPv6", (e, t) => {
|
|
4334
|
+
To.init(e, t), S.init(e, t);
|
|
4335
|
+
}), ta = /* @__PURE__ */ d("ZodCIDRv4", (e, t) => {
|
|
4336
|
+
Io.init(e, t), S.init(e, t);
|
|
4337
|
+
}), na = /* @__PURE__ */ d("ZodCIDRv6", (e, t) => {
|
|
4338
|
+
Oo.init(e, t), S.init(e, t);
|
|
4339
|
+
}), ra = /* @__PURE__ */ d("ZodBase64", (e, t) => {
|
|
4340
|
+
Po.init(e, t), S.init(e, t);
|
|
4341
|
+
}), oa = /* @__PURE__ */ d("ZodBase64URL", (e, t) => {
|
|
4342
|
+
No.init(e, t), S.init(e, t);
|
|
4343
|
+
}), ia = /* @__PURE__ */ d("ZodE164", (e, t) => {
|
|
4344
|
+
Co.init(e, t), S.init(e, t);
|
|
4345
|
+
}), sa = /* @__PURE__ */ d("ZodJWT", (e, t) => {
|
|
4346
|
+
jo.init(e, t), S.init(e, t);
|
|
4246
4347
|
}), Nt = /* @__PURE__ */ d("ZodNumber", (e, t) => {
|
|
4247
|
-
kt.init(e, t),
|
|
4348
|
+
kt.init(e, t), $.init(e, t), e._zod.processJSONSchema = (r, o, i) => ns(e, r, o), e.gt = (r, o) => e.check(/* @__PURE__ */ Be(r, o)), e.gte = (r, o) => e.check(/* @__PURE__ */ pe(r, o)), e.min = (r, o) => e.check(/* @__PURE__ */ pe(r, o)), e.lt = (r, o) => e.check(/* @__PURE__ */ Ge(r, o)), e.lte = (r, o) => e.check(/* @__PURE__ */ fe(r, o)), e.max = (r, o) => e.check(/* @__PURE__ */ fe(r, o)), e.int = (r) => e.check(Ke(r)), e.safe = (r) => e.check(Ke(r)), e.positive = (r) => e.check(/* @__PURE__ */ Be(0, r)), e.nonnegative = (r) => e.check(/* @__PURE__ */ pe(0, r)), e.negative = (r) => e.check(/* @__PURE__ */ Ge(0, r)), e.nonpositive = (r) => e.check(/* @__PURE__ */ fe(0, r)), e.multipleOf = (r, o) => e.check(/* @__PURE__ */ We(r, o)), e.step = (r, o) => e.check(/* @__PURE__ */ We(r, o)), e.finite = () => e;
|
|
4248
4349
|
const n = e._zod.bag;
|
|
4249
4350
|
e.minValue = Math.max(n.minimum ?? Number.NEGATIVE_INFINITY, n.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, e.maxValue = Math.min(n.maximum ?? Number.POSITIVE_INFINITY, n.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, e.isInt = (n.format ?? "").includes("int") || Number.isSafeInteger(n.multipleOf ?? 0.5), e.isFinite = !0, e.format = n.format ?? null;
|
|
4250
4351
|
});
|
|
4251
|
-
function
|
|
4252
|
-
return /* @__PURE__ */
|
|
4352
|
+
function $c(e) {
|
|
4353
|
+
return /* @__PURE__ */ Ni(Nt, e);
|
|
4253
4354
|
}
|
|
4254
|
-
const
|
|
4255
|
-
|
|
4355
|
+
const aa = /* @__PURE__ */ d("ZodNumberFormat", (e, t) => {
|
|
4356
|
+
Do.init(e, t), Nt.init(e, t);
|
|
4256
4357
|
});
|
|
4257
4358
|
function Ke(e) {
|
|
4258
|
-
return /* @__PURE__ */
|
|
4359
|
+
return /* @__PURE__ */ Ci(aa, e);
|
|
4259
4360
|
}
|
|
4260
|
-
const
|
|
4261
|
-
|
|
4361
|
+
const ca = /* @__PURE__ */ d("ZodBoolean", (e, t) => {
|
|
4362
|
+
Lo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => rs(e, n, r);
|
|
4262
4363
|
});
|
|
4263
|
-
function
|
|
4264
|
-
return /* @__PURE__ */
|
|
4364
|
+
function Sc(e) {
|
|
4365
|
+
return /* @__PURE__ */ Ri(ca, e);
|
|
4265
4366
|
}
|
|
4266
|
-
const
|
|
4267
|
-
|
|
4367
|
+
const ua = /* @__PURE__ */ d("ZodUnknown", (e, t) => {
|
|
4368
|
+
Uo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => is();
|
|
4268
4369
|
});
|
|
4269
4370
|
function Ye() {
|
|
4270
|
-
return /* @__PURE__ */
|
|
4371
|
+
return /* @__PURE__ */ ji(ua);
|
|
4271
4372
|
}
|
|
4272
|
-
const
|
|
4273
|
-
|
|
4373
|
+
const da = /* @__PURE__ */ d("ZodNever", (e, t) => {
|
|
4374
|
+
Mo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => os(e, n, r);
|
|
4274
4375
|
});
|
|
4275
|
-
function
|
|
4276
|
-
return /* @__PURE__ */
|
|
4376
|
+
function la(e) {
|
|
4377
|
+
return /* @__PURE__ */ Di(da, e);
|
|
4277
4378
|
}
|
|
4278
|
-
const
|
|
4279
|
-
|
|
4379
|
+
const fa = /* @__PURE__ */ d("ZodArray", (e, t) => {
|
|
4380
|
+
Fo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => ds(e, n, r, o), e.element = t.element, e.min = (n, r) => e.check(/* @__PURE__ */ ae(n, r)), e.nonempty = (n) => e.check(/* @__PURE__ */ ae(1, n)), e.max = (n, r) => e.check(/* @__PURE__ */ Et(n, r)), e.length = (n, r) => e.check(/* @__PURE__ */ Zt(n, r)), e.unwrap = () => e.element;
|
|
4280
4381
|
});
|
|
4281
|
-
function
|
|
4282
|
-
return /* @__PURE__ */
|
|
4382
|
+
function pa(e, t) {
|
|
4383
|
+
return /* @__PURE__ */ Hi(fa, e, t);
|
|
4283
4384
|
}
|
|
4284
|
-
const
|
|
4285
|
-
|
|
4385
|
+
const ga = /* @__PURE__ */ d("ZodObject", (e, t) => {
|
|
4386
|
+
Jo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => ls(e, n, r, o), v(e, "shape", () => t.shape), e.keyof = () => wa(Object.keys(e._zod.def.shape)), e.catchall = (n) => e.clone({ ...e._zod.def, catchall: n }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: Ye() }), e.loose = () => e.clone({ ...e._zod.def, catchall: Ye() }), e.strict = () => e.clone({ ...e._zod.def, catchall: la() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (n) => ur(e, n), e.safeExtend = (n) => dr(e, n), e.merge = (n) => lr(e, n), e.pick = (n) => ar(e, n), e.omit = (n) => cr(e, n), e.partial = (...n) => fr(Ct, e, n[0]), e.required = (...n) => pr(Rt, e, n[0]);
|
|
4286
4387
|
});
|
|
4287
|
-
function
|
|
4388
|
+
function Ec(e, t) {
|
|
4288
4389
|
const n = {
|
|
4289
4390
|
type: "object",
|
|
4290
4391
|
shape: e ?? {},
|
|
4291
4392
|
...h(t)
|
|
4292
4393
|
};
|
|
4293
|
-
return new
|
|
4394
|
+
return new ga(n);
|
|
4294
4395
|
}
|
|
4295
|
-
const
|
|
4296
|
-
|
|
4396
|
+
const ha = /* @__PURE__ */ d("ZodUnion", (e, t) => {
|
|
4397
|
+
qo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => fs(e, n, r, o), e.options = t.options;
|
|
4297
4398
|
});
|
|
4298
|
-
function
|
|
4299
|
-
return new
|
|
4399
|
+
function ma(e, t) {
|
|
4400
|
+
return new ha({
|
|
4300
4401
|
type: "union",
|
|
4301
4402
|
options: e,
|
|
4302
4403
|
...h(t)
|
|
4303
4404
|
});
|
|
4304
4405
|
}
|
|
4305
|
-
const
|
|
4306
|
-
|
|
4406
|
+
const _a = /* @__PURE__ */ d("ZodIntersection", (e, t) => {
|
|
4407
|
+
Vo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => ps(e, n, r, o);
|
|
4307
4408
|
});
|
|
4308
|
-
function
|
|
4309
|
-
return new
|
|
4409
|
+
function ya(e, t) {
|
|
4410
|
+
return new _a({
|
|
4310
4411
|
type: "intersection",
|
|
4311
4412
|
left: e,
|
|
4312
4413
|
right: t
|
|
4313
4414
|
});
|
|
4314
4415
|
}
|
|
4315
|
-
const
|
|
4316
|
-
|
|
4416
|
+
const va = /* @__PURE__ */ d("ZodRecord", (e, t) => {
|
|
4417
|
+
Go.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => gs(e, n, r, o), e.keyType = t.keyType, e.valueType = t.valueType;
|
|
4317
4418
|
});
|
|
4318
|
-
function
|
|
4319
|
-
return new
|
|
4419
|
+
function Zc(e, t, n) {
|
|
4420
|
+
return new va({
|
|
4320
4421
|
type: "record",
|
|
4321
4422
|
keyType: e,
|
|
4322
4423
|
valueType: t,
|
|
@@ -4324,7 +4425,7 @@ function kc(e, t, n) {
|
|
|
4324
4425
|
});
|
|
4325
4426
|
}
|
|
4326
4427
|
const me = /* @__PURE__ */ d("ZodEnum", (e, t) => {
|
|
4327
|
-
|
|
4428
|
+
Bo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (r, o, i) => ss(e, r, o), e.enum = t.entries, e.options = Object.values(t.entries);
|
|
4328
4429
|
const n = new Set(Object.keys(t.entries));
|
|
4329
4430
|
e.extract = (r, o) => {
|
|
4330
4431
|
const i = {};
|
|
@@ -4354,7 +4455,7 @@ const me = /* @__PURE__ */ d("ZodEnum", (e, t) => {
|
|
|
4354
4455
|
});
|
|
4355
4456
|
};
|
|
4356
4457
|
});
|
|
4357
|
-
function
|
|
4458
|
+
function wa(e, t) {
|
|
4358
4459
|
const n = Array.isArray(e) ? Object.fromEntries(e.map((r) => [r, r])) : e;
|
|
4359
4460
|
return new me({
|
|
4360
4461
|
type: "enum",
|
|
@@ -4362,8 +4463,8 @@ function ha(e, t) {
|
|
|
4362
4463
|
...h(t)
|
|
4363
4464
|
});
|
|
4364
4465
|
}
|
|
4365
|
-
const
|
|
4366
|
-
|
|
4466
|
+
const ba = /* @__PURE__ */ d("ZodLiteral", (e, t) => {
|
|
4467
|
+
Wo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => as(e, n, r), e.values = new Set(t.values), Object.defineProperty(e, "value", {
|
|
4367
4468
|
get() {
|
|
4368
4469
|
if (t.values.length > 1)
|
|
4369
4470
|
throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
|
|
@@ -4371,37 +4472,37 @@ const ma = /* @__PURE__ */ d("ZodLiteral", (e, t) => {
|
|
|
4371
4472
|
}
|
|
4372
4473
|
});
|
|
4373
4474
|
});
|
|
4374
|
-
function
|
|
4375
|
-
return new
|
|
4475
|
+
function Tc(e, t) {
|
|
4476
|
+
return new ba({
|
|
4376
4477
|
type: "literal",
|
|
4377
4478
|
values: Array.isArray(e) ? e : [e],
|
|
4378
4479
|
...h(t)
|
|
4379
4480
|
});
|
|
4380
4481
|
}
|
|
4381
|
-
const
|
|
4382
|
-
|
|
4482
|
+
const ka = /* @__PURE__ */ d("ZodTransform", (e, t) => {
|
|
4483
|
+
Ho.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => us(e, n), e._zod.parse = (n, r) => {
|
|
4383
4484
|
if (r.direction === "backward")
|
|
4384
4485
|
throw new st(e.constructor.name);
|
|
4385
4486
|
n.addIssue = (i) => {
|
|
4386
4487
|
if (typeof i == "string")
|
|
4387
|
-
n.issues.push(
|
|
4488
|
+
n.issues.push(te(i, n.value, t));
|
|
4388
4489
|
else {
|
|
4389
4490
|
const s = i;
|
|
4390
|
-
s.fatal && (s.continue = !1), s.code ?? (s.code = "custom"), s.input ?? (s.input = n.value), s.inst ?? (s.inst = e), n.issues.push(
|
|
4491
|
+
s.fatal && (s.continue = !1), s.code ?? (s.code = "custom"), s.input ?? (s.input = n.value), s.inst ?? (s.inst = e), n.issues.push(te(s));
|
|
4391
4492
|
}
|
|
4392
4493
|
};
|
|
4393
4494
|
const o = t.transform(n.value, n);
|
|
4394
4495
|
return o instanceof Promise ? o.then((i) => (n.value = i, n)) : (n.value = o, n);
|
|
4395
4496
|
};
|
|
4396
4497
|
});
|
|
4397
|
-
function
|
|
4398
|
-
return new
|
|
4498
|
+
function za(e) {
|
|
4499
|
+
return new ka({
|
|
4399
4500
|
type: "transform",
|
|
4400
4501
|
transform: e
|
|
4401
4502
|
});
|
|
4402
4503
|
}
|
|
4403
4504
|
const Ct = /* @__PURE__ */ d("ZodOptional", (e, t) => {
|
|
4404
|
-
St.init(e, t),
|
|
4505
|
+
St.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => Pt(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
4405
4506
|
});
|
|
4406
4507
|
function Qe(e) {
|
|
4407
4508
|
return new Ct({
|
|
@@ -4409,29 +4510,29 @@ function Qe(e) {
|
|
|
4409
4510
|
innerType: e
|
|
4410
4511
|
});
|
|
4411
4512
|
}
|
|
4412
|
-
const
|
|
4413
|
-
|
|
4513
|
+
const $a = /* @__PURE__ */ d("ZodExactOptional", (e, t) => {
|
|
4514
|
+
Ko.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => Pt(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
4414
4515
|
});
|
|
4415
|
-
function
|
|
4416
|
-
return new
|
|
4516
|
+
function Sa(e) {
|
|
4517
|
+
return new $a({
|
|
4417
4518
|
type: "optional",
|
|
4418
4519
|
innerType: e
|
|
4419
4520
|
});
|
|
4420
4521
|
}
|
|
4421
|
-
const
|
|
4422
|
-
|
|
4522
|
+
const Ea = /* @__PURE__ */ d("ZodNullable", (e, t) => {
|
|
4523
|
+
Yo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => hs(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
4423
4524
|
});
|
|
4424
4525
|
function Xe(e) {
|
|
4425
|
-
return new
|
|
4526
|
+
return new Ea({
|
|
4426
4527
|
type: "nullable",
|
|
4427
4528
|
innerType: e
|
|
4428
4529
|
});
|
|
4429
4530
|
}
|
|
4430
|
-
const
|
|
4431
|
-
|
|
4531
|
+
const Za = /* @__PURE__ */ d("ZodDefault", (e, t) => {
|
|
4532
|
+
Qo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => _s(e, n, r, o), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
|
|
4432
4533
|
});
|
|
4433
|
-
function
|
|
4434
|
-
return new
|
|
4534
|
+
function Ta(e, t) {
|
|
4535
|
+
return new Za({
|
|
4435
4536
|
type: "default",
|
|
4436
4537
|
innerType: e,
|
|
4437
4538
|
get defaultValue() {
|
|
@@ -4439,11 +4540,11 @@ function za(e, t) {
|
|
|
4439
4540
|
}
|
|
4440
4541
|
});
|
|
4441
4542
|
}
|
|
4442
|
-
const
|
|
4443
|
-
|
|
4543
|
+
const Ia = /* @__PURE__ */ d("ZodPrefault", (e, t) => {
|
|
4544
|
+
Xo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => ys(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
4444
4545
|
});
|
|
4445
|
-
function
|
|
4446
|
-
return new
|
|
4546
|
+
function Oa(e, t) {
|
|
4547
|
+
return new Ia({
|
|
4447
4548
|
type: "prefault",
|
|
4448
4549
|
innerType: e,
|
|
4449
4550
|
get defaultValue() {
|
|
@@ -4452,121 +4553,121 @@ function Sa(e, t) {
|
|
|
4452
4553
|
});
|
|
4453
4554
|
}
|
|
4454
4555
|
const Rt = /* @__PURE__ */ d("ZodNonOptional", (e, t) => {
|
|
4455
|
-
|
|
4556
|
+
ei.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => ms(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
4456
4557
|
});
|
|
4457
|
-
function
|
|
4558
|
+
function Pa(e, t) {
|
|
4458
4559
|
return new Rt({
|
|
4459
4560
|
type: "nonoptional",
|
|
4460
4561
|
innerType: e,
|
|
4461
4562
|
...h(t)
|
|
4462
4563
|
});
|
|
4463
4564
|
}
|
|
4464
|
-
const
|
|
4465
|
-
|
|
4565
|
+
const Aa = /* @__PURE__ */ d("ZodCatch", (e, t) => {
|
|
4566
|
+
ti.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => vs(e, n, r, o), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
|
4466
4567
|
});
|
|
4467
|
-
function
|
|
4468
|
-
return new
|
|
4568
|
+
function Na(e, t) {
|
|
4569
|
+
return new Aa({
|
|
4469
4570
|
type: "catch",
|
|
4470
4571
|
innerType: e,
|
|
4471
4572
|
catchValue: typeof t == "function" ? t : () => t
|
|
4472
4573
|
});
|
|
4473
4574
|
}
|
|
4474
|
-
const
|
|
4475
|
-
|
|
4575
|
+
const Ca = /* @__PURE__ */ d("ZodPipe", (e, t) => {
|
|
4576
|
+
ni.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => ws(e, n, r, o), e.in = t.in, e.out = t.out;
|
|
4476
4577
|
});
|
|
4477
4578
|
function et(e, t) {
|
|
4478
|
-
return new
|
|
4579
|
+
return new Ca({
|
|
4479
4580
|
type: "pipe",
|
|
4480
4581
|
in: e,
|
|
4481
4582
|
out: t
|
|
4482
4583
|
// ...util.normalizeParams(params),
|
|
4483
4584
|
});
|
|
4484
4585
|
}
|
|
4485
|
-
const
|
|
4486
|
-
|
|
4586
|
+
const Ra = /* @__PURE__ */ d("ZodReadonly", (e, t) => {
|
|
4587
|
+
ri.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => bs(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
4487
4588
|
});
|
|
4488
|
-
function
|
|
4489
|
-
return new
|
|
4589
|
+
function ja(e) {
|
|
4590
|
+
return new Ra({
|
|
4490
4591
|
type: "readonly",
|
|
4491
4592
|
innerType: e
|
|
4492
4593
|
});
|
|
4493
4594
|
}
|
|
4494
|
-
const
|
|
4495
|
-
|
|
4595
|
+
const Da = /* @__PURE__ */ d("ZodCustom", (e, t) => {
|
|
4596
|
+
oi.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => cs(e, n);
|
|
4496
4597
|
});
|
|
4497
|
-
function
|
|
4498
|
-
return /* @__PURE__ */
|
|
4598
|
+
function La(e, t = {}) {
|
|
4599
|
+
return /* @__PURE__ */ Ki(Da, e, t);
|
|
4499
4600
|
}
|
|
4500
|
-
function
|
|
4501
|
-
return /* @__PURE__ */
|
|
4601
|
+
function Ua(e) {
|
|
4602
|
+
return /* @__PURE__ */ Yi(e);
|
|
4502
4603
|
}
|
|
4503
4604
|
export {
|
|
4504
4605
|
Ut as $,
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4525
|
-
|
|
4606
|
+
Bn as A,
|
|
4607
|
+
ic as B,
|
|
4608
|
+
Zc as C,
|
|
4609
|
+
_c as D,
|
|
4610
|
+
vc as E,
|
|
4611
|
+
bc as F,
|
|
4612
|
+
gc as G,
|
|
4613
|
+
fc as H,
|
|
4614
|
+
pc as I,
|
|
4615
|
+
mc as J,
|
|
4616
|
+
lc as K,
|
|
4617
|
+
wc as L,
|
|
4618
|
+
Ha as M,
|
|
4619
|
+
Ka as N,
|
|
4620
|
+
Xn as O,
|
|
4621
|
+
Wa as P,
|
|
4622
|
+
Va as Q,
|
|
4623
|
+
hc as R,
|
|
4624
|
+
yc as S,
|
|
4625
|
+
qa as T,
|
|
4626
|
+
Tc as U,
|
|
4526
4627
|
Jt as V,
|
|
4527
|
-
|
|
4628
|
+
ec as W,
|
|
4528
4629
|
Ee as X,
|
|
4529
|
-
|
|
4630
|
+
xt as Y,
|
|
4530
4631
|
Mt as Z,
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
|
|
4632
|
+
wa as _,
|
|
4633
|
+
ac as a,
|
|
4634
|
+
Dt as a0,
|
|
4635
|
+
Kt as a1,
|
|
4636
|
+
nc as a2,
|
|
4637
|
+
ee as a3,
|
|
4537
4638
|
Lt as a4,
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4639
|
+
M as a5,
|
|
4640
|
+
Wt as a6,
|
|
4641
|
+
Ht as a7,
|
|
4642
|
+
sc as a8,
|
|
4643
|
+
rc as a9,
|
|
4644
|
+
kc as aa,
|
|
4645
|
+
tc as ab,
|
|
4646
|
+
qt as ac,
|
|
4647
|
+
dc as b,
|
|
4648
|
+
rn as c,
|
|
4649
|
+
Sc as d,
|
|
4549
4650
|
Ye as e,
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
|
|
4651
|
+
pa as f,
|
|
4652
|
+
Ja as g,
|
|
4653
|
+
Ga as h,
|
|
4553
4654
|
Pe as i,
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
|
|
4655
|
+
Xa as j,
|
|
4656
|
+
oc as k,
|
|
4657
|
+
Ba as l,
|
|
4658
|
+
xa as m,
|
|
4659
|
+
Yn as n,
|
|
4660
|
+
Ec as o,
|
|
4661
|
+
cc as p,
|
|
4662
|
+
uc as q,
|
|
4663
|
+
Fa as r,
|
|
4664
|
+
zc as s,
|
|
4665
|
+
Hn as t,
|
|
4666
|
+
ma as u,
|
|
4667
|
+
$c as v,
|
|
4668
|
+
Ya as w,
|
|
4669
|
+
Qn as x,
|
|
4569
4670
|
Ae as y,
|
|
4570
|
-
|
|
4671
|
+
Qa as z
|
|
4571
4672
|
};
|
|
4572
|
-
//# sourceMappingURL=schemas-
|
|
4673
|
+
//# sourceMappingURL=schemas-yF4IOEUi.js.map
|