@8wave/ai-elements 0.73.0 → 0.74.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +62 -15
- package/dist/_chunks/{PkToolShowArtifact-D-dU41VG.js → PkToolShowArtifact-c_vCWUpQ.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-D-dU41VG.js.map → PkToolShowArtifact-c_vCWUpQ.js.map} +1 -1
- package/dist/_chunks/{PkToolShowCalendarEvent-B33fWbkk.js → PkToolShowCalendarEvent-D2VHu1V3.js} +3 -3
- package/dist/_chunks/{PkToolShowCalendarEvent-B33fWbkk.js.map → PkToolShowCalendarEvent-D2VHu1V3.js.map} +1 -1
- package/dist/_chunks/{PkToolShowComparison-CcKHsr36.js → PkToolShowComparison-C2ZUH0w4.js} +3 -3
- package/dist/_chunks/{PkToolShowComparison-CcKHsr36.js.map → PkToolShowComparison-C2ZUH0w4.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-SmOSbCsp.js → PkToolShowContactForm-6C4uWDtf.js} +3 -3
- package/dist/_chunks/{PkToolShowContactForm-SmOSbCsp.js.map → PkToolShowContactForm-6C4uWDtf.js.map} +1 -1
- package/dist/_chunks/{PkToolShowEmail-BOivL2p_.js → PkToolShowEmail-BuyCHUU5.js} +3 -3
- package/dist/_chunks/{PkToolShowEmail-BOivL2p_.js.map → PkToolShowEmail-BuyCHUU5.js.map} +1 -1
- package/dist/_chunks/{PkToolShowImageGallery-Dy0vFEU-.js → PkToolShowImageGallery-ByldZ0nj.js} +2 -2
- package/dist/_chunks/{PkToolShowImageGallery-Dy0vFEU-.js.map → PkToolShowImageGallery-ByldZ0nj.js.map} +1 -1
- package/dist/_chunks/{PkToolShowLocation-US6u26ra.js → PkToolShowLocation-BCFnC5c7.js} +3 -3
- package/dist/_chunks/{PkToolShowLocation-US6u26ra.js.map → PkToolShowLocation-BCFnC5c7.js.map} +1 -1
- package/dist/_chunks/{PkToolShowMessage-Cjslxq94.js → PkToolShowMessage-6Bsfi3BC.js} +3 -3
- package/dist/_chunks/{PkToolShowMessage-Cjslxq94.js.map → PkToolShowMessage-6Bsfi3BC.js.map} +1 -1
- package/dist/_chunks/{PkToolShowMultipleChoice-BEwiJCLu.js → PkToolShowMultipleChoice-BLNTD2lK.js} +3 -3
- package/dist/_chunks/{PkToolShowMultipleChoice-BEwiJCLu.js.map → PkToolShowMultipleChoice-BLNTD2lK.js.map} +1 -1
- package/dist/_chunks/{PkToolShowProductList-D3Qe8yQM.js → PkToolShowProductList-B4S5_m-f.js} +2 -2
- package/dist/_chunks/{PkToolShowProductList-D3Qe8yQM.js.map → PkToolShowProductList-B4S5_m-f.js.map} +1 -1
- package/dist/_chunks/{PkToolShowQrCode-B64sdI0N.js → PkToolShowQrCode-BVZlzYDq.js} +3 -3
- package/dist/_chunks/{PkToolShowQrCode-B64sdI0N.js.map → PkToolShowQrCode-BVZlzYDq.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-B2rf94fU.js → PkToolShowSources-BQo5DRwt.js} +2 -2
- package/dist/_chunks/{PkToolShowSources-B2rf94fU.js.map → PkToolShowSources-BQo5DRwt.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSuggestedReply-BGWA08C7.js → PkToolShowSuggestedReply-BxDI6yp_.js} +2 -2
- package/dist/_chunks/{PkToolShowSuggestedReply-BGWA08C7.js.map → PkToolShowSuggestedReply-BxDI6yp_.js.map} +1 -1
- package/dist/_chunks/{PkToolShowWeather-ClMzD04y.js → PkToolShowWeather-DR6egBIP.js} +3 -3
- package/dist/_chunks/{PkToolShowWeather-ClMzD04y.js.map → PkToolShowWeather-DR6egBIP.js.map} +1 -1
- package/dist/_chunks/{PkToolShowWebPages-BCqywwEK.js → PkToolShowWebPages-D8RngE-F.js} +2 -2
- package/dist/_chunks/{PkToolShowWebPages-BCqywwEK.js.map → PkToolShowWebPages-D8RngE-F.js.map} +1 -1
- package/dist/_chunks/{index.es-Z3Hu-QIb.js → index.es-BGFmj59S.js} +2429 -1559
- package/dist/_chunks/{index.es-Z3Hu-QIb.js.map → index.es-BGFmj59S.js.map} +1 -1
- package/dist/ai-elements.es.js +2908 -2711
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotFeedbackForm.js +1 -1
- package/dist-vue/PkChatbotFilePreview.js +1 -1
- package/dist-vue/PkChatbotInput.js +1 -1
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/PkChatbotViewConversations.js +1 -1
- package/dist-vue/PkChatbotViewProfile.js +1 -1
- package/dist-vue/_chunks/PkChatbot-woRkjgP5.js +190 -0
- package/dist-vue/_chunks/{PkChatbot-D5_ytfqS.js.map → PkChatbot-woRkjgP5.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotFeedbackForm-CUnS-WyR.js → PkChatbotFeedbackForm-D-lx1URv.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotFeedbackForm-CUnS-WyR.js.map → PkChatbotFeedbackForm-D-lx1URv.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotFilePreview-JSpi3pmN.js → PkChatbotFilePreview-DHzuGtz5.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotFilePreview-JSpi3pmN.js.map → PkChatbotFilePreview-DHzuGtz5.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotInput-ODPhsqZt.js → PkChatbotInput-LHE0HZ9z.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotInput-ODPhsqZt.js.map → PkChatbotInput-LHE0HZ9z.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotMessages-CMLqkhmb.js → PkChatbotMessages-BxTeEm3j.js} +15 -15
- package/dist-vue/_chunks/{PkChatbotMessages-CMLqkhmb.js.map → PkChatbotMessages-BxTeEm3j.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-wLCypxNG.js → PkChatbotViewChat-BoEfZeco.js} +9 -9
- package/dist-vue/_chunks/{PkChatbotViewChat-wLCypxNG.js.map → PkChatbotViewChat-BoEfZeco.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotViewConversations-DvVc1arX.js +163 -0
- package/dist-vue/_chunks/PkChatbotViewConversations-DvVc1arX.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewProfile-CXmmVXrD.js → PkChatbotViewProfile-Dev_6pki.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-CXmmVXrD.js.map → PkChatbotViewProfile-Dev_6pki.js.map} +1 -1
- package/dist-vue/_chunks/{PkRelativeTime-jP41qAJ5.js → PkRelativeTime-WZ2aPcp_.js} +1 -1
- package/dist-vue/_chunks/{PkRelativeTime-jP41qAJ5.js.map → PkRelativeTime-WZ2aPcp_.js.map} +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-CtiMH6FD.js → PkStreamingMarkdown-B4gnJ4hk.js} +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-CtiMH6FD.js.map → PkStreamingMarkdown-B4gnJ4hk.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowArtifact-C2DgB_1z.js → PkToolShowArtifact-EvbUZSOf.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-C2DgB_1z.js.map → PkToolShowArtifact-EvbUZSOf.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-BzzbXuhh.js → PkToolShowContactForm-CsDOqSJK.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowContactForm-BzzbXuhh.js.map → PkToolShowContactForm-CsDOqSJK.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowImageGallery-DQXrJYop.js → PkToolShowImageGallery-B7Bt6ZGv.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowImageGallery-DQXrJYop.js.map → PkToolShowImageGallery-B7Bt6ZGv.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowLocation-McDIqI8y.js → PkToolShowLocation-DteWf0Cs.js} +1 -1
- package/dist-vue/_chunks/{PkToolShowLocation-McDIqI8y.js.map → PkToolShowLocation-DteWf0Cs.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowMultipleChoice-DW3m6VbJ.js → PkToolShowMultipleChoice-DZXfWtQp.js} +1 -1
- package/dist-vue/_chunks/{PkToolShowMultipleChoice-DW3m6VbJ.js.map → PkToolShowMultipleChoice-DZXfWtQp.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-BDSJs7bn.js → PkToolShowProductList-CtqWK0x4.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-BDSJs7bn.js.map → PkToolShowProductList-CtqWK0x4.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-D5cBZxwQ.js → PkToolShowSources-ZtXFkIHt.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowSources-D5cBZxwQ.js.map → PkToolShowSources-ZtXFkIHt.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-Dm3BTWYg.js → PkToolShowSuggestedReply-30m9yWDL.js} +1 -1
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-Dm3BTWYg.js.map → PkToolShowSuggestedReply-30m9yWDL.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-DnYVhLVU.js → PkToolShowWebPages-DZIdrdWs.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-DnYVhLVU.js.map → PkToolShowWebPages-DZIdrdWs.js.map} +1 -1
- package/dist-vue/_chunks/{PkUrl-CH4pWBR8.js → PkUrl-CGbSBfuP.js} +1 -1
- package/dist-vue/_chunks/{PkUrl-CH4pWBR8.js.map → PkUrl-CGbSBfuP.js.map} +1 -1
- package/dist-vue/_chunks/{createChatbotApiClient-2ynLWELM.js → createChatbotApiClient-YJegM3ni.js} +140 -118
- package/dist-vue/_chunks/createChatbotApiClient-YJegM3ni.js.map +1 -0
- package/dist-vue/_chunks/{dist-Bs6dYy7x.js → dist-21vPGg1O.js} +3 -3
- package/dist-vue/_chunks/{dist-Bs6dYy7x.js.map → dist-21vPGg1O.js.map} +1 -1
- package/dist-vue/_chunks/{dist-Bb1zRSg4.js → dist-BGXTbYew2.js} +4 -4
- package/dist-vue/_chunks/dist-BGXTbYew2.js.map +1 -0
- package/dist-vue/_chunks/{dist-BrlD3co0.js → dist-BL9cumqH.js} +2 -2
- package/dist-vue/_chunks/{dist-BrlD3co0.js.map → dist-BL9cumqH.js.map} +1 -1
- package/dist-vue/_chunks/{dist-B9Pw4_a5.js → dist-BU-VgsYM.js} +3 -3
- package/dist-vue/_chunks/{dist-B9Pw4_a5.js.map → dist-BU-VgsYM.js.map} +1 -1
- package/dist-vue/_chunks/{dist-D-tjAaHK.js → dist-BU5m1pTR.js} +3 -3
- package/dist-vue/_chunks/{dist-D-tjAaHK.js.map → dist-BU5m1pTR.js.map} +1 -1
- package/dist-vue/_chunks/{dist-Dn0cKZ5Q.js → dist-BbP2I_Or.js} +2 -2
- package/dist-vue/_chunks/{dist-Dn0cKZ5Q.js.map → dist-BbP2I_Or.js.map} +1 -1
- package/dist-vue/_chunks/{dist-Cvsv0YEw.js → dist-BvmTki6w.js} +3 -3
- package/dist-vue/_chunks/{dist-Cvsv0YEw.js.map → dist-BvmTki6w.js.map} +1 -1
- package/dist-vue/_chunks/{dist-QzbLuLIV.js → dist-C3dPzENq.js} +3 -3
- package/dist-vue/_chunks/{dist-QzbLuLIV.js.map → dist-C3dPzENq.js.map} +1 -1
- package/dist-vue/_chunks/{dist-BMWOJZqC.js → dist-C6AWJq9a.js} +2 -2
- package/dist-vue/_chunks/{dist-BMWOJZqC.js.map → dist-C6AWJq9a.js.map} +1 -1
- package/dist-vue/_chunks/{dist-BQCdUoYc.js → dist-CGNGkvWf.js} +4 -4
- package/dist-vue/_chunks/{dist-BQCdUoYc.js.map → dist-CGNGkvWf.js.map} +1 -1
- package/dist-vue/_chunks/{dist-JOgG1zY3.js → dist-CIN_Avbm.js} +1 -1
- package/dist-vue/_chunks/{dist-JOgG1zY3.js.map → dist-CIN_Avbm.js.map} +1 -1
- package/dist-vue/_chunks/{dist-NKG-Bt-Q.js → dist-CePpgudw.js} +3 -3
- package/dist-vue/_chunks/{dist-NKG-Bt-Q.js.map → dist-CePpgudw.js.map} +1 -1
- package/dist-vue/_chunks/{dist-C13mHkC-.js → dist-CtMo7ig_.js} +2 -2
- package/dist-vue/_chunks/{dist-C13mHkC-.js.map → dist-CtMo7ig_.js.map} +1 -1
- package/dist-vue/_chunks/{dist-DucfoJQX.js → dist-CwG072cD.js} +3 -3
- package/dist-vue/_chunks/{dist-DucfoJQX.js.map → dist-CwG072cD.js.map} +1 -1
- package/dist-vue/_chunks/{dist-_4yQQX_L.js → dist-DFvVVU0-.js} +2 -2
- package/dist-vue/_chunks/{dist-_4yQQX_L.js.map → dist-DFvVVU0-.js.map} +1 -1
- package/dist-vue/_chunks/{dist-C_tRbeXQ.js → dist-DGz57kzK.js} +2 -2
- package/dist-vue/_chunks/{dist-C_tRbeXQ.js.map → dist-DGz57kzK.js.map} +1 -1
- package/dist-vue/_chunks/{dist-C2tC3pDh.js → dist-DT30Xa-D.js} +2 -2
- package/dist-vue/_chunks/{dist-C2tC3pDh.js.map → dist-DT30Xa-D.js.map} +1 -1
- package/dist-vue/_chunks/{dist-DNn7FqmI.js → dist-DoRhRpjL.js} +2 -2
- package/dist-vue/_chunks/{dist-DNn7FqmI.js.map → dist-DoRhRpjL.js.map} +1 -1
- package/dist-vue/_chunks/{dist-CQmgfFIN.js → dist-GnhLE5-A.js} +4 -4
- package/dist-vue/_chunks/{dist-CQmgfFIN.js.map → dist-GnhLE5-A.js.map} +1 -1
- package/dist-vue/_chunks/{dist-1ToEz3Zq.js → dist-QzWOn2Kx.js} +3 -3
- package/dist-vue/_chunks/{dist-1ToEz3Zq.js.map → dist-QzWOn2Kx.js.map} +1 -1
- package/dist-vue/_chunks/{dist-e9UFeG14.js → dist-uYEYs0EJ.js} +2 -2
- package/dist-vue/_chunks/{dist-e9UFeG14.js.map → dist-uYEYs0EJ.js.map} +1 -1
- package/dist-vue/_chunks/{dist-BpT8aqtS.js → dist-ukeBjdwq.js} +4 -4
- package/dist-vue/_chunks/{dist-BpT8aqtS.js.map → dist-ukeBjdwq.js.map} +1 -1
- package/dist-vue/_chunks/{dist-BHTSdHeX.js → dist-wLB8N32T.js} +3 -3
- package/dist-vue/_chunks/{dist-BHTSdHeX.js.map → dist-wLB8N32T.js.map} +1 -1
- package/dist-vue/_chunks/{index.es-BnOT0fHY.js → index.es-CrPSzhoZ.js} +1 -1
- package/dist-vue/_chunks/{index.es-BnOT0fHY.js.map → index.es-CrPSzhoZ.js.map} +1 -1
- package/dist-vue/_chunks/{useChatbotStore-Im8Xjwte.js → useChatbotStore-DGL81KJa.js} +720 -704
- package/dist-vue/_chunks/{useChatbotStore-Im8Xjwte.js.map → useChatbotStore-DGL81KJa.js.map} +1 -1
- package/dist-vue/_chunks/{useLightbox-BiZUwsmB.js → useLightbox-1sB7fmFb.js} +1 -1
- package/dist-vue/_chunks/{useLightbox-BiZUwsmB.js.map → useLightbox-1sB7fmFb.js.map} +1 -1
- package/dist-vue/_chunks/{utils-DO7emdsn.js → utils-BegUBK7s.js} +1 -1
- package/dist-vue/_chunks/{utils-DO7emdsn.js.map → utils-BegUBK7s.js.map} +1 -1
- package/dist-vue/api.js +1 -1
- package/dist-vue/apps/web-component/src/composables/useChatbotAgent.d.ts +3 -1
- package/dist-vue/composables.js +3 -3
- package/dist-vue/index.js +3552 -3512
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +56 -20
- package/dist-vue/packages/components/src/PkEditorPrompt.d.ts +2 -0
- package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +6 -3
- package/dist-vue/packages/components/src/chat/PkEditorChannels.d.ts +16 -0
- package/dist-vue/packages/composable/src/chatbot/api/createChatbotApiClient.d.ts +2 -0
- package/dist-vue/packages/models/src/schema/Agent.d.ts +10 -0
- package/dist-vue/packages/models/src/schema/Chat.d.ts +6 -0
- package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +3 -1
- package/dist-vue/packages/models/src/schema/SubAgent.d.ts +3 -1
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist-vue/_chunks/PkChatbot-D5_ytfqS.js +0 -190
- package/dist-vue/_chunks/PkChatbotViewConversations-B5qBiqo4.js +0 -40
- package/dist-vue/_chunks/PkChatbotViewConversations-B5qBiqo4.js.map +0 -1
- package/dist-vue/_chunks/createChatbotApiClient-2ynLWELM.js.map +0 -1
- package/dist-vue/_chunks/dist-Bb1zRSg4.js.map +0 -1
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-D9KsE1-l.js";
|
|
2
|
-
import { t } from "./createChatbotApiClient-
|
|
2
|
+
import { t } from "./createChatbotApiClient-YJegM3ni.js";
|
|
3
3
|
import { C as n, S as r, _ as i, a, b as o, c as s, d as c, g as l, i as u, m as d, n as f, o as p, p as m, r as h, s as g, u as ee, v as _, y as v } from "./schemas-sa2dDEGb.js";
|
|
4
4
|
import { _ as te, g as ne, h as re, s as ie } from "./src-EtGd6cRz.js";
|
|
5
5
|
import { a as y, i as b, n as x, r as S, t as C } from "./ZodError-Ca0wCsGp.js";
|
|
6
6
|
import { t as ae } from "./useSafeLocalStorage-BDPvGrtd.js";
|
|
7
7
|
import { computed as w, getCurrentInstance as oe, isReadonly as se, onMounted as ce, onUnmounted as le, reactive as ue, ref as T, toRefs as E, watch as de, watchEffect as fe } from "vue";
|
|
8
8
|
import { useI18n as pe } from "vue-i18n";
|
|
9
|
-
import { defineStore as
|
|
9
|
+
import { defineStore as me } from "pinia";
|
|
10
10
|
//#region ../../node_modules/.pnpm/@ai-sdk+provider@3.0.8/node_modules/@ai-sdk/provider/dist/index.mjs
|
|
11
|
-
var
|
|
11
|
+
var D = "vercel.ai.error", he = Symbol.for(D), ge, _e, O = class e extends (_e = Error, ge = he, _e) {
|
|
12
12
|
constructor({ name: e, message: t, cause: n }) {
|
|
13
13
|
super(t), this[ge] = !0, this.name = e, this.cause = n;
|
|
14
14
|
}
|
|
15
15
|
static isInstance(t) {
|
|
16
|
-
return e.hasMarker(t,
|
|
16
|
+
return e.hasMarker(t, D);
|
|
17
17
|
}
|
|
18
18
|
static hasMarker(e, t) {
|
|
19
19
|
let n = Symbol.for(t);
|
|
20
20
|
return typeof e == "object" && !!e && n in e && typeof e[n] == "boolean" && e[n] === !0;
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
function
|
|
23
|
+
function k(e) {
|
|
24
24
|
return e == null ? "unknown error" : typeof e == "string" ? e : e instanceof Error ? e.message : JSON.stringify(e);
|
|
25
25
|
}
|
|
26
|
-
var
|
|
26
|
+
var ve = "AI_InvalidArgumentError", ye = `vercel.ai.error.${ve}`, be = Symbol.for(ye), xe, Se, Ce = class extends (Se = O, xe = be, Se) {
|
|
27
27
|
constructor({ message: e, cause: t, argument: n }) {
|
|
28
28
|
super({
|
|
29
|
-
name:
|
|
29
|
+
name: ve,
|
|
30
30
|
message: e,
|
|
31
31
|
cause: t
|
|
32
|
-
}), this[
|
|
32
|
+
}), this[xe] = !0, this.argument = n;
|
|
33
33
|
}
|
|
34
34
|
static isInstance(e) {
|
|
35
|
-
return O.hasMarker(e,
|
|
35
|
+
return O.hasMarker(e, ye);
|
|
36
36
|
}
|
|
37
|
-
},
|
|
37
|
+
}, we = "AI_JSONParseError", Te = `vercel.ai.error.${we}`, Ee = Symbol.for(Te), De, A, j = class extends (A = O, De = Ee, A) {
|
|
38
38
|
constructor({ text: e, cause: t }) {
|
|
39
39
|
super({
|
|
40
|
-
name:
|
|
40
|
+
name: we,
|
|
41
41
|
message: `JSON parsing failed: Text: ${e}.
|
|
42
|
-
Error message: ${
|
|
42
|
+
Error message: ${k(t)}`,
|
|
43
43
|
cause: t
|
|
44
|
-
}), this[
|
|
44
|
+
}), this[De] = !0, this.text = e;
|
|
45
45
|
}
|
|
46
46
|
static isInstance(e) {
|
|
47
|
-
return O.hasMarker(e,
|
|
47
|
+
return O.hasMarker(e, Te);
|
|
48
48
|
}
|
|
49
|
-
},
|
|
49
|
+
}, Oe = "AI_TypeValidationError", ke = `vercel.ai.error.${Oe}`, Ae = Symbol.for(ke), je, Me, Ne = class e extends (Me = O, je = Ae, Me) {
|
|
50
50
|
constructor({ value: e, cause: t, context: n }) {
|
|
51
51
|
let r = "Type validation failed";
|
|
52
52
|
if (n?.field && (r += ` for ${n.field}`), n?.entityName || n?.entityId) {
|
|
@@ -55,14 +55,14 @@ Error message: ${ve(t)}`,
|
|
|
55
55
|
n.entityName && e.push(n.entityName), n.entityId && e.push(`id: "${n.entityId}"`), r += e.join(", "), r += ")";
|
|
56
56
|
}
|
|
57
57
|
super({
|
|
58
|
-
name:
|
|
58
|
+
name: Oe,
|
|
59
59
|
message: `${r}: Value: ${JSON.stringify(e)}.
|
|
60
|
-
Error message: ${
|
|
60
|
+
Error message: ${k(t)}`,
|
|
61
61
|
cause: t
|
|
62
|
-
}), this[
|
|
62
|
+
}), this[je] = !0, this.value = e, this.context = n;
|
|
63
63
|
}
|
|
64
64
|
static isInstance(e) {
|
|
65
|
-
return O.hasMarker(e,
|
|
65
|
+
return O.hasMarker(e, ke);
|
|
66
66
|
}
|
|
67
67
|
static wrap({ value: t, cause: n, context: r }) {
|
|
68
68
|
return e.isInstance(n) && n.value === t && n.context?.field === r?.field && n.context?.entityName === r?.entityName && n.context?.entityId === r?.entityId ? n : new e({
|
|
@@ -71,7 +71,7 @@ Error message: ${ve(t)}`,
|
|
|
71
71
|
context: r
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
|
-
},
|
|
74
|
+
}, Pe = (e, t) => {
|
|
75
75
|
let n;
|
|
76
76
|
switch (e.code) {
|
|
77
77
|
case x.invalid_type:
|
|
@@ -125,7 +125,7 @@ Error message: ${ve(t)}`,
|
|
|
125
125
|
default: n = t.defaultError, y.assertNever(e);
|
|
126
126
|
}
|
|
127
127
|
return { message: n };
|
|
128
|
-
}, Fe =
|
|
128
|
+
}, Fe = Pe;
|
|
129
129
|
function Ie() {
|
|
130
130
|
return Fe;
|
|
131
131
|
}
|
|
@@ -161,7 +161,7 @@ function M(e, t) {
|
|
|
161
161
|
e.common.contextualErrorMap,
|
|
162
162
|
e.schemaErrorMap,
|
|
163
163
|
n,
|
|
164
|
-
n ===
|
|
164
|
+
n === Pe ? void 0 : Pe
|
|
165
165
|
].filter((e) => !!e)
|
|
166
166
|
});
|
|
167
167
|
e.common.issues.push(r);
|
|
@@ -216,21 +216,21 @@ var N = class e {
|
|
|
216
216
|
}), F = (e) => ({
|
|
217
217
|
status: "valid",
|
|
218
218
|
value: e
|
|
219
|
-
}), ze = (e) => e.status === "aborted", Be = (e) => e.status === "dirty",
|
|
219
|
+
}), ze = (e) => e.status === "aborted", Be = (e) => e.status === "dirty", Ve = (e) => e.status === "valid", He = (e) => typeof Promise < "u" && e instanceof Promise, I;
|
|
220
220
|
(function(e) {
|
|
221
221
|
e.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, e.toString = (e) => typeof e == "string" ? e : e?.message;
|
|
222
|
-
})(
|
|
222
|
+
})(I ||= {});
|
|
223
223
|
//#endregion
|
|
224
224
|
//#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/types.js
|
|
225
|
-
var
|
|
225
|
+
var L = class {
|
|
226
226
|
constructor(e, t, n, r) {
|
|
227
227
|
this._cachedPath = [], this.parent = e, this.data = t, this._path = n, this._key = r;
|
|
228
228
|
}
|
|
229
229
|
get path() {
|
|
230
230
|
return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
231
231
|
}
|
|
232
|
-
},
|
|
233
|
-
if (
|
|
232
|
+
}, Ue = (e, t) => {
|
|
233
|
+
if (Ve(t)) return {
|
|
234
234
|
success: !0,
|
|
235
235
|
data: t.value
|
|
236
236
|
};
|
|
@@ -244,7 +244,7 @@ var R = class {
|
|
|
244
244
|
}
|
|
245
245
|
};
|
|
246
246
|
};
|
|
247
|
-
function
|
|
247
|
+
function R(e) {
|
|
248
248
|
if (!e) return {};
|
|
249
249
|
let { errorMap: t, invalid_type_error: n, required_error: r, description: i } = e;
|
|
250
250
|
if (t && (n || r)) throw Error("Can't use \"invalid_type_error\" or \"required_error\" in conjunction with custom error map.");
|
|
@@ -259,7 +259,7 @@ function z(e) {
|
|
|
259
259
|
description: i
|
|
260
260
|
};
|
|
261
261
|
}
|
|
262
|
-
var
|
|
262
|
+
var z = class {
|
|
263
263
|
get description() {
|
|
264
264
|
return this._def.description;
|
|
265
265
|
}
|
|
@@ -291,7 +291,7 @@ var B = class {
|
|
|
291
291
|
}
|
|
292
292
|
_parseSync(e) {
|
|
293
293
|
let t = this._parse(e);
|
|
294
|
-
if (
|
|
294
|
+
if (He(t)) throw Error("Synchronous parse encountered promise.");
|
|
295
295
|
return t;
|
|
296
296
|
}
|
|
297
297
|
_parseAsync(e) {
|
|
@@ -316,7 +316,7 @@ var B = class {
|
|
|
316
316
|
data: e,
|
|
317
317
|
parsedType: b(e)
|
|
318
318
|
};
|
|
319
|
-
return
|
|
319
|
+
return Ue(n, this._parseSync({
|
|
320
320
|
data: e,
|
|
321
321
|
path: n.path,
|
|
322
322
|
parent: n
|
|
@@ -340,7 +340,7 @@ var B = class {
|
|
|
340
340
|
path: [],
|
|
341
341
|
parent: t
|
|
342
342
|
});
|
|
343
|
-
return
|
|
343
|
+
return Ve(n) ? { value: n.value } : { issues: t.common.issues };
|
|
344
344
|
} catch (e) {
|
|
345
345
|
e?.message?.toLowerCase()?.includes("encountered") && (this["~standard"].async = !0), t.common = {
|
|
346
346
|
issues: [],
|
|
@@ -351,7 +351,7 @@ var B = class {
|
|
|
351
351
|
data: e,
|
|
352
352
|
path: [],
|
|
353
353
|
parent: t
|
|
354
|
-
}).then((e) =>
|
|
354
|
+
}).then((e) => Ve(e) ? { value: e.value } : { issues: t.common.issues });
|
|
355
355
|
}
|
|
356
356
|
async parseAsync(e, t) {
|
|
357
357
|
let n = await this.safeParseAsync(e, t);
|
|
@@ -375,7 +375,7 @@ var B = class {
|
|
|
375
375
|
path: n.path,
|
|
376
376
|
parent: n
|
|
377
377
|
});
|
|
378
|
-
return
|
|
378
|
+
return Ue(n, await (He(r) ? r : Promise.resolve(r)));
|
|
379
379
|
}
|
|
380
380
|
refine(e, t) {
|
|
381
381
|
let n = (e) => typeof t == "string" || t === void 0 ? { message: t } : typeof t == "function" ? t(e) : t;
|
|
@@ -391,9 +391,9 @@ var B = class {
|
|
|
391
391
|
return this._refinement((n, r) => e(n) ? !0 : (r.addIssue(typeof t == "function" ? t(n, r) : t), !1));
|
|
392
392
|
}
|
|
393
393
|
_refinement(e) {
|
|
394
|
-
return new
|
|
394
|
+
return new H({
|
|
395
395
|
schema: this,
|
|
396
|
-
typeName:
|
|
396
|
+
typeName: W.ZodEffects,
|
|
397
397
|
effect: {
|
|
398
398
|
type: "refinement",
|
|
399
399
|
refinement: e
|
|
@@ -411,31 +411,31 @@ var B = class {
|
|
|
411
411
|
};
|
|
412
412
|
}
|
|
413
413
|
optional() {
|
|
414
|
-
return
|
|
414
|
+
return U.create(this, this._def);
|
|
415
415
|
}
|
|
416
416
|
nullable() {
|
|
417
|
-
return
|
|
417
|
+
return Wt.create(this, this._def);
|
|
418
418
|
}
|
|
419
419
|
nullish() {
|
|
420
420
|
return this.nullable().optional();
|
|
421
421
|
}
|
|
422
422
|
array() {
|
|
423
|
-
return
|
|
423
|
+
return Et.create(this);
|
|
424
424
|
}
|
|
425
425
|
promise() {
|
|
426
|
-
return
|
|
426
|
+
return Ut.create(this, this._def);
|
|
427
427
|
}
|
|
428
428
|
or(e) {
|
|
429
|
-
return
|
|
429
|
+
return Ot.create([this, e], this._def);
|
|
430
430
|
}
|
|
431
431
|
and(e) {
|
|
432
|
-
return
|
|
432
|
+
return Mt.create(this, e, this._def);
|
|
433
433
|
}
|
|
434
434
|
transform(e) {
|
|
435
|
-
return new
|
|
436
|
-
...
|
|
435
|
+
return new H({
|
|
436
|
+
...R(this._def),
|
|
437
437
|
schema: this,
|
|
438
|
-
typeName:
|
|
438
|
+
typeName: W.ZodEffects,
|
|
439
439
|
effect: {
|
|
440
440
|
type: "transform",
|
|
441
441
|
transform: e
|
|
@@ -444,27 +444,27 @@ var B = class {
|
|
|
444
444
|
}
|
|
445
445
|
default(e) {
|
|
446
446
|
let t = typeof e == "function" ? e : () => e;
|
|
447
|
-
return new
|
|
448
|
-
...
|
|
447
|
+
return new Gt({
|
|
448
|
+
...R(this._def),
|
|
449
449
|
innerType: this,
|
|
450
450
|
defaultValue: t,
|
|
451
|
-
typeName:
|
|
451
|
+
typeName: W.ZodDefault
|
|
452
452
|
});
|
|
453
453
|
}
|
|
454
454
|
brand() {
|
|
455
|
-
return new
|
|
456
|
-
typeName:
|
|
455
|
+
return new Jt({
|
|
456
|
+
typeName: W.ZodBranded,
|
|
457
457
|
type: this,
|
|
458
|
-
...
|
|
458
|
+
...R(this._def)
|
|
459
459
|
});
|
|
460
460
|
}
|
|
461
461
|
catch(e) {
|
|
462
462
|
let t = typeof e == "function" ? e : () => e;
|
|
463
|
-
return new
|
|
464
|
-
...
|
|
463
|
+
return new Kt({
|
|
464
|
+
...R(this._def),
|
|
465
465
|
innerType: this,
|
|
466
466
|
catchValue: t,
|
|
467
|
-
typeName:
|
|
467
|
+
typeName: W.ZodCatch
|
|
468
468
|
});
|
|
469
469
|
}
|
|
470
470
|
describe(e) {
|
|
@@ -475,10 +475,10 @@ var B = class {
|
|
|
475
475
|
});
|
|
476
476
|
}
|
|
477
477
|
pipe(e) {
|
|
478
|
-
return
|
|
478
|
+
return Yt.create(this, e);
|
|
479
479
|
}
|
|
480
480
|
readonly() {
|
|
481
|
-
return
|
|
481
|
+
return Xt.create(this);
|
|
482
482
|
}
|
|
483
483
|
isOptional() {
|
|
484
484
|
return this.safeParse(void 0).success;
|
|
@@ -486,25 +486,25 @@ var B = class {
|
|
|
486
486
|
isNullable() {
|
|
487
487
|
return this.safeParse(null).success;
|
|
488
488
|
}
|
|
489
|
-
},
|
|
490
|
-
function
|
|
489
|
+
}, We = /^c[^\s-]{8,}$/i, Ge = /^[0-9a-z]+$/, Ke = /^[0-9A-HJKMNP-TV-Z]{26}$/i, qe = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Je = /^[a-z0-9_-]{21}$/i, Ye = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Xe = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Ze = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Qe = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", $e, et = /^(?:(?: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])$/, tt = /^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/, nt = /^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, rt = /^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, it = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, at = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, ot = "((\\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])))", st = RegExp(`^${ot}$`);
|
|
490
|
+
function ct(e) {
|
|
491
491
|
let t = "[0-5]\\d";
|
|
492
492
|
e.precision ? t = `${t}\\.\\d{${e.precision}}` : e.precision ?? (t = `${t}(\\.\\d+)?`);
|
|
493
493
|
let n = e.precision ? "+" : "?";
|
|
494
494
|
return `([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`;
|
|
495
495
|
}
|
|
496
|
-
function ct(e) {
|
|
497
|
-
return RegExp(`^${st(e)}$`);
|
|
498
|
-
}
|
|
499
496
|
function lt(e) {
|
|
500
|
-
|
|
501
|
-
return n.push(e.local ? "Z?" : "Z"), e.offset && n.push("([+-]\\d{2}:?\\d{2})"), t = `${t}(${n.join("|")})`, RegExp(`^${t}$`);
|
|
497
|
+
return RegExp(`^${ct(e)}$`);
|
|
502
498
|
}
|
|
503
|
-
function ut(e
|
|
504
|
-
|
|
499
|
+
function ut(e) {
|
|
500
|
+
let t = `${ot}T${ct(e)}`, n = [];
|
|
501
|
+
return n.push(e.local ? "Z?" : "Z"), e.offset && n.push("([+-]\\d{2}:?\\d{2})"), t = `${t}(${n.join("|")})`, RegExp(`^${t}$`);
|
|
505
502
|
}
|
|
506
503
|
function dt(e, t) {
|
|
507
|
-
|
|
504
|
+
return !!((t === "v4" || !t) && et.test(e) || (t === "v6" || !t) && nt.test(e));
|
|
505
|
+
}
|
|
506
|
+
function ft(e, t) {
|
|
507
|
+
if (!Ye.test(e)) return !1;
|
|
508
508
|
try {
|
|
509
509
|
let [n] = e.split(".");
|
|
510
510
|
if (!n) return !1;
|
|
@@ -514,10 +514,10 @@ function dt(e, t) {
|
|
|
514
514
|
return !1;
|
|
515
515
|
}
|
|
516
516
|
}
|
|
517
|
-
function
|
|
518
|
-
return !!((t === "v4" || !t) &&
|
|
517
|
+
function pt(e, t) {
|
|
518
|
+
return !!((t === "v4" || !t) && tt.test(e) || (t === "v6" || !t) && rt.test(e));
|
|
519
519
|
}
|
|
520
|
-
var
|
|
520
|
+
var mt = class e extends z {
|
|
521
521
|
_parse(e) {
|
|
522
522
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== S.string) {
|
|
523
523
|
let t = this._getOrReturnCtx(e);
|
|
@@ -561,37 +561,37 @@ var pt = class e extends B {
|
|
|
561
561
|
exact: !0,
|
|
562
562
|
message: r.message
|
|
563
563
|
}), t.dirty());
|
|
564
|
-
} else if (r.kind === "email")
|
|
564
|
+
} else if (r.kind === "email") Ze.test(e.data) || (n = this._getOrReturnCtx(e, n), M(n, {
|
|
565
565
|
validation: "email",
|
|
566
566
|
code: x.invalid_string,
|
|
567
567
|
message: r.message
|
|
568
568
|
}), t.dirty());
|
|
569
|
-
else if (r.kind === "emoji")
|
|
569
|
+
else if (r.kind === "emoji") $e ||= new RegExp(Qe, "u"), $e.test(e.data) || (n = this._getOrReturnCtx(e, n), M(n, {
|
|
570
570
|
validation: "emoji",
|
|
571
571
|
code: x.invalid_string,
|
|
572
572
|
message: r.message
|
|
573
573
|
}), t.dirty());
|
|
574
|
-
else if (r.kind === "uuid")
|
|
574
|
+
else if (r.kind === "uuid") qe.test(e.data) || (n = this._getOrReturnCtx(e, n), M(n, {
|
|
575
575
|
validation: "uuid",
|
|
576
576
|
code: x.invalid_string,
|
|
577
577
|
message: r.message
|
|
578
578
|
}), t.dirty());
|
|
579
|
-
else if (r.kind === "nanoid")
|
|
579
|
+
else if (r.kind === "nanoid") Je.test(e.data) || (n = this._getOrReturnCtx(e, n), M(n, {
|
|
580
580
|
validation: "nanoid",
|
|
581
581
|
code: x.invalid_string,
|
|
582
582
|
message: r.message
|
|
583
583
|
}), t.dirty());
|
|
584
|
-
else if (r.kind === "cuid")
|
|
584
|
+
else if (r.kind === "cuid") We.test(e.data) || (n = this._getOrReturnCtx(e, n), M(n, {
|
|
585
585
|
validation: "cuid",
|
|
586
586
|
code: x.invalid_string,
|
|
587
587
|
message: r.message
|
|
588
588
|
}), t.dirty());
|
|
589
|
-
else if (r.kind === "cuid2")
|
|
589
|
+
else if (r.kind === "cuid2") Ge.test(e.data) || (n = this._getOrReturnCtx(e, n), M(n, {
|
|
590
590
|
validation: "cuid2",
|
|
591
591
|
code: x.invalid_string,
|
|
592
592
|
message: r.message
|
|
593
593
|
}), t.dirty());
|
|
594
|
-
else if (r.kind === "ulid")
|
|
594
|
+
else if (r.kind === "ulid") Ke.test(e.data) || (n = this._getOrReturnCtx(e, n), M(n, {
|
|
595
595
|
validation: "ulid",
|
|
596
596
|
code: x.invalid_string,
|
|
597
597
|
message: r.message
|
|
@@ -624,39 +624,39 @@ var pt = class e extends B {
|
|
|
624
624
|
code: x.invalid_string,
|
|
625
625
|
validation: { endsWith: r.value },
|
|
626
626
|
message: r.message
|
|
627
|
-
}), t.dirty()) : r.kind === "datetime" ?
|
|
627
|
+
}), t.dirty()) : r.kind === "datetime" ? ut(r).test(e.data) || (n = this._getOrReturnCtx(e, n), M(n, {
|
|
628
628
|
code: x.invalid_string,
|
|
629
629
|
validation: "datetime",
|
|
630
630
|
message: r.message
|
|
631
|
-
}), t.dirty()) : r.kind === "date" ?
|
|
631
|
+
}), t.dirty()) : r.kind === "date" ? st.test(e.data) || (n = this._getOrReturnCtx(e, n), M(n, {
|
|
632
632
|
code: x.invalid_string,
|
|
633
633
|
validation: "date",
|
|
634
634
|
message: r.message
|
|
635
|
-
}), t.dirty()) : r.kind === "time" ?
|
|
635
|
+
}), t.dirty()) : r.kind === "time" ? lt(r).test(e.data) || (n = this._getOrReturnCtx(e, n), M(n, {
|
|
636
636
|
code: x.invalid_string,
|
|
637
637
|
validation: "time",
|
|
638
638
|
message: r.message
|
|
639
|
-
}), t.dirty()) : r.kind === "duration" ?
|
|
639
|
+
}), t.dirty()) : r.kind === "duration" ? Xe.test(e.data) || (n = this._getOrReturnCtx(e, n), M(n, {
|
|
640
640
|
validation: "duration",
|
|
641
641
|
code: x.invalid_string,
|
|
642
642
|
message: r.message
|
|
643
|
-
}), t.dirty()) : r.kind === "ip" ?
|
|
643
|
+
}), t.dirty()) : r.kind === "ip" ? dt(e.data, r.version) || (n = this._getOrReturnCtx(e, n), M(n, {
|
|
644
644
|
validation: "ip",
|
|
645
645
|
code: x.invalid_string,
|
|
646
646
|
message: r.message
|
|
647
|
-
}), t.dirty()) : r.kind === "jwt" ?
|
|
647
|
+
}), t.dirty()) : r.kind === "jwt" ? ft(e.data, r.alg) || (n = this._getOrReturnCtx(e, n), M(n, {
|
|
648
648
|
validation: "jwt",
|
|
649
649
|
code: x.invalid_string,
|
|
650
650
|
message: r.message
|
|
651
|
-
}), t.dirty()) : r.kind === "cidr" ?
|
|
651
|
+
}), t.dirty()) : r.kind === "cidr" ? pt(e.data, r.version) || (n = this._getOrReturnCtx(e, n), M(n, {
|
|
652
652
|
validation: "cidr",
|
|
653
653
|
code: x.invalid_string,
|
|
654
654
|
message: r.message
|
|
655
|
-
}), t.dirty()) : r.kind === "base64" ?
|
|
655
|
+
}), t.dirty()) : r.kind === "base64" ? it.test(e.data) || (n = this._getOrReturnCtx(e, n), M(n, {
|
|
656
656
|
validation: "base64",
|
|
657
657
|
code: x.invalid_string,
|
|
658
658
|
message: r.message
|
|
659
|
-
}), t.dirty()) : r.kind === "base64url" ?
|
|
659
|
+
}), t.dirty()) : r.kind === "base64url" ? at.test(e.data) || (n = this._getOrReturnCtx(e, n), M(n, {
|
|
660
660
|
validation: "base64url",
|
|
661
661
|
code: x.invalid_string,
|
|
662
662
|
message: r.message
|
|
@@ -670,7 +670,7 @@ var pt = class e extends B {
|
|
|
670
670
|
return this.refinement((t) => e.test(t), {
|
|
671
671
|
validation: t,
|
|
672
672
|
code: x.invalid_string,
|
|
673
|
-
...
|
|
673
|
+
...I.errToObj(n)
|
|
674
674
|
});
|
|
675
675
|
}
|
|
676
676
|
_addCheck(t) {
|
|
@@ -682,79 +682,79 @@ var pt = class e extends B {
|
|
|
682
682
|
email(e) {
|
|
683
683
|
return this._addCheck({
|
|
684
684
|
kind: "email",
|
|
685
|
-
...
|
|
685
|
+
...I.errToObj(e)
|
|
686
686
|
});
|
|
687
687
|
}
|
|
688
688
|
url(e) {
|
|
689
689
|
return this._addCheck({
|
|
690
690
|
kind: "url",
|
|
691
|
-
...
|
|
691
|
+
...I.errToObj(e)
|
|
692
692
|
});
|
|
693
693
|
}
|
|
694
694
|
emoji(e) {
|
|
695
695
|
return this._addCheck({
|
|
696
696
|
kind: "emoji",
|
|
697
|
-
...
|
|
697
|
+
...I.errToObj(e)
|
|
698
698
|
});
|
|
699
699
|
}
|
|
700
700
|
uuid(e) {
|
|
701
701
|
return this._addCheck({
|
|
702
702
|
kind: "uuid",
|
|
703
|
-
...
|
|
703
|
+
...I.errToObj(e)
|
|
704
704
|
});
|
|
705
705
|
}
|
|
706
706
|
nanoid(e) {
|
|
707
707
|
return this._addCheck({
|
|
708
708
|
kind: "nanoid",
|
|
709
|
-
...
|
|
709
|
+
...I.errToObj(e)
|
|
710
710
|
});
|
|
711
711
|
}
|
|
712
712
|
cuid(e) {
|
|
713
713
|
return this._addCheck({
|
|
714
714
|
kind: "cuid",
|
|
715
|
-
...
|
|
715
|
+
...I.errToObj(e)
|
|
716
716
|
});
|
|
717
717
|
}
|
|
718
718
|
cuid2(e) {
|
|
719
719
|
return this._addCheck({
|
|
720
720
|
kind: "cuid2",
|
|
721
|
-
...
|
|
721
|
+
...I.errToObj(e)
|
|
722
722
|
});
|
|
723
723
|
}
|
|
724
724
|
ulid(e) {
|
|
725
725
|
return this._addCheck({
|
|
726
726
|
kind: "ulid",
|
|
727
|
-
...
|
|
727
|
+
...I.errToObj(e)
|
|
728
728
|
});
|
|
729
729
|
}
|
|
730
730
|
base64(e) {
|
|
731
731
|
return this._addCheck({
|
|
732
732
|
kind: "base64",
|
|
733
|
-
...
|
|
733
|
+
...I.errToObj(e)
|
|
734
734
|
});
|
|
735
735
|
}
|
|
736
736
|
base64url(e) {
|
|
737
737
|
return this._addCheck({
|
|
738
738
|
kind: "base64url",
|
|
739
|
-
...
|
|
739
|
+
...I.errToObj(e)
|
|
740
740
|
});
|
|
741
741
|
}
|
|
742
742
|
jwt(e) {
|
|
743
743
|
return this._addCheck({
|
|
744
744
|
kind: "jwt",
|
|
745
|
-
...
|
|
745
|
+
...I.errToObj(e)
|
|
746
746
|
});
|
|
747
747
|
}
|
|
748
748
|
ip(e) {
|
|
749
749
|
return this._addCheck({
|
|
750
750
|
kind: "ip",
|
|
751
|
-
...
|
|
751
|
+
...I.errToObj(e)
|
|
752
752
|
});
|
|
753
753
|
}
|
|
754
754
|
cidr(e) {
|
|
755
755
|
return this._addCheck({
|
|
756
756
|
kind: "cidr",
|
|
757
|
-
...
|
|
757
|
+
...I.errToObj(e)
|
|
758
758
|
});
|
|
759
759
|
}
|
|
760
760
|
datetime(e) {
|
|
@@ -769,7 +769,7 @@ var pt = class e extends B {
|
|
|
769
769
|
precision: e?.precision === void 0 ? null : e?.precision,
|
|
770
770
|
offset: e?.offset ?? !1,
|
|
771
771
|
local: e?.local ?? !1,
|
|
772
|
-
...
|
|
772
|
+
...I.errToObj(e?.message)
|
|
773
773
|
});
|
|
774
774
|
}
|
|
775
775
|
date(e) {
|
|
@@ -786,20 +786,20 @@ var pt = class e extends B {
|
|
|
786
786
|
}) : this._addCheck({
|
|
787
787
|
kind: "time",
|
|
788
788
|
precision: e?.precision === void 0 ? null : e?.precision,
|
|
789
|
-
...
|
|
789
|
+
...I.errToObj(e?.message)
|
|
790
790
|
});
|
|
791
791
|
}
|
|
792
792
|
duration(e) {
|
|
793
793
|
return this._addCheck({
|
|
794
794
|
kind: "duration",
|
|
795
|
-
...
|
|
795
|
+
...I.errToObj(e)
|
|
796
796
|
});
|
|
797
797
|
}
|
|
798
798
|
regex(e, t) {
|
|
799
799
|
return this._addCheck({
|
|
800
800
|
kind: "regex",
|
|
801
801
|
regex: e,
|
|
802
|
-
...
|
|
802
|
+
...I.errToObj(t)
|
|
803
803
|
});
|
|
804
804
|
}
|
|
805
805
|
includes(e, t) {
|
|
@@ -807,46 +807,46 @@ var pt = class e extends B {
|
|
|
807
807
|
kind: "includes",
|
|
808
808
|
value: e,
|
|
809
809
|
position: t?.position,
|
|
810
|
-
...
|
|
810
|
+
...I.errToObj(t?.message)
|
|
811
811
|
});
|
|
812
812
|
}
|
|
813
813
|
startsWith(e, t) {
|
|
814
814
|
return this._addCheck({
|
|
815
815
|
kind: "startsWith",
|
|
816
816
|
value: e,
|
|
817
|
-
...
|
|
817
|
+
...I.errToObj(t)
|
|
818
818
|
});
|
|
819
819
|
}
|
|
820
820
|
endsWith(e, t) {
|
|
821
821
|
return this._addCheck({
|
|
822
822
|
kind: "endsWith",
|
|
823
823
|
value: e,
|
|
824
|
-
...
|
|
824
|
+
...I.errToObj(t)
|
|
825
825
|
});
|
|
826
826
|
}
|
|
827
827
|
min(e, t) {
|
|
828
828
|
return this._addCheck({
|
|
829
829
|
kind: "min",
|
|
830
830
|
value: e,
|
|
831
|
-
...
|
|
831
|
+
...I.errToObj(t)
|
|
832
832
|
});
|
|
833
833
|
}
|
|
834
834
|
max(e, t) {
|
|
835
835
|
return this._addCheck({
|
|
836
836
|
kind: "max",
|
|
837
837
|
value: e,
|
|
838
|
-
...
|
|
838
|
+
...I.errToObj(t)
|
|
839
839
|
});
|
|
840
840
|
}
|
|
841
841
|
length(e, t) {
|
|
842
842
|
return this._addCheck({
|
|
843
843
|
kind: "length",
|
|
844
844
|
value: e,
|
|
845
|
-
...
|
|
845
|
+
...I.errToObj(t)
|
|
846
846
|
});
|
|
847
847
|
}
|
|
848
848
|
nonempty(e) {
|
|
849
|
-
return this.min(1,
|
|
849
|
+
return this.min(1, I.errToObj(e));
|
|
850
850
|
}
|
|
851
851
|
trim() {
|
|
852
852
|
return new e({
|
|
@@ -925,17 +925,17 @@ var pt = class e extends B {
|
|
|
925
925
|
return e;
|
|
926
926
|
}
|
|
927
927
|
};
|
|
928
|
-
|
|
928
|
+
mt.create = (e) => new mt({
|
|
929
929
|
checks: [],
|
|
930
|
-
typeName:
|
|
930
|
+
typeName: W.ZodString,
|
|
931
931
|
coerce: e?.coerce ?? !1,
|
|
932
|
-
...
|
|
932
|
+
...R(e)
|
|
933
933
|
});
|
|
934
|
-
function
|
|
934
|
+
function ht(e, t) {
|
|
935
935
|
let n = (e.toString().split(".")[1] || "").length, r = (t.toString().split(".")[1] || "").length, i = n > r ? n : r;
|
|
936
936
|
return Number.parseInt(e.toFixed(i).replace(".", "")) % Number.parseInt(t.toFixed(i).replace(".", "")) / 10 ** i;
|
|
937
937
|
}
|
|
938
|
-
var
|
|
938
|
+
var gt = class e extends z {
|
|
939
939
|
constructor() {
|
|
940
940
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
941
941
|
}
|
|
@@ -968,7 +968,7 @@ var ht = class e extends B {
|
|
|
968
968
|
inclusive: r.inclusive,
|
|
969
969
|
exact: !1,
|
|
970
970
|
message: r.message
|
|
971
|
-
}), n.dirty()) : r.kind === "multipleOf" ?
|
|
971
|
+
}), n.dirty()) : r.kind === "multipleOf" ? ht(e.data, r.value) !== 0 && (t = this._getOrReturnCtx(e, t), M(t, {
|
|
972
972
|
code: x.not_multiple_of,
|
|
973
973
|
multipleOf: r.value,
|
|
974
974
|
message: r.message
|
|
@@ -982,16 +982,16 @@ var ht = class e extends B {
|
|
|
982
982
|
};
|
|
983
983
|
}
|
|
984
984
|
gte(e, t) {
|
|
985
|
-
return this.setLimit("min", e, !0,
|
|
985
|
+
return this.setLimit("min", e, !0, I.toString(t));
|
|
986
986
|
}
|
|
987
987
|
gt(e, t) {
|
|
988
|
-
return this.setLimit("min", e, !1,
|
|
988
|
+
return this.setLimit("min", e, !1, I.toString(t));
|
|
989
989
|
}
|
|
990
990
|
lte(e, t) {
|
|
991
|
-
return this.setLimit("max", e, !0,
|
|
991
|
+
return this.setLimit("max", e, !0, I.toString(t));
|
|
992
992
|
}
|
|
993
993
|
lt(e, t) {
|
|
994
|
-
return this.setLimit("max", e, !1,
|
|
994
|
+
return this.setLimit("max", e, !1, I.toString(t));
|
|
995
995
|
}
|
|
996
996
|
setLimit(t, n, r, i) {
|
|
997
997
|
return new e({
|
|
@@ -1000,7 +1000,7 @@ var ht = class e extends B {
|
|
|
1000
1000
|
kind: t,
|
|
1001
1001
|
value: n,
|
|
1002
1002
|
inclusive: r,
|
|
1003
|
-
message:
|
|
1003
|
+
message: I.toString(i)
|
|
1004
1004
|
}]
|
|
1005
1005
|
});
|
|
1006
1006
|
}
|
|
@@ -1013,7 +1013,7 @@ var ht = class e extends B {
|
|
|
1013
1013
|
int(e) {
|
|
1014
1014
|
return this._addCheck({
|
|
1015
1015
|
kind: "int",
|
|
1016
|
-
message:
|
|
1016
|
+
message: I.toString(e)
|
|
1017
1017
|
});
|
|
1018
1018
|
}
|
|
1019
1019
|
positive(e) {
|
|
@@ -1021,7 +1021,7 @@ var ht = class e extends B {
|
|
|
1021
1021
|
kind: "min",
|
|
1022
1022
|
value: 0,
|
|
1023
1023
|
inclusive: !1,
|
|
1024
|
-
message:
|
|
1024
|
+
message: I.toString(e)
|
|
1025
1025
|
});
|
|
1026
1026
|
}
|
|
1027
1027
|
negative(e) {
|
|
@@ -1029,7 +1029,7 @@ var ht = class e extends B {
|
|
|
1029
1029
|
kind: "max",
|
|
1030
1030
|
value: 0,
|
|
1031
1031
|
inclusive: !1,
|
|
1032
|
-
message:
|
|
1032
|
+
message: I.toString(e)
|
|
1033
1033
|
});
|
|
1034
1034
|
}
|
|
1035
1035
|
nonpositive(e) {
|
|
@@ -1037,7 +1037,7 @@ var ht = class e extends B {
|
|
|
1037
1037
|
kind: "max",
|
|
1038
1038
|
value: 0,
|
|
1039
1039
|
inclusive: !0,
|
|
1040
|
-
message:
|
|
1040
|
+
message: I.toString(e)
|
|
1041
1041
|
});
|
|
1042
1042
|
}
|
|
1043
1043
|
nonnegative(e) {
|
|
@@ -1045,20 +1045,20 @@ var ht = class e extends B {
|
|
|
1045
1045
|
kind: "min",
|
|
1046
1046
|
value: 0,
|
|
1047
1047
|
inclusive: !0,
|
|
1048
|
-
message:
|
|
1048
|
+
message: I.toString(e)
|
|
1049
1049
|
});
|
|
1050
1050
|
}
|
|
1051
1051
|
multipleOf(e, t) {
|
|
1052
1052
|
return this._addCheck({
|
|
1053
1053
|
kind: "multipleOf",
|
|
1054
1054
|
value: e,
|
|
1055
|
-
message:
|
|
1055
|
+
message: I.toString(t)
|
|
1056
1056
|
});
|
|
1057
1057
|
}
|
|
1058
1058
|
finite(e) {
|
|
1059
1059
|
return this._addCheck({
|
|
1060
1060
|
kind: "finite",
|
|
1061
|
-
message:
|
|
1061
|
+
message: I.toString(e)
|
|
1062
1062
|
});
|
|
1063
1063
|
}
|
|
1064
1064
|
safe(e) {
|
|
@@ -1066,12 +1066,12 @@ var ht = class e extends B {
|
|
|
1066
1066
|
kind: "min",
|
|
1067
1067
|
inclusive: !0,
|
|
1068
1068
|
value: -(2 ** 53 - 1),
|
|
1069
|
-
message:
|
|
1069
|
+
message: I.toString(e)
|
|
1070
1070
|
})._addCheck({
|
|
1071
1071
|
kind: "max",
|
|
1072
1072
|
inclusive: !0,
|
|
1073
1073
|
value: 2 ** 53 - 1,
|
|
1074
|
-
message:
|
|
1074
|
+
message: I.toString(e)
|
|
1075
1075
|
});
|
|
1076
1076
|
}
|
|
1077
1077
|
get minValue() {
|
|
@@ -1094,13 +1094,13 @@ var ht = class e extends B {
|
|
|
1094
1094
|
return Number.isFinite(t) && Number.isFinite(e);
|
|
1095
1095
|
}
|
|
1096
1096
|
};
|
|
1097
|
-
|
|
1097
|
+
gt.create = (e) => new gt({
|
|
1098
1098
|
checks: [],
|
|
1099
|
-
typeName:
|
|
1099
|
+
typeName: W.ZodNumber,
|
|
1100
1100
|
coerce: e?.coerce || !1,
|
|
1101
|
-
...
|
|
1101
|
+
...R(e)
|
|
1102
1102
|
});
|
|
1103
|
-
var
|
|
1103
|
+
var _t = class e extends z {
|
|
1104
1104
|
constructor() {
|
|
1105
1105
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
1106
1106
|
}
|
|
@@ -1143,16 +1143,16 @@ var gt = class e extends B {
|
|
|
1143
1143
|
}), P;
|
|
1144
1144
|
}
|
|
1145
1145
|
gte(e, t) {
|
|
1146
|
-
return this.setLimit("min", e, !0,
|
|
1146
|
+
return this.setLimit("min", e, !0, I.toString(t));
|
|
1147
1147
|
}
|
|
1148
1148
|
gt(e, t) {
|
|
1149
|
-
return this.setLimit("min", e, !1,
|
|
1149
|
+
return this.setLimit("min", e, !1, I.toString(t));
|
|
1150
1150
|
}
|
|
1151
1151
|
lte(e, t) {
|
|
1152
|
-
return this.setLimit("max", e, !0,
|
|
1152
|
+
return this.setLimit("max", e, !0, I.toString(t));
|
|
1153
1153
|
}
|
|
1154
1154
|
lt(e, t) {
|
|
1155
|
-
return this.setLimit("max", e, !1,
|
|
1155
|
+
return this.setLimit("max", e, !1, I.toString(t));
|
|
1156
1156
|
}
|
|
1157
1157
|
setLimit(t, n, r, i) {
|
|
1158
1158
|
return new e({
|
|
@@ -1161,7 +1161,7 @@ var gt = class e extends B {
|
|
|
1161
1161
|
kind: t,
|
|
1162
1162
|
value: n,
|
|
1163
1163
|
inclusive: r,
|
|
1164
|
-
message:
|
|
1164
|
+
message: I.toString(i)
|
|
1165
1165
|
}]
|
|
1166
1166
|
});
|
|
1167
1167
|
}
|
|
@@ -1176,7 +1176,7 @@ var gt = class e extends B {
|
|
|
1176
1176
|
kind: "min",
|
|
1177
1177
|
value: BigInt(0),
|
|
1178
1178
|
inclusive: !1,
|
|
1179
|
-
message:
|
|
1179
|
+
message: I.toString(e)
|
|
1180
1180
|
});
|
|
1181
1181
|
}
|
|
1182
1182
|
negative(e) {
|
|
@@ -1184,7 +1184,7 @@ var gt = class e extends B {
|
|
|
1184
1184
|
kind: "max",
|
|
1185
1185
|
value: BigInt(0),
|
|
1186
1186
|
inclusive: !1,
|
|
1187
|
-
message:
|
|
1187
|
+
message: I.toString(e)
|
|
1188
1188
|
});
|
|
1189
1189
|
}
|
|
1190
1190
|
nonpositive(e) {
|
|
@@ -1192,7 +1192,7 @@ var gt = class e extends B {
|
|
|
1192
1192
|
kind: "max",
|
|
1193
1193
|
value: BigInt(0),
|
|
1194
1194
|
inclusive: !0,
|
|
1195
|
-
message:
|
|
1195
|
+
message: I.toString(e)
|
|
1196
1196
|
});
|
|
1197
1197
|
}
|
|
1198
1198
|
nonnegative(e) {
|
|
@@ -1200,14 +1200,14 @@ var gt = class e extends B {
|
|
|
1200
1200
|
kind: "min",
|
|
1201
1201
|
value: BigInt(0),
|
|
1202
1202
|
inclusive: !0,
|
|
1203
|
-
message:
|
|
1203
|
+
message: I.toString(e)
|
|
1204
1204
|
});
|
|
1205
1205
|
}
|
|
1206
1206
|
multipleOf(e, t) {
|
|
1207
1207
|
return this._addCheck({
|
|
1208
1208
|
kind: "multipleOf",
|
|
1209
1209
|
value: e,
|
|
1210
|
-
message:
|
|
1210
|
+
message: I.toString(t)
|
|
1211
1211
|
});
|
|
1212
1212
|
}
|
|
1213
1213
|
get minValue() {
|
|
@@ -1221,13 +1221,13 @@ var gt = class e extends B {
|
|
|
1221
1221
|
return e;
|
|
1222
1222
|
}
|
|
1223
1223
|
};
|
|
1224
|
-
|
|
1224
|
+
_t.create = (e) => new _t({
|
|
1225
1225
|
checks: [],
|
|
1226
|
-
typeName:
|
|
1226
|
+
typeName: W.ZodBigInt,
|
|
1227
1227
|
coerce: e?.coerce ?? !1,
|
|
1228
|
-
...
|
|
1228
|
+
...R(e)
|
|
1229
1229
|
});
|
|
1230
|
-
var
|
|
1230
|
+
var vt = class extends z {
|
|
1231
1231
|
_parse(e) {
|
|
1232
1232
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== S.boolean) {
|
|
1233
1233
|
let t = this._getOrReturnCtx(e);
|
|
@@ -1240,12 +1240,12 @@ var _t = class extends B {
|
|
|
1240
1240
|
return F(e.data);
|
|
1241
1241
|
}
|
|
1242
1242
|
};
|
|
1243
|
-
|
|
1244
|
-
typeName:
|
|
1243
|
+
vt.create = (e) => new vt({
|
|
1244
|
+
typeName: W.ZodBoolean,
|
|
1245
1245
|
coerce: e?.coerce || !1,
|
|
1246
|
-
...
|
|
1246
|
+
...R(e)
|
|
1247
1247
|
});
|
|
1248
|
-
var
|
|
1248
|
+
var yt = class e extends z {
|
|
1249
1249
|
_parse(e) {
|
|
1250
1250
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== S.date) {
|
|
1251
1251
|
let t = this._getOrReturnCtx(e);
|
|
@@ -1287,14 +1287,14 @@ var vt = class e extends B {
|
|
|
1287
1287
|
return this._addCheck({
|
|
1288
1288
|
kind: "min",
|
|
1289
1289
|
value: e.getTime(),
|
|
1290
|
-
message:
|
|
1290
|
+
message: I.toString(t)
|
|
1291
1291
|
});
|
|
1292
1292
|
}
|
|
1293
1293
|
max(e, t) {
|
|
1294
1294
|
return this._addCheck({
|
|
1295
1295
|
kind: "max",
|
|
1296
1296
|
value: e.getTime(),
|
|
1297
|
-
message:
|
|
1297
|
+
message: I.toString(t)
|
|
1298
1298
|
});
|
|
1299
1299
|
}
|
|
1300
1300
|
get minDate() {
|
|
@@ -1308,13 +1308,13 @@ var vt = class e extends B {
|
|
|
1308
1308
|
return e == null ? null : new Date(e);
|
|
1309
1309
|
}
|
|
1310
1310
|
};
|
|
1311
|
-
|
|
1311
|
+
yt.create = (e) => new yt({
|
|
1312
1312
|
checks: [],
|
|
1313
1313
|
coerce: e?.coerce || !1,
|
|
1314
|
-
typeName:
|
|
1315
|
-
...
|
|
1314
|
+
typeName: W.ZodDate,
|
|
1315
|
+
...R(e)
|
|
1316
1316
|
});
|
|
1317
|
-
var
|
|
1317
|
+
var bt = class extends z {
|
|
1318
1318
|
_parse(e) {
|
|
1319
1319
|
if (this._getType(e) !== S.symbol) {
|
|
1320
1320
|
let t = this._getOrReturnCtx(e);
|
|
@@ -1327,11 +1327,11 @@ var yt = class extends B {
|
|
|
1327
1327
|
return F(e.data);
|
|
1328
1328
|
}
|
|
1329
1329
|
};
|
|
1330
|
-
|
|
1331
|
-
typeName:
|
|
1332
|
-
...
|
|
1330
|
+
bt.create = (e) => new bt({
|
|
1331
|
+
typeName: W.ZodSymbol,
|
|
1332
|
+
...R(e)
|
|
1333
1333
|
});
|
|
1334
|
-
var
|
|
1334
|
+
var xt = class extends z {
|
|
1335
1335
|
_parse(e) {
|
|
1336
1336
|
if (this._getType(e) !== S.undefined) {
|
|
1337
1337
|
let t = this._getOrReturnCtx(e);
|
|
@@ -1344,11 +1344,11 @@ var bt = class extends B {
|
|
|
1344
1344
|
return F(e.data);
|
|
1345
1345
|
}
|
|
1346
1346
|
};
|
|
1347
|
-
|
|
1348
|
-
typeName:
|
|
1349
|
-
...
|
|
1347
|
+
xt.create = (e) => new xt({
|
|
1348
|
+
typeName: W.ZodUndefined,
|
|
1349
|
+
...R(e)
|
|
1350
1350
|
});
|
|
1351
|
-
var
|
|
1351
|
+
var St = class extends z {
|
|
1352
1352
|
_parse(e) {
|
|
1353
1353
|
if (this._getType(e) !== S.null) {
|
|
1354
1354
|
let t = this._getOrReturnCtx(e);
|
|
@@ -1361,11 +1361,11 @@ var xt = class extends B {
|
|
|
1361
1361
|
return F(e.data);
|
|
1362
1362
|
}
|
|
1363
1363
|
};
|
|
1364
|
-
|
|
1365
|
-
typeName:
|
|
1366
|
-
...
|
|
1364
|
+
St.create = (e) => new St({
|
|
1365
|
+
typeName: W.ZodNull,
|
|
1366
|
+
...R(e)
|
|
1367
1367
|
});
|
|
1368
|
-
var
|
|
1368
|
+
var Ct = class extends z {
|
|
1369
1369
|
constructor() {
|
|
1370
1370
|
super(...arguments), this._any = !0;
|
|
1371
1371
|
}
|
|
@@ -1373,11 +1373,11 @@ var St = class extends B {
|
|
|
1373
1373
|
return F(e.data);
|
|
1374
1374
|
}
|
|
1375
1375
|
};
|
|
1376
|
-
|
|
1377
|
-
typeName:
|
|
1378
|
-
...
|
|
1376
|
+
Ct.create = (e) => new Ct({
|
|
1377
|
+
typeName: W.ZodAny,
|
|
1378
|
+
...R(e)
|
|
1379
1379
|
});
|
|
1380
|
-
var
|
|
1380
|
+
var wt = class extends z {
|
|
1381
1381
|
constructor() {
|
|
1382
1382
|
super(...arguments), this._unknown = !0;
|
|
1383
1383
|
}
|
|
@@ -1385,11 +1385,11 @@ var Ct = class extends B {
|
|
|
1385
1385
|
return F(e.data);
|
|
1386
1386
|
}
|
|
1387
1387
|
};
|
|
1388
|
-
|
|
1389
|
-
typeName:
|
|
1390
|
-
...
|
|
1388
|
+
wt.create = (e) => new wt({
|
|
1389
|
+
typeName: W.ZodUnknown,
|
|
1390
|
+
...R(e)
|
|
1391
1391
|
});
|
|
1392
|
-
var
|
|
1392
|
+
var B = class extends z {
|
|
1393
1393
|
_parse(e) {
|
|
1394
1394
|
let t = this._getOrReturnCtx(e);
|
|
1395
1395
|
return M(t, {
|
|
@@ -1399,11 +1399,11 @@ var V = class extends B {
|
|
|
1399
1399
|
}), P;
|
|
1400
1400
|
}
|
|
1401
1401
|
};
|
|
1402
|
-
|
|
1403
|
-
typeName:
|
|
1404
|
-
...
|
|
1402
|
+
B.create = (e) => new B({
|
|
1403
|
+
typeName: W.ZodNever,
|
|
1404
|
+
...R(e)
|
|
1405
1405
|
});
|
|
1406
|
-
var
|
|
1406
|
+
var Tt = class extends z {
|
|
1407
1407
|
_parse(e) {
|
|
1408
1408
|
if (this._getType(e) !== S.undefined) {
|
|
1409
1409
|
let t = this._getOrReturnCtx(e);
|
|
@@ -1416,11 +1416,11 @@ var wt = class extends B {
|
|
|
1416
1416
|
return F(e.data);
|
|
1417
1417
|
}
|
|
1418
1418
|
};
|
|
1419
|
-
|
|
1420
|
-
typeName:
|
|
1421
|
-
...
|
|
1419
|
+
Tt.create = (e) => new Tt({
|
|
1420
|
+
typeName: W.ZodVoid,
|
|
1421
|
+
...R(e)
|
|
1422
1422
|
});
|
|
1423
|
-
var
|
|
1423
|
+
var Et = class e extends z {
|
|
1424
1424
|
_parse(e) {
|
|
1425
1425
|
let { ctx: t, status: n } = this._processInputParams(e), r = this._def;
|
|
1426
1426
|
if (t.parsedType !== S.array) return M(t, {
|
|
@@ -1454,8 +1454,8 @@ var Tt = class e extends B {
|
|
|
1454
1454
|
inclusive: !0,
|
|
1455
1455
|
exact: !1,
|
|
1456
1456
|
message: r.maxLength.message
|
|
1457
|
-
}), n.dirty()), t.common.async) return Promise.all([...t.data].map((e, n) => r.type._parseAsync(new
|
|
1458
|
-
let i = [...t.data].map((e, n) => r.type._parseSync(new
|
|
1457
|
+
}), n.dirty()), t.common.async) return Promise.all([...t.data].map((e, n) => r.type._parseAsync(new L(t, e, t.path, n)))).then((e) => N.mergeArray(n, e));
|
|
1458
|
+
let i = [...t.data].map((e, n) => r.type._parseSync(new L(t, e, t.path, n)));
|
|
1459
1459
|
return N.mergeArray(n, i);
|
|
1460
1460
|
}
|
|
1461
1461
|
get element() {
|
|
@@ -1466,7 +1466,7 @@ var Tt = class e extends B {
|
|
|
1466
1466
|
...this._def,
|
|
1467
1467
|
minLength: {
|
|
1468
1468
|
value: t,
|
|
1469
|
-
message:
|
|
1469
|
+
message: I.toString(n)
|
|
1470
1470
|
}
|
|
1471
1471
|
});
|
|
1472
1472
|
}
|
|
@@ -1475,7 +1475,7 @@ var Tt = class e extends B {
|
|
|
1475
1475
|
...this._def,
|
|
1476
1476
|
maxLength: {
|
|
1477
1477
|
value: t,
|
|
1478
|
-
message:
|
|
1478
|
+
message: I.toString(n)
|
|
1479
1479
|
}
|
|
1480
1480
|
});
|
|
1481
1481
|
}
|
|
@@ -1484,7 +1484,7 @@ var Tt = class e extends B {
|
|
|
1484
1484
|
...this._def,
|
|
1485
1485
|
exactLength: {
|
|
1486
1486
|
value: t,
|
|
1487
|
-
message:
|
|
1487
|
+
message: I.toString(n)
|
|
1488
1488
|
}
|
|
1489
1489
|
});
|
|
1490
1490
|
}
|
|
@@ -1492,35 +1492,35 @@ var Tt = class e extends B {
|
|
|
1492
1492
|
return this.min(1, e);
|
|
1493
1493
|
}
|
|
1494
1494
|
};
|
|
1495
|
-
|
|
1495
|
+
Et.create = (e, t) => new Et({
|
|
1496
1496
|
type: e,
|
|
1497
1497
|
minLength: null,
|
|
1498
1498
|
maxLength: null,
|
|
1499
1499
|
exactLength: null,
|
|
1500
|
-
typeName:
|
|
1501
|
-
...
|
|
1500
|
+
typeName: W.ZodArray,
|
|
1501
|
+
...R(t)
|
|
1502
1502
|
});
|
|
1503
|
-
function
|
|
1504
|
-
if (e instanceof
|
|
1503
|
+
function Dt(e) {
|
|
1504
|
+
if (e instanceof V) {
|
|
1505
1505
|
let t = {};
|
|
1506
1506
|
for (let n in e.shape) {
|
|
1507
1507
|
let r = e.shape[n];
|
|
1508
|
-
t[n] =
|
|
1508
|
+
t[n] = U.create(Dt(r));
|
|
1509
1509
|
}
|
|
1510
|
-
return new
|
|
1510
|
+
return new V({
|
|
1511
1511
|
...e._def,
|
|
1512
1512
|
shape: () => t
|
|
1513
1513
|
});
|
|
1514
|
-
} else if (e instanceof
|
|
1514
|
+
} else if (e instanceof Et) return new Et({
|
|
1515
1515
|
...e._def,
|
|
1516
|
-
type:
|
|
1516
|
+
type: Dt(e.element)
|
|
1517
1517
|
});
|
|
1518
|
-
else if (e instanceof
|
|
1519
|
-
else if (e instanceof
|
|
1520
|
-
else if (e instanceof
|
|
1518
|
+
else if (e instanceof U) return U.create(Dt(e.unwrap()));
|
|
1519
|
+
else if (e instanceof Wt) return Wt.create(Dt(e.unwrap()));
|
|
1520
|
+
else if (e instanceof Nt) return Nt.create(e.items.map((e) => Dt(e)));
|
|
1521
1521
|
else return e;
|
|
1522
1522
|
}
|
|
1523
|
-
var
|
|
1523
|
+
var V = class e extends z {
|
|
1524
1524
|
constructor() {
|
|
1525
1525
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
1526
1526
|
}
|
|
@@ -1542,7 +1542,7 @@ var H = class e extends B {
|
|
|
1542
1542
|
}), P;
|
|
1543
1543
|
}
|
|
1544
1544
|
let { status: t, ctx: n } = this._processInputParams(e), { shape: r, keys: i } = this._getCached(), a = [];
|
|
1545
|
-
if (!(this._def.catchall instanceof
|
|
1545
|
+
if (!(this._def.catchall instanceof B && this._def.unknownKeys === "strip")) for (let e in n.data) i.includes(e) || a.push(e);
|
|
1546
1546
|
let o = [];
|
|
1547
1547
|
for (let e of i) {
|
|
1548
1548
|
let t = r[e], i = n.data[e];
|
|
@@ -1551,11 +1551,11 @@ var H = class e extends B {
|
|
|
1551
1551
|
status: "valid",
|
|
1552
1552
|
value: e
|
|
1553
1553
|
},
|
|
1554
|
-
value: t._parse(new
|
|
1554
|
+
value: t._parse(new L(n, i, n.path, e)),
|
|
1555
1555
|
alwaysSet: e in n.data
|
|
1556
1556
|
});
|
|
1557
1557
|
}
|
|
1558
|
-
if (this._def.catchall instanceof
|
|
1558
|
+
if (this._def.catchall instanceof B) {
|
|
1559
1559
|
let e = this._def.unknownKeys;
|
|
1560
1560
|
if (e === "passthrough") for (let e of a) o.push({
|
|
1561
1561
|
key: {
|
|
@@ -1581,7 +1581,7 @@ var H = class e extends B {
|
|
|
1581
1581
|
status: "valid",
|
|
1582
1582
|
value: t
|
|
1583
1583
|
},
|
|
1584
|
-
value: e._parse(new
|
|
1584
|
+
value: e._parse(new L(n, r, n.path, t)),
|
|
1585
1585
|
alwaysSet: t in n.data
|
|
1586
1586
|
});
|
|
1587
1587
|
}
|
|
@@ -1603,12 +1603,12 @@ var H = class e extends B {
|
|
|
1603
1603
|
return this._def.shape();
|
|
1604
1604
|
}
|
|
1605
1605
|
strict(t) {
|
|
1606
|
-
return
|
|
1606
|
+
return I.errToObj, new e({
|
|
1607
1607
|
...this._def,
|
|
1608
1608
|
unknownKeys: "strict",
|
|
1609
1609
|
...t === void 0 ? {} : { errorMap: (e, n) => {
|
|
1610
1610
|
let r = this._def.errorMap?.(e, n).message ?? n.defaultError;
|
|
1611
|
-
return e.code === "unrecognized_keys" ? { message:
|
|
1611
|
+
return e.code === "unrecognized_keys" ? { message: I.errToObj(t).message ?? r } : { message: r };
|
|
1612
1612
|
} }
|
|
1613
1613
|
});
|
|
1614
1614
|
}
|
|
@@ -1641,7 +1641,7 @@ var H = class e extends B {
|
|
|
1641
1641
|
...this._def.shape(),
|
|
1642
1642
|
...t._def.shape()
|
|
1643
1643
|
}),
|
|
1644
|
-
typeName:
|
|
1644
|
+
typeName: W.ZodObject
|
|
1645
1645
|
});
|
|
1646
1646
|
}
|
|
1647
1647
|
setKey(e, t) {
|
|
@@ -1670,7 +1670,7 @@ var H = class e extends B {
|
|
|
1670
1670
|
});
|
|
1671
1671
|
}
|
|
1672
1672
|
deepPartial() {
|
|
1673
|
-
return
|
|
1673
|
+
return Dt(this);
|
|
1674
1674
|
}
|
|
1675
1675
|
partial(t) {
|
|
1676
1676
|
let n = {};
|
|
@@ -1688,7 +1688,7 @@ var H = class e extends B {
|
|
|
1688
1688
|
for (let e of y.objectKeys(this.shape)) if (t && !t[e]) n[e] = this.shape[e];
|
|
1689
1689
|
else {
|
|
1690
1690
|
let t = this.shape[e];
|
|
1691
|
-
for (; t instanceof
|
|
1691
|
+
for (; t instanceof U;) t = t._def.innerType;
|
|
1692
1692
|
n[e] = t;
|
|
1693
1693
|
}
|
|
1694
1694
|
return new e({
|
|
@@ -1697,29 +1697,29 @@ var H = class e extends B {
|
|
|
1697
1697
|
});
|
|
1698
1698
|
}
|
|
1699
1699
|
keyof() {
|
|
1700
|
-
return
|
|
1700
|
+
return Bt(y.objectKeys(this.shape));
|
|
1701
1701
|
}
|
|
1702
1702
|
};
|
|
1703
|
-
|
|
1703
|
+
V.create = (e, t) => new V({
|
|
1704
1704
|
shape: () => e,
|
|
1705
1705
|
unknownKeys: "strip",
|
|
1706
|
-
catchall:
|
|
1707
|
-
typeName:
|
|
1708
|
-
...
|
|
1709
|
-
}),
|
|
1706
|
+
catchall: B.create(),
|
|
1707
|
+
typeName: W.ZodObject,
|
|
1708
|
+
...R(t)
|
|
1709
|
+
}), V.strictCreate = (e, t) => new V({
|
|
1710
1710
|
shape: () => e,
|
|
1711
1711
|
unknownKeys: "strict",
|
|
1712
|
-
catchall:
|
|
1713
|
-
typeName:
|
|
1714
|
-
...
|
|
1715
|
-
}),
|
|
1712
|
+
catchall: B.create(),
|
|
1713
|
+
typeName: W.ZodObject,
|
|
1714
|
+
...R(t)
|
|
1715
|
+
}), V.lazycreate = (e, t) => new V({
|
|
1716
1716
|
shape: e,
|
|
1717
1717
|
unknownKeys: "strip",
|
|
1718
|
-
catchall:
|
|
1719
|
-
typeName:
|
|
1720
|
-
...
|
|
1718
|
+
catchall: B.create(),
|
|
1719
|
+
typeName: W.ZodObject,
|
|
1720
|
+
...R(t)
|
|
1721
1721
|
});
|
|
1722
|
-
var
|
|
1722
|
+
var Ot = class extends z {
|
|
1723
1723
|
_parse(e) {
|
|
1724
1724
|
let { ctx: t } = this._processInputParams(e), n = this._def.options;
|
|
1725
1725
|
function r(e) {
|
|
@@ -1782,12 +1782,12 @@ var Dt = class extends B {
|
|
|
1782
1782
|
return this._def.options;
|
|
1783
1783
|
}
|
|
1784
1784
|
};
|
|
1785
|
-
|
|
1785
|
+
Ot.create = (e, t) => new Ot({
|
|
1786
1786
|
options: e,
|
|
1787
|
-
typeName:
|
|
1788
|
-
...
|
|
1787
|
+
typeName: W.ZodUnion,
|
|
1788
|
+
...R(t)
|
|
1789
1789
|
});
|
|
1790
|
-
var
|
|
1790
|
+
var kt = (e) => e instanceof Rt ? kt(e.schema) : e instanceof H ? kt(e.innerType()) : e instanceof zt ? [e.value] : e instanceof Vt ? e.options : e instanceof Ht ? y.objectValues(e.enum) : e instanceof Gt ? kt(e._def.innerType) : e instanceof xt ? [void 0] : e instanceof St ? [null] : e instanceof U ? [void 0, ...kt(e.unwrap())] : e instanceof Wt ? [null, ...kt(e.unwrap())] : e instanceof Jt || e instanceof Xt ? kt(e.unwrap()) : e instanceof Kt ? kt(e._def.innerType) : [], At = class e extends z {
|
|
1791
1791
|
_parse(e) {
|
|
1792
1792
|
let { ctx: t } = this._processInputParams(e);
|
|
1793
1793
|
if (t.parsedType !== S.object) return M(t, {
|
|
@@ -1822,7 +1822,7 @@ var U = (e) => e instanceof It ? U(e.schema) : e instanceof W ? U(e.innerType())
|
|
|
1822
1822
|
static create(t, n, r) {
|
|
1823
1823
|
let i = /* @__PURE__ */ new Map();
|
|
1824
1824
|
for (let e of n) {
|
|
1825
|
-
let n =
|
|
1825
|
+
let n = kt(e.shape[t]);
|
|
1826
1826
|
if (!n.length) throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);
|
|
1827
1827
|
for (let r of n) {
|
|
1828
1828
|
if (i.has(r)) throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);
|
|
@@ -1830,15 +1830,15 @@ var U = (e) => e instanceof It ? U(e.schema) : e instanceof W ? U(e.innerType())
|
|
|
1830
1830
|
}
|
|
1831
1831
|
}
|
|
1832
1832
|
return new e({
|
|
1833
|
-
typeName:
|
|
1833
|
+
typeName: W.ZodDiscriminatedUnion,
|
|
1834
1834
|
discriminator: t,
|
|
1835
1835
|
options: n,
|
|
1836
1836
|
optionsMap: i,
|
|
1837
|
-
...
|
|
1837
|
+
...R(r)
|
|
1838
1838
|
});
|
|
1839
1839
|
}
|
|
1840
1840
|
};
|
|
1841
|
-
function
|
|
1841
|
+
function jt(e, t) {
|
|
1842
1842
|
let n = b(e), r = b(t);
|
|
1843
1843
|
if (e === t) return {
|
|
1844
1844
|
valid: !0,
|
|
@@ -1850,7 +1850,7 @@ function kt(e, t) {
|
|
|
1850
1850
|
...t
|
|
1851
1851
|
};
|
|
1852
1852
|
for (let n of r) {
|
|
1853
|
-
let r =
|
|
1853
|
+
let r = jt(e[n], t[n]);
|
|
1854
1854
|
if (!r.valid) return { valid: !1 };
|
|
1855
1855
|
i[n] = r.data;
|
|
1856
1856
|
}
|
|
@@ -1862,7 +1862,7 @@ function kt(e, t) {
|
|
|
1862
1862
|
if (e.length !== t.length) return { valid: !1 };
|
|
1863
1863
|
let n = [];
|
|
1864
1864
|
for (let r = 0; r < e.length; r++) {
|
|
1865
|
-
let i = e[r], a = t[r], o =
|
|
1865
|
+
let i = e[r], a = t[r], o = jt(i, a);
|
|
1866
1866
|
if (!o.valid) return { valid: !1 };
|
|
1867
1867
|
n.push(o.data);
|
|
1868
1868
|
}
|
|
@@ -1876,11 +1876,11 @@ function kt(e, t) {
|
|
|
1876
1876
|
};
|
|
1877
1877
|
else return { valid: !1 };
|
|
1878
1878
|
}
|
|
1879
|
-
var
|
|
1879
|
+
var Mt = class extends z {
|
|
1880
1880
|
_parse(e) {
|
|
1881
1881
|
let { status: t, ctx: n } = this._processInputParams(e), r = (e, r) => {
|
|
1882
1882
|
if (ze(e) || ze(r)) return P;
|
|
1883
|
-
let i =
|
|
1883
|
+
let i = jt(e.value, r.value);
|
|
1884
1884
|
return i.valid ? ((Be(e) || Be(r)) && t.dirty(), {
|
|
1885
1885
|
status: t.value,
|
|
1886
1886
|
value: i.data
|
|
@@ -1905,13 +1905,13 @@ var At = class extends B {
|
|
|
1905
1905
|
}));
|
|
1906
1906
|
}
|
|
1907
1907
|
};
|
|
1908
|
-
|
|
1908
|
+
Mt.create = (e, t, n) => new Mt({
|
|
1909
1909
|
left: e,
|
|
1910
1910
|
right: t,
|
|
1911
|
-
typeName:
|
|
1912
|
-
...
|
|
1911
|
+
typeName: W.ZodIntersection,
|
|
1912
|
+
...R(n)
|
|
1913
1913
|
});
|
|
1914
|
-
var
|
|
1914
|
+
var Nt = class e extends z {
|
|
1915
1915
|
_parse(e) {
|
|
1916
1916
|
let { status: t, ctx: n } = this._processInputParams(e);
|
|
1917
1917
|
if (n.parsedType !== S.array) return M(n, {
|
|
@@ -1935,7 +1935,7 @@ var jt = class e extends B {
|
|
|
1935
1935
|
}), t.dirty());
|
|
1936
1936
|
let r = [...n.data].map((e, t) => {
|
|
1937
1937
|
let r = this._def.items[t] || this._def.rest;
|
|
1938
|
-
return r ? r._parse(new
|
|
1938
|
+
return r ? r._parse(new L(n, e, n.path, t)) : null;
|
|
1939
1939
|
}).filter((e) => !!e);
|
|
1940
1940
|
return n.common.async ? Promise.all(r).then((e) => N.mergeArray(t, e)) : N.mergeArray(t, r);
|
|
1941
1941
|
}
|
|
@@ -1949,16 +1949,16 @@ var jt = class e extends B {
|
|
|
1949
1949
|
});
|
|
1950
1950
|
}
|
|
1951
1951
|
};
|
|
1952
|
-
|
|
1952
|
+
Nt.create = (e, t) => {
|
|
1953
1953
|
if (!Array.isArray(e)) throw Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
1954
|
-
return new
|
|
1954
|
+
return new Nt({
|
|
1955
1955
|
items: e,
|
|
1956
|
-
typeName:
|
|
1956
|
+
typeName: W.ZodTuple,
|
|
1957
1957
|
rest: null,
|
|
1958
|
-
...
|
|
1958
|
+
...R(t)
|
|
1959
1959
|
});
|
|
1960
1960
|
};
|
|
1961
|
-
var
|
|
1961
|
+
var Pt = class e extends z {
|
|
1962
1962
|
get keySchema() {
|
|
1963
1963
|
return this._def.keyType;
|
|
1964
1964
|
}
|
|
@@ -1974,8 +1974,8 @@ var Mt = class e extends B {
|
|
|
1974
1974
|
}), P;
|
|
1975
1975
|
let r = [], i = this._def.keyType, a = this._def.valueType;
|
|
1976
1976
|
for (let e in n.data) r.push({
|
|
1977
|
-
key: i._parse(new
|
|
1978
|
-
value: a._parse(new
|
|
1977
|
+
key: i._parse(new L(n, e, n.path, e)),
|
|
1978
|
+
value: a._parse(new L(n, n.data[e], n.path, e)),
|
|
1979
1979
|
alwaysSet: e in n.data
|
|
1980
1980
|
});
|
|
1981
1981
|
return n.common.async ? N.mergeObjectAsync(t, r) : N.mergeObjectSync(t, r);
|
|
@@ -1984,19 +1984,19 @@ var Mt = class e extends B {
|
|
|
1984
1984
|
return this._def.valueType;
|
|
1985
1985
|
}
|
|
1986
1986
|
static create(t, n, r) {
|
|
1987
|
-
return n instanceof
|
|
1987
|
+
return n instanceof z ? new e({
|
|
1988
1988
|
keyType: t,
|
|
1989
1989
|
valueType: n,
|
|
1990
|
-
typeName:
|
|
1991
|
-
...
|
|
1990
|
+
typeName: W.ZodRecord,
|
|
1991
|
+
...R(r)
|
|
1992
1992
|
}) : new e({
|
|
1993
|
-
keyType:
|
|
1993
|
+
keyType: mt.create(),
|
|
1994
1994
|
valueType: t,
|
|
1995
|
-
typeName:
|
|
1996
|
-
...
|
|
1995
|
+
typeName: W.ZodRecord,
|
|
1996
|
+
...R(n)
|
|
1997
1997
|
});
|
|
1998
1998
|
}
|
|
1999
|
-
},
|
|
1999
|
+
}, Ft = class extends z {
|
|
2000
2000
|
get keySchema() {
|
|
2001
2001
|
return this._def.keyType;
|
|
2002
2002
|
}
|
|
@@ -2011,8 +2011,8 @@ var Mt = class e extends B {
|
|
|
2011
2011
|
received: n.parsedType
|
|
2012
2012
|
}), P;
|
|
2013
2013
|
let r = this._def.keyType, i = this._def.valueType, a = [...n.data.entries()].map(([e, t], a) => ({
|
|
2014
|
-
key: r._parse(new
|
|
2015
|
-
value: i._parse(new
|
|
2014
|
+
key: r._parse(new L(n, e, n.path, [a, "key"])),
|
|
2015
|
+
value: i._parse(new L(n, t, n.path, [a, "value"]))
|
|
2016
2016
|
}));
|
|
2017
2017
|
if (n.common.async) {
|
|
2018
2018
|
let e = /* @__PURE__ */ new Map();
|
|
@@ -2041,13 +2041,13 @@ var Mt = class e extends B {
|
|
|
2041
2041
|
}
|
|
2042
2042
|
}
|
|
2043
2043
|
};
|
|
2044
|
-
|
|
2044
|
+
Ft.create = (e, t, n) => new Ft({
|
|
2045
2045
|
valueType: t,
|
|
2046
2046
|
keyType: e,
|
|
2047
|
-
typeName:
|
|
2048
|
-
...
|
|
2047
|
+
typeName: W.ZodMap,
|
|
2048
|
+
...R(n)
|
|
2049
2049
|
});
|
|
2050
|
-
var
|
|
2050
|
+
var It = class e extends z {
|
|
2051
2051
|
_parse(e) {
|
|
2052
2052
|
let { status: t, ctx: n } = this._processInputParams(e);
|
|
2053
2053
|
if (n.parsedType !== S.set) return M(n, {
|
|
@@ -2083,7 +2083,7 @@ var Pt = class e extends B {
|
|
|
2083
2083
|
value: n
|
|
2084
2084
|
};
|
|
2085
2085
|
}
|
|
2086
|
-
let o = [...n.data.values()].map((e, t) => i._parse(new
|
|
2086
|
+
let o = [...n.data.values()].map((e, t) => i._parse(new L(n, e, n.path, t)));
|
|
2087
2087
|
return n.common.async ? Promise.all(o).then((e) => a(e)) : a(o);
|
|
2088
2088
|
}
|
|
2089
2089
|
min(t, n) {
|
|
@@ -2091,7 +2091,7 @@ var Pt = class e extends B {
|
|
|
2091
2091
|
...this._def,
|
|
2092
2092
|
minSize: {
|
|
2093
2093
|
value: t,
|
|
2094
|
-
message:
|
|
2094
|
+
message: I.toString(n)
|
|
2095
2095
|
}
|
|
2096
2096
|
});
|
|
2097
2097
|
}
|
|
@@ -2100,7 +2100,7 @@ var Pt = class e extends B {
|
|
|
2100
2100
|
...this._def,
|
|
2101
2101
|
maxSize: {
|
|
2102
2102
|
value: t,
|
|
2103
|
-
message:
|
|
2103
|
+
message: I.toString(n)
|
|
2104
2104
|
}
|
|
2105
2105
|
});
|
|
2106
2106
|
}
|
|
@@ -2111,14 +2111,14 @@ var Pt = class e extends B {
|
|
|
2111
2111
|
return this.min(1, e);
|
|
2112
2112
|
}
|
|
2113
2113
|
};
|
|
2114
|
-
|
|
2114
|
+
It.create = (e, t) => new It({
|
|
2115
2115
|
valueType: e,
|
|
2116
2116
|
minSize: null,
|
|
2117
2117
|
maxSize: null,
|
|
2118
|
-
typeName:
|
|
2119
|
-
...
|
|
2118
|
+
typeName: W.ZodSet,
|
|
2119
|
+
...R(t)
|
|
2120
2120
|
});
|
|
2121
|
-
var
|
|
2121
|
+
var Lt = class e extends z {
|
|
2122
2122
|
constructor() {
|
|
2123
2123
|
super(...arguments), this.validate = this.implement;
|
|
2124
2124
|
}
|
|
@@ -2137,7 +2137,7 @@ var Ft = class e extends B {
|
|
|
2137
2137
|
t.common.contextualErrorMap,
|
|
2138
2138
|
t.schemaErrorMap,
|
|
2139
2139
|
Ie(),
|
|
2140
|
-
|
|
2140
|
+
Pe
|
|
2141
2141
|
].filter((e) => !!e),
|
|
2142
2142
|
issueData: {
|
|
2143
2143
|
code: x.invalid_arguments,
|
|
@@ -2153,7 +2153,7 @@ var Ft = class e extends B {
|
|
|
2153
2153
|
t.common.contextualErrorMap,
|
|
2154
2154
|
t.schemaErrorMap,
|
|
2155
2155
|
Ie(),
|
|
2156
|
-
|
|
2156
|
+
Pe
|
|
2157
2157
|
].filter((e) => !!e),
|
|
2158
2158
|
issueData: {
|
|
2159
2159
|
code: x.invalid_return_type,
|
|
@@ -2162,7 +2162,7 @@ var Ft = class e extends B {
|
|
|
2162
2162
|
});
|
|
2163
2163
|
}
|
|
2164
2164
|
let i = { errorMap: t.common.contextualErrorMap }, a = t.data;
|
|
2165
|
-
if (this._def.returns instanceof
|
|
2165
|
+
if (this._def.returns instanceof Ut) {
|
|
2166
2166
|
let e = this;
|
|
2167
2167
|
return F(async function(...t) {
|
|
2168
2168
|
let o = new C([]), s = await e._def.args.parseAsync(t, i).catch((e) => {
|
|
@@ -2192,7 +2192,7 @@ var Ft = class e extends B {
|
|
|
2192
2192
|
args(...t) {
|
|
2193
2193
|
return new e({
|
|
2194
2194
|
...this._def,
|
|
2195
|
-
args:
|
|
2195
|
+
args: Nt.create(t).rest(wt.create())
|
|
2196
2196
|
});
|
|
2197
2197
|
}
|
|
2198
2198
|
returns(t) {
|
|
@@ -2209,13 +2209,13 @@ var Ft = class e extends B {
|
|
|
2209
2209
|
}
|
|
2210
2210
|
static create(t, n, r) {
|
|
2211
2211
|
return new e({
|
|
2212
|
-
args: t ||
|
|
2213
|
-
returns: n ||
|
|
2214
|
-
typeName:
|
|
2215
|
-
...
|
|
2212
|
+
args: t || Nt.create([]).rest(wt.create()),
|
|
2213
|
+
returns: n || wt.create(),
|
|
2214
|
+
typeName: W.ZodFunction,
|
|
2215
|
+
...R(r)
|
|
2216
2216
|
});
|
|
2217
2217
|
}
|
|
2218
|
-
},
|
|
2218
|
+
}, Rt = class extends z {
|
|
2219
2219
|
get schema() {
|
|
2220
2220
|
return this._def.getter();
|
|
2221
2221
|
}
|
|
@@ -2228,12 +2228,12 @@ var Ft = class e extends B {
|
|
|
2228
2228
|
});
|
|
2229
2229
|
}
|
|
2230
2230
|
};
|
|
2231
|
-
|
|
2231
|
+
Rt.create = (e, t) => new Rt({
|
|
2232
2232
|
getter: e,
|
|
2233
|
-
typeName:
|
|
2234
|
-
...
|
|
2233
|
+
typeName: W.ZodLazy,
|
|
2234
|
+
...R(t)
|
|
2235
2235
|
});
|
|
2236
|
-
var
|
|
2236
|
+
var zt = class extends z {
|
|
2237
2237
|
_parse(e) {
|
|
2238
2238
|
if (e.data !== this._def.value) {
|
|
2239
2239
|
let t = this._getOrReturnCtx(e);
|
|
@@ -2252,19 +2252,19 @@ var Lt = class extends B {
|
|
|
2252
2252
|
return this._def.value;
|
|
2253
2253
|
}
|
|
2254
2254
|
};
|
|
2255
|
-
|
|
2255
|
+
zt.create = (e, t) => new zt({
|
|
2256
2256
|
value: e,
|
|
2257
|
-
typeName:
|
|
2258
|
-
...
|
|
2257
|
+
typeName: W.ZodLiteral,
|
|
2258
|
+
...R(t)
|
|
2259
2259
|
});
|
|
2260
|
-
function
|
|
2261
|
-
return new
|
|
2260
|
+
function Bt(e, t) {
|
|
2261
|
+
return new Vt({
|
|
2262
2262
|
values: e,
|
|
2263
|
-
typeName:
|
|
2264
|
-
...
|
|
2263
|
+
typeName: W.ZodEnum,
|
|
2264
|
+
...R(t)
|
|
2265
2265
|
});
|
|
2266
2266
|
}
|
|
2267
|
-
var
|
|
2267
|
+
var Vt = class e extends z {
|
|
2268
2268
|
_parse(e) {
|
|
2269
2269
|
if (typeof e.data != "string") {
|
|
2270
2270
|
let t = this._getOrReturnCtx(e), n = this._def.values;
|
|
@@ -2315,8 +2315,8 @@ var zt = class e extends B {
|
|
|
2315
2315
|
});
|
|
2316
2316
|
}
|
|
2317
2317
|
};
|
|
2318
|
-
|
|
2319
|
-
var
|
|
2318
|
+
Vt.create = Bt;
|
|
2319
|
+
var Ht = class extends z {
|
|
2320
2320
|
_parse(e) {
|
|
2321
2321
|
let t = y.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
2322
2322
|
if (n.parsedType !== S.string && n.parsedType !== S.number) {
|
|
@@ -2341,12 +2341,12 @@ var Bt = class extends B {
|
|
|
2341
2341
|
return this._def.values;
|
|
2342
2342
|
}
|
|
2343
2343
|
};
|
|
2344
|
-
|
|
2344
|
+
Ht.create = (e, t) => new Ht({
|
|
2345
2345
|
values: e,
|
|
2346
|
-
typeName:
|
|
2347
|
-
...
|
|
2346
|
+
typeName: W.ZodNativeEnum,
|
|
2347
|
+
...R(t)
|
|
2348
2348
|
});
|
|
2349
|
-
var
|
|
2349
|
+
var Ut = class extends z {
|
|
2350
2350
|
unwrap() {
|
|
2351
2351
|
return this._def.type;
|
|
2352
2352
|
}
|
|
@@ -2362,17 +2362,17 @@ var Vt = class extends B {
|
|
|
2362
2362
|
})));
|
|
2363
2363
|
}
|
|
2364
2364
|
};
|
|
2365
|
-
|
|
2365
|
+
Ut.create = (e, t) => new Ut({
|
|
2366
2366
|
type: e,
|
|
2367
|
-
typeName:
|
|
2368
|
-
...
|
|
2367
|
+
typeName: W.ZodPromise,
|
|
2368
|
+
...R(t)
|
|
2369
2369
|
});
|
|
2370
|
-
var
|
|
2370
|
+
var H = class extends z {
|
|
2371
2371
|
innerType() {
|
|
2372
2372
|
return this._def.schema;
|
|
2373
2373
|
}
|
|
2374
2374
|
sourceType() {
|
|
2375
|
-
return this._def.schema._def.typeName ===
|
|
2375
|
+
return this._def.schema._def.typeName === W.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
2376
2376
|
}
|
|
2377
2377
|
_parse(e) {
|
|
2378
2378
|
let { status: t, ctx: n } = this._processInputParams(e), r = this._def.effect || null, i = {
|
|
@@ -2436,7 +2436,7 @@ var W = class extends B {
|
|
|
2436
2436
|
path: n.path,
|
|
2437
2437
|
parent: n
|
|
2438
2438
|
});
|
|
2439
|
-
if (!
|
|
2439
|
+
if (!Ve(e)) return P;
|
|
2440
2440
|
let a = r.transform(e.value, i);
|
|
2441
2441
|
if (a instanceof Promise) throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2442
2442
|
return {
|
|
@@ -2447,28 +2447,28 @@ var W = class extends B {
|
|
|
2447
2447
|
data: n.data,
|
|
2448
2448
|
path: n.path,
|
|
2449
2449
|
parent: n
|
|
2450
|
-
}).then((e) =>
|
|
2450
|
+
}).then((e) => Ve(e) ? Promise.resolve(r.transform(e.value, i)).then((e) => ({
|
|
2451
2451
|
status: t.value,
|
|
2452
2452
|
value: e
|
|
2453
2453
|
})) : P);
|
|
2454
2454
|
y.assertNever(r);
|
|
2455
2455
|
}
|
|
2456
2456
|
};
|
|
2457
|
-
|
|
2457
|
+
H.create = (e, t, n) => new H({
|
|
2458
2458
|
schema: e,
|
|
2459
|
-
typeName:
|
|
2459
|
+
typeName: W.ZodEffects,
|
|
2460
2460
|
effect: t,
|
|
2461
|
-
...
|
|
2462
|
-
}),
|
|
2461
|
+
...R(n)
|
|
2462
|
+
}), H.createWithPreprocess = (e, t, n) => new H({
|
|
2463
2463
|
schema: t,
|
|
2464
2464
|
effect: {
|
|
2465
2465
|
type: "preprocess",
|
|
2466
2466
|
transform: e
|
|
2467
2467
|
},
|
|
2468
|
-
typeName:
|
|
2469
|
-
...
|
|
2468
|
+
typeName: W.ZodEffects,
|
|
2469
|
+
...R(n)
|
|
2470
2470
|
});
|
|
2471
|
-
var
|
|
2471
|
+
var U = class extends z {
|
|
2472
2472
|
_parse(e) {
|
|
2473
2473
|
return this._getType(e) === S.undefined ? F(void 0) : this._def.innerType._parse(e);
|
|
2474
2474
|
}
|
|
@@ -2476,12 +2476,12 @@ var G = class extends B {
|
|
|
2476
2476
|
return this._def.innerType;
|
|
2477
2477
|
}
|
|
2478
2478
|
};
|
|
2479
|
-
|
|
2479
|
+
U.create = (e, t) => new U({
|
|
2480
2480
|
innerType: e,
|
|
2481
|
-
typeName:
|
|
2482
|
-
...
|
|
2481
|
+
typeName: W.ZodOptional,
|
|
2482
|
+
...R(t)
|
|
2483
2483
|
});
|
|
2484
|
-
var
|
|
2484
|
+
var Wt = class extends z {
|
|
2485
2485
|
_parse(e) {
|
|
2486
2486
|
return this._getType(e) === S.null ? F(null) : this._def.innerType._parse(e);
|
|
2487
2487
|
}
|
|
@@ -2489,12 +2489,12 @@ var Ht = class extends B {
|
|
|
2489
2489
|
return this._def.innerType;
|
|
2490
2490
|
}
|
|
2491
2491
|
};
|
|
2492
|
-
|
|
2492
|
+
Wt.create = (e, t) => new Wt({
|
|
2493
2493
|
innerType: e,
|
|
2494
|
-
typeName:
|
|
2495
|
-
...
|
|
2494
|
+
typeName: W.ZodNullable,
|
|
2495
|
+
...R(t)
|
|
2496
2496
|
});
|
|
2497
|
-
var
|
|
2497
|
+
var Gt = class extends z {
|
|
2498
2498
|
_parse(e) {
|
|
2499
2499
|
let { ctx: t } = this._processInputParams(e), n = t.data;
|
|
2500
2500
|
return t.parsedType === S.undefined && (n = this._def.defaultValue()), this._def.innerType._parse({
|
|
@@ -2507,13 +2507,13 @@ var Ut = class extends B {
|
|
|
2507
2507
|
return this._def.innerType;
|
|
2508
2508
|
}
|
|
2509
2509
|
};
|
|
2510
|
-
|
|
2510
|
+
Gt.create = (e, t) => new Gt({
|
|
2511
2511
|
innerType: e,
|
|
2512
|
-
typeName:
|
|
2512
|
+
typeName: W.ZodDefault,
|
|
2513
2513
|
defaultValue: typeof t.default == "function" ? t.default : () => t.default,
|
|
2514
|
-
...
|
|
2514
|
+
...R(t)
|
|
2515
2515
|
});
|
|
2516
|
-
var
|
|
2516
|
+
var Kt = class extends z {
|
|
2517
2517
|
_parse(e) {
|
|
2518
2518
|
let { ctx: t } = this._processInputParams(e), n = {
|
|
2519
2519
|
...t,
|
|
@@ -2526,7 +2526,7 @@ var Wt = class extends B {
|
|
|
2526
2526
|
path: n.path,
|
|
2527
2527
|
parent: { ...n }
|
|
2528
2528
|
});
|
|
2529
|
-
return
|
|
2529
|
+
return He(r) ? r.then((e) => ({
|
|
2530
2530
|
status: "valid",
|
|
2531
2531
|
value: e.status === "valid" ? e.value : this._def.catchValue({
|
|
2532
2532
|
get error() {
|
|
@@ -2548,13 +2548,13 @@ var Wt = class extends B {
|
|
|
2548
2548
|
return this._def.innerType;
|
|
2549
2549
|
}
|
|
2550
2550
|
};
|
|
2551
|
-
|
|
2551
|
+
Kt.create = (e, t) => new Kt({
|
|
2552
2552
|
innerType: e,
|
|
2553
|
-
typeName:
|
|
2553
|
+
typeName: W.ZodCatch,
|
|
2554
2554
|
catchValue: typeof t.catch == "function" ? t.catch : () => t.catch,
|
|
2555
|
-
...
|
|
2555
|
+
...R(t)
|
|
2556
2556
|
});
|
|
2557
|
-
var
|
|
2557
|
+
var qt = class extends z {
|
|
2558
2558
|
_parse(e) {
|
|
2559
2559
|
if (this._getType(e) !== S.nan) {
|
|
2560
2560
|
let t = this._getOrReturnCtx(e);
|
|
@@ -2570,11 +2570,11 @@ var Gt = class extends B {
|
|
|
2570
2570
|
};
|
|
2571
2571
|
}
|
|
2572
2572
|
};
|
|
2573
|
-
|
|
2574
|
-
typeName:
|
|
2575
|
-
...
|
|
2573
|
+
qt.create = (e) => new qt({
|
|
2574
|
+
typeName: W.ZodNaN,
|
|
2575
|
+
...R(e)
|
|
2576
2576
|
});
|
|
2577
|
-
var
|
|
2577
|
+
var Jt = class extends z {
|
|
2578
2578
|
_parse(e) {
|
|
2579
2579
|
let { ctx: t } = this._processInputParams(e), n = t.data;
|
|
2580
2580
|
return this._def.type._parse({
|
|
@@ -2586,7 +2586,7 @@ var Kt = class extends B {
|
|
|
2586
2586
|
unwrap() {
|
|
2587
2587
|
return this._def.type;
|
|
2588
2588
|
}
|
|
2589
|
-
},
|
|
2589
|
+
}, Yt = class e extends z {
|
|
2590
2590
|
_parse(e) {
|
|
2591
2591
|
let { status: t, ctx: n } = this._processInputParams(e);
|
|
2592
2592
|
if (n.common.async) return (async () => {
|
|
@@ -2621,40 +2621,40 @@ var Kt = class extends B {
|
|
|
2621
2621
|
return new e({
|
|
2622
2622
|
in: t,
|
|
2623
2623
|
out: n,
|
|
2624
|
-
typeName:
|
|
2624
|
+
typeName: W.ZodPipeline
|
|
2625
2625
|
});
|
|
2626
2626
|
}
|
|
2627
|
-
},
|
|
2627
|
+
}, Xt = class extends z {
|
|
2628
2628
|
_parse(e) {
|
|
2629
|
-
let t = this._def.innerType._parse(e), n = (e) => (
|
|
2630
|
-
return
|
|
2629
|
+
let t = this._def.innerType._parse(e), n = (e) => (Ve(e) && (e.value = Object.freeze(e.value)), e);
|
|
2630
|
+
return He(t) ? t.then((e) => n(e)) : n(t);
|
|
2631
2631
|
}
|
|
2632
2632
|
unwrap() {
|
|
2633
2633
|
return this._def.innerType;
|
|
2634
2634
|
}
|
|
2635
2635
|
};
|
|
2636
|
-
|
|
2636
|
+
Xt.create = (e, t) => new Xt({
|
|
2637
2637
|
innerType: e,
|
|
2638
|
-
typeName:
|
|
2639
|
-
...
|
|
2640
|
-
}),
|
|
2641
|
-
var
|
|
2638
|
+
typeName: W.ZodReadonly,
|
|
2639
|
+
...R(t)
|
|
2640
|
+
}), V.lazycreate;
|
|
2641
|
+
var W;
|
|
2642
2642
|
(function(e) {
|
|
2643
2643
|
e.ZodString = "ZodString", e.ZodNumber = "ZodNumber", e.ZodNaN = "ZodNaN", e.ZodBigInt = "ZodBigInt", e.ZodBoolean = "ZodBoolean", e.ZodDate = "ZodDate", e.ZodSymbol = "ZodSymbol", e.ZodUndefined = "ZodUndefined", e.ZodNull = "ZodNull", e.ZodAny = "ZodAny", e.ZodUnknown = "ZodUnknown", e.ZodNever = "ZodNever", e.ZodVoid = "ZodVoid", e.ZodArray = "ZodArray", e.ZodObject = "ZodObject", e.ZodUnion = "ZodUnion", e.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", e.ZodIntersection = "ZodIntersection", e.ZodTuple = "ZodTuple", e.ZodRecord = "ZodRecord", e.ZodMap = "ZodMap", e.ZodSet = "ZodSet", e.ZodFunction = "ZodFunction", e.ZodLazy = "ZodLazy", e.ZodLiteral = "ZodLiteral", e.ZodEnum = "ZodEnum", e.ZodEffects = "ZodEffects", e.ZodNativeEnum = "ZodNativeEnum", e.ZodOptional = "ZodOptional", e.ZodNullable = "ZodNullable", e.ZodDefault = "ZodDefault", e.ZodCatch = "ZodCatch", e.ZodPromise = "ZodPromise", e.ZodBranded = "ZodBranded", e.ZodPipeline = "ZodPipeline", e.ZodReadonly = "ZodReadonly";
|
|
2644
|
-
})(
|
|
2644
|
+
})(W ||= {}), mt.create, gt.create, qt.create, _t.create, vt.create, yt.create, bt.create, xt.create, St.create, Ct.create, wt.create, B.create, Tt.create, Et.create, V.create, V.strictCreate, Ot.create, At.create, Mt.create, Nt.create, Pt.create, Ft.create, It.create, Lt.create, Rt.create, zt.create, Vt.create, Ht.create, Ut.create, H.create, U.create, Wt.create, H.createWithPreprocess, Yt.create;
|
|
2645
2645
|
//#endregion
|
|
2646
2646
|
//#region ../../node_modules/.pnpm/eventsource-parser@3.0.6/node_modules/eventsource-parser/dist/index.js
|
|
2647
|
-
var
|
|
2647
|
+
var Zt = class extends Error {
|
|
2648
2648
|
constructor(e, t) {
|
|
2649
2649
|
super(e), this.name = "ParseError", this.type = t.type, this.field = t.field, this.value = t.value, this.line = t.line;
|
|
2650
2650
|
}
|
|
2651
2651
|
};
|
|
2652
|
-
function
|
|
2653
|
-
function
|
|
2652
|
+
function Qt(e) {}
|
|
2653
|
+
function $t(e) {
|
|
2654
2654
|
if (typeof e == "function") throw TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");
|
|
2655
|
-
let { onEvent: t =
|
|
2655
|
+
let { onEvent: t = Qt, onError: n = Qt, onRetry: r = Qt, onComment: i } = e, a = "", o = !0, s, c = "", l = "";
|
|
2656
2656
|
function u(e) {
|
|
2657
|
-
let t = o ? e.replace(/^\xEF\xBB\xBF/, "") : e, [n, r] =
|
|
2657
|
+
let t = o ? e.replace(/^\xEF\xBB\xBF/, "") : e, [n, r] = en(`${a}${t}`);
|
|
2658
2658
|
for (let e of n) d(e);
|
|
2659
2659
|
a = r, o = !1;
|
|
2660
2660
|
}
|
|
@@ -2688,14 +2688,14 @@ function Zt(e) {
|
|
|
2688
2688
|
s = t.includes("\0") ? void 0 : t;
|
|
2689
2689
|
break;
|
|
2690
2690
|
case "retry":
|
|
2691
|
-
/^\d+$/.test(t) ? r(parseInt(t, 10)) : n(new
|
|
2691
|
+
/^\d+$/.test(t) ? r(parseInt(t, 10)) : n(new Zt(`Invalid \`retry\` value: "${t}"`, {
|
|
2692
2692
|
type: "invalid-retry",
|
|
2693
2693
|
value: t,
|
|
2694
2694
|
line: i
|
|
2695
2695
|
}));
|
|
2696
2696
|
break;
|
|
2697
2697
|
default:
|
|
2698
|
-
n(new
|
|
2698
|
+
n(new Zt(`Unknown field "${e.length > 20 ? `${e.slice(0, 20)}\u2026` : e}"`, {
|
|
2699
2699
|
type: "unknown-field",
|
|
2700
2700
|
field: e,
|
|
2701
2701
|
value: t,
|
|
@@ -2719,7 +2719,7 @@ function Zt(e) {
|
|
|
2719
2719
|
reset: m
|
|
2720
2720
|
};
|
|
2721
2721
|
}
|
|
2722
|
-
function
|
|
2722
|
+
function en(e) {
|
|
2723
2723
|
let t = [], n = "", r = 0;
|
|
2724
2724
|
for (; r < e.length;) {
|
|
2725
2725
|
let i = e.indexOf("\r", r), a = e.indexOf("\n", r), o = -1;
|
|
@@ -2735,12 +2735,12 @@ function Qt(e) {
|
|
|
2735
2735
|
}
|
|
2736
2736
|
//#endregion
|
|
2737
2737
|
//#region ../../node_modules/.pnpm/eventsource-parser@3.0.6/node_modules/eventsource-parser/dist/stream.js
|
|
2738
|
-
var
|
|
2738
|
+
var tn = class extends TransformStream {
|
|
2739
2739
|
constructor({ onError: e, onRetry: t, onComment: n } = {}) {
|
|
2740
2740
|
let r;
|
|
2741
2741
|
super({
|
|
2742
2742
|
start(i) {
|
|
2743
|
-
r =
|
|
2743
|
+
r = $t({
|
|
2744
2744
|
onEvent: (e) => {
|
|
2745
2745
|
i.enqueue(e);
|
|
2746
2746
|
},
|
|
@@ -2756,20 +2756,20 @@ var $t = class extends TransformStream {
|
|
|
2756
2756
|
}
|
|
2757
2757
|
});
|
|
2758
2758
|
}
|
|
2759
|
-
}, { btoa:
|
|
2759
|
+
}, { btoa: nn, atob: rn } = globalThis, an = ({ prefix: e, size: t = 16, alphabet: n = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", separator: r = "-" } = {}) => {
|
|
2760
2760
|
let i = () => {
|
|
2761
2761
|
let e = n.length, r = Array(t);
|
|
2762
2762
|
for (let i = 0; i < t; i++) r[i] = n[Math.random() * e | 0];
|
|
2763
2763
|
return r.join("");
|
|
2764
2764
|
};
|
|
2765
2765
|
if (e == null) return i;
|
|
2766
|
-
if (n.includes(r)) throw new
|
|
2766
|
+
if (n.includes(r)) throw new Ce({
|
|
2767
2767
|
argument: "separator",
|
|
2768
2768
|
message: `The separator "${r}" must not be part of the alphabet "${n}".`
|
|
2769
2769
|
});
|
|
2770
2770
|
return () => `${e}${r}${i()}`;
|
|
2771
|
-
},
|
|
2772
|
-
function
|
|
2771
|
+
}, on = an();
|
|
2772
|
+
function sn(e) {
|
|
2773
2773
|
if (e == null) return {};
|
|
2774
2774
|
let t = {};
|
|
2775
2775
|
if (e instanceof Headers) e.forEach((e, n) => {
|
|
@@ -2781,12 +2781,12 @@ function an(e) {
|
|
|
2781
2781
|
}
|
|
2782
2782
|
return t;
|
|
2783
2783
|
}
|
|
2784
|
-
var
|
|
2785
|
-
function
|
|
2784
|
+
var cn = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/, ln = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
|
|
2785
|
+
function un(e) {
|
|
2786
2786
|
let t = JSON.parse(e);
|
|
2787
|
-
return typeof t != "object" || !t ||
|
|
2787
|
+
return typeof t != "object" || !t || cn.test(e) === !1 && ln.test(e) === !1 ? t : dn(t);
|
|
2788
2788
|
}
|
|
2789
|
-
function
|
|
2789
|
+
function dn(e) {
|
|
2790
2790
|
let t = [e];
|
|
2791
2791
|
for (; t.length;) {
|
|
2792
2792
|
let e = t;
|
|
@@ -2801,34 +2801,34 @@ function ln(e) {
|
|
|
2801
2801
|
}
|
|
2802
2802
|
return e;
|
|
2803
2803
|
}
|
|
2804
|
-
function
|
|
2804
|
+
function fn(e) {
|
|
2805
2805
|
let { stackTraceLimit: t } = Error;
|
|
2806
2806
|
try {
|
|
2807
2807
|
Error.stackTraceLimit = 0;
|
|
2808
2808
|
} catch {
|
|
2809
|
-
return
|
|
2809
|
+
return un(e);
|
|
2810
2810
|
}
|
|
2811
2811
|
try {
|
|
2812
|
-
return
|
|
2812
|
+
return un(e);
|
|
2813
2813
|
} finally {
|
|
2814
2814
|
Error.stackTraceLimit = t;
|
|
2815
2815
|
}
|
|
2816
2816
|
}
|
|
2817
|
-
function
|
|
2817
|
+
function pn(e) {
|
|
2818
2818
|
if (e.type === "object" || Array.isArray(e.type) && e.type.includes("object")) {
|
|
2819
2819
|
e.additionalProperties = !1;
|
|
2820
2820
|
let { properties: t } = e;
|
|
2821
|
-
if (t != null) for (let e of Object.keys(t)) t[e] =
|
|
2821
|
+
if (t != null) for (let e of Object.keys(t)) t[e] = mn(t[e]);
|
|
2822
2822
|
}
|
|
2823
|
-
e.items != null && (e.items = Array.isArray(e.items) ? e.items.map(
|
|
2823
|
+
e.items != null && (e.items = Array.isArray(e.items) ? e.items.map(mn) : mn(e.items)), e.anyOf != null && (e.anyOf = e.anyOf.map(mn)), e.allOf != null && (e.allOf = e.allOf.map(mn)), e.oneOf != null && (e.oneOf = e.oneOf.map(mn));
|
|
2824
2824
|
let { definitions: t } = e;
|
|
2825
|
-
if (t != null) for (let e of Object.keys(t)) t[e] =
|
|
2825
|
+
if (t != null) for (let e of Object.keys(t)) t[e] = mn(t[e]);
|
|
2826
2826
|
return e;
|
|
2827
2827
|
}
|
|
2828
|
-
function
|
|
2829
|
-
return typeof e == "boolean" ? e :
|
|
2828
|
+
function mn(e) {
|
|
2829
|
+
return typeof e == "boolean" ? e : pn(e);
|
|
2830
2830
|
}
|
|
2831
|
-
var
|
|
2831
|
+
var hn = /* @__PURE__ */ Symbol("Let zodToJsonSchema decide on which parser to use"), gn = {
|
|
2832
2832
|
name: void 0,
|
|
2833
2833
|
$refStrategy: "root",
|
|
2834
2834
|
basePath: ["#"],
|
|
@@ -2848,24 +2848,24 @@ var pn = /* @__PURE__ */ Symbol("Let zodToJsonSchema decide on which parser to u
|
|
|
2848
2848
|
emailStrategy: "format:email",
|
|
2849
2849
|
base64Strategy: "contentEncoding:base64",
|
|
2850
2850
|
nameStrategy: "ref"
|
|
2851
|
-
},
|
|
2852
|
-
...
|
|
2851
|
+
}, _n = (e) => typeof e == "string" ? {
|
|
2852
|
+
...gn,
|
|
2853
2853
|
name: e
|
|
2854
2854
|
} : {
|
|
2855
|
-
...
|
|
2855
|
+
...gn,
|
|
2856
2856
|
...e
|
|
2857
2857
|
};
|
|
2858
|
-
function
|
|
2858
|
+
function G() {
|
|
2859
2859
|
return {};
|
|
2860
2860
|
}
|
|
2861
|
-
function
|
|
2861
|
+
function vn(e, t) {
|
|
2862
2862
|
let n = { type: "array" };
|
|
2863
|
-
return e.type?._def && e.type?._def?.typeName !==
|
|
2863
|
+
return e.type?._def && e.type?._def?.typeName !== W.ZodAny && (n.items = Y(e.type._def, {
|
|
2864
2864
|
...t,
|
|
2865
2865
|
currentPath: [...t.currentPath, "items"]
|
|
2866
2866
|
})), e.minLength && (n.minItems = e.minLength.value), e.maxLength && (n.maxItems = e.maxLength.value), e.exactLength && (n.minItems = e.exactLength.value, n.maxItems = e.exactLength.value), n;
|
|
2867
2867
|
}
|
|
2868
|
-
function
|
|
2868
|
+
function yn(e) {
|
|
2869
2869
|
let t = {
|
|
2870
2870
|
type: "integer",
|
|
2871
2871
|
format: "int64"
|
|
@@ -2884,16 +2884,16 @@ function _n(e) {
|
|
|
2884
2884
|
}
|
|
2885
2885
|
return t;
|
|
2886
2886
|
}
|
|
2887
|
-
function
|
|
2887
|
+
function bn() {
|
|
2888
2888
|
return { type: "boolean" };
|
|
2889
2889
|
}
|
|
2890
|
-
function
|
|
2891
|
-
return
|
|
2890
|
+
function xn(e, t) {
|
|
2891
|
+
return Y(e.type._def, t);
|
|
2892
2892
|
}
|
|
2893
|
-
var
|
|
2894
|
-
function
|
|
2893
|
+
var Sn = (e, t) => Y(e.innerType._def, t);
|
|
2894
|
+
function Cn(e, t, n) {
|
|
2895
2895
|
let r = n ?? t.dateStrategy;
|
|
2896
|
-
if (Array.isArray(r)) return { anyOf: r.map((n, r) =>
|
|
2896
|
+
if (Array.isArray(r)) return { anyOf: r.map((n, r) => Cn(e, t, n)) };
|
|
2897
2897
|
switch (r) {
|
|
2898
2898
|
case "string":
|
|
2899
2899
|
case "format:date-time": return {
|
|
@@ -2904,10 +2904,10 @@ function xn(e, t, n) {
|
|
|
2904
2904
|
type: "string",
|
|
2905
2905
|
format: "date"
|
|
2906
2906
|
};
|
|
2907
|
-
case "integer": return
|
|
2907
|
+
case "integer": return wn(e);
|
|
2908
2908
|
}
|
|
2909
2909
|
}
|
|
2910
|
-
var
|
|
2910
|
+
var wn = (e) => {
|
|
2911
2911
|
let t = {
|
|
2912
2912
|
type: "integer",
|
|
2913
2913
|
format: "unix-time"
|
|
@@ -2922,31 +2922,31 @@ var Sn = (e) => {
|
|
|
2922
2922
|
}
|
|
2923
2923
|
return t;
|
|
2924
2924
|
};
|
|
2925
|
-
function
|
|
2925
|
+
function Tn(e, t) {
|
|
2926
2926
|
return {
|
|
2927
|
-
...
|
|
2927
|
+
...Y(e.innerType._def, t),
|
|
2928
2928
|
default: e.defaultValue()
|
|
2929
2929
|
};
|
|
2930
2930
|
}
|
|
2931
|
-
function
|
|
2932
|
-
return t.effectStrategy === "input" ?
|
|
2931
|
+
function En(e, t) {
|
|
2932
|
+
return t.effectStrategy === "input" ? Y(e.schema._def, t) : G();
|
|
2933
2933
|
}
|
|
2934
|
-
function
|
|
2934
|
+
function Dn(e) {
|
|
2935
2935
|
return {
|
|
2936
2936
|
type: "string",
|
|
2937
2937
|
enum: Array.from(e.values)
|
|
2938
2938
|
};
|
|
2939
2939
|
}
|
|
2940
|
-
var
|
|
2941
|
-
function
|
|
2942
|
-
let n = [
|
|
2940
|
+
var On = (e) => "type" in e && e.type === "string" ? !1 : "allOf" in e;
|
|
2941
|
+
function kn(e, t) {
|
|
2942
|
+
let n = [Y(e.left._def, {
|
|
2943
2943
|
...t,
|
|
2944
2944
|
currentPath: [
|
|
2945
2945
|
...t.currentPath,
|
|
2946
2946
|
"allOf",
|
|
2947
2947
|
"0"
|
|
2948
2948
|
]
|
|
2949
|
-
}),
|
|
2949
|
+
}), Y(e.right._def, {
|
|
2950
2950
|
...t,
|
|
2951
2951
|
currentPath: [
|
|
2952
2952
|
...t.currentPath,
|
|
@@ -2955,7 +2955,7 @@ function Dn(e, t) {
|
|
|
2955
2955
|
]
|
|
2956
2956
|
})].filter((e) => !!e), r = [];
|
|
2957
2957
|
return n.forEach((e) => {
|
|
2958
|
-
if (
|
|
2958
|
+
if (On(e)) r.push(...e.allOf);
|
|
2959
2959
|
else {
|
|
2960
2960
|
let t = e;
|
|
2961
2961
|
if ("additionalProperties" in e && e.additionalProperties === !1) {
|
|
@@ -2966,19 +2966,19 @@ function Dn(e, t) {
|
|
|
2966
2966
|
}
|
|
2967
2967
|
}), r.length ? { allOf: r } : void 0;
|
|
2968
2968
|
}
|
|
2969
|
-
function
|
|
2969
|
+
function An(e) {
|
|
2970
2970
|
let t = typeof e.value;
|
|
2971
2971
|
return t !== "bigint" && t !== "number" && t !== "boolean" && t !== "string" ? { type: Array.isArray(e.value) ? "array" : "object" } : {
|
|
2972
2972
|
type: t === "bigint" ? "integer" : t,
|
|
2973
2973
|
const: e.value
|
|
2974
2974
|
};
|
|
2975
2975
|
}
|
|
2976
|
-
var
|
|
2976
|
+
var jn = void 0, K = {
|
|
2977
2977
|
cuid: /^[cC][^\s-]{8,}$/,
|
|
2978
2978
|
cuid2: /^[0-9a-z]+$/,
|
|
2979
2979
|
ulid: /^[0-9A-HJKMNP-TV-Z]{26}$/,
|
|
2980
2980
|
email: /^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,
|
|
2981
|
-
emoji: () => (
|
|
2981
|
+
emoji: () => (jn === void 0 && (jn = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")), jn),
|
|
2982
2982
|
uuid: /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,
|
|
2983
2983
|
ipv4: /^(?:(?: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])$/,
|
|
2984
2984
|
ipv4Cidr: /^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,
|
|
@@ -2989,7 +2989,7 @@ var kn = void 0, J = {
|
|
|
2989
2989
|
nanoid: /^[a-zA-Z0-9_-]{21}$/,
|
|
2990
2990
|
jwt: /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/
|
|
2991
2991
|
};
|
|
2992
|
-
function
|
|
2992
|
+
function Mn(e, t) {
|
|
2993
2993
|
let n = { type: "string" };
|
|
2994
2994
|
if (e.checks) for (let r of e.checks) switch (r.kind) {
|
|
2995
2995
|
case "min":
|
|
@@ -3001,87 +3001,87 @@ function An(e, t) {
|
|
|
3001
3001
|
case "email":
|
|
3002
3002
|
switch (t.emailStrategy) {
|
|
3003
3003
|
case "format:email":
|
|
3004
|
-
|
|
3004
|
+
q(n, "email", r.message, t);
|
|
3005
3005
|
break;
|
|
3006
3006
|
case "format:idn-email":
|
|
3007
|
-
|
|
3007
|
+
q(n, "idn-email", r.message, t);
|
|
3008
3008
|
break;
|
|
3009
3009
|
case "pattern:zod":
|
|
3010
|
-
|
|
3010
|
+
J(n, K.email, r.message, t);
|
|
3011
3011
|
break;
|
|
3012
3012
|
}
|
|
3013
3013
|
break;
|
|
3014
3014
|
case "url":
|
|
3015
|
-
|
|
3015
|
+
q(n, "uri", r.message, t);
|
|
3016
3016
|
break;
|
|
3017
3017
|
case "uuid":
|
|
3018
|
-
|
|
3018
|
+
q(n, "uuid", r.message, t);
|
|
3019
3019
|
break;
|
|
3020
3020
|
case "regex":
|
|
3021
|
-
|
|
3021
|
+
J(n, r.regex, r.message, t);
|
|
3022
3022
|
break;
|
|
3023
3023
|
case "cuid":
|
|
3024
|
-
|
|
3024
|
+
J(n, K.cuid, r.message, t);
|
|
3025
3025
|
break;
|
|
3026
3026
|
case "cuid2":
|
|
3027
|
-
|
|
3027
|
+
J(n, K.cuid2, r.message, t);
|
|
3028
3028
|
break;
|
|
3029
3029
|
case "startsWith":
|
|
3030
|
-
|
|
3030
|
+
J(n, RegExp(`^${Nn(r.value, t)}`), r.message, t);
|
|
3031
3031
|
break;
|
|
3032
3032
|
case "endsWith":
|
|
3033
|
-
|
|
3033
|
+
J(n, RegExp(`${Nn(r.value, t)}$`), r.message, t);
|
|
3034
3034
|
break;
|
|
3035
3035
|
case "datetime":
|
|
3036
|
-
|
|
3036
|
+
q(n, "date-time", r.message, t);
|
|
3037
3037
|
break;
|
|
3038
3038
|
case "date":
|
|
3039
|
-
|
|
3039
|
+
q(n, "date", r.message, t);
|
|
3040
3040
|
break;
|
|
3041
3041
|
case "time":
|
|
3042
|
-
|
|
3042
|
+
q(n, "time", r.message, t);
|
|
3043
3043
|
break;
|
|
3044
3044
|
case "duration":
|
|
3045
|
-
|
|
3045
|
+
q(n, "duration", r.message, t);
|
|
3046
3046
|
break;
|
|
3047
3047
|
case "length":
|
|
3048
3048
|
n.minLength = typeof n.minLength == "number" ? Math.max(n.minLength, r.value) : r.value, n.maxLength = typeof n.maxLength == "number" ? Math.min(n.maxLength, r.value) : r.value;
|
|
3049
3049
|
break;
|
|
3050
3050
|
case "includes":
|
|
3051
|
-
|
|
3051
|
+
J(n, RegExp(Nn(r.value, t)), r.message, t);
|
|
3052
3052
|
break;
|
|
3053
3053
|
case "ip":
|
|
3054
|
-
r.version !== "v6" &&
|
|
3054
|
+
r.version !== "v6" && q(n, "ipv4", r.message, t), r.version !== "v4" && q(n, "ipv6", r.message, t);
|
|
3055
3055
|
break;
|
|
3056
3056
|
case "base64url":
|
|
3057
|
-
|
|
3057
|
+
J(n, K.base64url, r.message, t);
|
|
3058
3058
|
break;
|
|
3059
3059
|
case "jwt":
|
|
3060
|
-
|
|
3060
|
+
J(n, K.jwt, r.message, t);
|
|
3061
3061
|
break;
|
|
3062
3062
|
case "cidr":
|
|
3063
|
-
r.version !== "v6" &&
|
|
3063
|
+
r.version !== "v6" && J(n, K.ipv4Cidr, r.message, t), r.version !== "v4" && J(n, K.ipv6Cidr, r.message, t);
|
|
3064
3064
|
break;
|
|
3065
3065
|
case "emoji":
|
|
3066
|
-
|
|
3066
|
+
J(n, K.emoji(), r.message, t);
|
|
3067
3067
|
break;
|
|
3068
3068
|
case "ulid":
|
|
3069
|
-
|
|
3069
|
+
J(n, K.ulid, r.message, t);
|
|
3070
3070
|
break;
|
|
3071
3071
|
case "base64":
|
|
3072
3072
|
switch (t.base64Strategy) {
|
|
3073
3073
|
case "format:binary":
|
|
3074
|
-
|
|
3074
|
+
q(n, "binary", r.message, t);
|
|
3075
3075
|
break;
|
|
3076
3076
|
case "contentEncoding:base64":
|
|
3077
3077
|
n.contentEncoding = "base64";
|
|
3078
3078
|
break;
|
|
3079
3079
|
case "pattern:zod":
|
|
3080
|
-
|
|
3080
|
+
J(n, K.base64, r.message, t);
|
|
3081
3081
|
break;
|
|
3082
3082
|
}
|
|
3083
3083
|
break;
|
|
3084
|
-
case "nanoid":
|
|
3084
|
+
case "nanoid": J(n, K.nanoid, r.message, t);
|
|
3085
3085
|
case "toLowerCase":
|
|
3086
3086
|
case "toUpperCase":
|
|
3087
3087
|
case "trim": break;
|
|
@@ -3089,28 +3089,28 @@ function An(e, t) {
|
|
|
3089
3089
|
}
|
|
3090
3090
|
return n;
|
|
3091
3091
|
}
|
|
3092
|
-
function
|
|
3093
|
-
return t.patternStrategy === "escape" ?
|
|
3092
|
+
function Nn(e, t) {
|
|
3093
|
+
return t.patternStrategy === "escape" ? Fn(e) : e;
|
|
3094
3094
|
}
|
|
3095
|
-
var
|
|
3096
|
-
function
|
|
3095
|
+
var Pn = /* @__PURE__ */ new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
|
|
3096
|
+
function Fn(e) {
|
|
3097
3097
|
let t = "";
|
|
3098
|
-
for (let n = 0; n < e.length; n++)
|
|
3098
|
+
for (let n = 0; n < e.length; n++) Pn.has(e[n]) || (t += "\\"), t += e[n];
|
|
3099
3099
|
return t;
|
|
3100
3100
|
}
|
|
3101
|
-
function
|
|
3101
|
+
function q(e, t, n, r) {
|
|
3102
3102
|
e.format || e.anyOf?.some((e) => e.format) ? (e.anyOf ||= [], e.format && (e.anyOf.push({ format: e.format }), delete e.format), e.anyOf.push({
|
|
3103
3103
|
format: t,
|
|
3104
3104
|
...n && r.errorMessages && { errorMessage: { format: n } }
|
|
3105
3105
|
})) : e.format = t;
|
|
3106
3106
|
}
|
|
3107
|
-
function
|
|
3107
|
+
function J(e, t, n, r) {
|
|
3108
3108
|
e.pattern || e.allOf?.some((e) => e.pattern) ? (e.allOf ||= [], e.pattern && (e.allOf.push({ pattern: e.pattern }), delete e.pattern), e.allOf.push({
|
|
3109
|
-
pattern:
|
|
3109
|
+
pattern: In(t, r),
|
|
3110
3110
|
...n && r.errorMessages && { errorMessage: { pattern: n } }
|
|
3111
|
-
})) : e.pattern =
|
|
3111
|
+
})) : e.pattern = In(t, r);
|
|
3112
3112
|
}
|
|
3113
|
-
function
|
|
3113
|
+
function In(e, t) {
|
|
3114
3114
|
if (!t.applyRegexFlags || !e.flags) return e.source;
|
|
3115
3115
|
let n = {
|
|
3116
3116
|
i: e.flags.includes("i"),
|
|
@@ -3157,26 +3157,26 @@ function Pn(e, t) {
|
|
|
3157
3157
|
}
|
|
3158
3158
|
return i;
|
|
3159
3159
|
}
|
|
3160
|
-
function
|
|
3160
|
+
function Ln(e, t) {
|
|
3161
3161
|
let n = {
|
|
3162
3162
|
type: "object",
|
|
3163
|
-
additionalProperties:
|
|
3163
|
+
additionalProperties: Y(e.valueType._def, {
|
|
3164
3164
|
...t,
|
|
3165
3165
|
currentPath: [...t.currentPath, "additionalProperties"]
|
|
3166
3166
|
}) ?? t.allowedAdditionalProperties
|
|
3167
3167
|
};
|
|
3168
|
-
if (e.keyType?._def.typeName ===
|
|
3169
|
-
let { type: r, ...i } =
|
|
3168
|
+
if (e.keyType?._def.typeName === W.ZodString && e.keyType._def.checks?.length) {
|
|
3169
|
+
let { type: r, ...i } = Mn(e.keyType._def, t);
|
|
3170
3170
|
return {
|
|
3171
3171
|
...n,
|
|
3172
3172
|
propertyNames: i
|
|
3173
3173
|
};
|
|
3174
|
-
} else if (e.keyType?._def.typeName ===
|
|
3174
|
+
} else if (e.keyType?._def.typeName === W.ZodEnum) return {
|
|
3175
3175
|
...n,
|
|
3176
3176
|
propertyNames: { enum: e.keyType._def.values }
|
|
3177
3177
|
};
|
|
3178
|
-
else if (e.keyType?._def.typeName ===
|
|
3179
|
-
let { type: r, ...i } =
|
|
3178
|
+
else if (e.keyType?._def.typeName === W.ZodBranded && e.keyType._def.type._def.typeName === W.ZodString && e.keyType._def.type._def.checks?.length) {
|
|
3179
|
+
let { type: r, ...i } = xn(e.keyType._def, t);
|
|
3180
3180
|
return {
|
|
3181
3181
|
...n,
|
|
3182
3182
|
propertyNames: i
|
|
@@ -3184,13 +3184,13 @@ function Fn(e, t) {
|
|
|
3184
3184
|
}
|
|
3185
3185
|
return n;
|
|
3186
3186
|
}
|
|
3187
|
-
function
|
|
3188
|
-
return t.mapStrategy === "record" ?
|
|
3187
|
+
function Rn(e, t) {
|
|
3188
|
+
return t.mapStrategy === "record" ? Ln(e, t) : {
|
|
3189
3189
|
type: "array",
|
|
3190
3190
|
maxItems: 125,
|
|
3191
3191
|
items: {
|
|
3192
3192
|
type: "array",
|
|
3193
|
-
items: [
|
|
3193
|
+
items: [Y(e.keyType._def, {
|
|
3194
3194
|
...t,
|
|
3195
3195
|
currentPath: [
|
|
3196
3196
|
...t.currentPath,
|
|
@@ -3198,7 +3198,7 @@ function In(e, t) {
|
|
|
3198
3198
|
"items",
|
|
3199
3199
|
"0"
|
|
3200
3200
|
]
|
|
3201
|
-
}) ||
|
|
3201
|
+
}) || G(), Y(e.valueType._def, {
|
|
3202
3202
|
...t,
|
|
3203
3203
|
currentPath: [
|
|
3204
3204
|
...t.currentPath,
|
|
@@ -3206,37 +3206,37 @@ function In(e, t) {
|
|
|
3206
3206
|
"items",
|
|
3207
3207
|
"1"
|
|
3208
3208
|
]
|
|
3209
|
-
}) ||
|
|
3209
|
+
}) || G()],
|
|
3210
3210
|
minItems: 2,
|
|
3211
3211
|
maxItems: 2
|
|
3212
3212
|
}
|
|
3213
3213
|
};
|
|
3214
3214
|
}
|
|
3215
|
-
function
|
|
3215
|
+
function zn(e) {
|
|
3216
3216
|
let t = e.values, n = Object.keys(e.values).filter((e) => typeof t[t[e]] != "number").map((e) => t[e]), r = Array.from(new Set(n.map((e) => typeof e)));
|
|
3217
3217
|
return {
|
|
3218
3218
|
type: r.length === 1 ? r[0] === "string" ? "string" : "number" : ["string", "number"],
|
|
3219
3219
|
enum: n
|
|
3220
3220
|
};
|
|
3221
3221
|
}
|
|
3222
|
-
function
|
|
3223
|
-
return { not:
|
|
3222
|
+
function Bn() {
|
|
3223
|
+
return { not: G() };
|
|
3224
3224
|
}
|
|
3225
|
-
function
|
|
3225
|
+
function Vn() {
|
|
3226
3226
|
return { type: "null" };
|
|
3227
3227
|
}
|
|
3228
|
-
var
|
|
3228
|
+
var Hn = {
|
|
3229
3229
|
ZodString: "string",
|
|
3230
3230
|
ZodNumber: "number",
|
|
3231
3231
|
ZodBigInt: "integer",
|
|
3232
3232
|
ZodBoolean: "boolean",
|
|
3233
3233
|
ZodNull: "null"
|
|
3234
3234
|
};
|
|
3235
|
-
function
|
|
3235
|
+
function Un(e, t) {
|
|
3236
3236
|
let n = e.options instanceof Map ? Array.from(e.options.values()) : e.options;
|
|
3237
|
-
if (n.every((e) => e._def.typeName in
|
|
3237
|
+
if (n.every((e) => e._def.typeName in Hn && (!e._def.checks || !e._def.checks.length))) {
|
|
3238
3238
|
let e = n.reduce((e, t) => {
|
|
3239
|
-
let n =
|
|
3239
|
+
let n = Hn[t._def.typeName];
|
|
3240
3240
|
return n && !e.includes(n) ? [...e, n] : e;
|
|
3241
3241
|
}, []);
|
|
3242
3242
|
return { type: e.length > 1 ? e : e[0] };
|
|
@@ -3263,10 +3263,10 @@ function Vn(e, t) {
|
|
|
3263
3263
|
type: "string",
|
|
3264
3264
|
enum: n.reduce((e, t) => [...e, ...t._def.values.filter((t) => !e.includes(t))], [])
|
|
3265
3265
|
};
|
|
3266
|
-
return
|
|
3266
|
+
return Wn(e, t);
|
|
3267
3267
|
}
|
|
3268
|
-
var
|
|
3269
|
-
let n = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map((e, n) =>
|
|
3268
|
+
var Wn = (e, t) => {
|
|
3269
|
+
let n = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map((e, n) => Y(e._def, {
|
|
3270
3270
|
...t,
|
|
3271
3271
|
currentPath: [
|
|
3272
3272
|
...t.currentPath,
|
|
@@ -3276,15 +3276,15 @@ var Hn = (e, t) => {
|
|
|
3276
3276
|
})).filter((e) => !!e && (!t.strictUnions || typeof e == "object" && Object.keys(e).length > 0));
|
|
3277
3277
|
return n.length ? { anyOf: n } : void 0;
|
|
3278
3278
|
};
|
|
3279
|
-
function
|
|
3279
|
+
function Gn(e, t) {
|
|
3280
3280
|
if ([
|
|
3281
3281
|
"ZodString",
|
|
3282
3282
|
"ZodNumber",
|
|
3283
3283
|
"ZodBigInt",
|
|
3284
3284
|
"ZodBoolean",
|
|
3285
3285
|
"ZodNull"
|
|
3286
|
-
].includes(e.innerType._def.typeName) && (!e.innerType._def.checks || !e.innerType._def.checks.length)) return { type: [
|
|
3287
|
-
let n =
|
|
3286
|
+
].includes(e.innerType._def.typeName) && (!e.innerType._def.checks || !e.innerType._def.checks.length)) return { type: [Hn[e.innerType._def.typeName], "null"] };
|
|
3287
|
+
let n = Y(e.innerType._def, {
|
|
3288
3288
|
...t,
|
|
3289
3289
|
currentPath: [
|
|
3290
3290
|
...t.currentPath,
|
|
@@ -3294,7 +3294,7 @@ function Un(e, t) {
|
|
|
3294
3294
|
});
|
|
3295
3295
|
return n && { anyOf: [n, { type: "null" }] };
|
|
3296
3296
|
}
|
|
3297
|
-
function
|
|
3297
|
+
function Kn(e) {
|
|
3298
3298
|
let t = { type: "number" };
|
|
3299
3299
|
if (!e.checks) return t;
|
|
3300
3300
|
for (let n of e.checks) switch (n.kind) {
|
|
@@ -3313,7 +3313,7 @@ function Wn(e) {
|
|
|
3313
3313
|
}
|
|
3314
3314
|
return t;
|
|
3315
3315
|
}
|
|
3316
|
-
function
|
|
3316
|
+
function qn(e, t) {
|
|
3317
3317
|
let n = {
|
|
3318
3318
|
type: "object",
|
|
3319
3319
|
properties: {}
|
|
@@ -3321,7 +3321,7 @@ function Gn(e, t) {
|
|
|
3321
3321
|
for (let e in i) {
|
|
3322
3322
|
let a = i[e];
|
|
3323
3323
|
if (a === void 0 || a._def === void 0) continue;
|
|
3324
|
-
let o =
|
|
3324
|
+
let o = Yn(a), s = Y(a._def, {
|
|
3325
3325
|
...t,
|
|
3326
3326
|
currentPath: [
|
|
3327
3327
|
...t.currentPath,
|
|
@@ -3337,11 +3337,11 @@ function Gn(e, t) {
|
|
|
3337
3337
|
s !== void 0 && (n.properties[e] = s, o || r.push(e));
|
|
3338
3338
|
}
|
|
3339
3339
|
r.length && (n.required = r);
|
|
3340
|
-
let a =
|
|
3340
|
+
let a = Jn(e, t);
|
|
3341
3341
|
return a !== void 0 && (n.additionalProperties = a), n;
|
|
3342
3342
|
}
|
|
3343
|
-
function
|
|
3344
|
-
if (e.catchall._def.typeName !== "ZodNever") return
|
|
3343
|
+
function Jn(e, t) {
|
|
3344
|
+
if (e.catchall._def.typeName !== "ZodNever") return Y(e.catchall._def, {
|
|
3345
3345
|
...t,
|
|
3346
3346
|
currentPath: [...t.currentPath, "additionalProperties"]
|
|
3347
3347
|
});
|
|
@@ -3351,16 +3351,16 @@ function Kn(e, t) {
|
|
|
3351
3351
|
case "strip": return t.removeAdditionalStrategy === "strict" ? t.allowedAdditionalProperties : t.rejectedAdditionalProperties;
|
|
3352
3352
|
}
|
|
3353
3353
|
}
|
|
3354
|
-
function
|
|
3354
|
+
function Yn(e) {
|
|
3355
3355
|
try {
|
|
3356
3356
|
return e.isOptional();
|
|
3357
3357
|
} catch {
|
|
3358
3358
|
return !0;
|
|
3359
3359
|
}
|
|
3360
3360
|
}
|
|
3361
|
-
var
|
|
3362
|
-
if (t.currentPath.toString() === t.propertyPath?.toString()) return
|
|
3363
|
-
let n =
|
|
3361
|
+
var Xn = (e, t) => {
|
|
3362
|
+
if (t.currentPath.toString() === t.propertyPath?.toString()) return Y(e.innerType._def, t);
|
|
3363
|
+
let n = Y(e.innerType._def, {
|
|
3364
3364
|
...t,
|
|
3365
3365
|
currentPath: [
|
|
3366
3366
|
...t.currentPath,
|
|
@@ -3368,11 +3368,11 @@ var Jn = (e, t) => {
|
|
|
3368
3368
|
"1"
|
|
3369
3369
|
]
|
|
3370
3370
|
});
|
|
3371
|
-
return n ? { anyOf: [{ not:
|
|
3372
|
-
},
|
|
3373
|
-
if (t.pipeStrategy === "input") return
|
|
3374
|
-
if (t.pipeStrategy === "output") return
|
|
3375
|
-
let n =
|
|
3371
|
+
return n ? { anyOf: [{ not: G() }, n] } : G();
|
|
3372
|
+
}, Zn = (e, t) => {
|
|
3373
|
+
if (t.pipeStrategy === "input") return Y(e.in._def, t);
|
|
3374
|
+
if (t.pipeStrategy === "output") return Y(e.out._def, t);
|
|
3375
|
+
let n = Y(e.in._def, {
|
|
3376
3376
|
...t,
|
|
3377
3377
|
currentPath: [
|
|
3378
3378
|
...t.currentPath,
|
|
@@ -3380,7 +3380,7 @@ var Jn = (e, t) => {
|
|
|
3380
3380
|
"0"
|
|
3381
3381
|
]
|
|
3382
3382
|
});
|
|
3383
|
-
return { allOf: [n,
|
|
3383
|
+
return { allOf: [n, Y(e.out._def, {
|
|
3384
3384
|
...t,
|
|
3385
3385
|
currentPath: [
|
|
3386
3386
|
...t.currentPath,
|
|
@@ -3389,25 +3389,25 @@ var Jn = (e, t) => {
|
|
|
3389
3389
|
]
|
|
3390
3390
|
})].filter((e) => e !== void 0) };
|
|
3391
3391
|
};
|
|
3392
|
-
function
|
|
3393
|
-
return
|
|
3392
|
+
function Qn(e, t) {
|
|
3393
|
+
return Y(e.type._def, t);
|
|
3394
3394
|
}
|
|
3395
|
-
function
|
|
3395
|
+
function $n(e, t) {
|
|
3396
3396
|
let n = {
|
|
3397
3397
|
type: "array",
|
|
3398
3398
|
uniqueItems: !0,
|
|
3399
|
-
items:
|
|
3399
|
+
items: Y(e.valueType._def, {
|
|
3400
3400
|
...t,
|
|
3401
3401
|
currentPath: [...t.currentPath, "items"]
|
|
3402
3402
|
})
|
|
3403
3403
|
};
|
|
3404
3404
|
return e.minSize && (n.minItems = e.minSize.value), e.maxSize && (n.maxItems = e.maxSize.value), n;
|
|
3405
3405
|
}
|
|
3406
|
-
function
|
|
3406
|
+
function er(e, t) {
|
|
3407
3407
|
return e.rest ? {
|
|
3408
3408
|
type: "array",
|
|
3409
3409
|
minItems: e.items.length,
|
|
3410
|
-
items: e.items.map((e, n) =>
|
|
3410
|
+
items: e.items.map((e, n) => Y(e._def, {
|
|
3411
3411
|
...t,
|
|
3412
3412
|
currentPath: [
|
|
3413
3413
|
...t.currentPath,
|
|
@@ -3415,7 +3415,7 @@ function Qn(e, t) {
|
|
|
3415
3415
|
`${n}`
|
|
3416
3416
|
]
|
|
3417
3417
|
})).reduce((e, t) => t === void 0 ? e : [...e, t], []),
|
|
3418
|
-
additionalItems:
|
|
3418
|
+
additionalItems: Y(e.rest._def, {
|
|
3419
3419
|
...t,
|
|
3420
3420
|
currentPath: [...t.currentPath, "additionalItems"]
|
|
3421
3421
|
})
|
|
@@ -3423,7 +3423,7 @@ function Qn(e, t) {
|
|
|
3423
3423
|
type: "array",
|
|
3424
3424
|
minItems: e.items.length,
|
|
3425
3425
|
maxItems: e.items.length,
|
|
3426
|
-
items: e.items.map((e, n) =>
|
|
3426
|
+
items: e.items.map((e, n) => Y(e._def, {
|
|
3427
3427
|
...t,
|
|
3428
3428
|
currentPath: [
|
|
3429
3429
|
...t.currentPath,
|
|
@@ -3433,65 +3433,65 @@ function Qn(e, t) {
|
|
|
3433
3433
|
})).reduce((e, t) => t === void 0 ? e : [...e, t], [])
|
|
3434
3434
|
};
|
|
3435
3435
|
}
|
|
3436
|
-
function
|
|
3437
|
-
return { not:
|
|
3436
|
+
function tr() {
|
|
3437
|
+
return { not: G() };
|
|
3438
3438
|
}
|
|
3439
|
-
function
|
|
3440
|
-
return
|
|
3439
|
+
function nr() {
|
|
3440
|
+
return G();
|
|
3441
3441
|
}
|
|
3442
|
-
var
|
|
3442
|
+
var rr = (e, t) => Y(e.innerType._def, t), ir = (e, t, n) => {
|
|
3443
3443
|
switch (t) {
|
|
3444
|
-
case
|
|
3445
|
-
case
|
|
3446
|
-
case
|
|
3447
|
-
case
|
|
3448
|
-
case
|
|
3449
|
-
case
|
|
3450
|
-
case
|
|
3451
|
-
case
|
|
3452
|
-
case
|
|
3453
|
-
case
|
|
3454
|
-
case
|
|
3455
|
-
case
|
|
3456
|
-
case
|
|
3457
|
-
case
|
|
3458
|
-
case
|
|
3459
|
-
case
|
|
3460
|
-
case
|
|
3461
|
-
case
|
|
3462
|
-
case
|
|
3463
|
-
case
|
|
3464
|
-
case
|
|
3465
|
-
case
|
|
3466
|
-
case
|
|
3467
|
-
case
|
|
3468
|
-
case
|
|
3469
|
-
case
|
|
3470
|
-
case
|
|
3471
|
-
case
|
|
3472
|
-
case
|
|
3473
|
-
case
|
|
3474
|
-
case
|
|
3475
|
-
case
|
|
3476
|
-
case
|
|
3477
|
-
case
|
|
3478
|
-
case
|
|
3479
|
-
case
|
|
3444
|
+
case W.ZodString: return Mn(e, n);
|
|
3445
|
+
case W.ZodNumber: return Kn(e);
|
|
3446
|
+
case W.ZodObject: return qn(e, n);
|
|
3447
|
+
case W.ZodBigInt: return yn(e);
|
|
3448
|
+
case W.ZodBoolean: return bn();
|
|
3449
|
+
case W.ZodDate: return Cn(e, n);
|
|
3450
|
+
case W.ZodUndefined: return tr();
|
|
3451
|
+
case W.ZodNull: return Vn();
|
|
3452
|
+
case W.ZodArray: return vn(e, n);
|
|
3453
|
+
case W.ZodUnion:
|
|
3454
|
+
case W.ZodDiscriminatedUnion: return Un(e, n);
|
|
3455
|
+
case W.ZodIntersection: return kn(e, n);
|
|
3456
|
+
case W.ZodTuple: return er(e, n);
|
|
3457
|
+
case W.ZodRecord: return Ln(e, n);
|
|
3458
|
+
case W.ZodLiteral: return An(e);
|
|
3459
|
+
case W.ZodEnum: return Dn(e);
|
|
3460
|
+
case W.ZodNativeEnum: return zn(e);
|
|
3461
|
+
case W.ZodNullable: return Gn(e, n);
|
|
3462
|
+
case W.ZodOptional: return Xn(e, n);
|
|
3463
|
+
case W.ZodMap: return Rn(e, n);
|
|
3464
|
+
case W.ZodSet: return $n(e, n);
|
|
3465
|
+
case W.ZodLazy: return () => e.getter()._def;
|
|
3466
|
+
case W.ZodPromise: return Qn(e, n);
|
|
3467
|
+
case W.ZodNaN:
|
|
3468
|
+
case W.ZodNever: return Bn();
|
|
3469
|
+
case W.ZodEffects: return En(e, n);
|
|
3470
|
+
case W.ZodAny: return G();
|
|
3471
|
+
case W.ZodUnknown: return nr();
|
|
3472
|
+
case W.ZodDefault: return Tn(e, n);
|
|
3473
|
+
case W.ZodBranded: return xn(e, n);
|
|
3474
|
+
case W.ZodReadonly: return rr(e, n);
|
|
3475
|
+
case W.ZodCatch: return Sn(e, n);
|
|
3476
|
+
case W.ZodPipeline: return Zn(e, n);
|
|
3477
|
+
case W.ZodFunction:
|
|
3478
|
+
case W.ZodVoid:
|
|
3479
|
+
case W.ZodSymbol: return;
|
|
3480
3480
|
default: return /* @__PURE__ */ ((e) => void 0)(t);
|
|
3481
3481
|
}
|
|
3482
|
-
},
|
|
3482
|
+
}, ar = (e, t) => {
|
|
3483
3483
|
let n = 0;
|
|
3484
3484
|
for (; n < e.length && n < t.length && e[n] === t[n]; n++);
|
|
3485
3485
|
return [(e.length - n).toString(), ...t.slice(n)].join("/");
|
|
3486
3486
|
};
|
|
3487
|
-
function
|
|
3487
|
+
function Y(e, t, n = !1) {
|
|
3488
3488
|
let r = t.seen.get(e);
|
|
3489
3489
|
if (t.override) {
|
|
3490
3490
|
let i = t.override?.call(t, e, t, r, n);
|
|
3491
|
-
if (i !==
|
|
3491
|
+
if (i !== hn) return i;
|
|
3492
3492
|
}
|
|
3493
3493
|
if (r && !n) {
|
|
3494
|
-
let e =
|
|
3494
|
+
let e = or(r, t);
|
|
3495
3495
|
if (e !== void 0) return e;
|
|
3496
3496
|
}
|
|
3497
3497
|
let i = {
|
|
@@ -3500,22 +3500,22 @@ function Z(e, t, n = !1) {
|
|
|
3500
3500
|
jsonSchema: void 0
|
|
3501
3501
|
};
|
|
3502
3502
|
t.seen.set(e, i);
|
|
3503
|
-
let a =
|
|
3504
|
-
if (o &&
|
|
3503
|
+
let a = ir(e, e.typeName, t), o = typeof a == "function" ? Y(a(), t) : a;
|
|
3504
|
+
if (o && sr(e, t, o), t.postProcess) {
|
|
3505
3505
|
let n = t.postProcess(o, e, t);
|
|
3506
3506
|
return i.jsonSchema = o, n;
|
|
3507
3507
|
}
|
|
3508
3508
|
return i.jsonSchema = o, o;
|
|
3509
3509
|
}
|
|
3510
|
-
var
|
|
3510
|
+
var or = (e, t) => {
|
|
3511
3511
|
switch (t.$refStrategy) {
|
|
3512
3512
|
case "root": return { $ref: e.path.join("/") };
|
|
3513
|
-
case "relative": return { $ref:
|
|
3513
|
+
case "relative": return { $ref: ar(t.currentPath, e.path) };
|
|
3514
3514
|
case "none":
|
|
3515
|
-
case "seen": return e.path.length < t.currentPath.length && e.path.every((e, n) => t.currentPath[n] === e) ? (console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),
|
|
3515
|
+
case "seen": return e.path.length < t.currentPath.length && e.path.every((e, n) => t.currentPath[n] === e) ? (console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`), G()) : t.$refStrategy === "seen" ? G() : void 0;
|
|
3516
3516
|
}
|
|
3517
|
-
},
|
|
3518
|
-
let t =
|
|
3517
|
+
}, sr = (e, t, n) => (e.description && (n.description = e.description), n), cr = (e) => {
|
|
3518
|
+
let t = _n(e), n = t.name === void 0 ? t.basePath : [
|
|
3519
3519
|
...t.basePath,
|
|
3520
3520
|
t.definitionPath,
|
|
3521
3521
|
t.name
|
|
@@ -3534,25 +3534,25 @@ var ir = (e, t) => {
|
|
|
3534
3534
|
jsonSchema: void 0
|
|
3535
3535
|
}]))
|
|
3536
3536
|
};
|
|
3537
|
-
},
|
|
3538
|
-
let n =
|
|
3537
|
+
}, lr = (e, t) => {
|
|
3538
|
+
let n = cr(t), r = typeof t == "object" && t.definitions ? Object.entries(t.definitions).reduce((e, [t, r]) => ({
|
|
3539
3539
|
...e,
|
|
3540
|
-
[t]:
|
|
3540
|
+
[t]: Y(r._def, {
|
|
3541
3541
|
...n,
|
|
3542
3542
|
currentPath: [
|
|
3543
3543
|
...n.basePath,
|
|
3544
3544
|
n.definitionPath,
|
|
3545
3545
|
t
|
|
3546
3546
|
]
|
|
3547
|
-
}, !0) ??
|
|
3548
|
-
}), {}) : void 0, i = typeof t == "string" ? t : t?.nameStrategy === "title" ? void 0 : t?.name, a =
|
|
3547
|
+
}, !0) ?? G()
|
|
3548
|
+
}), {}) : void 0, i = typeof t == "string" ? t : t?.nameStrategy === "title" ? void 0 : t?.name, a = Y(e._def, i === void 0 ? n : {
|
|
3549
3549
|
...n,
|
|
3550
3550
|
currentPath: [
|
|
3551
3551
|
...n.basePath,
|
|
3552
3552
|
n.definitionPath,
|
|
3553
3553
|
i
|
|
3554
3554
|
]
|
|
3555
|
-
}, !1) ??
|
|
3555
|
+
}, !1) ?? G(), o = typeof t == "object" && t.name !== void 0 && t.nameStrategy === "title" ? t.name : void 0;
|
|
3556
3556
|
o !== void 0 && (a.title = o);
|
|
3557
3557
|
let s = i === void 0 ? r ? {
|
|
3558
3558
|
...a,
|
|
@@ -3569,14 +3569,14 @@ var ir = (e, t) => {
|
|
|
3569
3569
|
}
|
|
3570
3570
|
};
|
|
3571
3571
|
return s.$schema = "http://json-schema.org/draft-07/schema#", s;
|
|
3572
|
-
},
|
|
3573
|
-
function
|
|
3572
|
+
}, ur = /* @__PURE__ */ Symbol.for("vercel.ai.schema");
|
|
3573
|
+
function dr(e) {
|
|
3574
3574
|
let t;
|
|
3575
3575
|
return () => (t ??= e(), t);
|
|
3576
3576
|
}
|
|
3577
|
-
function
|
|
3577
|
+
function fr(e, { validate: t } = {}) {
|
|
3578
3578
|
return {
|
|
3579
|
-
[
|
|
3579
|
+
[ur]: !0,
|
|
3580
3580
|
_type: void 0,
|
|
3581
3581
|
get jsonSchema() {
|
|
3582
3582
|
return typeof e == "function" && (e = e()), e;
|
|
@@ -3584,33 +3584,33 @@ function ur(e, { validate: t } = {}) {
|
|
|
3584
3584
|
validate: t
|
|
3585
3585
|
};
|
|
3586
3586
|
}
|
|
3587
|
-
function
|
|
3588
|
-
return typeof e == "object" && !!e &&
|
|
3587
|
+
function pr(e) {
|
|
3588
|
+
return typeof e == "object" && !!e && ur in e && e[ur] === !0 && "jsonSchema" in e && "validate" in e;
|
|
3589
3589
|
}
|
|
3590
|
-
function
|
|
3591
|
-
return e == null ?
|
|
3590
|
+
function mr(e) {
|
|
3591
|
+
return e == null ? fr({
|
|
3592
3592
|
properties: {},
|
|
3593
3593
|
additionalProperties: !1
|
|
3594
|
-
}) :
|
|
3594
|
+
}) : pr(e) ? e : "~standard" in e ? e["~standard"].vendor === "zod" ? yr(e) : hr(e) : e();
|
|
3595
3595
|
}
|
|
3596
|
-
function
|
|
3597
|
-
return
|
|
3596
|
+
function hr(e) {
|
|
3597
|
+
return fr(() => pn(e["~standard"].jsonSchema.input({ target: "draft-07" })), { validate: async (t) => {
|
|
3598
3598
|
let n = await e["~standard"].validate(t);
|
|
3599
3599
|
return "value" in n ? {
|
|
3600
3600
|
success: !0,
|
|
3601
3601
|
value: n.value
|
|
3602
3602
|
} : {
|
|
3603
3603
|
success: !1,
|
|
3604
|
-
error: new
|
|
3604
|
+
error: new Ne({
|
|
3605
3605
|
value: t,
|
|
3606
3606
|
cause: n.issues
|
|
3607
3607
|
})
|
|
3608
3608
|
};
|
|
3609
3609
|
} });
|
|
3610
3610
|
}
|
|
3611
|
-
function
|
|
3611
|
+
function gr(e, t) {
|
|
3612
3612
|
let n = t?.useReferences ?? !1;
|
|
3613
|
-
return
|
|
3613
|
+
return fr(() => lr(e, { $refStrategy: n ? "root" : "none" }), { validate: async (t) => {
|
|
3614
3614
|
let n = await e.safeParseAsync(t);
|
|
3615
3615
|
return n.success ? {
|
|
3616
3616
|
success: !0,
|
|
@@ -3621,9 +3621,9 @@ function mr(e, t) {
|
|
|
3621
3621
|
};
|
|
3622
3622
|
} });
|
|
3623
3623
|
}
|
|
3624
|
-
function
|
|
3624
|
+
function _r(e, t) {
|
|
3625
3625
|
let i = t?.useReferences ?? !1;
|
|
3626
|
-
return
|
|
3626
|
+
return fr(() => pn(n(e, {
|
|
3627
3627
|
target: "draft-7",
|
|
3628
3628
|
io: "input",
|
|
3629
3629
|
reused: i ? "ref" : "inline"
|
|
@@ -3638,27 +3638,27 @@ function hr(e, t) {
|
|
|
3638
3638
|
};
|
|
3639
3639
|
} });
|
|
3640
3640
|
}
|
|
3641
|
-
function
|
|
3641
|
+
function vr(e) {
|
|
3642
3642
|
return "_zod" in e;
|
|
3643
3643
|
}
|
|
3644
|
-
function
|
|
3645
|
-
return
|
|
3644
|
+
function yr(e, t) {
|
|
3645
|
+
return vr(e) ? _r(e, t) : gr(e, t);
|
|
3646
3646
|
}
|
|
3647
|
-
async function
|
|
3648
|
-
let r = await
|
|
3647
|
+
async function br({ value: e, schema: t, context: n }) {
|
|
3648
|
+
let r = await xr({
|
|
3649
3649
|
value: e,
|
|
3650
3650
|
schema: t,
|
|
3651
3651
|
context: n
|
|
3652
3652
|
});
|
|
3653
|
-
if (!r.success) throw
|
|
3653
|
+
if (!r.success) throw Ne.wrap({
|
|
3654
3654
|
value: e,
|
|
3655
3655
|
cause: r.error,
|
|
3656
3656
|
context: n
|
|
3657
3657
|
});
|
|
3658
3658
|
return r.value;
|
|
3659
3659
|
}
|
|
3660
|
-
async function
|
|
3661
|
-
let r =
|
|
3660
|
+
async function xr({ value: e, schema: t, context: n }) {
|
|
3661
|
+
let r = mr(t);
|
|
3662
3662
|
try {
|
|
3663
3663
|
if (r.validate == null) return {
|
|
3664
3664
|
success: !0,
|
|
@@ -3672,7 +3672,7 @@ async function yr({ value: e, schema: t, context: n }) {
|
|
|
3672
3672
|
rawValue: e
|
|
3673
3673
|
} : {
|
|
3674
3674
|
success: !1,
|
|
3675
|
-
error:
|
|
3675
|
+
error: Ne.wrap({
|
|
3676
3676
|
value: e,
|
|
3677
3677
|
cause: t.error,
|
|
3678
3678
|
context: n
|
|
@@ -3682,7 +3682,7 @@ async function yr({ value: e, schema: t, context: n }) {
|
|
|
3682
3682
|
} catch (t) {
|
|
3683
3683
|
return {
|
|
3684
3684
|
success: !1,
|
|
3685
|
-
error:
|
|
3685
|
+
error: Ne.wrap({
|
|
3686
3686
|
value: e,
|
|
3687
3687
|
cause: t,
|
|
3688
3688
|
context: n
|
|
@@ -3691,21 +3691,21 @@ async function yr({ value: e, schema: t, context: n }) {
|
|
|
3691
3691
|
};
|
|
3692
3692
|
}
|
|
3693
3693
|
}
|
|
3694
|
-
async function
|
|
3694
|
+
async function Sr({ text: e, schema: t }) {
|
|
3695
3695
|
try {
|
|
3696
|
-
let n =
|
|
3696
|
+
let n = fn(e);
|
|
3697
3697
|
return t == null ? {
|
|
3698
3698
|
success: !0,
|
|
3699
3699
|
value: n,
|
|
3700
3700
|
rawValue: n
|
|
3701
|
-
} : await
|
|
3701
|
+
} : await xr({
|
|
3702
3702
|
value: n,
|
|
3703
3703
|
schema: t
|
|
3704
3704
|
});
|
|
3705
3705
|
} catch (t) {
|
|
3706
3706
|
return {
|
|
3707
3707
|
success: !1,
|
|
3708
|
-
error:
|
|
3708
|
+
error: j.isInstance(t) ? t : new j({
|
|
3709
3709
|
text: e,
|
|
3710
3710
|
cause: t
|
|
3711
3711
|
}),
|
|
@@ -3713,37 +3713,37 @@ async function br({ text: e, schema: t }) {
|
|
|
3713
3713
|
};
|
|
3714
3714
|
}
|
|
3715
3715
|
}
|
|
3716
|
-
function
|
|
3717
|
-
return e.pipeThrough(new TextDecoderStream()).pipeThrough(new
|
|
3718
|
-
e !== "[DONE]" && n.enqueue(await
|
|
3716
|
+
function Cr({ stream: e, schema: t }) {
|
|
3717
|
+
return e.pipeThrough(new TextDecoderStream()).pipeThrough(new tn()).pipeThrough(new TransformStream({ async transform({ data: e }, n) {
|
|
3718
|
+
e !== "[DONE]" && n.enqueue(await Sr({
|
|
3719
3719
|
text: e,
|
|
3720
3720
|
schema: t
|
|
3721
3721
|
}));
|
|
3722
3722
|
} }));
|
|
3723
3723
|
}
|
|
3724
|
-
async function
|
|
3724
|
+
async function X(e) {
|
|
3725
3725
|
return typeof e == "function" && (e = e()), Promise.resolve(e);
|
|
3726
3726
|
}
|
|
3727
3727
|
//#endregion
|
|
3728
3728
|
//#region ../../node_modules/.pnpm/ai@6.0.138_zod@4.3.6/node_modules/ai/dist/index.mjs
|
|
3729
|
-
var
|
|
3730
|
-
for (var n in t)
|
|
3729
|
+
var wr = Object.defineProperty, Tr = (e, t) => {
|
|
3730
|
+
for (var n in t) wr(e, n, {
|
|
3731
3731
|
get: t[n],
|
|
3732
3732
|
enumerable: !0
|
|
3733
3733
|
});
|
|
3734
|
-
},
|
|
3734
|
+
}, Er = "AI_NoObjectGeneratedError", Dr = `vercel.ai.error.${Er}`, Or = Symbol.for(Dr), kr, Z = class extends O {
|
|
3735
3735
|
constructor({ message: e = "No object generated.", cause: t, text: n, response: r, usage: i, finishReason: a }) {
|
|
3736
3736
|
super({
|
|
3737
|
-
name:
|
|
3737
|
+
name: Er,
|
|
3738
3738
|
message: e,
|
|
3739
3739
|
cause: t
|
|
3740
|
-
}), this[
|
|
3740
|
+
}), this[kr] = !0, this.text = n, this.response = r, this.usage = i, this.finishReason = a;
|
|
3741
3741
|
}
|
|
3742
3742
|
static isInstance(e) {
|
|
3743
|
-
return O.hasMarker(e,
|
|
3743
|
+
return O.hasMarker(e, Dr);
|
|
3744
3744
|
}
|
|
3745
3745
|
};
|
|
3746
|
-
|
|
3746
|
+
kr = Or;
|
|
3747
3747
|
var Ar = "AI_UIMessageStreamError", jr = `vercel.ai.error.${Ar}`, Mr = Symbol.for(jr), Nr, Pr = class extends O {
|
|
3748
3748
|
constructor({ chunkType: e, chunkId: t, message: n }) {
|
|
3749
3749
|
super({
|
|
@@ -3934,7 +3934,7 @@ function Kr(e, t) {
|
|
|
3934
3934
|
}
|
|
3935
3935
|
return n;
|
|
3936
3936
|
}
|
|
3937
|
-
|
|
3937
|
+
Tr({}, {
|
|
3938
3938
|
array: () => Zr,
|
|
3939
3939
|
choice: () => Qr,
|
|
3940
3940
|
json: () => $r,
|
|
@@ -4148,11 +4148,11 @@ async function Jr(e) {
|
|
|
4148
4148
|
value: void 0,
|
|
4149
4149
|
state: "undefined-input"
|
|
4150
4150
|
};
|
|
4151
|
-
let t = await
|
|
4151
|
+
let t = await Sr({ text: e });
|
|
4152
4152
|
return t.success ? {
|
|
4153
4153
|
value: t.value,
|
|
4154
4154
|
state: "successful-parse"
|
|
4155
|
-
} : (t = await
|
|
4155
|
+
} : (t = await Sr({ text: qr(e) }), t.success ? {
|
|
4156
4156
|
value: t.value,
|
|
4157
4157
|
state: "repaired-parse"
|
|
4158
4158
|
} : {
|
|
@@ -4171,18 +4171,18 @@ var Yr = () => ({
|
|
|
4171
4171
|
},
|
|
4172
4172
|
createElementStreamTransform() {}
|
|
4173
4173
|
}), Xr = ({ schema: e, name: t, description: n }) => {
|
|
4174
|
-
let r =
|
|
4174
|
+
let r = mr(e);
|
|
4175
4175
|
return {
|
|
4176
4176
|
name: "object",
|
|
4177
|
-
responseFormat:
|
|
4177
|
+
responseFormat: X(r.jsonSchema).then((e) => ({
|
|
4178
4178
|
type: "json",
|
|
4179
4179
|
schema: e,
|
|
4180
4180
|
...t != null && { name: t },
|
|
4181
4181
|
...n != null && { description: n }
|
|
4182
4182
|
})),
|
|
4183
4183
|
async parseCompleteOutput({ text: e }, t) {
|
|
4184
|
-
let n = await
|
|
4185
|
-
if (!n.success) throw new
|
|
4184
|
+
let n = await Sr({ text: e });
|
|
4185
|
+
if (!n.success) throw new Z({
|
|
4186
4186
|
message: "No object generated: could not parse the response.",
|
|
4187
4187
|
cause: n.error,
|
|
4188
4188
|
text: e,
|
|
@@ -4190,11 +4190,11 @@ var Yr = () => ({
|
|
|
4190
4190
|
usage: t.usage,
|
|
4191
4191
|
finishReason: t.finishReason
|
|
4192
4192
|
});
|
|
4193
|
-
let i = await
|
|
4193
|
+
let i = await xr({
|
|
4194
4194
|
value: n.value,
|
|
4195
4195
|
schema: r
|
|
4196
4196
|
});
|
|
4197
|
-
if (!i.success) throw new
|
|
4197
|
+
if (!i.success) throw new Z({
|
|
4198
4198
|
message: "No object generated: response did not match schema.",
|
|
4199
4199
|
cause: i.error,
|
|
4200
4200
|
text: e,
|
|
@@ -4216,10 +4216,10 @@ var Yr = () => ({
|
|
|
4216
4216
|
createElementStreamTransform() {}
|
|
4217
4217
|
};
|
|
4218
4218
|
}, Zr = ({ element: e, name: t, description: n }) => {
|
|
4219
|
-
let r =
|
|
4219
|
+
let r = mr(e);
|
|
4220
4220
|
return {
|
|
4221
4221
|
name: "array",
|
|
4222
|
-
responseFormat:
|
|
4222
|
+
responseFormat: X(r.jsonSchema).then((e) => {
|
|
4223
4223
|
let { $schema: r, ...i } = e;
|
|
4224
4224
|
return {
|
|
4225
4225
|
type: "json",
|
|
@@ -4238,8 +4238,8 @@ var Yr = () => ({
|
|
|
4238
4238
|
};
|
|
4239
4239
|
}),
|
|
4240
4240
|
async parseCompleteOutput({ text: e }, t) {
|
|
4241
|
-
let n = await
|
|
4242
|
-
if (!n.success) throw new
|
|
4241
|
+
let n = await Sr({ text: e });
|
|
4242
|
+
if (!n.success) throw new Z({
|
|
4243
4243
|
message: "No object generated: could not parse the response.",
|
|
4244
4244
|
cause: n.error,
|
|
4245
4245
|
text: e,
|
|
@@ -4248,9 +4248,9 @@ var Yr = () => ({
|
|
|
4248
4248
|
finishReason: t.finishReason
|
|
4249
4249
|
});
|
|
4250
4250
|
let i = n.value;
|
|
4251
|
-
if (typeof i != "object" || !i || !("elements" in i) || !Array.isArray(i.elements)) throw new
|
|
4251
|
+
if (typeof i != "object" || !i || !("elements" in i) || !Array.isArray(i.elements)) throw new Z({
|
|
4252
4252
|
message: "No object generated: response did not match schema.",
|
|
4253
|
-
cause: new
|
|
4253
|
+
cause: new Ne({
|
|
4254
4254
|
value: i,
|
|
4255
4255
|
cause: "response must be an object with an elements array"
|
|
4256
4256
|
}),
|
|
@@ -4260,11 +4260,11 @@ var Yr = () => ({
|
|
|
4260
4260
|
finishReason: t.finishReason
|
|
4261
4261
|
});
|
|
4262
4262
|
for (let n of i.elements) {
|
|
4263
|
-
let i = await
|
|
4263
|
+
let i = await xr({
|
|
4264
4264
|
value: n,
|
|
4265
4265
|
schema: r
|
|
4266
4266
|
});
|
|
4267
|
-
if (!i.success) throw new
|
|
4267
|
+
if (!i.success) throw new Z({
|
|
4268
4268
|
message: "No object generated: response did not match schema.",
|
|
4269
4269
|
cause: i.error,
|
|
4270
4270
|
text: e,
|
|
@@ -4286,7 +4286,7 @@ var Yr = () => ({
|
|
|
4286
4286
|
if (typeof e != "object" || !e || !("elements" in e) || !Array.isArray(e.elements)) return;
|
|
4287
4287
|
let n = t.state === "repaired-parse" && e.elements.length > 0 ? e.elements.slice(0, -1) : e.elements, i = [];
|
|
4288
4288
|
for (let e of n) {
|
|
4289
|
-
let t = await
|
|
4289
|
+
let t = await xr({
|
|
4290
4290
|
value: e,
|
|
4291
4291
|
schema: r
|
|
4292
4292
|
});
|
|
@@ -4321,8 +4321,8 @@ var Yr = () => ({
|
|
|
4321
4321
|
...n != null && { description: n }
|
|
4322
4322
|
}),
|
|
4323
4323
|
async parseCompleteOutput({ text: t }, n) {
|
|
4324
|
-
let r = await
|
|
4325
|
-
if (!r.success) throw new
|
|
4324
|
+
let r = await Sr({ text: t });
|
|
4325
|
+
if (!r.success) throw new Z({
|
|
4326
4326
|
message: "No object generated: could not parse the response.",
|
|
4327
4327
|
cause: r.error,
|
|
4328
4328
|
text: t,
|
|
@@ -4331,9 +4331,9 @@ var Yr = () => ({
|
|
|
4331
4331
|
finishReason: n.finishReason
|
|
4332
4332
|
});
|
|
4333
4333
|
let i = r.value;
|
|
4334
|
-
if (typeof i != "object" || !i || !("result" in i) || typeof i.result != "string" || !e.includes(i.result)) throw new
|
|
4334
|
+
if (typeof i != "object" || !i || !("result" in i) || typeof i.result != "string" || !e.includes(i.result)) throw new Z({
|
|
4335
4335
|
message: "No object generated: response did not match schema.",
|
|
4336
|
-
cause: new
|
|
4336
|
+
cause: new Ne({
|
|
4337
4337
|
value: i,
|
|
4338
4338
|
cause: "response must be an object that contains a choice value."
|
|
4339
4339
|
}),
|
|
@@ -4367,8 +4367,8 @@ var Yr = () => ({
|
|
|
4367
4367
|
...t != null && { description: t }
|
|
4368
4368
|
}),
|
|
4369
4369
|
async parseCompleteOutput({ text: e }, t) {
|
|
4370
|
-
let n = await
|
|
4371
|
-
if (!n.success) throw new
|
|
4370
|
+
let n = await Sr({ text: e });
|
|
4371
|
+
if (!n.success) throw new Z({
|
|
4372
4372
|
message: "No object generated: could not parse the response.",
|
|
4373
4373
|
cause: n.error,
|
|
4374
4374
|
text: e,
|
|
@@ -4389,11 +4389,11 @@ var Yr = () => ({
|
|
|
4389
4389
|
},
|
|
4390
4390
|
createElementStreamTransform() {}
|
|
4391
4391
|
});
|
|
4392
|
-
|
|
4392
|
+
an({
|
|
4393
4393
|
prefix: "aitxt",
|
|
4394
4394
|
size: 24
|
|
4395
4395
|
}), TransformStream;
|
|
4396
|
-
var ei =
|
|
4396
|
+
var ei = dr(() => yr(v([
|
|
4397
4397
|
i({
|
|
4398
4398
|
type: c("text-start"),
|
|
4399
4399
|
id: _(),
|
|
@@ -4637,7 +4637,7 @@ function si({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
4637
4637
|
async function f(e) {
|
|
4638
4638
|
if (e != null) {
|
|
4639
4639
|
let n = r.message.metadata == null ? e : Kr(r.message.metadata, e);
|
|
4640
|
-
t != null && await
|
|
4640
|
+
t != null && await br({
|
|
4641
4641
|
value: n,
|
|
4642
4642
|
schema: t,
|
|
4643
4643
|
context: {
|
|
@@ -4907,7 +4907,7 @@ function si({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
4907
4907
|
default: if (ti(e)) {
|
|
4908
4908
|
if (n?.[e.type] != null) {
|
|
4909
4909
|
let t = r.message.parts.findIndex((t) => "id" in t && "data" in t && t.id === e.id && t.type === e.type), i = t >= 0 ? t : r.message.parts.length;
|
|
4910
|
-
await
|
|
4910
|
+
await br({
|
|
4911
4911
|
value: e.data,
|
|
4912
4912
|
schema: n[e.type],
|
|
4913
4913
|
context: {
|
|
@@ -4943,10 +4943,10 @@ async function ci({ stream: e, onError: t }) {
|
|
|
4943
4943
|
n.releaseLock();
|
|
4944
4944
|
}
|
|
4945
4945
|
}
|
|
4946
|
-
|
|
4946
|
+
an({
|
|
4947
4947
|
prefix: "aitxt",
|
|
4948
4948
|
size: 24
|
|
4949
|
-
}),
|
|
4949
|
+
}), an({
|
|
4950
4950
|
prefix: "aiobj",
|
|
4951
4951
|
size: 24
|
|
4952
4952
|
});
|
|
@@ -4972,7 +4972,7 @@ var li = class {
|
|
|
4972
4972
|
});
|
|
4973
4973
|
}
|
|
4974
4974
|
};
|
|
4975
|
-
|
|
4975
|
+
an({
|
|
4976
4976
|
prefix: "aiobj",
|
|
4977
4977
|
size: 24
|
|
4978
4978
|
});
|
|
@@ -4999,9 +4999,9 @@ var di = class {
|
|
|
4999
4999
|
this.api = e, this.credentials = t, this.headers = n, this.body = r, this.fetch = i, this.prepareSendMessagesRequest = a, this.prepareReconnectToStreamRequest = o;
|
|
5000
5000
|
}
|
|
5001
5001
|
async sendMessages({ abortSignal: e, ...t }) {
|
|
5002
|
-
let n = await
|
|
5003
|
-
...
|
|
5004
|
-
...
|
|
5002
|
+
let n = await X(this.body), r = await X(this.headers), i = await X(this.credentials), a = {
|
|
5003
|
+
...sn(r),
|
|
5004
|
+
...sn(t.headers)
|
|
5005
5005
|
}, o = await this.prepareSendMessagesRequest?.call(this, {
|
|
5006
5006
|
api: this.api,
|
|
5007
5007
|
id: t.chatId,
|
|
@@ -5015,7 +5015,7 @@ var di = class {
|
|
|
5015
5015
|
requestMetadata: t.metadata,
|
|
5016
5016
|
trigger: t.trigger,
|
|
5017
5017
|
messageId: t.messageId
|
|
5018
|
-
}), s = o?.api ?? this.api, c = o?.headers === void 0 ? a :
|
|
5018
|
+
}), s = o?.api ?? this.api, c = o?.headers === void 0 ? a : sn(o.headers), l = o?.body === void 0 ? {
|
|
5019
5019
|
...n,
|
|
5020
5020
|
...t.body,
|
|
5021
5021
|
id: t.chatId,
|
|
@@ -5037,9 +5037,9 @@ var di = class {
|
|
|
5037
5037
|
return this.processResponseStream(d.body);
|
|
5038
5038
|
}
|
|
5039
5039
|
async reconnectToStream(e) {
|
|
5040
|
-
let t = await
|
|
5041
|
-
...
|
|
5042
|
-
...
|
|
5040
|
+
let t = await X(this.body), n = await X(this.headers), r = await X(this.credentials), i = {
|
|
5041
|
+
...sn(n),
|
|
5042
|
+
...sn(e.headers)
|
|
5043
5043
|
}, a = await this.prepareReconnectToStreamRequest?.call(this, {
|
|
5044
5044
|
api: this.api,
|
|
5045
5045
|
id: e.chatId,
|
|
@@ -5050,7 +5050,7 @@ var di = class {
|
|
|
5050
5050
|
headers: i,
|
|
5051
5051
|
credentials: r,
|
|
5052
5052
|
requestMetadata: e.metadata
|
|
5053
|
-
}), o = a?.api ?? `${this.api}/${e.chatId}/stream`, s = a?.headers === void 0 ? i :
|
|
5053
|
+
}), o = a?.api ?? `${this.api}/${e.chatId}/stream`, s = a?.headers === void 0 ? i : sn(a.headers), c = a?.credentials ?? r, l = await (this.fetch ?? globalThis.fetch)(o, {
|
|
5054
5054
|
method: "GET",
|
|
5055
5055
|
headers: s,
|
|
5056
5056
|
credentials: c
|
|
@@ -5065,7 +5065,7 @@ var di = class {
|
|
|
5065
5065
|
super(e);
|
|
5066
5066
|
}
|
|
5067
5067
|
processResponseStream(e) {
|
|
5068
|
-
return
|
|
5068
|
+
return Cr({
|
|
5069
5069
|
stream: e,
|
|
5070
5070
|
schema: ei
|
|
5071
5071
|
}).pipeThrough(new TransformStream({ async transform(e, t) {
|
|
@@ -5074,7 +5074,7 @@ var di = class {
|
|
|
5074
5074
|
} }));
|
|
5075
5075
|
}
|
|
5076
5076
|
}, pi = class {
|
|
5077
|
-
constructor({ generateId: e =
|
|
5077
|
+
constructor({ generateId: e = on, id: t = e(), transport: n = new fi(), messageMetadataSchema: r, dataPartSchemas: i, state: a, onError: o, onToolCall: s, onFinish: c, onData: l, sendAutomaticallyWhen: u }) {
|
|
5078
5078
|
this.activeResponse = void 0, this.jobExecutor = new li(), this.sendMessage = async (e, t) => {
|
|
5079
5079
|
if (e == null) {
|
|
5080
5080
|
await this.makeRequest({
|
|
@@ -5781,7 +5781,7 @@ Xi.default;
|
|
|
5781
5781
|
//#endregion
|
|
5782
5782
|
//#region ../../packages/composable/src/chatbot/useChatbotStore.ts
|
|
5783
5783
|
function $i(e) {
|
|
5784
|
-
return
|
|
5784
|
+
return me(`chatbot-${e}`, () => {
|
|
5785
5785
|
let { t: n, te: r, locale: i } = pe({ useScope: "global" }), a = T(""), o = T(), s = T(e), c = T(), l = T(), u = T(), d = T(), f = T(), p = T(), m = T(), h = T(), g = T(), ee = T(), _ = T(), v = T(), y = T(), b = w(() => l.value === "reasoning"), x = w(() => b.value ? ee.value?.filter((e) => ![
|
|
5786
5786
|
"upvote",
|
|
5787
5787
|
"downvote",
|
|
@@ -5816,7 +5816,7 @@ function $i(e) {
|
|
|
5816
5816
|
baseUrl: a.value,
|
|
5817
5817
|
basePath: o.value,
|
|
5818
5818
|
headers: () => m.value
|
|
5819
|
-
})),
|
|
5819
|
+
})), me = T(null), D = w(() => new Qi({
|
|
5820
5820
|
id: C.value,
|
|
5821
5821
|
transport: new fi({
|
|
5822
5822
|
api: E.value.getChatEndpoint(s.value, b.value ? "reasoning" : "chat"),
|
|
@@ -5834,7 +5834,7 @@ function $i(e) {
|
|
|
5834
5834
|
reasoning: f.value?.reasoning,
|
|
5835
5835
|
deviceContext: {
|
|
5836
5836
|
...ne(),
|
|
5837
|
-
...
|
|
5837
|
+
...me.value ?? {}
|
|
5838
5838
|
},
|
|
5839
5839
|
disabledTools: p.value?.disabled,
|
|
5840
5840
|
fallbackModels: v.value,
|
|
@@ -5848,17 +5848,17 @@ function $i(e) {
|
|
|
5848
5848
|
},
|
|
5849
5849
|
sendAutomaticallyWhen: mi,
|
|
5850
5850
|
onError: ue
|
|
5851
|
-
})),
|
|
5851
|
+
})), he = w(() => {
|
|
5852
5852
|
let e = d.value?.initialMessage;
|
|
5853
5853
|
return e?.[i.value] ? e[i.value] : r("message.defaultAgentWelcome") ? n("message.defaultAgentWelcome") : "";
|
|
5854
|
-
}),
|
|
5854
|
+
}), ge = w(() => ({
|
|
5855
5855
|
id: Ei(),
|
|
5856
5856
|
role: "assistant",
|
|
5857
5857
|
parts: [{
|
|
5858
5858
|
type: "text",
|
|
5859
|
-
text:
|
|
5859
|
+
text: he.value
|
|
5860
5860
|
}]
|
|
5861
|
-
})),
|
|
5861
|
+
})), _e = w(() => {
|
|
5862
5862
|
let e = (e) => e.map((e) => e.role !== "user" || !e.parts.some((e) => e.type === "file") ? e : {
|
|
5863
5863
|
...e,
|
|
5864
5864
|
parts: e.parts.map((e) => {
|
|
@@ -5877,23 +5877,23 @@ function $i(e) {
|
|
|
5877
5877
|
};
|
|
5878
5878
|
})
|
|
5879
5879
|
});
|
|
5880
|
-
return b.value || D.value.messages?.[0]?.role === "assistant" ? e(D.value.messages) : [
|
|
5881
|
-
}),
|
|
5880
|
+
return b.value || D.value.messages?.[0]?.role === "assistant" ? e(D.value.messages) : [ge.value, ...e(D.value.messages)];
|
|
5881
|
+
}), O = w(() => {
|
|
5882
5882
|
let e = d.value?.messagePlaceholder;
|
|
5883
5883
|
return e?.[i.value] ? e[i.value] : r("placeholder.askAnything") ? n("placeholder.askAnything") : "";
|
|
5884
|
-
}),
|
|
5885
|
-
async function
|
|
5884
|
+
}), k = T([]), ve = T("chat"), ye = T([]), be = T(), xe = T(!1), Se = T(!1), Ce = T(), we = T(!1), Te = T(!1), Ee = T(), De = T(""), A = T([]), j = T(""), Oe = T(0);
|
|
5885
|
+
async function ke(e) {
|
|
5886
5886
|
if (b.value) {
|
|
5887
|
-
|
|
5887
|
+
k.value = [];
|
|
5888
5888
|
return;
|
|
5889
5889
|
}
|
|
5890
5890
|
try {
|
|
5891
|
-
|
|
5891
|
+
k.value = await E.value.getConversations(e, u.value);
|
|
5892
5892
|
} catch {
|
|
5893
|
-
|
|
5893
|
+
k.value = [];
|
|
5894
5894
|
}
|
|
5895
5895
|
}
|
|
5896
|
-
async function
|
|
5896
|
+
async function Ae(e, t) {
|
|
5897
5897
|
if (b.value) {
|
|
5898
5898
|
D.value.messages = [];
|
|
5899
5899
|
return;
|
|
@@ -5905,65 +5905,69 @@ function $i(e) {
|
|
|
5905
5905
|
D.value.messages = [];
|
|
5906
5906
|
}
|
|
5907
5907
|
}
|
|
5908
|
-
async function
|
|
5908
|
+
async function je(e) {
|
|
5909
5909
|
try {
|
|
5910
5910
|
ye.value = await E.value.getMessageFeedbacks(e);
|
|
5911
5911
|
} catch {
|
|
5912
5912
|
ye.value = [];
|
|
5913
5913
|
}
|
|
5914
5914
|
}
|
|
5915
|
-
function
|
|
5915
|
+
function Me(e) {
|
|
5916
5916
|
let t = ye.value.findIndex((t) => t.messageId === e.messageId);
|
|
5917
5917
|
t >= 0 ? ye.value[t] = e : ye.value.push(e);
|
|
5918
5918
|
}
|
|
5919
|
-
function
|
|
5920
|
-
let t =
|
|
5919
|
+
function Ne(e) {
|
|
5920
|
+
let t = _e.value, n = t.findIndex((t) => t.id === e.id), r = ie(e) ?? "";
|
|
5921
5921
|
return {
|
|
5922
5922
|
userQuestion: ie(t.slice(0, n).reverse().find((e) => e.role === "user") ?? e) ?? "",
|
|
5923
5923
|
assistantMessage: r
|
|
5924
5924
|
};
|
|
5925
5925
|
}
|
|
5926
|
-
async function
|
|
5926
|
+
async function Pe(e, t) {
|
|
5927
5927
|
await Promise.all([
|
|
5928
|
-
|
|
5929
|
-
|
|
5930
|
-
|
|
5931
|
-
]),
|
|
5932
|
-
e && (
|
|
5928
|
+
Ae(e, t),
|
|
5929
|
+
ke(e),
|
|
5930
|
+
je(t)
|
|
5931
|
+
]), me.value || te((e, t) => E.value.reverseGeocode(e, t, i.value)).then((e) => {
|
|
5932
|
+
e && (me.value = e);
|
|
5933
5933
|
});
|
|
5934
5934
|
}
|
|
5935
|
-
async function
|
|
5936
|
-
let e = De.value.trim(), t =
|
|
5935
|
+
async function Fe() {
|
|
5936
|
+
let e = De.value.trim(), t = A.value.filter((e) => e.state === "done" && e.mediaSource !== void 0).map((e) => ({
|
|
5937
5937
|
type: "file",
|
|
5938
5938
|
mediaType: e.mediaSource.mimeType,
|
|
5939
5939
|
url: e.localUrl,
|
|
5940
5940
|
filename: e.mediaSource.name,
|
|
5941
5941
|
providerMetadata: { "8bot": { media: e.mediaSource } }
|
|
5942
5942
|
}));
|
|
5943
|
-
b.value &&
|
|
5943
|
+
b.value && _e.value.length > 0 && await M(), j.value = e, Oe.value = D.value.messages.length;
|
|
5944
5944
|
let n = D.value.sendMessage;
|
|
5945
5945
|
n({
|
|
5946
5946
|
text: e,
|
|
5947
5947
|
files: t.length > 0 ? t : void 0
|
|
5948
|
-
}), De.value = "",
|
|
5948
|
+
}), De.value = "", Le();
|
|
5949
5949
|
}
|
|
5950
|
-
async function
|
|
5951
|
-
|
|
5950
|
+
async function Ie() {
|
|
5951
|
+
let e = j.value.length > 0;
|
|
5952
|
+
await D.value.stop(), e && (De.value = j.value, D.value.messages = D.value.messages.slice(0, Oe.value), j.value = "");
|
|
5952
5953
|
}
|
|
5953
|
-
|
|
5954
|
-
|
|
5955
|
-
|
|
5954
|
+
de(() => D.value.status, (e) => {
|
|
5955
|
+
e === "ready" && j.value.length > 0 && (j.value = "");
|
|
5956
|
+
});
|
|
5957
|
+
function Le(e = !1) {
|
|
5958
|
+
for (let t of A.value) (e || t.state !== "done") && URL.revokeObjectURL(t.localUrl);
|
|
5959
|
+
A.value = [];
|
|
5956
5960
|
}
|
|
5957
|
-
async function
|
|
5958
|
-
return await
|
|
5961
|
+
async function M() {
|
|
5962
|
+
return j.value = "", await Ie(), C.value = Ei(), D.value.clearError(), oe.value = void 0, se.value = !1, Le(!0), R("chat"), C.value;
|
|
5959
5963
|
}
|
|
5960
|
-
async function
|
|
5961
|
-
D.value.status !== "ready" && await
|
|
5964
|
+
async function N(e) {
|
|
5965
|
+
D.value.status !== "ready" && (j.value = "", await Ie()), await D.value.regenerate(e);
|
|
5962
5966
|
}
|
|
5963
|
-
function
|
|
5967
|
+
function P(e) {
|
|
5964
5968
|
if (e.tool === "requestGeolocation") {
|
|
5965
5969
|
let t = e.output;
|
|
5966
|
-
"latitude" in t && (
|
|
5970
|
+
"latitude" in t && (me.value = {
|
|
5967
5971
|
geolocationLatitude: t.latitude,
|
|
5968
5972
|
geolocationLongitude: t.longitude,
|
|
5969
5973
|
geolocationAccuracy: t.accuracy,
|
|
@@ -5972,33 +5976,33 @@ function $i(e) {
|
|
|
5972
5976
|
}
|
|
5973
5977
|
D.value.addToolOutput(e);
|
|
5974
5978
|
}
|
|
5975
|
-
async function
|
|
5979
|
+
async function Re(e) {
|
|
5976
5980
|
let t = Ei(), n = {
|
|
5977
5981
|
id: t,
|
|
5978
5982
|
file: e,
|
|
5979
5983
|
localUrl: URL.createObjectURL(e),
|
|
5980
5984
|
state: "uploading"
|
|
5981
5985
|
};
|
|
5982
|
-
|
|
5986
|
+
A.value = [...A.value, n];
|
|
5983
5987
|
try {
|
|
5984
5988
|
let n = await E.value.uploadMedia(s.value, C.value, e);
|
|
5985
|
-
|
|
5989
|
+
A.value = A.value.map((e) => e.id === t ? {
|
|
5986
5990
|
...e,
|
|
5987
5991
|
state: "done",
|
|
5988
5992
|
mediaSource: n
|
|
5989
5993
|
} : e);
|
|
5990
5994
|
} catch (e) {
|
|
5991
5995
|
let n = e instanceof Error ? e.message : "Upload failed";
|
|
5992
|
-
|
|
5996
|
+
A.value = A.value.map((e) => e.id === t ? {
|
|
5993
5997
|
...e,
|
|
5994
5998
|
state: "error",
|
|
5995
5999
|
error: n
|
|
5996
6000
|
} : e);
|
|
5997
6001
|
}
|
|
5998
6002
|
}
|
|
5999
|
-
async function
|
|
6000
|
-
let { userQuestion: n, assistantMessage: r } =
|
|
6001
|
-
|
|
6003
|
+
async function F(e, t) {
|
|
6004
|
+
let { userQuestion: n, assistantMessage: r } = Ne(e);
|
|
6005
|
+
Me(await E.value.submitMessageFeedback({
|
|
6002
6006
|
messageId: e.id,
|
|
6003
6007
|
chatId: C.value,
|
|
6004
6008
|
agentId: s.value,
|
|
@@ -6007,34 +6011,34 @@ function $i(e) {
|
|
|
6007
6011
|
assistantMessage: r
|
|
6008
6012
|
}));
|
|
6009
6013
|
}
|
|
6010
|
-
async function
|
|
6011
|
-
await
|
|
6014
|
+
async function ze(e) {
|
|
6015
|
+
await F(e, "upvote");
|
|
6012
6016
|
}
|
|
6013
|
-
async function
|
|
6014
|
-
await
|
|
6017
|
+
async function Be(e) {
|
|
6018
|
+
await F(e, "downvote");
|
|
6015
6019
|
}
|
|
6016
|
-
function
|
|
6020
|
+
function Ve(e) {
|
|
6017
6021
|
Se.value = !1, Ce.value = void 0, be.value = e;
|
|
6018
6022
|
}
|
|
6019
|
-
async function
|
|
6023
|
+
async function He(e) {
|
|
6020
6024
|
if (be.value) try {
|
|
6021
6025
|
xe.value = !0, Se.value = !1, Ce.value = void 0;
|
|
6022
|
-
let { userQuestion: t, assistantMessage: n } =
|
|
6023
|
-
|
|
6026
|
+
let { userQuestion: t, assistantMessage: n } = Ne(be.value);
|
|
6027
|
+
Me(await E.value.submitMessageFeedback({
|
|
6024
6028
|
messageId: be.value.id,
|
|
6025
6029
|
chatId: C.value,
|
|
6026
6030
|
agentId: s.value,
|
|
6027
6031
|
userQuestion: t,
|
|
6028
6032
|
assistantMessage: n,
|
|
6029
6033
|
comment: e
|
|
6030
|
-
})), Se.value = !0, await
|
|
6034
|
+
})), Se.value = !0, await je(C.value);
|
|
6031
6035
|
} catch {
|
|
6032
6036
|
Ce.value = r("message.feedbackSubmitError") ? n("message.feedbackSubmitError") : "Failed to submit feedback";
|
|
6033
6037
|
} finally {
|
|
6034
6038
|
xe.value = !1;
|
|
6035
6039
|
}
|
|
6036
6040
|
}
|
|
6037
|
-
async function
|
|
6041
|
+
async function I(e) {
|
|
6038
6042
|
try {
|
|
6039
6043
|
Te.value = !0, we.value = !1, Ee.value = void 0, await E.value.submitLead({
|
|
6040
6044
|
agentId: s.value,
|
|
@@ -6047,7 +6051,17 @@ function $i(e) {
|
|
|
6047
6051
|
Te.value = !1;
|
|
6048
6052
|
}
|
|
6049
6053
|
}
|
|
6050
|
-
function
|
|
6054
|
+
async function L(e, t) {
|
|
6055
|
+
let n = await E.value.updateChatTitle(s.value, e, t);
|
|
6056
|
+
k.value = k.value.map((t) => t.id === e ? {
|
|
6057
|
+
...t,
|
|
6058
|
+
title: n.title
|
|
6059
|
+
} : t);
|
|
6060
|
+
}
|
|
6061
|
+
async function Ue(e) {
|
|
6062
|
+
await E.value.deleteChat(s.value, e), k.value = k.value.filter((t) => t.id !== e), C.value === e && await M();
|
|
6063
|
+
}
|
|
6064
|
+
function R(e) {
|
|
6051
6065
|
ve.value = e;
|
|
6052
6066
|
}
|
|
6053
6067
|
return {
|
|
@@ -6070,13 +6084,13 @@ function $i(e) {
|
|
|
6070
6084
|
fallbackModels: v,
|
|
6071
6085
|
gatewayOptions: y,
|
|
6072
6086
|
chat: D,
|
|
6073
|
-
messages:
|
|
6074
|
-
conversations:
|
|
6087
|
+
messages: _e,
|
|
6088
|
+
conversations: k,
|
|
6075
6089
|
input: De,
|
|
6076
|
-
pendingAttachments:
|
|
6090
|
+
pendingAttachments: A,
|
|
6077
6091
|
localChatId: C,
|
|
6078
6092
|
isConversationBlocked: se,
|
|
6079
|
-
inputMessagePlaceholder:
|
|
6093
|
+
inputMessagePlaceholder: O,
|
|
6080
6094
|
chatError: oe,
|
|
6081
6095
|
activeView: ve,
|
|
6082
6096
|
messageFeedbacks: ye,
|
|
@@ -6087,25 +6101,27 @@ function $i(e) {
|
|
|
6087
6101
|
isLeadSubmitted: we,
|
|
6088
6102
|
isLoadingSubmitLead: Te,
|
|
6089
6103
|
submitLeadError: Ee,
|
|
6090
|
-
initialize:
|
|
6091
|
-
loadConversations:
|
|
6092
|
-
handleSubmit:
|
|
6093
|
-
stopGeneration:
|
|
6094
|
-
startNewChat:
|
|
6095
|
-
regenerate:
|
|
6096
|
-
addToolOutput:
|
|
6097
|
-
handleFileSelect:
|
|
6098
|
-
clearPendingAttachments:
|
|
6099
|
-
onUpvote:
|
|
6100
|
-
onDownvote:
|
|
6101
|
-
onFeedback:
|
|
6102
|
-
onFeedbackSubmit:
|
|
6103
|
-
onLeadSubmit:
|
|
6104
|
-
navigate:
|
|
6104
|
+
initialize: Pe,
|
|
6105
|
+
loadConversations: ke,
|
|
6106
|
+
handleSubmit: Fe,
|
|
6107
|
+
stopGeneration: Ie,
|
|
6108
|
+
startNewChat: M,
|
|
6109
|
+
regenerate: N,
|
|
6110
|
+
addToolOutput: P,
|
|
6111
|
+
handleFileSelect: Re,
|
|
6112
|
+
clearPendingAttachments: Le,
|
|
6113
|
+
onUpvote: ze,
|
|
6114
|
+
onDownvote: Be,
|
|
6115
|
+
onFeedback: Ve,
|
|
6116
|
+
onFeedbackSubmit: He,
|
|
6117
|
+
onLeadSubmit: I,
|
|
6118
|
+
navigate: R,
|
|
6119
|
+
renameChatTitle: L,
|
|
6120
|
+
deleteChat: Ue
|
|
6105
6121
|
};
|
|
6106
6122
|
})();
|
|
6107
6123
|
}
|
|
6108
6124
|
//#endregion
|
|
6109
|
-
export {
|
|
6125
|
+
export { W as i, Xi as n, Ei as r, $i as t };
|
|
6110
6126
|
|
|
6111
|
-
//# sourceMappingURL=useChatbotStore-
|
|
6127
|
+
//# sourceMappingURL=useChatbotStore-DGL81KJa.js.map
|