@makoojs/cli 0.3.2 → 0.4.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.CN.md +298 -261
- package/README.md +298 -261
- package/dist/bin.js +278 -15
- package/dist/command/inspect.d.ts +2 -1
- package/dist/config/resolve.d.ts +4 -1
- package/dist/config/types.d.ts +20 -1
- package/dist/error/{error.d.ts → MakooCliError.d.ts} +13 -1
- package/dist/generator/render/import/importManifest.d.ts +3 -0
- package/dist/generator/render/init/initMakooRuntime.d.ts +3 -2
- package/dist/generator/render/init/registerComp.d.ts +3 -2
- package/dist/generator/render/init/registerListener.d.ts +4 -0
- package/dist/generator/render/util/match.d.ts +1 -0
- package/dist/generator/types.d.ts +6 -0
- package/dist/index.cjs +21 -18
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1002 -917
- package/dist/manifest/index.cjs +1 -0
- package/dist/manifest/index.d.ts +2 -0
- package/dist/manifest/index.js +7 -0
- package/dist/scanner/manifestBinding.d.ts +14 -0
- package/dist/scanner/types.d.ts +25 -1
- package/dist/scanner/validation.d.ts +67 -5
- package/dist/shared/terminalColor.d.ts +1 -0
- package/package.json +9 -4
package/dist/index.js
CHANGED
|
@@ -14,84 +14,108 @@ var v = Object.create, y = Object.defineProperty, b = Object.getOwnPropertyDescr
|
|
|
14
14
|
}, T = (e, t, n) => (n = e == null ? {} : v(S(e)), w(t || !e || !e.__esModule ? y(n, "default", {
|
|
15
15
|
value: e,
|
|
16
16
|
enumerable: !0
|
|
17
|
-
}) : n, e)), E =
|
|
18
|
-
function re(e) {
|
|
19
|
-
return e;
|
|
20
|
-
}
|
|
21
|
-
//#endregion
|
|
22
|
-
//#region packages/cli/src/error/error.ts
|
|
23
|
-
var ie = class extends f {
|
|
17
|
+
}) : n, e)), E = class extends f {
|
|
24
18
|
constructor(e, t = d.CLI_RUNTIME_SETUP_NOT_FOUND, n) {
|
|
25
19
|
super(`Runtime setup file not found at ${e}`, [{
|
|
26
20
|
path: "runtime.setup",
|
|
27
21
|
message: e
|
|
28
22
|
}], t, n), this.name = "RuntimeSetupNotFoundError";
|
|
29
23
|
}
|
|
30
|
-
},
|
|
24
|
+
}, re = class extends f {
|
|
31
25
|
constructor(e, t, n = d.CLI_MANIFEST_VALIDATION_FAIL, r) {
|
|
32
|
-
let i = t.map(
|
|
26
|
+
let i = t.map(L), a = c(u.cwd(), e);
|
|
33
27
|
super(`Invalid manifest at ${a}`, i, n, r), this.name = "ManifestValidationError";
|
|
34
28
|
}
|
|
35
|
-
},
|
|
29
|
+
}, ie = class extends f {
|
|
36
30
|
constructor(e, t = d.CLI_CONFIG_INVALID, n) {
|
|
37
31
|
super("Invalid CliConfig", e, t, n), this.name = "ConfigValidationError";
|
|
38
32
|
}
|
|
39
|
-
},
|
|
33
|
+
}, D = class extends f {
|
|
40
34
|
constructor(e, t = d.CLI_UNKNOWN_FRAMEWORK, n) {
|
|
41
35
|
super(`Cannot infer framework from "${e}". Set "framework" explicitly ("Vue" or "React") in the module manifest.`, [{
|
|
42
36
|
path: "framework",
|
|
43
37
|
message: `cannot infer from "${e}"`
|
|
44
38
|
}], t, n), this.name = "UnknownFrameworkError";
|
|
45
39
|
}
|
|
46
|
-
},
|
|
40
|
+
}, O = class extends f {
|
|
47
41
|
constructor(e, t = d.CLI_COMPONENT_NOT_FOUND, n) {
|
|
48
42
|
super(`Missing component path for injection "${e}"`, [{
|
|
49
43
|
path: "component",
|
|
50
44
|
message: "could not resolve component path"
|
|
51
45
|
}], t, n), this.name = "ComponentNotFoundError";
|
|
52
46
|
}
|
|
53
|
-
},
|
|
47
|
+
}, ae = class extends f {
|
|
54
48
|
constructor(e, t = d.CLI_SOURCE_DIR_NOT_FOUND, n) {
|
|
55
49
|
super(`Source directory not found at ${e}`, void 0, t, n), this.name = "SourceDirNotFoundError";
|
|
56
50
|
}
|
|
57
|
-
},
|
|
51
|
+
}, oe = class extends f {
|
|
58
52
|
constructor(e, t = d.CLI_MANIFEST_NOT_FOUND, n) {
|
|
59
53
|
super(`No manifest found in source directory at ${e}`, void 0, t, n), this.name = "ManifestNotFoundError";
|
|
60
54
|
}
|
|
55
|
+
}, k = class extends f {
|
|
56
|
+
constructor(e, t, n = d.CLI_MANIFEST_BINDING_NOT_FOUND, r) {
|
|
57
|
+
let i = e === "injectionDefaults" ? `${e}.${t}` : `${e}s.${t}`;
|
|
58
|
+
super(`Missing manifest binding for ${e === "injectionDefaults" ? "injection defaults" : e} "${t}"`, [{
|
|
59
|
+
path: i,
|
|
60
|
+
message: "could not resolve manifest source"
|
|
61
|
+
}], n, r), this.name = "ManifestBindingNotFoundError";
|
|
62
|
+
}
|
|
63
|
+
}, A = class extends f {
|
|
64
|
+
constructor(e, t = d.CLI_MANIFEST_IMPORT_NOT_FOUND, n) {
|
|
65
|
+
super(`Missing manifest import for "${e}"`, [{
|
|
66
|
+
path: "manifestFile",
|
|
67
|
+
message: e
|
|
68
|
+
}], t, n), this.name = "ManifestImportNotFoundError";
|
|
69
|
+
}
|
|
61
70
|
}, j = class extends f {
|
|
71
|
+
constructor(e, t, n, r = d.CLI_SELECTOR_TARGET_UNSUPPORTED, i) {
|
|
72
|
+
let a = c(u.cwd(), e);
|
|
73
|
+
super(`Unsupported selector target "${n}" in manifest at ${a}`, [{
|
|
74
|
+
path: t,
|
|
75
|
+
message: "must be a CSS selector; document and window are not supported"
|
|
76
|
+
}], r, i), this.name = "UnsupportedSelectorTargetError";
|
|
77
|
+
}
|
|
78
|
+
}, M = class extends f {
|
|
79
|
+
constructor(e = d.CLI_FUNCTION_SERIALIZATION_UNSUPPORTED, t) {
|
|
80
|
+
super("Function values cannot be serialized into the generated entry; use a manifest binding instead", [{
|
|
81
|
+
path: "generator.inlineValue",
|
|
82
|
+
message: "function values require a manifest binding"
|
|
83
|
+
}], e, t), this.name = "FunctionSerializationError";
|
|
84
|
+
}
|
|
85
|
+
}, se = class extends f {
|
|
62
86
|
constructor(e, t = d.CLI_MANIFEST_LOAD_FAIL, n) {
|
|
63
87
|
super(`Failed to load manifest at ${e}`, [{
|
|
64
88
|
path: "(load)",
|
|
65
89
|
message: n instanceof Error ? n.message : String(n)
|
|
66
90
|
}], t, n), this.name = "ManifestLoadError";
|
|
67
91
|
}
|
|
68
|
-
},
|
|
92
|
+
}, N = class extends f {
|
|
69
93
|
constructor(e, t = d.CLI_MODULE_MANIFEST_LOAD_FAIL, n) {
|
|
70
94
|
super(`Failed to load module manifest at ${e}`, [{
|
|
71
95
|
path: "(load)",
|
|
72
96
|
message: n instanceof Error ? n.message : String(n)
|
|
73
97
|
}], t, n), this.name = "ModuleManifestLoadError";
|
|
74
98
|
}
|
|
75
|
-
},
|
|
76
|
-
constructor(e = d.
|
|
77
|
-
super("No enabled
|
|
99
|
+
}, P = class extends f {
|
|
100
|
+
constructor(e = d.CLI_NO_ENABLED_TASKS, t) {
|
|
101
|
+
super("No enabled tasks — all injections and listeners are disabled or filtered out", void 0, e, t), this.name = "NoEnabledTasksError";
|
|
78
102
|
}
|
|
79
103
|
};
|
|
80
|
-
function
|
|
104
|
+
function F(e) {
|
|
81
105
|
return e.length === 0 ? "(root)" : e.filter((e) => typeof e != "symbol").map((e) => typeof e == "number" ? `[${e}]` : e).join(".");
|
|
82
106
|
}
|
|
83
|
-
function
|
|
107
|
+
function I(e) {
|
|
84
108
|
return e.code === "invalid_type" && e.message.endsWith("received undefined") ? "is required" : e.message;
|
|
85
109
|
}
|
|
86
|
-
function
|
|
110
|
+
function L(e) {
|
|
87
111
|
return {
|
|
88
|
-
path:
|
|
89
|
-
message:
|
|
112
|
+
path: F(e.path),
|
|
113
|
+
message: I(e)
|
|
90
114
|
};
|
|
91
115
|
}
|
|
92
116
|
//#endregion
|
|
93
117
|
//#region packages/cli/src/config/defaults.ts
|
|
94
|
-
var
|
|
118
|
+
var R = [
|
|
95
119
|
".ts",
|
|
96
120
|
".tsx",
|
|
97
121
|
".js",
|
|
@@ -100,27 +124,27 @@ var I = [
|
|
|
100
124
|
".cts",
|
|
101
125
|
".mjs",
|
|
102
126
|
".cjs"
|
|
103
|
-
],
|
|
104
|
-
dir:
|
|
127
|
+
], z = /\bimport\s+(?:type\s+)?(?:[^'"]*?\s+from\s+)?['"]([^'"]+)['"]|\bexport\s+(?:type\s+)?(?:[^'"]*?\s+from\s+)?['"]([^'"]+)['"]/g, ce = /\brequire\s*\(['"]([^'"]+)['"]\)/g, le = "\0virtual:makoo/entry", B = "makoo-entry.ts", ue = "\0makoo-entry.ts", V = new Set([".tsx", ".jsx"]), de = new Set([".vue"]), fe = "injections", pe = "manifest", me = {
|
|
128
|
+
dir: fe,
|
|
105
129
|
include: ["*"],
|
|
106
130
|
exclude: [],
|
|
107
|
-
manifest:
|
|
108
|
-
},
|
|
131
|
+
manifest: pe
|
|
132
|
+
}, he = { setup: [] }, ge = {
|
|
109
133
|
alive: !1,
|
|
110
134
|
scope: "local",
|
|
111
135
|
timeout: 5e3,
|
|
112
136
|
hooks: {}
|
|
113
|
-
},
|
|
137
|
+
}, _e = {
|
|
114
138
|
open: u.platform === "win32" || u.platform === "darwin",
|
|
115
139
|
prefix: "server:"
|
|
116
|
-
},
|
|
140
|
+
}, ve = {
|
|
117
141
|
metaFileName: !1,
|
|
118
142
|
autoGrant: !0
|
|
119
|
-
},
|
|
143
|
+
}, ye = {
|
|
120
144
|
align: 2,
|
|
121
145
|
clientAlias: "$",
|
|
122
146
|
styleImport: !0
|
|
123
|
-
},
|
|
147
|
+
}, be;
|
|
124
148
|
function H(e, t, n) {
|
|
125
149
|
function r(n, r) {
|
|
126
150
|
if (n._zod || Object.defineProperty(n, "_zod", {
|
|
@@ -150,30 +174,30 @@ function H(e, t, n) {
|
|
|
150
174
|
}
|
|
151
175
|
return Object.defineProperty(o, "init", { value: r }), Object.defineProperty(o, Symbol.hasInstance, { value: (t) => n?.Parent && t instanceof n.Parent ? !0 : t?._zod?.traits?.has(e) }), Object.defineProperty(o, "name", { value: e }), o;
|
|
152
176
|
}
|
|
153
|
-
var
|
|
177
|
+
var xe = class extends Error {
|
|
154
178
|
constructor() {
|
|
155
179
|
super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
|
|
156
180
|
}
|
|
157
|
-
},
|
|
181
|
+
}, Se = class extends Error {
|
|
158
182
|
constructor(e) {
|
|
159
183
|
super(`Encountered unidirectional transform during encode: ${e}`), this.name = "ZodEncodeError";
|
|
160
184
|
}
|
|
161
185
|
};
|
|
162
|
-
(
|
|
163
|
-
var
|
|
164
|
-
function
|
|
165
|
-
return e && Object.assign(
|
|
186
|
+
(be = globalThis).__zod_globalConfig ?? (be.__zod_globalConfig = {});
|
|
187
|
+
var Ce = globalThis.__zod_globalConfig;
|
|
188
|
+
function we(e) {
|
|
189
|
+
return e && Object.assign(Ce, e), Ce;
|
|
166
190
|
}
|
|
167
191
|
//#endregion
|
|
168
192
|
//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/util.js
|
|
169
|
-
function
|
|
193
|
+
function Te(e) {
|
|
170
194
|
let t = Object.values(e).filter((e) => typeof e == "number");
|
|
171
195
|
return Object.entries(e).filter(([e, n]) => t.indexOf(+e) === -1).map(([e, t]) => t);
|
|
172
196
|
}
|
|
173
|
-
function
|
|
197
|
+
function Ee(e, t) {
|
|
174
198
|
return typeof t == "bigint" ? t.toString() : t;
|
|
175
199
|
}
|
|
176
|
-
function
|
|
200
|
+
function De(e) {
|
|
177
201
|
return { get value() {
|
|
178
202
|
{
|
|
179
203
|
let t = e();
|
|
@@ -182,23 +206,23 @@ function Te(e) {
|
|
|
182
206
|
throw Error("cached value already set");
|
|
183
207
|
} };
|
|
184
208
|
}
|
|
185
|
-
function
|
|
209
|
+
function Oe(e) {
|
|
186
210
|
return e == null;
|
|
187
211
|
}
|
|
188
|
-
function
|
|
212
|
+
function ke(e) {
|
|
189
213
|
let t = +!!e.startsWith("^"), n = e.endsWith("$") ? e.length - 1 : e.length;
|
|
190
214
|
return e.slice(t, n);
|
|
191
215
|
}
|
|
192
|
-
function
|
|
216
|
+
function Ae(e, t) {
|
|
193
217
|
let n = e / t, r = Math.round(n), i = 2 ** -52 * Math.max(Math.abs(n), 1);
|
|
194
218
|
return Math.abs(n - r) < i ? 0 : n - r;
|
|
195
219
|
}
|
|
196
|
-
var
|
|
220
|
+
var je = /* @__PURE__ */ Symbol("evaluating");
|
|
197
221
|
function U(e, t, n) {
|
|
198
222
|
let r;
|
|
199
223
|
Object.defineProperty(e, t, {
|
|
200
224
|
get() {
|
|
201
|
-
if (r !==
|
|
225
|
+
if (r !== je) return r === void 0 && (r = je, r = n()), r;
|
|
202
226
|
},
|
|
203
227
|
set(n) {
|
|
204
228
|
Object.defineProperty(e, t, { value: n });
|
|
@@ -206,7 +230,7 @@ function U(e, t, n) {
|
|
|
206
230
|
configurable: !0
|
|
207
231
|
});
|
|
208
232
|
}
|
|
209
|
-
function
|
|
233
|
+
function Me(e, t, n) {
|
|
210
234
|
Object.defineProperty(e, t, {
|
|
211
235
|
value: n,
|
|
212
236
|
writable: !0,
|
|
@@ -214,48 +238,48 @@ function Ae(e, t, n) {
|
|
|
214
238
|
configurable: !0
|
|
215
239
|
});
|
|
216
240
|
}
|
|
217
|
-
function
|
|
241
|
+
function Ne(...e) {
|
|
218
242
|
let t = {};
|
|
219
243
|
for (let n of e) Object.assign(t, Object.getOwnPropertyDescriptors(n));
|
|
220
244
|
return Object.defineProperties({}, t);
|
|
221
245
|
}
|
|
222
|
-
function
|
|
246
|
+
function Pe(e) {
|
|
223
247
|
return JSON.stringify(e);
|
|
224
248
|
}
|
|
225
|
-
function
|
|
249
|
+
function Fe(e) {
|
|
226
250
|
return e.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
227
251
|
}
|
|
228
|
-
var
|
|
229
|
-
function
|
|
252
|
+
var Ie = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {};
|
|
253
|
+
function Le(e) {
|
|
230
254
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
231
255
|
}
|
|
232
|
-
var
|
|
233
|
-
if (
|
|
256
|
+
var Re = /* @__PURE__ */ De(() => {
|
|
257
|
+
if (Ce.jitless || typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare")) return !1;
|
|
234
258
|
try {
|
|
235
259
|
return Function(""), !0;
|
|
236
260
|
} catch {
|
|
237
261
|
return !1;
|
|
238
262
|
}
|
|
239
263
|
});
|
|
240
|
-
function
|
|
241
|
-
if (
|
|
264
|
+
function ze(e) {
|
|
265
|
+
if (Le(e) === !1) return !1;
|
|
242
266
|
let t = e.constructor;
|
|
243
267
|
if (t === void 0 || typeof t != "function") return !0;
|
|
244
268
|
let n = t.prototype;
|
|
245
|
-
return !(
|
|
269
|
+
return !(Le(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
|
|
246
270
|
}
|
|
247
|
-
function
|
|
248
|
-
return
|
|
271
|
+
function Be(e) {
|
|
272
|
+
return ze(e) ? { ...e } : Array.isArray(e) ? [...e] : e instanceof Map ? new Map(e) : e instanceof Set ? new Set(e) : e;
|
|
249
273
|
}
|
|
250
|
-
var
|
|
274
|
+
var Ve = /* @__PURE__ */ new Set([
|
|
251
275
|
"string",
|
|
252
276
|
"number",
|
|
253
277
|
"symbol"
|
|
254
278
|
]);
|
|
255
|
-
function
|
|
279
|
+
function He(e) {
|
|
256
280
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
257
281
|
}
|
|
258
|
-
function
|
|
282
|
+
function Ue(e, t, n) {
|
|
259
283
|
let r = new e._zod.constr(t ?? e._zod.def);
|
|
260
284
|
return (!t || n?.parent) && (r._zod.parent = e), r;
|
|
261
285
|
}
|
|
@@ -272,80 +296,80 @@ function W(e) {
|
|
|
272
296
|
error: () => t.error
|
|
273
297
|
} : t;
|
|
274
298
|
}
|
|
275
|
-
function
|
|
299
|
+
function We(e) {
|
|
276
300
|
return Object.keys(e).filter((t) => e[t]._zod.optin === "optional" && e[t]._zod.optout === "optional");
|
|
277
301
|
}
|
|
278
|
-
var
|
|
302
|
+
var Ge = {
|
|
279
303
|
safeint: [-(2 ** 53 - 1), 2 ** 53 - 1],
|
|
280
304
|
int32: [-2147483648, 2147483647],
|
|
281
305
|
uint32: [0, 4294967295],
|
|
282
306
|
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
283
307
|
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
284
308
|
};
|
|
285
|
-
function
|
|
309
|
+
function Ke(e, t) {
|
|
286
310
|
let n = e._zod.def, r = n.checks;
|
|
287
311
|
if (r && r.length > 0) throw Error(".pick() cannot be used on object schemas containing refinements");
|
|
288
|
-
return
|
|
312
|
+
return Ue(e, Ne(e._zod.def, {
|
|
289
313
|
get shape() {
|
|
290
314
|
let e = {};
|
|
291
315
|
for (let r in t) {
|
|
292
316
|
if (!(r in n.shape)) throw Error(`Unrecognized key: "${r}"`);
|
|
293
317
|
t[r] && (e[r] = n.shape[r]);
|
|
294
318
|
}
|
|
295
|
-
return
|
|
319
|
+
return Me(this, "shape", e), e;
|
|
296
320
|
},
|
|
297
321
|
checks: []
|
|
298
322
|
}));
|
|
299
323
|
}
|
|
300
|
-
function
|
|
324
|
+
function qe(e, t) {
|
|
301
325
|
let n = e._zod.def, r = n.checks;
|
|
302
326
|
if (r && r.length > 0) throw Error(".omit() cannot be used on object schemas containing refinements");
|
|
303
|
-
return
|
|
327
|
+
return Ue(e, Ne(e._zod.def, {
|
|
304
328
|
get shape() {
|
|
305
329
|
let r = { ...e._zod.def.shape };
|
|
306
330
|
for (let e in t) {
|
|
307
331
|
if (!(e in n.shape)) throw Error(`Unrecognized key: "${e}"`);
|
|
308
332
|
t[e] && delete r[e];
|
|
309
333
|
}
|
|
310
|
-
return
|
|
334
|
+
return Me(this, "shape", r), r;
|
|
311
335
|
},
|
|
312
336
|
checks: []
|
|
313
337
|
}));
|
|
314
338
|
}
|
|
315
|
-
function
|
|
316
|
-
if (!
|
|
339
|
+
function Je(e, t) {
|
|
340
|
+
if (!ze(t)) throw Error("Invalid input to extend: expected a plain object");
|
|
317
341
|
let n = e._zod.def.checks;
|
|
318
342
|
if (n && n.length > 0) {
|
|
319
343
|
let n = e._zod.def.shape;
|
|
320
344
|
for (let e in t) if (Object.getOwnPropertyDescriptor(n, e) !== void 0) throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
321
345
|
}
|
|
322
|
-
return
|
|
346
|
+
return Ue(e, Ne(e._zod.def, { get shape() {
|
|
323
347
|
let n = {
|
|
324
348
|
...e._zod.def.shape,
|
|
325
349
|
...t
|
|
326
350
|
};
|
|
327
|
-
return
|
|
351
|
+
return Me(this, "shape", n), n;
|
|
328
352
|
} }));
|
|
329
353
|
}
|
|
330
|
-
function
|
|
331
|
-
if (!
|
|
332
|
-
return
|
|
354
|
+
function Ye(e, t) {
|
|
355
|
+
if (!ze(t)) throw Error("Invalid input to safeExtend: expected a plain object");
|
|
356
|
+
return Ue(e, Ne(e._zod.def, { get shape() {
|
|
333
357
|
let n = {
|
|
334
358
|
...e._zod.def.shape,
|
|
335
359
|
...t
|
|
336
360
|
};
|
|
337
|
-
return
|
|
361
|
+
return Me(this, "shape", n), n;
|
|
338
362
|
} }));
|
|
339
363
|
}
|
|
340
|
-
function
|
|
364
|
+
function Xe(e, t) {
|
|
341
365
|
if (e._zod.def.checks?.length) throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
|
|
342
|
-
return
|
|
366
|
+
return Ue(e, Ne(e._zod.def, {
|
|
343
367
|
get shape() {
|
|
344
368
|
let n = {
|
|
345
369
|
...e._zod.def.shape,
|
|
346
370
|
...t._zod.def.shape
|
|
347
371
|
};
|
|
348
|
-
return
|
|
372
|
+
return Me(this, "shape", n), n;
|
|
349
373
|
},
|
|
350
374
|
get catchall() {
|
|
351
375
|
return t._zod.def.catchall;
|
|
@@ -353,10 +377,10 @@ function Je(e, t) {
|
|
|
353
377
|
checks: t._zod.def.checks ?? []
|
|
354
378
|
}));
|
|
355
379
|
}
|
|
356
|
-
function
|
|
380
|
+
function Ze(e, t, n) {
|
|
357
381
|
let r = t._zod.def.checks;
|
|
358
382
|
if (r && r.length > 0) throw Error(".partial() cannot be used on object schemas containing refinements");
|
|
359
|
-
return
|
|
383
|
+
return Ue(t, Ne(t._zod.def, {
|
|
360
384
|
get shape() {
|
|
361
385
|
let r = t._zod.def.shape, i = { ...r };
|
|
362
386
|
if (n) for (let t in n) {
|
|
@@ -370,13 +394,13 @@ function Ye(e, t, n) {
|
|
|
370
394
|
type: "optional",
|
|
371
395
|
innerType: r[t]
|
|
372
396
|
}) : r[t];
|
|
373
|
-
return
|
|
397
|
+
return Me(this, "shape", i), i;
|
|
374
398
|
},
|
|
375
399
|
checks: []
|
|
376
400
|
}));
|
|
377
401
|
}
|
|
378
|
-
function
|
|
379
|
-
return
|
|
402
|
+
function Qe(e, t, n) {
|
|
403
|
+
return Ue(t, Ne(t._zod.def, { get shape() {
|
|
380
404
|
let r = t._zod.def.shape, i = { ...r };
|
|
381
405
|
if (n) for (let t in n) {
|
|
382
406
|
if (!(t in i)) throw Error(`Unrecognized key: "${t}"`);
|
|
@@ -389,36 +413,36 @@ function Xe(e, t, n) {
|
|
|
389
413
|
type: "nonoptional",
|
|
390
414
|
innerType: r[t]
|
|
391
415
|
});
|
|
392
|
-
return
|
|
416
|
+
return Me(this, "shape", i), i;
|
|
393
417
|
} }));
|
|
394
418
|
}
|
|
395
|
-
function
|
|
419
|
+
function $e(e, t = 0) {
|
|
396
420
|
if (e.aborted === !0) return !0;
|
|
397
421
|
for (let n = t; n < e.issues.length; n++) if (e.issues[n]?.continue !== !0) return !0;
|
|
398
422
|
return !1;
|
|
399
423
|
}
|
|
400
|
-
function
|
|
424
|
+
function et(e, t = 0) {
|
|
401
425
|
if (e.aborted === !0) return !0;
|
|
402
426
|
for (let n = t; n < e.issues.length; n++) if (e.issues[n]?.continue === !1) return !0;
|
|
403
427
|
return !1;
|
|
404
428
|
}
|
|
405
|
-
function
|
|
429
|
+
function tt(e, t) {
|
|
406
430
|
return t.map((t) => {
|
|
407
431
|
var n;
|
|
408
432
|
return (n = t).path ?? (n.path = []), t.path.unshift(e), t;
|
|
409
433
|
});
|
|
410
434
|
}
|
|
411
|
-
function
|
|
435
|
+
function nt(e) {
|
|
412
436
|
return typeof e == "string" ? e : e?.message;
|
|
413
437
|
}
|
|
414
|
-
function
|
|
415
|
-
let r = e.message ? e.message :
|
|
438
|
+
function rt(e, t, n) {
|
|
439
|
+
let r = e.message ? e.message : nt(e.inst?._zod.def?.error?.(e)) ?? nt(t?.error?.(e)) ?? nt(n.customError?.(e)) ?? nt(n.localeError?.(e)) ?? "Invalid input", { inst: i, continue: a, input: o, ...s } = e;
|
|
416
440
|
return s.path ??= [], s.message = r, t?.reportInput && (s.input = o), s;
|
|
417
441
|
}
|
|
418
|
-
function
|
|
442
|
+
function it(e) {
|
|
419
443
|
return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
|
|
420
444
|
}
|
|
421
|
-
function
|
|
445
|
+
function at(...e) {
|
|
422
446
|
let [t, n, r] = e;
|
|
423
447
|
return typeof t == "string" ? {
|
|
424
448
|
message: t,
|
|
@@ -429,19 +453,19 @@ function rt(...e) {
|
|
|
429
453
|
}
|
|
430
454
|
//#endregion
|
|
431
455
|
//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/errors.js
|
|
432
|
-
var
|
|
456
|
+
var ot = (e, t) => {
|
|
433
457
|
e.name = "$ZodError", Object.defineProperty(e, "_zod", {
|
|
434
458
|
value: e._zod,
|
|
435
459
|
enumerable: !1
|
|
436
460
|
}), Object.defineProperty(e, "issues", {
|
|
437
461
|
value: t,
|
|
438
462
|
enumerable: !1
|
|
439
|
-
}), e.message = JSON.stringify(t,
|
|
463
|
+
}), e.message = JSON.stringify(t, Ee, 2), Object.defineProperty(e, "toString", {
|
|
440
464
|
value: () => e.message,
|
|
441
465
|
enumerable: !1
|
|
442
466
|
});
|
|
443
|
-
},
|
|
444
|
-
function
|
|
467
|
+
}, st = H("$ZodError", ot), ct = H("$ZodError", ot, { Parent: Error });
|
|
468
|
+
function lt(e, t = (e) => e.message) {
|
|
445
469
|
let n = {}, r = [];
|
|
446
470
|
for (let i of e.issues) i.path.length > 0 ? (n[i.path[0]] = n[i.path[0]] || [], n[i.path[0]].push(t(i))) : r.push(t(i));
|
|
447
471
|
return {
|
|
@@ -449,7 +473,7 @@ function st(e, t = (e) => e.message) {
|
|
|
449
473
|
fieldErrors: n
|
|
450
474
|
};
|
|
451
475
|
}
|
|
452
|
-
function
|
|
476
|
+
function ut(e, t = (e) => e.message) {
|
|
453
477
|
let n = { _errors: [] }, r = (e, i = []) => {
|
|
454
478
|
for (let a of e.issues) if (a.code === "invalid_union" && a.errors.length) a.errors.map((e) => r({ issues: e }, [...i, ...a.path]));
|
|
455
479
|
else if (a.code === "invalid_key") r({ issues: a.issues }, [...i, ...a.path]);
|
|
@@ -470,7 +494,7 @@ function ct(e, t = (e) => e.message) {
|
|
|
470
494
|
}
|
|
471
495
|
//#endregion
|
|
472
496
|
//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/parse.js
|
|
473
|
-
var
|
|
497
|
+
var dt = (e) => (t, n, r, i) => {
|
|
474
498
|
let a = r ? {
|
|
475
499
|
...r,
|
|
476
500
|
async: !1
|
|
@@ -478,13 +502,13 @@ var lt = (e) => (t, n, r, i) => {
|
|
|
478
502
|
value: n,
|
|
479
503
|
issues: []
|
|
480
504
|
}, a);
|
|
481
|
-
if (o instanceof Promise) throw new
|
|
505
|
+
if (o instanceof Promise) throw new xe();
|
|
482
506
|
if (o.issues.length) {
|
|
483
|
-
let t = new (i?.Err ?? e)(o.issues.map((e) =>
|
|
484
|
-
throw
|
|
507
|
+
let t = new (i?.Err ?? e)(o.issues.map((e) => rt(e, a, we())));
|
|
508
|
+
throw Ie(t, i?.callee), t;
|
|
485
509
|
}
|
|
486
510
|
return o.value;
|
|
487
|
-
},
|
|
511
|
+
}, ft = (e) => async (t, n, r, i) => {
|
|
488
512
|
let a = r ? {
|
|
489
513
|
...r,
|
|
490
514
|
async: !0
|
|
@@ -493,11 +517,11 @@ var lt = (e) => (t, n, r, i) => {
|
|
|
493
517
|
issues: []
|
|
494
518
|
}, a);
|
|
495
519
|
if (o instanceof Promise && (o = await o), o.issues.length) {
|
|
496
|
-
let t = new (i?.Err ?? e)(o.issues.map((e) =>
|
|
497
|
-
throw
|
|
520
|
+
let t = new (i?.Err ?? e)(o.issues.map((e) => rt(e, a, we())));
|
|
521
|
+
throw Ie(t, i?.callee), t;
|
|
498
522
|
}
|
|
499
523
|
return o.value;
|
|
500
|
-
},
|
|
524
|
+
}, pt = (e) => (t, n, r) => {
|
|
501
525
|
let i = r ? {
|
|
502
526
|
...r,
|
|
503
527
|
async: !1
|
|
@@ -505,15 +529,15 @@ var lt = (e) => (t, n, r, i) => {
|
|
|
505
529
|
value: n,
|
|
506
530
|
issues: []
|
|
507
531
|
}, i);
|
|
508
|
-
if (a instanceof Promise) throw new
|
|
532
|
+
if (a instanceof Promise) throw new xe();
|
|
509
533
|
return a.issues.length ? {
|
|
510
534
|
success: !1,
|
|
511
|
-
error: new (e ??
|
|
535
|
+
error: new (e ?? st)(a.issues.map((e) => rt(e, i, we())))
|
|
512
536
|
} : {
|
|
513
537
|
success: !0,
|
|
514
538
|
data: a.value
|
|
515
539
|
};
|
|
516
|
-
}, mt = /* @__PURE__ */ pt(
|
|
540
|
+
}, mt = /* @__PURE__ */ pt(ct), ht = (e) => async (t, n, r) => {
|
|
517
541
|
let i = r ? {
|
|
518
542
|
...r,
|
|
519
543
|
async: !0
|
|
@@ -523,24 +547,24 @@ var lt = (e) => (t, n, r, i) => {
|
|
|
523
547
|
}, i);
|
|
524
548
|
return a instanceof Promise && (a = await a), a.issues.length ? {
|
|
525
549
|
success: !1,
|
|
526
|
-
error: new e(a.issues.map((e) =>
|
|
550
|
+
error: new e(a.issues.map((e) => rt(e, i, we())))
|
|
527
551
|
} : {
|
|
528
552
|
success: !0,
|
|
529
553
|
data: a.value
|
|
530
554
|
};
|
|
531
|
-
}, gt = /* @__PURE__ */ ht(
|
|
555
|
+
}, gt = /* @__PURE__ */ ht(ct), _t = (e) => (t, n, r) => {
|
|
532
556
|
let i = r ? {
|
|
533
557
|
...r,
|
|
534
558
|
direction: "backward"
|
|
535
559
|
} : { direction: "backward" };
|
|
536
|
-
return
|
|
537
|
-
}, vt = (e) => (t, n, r) =>
|
|
560
|
+
return dt(e)(t, n, i);
|
|
561
|
+
}, vt = (e) => (t, n, r) => dt(e)(t, n, r), yt = (e) => async (t, n, r) => {
|
|
538
562
|
let i = r ? {
|
|
539
563
|
...r,
|
|
540
564
|
direction: "backward"
|
|
541
565
|
} : { direction: "backward" };
|
|
542
|
-
return
|
|
543
|
-
}, bt = (e) => async (t, n, r) =>
|
|
566
|
+
return ft(e)(t, n, i);
|
|
567
|
+
}, bt = (e) => async (t, n, r) => ft(e)(t, n, r), xt = (e) => (t, n, r) => {
|
|
544
568
|
let i = r ? {
|
|
545
569
|
...r,
|
|
546
570
|
direction: "backward"
|
|
@@ -620,7 +644,7 @@ var Xt = (e) => {
|
|
|
620
644
|
(n = e._zod.bag).multipleOf ?? (n.multipleOf = t.value);
|
|
621
645
|
}), e._zod.check = (n) => {
|
|
622
646
|
if (typeof n.value != typeof t.value) throw Error("Cannot mix number and bigint in multiple_of check.");
|
|
623
|
-
(typeof n.value == "bigint" ? n.value % t.value === BigInt(0) :
|
|
647
|
+
(typeof n.value == "bigint" ? n.value % t.value === BigInt(0) : Ae(n.value, t.value) === 0) || n.issues.push({
|
|
624
648
|
origin: typeof n.value,
|
|
625
649
|
code: "not_multiple_of",
|
|
626
650
|
divisor: t.value,
|
|
@@ -631,7 +655,7 @@ var Xt = (e) => {
|
|
|
631
655
|
};
|
|
632
656
|
}), sn = /* @__PURE__ */ H("$ZodCheckNumberFormat", (e, t) => {
|
|
633
657
|
G.init(e, t), t.format = t.format || "float64";
|
|
634
|
-
let n = t.format?.includes("int"), r = n ? "int" : "number", [i, a] =
|
|
658
|
+
let n = t.format?.includes("int"), r = n ? "int" : "number", [i, a] = Ge[t.format];
|
|
635
659
|
e._zod.onattach.push((e) => {
|
|
636
660
|
let r = e._zod.bag;
|
|
637
661
|
r.format = t.format, r.minimum = i, r.maximum = a, n && (r.pattern = Zt);
|
|
@@ -694,14 +718,14 @@ var Xt = (e) => {
|
|
|
694
718
|
var n;
|
|
695
719
|
G.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => {
|
|
696
720
|
let t = e.value;
|
|
697
|
-
return !
|
|
721
|
+
return !Oe(t) && t.length !== void 0;
|
|
698
722
|
}), e._zod.onattach.push((e) => {
|
|
699
723
|
let n = e._zod.bag.maximum ?? Infinity;
|
|
700
724
|
t.maximum < n && (e._zod.bag.maximum = t.maximum);
|
|
701
725
|
}), e._zod.check = (n) => {
|
|
702
726
|
let r = n.value;
|
|
703
727
|
if (r.length <= t.maximum) return;
|
|
704
|
-
let i =
|
|
728
|
+
let i = it(r);
|
|
705
729
|
n.issues.push({
|
|
706
730
|
origin: i,
|
|
707
731
|
code: "too_big",
|
|
@@ -716,14 +740,14 @@ var Xt = (e) => {
|
|
|
716
740
|
var n;
|
|
717
741
|
G.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => {
|
|
718
742
|
let t = e.value;
|
|
719
|
-
return !
|
|
743
|
+
return !Oe(t) && t.length !== void 0;
|
|
720
744
|
}), e._zod.onattach.push((e) => {
|
|
721
745
|
let n = e._zod.bag.minimum ?? -Infinity;
|
|
722
746
|
t.minimum > n && (e._zod.bag.minimum = t.minimum);
|
|
723
747
|
}), e._zod.check = (n) => {
|
|
724
748
|
let r = n.value;
|
|
725
749
|
if (r.length >= t.minimum) return;
|
|
726
|
-
let i =
|
|
750
|
+
let i = it(r);
|
|
727
751
|
n.issues.push({
|
|
728
752
|
origin: i,
|
|
729
753
|
code: "too_small",
|
|
@@ -738,14 +762,14 @@ var Xt = (e) => {
|
|
|
738
762
|
var n;
|
|
739
763
|
G.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => {
|
|
740
764
|
let t = e.value;
|
|
741
|
-
return !
|
|
765
|
+
return !Oe(t) && t.length !== void 0;
|
|
742
766
|
}), e._zod.onattach.push((e) => {
|
|
743
767
|
let n = e._zod.bag;
|
|
744
768
|
n.minimum = t.length, n.maximum = t.length, n.length = t.length;
|
|
745
769
|
}), e._zod.check = (n) => {
|
|
746
770
|
let r = n.value, i = r.length;
|
|
747
771
|
if (i === t.length) return;
|
|
748
|
-
let a =
|
|
772
|
+
let a = it(r), o = i > t.length;
|
|
749
773
|
n.issues.push({
|
|
750
774
|
origin: a,
|
|
751
775
|
...o ? {
|
|
@@ -796,7 +820,7 @@ var Xt = (e) => {
|
|
|
796
820
|
t.pattern ??= tn, dn.init(e, t);
|
|
797
821
|
}), hn = /* @__PURE__ */ H("$ZodCheckIncludes", (e, t) => {
|
|
798
822
|
G.init(e, t);
|
|
799
|
-
let n =
|
|
823
|
+
let n = He(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
|
|
800
824
|
t.pattern = r, e._zod.onattach.push((e) => {
|
|
801
825
|
let t = e._zod.bag;
|
|
802
826
|
t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(r);
|
|
@@ -813,7 +837,7 @@ var Xt = (e) => {
|
|
|
813
837
|
};
|
|
814
838
|
}), gn = /* @__PURE__ */ H("$ZodCheckStartsWith", (e, t) => {
|
|
815
839
|
G.init(e, t);
|
|
816
|
-
let n = RegExp(`^${
|
|
840
|
+
let n = RegExp(`^${He(t.prefix)}.*`);
|
|
817
841
|
t.pattern ??= n, e._zod.onattach.push((e) => {
|
|
818
842
|
let t = e._zod.bag;
|
|
819
843
|
t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(n);
|
|
@@ -830,7 +854,7 @@ var Xt = (e) => {
|
|
|
830
854
|
};
|
|
831
855
|
}), _n = /* @__PURE__ */ H("$ZodCheckEndsWith", (e, t) => {
|
|
832
856
|
G.init(e, t);
|
|
833
|
-
let n = RegExp(`.*${
|
|
857
|
+
let n = RegExp(`.*${He(t.suffix)}$`);
|
|
834
858
|
t.pattern ??= n, e._zod.onattach.push((e) => {
|
|
835
859
|
let t = e._zod.bag;
|
|
836
860
|
t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(n);
|
|
@@ -883,27 +907,27 @@ var Xt = (e) => {
|
|
|
883
907
|
});
|
|
884
908
|
else {
|
|
885
909
|
let t = (e, t, n) => {
|
|
886
|
-
let r =
|
|
910
|
+
let r = $e(e), i;
|
|
887
911
|
for (let a of t) {
|
|
888
912
|
if (a._zod.def.when) {
|
|
889
|
-
if (
|
|
913
|
+
if (et(e) || !a._zod.def.when(e)) continue;
|
|
890
914
|
} else if (r) continue;
|
|
891
915
|
let t = e.issues.length, o = a._zod.check(e);
|
|
892
|
-
if (o instanceof Promise && n?.async === !1) throw new
|
|
916
|
+
if (o instanceof Promise && n?.async === !1) throw new xe();
|
|
893
917
|
if (i || o instanceof Promise) i = (i ?? Promise.resolve()).then(async () => {
|
|
894
|
-
await o, e.issues.length !== t && (r ||=
|
|
918
|
+
await o, e.issues.length !== t && (r ||= $e(e, t));
|
|
895
919
|
});
|
|
896
920
|
else {
|
|
897
921
|
if (e.issues.length === t) continue;
|
|
898
|
-
r ||=
|
|
922
|
+
r ||= $e(e, t);
|
|
899
923
|
}
|
|
900
924
|
}
|
|
901
925
|
return i ? i.then(() => e) : e;
|
|
902
926
|
}, n = (n, i, a) => {
|
|
903
|
-
if (
|
|
927
|
+
if ($e(n)) return n.aborted = !0, n;
|
|
904
928
|
let o = t(i, r, a);
|
|
905
929
|
if (o instanceof Promise) {
|
|
906
|
-
if (a.async === !1) throw new
|
|
930
|
+
if (a.async === !1) throw new xe();
|
|
907
931
|
return o.then((t) => e._zod.parse(t, a));
|
|
908
932
|
}
|
|
909
933
|
return e._zod.parse(o, a);
|
|
@@ -922,7 +946,7 @@ var Xt = (e) => {
|
|
|
922
946
|
}
|
|
923
947
|
let o = e._zod.parse(i, a);
|
|
924
948
|
if (o instanceof Promise) {
|
|
925
|
-
if (a.async === !1) throw new
|
|
949
|
+
if (a.async === !1) throw new xe();
|
|
926
950
|
return o.then((e) => t(e, r, a));
|
|
927
951
|
}
|
|
928
952
|
return t(o, r, a);
|
|
@@ -1181,7 +1205,7 @@ var qn = /* @__PURE__ */ H("$ZodJWT", (e, t) => {
|
|
|
1181
1205
|
}), t);
|
|
1182
1206
|
});
|
|
1183
1207
|
function $n(e, t, n) {
|
|
1184
|
-
e.issues.length && t.issues.push(
|
|
1208
|
+
e.issues.length && t.issues.push(...tt(n, e.issues)), t.value[n] = e.value;
|
|
1185
1209
|
}
|
|
1186
1210
|
var er = /* @__PURE__ */ H("$ZodArray", (e, t) => {
|
|
1187
1211
|
K.init(e, t), e._zod.parse = (n, r) => {
|
|
@@ -1208,7 +1232,7 @@ function tr(e, t, n, r, i, a) {
|
|
|
1208
1232
|
let o = n in r;
|
|
1209
1233
|
if (e.issues.length) {
|
|
1210
1234
|
if (i && a && !o) return;
|
|
1211
|
-
t.issues.push(
|
|
1235
|
+
t.issues.push(...tt(n, e.issues));
|
|
1212
1236
|
}
|
|
1213
1237
|
if (!o && !i) {
|
|
1214
1238
|
e.issues.length || t.issues.push({
|
|
@@ -1224,7 +1248,7 @@ function tr(e, t, n, r, i, a) {
|
|
|
1224
1248
|
function nr(e) {
|
|
1225
1249
|
let t = Object.keys(e.shape);
|
|
1226
1250
|
for (let n of t) if (!e.shape?.[n]?._zod?.traits?.has("$ZodType")) throw Error(`Invalid element at key "${n}": expected a Zod schema`);
|
|
1227
|
-
let n =
|
|
1251
|
+
let n = We(e.shape);
|
|
1228
1252
|
return {
|
|
1229
1253
|
...e,
|
|
1230
1254
|
keys: t,
|
|
@@ -1262,7 +1286,7 @@ var ir = /* @__PURE__ */ H("$ZodObject", (e, t) => {
|
|
|
1262
1286
|
return Object.defineProperty(t, "shape", { value: n }), n;
|
|
1263
1287
|
} });
|
|
1264
1288
|
}
|
|
1265
|
-
let n =
|
|
1289
|
+
let n = De(() => nr(t));
|
|
1266
1290
|
U(e._zod, "propValues", () => {
|
|
1267
1291
|
let e = t.shape, n = {};
|
|
1268
1292
|
for (let t in e) {
|
|
@@ -1274,7 +1298,7 @@ var ir = /* @__PURE__ */ H("$ZodObject", (e, t) => {
|
|
|
1274
1298
|
}
|
|
1275
1299
|
return n;
|
|
1276
1300
|
});
|
|
1277
|
-
let r =
|
|
1301
|
+
let r = Le, i = t.catchall, a;
|
|
1278
1302
|
e._zod.parse = (t, o) => {
|
|
1279
1303
|
a ??= n.value;
|
|
1280
1304
|
let s = t.value;
|
|
@@ -1297,13 +1321,13 @@ var ir = /* @__PURE__ */ H("$ZodObject", (e, t) => {
|
|
|
1297
1321
|
};
|
|
1298
1322
|
}), ar = /* @__PURE__ */ H("$ZodObjectJIT", (e, t) => {
|
|
1299
1323
|
ir.init(e, t);
|
|
1300
|
-
let n = e._zod.parse, r =
|
|
1324
|
+
let n = e._zod.parse, r = De(() => nr(t)), i = (e) => {
|
|
1301
1325
|
let t = new yn([
|
|
1302
1326
|
"shape",
|
|
1303
1327
|
"payload",
|
|
1304
1328
|
"ctx"
|
|
1305
1329
|
]), n = r.value, i = (e) => {
|
|
1306
|
-
let t =
|
|
1330
|
+
let t = Pe(e);
|
|
1307
1331
|
return `shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`;
|
|
1308
1332
|
};
|
|
1309
1333
|
t.write("const input = payload.value;");
|
|
@@ -1311,7 +1335,7 @@ var ir = /* @__PURE__ */ H("$ZodObject", (e, t) => {
|
|
|
1311
1335
|
for (let e of n.keys) a[e] = `key_${o++}`;
|
|
1312
1336
|
t.write("const newResult = {};");
|
|
1313
1337
|
for (let r of n.keys) {
|
|
1314
|
-
let n = a[r], o =
|
|
1338
|
+
let n = a[r], o = Pe(r), s = e[r], c = s?._zod?.optin === "optional", l = s?._zod?.optout === "optional";
|
|
1315
1339
|
t.write(`const ${n} = ${i(r)};`), c && l ? t.write(`
|
|
1316
1340
|
if (${n}.issues.length) {
|
|
1317
1341
|
if (${o} in input) {
|
|
@@ -1376,7 +1400,7 @@ var ir = /* @__PURE__ */ H("$ZodObject", (e, t) => {
|
|
|
1376
1400
|
t.write("payload.value = newResult;"), t.write("return payload;");
|
|
1377
1401
|
let s = t.compile();
|
|
1378
1402
|
return (t, n) => s(e, t, n);
|
|
1379
|
-
}, a, o =
|
|
1403
|
+
}, a, o = Le, s = !Ce.jitless, c = s && Re.value, l = t.catchall, u;
|
|
1380
1404
|
e._zod.parse = (d, f) => {
|
|
1381
1405
|
u ??= r.value;
|
|
1382
1406
|
let p = d.value;
|
|
@@ -1390,12 +1414,12 @@ var ir = /* @__PURE__ */ H("$ZodObject", (e, t) => {
|
|
|
1390
1414
|
});
|
|
1391
1415
|
function or(e, t, n, r) {
|
|
1392
1416
|
for (let n of e) if (n.issues.length === 0) return t.value = n.value, t;
|
|
1393
|
-
let i = e.filter((e) =>
|
|
1417
|
+
let i = e.filter((e) => !$e(e));
|
|
1394
1418
|
return i.length === 1 ? (t.value = i[0].value, i[0]) : (t.issues.push({
|
|
1395
1419
|
code: "invalid_union",
|
|
1396
1420
|
input: t.value,
|
|
1397
1421
|
inst: n,
|
|
1398
|
-
errors: e.map((e) => e.issues.map((e) =>
|
|
1422
|
+
errors: e.map((e) => e.issues.map((e) => rt(e, r, we())))
|
|
1399
1423
|
}), t);
|
|
1400
1424
|
}
|
|
1401
1425
|
var sr = /* @__PURE__ */ H("$ZodUnion", (e, t) => {
|
|
@@ -1404,7 +1428,7 @@ var sr = /* @__PURE__ */ H("$ZodUnion", (e, t) => {
|
|
|
1404
1428
|
}), U(e._zod, "pattern", () => {
|
|
1405
1429
|
if (t.options.every((e) => e._zod.pattern)) {
|
|
1406
1430
|
let e = t.options.map((e) => e._zod.pattern);
|
|
1407
|
-
return RegExp(`^(${e.map((e) =>
|
|
1431
|
+
return RegExp(`^(${e.map((e) => ke(e.source)).join("|")})$`);
|
|
1408
1432
|
}
|
|
1409
1433
|
});
|
|
1410
1434
|
let n = t.options.length === 1 ? t.options[0]._zod.run : null;
|
|
@@ -1441,7 +1465,7 @@ function lr(e, t) {
|
|
|
1441
1465
|
valid: !0,
|
|
1442
1466
|
data: e
|
|
1443
1467
|
};
|
|
1444
|
-
if (
|
|
1468
|
+
if (ze(e) && ze(t)) {
|
|
1445
1469
|
let n = Object.keys(t), r = Object.keys(e).filter((e) => n.indexOf(e) !== -1), i = {
|
|
1446
1470
|
...e,
|
|
1447
1471
|
...t
|
|
@@ -1495,92 +1519,15 @@ function ur(e, t, n) {
|
|
|
1495
1519
|
if (a.length && i && e.issues.push({
|
|
1496
1520
|
...i,
|
|
1497
1521
|
keys: a
|
|
1498
|
-
}),
|
|
1522
|
+
}), $e(e)) return e;
|
|
1499
1523
|
let o = lr(t.value, n.value);
|
|
1500
1524
|
if (!o.valid) throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);
|
|
1501
1525
|
return e.value = o.data, e;
|
|
1502
1526
|
}
|
|
1503
|
-
var dr = /* @__PURE__ */ H("$
|
|
1504
|
-
K.init(e, t);
|
|
1505
|
-
let n = t.items;
|
|
1506
|
-
e._zod.parse = (r, i) => {
|
|
1507
|
-
let a = r.value;
|
|
1508
|
-
if (!Array.isArray(a)) return r.issues.push({
|
|
1509
|
-
input: a,
|
|
1510
|
-
inst: e,
|
|
1511
|
-
expected: "tuple",
|
|
1512
|
-
code: "invalid_type"
|
|
1513
|
-
}), r;
|
|
1514
|
-
r.value = [];
|
|
1515
|
-
let o = [], s = fr(n, "optin"), c = fr(n, "optout");
|
|
1516
|
-
if (!t.rest) {
|
|
1517
|
-
if (a.length < s) return r.issues.push({
|
|
1518
|
-
code: "too_small",
|
|
1519
|
-
minimum: s,
|
|
1520
|
-
inclusive: !0,
|
|
1521
|
-
input: a,
|
|
1522
|
-
inst: e,
|
|
1523
|
-
origin: "array"
|
|
1524
|
-
}), r;
|
|
1525
|
-
a.length > n.length && r.issues.push({
|
|
1526
|
-
code: "too_big",
|
|
1527
|
-
maximum: n.length,
|
|
1528
|
-
inclusive: !0,
|
|
1529
|
-
input: a,
|
|
1530
|
-
inst: e,
|
|
1531
|
-
origin: "array"
|
|
1532
|
-
});
|
|
1533
|
-
}
|
|
1534
|
-
let l = Array(n.length);
|
|
1535
|
-
for (let e = 0; e < n.length; e++) {
|
|
1536
|
-
let t = n[e]._zod.run({
|
|
1537
|
-
value: a[e],
|
|
1538
|
-
issues: []
|
|
1539
|
-
}, i);
|
|
1540
|
-
t instanceof Promise ? o.push(t.then((t) => {
|
|
1541
|
-
l[e] = t;
|
|
1542
|
-
})) : l[e] = t;
|
|
1543
|
-
}
|
|
1544
|
-
if (t.rest) {
|
|
1545
|
-
let e = n.length - 1, s = a.slice(n.length);
|
|
1546
|
-
for (let n of s) {
|
|
1547
|
-
e++;
|
|
1548
|
-
let a = t.rest._zod.run({
|
|
1549
|
-
value: n,
|
|
1550
|
-
issues: []
|
|
1551
|
-
}, i);
|
|
1552
|
-
a instanceof Promise ? o.push(a.then((t) => pr(t, r, e))) : pr(a, r, e);
|
|
1553
|
-
}
|
|
1554
|
-
}
|
|
1555
|
-
return o.length ? Promise.all(o).then(() => mr(l, r, n, a, c)) : mr(l, r, n, a, c);
|
|
1556
|
-
};
|
|
1557
|
-
});
|
|
1558
|
-
function fr(e, t) {
|
|
1559
|
-
for (let n = e.length - 1; n >= 0; n--) if (e[n]._zod[t] !== "optional") return n + 1;
|
|
1560
|
-
return 0;
|
|
1561
|
-
}
|
|
1562
|
-
function pr(e, t, n) {
|
|
1563
|
-
e.issues.length && t.issues.push(...$e(n, e.issues)), t.value[n] = e.value;
|
|
1564
|
-
}
|
|
1565
|
-
function mr(e, t, n, r, i) {
|
|
1566
|
-
for (let a = 0; a < n.length; a++) {
|
|
1567
|
-
let n = e[a], o = a < r.length;
|
|
1568
|
-
if (n.issues.length) {
|
|
1569
|
-
if (!o && a >= i) {
|
|
1570
|
-
t.value.length = a;
|
|
1571
|
-
break;
|
|
1572
|
-
}
|
|
1573
|
-
t.issues.push(...$e(a, n.issues));
|
|
1574
|
-
}
|
|
1575
|
-
t.value[a] = n.value;
|
|
1576
|
-
}
|
|
1577
|
-
for (let e = t.value.length - 1; e >= r.length && n[e]._zod.optout === "optional" && t.value[e] === void 0; e--) t.value.length = e;
|
|
1578
|
-
return t;
|
|
1579
|
-
}
|
|
1580
|
-
var hr = /* @__PURE__ */ H("$ZodRecord", (e, t) => {
|
|
1527
|
+
var dr = /* @__PURE__ */ H("$ZodRecord", (e, t) => {
|
|
1581
1528
|
K.init(e, t), e._zod.parse = (n, r) => {
|
|
1582
1529
|
let i = n.value;
|
|
1583
|
-
if (!
|
|
1530
|
+
if (!ze(i)) return n.issues.push({
|
|
1584
1531
|
expected: "record",
|
|
1585
1532
|
code: "invalid_type",
|
|
1586
1533
|
input: i,
|
|
@@ -1601,7 +1548,7 @@ var hr = /* @__PURE__ */ H("$ZodRecord", (e, t) => {
|
|
|
1601
1548
|
n.issues.push({
|
|
1602
1549
|
code: "invalid_key",
|
|
1603
1550
|
origin: "record",
|
|
1604
|
-
issues: o.issues.map((e) =>
|
|
1551
|
+
issues: o.issues.map((e) => rt(e, r, we())),
|
|
1605
1552
|
input: c,
|
|
1606
1553
|
path: [c],
|
|
1607
1554
|
inst: e
|
|
@@ -1613,8 +1560,8 @@ var hr = /* @__PURE__ */ H("$ZodRecord", (e, t) => {
|
|
|
1613
1560
|
issues: []
|
|
1614
1561
|
}, r);
|
|
1615
1562
|
u instanceof Promise ? a.push(u.then((e) => {
|
|
1616
|
-
e.issues.length && n.issues.push(
|
|
1617
|
-
})) : (u.issues.length && n.issues.push(
|
|
1563
|
+
e.issues.length && n.issues.push(...tt(c, e.issues)), n.value[l] = e.value;
|
|
1564
|
+
})) : (u.issues.length && n.issues.push(...tt(c, u.issues)), n.value[l] = u.value);
|
|
1618
1565
|
}
|
|
1619
1566
|
let c;
|
|
1620
1567
|
for (let e in i) s.has(e) || (c ??= [], c.push(e));
|
|
@@ -1645,7 +1592,7 @@ var hr = /* @__PURE__ */ H("$ZodRecord", (e, t) => {
|
|
|
1645
1592
|
t.mode === "loose" ? n.value[o] = i[o] : n.issues.push({
|
|
1646
1593
|
code: "invalid_key",
|
|
1647
1594
|
origin: "record",
|
|
1648
|
-
issues: s.issues.map((e) =>
|
|
1595
|
+
issues: s.issues.map((e) => rt(e, r, we())),
|
|
1649
1596
|
input: o,
|
|
1650
1597
|
path: [o],
|
|
1651
1598
|
inst: e
|
|
@@ -1657,16 +1604,16 @@ var hr = /* @__PURE__ */ H("$ZodRecord", (e, t) => {
|
|
|
1657
1604
|
issues: []
|
|
1658
1605
|
}, r);
|
|
1659
1606
|
c instanceof Promise ? a.push(c.then((e) => {
|
|
1660
|
-
e.issues.length && n.issues.push(
|
|
1661
|
-
})) : (c.issues.length && n.issues.push(
|
|
1607
|
+
e.issues.length && n.issues.push(...tt(o, e.issues)), n.value[s.value] = e.value;
|
|
1608
|
+
})) : (c.issues.length && n.issues.push(...tt(o, c.issues)), n.value[s.value] = c.value);
|
|
1662
1609
|
}
|
|
1663
1610
|
}
|
|
1664
1611
|
return a.length ? Promise.all(a).then(() => n) : n;
|
|
1665
1612
|
};
|
|
1666
|
-
}),
|
|
1613
|
+
}), fr = /* @__PURE__ */ H("$ZodEnum", (e, t) => {
|
|
1667
1614
|
K.init(e, t);
|
|
1668
|
-
let n =
|
|
1669
|
-
e._zod.values = r, e._zod.pattern = RegExp(`^(${n.filter((e) =>
|
|
1615
|
+
let n = Te(t.entries), r = new Set(n);
|
|
1616
|
+
e._zod.values = r, e._zod.pattern = RegExp(`^(${n.filter((e) => Ve.has(typeof e)).map((e) => typeof e == "string" ? He(e) : e.toString()).join("|")})$`), e._zod.parse = (t, i) => {
|
|
1670
1617
|
let a = t.value;
|
|
1671
1618
|
return r.has(a) || t.issues.push({
|
|
1672
1619
|
code: "invalid_value",
|
|
@@ -1675,62 +1622,62 @@ var hr = /* @__PURE__ */ H("$ZodRecord", (e, t) => {
|
|
|
1675
1622
|
inst: e
|
|
1676
1623
|
}), t;
|
|
1677
1624
|
};
|
|
1678
|
-
}),
|
|
1625
|
+
}), pr = /* @__PURE__ */ H("$ZodTransform", (e, t) => {
|
|
1679
1626
|
K.init(e, t), e._zod.optin = "optional", e._zod.parse = (n, r) => {
|
|
1680
|
-
if (r.direction === "backward") throw new
|
|
1627
|
+
if (r.direction === "backward") throw new Se(e.constructor.name);
|
|
1681
1628
|
let i = t.transform(n.value, n);
|
|
1682
1629
|
if (r.async) return (i instanceof Promise ? i : Promise.resolve(i)).then((e) => (n.value = e, n.fallback = !0, n));
|
|
1683
|
-
if (i instanceof Promise) throw new
|
|
1630
|
+
if (i instanceof Promise) throw new xe();
|
|
1684
1631
|
return n.value = i, n.fallback = !0, n;
|
|
1685
1632
|
};
|
|
1686
1633
|
});
|
|
1687
|
-
function
|
|
1634
|
+
function mr(e, t) {
|
|
1688
1635
|
return t === void 0 && (e.issues.length || e.fallback) ? {
|
|
1689
1636
|
issues: [],
|
|
1690
1637
|
value: void 0
|
|
1691
1638
|
} : e;
|
|
1692
1639
|
}
|
|
1693
|
-
var
|
|
1640
|
+
var hr = /* @__PURE__ */ H("$ZodOptional", (e, t) => {
|
|
1694
1641
|
K.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", U(e._zod, "values", () => t.innerType._zod.values ? new Set([...t.innerType._zod.values, void 0]) : void 0), U(e._zod, "pattern", () => {
|
|
1695
1642
|
let e = t.innerType._zod.pattern;
|
|
1696
|
-
return e ? RegExp(`^(${
|
|
1643
|
+
return e ? RegExp(`^(${ke(e.source)})?$`) : void 0;
|
|
1697
1644
|
}), e._zod.parse = (e, n) => {
|
|
1698
1645
|
if (t.innerType._zod.optin === "optional") {
|
|
1699
1646
|
let r = e.value, i = t.innerType._zod.run(e, n);
|
|
1700
|
-
return i instanceof Promise ? i.then((e) =>
|
|
1647
|
+
return i instanceof Promise ? i.then((e) => mr(e, r)) : mr(i, r);
|
|
1701
1648
|
}
|
|
1702
1649
|
return e.value === void 0 ? e : t.innerType._zod.run(e, n);
|
|
1703
1650
|
};
|
|
1704
|
-
}),
|
|
1705
|
-
|
|
1706
|
-
}),
|
|
1651
|
+
}), gr = /* @__PURE__ */ H("$ZodExactOptional", (e, t) => {
|
|
1652
|
+
hr.init(e, t), U(e._zod, "values", () => t.innerType._zod.values), U(e._zod, "pattern", () => t.innerType._zod.pattern), e._zod.parse = (e, n) => t.innerType._zod.run(e, n);
|
|
1653
|
+
}), _r = /* @__PURE__ */ H("$ZodNullable", (e, t) => {
|
|
1707
1654
|
K.init(e, t), U(e._zod, "optin", () => t.innerType._zod.optin), U(e._zod, "optout", () => t.innerType._zod.optout), U(e._zod, "pattern", () => {
|
|
1708
1655
|
let e = t.innerType._zod.pattern;
|
|
1709
|
-
return e ? RegExp(`^(${
|
|
1656
|
+
return e ? RegExp(`^(${ke(e.source)}|null)$`) : void 0;
|
|
1710
1657
|
}), U(e._zod, "values", () => t.innerType._zod.values ? new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (e, n) => e.value === null ? e : t.innerType._zod.run(e, n);
|
|
1711
|
-
}),
|
|
1658
|
+
}), vr = /* @__PURE__ */ H("$ZodDefault", (e, t) => {
|
|
1712
1659
|
K.init(e, t), e._zod.optin = "optional", U(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (e, n) => {
|
|
1713
1660
|
if (n.direction === "backward") return t.innerType._zod.run(e, n);
|
|
1714
1661
|
if (e.value === void 0) return e.value = t.defaultValue, e;
|
|
1715
1662
|
let r = t.innerType._zod.run(e, n);
|
|
1716
|
-
return r instanceof Promise ? r.then((e) =>
|
|
1663
|
+
return r instanceof Promise ? r.then((e) => yr(e, t)) : yr(r, t);
|
|
1717
1664
|
};
|
|
1718
1665
|
});
|
|
1719
|
-
function
|
|
1666
|
+
function yr(e, t) {
|
|
1720
1667
|
return e.value === void 0 && (e.value = t.defaultValue), e;
|
|
1721
1668
|
}
|
|
1722
|
-
var
|
|
1669
|
+
var br = /* @__PURE__ */ H("$ZodPrefault", (e, t) => {
|
|
1723
1670
|
K.init(e, t), e._zod.optin = "optional", U(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (e, n) => (n.direction === "backward" || e.value === void 0 && (e.value = t.defaultValue), t.innerType._zod.run(e, n));
|
|
1724
|
-
}),
|
|
1671
|
+
}), xr = /* @__PURE__ */ H("$ZodNonOptional", (e, t) => {
|
|
1725
1672
|
K.init(e, t), U(e._zod, "values", () => {
|
|
1726
1673
|
let e = t.innerType._zod.values;
|
|
1727
1674
|
return e ? new Set([...e].filter((e) => e !== void 0)) : void 0;
|
|
1728
1675
|
}), e._zod.parse = (n, r) => {
|
|
1729
1676
|
let i = t.innerType._zod.run(n, r);
|
|
1730
|
-
return i instanceof Promise ? i.then((t) =>
|
|
1677
|
+
return i instanceof Promise ? i.then((t) => Sr(t, e)) : Sr(i, e);
|
|
1731
1678
|
};
|
|
1732
1679
|
});
|
|
1733
|
-
function
|
|
1680
|
+
function Sr(e, t) {
|
|
1734
1681
|
return !e.issues.length && e.value === void 0 && e.issues.push({
|
|
1735
1682
|
code: "invalid_type",
|
|
1736
1683
|
expected: "nonoptional",
|
|
@@ -1738,94 +1685,55 @@ function Er(e, t) {
|
|
|
1738
1685
|
inst: t
|
|
1739
1686
|
}), e;
|
|
1740
1687
|
}
|
|
1741
|
-
var
|
|
1688
|
+
var Cr = /* @__PURE__ */ H("$ZodCatch", (e, t) => {
|
|
1742
1689
|
K.init(e, t), e._zod.optin = "optional", U(e._zod, "optout", () => t.innerType._zod.optout), U(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (e, n) => {
|
|
1743
1690
|
if (n.direction === "backward") return t.innerType._zod.run(e, n);
|
|
1744
1691
|
let r = t.innerType._zod.run(e, n);
|
|
1745
1692
|
return r instanceof Promise ? r.then((r) => (e.value = r.value, r.issues.length && (e.value = t.catchValue({
|
|
1746
1693
|
...e,
|
|
1747
|
-
error: { issues: r.issues.map((e) =>
|
|
1694
|
+
error: { issues: r.issues.map((e) => rt(e, n, we())) },
|
|
1748
1695
|
input: e.value
|
|
1749
1696
|
}), e.issues = [], e.fallback = !0), e)) : (e.value = r.value, r.issues.length && (e.value = t.catchValue({
|
|
1750
1697
|
...e,
|
|
1751
|
-
error: { issues: r.issues.map((e) =>
|
|
1698
|
+
error: { issues: r.issues.map((e) => rt(e, n, we())) },
|
|
1752
1699
|
input: e.value
|
|
1753
1700
|
}), e.issues = [], e.fallback = !0), e);
|
|
1754
1701
|
};
|
|
1755
|
-
}),
|
|
1702
|
+
}), wr = /* @__PURE__ */ H("$ZodPipe", (e, t) => {
|
|
1756
1703
|
K.init(e, t), U(e._zod, "values", () => t.in._zod.values), U(e._zod, "optin", () => t.in._zod.optin), U(e._zod, "optout", () => t.out._zod.optout), U(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (e, n) => {
|
|
1757
1704
|
if (n.direction === "backward") {
|
|
1758
1705
|
let r = t.out._zod.run(e, n);
|
|
1759
|
-
return r instanceof Promise ? r.then((e) =>
|
|
1706
|
+
return r instanceof Promise ? r.then((e) => Tr(e, t.in, n)) : Tr(r, t.in, n);
|
|
1760
1707
|
}
|
|
1761
1708
|
let r = t.in._zod.run(e, n);
|
|
1762
|
-
return r instanceof Promise ? r.then((e) =>
|
|
1709
|
+
return r instanceof Promise ? r.then((e) => Tr(e, t.out, n)) : Tr(r, t.out, n);
|
|
1763
1710
|
};
|
|
1764
1711
|
});
|
|
1765
|
-
function
|
|
1712
|
+
function Tr(e, t, n) {
|
|
1766
1713
|
return e.issues.length ? (e.aborted = !0, e) : t._zod.run({
|
|
1767
1714
|
value: e.value,
|
|
1768
1715
|
issues: e.issues,
|
|
1769
1716
|
fallback: e.fallback
|
|
1770
1717
|
}, n);
|
|
1771
1718
|
}
|
|
1772
|
-
var
|
|
1719
|
+
var Er = /* @__PURE__ */ H("$ZodReadonly", (e, t) => {
|
|
1773
1720
|
K.init(e, t), U(e._zod, "propValues", () => t.innerType._zod.propValues), U(e._zod, "values", () => t.innerType._zod.values), U(e._zod, "optin", () => t.innerType?._zod?.optin), U(e._zod, "optout", () => t.innerType?._zod?.optout), e._zod.parse = (e, n) => {
|
|
1774
1721
|
if (n.direction === "backward") return t.innerType._zod.run(e, n);
|
|
1775
1722
|
let r = t.innerType._zod.run(e, n);
|
|
1776
|
-
return r instanceof Promise ? r.then(
|
|
1723
|
+
return r instanceof Promise ? r.then(Dr) : Dr(r);
|
|
1777
1724
|
};
|
|
1778
1725
|
});
|
|
1779
|
-
function
|
|
1726
|
+
function Dr(e) {
|
|
1780
1727
|
return e.value = Object.freeze(e.value), e;
|
|
1781
1728
|
}
|
|
1782
|
-
var
|
|
1783
|
-
if (typeof t != "function") throw Error("implement() must be called with a function");
|
|
1784
|
-
return function(...n) {
|
|
1785
|
-
let r = e._def.input ? ut(e._def.input, n) : n, i = Reflect.apply(t, this, r);
|
|
1786
|
-
return e._def.output ? ut(e._def.output, i) : i;
|
|
1787
|
-
};
|
|
1788
|
-
}, e.implementAsync = (t) => {
|
|
1789
|
-
if (typeof t != "function") throw Error("implementAsync() must be called with a function");
|
|
1790
|
-
return async function(...n) {
|
|
1791
|
-
let r = e._def.input ? await ft(e._def.input, n) : n, i = await Reflect.apply(t, this, r);
|
|
1792
|
-
return e._def.output ? await ft(e._def.output, i) : i;
|
|
1793
|
-
};
|
|
1794
|
-
}, e._zod.parse = (t, n) => typeof t.value == "function" ? (e._def.output && e._def.output._zod.def.type === "promise" ? t.value = e.implementAsync(t.value) : t.value = e.implement(t.value), t) : (t.issues.push({
|
|
1795
|
-
code: "invalid_type",
|
|
1796
|
-
expected: "function",
|
|
1797
|
-
input: t.value,
|
|
1798
|
-
inst: e
|
|
1799
|
-
}), t), e.input = (...t) => {
|
|
1800
|
-
let n = e.constructor;
|
|
1801
|
-
return Array.isArray(t[0]) ? new n({
|
|
1802
|
-
type: "function",
|
|
1803
|
-
input: new dr({
|
|
1804
|
-
type: "tuple",
|
|
1805
|
-
items: t[0],
|
|
1806
|
-
rest: t[1]
|
|
1807
|
-
}),
|
|
1808
|
-
output: e._def.output
|
|
1809
|
-
}) : new n({
|
|
1810
|
-
type: "function",
|
|
1811
|
-
input: t[0],
|
|
1812
|
-
output: e._def.output
|
|
1813
|
-
});
|
|
1814
|
-
}, e.output = (t) => {
|
|
1815
|
-
let n = e.constructor;
|
|
1816
|
-
return new n({
|
|
1817
|
-
type: "function",
|
|
1818
|
-
input: e._def.input,
|
|
1819
|
-
output: t
|
|
1820
|
-
});
|
|
1821
|
-
}, e)), Nr = /* @__PURE__ */ H("$ZodCustom", (e, t) => {
|
|
1729
|
+
var Or = /* @__PURE__ */ H("$ZodCustom", (e, t) => {
|
|
1822
1730
|
G.init(e, t), K.init(e, t), e._zod.parse = (e, t) => e, e._zod.check = (n) => {
|
|
1823
1731
|
let r = n.value, i = t.fn(r);
|
|
1824
|
-
if (i instanceof Promise) return i.then((t) =>
|
|
1825
|
-
|
|
1732
|
+
if (i instanceof Promise) return i.then((t) => kr(t, n, r, e));
|
|
1733
|
+
kr(i, n, r, e);
|
|
1826
1734
|
};
|
|
1827
1735
|
});
|
|
1828
|
-
function
|
|
1736
|
+
function kr(e, t, n, r) {
|
|
1829
1737
|
if (!e) {
|
|
1830
1738
|
let e = {
|
|
1831
1739
|
code: "custom",
|
|
@@ -1834,12 +1742,12 @@ function Pr(e, t, n, r) {
|
|
|
1834
1742
|
path: [...r._zod.def.path ?? []],
|
|
1835
1743
|
continue: !r._zod.def.abort
|
|
1836
1744
|
};
|
|
1837
|
-
r._zod.def.params && (e.params = r._zod.def.params), t.issues.push(
|
|
1745
|
+
r._zod.def.params && (e.params = r._zod.def.params), t.issues.push(at(e));
|
|
1838
1746
|
}
|
|
1839
1747
|
}
|
|
1840
1748
|
//#endregion
|
|
1841
1749
|
//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/registries.js
|
|
1842
|
-
var
|
|
1750
|
+
var Ar, jr = class {
|
|
1843
1751
|
constructor() {
|
|
1844
1752
|
this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
|
|
1845
1753
|
}
|
|
@@ -1871,22 +1779,22 @@ var Fr, Ir = class {
|
|
|
1871
1779
|
return this._map.has(e);
|
|
1872
1780
|
}
|
|
1873
1781
|
};
|
|
1874
|
-
function
|
|
1875
|
-
return new
|
|
1782
|
+
function Mr() {
|
|
1783
|
+
return new jr();
|
|
1876
1784
|
}
|
|
1877
|
-
(
|
|
1878
|
-
var
|
|
1785
|
+
(Ar = globalThis).__zod_globalRegistry ?? (Ar.__zod_globalRegistry = Mr());
|
|
1786
|
+
var Nr = globalThis.__zod_globalRegistry;
|
|
1879
1787
|
//#endregion
|
|
1880
1788
|
//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/api.js
|
|
1881
1789
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1882
|
-
function
|
|
1790
|
+
function Pr(e, t) {
|
|
1883
1791
|
return new e({
|
|
1884
1792
|
type: "string",
|
|
1885
1793
|
...W(t)
|
|
1886
1794
|
});
|
|
1887
1795
|
}
|
|
1888
1796
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1889
|
-
function
|
|
1797
|
+
function Fr(e, t) {
|
|
1890
1798
|
return new e({
|
|
1891
1799
|
type: "string",
|
|
1892
1800
|
format: "email",
|
|
@@ -1896,7 +1804,7 @@ function Br(e, t) {
|
|
|
1896
1804
|
});
|
|
1897
1805
|
}
|
|
1898
1806
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1899
|
-
function
|
|
1807
|
+
function Ir(e, t) {
|
|
1900
1808
|
return new e({
|
|
1901
1809
|
type: "string",
|
|
1902
1810
|
format: "guid",
|
|
@@ -1906,7 +1814,7 @@ function Vr(e, t) {
|
|
|
1906
1814
|
});
|
|
1907
1815
|
}
|
|
1908
1816
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1909
|
-
function
|
|
1817
|
+
function Lr(e, t) {
|
|
1910
1818
|
return new e({
|
|
1911
1819
|
type: "string",
|
|
1912
1820
|
format: "uuid",
|
|
@@ -1916,7 +1824,7 @@ function Hr(e, t) {
|
|
|
1916
1824
|
});
|
|
1917
1825
|
}
|
|
1918
1826
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1919
|
-
function
|
|
1827
|
+
function Rr(e, t) {
|
|
1920
1828
|
return new e({
|
|
1921
1829
|
type: "string",
|
|
1922
1830
|
format: "uuid",
|
|
@@ -1927,7 +1835,7 @@ function Ur(e, t) {
|
|
|
1927
1835
|
});
|
|
1928
1836
|
}
|
|
1929
1837
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1930
|
-
function
|
|
1838
|
+
function zr(e, t) {
|
|
1931
1839
|
return new e({
|
|
1932
1840
|
type: "string",
|
|
1933
1841
|
format: "uuid",
|
|
@@ -1938,7 +1846,7 @@ function Wr(e, t) {
|
|
|
1938
1846
|
});
|
|
1939
1847
|
}
|
|
1940
1848
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1941
|
-
function
|
|
1849
|
+
function Br(e, t) {
|
|
1942
1850
|
return new e({
|
|
1943
1851
|
type: "string",
|
|
1944
1852
|
format: "uuid",
|
|
@@ -1949,7 +1857,7 @@ function Gr(e, t) {
|
|
|
1949
1857
|
});
|
|
1950
1858
|
}
|
|
1951
1859
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1952
|
-
function
|
|
1860
|
+
function Vr(e, t) {
|
|
1953
1861
|
return new e({
|
|
1954
1862
|
type: "string",
|
|
1955
1863
|
format: "url",
|
|
@@ -1959,7 +1867,7 @@ function Kr(e, t) {
|
|
|
1959
1867
|
});
|
|
1960
1868
|
}
|
|
1961
1869
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1962
|
-
function
|
|
1870
|
+
function Hr(e, t) {
|
|
1963
1871
|
return new e({
|
|
1964
1872
|
type: "string",
|
|
1965
1873
|
format: "emoji",
|
|
@@ -1969,7 +1877,7 @@ function qr(e, t) {
|
|
|
1969
1877
|
});
|
|
1970
1878
|
}
|
|
1971
1879
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1972
|
-
function
|
|
1880
|
+
function Ur(e, t) {
|
|
1973
1881
|
return new e({
|
|
1974
1882
|
type: "string",
|
|
1975
1883
|
format: "nanoid",
|
|
@@ -1979,7 +1887,7 @@ function Jr(e, t) {
|
|
|
1979
1887
|
});
|
|
1980
1888
|
}
|
|
1981
1889
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1982
|
-
function
|
|
1890
|
+
function Wr(e, t) {
|
|
1983
1891
|
return new e({
|
|
1984
1892
|
type: "string",
|
|
1985
1893
|
format: "cuid",
|
|
@@ -1989,7 +1897,7 @@ function Yr(e, t) {
|
|
|
1989
1897
|
});
|
|
1990
1898
|
}
|
|
1991
1899
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1992
|
-
function
|
|
1900
|
+
function Gr(e, t) {
|
|
1993
1901
|
return new e({
|
|
1994
1902
|
type: "string",
|
|
1995
1903
|
format: "cuid2",
|
|
@@ -1999,7 +1907,7 @@ function Xr(e, t) {
|
|
|
1999
1907
|
});
|
|
2000
1908
|
}
|
|
2001
1909
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2002
|
-
function
|
|
1910
|
+
function Kr(e, t) {
|
|
2003
1911
|
return new e({
|
|
2004
1912
|
type: "string",
|
|
2005
1913
|
format: "ulid",
|
|
@@ -2009,7 +1917,7 @@ function Zr(e, t) {
|
|
|
2009
1917
|
});
|
|
2010
1918
|
}
|
|
2011
1919
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2012
|
-
function
|
|
1920
|
+
function qr(e, t) {
|
|
2013
1921
|
return new e({
|
|
2014
1922
|
type: "string",
|
|
2015
1923
|
format: "xid",
|
|
@@ -2019,7 +1927,7 @@ function Qr(e, t) {
|
|
|
2019
1927
|
});
|
|
2020
1928
|
}
|
|
2021
1929
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2022
|
-
function
|
|
1930
|
+
function Jr(e, t) {
|
|
2023
1931
|
return new e({
|
|
2024
1932
|
type: "string",
|
|
2025
1933
|
format: "ksuid",
|
|
@@ -2029,7 +1937,7 @@ function $r(e, t) {
|
|
|
2029
1937
|
});
|
|
2030
1938
|
}
|
|
2031
1939
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2032
|
-
function
|
|
1940
|
+
function Yr(e, t) {
|
|
2033
1941
|
return new e({
|
|
2034
1942
|
type: "string",
|
|
2035
1943
|
format: "ipv4",
|
|
@@ -2039,7 +1947,7 @@ function ei(e, t) {
|
|
|
2039
1947
|
});
|
|
2040
1948
|
}
|
|
2041
1949
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2042
|
-
function
|
|
1950
|
+
function Xr(e, t) {
|
|
2043
1951
|
return new e({
|
|
2044
1952
|
type: "string",
|
|
2045
1953
|
format: "ipv6",
|
|
@@ -2049,7 +1957,7 @@ function ti(e, t) {
|
|
|
2049
1957
|
});
|
|
2050
1958
|
}
|
|
2051
1959
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2052
|
-
function
|
|
1960
|
+
function Zr(e, t) {
|
|
2053
1961
|
return new e({
|
|
2054
1962
|
type: "string",
|
|
2055
1963
|
format: "cidrv4",
|
|
@@ -2059,7 +1967,7 @@ function ni(e, t) {
|
|
|
2059
1967
|
});
|
|
2060
1968
|
}
|
|
2061
1969
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2062
|
-
function
|
|
1970
|
+
function Qr(e, t) {
|
|
2063
1971
|
return new e({
|
|
2064
1972
|
type: "string",
|
|
2065
1973
|
format: "cidrv6",
|
|
@@ -2069,7 +1977,7 @@ function ri(e, t) {
|
|
|
2069
1977
|
});
|
|
2070
1978
|
}
|
|
2071
1979
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2072
|
-
function
|
|
1980
|
+
function $r(e, t) {
|
|
2073
1981
|
return new e({
|
|
2074
1982
|
type: "string",
|
|
2075
1983
|
format: "base64",
|
|
@@ -2079,7 +1987,7 @@ function ii(e, t) {
|
|
|
2079
1987
|
});
|
|
2080
1988
|
}
|
|
2081
1989
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2082
|
-
function
|
|
1990
|
+
function ei(e, t) {
|
|
2083
1991
|
return new e({
|
|
2084
1992
|
type: "string",
|
|
2085
1993
|
format: "base64url",
|
|
@@ -2089,7 +1997,7 @@ function ai(e, t) {
|
|
|
2089
1997
|
});
|
|
2090
1998
|
}
|
|
2091
1999
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2092
|
-
function
|
|
2000
|
+
function ti(e, t) {
|
|
2093
2001
|
return new e({
|
|
2094
2002
|
type: "string",
|
|
2095
2003
|
format: "e164",
|
|
@@ -2099,7 +2007,7 @@ function oi(e, t) {
|
|
|
2099
2007
|
});
|
|
2100
2008
|
}
|
|
2101
2009
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2102
|
-
function
|
|
2010
|
+
function ni(e, t) {
|
|
2103
2011
|
return new e({
|
|
2104
2012
|
type: "string",
|
|
2105
2013
|
format: "jwt",
|
|
@@ -2109,7 +2017,7 @@ function si(e, t) {
|
|
|
2109
2017
|
});
|
|
2110
2018
|
}
|
|
2111
2019
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2112
|
-
function
|
|
2020
|
+
function ri(e, t) {
|
|
2113
2021
|
return new e({
|
|
2114
2022
|
type: "string",
|
|
2115
2023
|
format: "datetime",
|
|
@@ -2121,7 +2029,7 @@ function ci(e, t) {
|
|
|
2121
2029
|
});
|
|
2122
2030
|
}
|
|
2123
2031
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2124
|
-
function
|
|
2032
|
+
function ii(e, t) {
|
|
2125
2033
|
return new e({
|
|
2126
2034
|
type: "string",
|
|
2127
2035
|
format: "date",
|
|
@@ -2130,7 +2038,7 @@ function li(e, t) {
|
|
|
2130
2038
|
});
|
|
2131
2039
|
}
|
|
2132
2040
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2133
|
-
function
|
|
2041
|
+
function ai(e, t) {
|
|
2134
2042
|
return new e({
|
|
2135
2043
|
type: "string",
|
|
2136
2044
|
format: "time",
|
|
@@ -2140,7 +2048,7 @@ function ui(e, t) {
|
|
|
2140
2048
|
});
|
|
2141
2049
|
}
|
|
2142
2050
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2143
|
-
function
|
|
2051
|
+
function oi(e, t) {
|
|
2144
2052
|
return new e({
|
|
2145
2053
|
type: "string",
|
|
2146
2054
|
format: "duration",
|
|
@@ -2149,7 +2057,7 @@ function di(e, t) {
|
|
|
2149
2057
|
});
|
|
2150
2058
|
}
|
|
2151
2059
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2152
|
-
function
|
|
2060
|
+
function si(e, t) {
|
|
2153
2061
|
return new e({
|
|
2154
2062
|
type: "number",
|
|
2155
2063
|
checks: [],
|
|
@@ -2157,7 +2065,7 @@ function fi(e, t) {
|
|
|
2157
2065
|
});
|
|
2158
2066
|
}
|
|
2159
2067
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2160
|
-
function
|
|
2068
|
+
function ci(e, t) {
|
|
2161
2069
|
return new e({
|
|
2162
2070
|
type: "number",
|
|
2163
2071
|
check: "number_format",
|
|
@@ -2167,25 +2075,25 @@ function pi(e, t) {
|
|
|
2167
2075
|
});
|
|
2168
2076
|
}
|
|
2169
2077
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2170
|
-
function
|
|
2078
|
+
function li(e, t) {
|
|
2171
2079
|
return new e({
|
|
2172
2080
|
type: "boolean",
|
|
2173
2081
|
...W(t)
|
|
2174
2082
|
});
|
|
2175
2083
|
}
|
|
2176
2084
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2177
|
-
function
|
|
2085
|
+
function ui(e) {
|
|
2178
2086
|
return new e({ type: "unknown" });
|
|
2179
2087
|
}
|
|
2180
2088
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2181
|
-
function
|
|
2089
|
+
function di(e, t) {
|
|
2182
2090
|
return new e({
|
|
2183
2091
|
type: "never",
|
|
2184
2092
|
...W(t)
|
|
2185
2093
|
});
|
|
2186
2094
|
}
|
|
2187
2095
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2188
|
-
function
|
|
2096
|
+
function fi(e, t) {
|
|
2189
2097
|
return new rn({
|
|
2190
2098
|
check: "less_than",
|
|
2191
2099
|
...W(t),
|
|
@@ -2194,7 +2102,7 @@ function _i(e, t) {
|
|
|
2194
2102
|
});
|
|
2195
2103
|
}
|
|
2196
2104
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2197
|
-
function
|
|
2105
|
+
function pi(e, t) {
|
|
2198
2106
|
return new rn({
|
|
2199
2107
|
check: "less_than",
|
|
2200
2108
|
...W(t),
|
|
@@ -2203,7 +2111,7 @@ function vi(e, t) {
|
|
|
2203
2111
|
});
|
|
2204
2112
|
}
|
|
2205
2113
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2206
|
-
function
|
|
2114
|
+
function mi(e, t) {
|
|
2207
2115
|
return new an({
|
|
2208
2116
|
check: "greater_than",
|
|
2209
2117
|
...W(t),
|
|
@@ -2212,7 +2120,7 @@ function yi(e, t) {
|
|
|
2212
2120
|
});
|
|
2213
2121
|
}
|
|
2214
2122
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2215
|
-
function
|
|
2123
|
+
function hi(e, t) {
|
|
2216
2124
|
return new an({
|
|
2217
2125
|
check: "greater_than",
|
|
2218
2126
|
...W(t),
|
|
@@ -2221,7 +2129,7 @@ function bi(e, t) {
|
|
|
2221
2129
|
});
|
|
2222
2130
|
}
|
|
2223
2131
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2224
|
-
function
|
|
2132
|
+
function gi(e, t) {
|
|
2225
2133
|
return new on({
|
|
2226
2134
|
check: "multiple_of",
|
|
2227
2135
|
...W(t),
|
|
@@ -2229,7 +2137,7 @@ function xi(e, t) {
|
|
|
2229
2137
|
});
|
|
2230
2138
|
}
|
|
2231
2139
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2232
|
-
function
|
|
2140
|
+
function _i(e, t) {
|
|
2233
2141
|
return new cn({
|
|
2234
2142
|
check: "max_length",
|
|
2235
2143
|
...W(t),
|
|
@@ -2237,7 +2145,7 @@ function Si(e, t) {
|
|
|
2237
2145
|
});
|
|
2238
2146
|
}
|
|
2239
2147
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2240
|
-
function
|
|
2148
|
+
function vi(e, t) {
|
|
2241
2149
|
return new ln({
|
|
2242
2150
|
check: "min_length",
|
|
2243
2151
|
...W(t),
|
|
@@ -2245,7 +2153,7 @@ function Ci(e, t) {
|
|
|
2245
2153
|
});
|
|
2246
2154
|
}
|
|
2247
2155
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2248
|
-
function
|
|
2156
|
+
function yi(e, t) {
|
|
2249
2157
|
return new un({
|
|
2250
2158
|
check: "length_equals",
|
|
2251
2159
|
...W(t),
|
|
@@ -2253,7 +2161,7 @@ function wi(e, t) {
|
|
|
2253
2161
|
});
|
|
2254
2162
|
}
|
|
2255
2163
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2256
|
-
function
|
|
2164
|
+
function bi(e, t) {
|
|
2257
2165
|
return new fn({
|
|
2258
2166
|
check: "string_format",
|
|
2259
2167
|
format: "regex",
|
|
@@ -2262,7 +2170,7 @@ function Ti(e, t) {
|
|
|
2262
2170
|
});
|
|
2263
2171
|
}
|
|
2264
2172
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2265
|
-
function
|
|
2173
|
+
function xi(e) {
|
|
2266
2174
|
return new pn({
|
|
2267
2175
|
check: "string_format",
|
|
2268
2176
|
format: "lowercase",
|
|
@@ -2270,7 +2178,7 @@ function Ei(e) {
|
|
|
2270
2178
|
});
|
|
2271
2179
|
}
|
|
2272
2180
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2273
|
-
function
|
|
2181
|
+
function Si(e) {
|
|
2274
2182
|
return new mn({
|
|
2275
2183
|
check: "string_format",
|
|
2276
2184
|
format: "uppercase",
|
|
@@ -2278,7 +2186,7 @@ function Di(e) {
|
|
|
2278
2186
|
});
|
|
2279
2187
|
}
|
|
2280
2188
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2281
|
-
function
|
|
2189
|
+
function Ci(e, t) {
|
|
2282
2190
|
return new hn({
|
|
2283
2191
|
check: "string_format",
|
|
2284
2192
|
format: "includes",
|
|
@@ -2287,7 +2195,7 @@ function Oi(e, t) {
|
|
|
2287
2195
|
});
|
|
2288
2196
|
}
|
|
2289
2197
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2290
|
-
function
|
|
2198
|
+
function wi(e, t) {
|
|
2291
2199
|
return new gn({
|
|
2292
2200
|
check: "string_format",
|
|
2293
2201
|
format: "starts_with",
|
|
@@ -2296,7 +2204,7 @@ function ki(e, t) {
|
|
|
2296
2204
|
});
|
|
2297
2205
|
}
|
|
2298
2206
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2299
|
-
function
|
|
2207
|
+
function Ti(e, t) {
|
|
2300
2208
|
return new _n({
|
|
2301
2209
|
check: "string_format",
|
|
2302
2210
|
format: "ends_with",
|
|
@@ -2305,34 +2213,34 @@ function Ai(e, t) {
|
|
|
2305
2213
|
});
|
|
2306
2214
|
}
|
|
2307
2215
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2308
|
-
function
|
|
2216
|
+
function Ei(e) {
|
|
2309
2217
|
return new vn({
|
|
2310
2218
|
check: "overwrite",
|
|
2311
2219
|
tx: e
|
|
2312
2220
|
});
|
|
2313
2221
|
}
|
|
2314
2222
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2315
|
-
function
|
|
2316
|
-
return /* @__PURE__ */
|
|
2223
|
+
function Di(e) {
|
|
2224
|
+
return /* @__PURE__ */ Ei((t) => t.normalize(e));
|
|
2317
2225
|
}
|
|
2318
2226
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2319
|
-
function
|
|
2320
|
-
return /* @__PURE__ */
|
|
2227
|
+
function Oi() {
|
|
2228
|
+
return /* @__PURE__ */ Ei((e) => e.trim());
|
|
2321
2229
|
}
|
|
2322
2230
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2323
|
-
function
|
|
2324
|
-
return /* @__PURE__ */
|
|
2231
|
+
function ki() {
|
|
2232
|
+
return /* @__PURE__ */ Ei((e) => e.toLowerCase());
|
|
2325
2233
|
}
|
|
2326
2234
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2327
|
-
function
|
|
2328
|
-
return /* @__PURE__ */
|
|
2235
|
+
function Ai() {
|
|
2236
|
+
return /* @__PURE__ */ Ei((e) => e.toUpperCase());
|
|
2329
2237
|
}
|
|
2330
2238
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2331
|
-
function
|
|
2332
|
-
return /* @__PURE__ */
|
|
2239
|
+
function ji() {
|
|
2240
|
+
return /* @__PURE__ */ Ei((e) => Fe(e));
|
|
2333
2241
|
}
|
|
2334
2242
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2335
|
-
function
|
|
2243
|
+
function Mi(e, t, n) {
|
|
2336
2244
|
return new e({
|
|
2337
2245
|
type: "array",
|
|
2338
2246
|
element: t,
|
|
@@ -2340,7 +2248,17 @@ function Li(e, t, n) {
|
|
|
2340
2248
|
});
|
|
2341
2249
|
}
|
|
2342
2250
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2343
|
-
function
|
|
2251
|
+
function Ni(e, t, n) {
|
|
2252
|
+
let r = W(n);
|
|
2253
|
+
return r.abort ??= !0, new e({
|
|
2254
|
+
type: "custom",
|
|
2255
|
+
check: "custom",
|
|
2256
|
+
fn: t,
|
|
2257
|
+
...r
|
|
2258
|
+
});
|
|
2259
|
+
}
|
|
2260
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2261
|
+
function Pi(e, t, n) {
|
|
2344
2262
|
return new e({
|
|
2345
2263
|
type: "custom",
|
|
2346
2264
|
check: "custom",
|
|
@@ -2349,18 +2267,18 @@ function Ri(e, t, n) {
|
|
|
2349
2267
|
});
|
|
2350
2268
|
}
|
|
2351
2269
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2352
|
-
function
|
|
2353
|
-
let n = /* @__PURE__ */
|
|
2354
|
-
if (typeof e == "string") t.issues.push(
|
|
2270
|
+
function Fi(e, t) {
|
|
2271
|
+
let n = /* @__PURE__ */ Ii((t) => (t.addIssue = (e) => {
|
|
2272
|
+
if (typeof e == "string") t.issues.push(at(e, t.value, n._zod.def));
|
|
2355
2273
|
else {
|
|
2356
2274
|
let r = e;
|
|
2357
|
-
r.fatal && (r.continue = !1), r.code ??= "custom", r.input ??= t.value, r.inst ??= n, r.continue ??= !n._zod.def.abort, t.issues.push(
|
|
2275
|
+
r.fatal && (r.continue = !1), r.code ??= "custom", r.input ??= t.value, r.inst ??= n, r.continue ??= !n._zod.def.abort, t.issues.push(at(r));
|
|
2358
2276
|
}
|
|
2359
2277
|
}, e(t.value, t)), t);
|
|
2360
2278
|
return n;
|
|
2361
2279
|
}
|
|
2362
2280
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2363
|
-
function
|
|
2281
|
+
function Ii(e, t) {
|
|
2364
2282
|
let n = new G({
|
|
2365
2283
|
check: "custom",
|
|
2366
2284
|
...W(t)
|
|
@@ -2369,11 +2287,11 @@ function Bi(e, t) {
|
|
|
2369
2287
|
}
|
|
2370
2288
|
//#endregion
|
|
2371
2289
|
//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/to-json-schema.js
|
|
2372
|
-
function
|
|
2290
|
+
function Li(e) {
|
|
2373
2291
|
let t = e?.target ?? "draft-2020-12";
|
|
2374
2292
|
return t === "draft-4" && (t = "draft-04"), t === "draft-7" && (t = "draft-07"), {
|
|
2375
2293
|
processors: e.processors ?? {},
|
|
2376
|
-
metadataRegistry: e?.metadata ??
|
|
2294
|
+
metadataRegistry: e?.metadata ?? Nr,
|
|
2377
2295
|
target: t,
|
|
2378
2296
|
unrepresentable: e?.unrepresentable ?? "throw",
|
|
2379
2297
|
override: e?.override ?? (() => {}),
|
|
@@ -2419,7 +2337,7 @@ function J(e, t, n = {
|
|
|
2419
2337
|
let c = t.metadataRegistry.get(e);
|
|
2420
2338
|
return c && Object.assign(o.schema, c), t.io === "input" && Y(e) && (delete o.schema.examples, delete o.schema.default), t.io === "input" && "_prefault" in o.schema && ((r = o.schema).default ?? (r.default = o.schema._prefault)), delete o.schema._prefault, t.seen.get(e).schema;
|
|
2421
2339
|
}
|
|
2422
|
-
function
|
|
2340
|
+
function Ri(e, t) {
|
|
2423
2341
|
let n = e.seen.get(t);
|
|
2424
2342
|
if (!n) throw Error("Unprocessed schema. This is a bug in Zod.");
|
|
2425
2343
|
let r = /* @__PURE__ */ new Map();
|
|
@@ -2489,7 +2407,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2489
2407
|
}
|
|
2490
2408
|
}
|
|
2491
2409
|
}
|
|
2492
|
-
function
|
|
2410
|
+
function zi(e, t) {
|
|
2493
2411
|
let n = e.seen.get(t);
|
|
2494
2412
|
if (!n) throw Error("Unprocessed schema. This is a bug in Zod.");
|
|
2495
2413
|
let r = (t) => {
|
|
@@ -2536,8 +2454,8 @@ function Ui(e, t) {
|
|
|
2536
2454
|
value: {
|
|
2537
2455
|
...t["~standard"],
|
|
2538
2456
|
jsonSchema: {
|
|
2539
|
-
input:
|
|
2540
|
-
output:
|
|
2457
|
+
input: Vi(t, "input", e.processors),
|
|
2458
|
+
output: Vi(t, "output", e.processors)
|
|
2541
2459
|
}
|
|
2542
2460
|
},
|
|
2543
2461
|
enumerable: !1,
|
|
@@ -2574,62 +2492,60 @@ function Y(e, t) {
|
|
|
2574
2492
|
}
|
|
2575
2493
|
return !1;
|
|
2576
2494
|
}
|
|
2577
|
-
var
|
|
2578
|
-
let r =
|
|
2495
|
+
var Bi = (e, t = {}) => (n) => {
|
|
2496
|
+
let r = Li({
|
|
2579
2497
|
...n,
|
|
2580
2498
|
processors: t
|
|
2581
2499
|
});
|
|
2582
|
-
return J(e, r),
|
|
2583
|
-
},
|
|
2584
|
-
let { libraryOptions: i, target: a } = r ?? {}, o =
|
|
2500
|
+
return J(e, r), Ri(r, e), zi(r, e);
|
|
2501
|
+
}, Vi = (e, t, n = {}) => (r) => {
|
|
2502
|
+
let { libraryOptions: i, target: a } = r ?? {}, o = Li({
|
|
2585
2503
|
...i ?? {},
|
|
2586
2504
|
target: a,
|
|
2587
2505
|
io: t,
|
|
2588
2506
|
processors: n
|
|
2589
2507
|
});
|
|
2590
|
-
return J(e, o),
|
|
2591
|
-
},
|
|
2508
|
+
return J(e, o), Ri(o, e), zi(o, e);
|
|
2509
|
+
}, Hi = {
|
|
2592
2510
|
guid: "uuid",
|
|
2593
2511
|
url: "uri",
|
|
2594
2512
|
datetime: "date-time",
|
|
2595
2513
|
json_string: "json-string",
|
|
2596
2514
|
regex: ""
|
|
2597
|
-
},
|
|
2515
|
+
}, Ui = (e, t, n, r) => {
|
|
2598
2516
|
let i = n;
|
|
2599
2517
|
i.type = "string";
|
|
2600
2518
|
let { minimum: a, maximum: o, format: s, patterns: c, contentEncoding: l } = e._zod.bag;
|
|
2601
|
-
if (typeof a == "number" && (i.minLength = a), typeof o == "number" && (i.maxLength = o), s && (i.format =
|
|
2519
|
+
if (typeof a == "number" && (i.minLength = a), typeof o == "number" && (i.maxLength = o), s && (i.format = Hi[s] ?? s, i.format === "" && delete i.format, s === "time" && delete i.format), l && (i.contentEncoding = l), c && c.size > 0) {
|
|
2602
2520
|
let e = [...c];
|
|
2603
2521
|
e.length === 1 ? i.pattern = e[0].source : e.length > 1 && (i.allOf = [...e.map((e) => ({
|
|
2604
2522
|
...t.target === "draft-07" || t.target === "draft-04" || t.target === "openapi-3.0" ? { type: "string" } : {},
|
|
2605
2523
|
pattern: e.source
|
|
2606
2524
|
}))]);
|
|
2607
2525
|
}
|
|
2608
|
-
},
|
|
2526
|
+
}, Wi = (e, t, n, r) => {
|
|
2609
2527
|
let i = n, { minimum: a, maximum: o, format: s, multipleOf: c, exclusiveMaximum: l, exclusiveMinimum: u } = e._zod.bag;
|
|
2610
2528
|
typeof s == "string" && s.includes("int") ? i.type = "integer" : i.type = "number";
|
|
2611
2529
|
let d = typeof u == "number" && u >= (a ?? -Infinity), f = typeof l == "number" && l <= (o ?? Infinity), p = t.target === "draft-04" || t.target === "openapi-3.0";
|
|
2612
2530
|
d ? p ? (i.minimum = u, i.exclusiveMinimum = !0) : i.exclusiveMinimum = u : typeof a == "number" && (i.minimum = a), f ? p ? (i.maximum = l, i.exclusiveMaximum = !0) : i.exclusiveMaximum = l : typeof o == "number" && (i.maximum = o), typeof c == "number" && (i.multipleOf = c);
|
|
2613
|
-
},
|
|
2531
|
+
}, Gi = (e, t, n, r) => {
|
|
2614
2532
|
n.type = "boolean";
|
|
2615
|
-
},
|
|
2533
|
+
}, Ki = (e, t, n, r) => {
|
|
2616
2534
|
n.not = {};
|
|
2617
|
-
},
|
|
2618
|
-
let i = e._zod.def, a =
|
|
2535
|
+
}, qi = (e, t, n, r) => {
|
|
2536
|
+
let i = e._zod.def, a = Te(i.entries);
|
|
2619
2537
|
a.every((e) => typeof e == "number") && (n.type = "number"), a.every((e) => typeof e == "string") && (n.type = "string"), n.enum = a;
|
|
2620
|
-
},
|
|
2538
|
+
}, Ji = (e, t, n, r) => {
|
|
2621
2539
|
if (t.unrepresentable === "throw") throw Error("Custom types cannot be represented in JSON Schema");
|
|
2622
|
-
},
|
|
2623
|
-
if (t.unrepresentable === "throw") throw Error("Function types cannot be represented in JSON Schema");
|
|
2624
|
-
}, ea = (e, t, n, r) => {
|
|
2540
|
+
}, Yi = (e, t, n, r) => {
|
|
2625
2541
|
if (t.unrepresentable === "throw") throw Error("Transforms cannot be represented in JSON Schema");
|
|
2626
|
-
},
|
|
2542
|
+
}, Xi = (e, t, n, r) => {
|
|
2627
2543
|
let i = n, a = e._zod.def, { minimum: o, maximum: s } = e._zod.bag;
|
|
2628
2544
|
typeof o == "number" && (i.minItems = o), typeof s == "number" && (i.maxItems = s), i.type = "array", i.items = J(a.element, t, {
|
|
2629
2545
|
...r,
|
|
2630
2546
|
path: [...r.path, "items"]
|
|
2631
2547
|
});
|
|
2632
|
-
},
|
|
2548
|
+
}, Zi = (e, t, n, r) => {
|
|
2633
2549
|
let i = n, a = e._zod.def;
|
|
2634
2550
|
i.type = "object", i.properties = {};
|
|
2635
2551
|
let o = a.shape;
|
|
@@ -2649,7 +2565,7 @@ var Wi = (e, t = {}) => (n) => {
|
|
|
2649
2565
|
...r,
|
|
2650
2566
|
path: [...r.path, "additionalProperties"]
|
|
2651
2567
|
})) : t.io === "output" && (i.additionalProperties = !1);
|
|
2652
|
-
},
|
|
2568
|
+
}, Qi = (e, t, n, r) => {
|
|
2653
2569
|
let i = e._zod.def, a = i.inclusive === !1, o = i.options.map((e, n) => J(e, t, {
|
|
2654
2570
|
...r,
|
|
2655
2571
|
path: [
|
|
@@ -2659,7 +2575,7 @@ var Wi = (e, t = {}) => (n) => {
|
|
|
2659
2575
|
]
|
|
2660
2576
|
}));
|
|
2661
2577
|
a ? n.oneOf = o : n.anyOf = o;
|
|
2662
|
-
},
|
|
2578
|
+
}, $i = (e, t, n, r) => {
|
|
2663
2579
|
let i = e._zod.def, a = J(i.left, t, {
|
|
2664
2580
|
...r,
|
|
2665
2581
|
path: [
|
|
@@ -2676,28 +2592,7 @@ var Wi = (e, t = {}) => (n) => {
|
|
|
2676
2592
|
]
|
|
2677
2593
|
}), s = (e) => "allOf" in e && Object.keys(e).length === 1;
|
|
2678
2594
|
n.allOf = [...s(a) ? a.allOf : [a], ...s(o) ? o.allOf : [o]];
|
|
2679
|
-
},
|
|
2680
|
-
let i = n, a = e._zod.def;
|
|
2681
|
-
i.type = "array";
|
|
2682
|
-
let o = t.target === "draft-2020-12" ? "prefixItems" : "items", s = t.target === "draft-2020-12" || t.target === "openapi-3.0" ? "items" : "additionalItems", c = a.items.map((e, n) => J(e, t, {
|
|
2683
|
-
...r,
|
|
2684
|
-
path: [
|
|
2685
|
-
...r.path,
|
|
2686
|
-
o,
|
|
2687
|
-
n
|
|
2688
|
-
]
|
|
2689
|
-
})), l = a.rest ? J(a.rest, t, {
|
|
2690
|
-
...r,
|
|
2691
|
-
path: [
|
|
2692
|
-
...r.path,
|
|
2693
|
-
s,
|
|
2694
|
-
...t.target === "openapi-3.0" ? [a.items.length] : []
|
|
2695
|
-
]
|
|
2696
|
-
}) : null;
|
|
2697
|
-
t.target === "draft-2020-12" ? (i.prefixItems = c, l && (i.items = l)) : t.target === "openapi-3.0" ? (i.items = { anyOf: c }, l && i.items.anyOf.push(l), i.minItems = c.length, l || (i.maxItems = c.length)) : (i.items = c, l && (i.additionalItems = l));
|
|
2698
|
-
let { minimum: u, maximum: d } = e._zod.bag;
|
|
2699
|
-
typeof u == "number" && (i.minItems = u), typeof d == "number" && (i.maxItems = d);
|
|
2700
|
-
}, oa = (e, t, n, r) => {
|
|
2595
|
+
}, ea = (e, t, n, r) => {
|
|
2701
2596
|
let i = n, a = e._zod.def;
|
|
2702
2597
|
i.type = "object";
|
|
2703
2598
|
let o = a.keyType, s = o._zod.bag?.patterns;
|
|
@@ -2724,25 +2619,25 @@ var Wi = (e, t = {}) => (n) => {
|
|
|
2724
2619
|
let e = [...c].filter((e) => typeof e == "string" || typeof e == "number");
|
|
2725
2620
|
e.length > 0 && (i.required = e);
|
|
2726
2621
|
}
|
|
2727
|
-
},
|
|
2622
|
+
}, ta = (e, t, n, r) => {
|
|
2728
2623
|
let i = e._zod.def, a = J(i.innerType, t, r), o = t.seen.get(e);
|
|
2729
2624
|
t.target === "openapi-3.0" ? (o.ref = i.innerType, n.nullable = !0) : n.anyOf = [a, { type: "null" }];
|
|
2730
|
-
},
|
|
2625
|
+
}, na = (e, t, n, r) => {
|
|
2731
2626
|
let i = e._zod.def;
|
|
2732
2627
|
J(i.innerType, t, r);
|
|
2733
2628
|
let a = t.seen.get(e);
|
|
2734
2629
|
a.ref = i.innerType;
|
|
2735
|
-
},
|
|
2630
|
+
}, ra = (e, t, n, r) => {
|
|
2736
2631
|
let i = e._zod.def;
|
|
2737
2632
|
J(i.innerType, t, r);
|
|
2738
2633
|
let a = t.seen.get(e);
|
|
2739
2634
|
a.ref = i.innerType, n.default = JSON.parse(JSON.stringify(i.defaultValue));
|
|
2740
|
-
},
|
|
2635
|
+
}, ia = (e, t, n, r) => {
|
|
2741
2636
|
let i = e._zod.def;
|
|
2742
2637
|
J(i.innerType, t, r);
|
|
2743
2638
|
let a = t.seen.get(e);
|
|
2744
2639
|
a.ref = i.innerType, t.io === "input" && (n._prefault = JSON.parse(JSON.stringify(i.defaultValue)));
|
|
2745
|
-
},
|
|
2640
|
+
}, aa = (e, t, n, r) => {
|
|
2746
2641
|
let i = e._zod.def;
|
|
2747
2642
|
J(i.innerType, t, r);
|
|
2748
2643
|
let a = t.seen.get(e);
|
|
@@ -2754,63 +2649,63 @@ var Wi = (e, t = {}) => (n) => {
|
|
|
2754
2649
|
throw Error("Dynamic catch values are not supported in JSON Schema");
|
|
2755
2650
|
}
|
|
2756
2651
|
n.default = o;
|
|
2757
|
-
},
|
|
2652
|
+
}, oa = (e, t, n, r) => {
|
|
2758
2653
|
let i = e._zod.def, a = i.in._zod.traits.has("$ZodTransform"), o = t.io === "input" ? a ? i.out : i.in : i.out;
|
|
2759
2654
|
J(o, t, r);
|
|
2760
2655
|
let s = t.seen.get(e);
|
|
2761
2656
|
s.ref = o;
|
|
2762
|
-
},
|
|
2657
|
+
}, sa = (e, t, n, r) => {
|
|
2763
2658
|
let i = e._zod.def;
|
|
2764
2659
|
J(i.innerType, t, r);
|
|
2765
2660
|
let a = t.seen.get(e);
|
|
2766
2661
|
a.ref = i.innerType, n.readOnly = !0;
|
|
2767
|
-
},
|
|
2662
|
+
}, ca = (e, t, n, r) => {
|
|
2768
2663
|
let i = e._zod.def;
|
|
2769
2664
|
J(i.innerType, t, r);
|
|
2770
2665
|
let a = t.seen.get(e);
|
|
2771
2666
|
a.ref = i.innerType;
|
|
2772
|
-
},
|
|
2667
|
+
}, la = /* @__PURE__ */ H("ZodISODateTime", (e, t) => {
|
|
2773
2668
|
Nn.init(e, t), $.init(e, t);
|
|
2774
2669
|
});
|
|
2775
|
-
function
|
|
2776
|
-
return /* @__PURE__ */
|
|
2670
|
+
function ua(e) {
|
|
2671
|
+
return /* @__PURE__ */ ri(la, e);
|
|
2777
2672
|
}
|
|
2778
|
-
var
|
|
2673
|
+
var da = /* @__PURE__ */ H("ZodISODate", (e, t) => {
|
|
2779
2674
|
Pn.init(e, t), $.init(e, t);
|
|
2780
2675
|
});
|
|
2781
|
-
function
|
|
2782
|
-
return /* @__PURE__ */
|
|
2676
|
+
function fa(e) {
|
|
2677
|
+
return /* @__PURE__ */ ii(da, e);
|
|
2783
2678
|
}
|
|
2784
|
-
var
|
|
2679
|
+
var pa = /* @__PURE__ */ H("ZodISOTime", (e, t) => {
|
|
2785
2680
|
Fn.init(e, t), $.init(e, t);
|
|
2786
2681
|
});
|
|
2787
|
-
function
|
|
2788
|
-
return /* @__PURE__ */
|
|
2682
|
+
function ma(e) {
|
|
2683
|
+
return /* @__PURE__ */ ai(pa, e);
|
|
2789
2684
|
}
|
|
2790
|
-
var
|
|
2685
|
+
var ha = /* @__PURE__ */ H("ZodISODuration", (e, t) => {
|
|
2791
2686
|
In.init(e, t), $.init(e, t);
|
|
2792
2687
|
});
|
|
2793
|
-
function
|
|
2794
|
-
return /* @__PURE__ */
|
|
2688
|
+
function ga(e) {
|
|
2689
|
+
return /* @__PURE__ */ oi(ha, e);
|
|
2795
2690
|
}
|
|
2796
2691
|
var X = /* @__PURE__ */ H("ZodError", (e, t) => {
|
|
2797
|
-
|
|
2798
|
-
format: { value: (t) =>
|
|
2799
|
-
flatten: { value: (t) =>
|
|
2692
|
+
st.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
|
|
2693
|
+
format: { value: (t) => ut(e, t) },
|
|
2694
|
+
flatten: { value: (t) => lt(e, t) },
|
|
2800
2695
|
addIssue: { value: (t) => {
|
|
2801
|
-
e.issues.push(t), e.message = JSON.stringify(e.issues,
|
|
2696
|
+
e.issues.push(t), e.message = JSON.stringify(e.issues, Ee, 2);
|
|
2802
2697
|
} },
|
|
2803
2698
|
addIssues: { value: (t) => {
|
|
2804
|
-
e.issues.push(...t), e.message = JSON.stringify(e.issues,
|
|
2699
|
+
e.issues.push(...t), e.message = JSON.stringify(e.issues, Ee, 2);
|
|
2805
2700
|
} },
|
|
2806
2701
|
isEmpty: { get() {
|
|
2807
2702
|
return e.issues.length === 0;
|
|
2808
2703
|
} }
|
|
2809
2704
|
});
|
|
2810
|
-
}, { Parent: Error }),
|
|
2811
|
-
function
|
|
2812
|
-
let r = Object.getPrototypeOf(e), i =
|
|
2813
|
-
if (i || (i = /* @__PURE__ */ new Set(),
|
|
2705
|
+
}, { Parent: Error }), _a = /* @__PURE__ */ dt(X), va = /* @__PURE__ */ ft(X), ya = /* @__PURE__ */ pt(X), ba = /* @__PURE__ */ ht(X), xa = /* @__PURE__ */ _t(X), Sa = /* @__PURE__ */ vt(X), Ca = /* @__PURE__ */ yt(X), wa = /* @__PURE__ */ bt(X), Ta = /* @__PURE__ */ xt(X), Ea = /* @__PURE__ */ St(X), Da = /* @__PURE__ */ Ct(X), Oa = /* @__PURE__ */ wt(X), ka = /* @__PURE__ */ new WeakMap();
|
|
2706
|
+
function Aa(e, t, n) {
|
|
2707
|
+
let r = Object.getPrototypeOf(e), i = ka.get(r);
|
|
2708
|
+
if (i || (i = /* @__PURE__ */ new Set(), ka.set(r, i)), !i.has(t)) {
|
|
2814
2709
|
i.add(t);
|
|
2815
2710
|
for (let e in n) {
|
|
2816
2711
|
let t = n[e];
|
|
@@ -2839,12 +2734,12 @@ function Ia(e, t, n) {
|
|
|
2839
2734
|
}
|
|
2840
2735
|
}
|
|
2841
2736
|
var Z = /* @__PURE__ */ H("ZodType", (e, t) => (K.init(e, t), Object.assign(e["~standard"], { jsonSchema: {
|
|
2842
|
-
input:
|
|
2843
|
-
output:
|
|
2844
|
-
} }), e.toJSONSchema =
|
|
2737
|
+
input: Vi(e, "input"),
|
|
2738
|
+
output: Vi(e, "output")
|
|
2739
|
+
} }), e.toJSONSchema = Bi(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.parse = (t, n) => _a(e, t, n, { callee: e.parse }), e.safeParse = (t, n) => ya(e, t, n), e.parseAsync = async (t, n) => va(e, t, n, { callee: e.parseAsync }), e.safeParseAsync = async (t, n) => ba(e, t, n), e.spa = e.safeParseAsync, e.encode = (t, n) => xa(e, t, n), e.decode = (t, n) => Sa(e, t, n), e.encodeAsync = async (t, n) => Ca(e, t, n), e.decodeAsync = async (t, n) => wa(e, t, n), e.safeEncode = (t, n) => Ta(e, t, n), e.safeDecode = (t, n) => Ea(e, t, n), e.safeEncodeAsync = async (t, n) => Da(e, t, n), e.safeDecodeAsync = async (t, n) => Oa(e, t, n), Aa(e, "ZodType", {
|
|
2845
2740
|
check(...e) {
|
|
2846
2741
|
let t = this.def;
|
|
2847
|
-
return this.clone(
|
|
2742
|
+
return this.clone(Ne(t, { checks: [...t.checks ?? [], ...e.map((e) => typeof e == "function" ? { _zod: {
|
|
2848
2743
|
check: e,
|
|
2849
2744
|
def: { check: "custom" },
|
|
2850
2745
|
onattach: []
|
|
@@ -2854,7 +2749,7 @@ var Z = /* @__PURE__ */ H("ZodType", (e, t) => (K.init(e, t), Object.assign(e["~
|
|
|
2854
2749
|
return this.check(...e);
|
|
2855
2750
|
},
|
|
2856
2751
|
clone(e, t) {
|
|
2857
|
-
return
|
|
2752
|
+
return Ue(this, e, t);
|
|
2858
2753
|
},
|
|
2859
2754
|
brand() {
|
|
2860
2755
|
return this;
|
|
@@ -2863,64 +2758,64 @@ var Z = /* @__PURE__ */ H("ZodType", (e, t) => (K.init(e, t), Object.assign(e["~
|
|
|
2863
2758
|
return e.add(this, t), this;
|
|
2864
2759
|
},
|
|
2865
2760
|
refine(e, t) {
|
|
2866
|
-
return this.check(
|
|
2761
|
+
return this.check(Uo(e, t));
|
|
2867
2762
|
},
|
|
2868
2763
|
superRefine(e, t) {
|
|
2869
|
-
return this.check(
|
|
2764
|
+
return this.check(Wo(e, t));
|
|
2870
2765
|
},
|
|
2871
2766
|
overwrite(e) {
|
|
2872
|
-
return this.check(/* @__PURE__ */
|
|
2767
|
+
return this.check(/* @__PURE__ */ Ei(e));
|
|
2873
2768
|
},
|
|
2874
2769
|
optional() {
|
|
2875
|
-
return
|
|
2770
|
+
return wo(this);
|
|
2876
2771
|
},
|
|
2877
2772
|
exactOptional() {
|
|
2878
|
-
return
|
|
2773
|
+
return Eo(this);
|
|
2879
2774
|
},
|
|
2880
2775
|
nullable() {
|
|
2881
|
-
return
|
|
2776
|
+
return Oo(this);
|
|
2882
2777
|
},
|
|
2883
2778
|
nullish() {
|
|
2884
|
-
return
|
|
2779
|
+
return wo(Oo(this));
|
|
2885
2780
|
},
|
|
2886
2781
|
nonoptional(e) {
|
|
2887
|
-
return
|
|
2782
|
+
return Po(this, e);
|
|
2888
2783
|
},
|
|
2889
2784
|
array() {
|
|
2890
|
-
return
|
|
2785
|
+
return lo(this);
|
|
2891
2786
|
},
|
|
2892
2787
|
or(e) {
|
|
2893
|
-
return
|
|
2788
|
+
return mo([this, e]);
|
|
2894
2789
|
},
|
|
2895
2790
|
and(e) {
|
|
2896
|
-
return
|
|
2791
|
+
return go(this, e);
|
|
2897
2792
|
},
|
|
2898
2793
|
transform(e) {
|
|
2899
|
-
return
|
|
2794
|
+
return Ro(this, So(e));
|
|
2900
2795
|
},
|
|
2901
2796
|
default(e) {
|
|
2902
|
-
return
|
|
2797
|
+
return Ao(this, e);
|
|
2903
2798
|
},
|
|
2904
2799
|
prefault(e) {
|
|
2905
|
-
return
|
|
2800
|
+
return Mo(this, e);
|
|
2906
2801
|
},
|
|
2907
2802
|
catch(e) {
|
|
2908
|
-
return
|
|
2803
|
+
return Io(this, e);
|
|
2909
2804
|
},
|
|
2910
2805
|
pipe(e) {
|
|
2911
|
-
return
|
|
2806
|
+
return Ro(this, e);
|
|
2912
2807
|
},
|
|
2913
2808
|
readonly() {
|
|
2914
|
-
return
|
|
2809
|
+
return Bo(this);
|
|
2915
2810
|
},
|
|
2916
2811
|
describe(e) {
|
|
2917
2812
|
let t = this.clone();
|
|
2918
|
-
return
|
|
2813
|
+
return Nr.add(t, { description: e }), t;
|
|
2919
2814
|
},
|
|
2920
2815
|
meta(...e) {
|
|
2921
|
-
if (e.length === 0) return
|
|
2816
|
+
if (e.length === 0) return Nr.get(this);
|
|
2922
2817
|
let t = this.clone();
|
|
2923
|
-
return
|
|
2818
|
+
return Nr.add(t, e[0]), t;
|
|
2924
2819
|
},
|
|
2925
2820
|
isOptional() {
|
|
2926
2821
|
return this.safeParse(void 0).success;
|
|
@@ -2933,148 +2828,148 @@ var Z = /* @__PURE__ */ H("ZodType", (e, t) => (K.init(e, t), Object.assign(e["~
|
|
|
2933
2828
|
}
|
|
2934
2829
|
}), Object.defineProperty(e, "description", {
|
|
2935
2830
|
get() {
|
|
2936
|
-
return
|
|
2831
|
+
return Nr.get(e)?.description;
|
|
2937
2832
|
},
|
|
2938
2833
|
configurable: !0
|
|
2939
|
-
}), e)),
|
|
2940
|
-
xn.init(e, t), Z.init(e, t), e._zod.processJSONSchema = (t, n, r) =>
|
|
2834
|
+
}), e)), ja = /* @__PURE__ */ H("_ZodString", (e, t) => {
|
|
2835
|
+
xn.init(e, t), Z.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ui(e, t, n, r);
|
|
2941
2836
|
let n = e._zod.bag;
|
|
2942
|
-
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null,
|
|
2837
|
+
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, Aa(e, "_ZodString", {
|
|
2943
2838
|
regex(...e) {
|
|
2944
|
-
return this.check(/* @__PURE__ */
|
|
2839
|
+
return this.check(/* @__PURE__ */ bi(...e));
|
|
2945
2840
|
},
|
|
2946
2841
|
includes(...e) {
|
|
2947
|
-
return this.check(/* @__PURE__ */
|
|
2842
|
+
return this.check(/* @__PURE__ */ Ci(...e));
|
|
2948
2843
|
},
|
|
2949
2844
|
startsWith(...e) {
|
|
2950
|
-
return this.check(/* @__PURE__ */
|
|
2845
|
+
return this.check(/* @__PURE__ */ wi(...e));
|
|
2951
2846
|
},
|
|
2952
2847
|
endsWith(...e) {
|
|
2953
|
-
return this.check(/* @__PURE__ */
|
|
2848
|
+
return this.check(/* @__PURE__ */ Ti(...e));
|
|
2954
2849
|
},
|
|
2955
2850
|
min(...e) {
|
|
2956
|
-
return this.check(/* @__PURE__ */
|
|
2851
|
+
return this.check(/* @__PURE__ */ vi(...e));
|
|
2957
2852
|
},
|
|
2958
2853
|
max(...e) {
|
|
2959
|
-
return this.check(/* @__PURE__ */
|
|
2854
|
+
return this.check(/* @__PURE__ */ _i(...e));
|
|
2960
2855
|
},
|
|
2961
2856
|
length(...e) {
|
|
2962
|
-
return this.check(/* @__PURE__ */
|
|
2857
|
+
return this.check(/* @__PURE__ */ yi(...e));
|
|
2963
2858
|
},
|
|
2964
2859
|
nonempty(...e) {
|
|
2965
|
-
return this.check(/* @__PURE__ */
|
|
2860
|
+
return this.check(/* @__PURE__ */ vi(1, ...e));
|
|
2966
2861
|
},
|
|
2967
2862
|
lowercase(e) {
|
|
2968
|
-
return this.check(/* @__PURE__ */
|
|
2863
|
+
return this.check(/* @__PURE__ */ xi(e));
|
|
2969
2864
|
},
|
|
2970
2865
|
uppercase(e) {
|
|
2971
|
-
return this.check(/* @__PURE__ */
|
|
2866
|
+
return this.check(/* @__PURE__ */ Si(e));
|
|
2972
2867
|
},
|
|
2973
2868
|
trim() {
|
|
2974
|
-
return this.check(/* @__PURE__ */
|
|
2869
|
+
return this.check(/* @__PURE__ */ Oi());
|
|
2975
2870
|
},
|
|
2976
2871
|
normalize(...e) {
|
|
2977
|
-
return this.check(/* @__PURE__ */
|
|
2872
|
+
return this.check(/* @__PURE__ */ Di(...e));
|
|
2978
2873
|
},
|
|
2979
2874
|
toLowerCase() {
|
|
2980
|
-
return this.check(/* @__PURE__ */
|
|
2875
|
+
return this.check(/* @__PURE__ */ ki());
|
|
2981
2876
|
},
|
|
2982
2877
|
toUpperCase() {
|
|
2983
|
-
return this.check(/* @__PURE__ */
|
|
2878
|
+
return this.check(/* @__PURE__ */ Ai());
|
|
2984
2879
|
},
|
|
2985
2880
|
slugify() {
|
|
2986
|
-
return this.check(/* @__PURE__ */
|
|
2881
|
+
return this.check(/* @__PURE__ */ ji());
|
|
2987
2882
|
}
|
|
2988
2883
|
});
|
|
2989
|
-
}),
|
|
2990
|
-
xn.init(e, t),
|
|
2884
|
+
}), Ma = /* @__PURE__ */ H("ZodString", (e, t) => {
|
|
2885
|
+
xn.init(e, t), ja.init(e, t), e.email = (t) => e.check(/* @__PURE__ */ Fr(Na, t)), e.url = (t) => e.check(/* @__PURE__ */ Vr(Ia, t)), e.jwt = (t) => e.check(/* @__PURE__ */ ni(Za, t)), e.emoji = (t) => e.check(/* @__PURE__ */ Hr(La, t)), e.guid = (t) => e.check(/* @__PURE__ */ Ir(Pa, t)), e.uuid = (t) => e.check(/* @__PURE__ */ Lr(Fa, t)), e.uuidv4 = (t) => e.check(/* @__PURE__ */ Rr(Fa, t)), e.uuidv6 = (t) => e.check(/* @__PURE__ */ zr(Fa, t)), e.uuidv7 = (t) => e.check(/* @__PURE__ */ Br(Fa, t)), e.nanoid = (t) => e.check(/* @__PURE__ */ Ur(Ra, t)), e.guid = (t) => e.check(/* @__PURE__ */ Ir(Pa, t)), e.cuid = (t) => e.check(/* @__PURE__ */ Wr(za, t)), e.cuid2 = (t) => e.check(/* @__PURE__ */ Gr(Ba, t)), e.ulid = (t) => e.check(/* @__PURE__ */ Kr(Va, t)), e.base64 = (t) => e.check(/* @__PURE__ */ $r(Ja, t)), e.base64url = (t) => e.check(/* @__PURE__ */ ei(Ya, t)), e.xid = (t) => e.check(/* @__PURE__ */ qr(Ha, t)), e.ksuid = (t) => e.check(/* @__PURE__ */ Jr(Ua, t)), e.ipv4 = (t) => e.check(/* @__PURE__ */ Yr(Wa, t)), e.ipv6 = (t) => e.check(/* @__PURE__ */ Xr(Ga, t)), e.cidrv4 = (t) => e.check(/* @__PURE__ */ Zr(Ka, t)), e.cidrv6 = (t) => e.check(/* @__PURE__ */ Qr(qa, t)), e.e164 = (t) => e.check(/* @__PURE__ */ ti(Xa, t)), e.datetime = (t) => e.check(ua(t)), e.date = (t) => e.check(fa(t)), e.time = (t) => e.check(ma(t)), e.duration = (t) => e.check(ga(t));
|
|
2991
2886
|
});
|
|
2992
2887
|
function Q(e) {
|
|
2993
|
-
return /* @__PURE__ */
|
|
2888
|
+
return /* @__PURE__ */ Pr(Ma, e);
|
|
2994
2889
|
}
|
|
2995
2890
|
var $ = /* @__PURE__ */ H("ZodStringFormat", (e, t) => {
|
|
2996
|
-
q.init(e, t),
|
|
2997
|
-
}),
|
|
2891
|
+
q.init(e, t), ja.init(e, t);
|
|
2892
|
+
}), Na = /* @__PURE__ */ H("ZodEmail", (e, t) => {
|
|
2998
2893
|
wn.init(e, t), $.init(e, t);
|
|
2999
|
-
}),
|
|
2894
|
+
}), Pa = /* @__PURE__ */ H("ZodGUID", (e, t) => {
|
|
3000
2895
|
Sn.init(e, t), $.init(e, t);
|
|
3001
|
-
}),
|
|
2896
|
+
}), Fa = /* @__PURE__ */ H("ZodUUID", (e, t) => {
|
|
3002
2897
|
Cn.init(e, t), $.init(e, t);
|
|
3003
|
-
}),
|
|
2898
|
+
}), Ia = /* @__PURE__ */ H("ZodURL", (e, t) => {
|
|
3004
2899
|
Tn.init(e, t), $.init(e, t);
|
|
3005
|
-
}),
|
|
2900
|
+
}), La = /* @__PURE__ */ H("ZodEmoji", (e, t) => {
|
|
3006
2901
|
En.init(e, t), $.init(e, t);
|
|
3007
|
-
}),
|
|
2902
|
+
}), Ra = /* @__PURE__ */ H("ZodNanoID", (e, t) => {
|
|
3008
2903
|
Dn.init(e, t), $.init(e, t);
|
|
3009
|
-
}),
|
|
2904
|
+
}), za = /* @__PURE__ */ H("ZodCUID", (e, t) => {
|
|
3010
2905
|
On.init(e, t), $.init(e, t);
|
|
3011
|
-
}),
|
|
2906
|
+
}), Ba = /* @__PURE__ */ H("ZodCUID2", (e, t) => {
|
|
3012
2907
|
kn.init(e, t), $.init(e, t);
|
|
3013
|
-
}),
|
|
2908
|
+
}), Va = /* @__PURE__ */ H("ZodULID", (e, t) => {
|
|
3014
2909
|
An.init(e, t), $.init(e, t);
|
|
3015
|
-
}),
|
|
2910
|
+
}), Ha = /* @__PURE__ */ H("ZodXID", (e, t) => {
|
|
3016
2911
|
jn.init(e, t), $.init(e, t);
|
|
3017
|
-
}),
|
|
2912
|
+
}), Ua = /* @__PURE__ */ H("ZodKSUID", (e, t) => {
|
|
3018
2913
|
Mn.init(e, t), $.init(e, t);
|
|
3019
|
-
}),
|
|
2914
|
+
}), Wa = /* @__PURE__ */ H("ZodIPv4", (e, t) => {
|
|
3020
2915
|
Ln.init(e, t), $.init(e, t);
|
|
3021
|
-
}),
|
|
2916
|
+
}), Ga = /* @__PURE__ */ H("ZodIPv6", (e, t) => {
|
|
3022
2917
|
Rn.init(e, t), $.init(e, t);
|
|
3023
|
-
}),
|
|
2918
|
+
}), Ka = /* @__PURE__ */ H("ZodCIDRv4", (e, t) => {
|
|
3024
2919
|
zn.init(e, t), $.init(e, t);
|
|
3025
|
-
}),
|
|
2920
|
+
}), qa = /* @__PURE__ */ H("ZodCIDRv6", (e, t) => {
|
|
3026
2921
|
Bn.init(e, t), $.init(e, t);
|
|
3027
|
-
}),
|
|
2922
|
+
}), Ja = /* @__PURE__ */ H("ZodBase64", (e, t) => {
|
|
3028
2923
|
Hn.init(e, t), $.init(e, t);
|
|
3029
|
-
}),
|
|
2924
|
+
}), Ya = /* @__PURE__ */ H("ZodBase64URL", (e, t) => {
|
|
3030
2925
|
Wn.init(e, t), $.init(e, t);
|
|
3031
|
-
}),
|
|
2926
|
+
}), Xa = /* @__PURE__ */ H("ZodE164", (e, t) => {
|
|
3032
2927
|
Gn.init(e, t), $.init(e, t);
|
|
3033
|
-
}),
|
|
2928
|
+
}), Za = /* @__PURE__ */ H("ZodJWT", (e, t) => {
|
|
3034
2929
|
qn.init(e, t), $.init(e, t);
|
|
3035
|
-
}),
|
|
3036
|
-
Jn.init(e, t), Z.init(e, t), e._zod.processJSONSchema = (t, n, r) =>
|
|
2930
|
+
}), Qa = /* @__PURE__ */ H("ZodNumber", (e, t) => {
|
|
2931
|
+
Jn.init(e, t), Z.init(e, t), e._zod.processJSONSchema = (t, n, r) => Wi(e, t, n, r), Aa(e, "ZodNumber", {
|
|
3037
2932
|
gt(e, t) {
|
|
3038
|
-
return this.check(/* @__PURE__ */
|
|
2933
|
+
return this.check(/* @__PURE__ */ mi(e, t));
|
|
3039
2934
|
},
|
|
3040
2935
|
gte(e, t) {
|
|
3041
|
-
return this.check(/* @__PURE__ */
|
|
2936
|
+
return this.check(/* @__PURE__ */ hi(e, t));
|
|
3042
2937
|
},
|
|
3043
2938
|
min(e, t) {
|
|
3044
|
-
return this.check(/* @__PURE__ */
|
|
2939
|
+
return this.check(/* @__PURE__ */ hi(e, t));
|
|
3045
2940
|
},
|
|
3046
2941
|
lt(e, t) {
|
|
3047
|
-
return this.check(/* @__PURE__ */
|
|
2942
|
+
return this.check(/* @__PURE__ */ fi(e, t));
|
|
3048
2943
|
},
|
|
3049
2944
|
lte(e, t) {
|
|
3050
|
-
return this.check(/* @__PURE__ */
|
|
2945
|
+
return this.check(/* @__PURE__ */ pi(e, t));
|
|
3051
2946
|
},
|
|
3052
2947
|
max(e, t) {
|
|
3053
|
-
return this.check(/* @__PURE__ */
|
|
2948
|
+
return this.check(/* @__PURE__ */ pi(e, t));
|
|
3054
2949
|
},
|
|
3055
2950
|
int(e) {
|
|
3056
|
-
return this.check(
|
|
2951
|
+
return this.check(to(e));
|
|
3057
2952
|
},
|
|
3058
2953
|
safe(e) {
|
|
3059
|
-
return this.check(
|
|
2954
|
+
return this.check(to(e));
|
|
3060
2955
|
},
|
|
3061
2956
|
positive(e) {
|
|
3062
|
-
return this.check(/* @__PURE__ */
|
|
2957
|
+
return this.check(/* @__PURE__ */ mi(0, e));
|
|
3063
2958
|
},
|
|
3064
2959
|
nonnegative(e) {
|
|
3065
|
-
return this.check(/* @__PURE__ */
|
|
2960
|
+
return this.check(/* @__PURE__ */ hi(0, e));
|
|
3066
2961
|
},
|
|
3067
2962
|
negative(e) {
|
|
3068
|
-
return this.check(/* @__PURE__ */
|
|
2963
|
+
return this.check(/* @__PURE__ */ fi(0, e));
|
|
3069
2964
|
},
|
|
3070
2965
|
nonpositive(e) {
|
|
3071
|
-
return this.check(/* @__PURE__ */
|
|
2966
|
+
return this.check(/* @__PURE__ */ pi(0, e));
|
|
3072
2967
|
},
|
|
3073
2968
|
multipleOf(e, t) {
|
|
3074
|
-
return this.check(/* @__PURE__ */
|
|
2969
|
+
return this.check(/* @__PURE__ */ gi(e, t));
|
|
3075
2970
|
},
|
|
3076
2971
|
step(e, t) {
|
|
3077
|
-
return this.check(/* @__PURE__ */
|
|
2972
|
+
return this.check(/* @__PURE__ */ gi(e, t));
|
|
3078
2973
|
},
|
|
3079
2974
|
finite() {
|
|
3080
2975
|
return this;
|
|
@@ -3083,59 +2978,59 @@ var $ = /* @__PURE__ */ H("ZodStringFormat", (e, t) => {
|
|
|
3083
2978
|
let n = e._zod.bag;
|
|
3084
2979
|
e.minValue = Math.max(n.minimum ?? -Infinity, n.exclusiveMinimum ?? -Infinity) ?? null, e.maxValue = Math.min(n.maximum ?? Infinity, n.exclusiveMaximum ?? Infinity) ?? null, e.isInt = (n.format ?? "").includes("int") || Number.isSafeInteger(n.multipleOf ?? .5), e.isFinite = !0, e.format = n.format ?? null;
|
|
3085
2980
|
});
|
|
3086
|
-
function
|
|
3087
|
-
return /* @__PURE__ */
|
|
2981
|
+
function $a(e) {
|
|
2982
|
+
return /* @__PURE__ */ si(Qa, e);
|
|
3088
2983
|
}
|
|
3089
|
-
var
|
|
3090
|
-
Yn.init(e, t),
|
|
2984
|
+
var eo = /* @__PURE__ */ H("ZodNumberFormat", (e, t) => {
|
|
2985
|
+
Yn.init(e, t), Qa.init(e, t);
|
|
3091
2986
|
});
|
|
3092
|
-
function
|
|
3093
|
-
return /* @__PURE__ */
|
|
2987
|
+
function to(e) {
|
|
2988
|
+
return /* @__PURE__ */ ci(eo, e);
|
|
3094
2989
|
}
|
|
3095
|
-
var
|
|
3096
|
-
Xn.init(e, t), Z.init(e, t), e._zod.processJSONSchema = (t, n, r) =>
|
|
2990
|
+
var no = /* @__PURE__ */ H("ZodBoolean", (e, t) => {
|
|
2991
|
+
Xn.init(e, t), Z.init(e, t), e._zod.processJSONSchema = (t, n, r) => Gi(e, t, n, r);
|
|
3097
2992
|
});
|
|
3098
|
-
function
|
|
3099
|
-
return /* @__PURE__ */
|
|
2993
|
+
function ro(e) {
|
|
2994
|
+
return /* @__PURE__ */ li(no, e);
|
|
3100
2995
|
}
|
|
3101
|
-
var
|
|
2996
|
+
var io = /* @__PURE__ */ H("ZodUnknown", (e, t) => {
|
|
3102
2997
|
Zn.init(e, t), Z.init(e, t), e._zod.processJSONSchema = (e, t, n) => void 0;
|
|
3103
2998
|
});
|
|
3104
|
-
function
|
|
3105
|
-
return /* @__PURE__ */
|
|
2999
|
+
function ao() {
|
|
3000
|
+
return /* @__PURE__ */ ui(io);
|
|
3106
3001
|
}
|
|
3107
|
-
var
|
|
3108
|
-
Qn.init(e, t), Z.init(e, t), e._zod.processJSONSchema = (t, n, r) =>
|
|
3002
|
+
var oo = /* @__PURE__ */ H("ZodNever", (e, t) => {
|
|
3003
|
+
Qn.init(e, t), Z.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ki(e, t, n, r);
|
|
3109
3004
|
});
|
|
3110
|
-
function
|
|
3111
|
-
return /* @__PURE__ */
|
|
3005
|
+
function so(e) {
|
|
3006
|
+
return /* @__PURE__ */ di(oo, e);
|
|
3112
3007
|
}
|
|
3113
|
-
var
|
|
3114
|
-
er.init(e, t), Z.init(e, t), e._zod.processJSONSchema = (t, n, r) =>
|
|
3008
|
+
var co = /* @__PURE__ */ H("ZodArray", (e, t) => {
|
|
3009
|
+
er.init(e, t), Z.init(e, t), e._zod.processJSONSchema = (t, n, r) => Xi(e, t, n, r), e.element = t.element, Aa(e, "ZodArray", {
|
|
3115
3010
|
min(e, t) {
|
|
3116
|
-
return this.check(/* @__PURE__ */
|
|
3011
|
+
return this.check(/* @__PURE__ */ vi(e, t));
|
|
3117
3012
|
},
|
|
3118
3013
|
nonempty(e) {
|
|
3119
|
-
return this.check(/* @__PURE__ */
|
|
3014
|
+
return this.check(/* @__PURE__ */ vi(1, e));
|
|
3120
3015
|
},
|
|
3121
3016
|
max(e, t) {
|
|
3122
|
-
return this.check(/* @__PURE__ */
|
|
3017
|
+
return this.check(/* @__PURE__ */ _i(e, t));
|
|
3123
3018
|
},
|
|
3124
3019
|
length(e, t) {
|
|
3125
|
-
return this.check(/* @__PURE__ */
|
|
3020
|
+
return this.check(/* @__PURE__ */ yi(e, t));
|
|
3126
3021
|
},
|
|
3127
3022
|
unwrap() {
|
|
3128
3023
|
return this.element;
|
|
3129
3024
|
}
|
|
3130
3025
|
});
|
|
3131
3026
|
});
|
|
3132
|
-
function
|
|
3133
|
-
return /* @__PURE__ */
|
|
3027
|
+
function lo(e, t) {
|
|
3028
|
+
return /* @__PURE__ */ Mi(co, e, t);
|
|
3134
3029
|
}
|
|
3135
|
-
var
|
|
3136
|
-
ar.init(e, t), Z.init(e, t), e._zod.processJSONSchema = (t, n, r) =>
|
|
3030
|
+
var uo = /* @__PURE__ */ H("ZodObject", (e, t) => {
|
|
3031
|
+
ar.init(e, t), Z.init(e, t), e._zod.processJSONSchema = (t, n, r) => Zi(e, t, n, r), U(e, "shape", () => t.shape), Aa(e, "ZodObject", {
|
|
3137
3032
|
keyof() {
|
|
3138
|
-
return
|
|
3033
|
+
return bo(Object.keys(this._zod.def.shape));
|
|
3139
3034
|
},
|
|
3140
3035
|
catchall(e) {
|
|
3141
3036
|
return this.clone({
|
|
@@ -3146,19 +3041,19 @@ var _o = /* @__PURE__ */ H("ZodObject", (e, t) => {
|
|
|
3146
3041
|
passthrough() {
|
|
3147
3042
|
return this.clone({
|
|
3148
3043
|
...this._zod.def,
|
|
3149
|
-
catchall:
|
|
3044
|
+
catchall: ao()
|
|
3150
3045
|
});
|
|
3151
3046
|
},
|
|
3152
3047
|
loose() {
|
|
3153
3048
|
return this.clone({
|
|
3154
3049
|
...this._zod.def,
|
|
3155
|
-
catchall:
|
|
3050
|
+
catchall: ao()
|
|
3156
3051
|
});
|
|
3157
3052
|
},
|
|
3158
3053
|
strict() {
|
|
3159
3054
|
return this.clone({
|
|
3160
3055
|
...this._zod.def,
|
|
3161
|
-
catchall:
|
|
3056
|
+
catchall: so()
|
|
3162
3057
|
});
|
|
3163
3058
|
},
|
|
3164
3059
|
strip() {
|
|
@@ -3168,94 +3063,79 @@ var _o = /* @__PURE__ */ H("ZodObject", (e, t) => {
|
|
|
3168
3063
|
});
|
|
3169
3064
|
},
|
|
3170
3065
|
extend(e) {
|
|
3171
|
-
return
|
|
3066
|
+
return Je(this, e);
|
|
3172
3067
|
},
|
|
3173
3068
|
safeExtend(e) {
|
|
3174
|
-
return
|
|
3069
|
+
return Ye(this, e);
|
|
3175
3070
|
},
|
|
3176
3071
|
merge(e) {
|
|
3177
|
-
return
|
|
3072
|
+
return Xe(this, e);
|
|
3178
3073
|
},
|
|
3179
3074
|
pick(e) {
|
|
3180
|
-
return
|
|
3075
|
+
return Ke(this, e);
|
|
3181
3076
|
},
|
|
3182
3077
|
omit(e) {
|
|
3183
|
-
return
|
|
3078
|
+
return qe(this, e);
|
|
3184
3079
|
},
|
|
3185
3080
|
partial(...e) {
|
|
3186
|
-
return
|
|
3081
|
+
return Ze(Co, this, e[0]);
|
|
3187
3082
|
},
|
|
3188
3083
|
required(...e) {
|
|
3189
|
-
return
|
|
3084
|
+
return Qe(No, this, e[0]);
|
|
3190
3085
|
}
|
|
3191
3086
|
});
|
|
3192
3087
|
});
|
|
3193
|
-
function
|
|
3194
|
-
return new
|
|
3088
|
+
function fo(e, t) {
|
|
3089
|
+
return new uo({
|
|
3195
3090
|
type: "object",
|
|
3196
3091
|
shape: e ?? {},
|
|
3197
3092
|
...W(t)
|
|
3198
3093
|
});
|
|
3199
3094
|
}
|
|
3200
|
-
var
|
|
3201
|
-
sr.init(e, t), Z.init(e, t), e._zod.processJSONSchema = (t, n, r) =>
|
|
3095
|
+
var po = /* @__PURE__ */ H("ZodUnion", (e, t) => {
|
|
3096
|
+
sr.init(e, t), Z.init(e, t), e._zod.processJSONSchema = (t, n, r) => Qi(e, t, n, r), e.options = t.options;
|
|
3202
3097
|
});
|
|
3203
|
-
function
|
|
3204
|
-
return new
|
|
3098
|
+
function mo(e, t) {
|
|
3099
|
+
return new po({
|
|
3205
3100
|
type: "union",
|
|
3206
3101
|
options: e,
|
|
3207
3102
|
...W(t)
|
|
3208
3103
|
});
|
|
3209
3104
|
}
|
|
3210
|
-
var
|
|
3211
|
-
cr.init(e, t), Z.init(e, t), e._zod.processJSONSchema = (t, n, r) =>
|
|
3105
|
+
var ho = /* @__PURE__ */ H("ZodIntersection", (e, t) => {
|
|
3106
|
+
cr.init(e, t), Z.init(e, t), e._zod.processJSONSchema = (t, n, r) => $i(e, t, n, r);
|
|
3212
3107
|
});
|
|
3213
|
-
function
|
|
3214
|
-
return new
|
|
3108
|
+
function go(e, t) {
|
|
3109
|
+
return new ho({
|
|
3215
3110
|
type: "intersection",
|
|
3216
3111
|
left: e,
|
|
3217
3112
|
right: t
|
|
3218
3113
|
});
|
|
3219
3114
|
}
|
|
3220
|
-
var
|
|
3221
|
-
dr.init(e, t), Z.init(e, t), e._zod.processJSONSchema = (t, n, r) =>
|
|
3222
|
-
...e._zod.def,
|
|
3223
|
-
rest: t
|
|
3224
|
-
});
|
|
3225
|
-
});
|
|
3226
|
-
function wo(e, t, n) {
|
|
3227
|
-
let r = t instanceof K;
|
|
3228
|
-
return new Co({
|
|
3229
|
-
type: "tuple",
|
|
3230
|
-
items: e,
|
|
3231
|
-
rest: r ? t : null,
|
|
3232
|
-
...W(r ? n : t)
|
|
3233
|
-
});
|
|
3234
|
-
}
|
|
3235
|
-
var To = /* @__PURE__ */ H("ZodRecord", (e, t) => {
|
|
3236
|
-
hr.init(e, t), Z.init(e, t), e._zod.processJSONSchema = (t, n, r) => oa(e, t, n, r), e.keyType = t.keyType, e.valueType = t.valueType;
|
|
3115
|
+
var _o = /* @__PURE__ */ H("ZodRecord", (e, t) => {
|
|
3116
|
+
dr.init(e, t), Z.init(e, t), e._zod.processJSONSchema = (t, n, r) => ea(e, t, n, r), e.keyType = t.keyType, e.valueType = t.valueType;
|
|
3237
3117
|
});
|
|
3238
|
-
function
|
|
3239
|
-
return !t || !t._zod ? new
|
|
3118
|
+
function vo(e, t, n) {
|
|
3119
|
+
return !t || !t._zod ? new _o({
|
|
3240
3120
|
type: "record",
|
|
3241
3121
|
keyType: Q(),
|
|
3242
3122
|
valueType: e,
|
|
3243
3123
|
...W(t)
|
|
3244
|
-
}) : new
|
|
3124
|
+
}) : new _o({
|
|
3245
3125
|
type: "record",
|
|
3246
3126
|
keyType: e,
|
|
3247
3127
|
valueType: t,
|
|
3248
3128
|
...W(n)
|
|
3249
3129
|
});
|
|
3250
3130
|
}
|
|
3251
|
-
var
|
|
3252
|
-
|
|
3131
|
+
var yo = /* @__PURE__ */ H("ZodEnum", (e, t) => {
|
|
3132
|
+
fr.init(e, t), Z.init(e, t), e._zod.processJSONSchema = (t, n, r) => qi(e, t, n, r), e.enum = t.entries, e.options = Object.values(t.entries);
|
|
3253
3133
|
let n = new Set(Object.keys(t.entries));
|
|
3254
3134
|
e.extract = (e, r) => {
|
|
3255
3135
|
let i = {};
|
|
3256
3136
|
for (let r of e) if (n.has(r)) i[r] = t.entries[r];
|
|
3257
3137
|
else throw Error(`Key ${r} not found in enum`);
|
|
3258
|
-
return new
|
|
3138
|
+
return new yo({
|
|
3259
3139
|
...t,
|
|
3260
3140
|
checks: [],
|
|
3261
3141
|
...W(r),
|
|
@@ -3265,7 +3145,7 @@ var Do = /* @__PURE__ */ H("ZodEnum", (e, t) => {
|
|
|
3265
3145
|
let i = { ...t.entries };
|
|
3266
3146
|
for (let t of e) if (n.has(t)) delete i[t];
|
|
3267
3147
|
else throw Error(`Key ${t} not found in enum`);
|
|
3268
|
-
return new
|
|
3148
|
+
return new yo({
|
|
3269
3149
|
...t,
|
|
3270
3150
|
checks: [],
|
|
3271
3151
|
...W(r),
|
|
@@ -3273,145 +3153,138 @@ var Do = /* @__PURE__ */ H("ZodEnum", (e, t) => {
|
|
|
3273
3153
|
});
|
|
3274
3154
|
};
|
|
3275
3155
|
});
|
|
3276
|
-
function
|
|
3277
|
-
return new
|
|
3156
|
+
function bo(e, t) {
|
|
3157
|
+
return new yo({
|
|
3278
3158
|
type: "enum",
|
|
3279
3159
|
entries: Array.isArray(e) ? Object.fromEntries(e.map((e) => [e, e])) : e,
|
|
3280
3160
|
...W(t)
|
|
3281
3161
|
});
|
|
3282
3162
|
}
|
|
3283
|
-
var
|
|
3284
|
-
|
|
3285
|
-
if (r.direction === "backward") throw new
|
|
3163
|
+
var xo = /* @__PURE__ */ H("ZodTransform", (e, t) => {
|
|
3164
|
+
pr.init(e, t), Z.init(e, t), e._zod.processJSONSchema = (t, n, r) => Yi(e, t, n, r), e._zod.parse = (n, r) => {
|
|
3165
|
+
if (r.direction === "backward") throw new Se(e.constructor.name);
|
|
3286
3166
|
n.addIssue = (r) => {
|
|
3287
|
-
if (typeof r == "string") n.issues.push(
|
|
3167
|
+
if (typeof r == "string") n.issues.push(at(r, n.value, t));
|
|
3288
3168
|
else {
|
|
3289
3169
|
let t = r;
|
|
3290
|
-
t.fatal && (t.continue = !1), t.code ??= "custom", t.input ??= n.value, t.inst ??= e, n.issues.push(
|
|
3170
|
+
t.fatal && (t.continue = !1), t.code ??= "custom", t.input ??= n.value, t.inst ??= e, n.issues.push(at(t));
|
|
3291
3171
|
}
|
|
3292
3172
|
};
|
|
3293
3173
|
let i = t.transform(n.value, n);
|
|
3294
3174
|
return i instanceof Promise ? i.then((e) => (n.value = e, n.fallback = !0, n)) : (n.value = i, n.fallback = !0, n);
|
|
3295
3175
|
};
|
|
3296
3176
|
});
|
|
3297
|
-
function
|
|
3298
|
-
return new
|
|
3177
|
+
function So(e) {
|
|
3178
|
+
return new xo({
|
|
3299
3179
|
type: "transform",
|
|
3300
3180
|
transform: e
|
|
3301
3181
|
});
|
|
3302
3182
|
}
|
|
3303
|
-
var
|
|
3304
|
-
|
|
3183
|
+
var Co = /* @__PURE__ */ H("ZodOptional", (e, t) => {
|
|
3184
|
+
hr.init(e, t), Z.init(e, t), e._zod.processJSONSchema = (t, n, r) => ca(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
|
|
3305
3185
|
});
|
|
3306
|
-
function
|
|
3307
|
-
return new
|
|
3186
|
+
function wo(e) {
|
|
3187
|
+
return new Co({
|
|
3308
3188
|
type: "optional",
|
|
3309
3189
|
innerType: e
|
|
3310
3190
|
});
|
|
3311
3191
|
}
|
|
3312
|
-
var
|
|
3313
|
-
|
|
3192
|
+
var To = /* @__PURE__ */ H("ZodExactOptional", (e, t) => {
|
|
3193
|
+
gr.init(e, t), Z.init(e, t), e._zod.processJSONSchema = (t, n, r) => ca(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
|
|
3314
3194
|
});
|
|
3315
|
-
function
|
|
3316
|
-
return new
|
|
3195
|
+
function Eo(e) {
|
|
3196
|
+
return new To({
|
|
3317
3197
|
type: "optional",
|
|
3318
3198
|
innerType: e
|
|
3319
3199
|
});
|
|
3320
3200
|
}
|
|
3321
|
-
var
|
|
3322
|
-
|
|
3201
|
+
var Do = /* @__PURE__ */ H("ZodNullable", (e, t) => {
|
|
3202
|
+
_r.init(e, t), Z.init(e, t), e._zod.processJSONSchema = (t, n, r) => ta(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
|
|
3323
3203
|
});
|
|
3324
|
-
function
|
|
3325
|
-
return new
|
|
3204
|
+
function Oo(e) {
|
|
3205
|
+
return new Do({
|
|
3326
3206
|
type: "nullable",
|
|
3327
3207
|
innerType: e
|
|
3328
3208
|
});
|
|
3329
3209
|
}
|
|
3330
|
-
var
|
|
3331
|
-
|
|
3210
|
+
var ko = /* @__PURE__ */ H("ZodDefault", (e, t) => {
|
|
3211
|
+
vr.init(e, t), Z.init(e, t), e._zod.processJSONSchema = (t, n, r) => ra(e, t, n, r), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
|
|
3332
3212
|
});
|
|
3333
|
-
function
|
|
3334
|
-
return new
|
|
3213
|
+
function Ao(e, t) {
|
|
3214
|
+
return new ko({
|
|
3335
3215
|
type: "default",
|
|
3336
3216
|
innerType: e,
|
|
3337
3217
|
get defaultValue() {
|
|
3338
|
-
return typeof t == "function" ? t() :
|
|
3218
|
+
return typeof t == "function" ? t() : Be(t);
|
|
3339
3219
|
}
|
|
3340
3220
|
});
|
|
3341
3221
|
}
|
|
3342
|
-
var
|
|
3343
|
-
|
|
3222
|
+
var jo = /* @__PURE__ */ H("ZodPrefault", (e, t) => {
|
|
3223
|
+
br.init(e, t), Z.init(e, t), e._zod.processJSONSchema = (t, n, r) => ia(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
|
|
3344
3224
|
});
|
|
3345
|
-
function
|
|
3346
|
-
return new
|
|
3225
|
+
function Mo(e, t) {
|
|
3226
|
+
return new jo({
|
|
3347
3227
|
type: "prefault",
|
|
3348
3228
|
innerType: e,
|
|
3349
3229
|
get defaultValue() {
|
|
3350
|
-
return typeof t == "function" ? t() :
|
|
3230
|
+
return typeof t == "function" ? t() : Be(t);
|
|
3351
3231
|
}
|
|
3352
3232
|
});
|
|
3353
3233
|
}
|
|
3354
|
-
var
|
|
3355
|
-
|
|
3234
|
+
var No = /* @__PURE__ */ H("ZodNonOptional", (e, t) => {
|
|
3235
|
+
xr.init(e, t), Z.init(e, t), e._zod.processJSONSchema = (t, n, r) => na(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
|
|
3356
3236
|
});
|
|
3357
|
-
function
|
|
3358
|
-
return new
|
|
3237
|
+
function Po(e, t) {
|
|
3238
|
+
return new No({
|
|
3359
3239
|
type: "nonoptional",
|
|
3360
3240
|
innerType: e,
|
|
3361
3241
|
...W(t)
|
|
3362
3242
|
});
|
|
3363
3243
|
}
|
|
3364
|
-
var
|
|
3365
|
-
|
|
3244
|
+
var Fo = /* @__PURE__ */ H("ZodCatch", (e, t) => {
|
|
3245
|
+
Cr.init(e, t), Z.init(e, t), e._zod.processJSONSchema = (t, n, r) => aa(e, t, n, r), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
|
3366
3246
|
});
|
|
3367
|
-
function
|
|
3368
|
-
return new
|
|
3247
|
+
function Io(e, t) {
|
|
3248
|
+
return new Fo({
|
|
3369
3249
|
type: "catch",
|
|
3370
3250
|
innerType: e,
|
|
3371
3251
|
catchValue: typeof t == "function" ? t : () => t
|
|
3372
3252
|
});
|
|
3373
3253
|
}
|
|
3374
|
-
var
|
|
3375
|
-
|
|
3254
|
+
var Lo = /* @__PURE__ */ H("ZodPipe", (e, t) => {
|
|
3255
|
+
wr.init(e, t), Z.init(e, t), e._zod.processJSONSchema = (t, n, r) => oa(e, t, n, r), e.in = t.in, e.out = t.out;
|
|
3376
3256
|
});
|
|
3377
|
-
function
|
|
3378
|
-
return new
|
|
3257
|
+
function Ro(e, t) {
|
|
3258
|
+
return new Lo({
|
|
3379
3259
|
type: "pipe",
|
|
3380
3260
|
in: e,
|
|
3381
3261
|
out: t
|
|
3382
3262
|
});
|
|
3383
3263
|
}
|
|
3384
|
-
var
|
|
3385
|
-
|
|
3264
|
+
var zo = /* @__PURE__ */ H("ZodReadonly", (e, t) => {
|
|
3265
|
+
Er.init(e, t), Z.init(e, t), e._zod.processJSONSchema = (t, n, r) => sa(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
|
|
3386
3266
|
});
|
|
3387
|
-
function
|
|
3388
|
-
return new
|
|
3267
|
+
function Bo(e) {
|
|
3268
|
+
return new zo({
|
|
3389
3269
|
type: "readonly",
|
|
3390
3270
|
innerType: e
|
|
3391
3271
|
});
|
|
3392
3272
|
}
|
|
3393
|
-
var
|
|
3394
|
-
|
|
3273
|
+
var Vo = /* @__PURE__ */ H("ZodCustom", (e, t) => {
|
|
3274
|
+
Or.init(e, t), Z.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ji(e, t, n, r);
|
|
3395
3275
|
});
|
|
3396
|
-
function
|
|
3397
|
-
return
|
|
3398
|
-
type: "function",
|
|
3399
|
-
input: Array.isArray(e?.input) ? wo(e?.input) : e?.input ?? go(fo()),
|
|
3400
|
-
output: e?.output ?? fo()
|
|
3401
|
-
});
|
|
3276
|
+
function Ho(e, t) {
|
|
3277
|
+
return /* @__PURE__ */ Ni(Vo, e ?? (() => !0), t);
|
|
3402
3278
|
}
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
});
|
|
3406
|
-
function Qo(e, t = {}) {
|
|
3407
|
-
return /* @__PURE__ */ Ri(Zo, e, t);
|
|
3279
|
+
function Uo(e, t = {}) {
|
|
3280
|
+
return /* @__PURE__ */ Pi(Vo, e, t);
|
|
3408
3281
|
}
|
|
3409
|
-
function
|
|
3410
|
-
return /* @__PURE__ */
|
|
3282
|
+
function Wo(e, t) {
|
|
3283
|
+
return /* @__PURE__ */ Fi(e, t);
|
|
3411
3284
|
}
|
|
3412
3285
|
//#endregion
|
|
3413
3286
|
//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/compat.js
|
|
3414
|
-
var
|
|
3287
|
+
var Go = {
|
|
3415
3288
|
invalid_type: "invalid_type",
|
|
3416
3289
|
too_big: "too_big",
|
|
3417
3290
|
too_small: "too_small",
|
|
@@ -3423,90 +3296,96 @@ var es = {
|
|
|
3423
3296
|
invalid_element: "invalid_element",
|
|
3424
3297
|
invalid_value: "invalid_value",
|
|
3425
3298
|
custom: "custom"
|
|
3426
|
-
},
|
|
3427
|
-
(function(e) {})(
|
|
3428
|
-
var
|
|
3429
|
-
app:
|
|
3299
|
+
}, Ko;
|
|
3300
|
+
(function(e) {})(Ko ||= {});
|
|
3301
|
+
var qo = fo({
|
|
3302
|
+
app: fo({
|
|
3430
3303
|
name: Q().min(1, "app.name is required"),
|
|
3431
3304
|
version: Q().min(1, "app.version is required"),
|
|
3432
3305
|
description: Q().optional()
|
|
3433
3306
|
}),
|
|
3434
|
-
monkey:
|
|
3307
|
+
monkey: fo({ server: fo({}).passthrough().optional() }).passthrough().superRefine((e, t) => {
|
|
3435
3308
|
"clientAlias" in e && t.addIssue({
|
|
3436
|
-
code:
|
|
3309
|
+
code: Go.custom,
|
|
3437
3310
|
path: ["clientAlias"],
|
|
3438
3311
|
message: "monkey.clientAlias is not supported by makoo"
|
|
3439
3312
|
}), e.server && typeof e.server == "object" && "mountGmApi" in e.server && t.addIssue({
|
|
3440
|
-
code:
|
|
3313
|
+
code: Go.custom,
|
|
3441
3314
|
path: ["server", "mountGmApi"],
|
|
3442
3315
|
message: "monkey.server.mountGmApi is not supported by makoo"
|
|
3443
3316
|
});
|
|
3444
3317
|
}).optional(),
|
|
3445
|
-
source:
|
|
3446
|
-
runtime:
|
|
3318
|
+
source: fo({}).passthrough().optional(),
|
|
3319
|
+
runtime: fo({}).passthrough().optional()
|
|
3447
3320
|
}).loose().superRefine((e, t) => {
|
|
3448
3321
|
"injector" in e && t.addIssue({
|
|
3449
|
-
code:
|
|
3322
|
+
code: Go.custom,
|
|
3450
3323
|
path: ["injector"],
|
|
3451
3324
|
message: "injector is not supported in vite config; use manifest injectionDefaults instead"
|
|
3452
3325
|
});
|
|
3453
3326
|
});
|
|
3454
|
-
function
|
|
3455
|
-
let t =
|
|
3456
|
-
if (!t.success) throw new
|
|
3327
|
+
function Jo(e) {
|
|
3328
|
+
let t = qo.safeParse(e);
|
|
3329
|
+
if (!t.success) throw new ie(t.error.issues.map(L));
|
|
3457
3330
|
}
|
|
3458
3331
|
//#endregion
|
|
3459
3332
|
//#region packages/cli/src/config/resolve.ts
|
|
3460
|
-
var
|
|
3333
|
+
var Yo = (e, t) => Array.isArray(e) ? e : e === void 0 ? t : [e], Xo = (e, t) => o(t) ? s(t) : s(l(e, t)), Zo = (e) => s(e ? l(e) : u.cwd()), Qo = (e) => {
|
|
3461
3334
|
let t = a(e).toLowerCase();
|
|
3462
|
-
if (
|
|
3463
|
-
if (
|
|
3464
|
-
throw new
|
|
3465
|
-
},
|
|
3335
|
+
if (V.has(t)) return "React";
|
|
3336
|
+
if (de.has(t)) return "Vue";
|
|
3337
|
+
throw new D(e);
|
|
3338
|
+
}, $o = (e, t) => e && e !== "auto" ? e : Qo(t), es = (e) => {
|
|
3466
3339
|
if (e) return Array.isArray(e) ? { include: e } : {
|
|
3467
3340
|
include: e.include,
|
|
3468
3341
|
exclude: e.exclude
|
|
3469
3342
|
};
|
|
3470
|
-
},
|
|
3343
|
+
}, ts = (e, t, n, i, o) => e.name ? e.name : i || r(t) || r(n, a(n)) || `injection-${typeof o == "number" ? o + 1 : 1}`, ns = (e, t, n) => e.name ? e.name : t || `listener-${typeof n == "number" ? n + 1 : 1}`, rs = (e, t) => t === !1 || t === void 0 ? !1 : t === !0 ? e.replace(/\.user\.js$/, ".meta.js") : typeof t == "function" ? t(e) : t, is = (e) => typeof e == "string" ? { "": e } : e, as = (e) => ({
|
|
3471
3344
|
...e,
|
|
3472
|
-
name:
|
|
3473
|
-
description:
|
|
3474
|
-
}),
|
|
3345
|
+
name: is(e.name),
|
|
3346
|
+
description: is(e.description)
|
|
3347
|
+
}), os = (e) => {
|
|
3475
3348
|
let t = e?.injections;
|
|
3476
3349
|
return t ? Array.isArray(t) ? t : Object.entries(t).map(([e, t]) => ({
|
|
3477
3350
|
name: e,
|
|
3478
3351
|
...t
|
|
3479
3352
|
})) : [];
|
|
3480
|
-
},
|
|
3353
|
+
}, ss = (e) => {
|
|
3354
|
+
let t = e?.listeners;
|
|
3355
|
+
return t ? Array.isArray(t) ? t : Object.entries(t).map(([e, t]) => ({
|
|
3356
|
+
name: e,
|
|
3357
|
+
...t
|
|
3358
|
+
})) : [];
|
|
3359
|
+
}, cs = (e) => ({
|
|
3481
3360
|
name: e.name,
|
|
3482
3361
|
version: e.version,
|
|
3483
3362
|
description: e.description
|
|
3484
|
-
}),
|
|
3485
|
-
dir:
|
|
3486
|
-
include:
|
|
3487
|
-
exclude:
|
|
3488
|
-
manifest:
|
|
3489
|
-
}),
|
|
3490
|
-
alive: e?.alive ??
|
|
3491
|
-
scope: e?.scope ??
|
|
3492
|
-
timeout: e?.timeout ??
|
|
3363
|
+
}), ls = (e, t) => ({
|
|
3364
|
+
dir: Xo(t, me.dir),
|
|
3365
|
+
include: Yo(e?.include, me.include),
|
|
3366
|
+
exclude: Yo(e?.exclude, me.exclude),
|
|
3367
|
+
manifest: pe
|
|
3368
|
+
}), us = (e) => ({
|
|
3369
|
+
alive: e?.alive ?? ge.alive,
|
|
3370
|
+
scope: e?.scope ?? ge.scope,
|
|
3371
|
+
timeout: e?.timeout ?? ge.timeout,
|
|
3493
3372
|
hooks: e?.hooks
|
|
3494
|
-
}),
|
|
3495
|
-
open: e?.server?.open ??
|
|
3496
|
-
prefix: e?.server?.prefix ??
|
|
3373
|
+
}), ds = (e, t) => ({ setup: Yo(e?.setup, he.setup).map((e) => Xo(t, e)) }), fs = (e) => ({
|
|
3374
|
+
open: e?.server?.open ?? _e.open,
|
|
3375
|
+
prefix: e?.server?.prefix ?? _e.prefix,
|
|
3497
3376
|
mountGmApi: !1
|
|
3498
|
-
}),
|
|
3377
|
+
}), ps = (e, t) => {
|
|
3499
3378
|
let n = t?.build?.fileName ?? `${e.name}.user.js`;
|
|
3500
3379
|
return {
|
|
3501
3380
|
fileName: n,
|
|
3502
|
-
metaFileName:
|
|
3381
|
+
metaFileName: rs(n, t?.build?.metaFileName ?? ve.metaFileName),
|
|
3503
3382
|
externalGlobals: t?.build?.externalGlobals,
|
|
3504
|
-
autoGrant: t?.build?.autoGrant ??
|
|
3383
|
+
autoGrant: t?.build?.autoGrant ?? ve.autoGrant,
|
|
3505
3384
|
externalResource: t?.build?.externalResource,
|
|
3506
3385
|
systemjs: t?.build?.systemjs,
|
|
3507
3386
|
cssSideEffects: t?.build?.cssSideEffects
|
|
3508
3387
|
};
|
|
3509
|
-
},
|
|
3388
|
+
}, ms = (e, t) => {
|
|
3510
3389
|
let { userscript: n, align: r, styleImport: i, server: a, build: o, ...s } = t ?? {};
|
|
3511
3390
|
return {
|
|
3512
3391
|
...s,
|
|
@@ -3516,16 +3395,16 @@ var is = (e, t) => Array.isArray(e) ? e : e === void 0 ? t : [e], as = (e, t) =>
|
|
|
3516
3395
|
description: e.description,
|
|
3517
3396
|
...n
|
|
3518
3397
|
},
|
|
3519
|
-
align: r ??
|
|
3520
|
-
clientAlias:
|
|
3521
|
-
styleImport: i ??
|
|
3522
|
-
server:
|
|
3523
|
-
build:
|
|
3398
|
+
align: r ?? ye.align ?? 2,
|
|
3399
|
+
clientAlias: ye.clientAlias,
|
|
3400
|
+
styleImport: i ?? ye.styleImport ?? !0,
|
|
3401
|
+
server: fs(t),
|
|
3402
|
+
build: ps(e, t)
|
|
3524
3403
|
};
|
|
3525
|
-
},
|
|
3526
|
-
let n =
|
|
3527
|
-
if (!t.componentPath) throw new
|
|
3528
|
-
let s =
|
|
3404
|
+
}, hs = (e, t) => {
|
|
3405
|
+
let n = Zo(t.root), r = t.source ?? ls(void 0, n), a = t.injectionDefaults ?? us(void 0), o = t.moduleDir ? Xo(n, t.moduleDir) : r.dir;
|
|
3406
|
+
if (!t.componentPath) throw new O(e.name ?? e.injectAt);
|
|
3407
|
+
let s = Xo(n, t.componentPath), c = t.moduleDir ? o : s ? i(s) : r.dir, { component: l, framework: u, enabled: d, alive: f, scope: p, timeout: m, ...h } = e, ee = t.moduleId ?? ts(e, c, s, t.fallbackName, t.index), te = $o(e.framework, s), g = t.moduleManifestFile ? Xo(n, t.moduleManifestFile) : void 0;
|
|
3529
3408
|
return {
|
|
3530
3409
|
...h,
|
|
3531
3410
|
moduleId: ee,
|
|
@@ -3537,32 +3416,43 @@ var is = (e, t) => Array.isArray(e) ? e : e === void 0 ? t : [e], as = (e, t) =>
|
|
|
3537
3416
|
alive: e.alive ?? a.alive,
|
|
3538
3417
|
scope: e.scope ?? a.scope,
|
|
3539
3418
|
timeout: e.timeout ?? a.timeout,
|
|
3540
|
-
match:
|
|
3419
|
+
match: es(e.match)
|
|
3541
3420
|
};
|
|
3542
|
-
},
|
|
3543
|
-
let n =
|
|
3544
|
-
return
|
|
3421
|
+
}, gs = (e, t) => {
|
|
3422
|
+
let n = Zo(t.root);
|
|
3423
|
+
return os(e).map((e, r) => hs(e, {
|
|
3545
3424
|
root: n,
|
|
3546
3425
|
source: t.source,
|
|
3547
3426
|
injectionDefaults: t.injectionDefaults,
|
|
3548
3427
|
componentPath: l(t.source.dir, e.component),
|
|
3549
3428
|
index: r
|
|
3550
3429
|
}));
|
|
3551
|
-
},
|
|
3552
|
-
|
|
3553
|
-
|
|
3430
|
+
}, _s = (e, t) => {
|
|
3431
|
+
let { name: n, enabled: r, match: i, ...a } = e;
|
|
3432
|
+
return {
|
|
3433
|
+
...a,
|
|
3434
|
+
listenerId: t.listenerId ?? ns(e, t.fallbackName, t.index),
|
|
3435
|
+
enabled: e.enabled ?? !0,
|
|
3436
|
+
match: es(e.match)
|
|
3437
|
+
};
|
|
3438
|
+
}, vs = (e, t) => ss(e).map((e, n) => _s(e, {
|
|
3439
|
+
root: t.root,
|
|
3440
|
+
index: n
|
|
3441
|
+
})), ys = (e, t = u.cwd()) => {
|
|
3442
|
+
Jo(e);
|
|
3443
|
+
let n = Zo(t), r = cs(e.app), i = ls(e.source, t);
|
|
3554
3444
|
return {
|
|
3555
3445
|
root: n,
|
|
3556
3446
|
app: r,
|
|
3557
|
-
monkey:
|
|
3447
|
+
monkey: ms(r, e.monkey),
|
|
3558
3448
|
source: i,
|
|
3559
|
-
runtime:
|
|
3449
|
+
runtime: ds(e.runtime, n)
|
|
3560
3450
|
};
|
|
3561
3451
|
};
|
|
3562
|
-
function
|
|
3452
|
+
function bs(e, t) {
|
|
3563
3453
|
let n = {
|
|
3564
3454
|
...e.monkey,
|
|
3565
|
-
entry: `./${
|
|
3455
|
+
entry: `./${B}`,
|
|
3566
3456
|
userscript: e.monkey.userscript,
|
|
3567
3457
|
align: e.monkey.align,
|
|
3568
3458
|
generate: e.monkey.generate,
|
|
@@ -3574,8 +3464,8 @@ function Ts(e, t) {
|
|
|
3574
3464
|
return {
|
|
3575
3465
|
...n,
|
|
3576
3466
|
...t,
|
|
3577
|
-
entry: `./${
|
|
3578
|
-
userscript:
|
|
3467
|
+
entry: `./${B}`,
|
|
3468
|
+
userscript: as({
|
|
3579
3469
|
...n.userscript,
|
|
3580
3470
|
...t?.userscript
|
|
3581
3471
|
}),
|
|
@@ -3591,7 +3481,7 @@ function Ts(e, t) {
|
|
|
3591
3481
|
}
|
|
3592
3482
|
//#endregion
|
|
3593
3483
|
//#region node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/constants.js
|
|
3594
|
-
var
|
|
3484
|
+
var xs = /* @__PURE__ */ C(((e, t) => {
|
|
3595
3485
|
var n = "\\\\/", r = `[^${n}]`, i = 0, a = "\\.", o = "\\+", s = "\\?", c = "\\/", l = "(?=.)", u = "[^/]", d = `(?:${c}|$)`, f = `(?:^|${c})`, p = `${a}{1,2}${d}`, m = {
|
|
3596
3486
|
DOT_LITERAL: a,
|
|
3597
3487
|
PLUS_LITERAL: o,
|
|
@@ -3732,8 +3622,8 @@ var Es = /* @__PURE__ */ C(((e, t) => {
|
|
|
3732
3622
|
return e === !0 ? h : m;
|
|
3733
3623
|
}
|
|
3734
3624
|
};
|
|
3735
|
-
})),
|
|
3736
|
-
var { REGEX_BACKSLASH: t, REGEX_REMOVE_BACKSLASH: n, REGEX_SPECIAL_CHARS: r, REGEX_SPECIAL_CHARS_GLOBAL: i } =
|
|
3625
|
+
})), Ss = /* @__PURE__ */ C(((e) => {
|
|
3626
|
+
var { REGEX_BACKSLASH: t, REGEX_REMOVE_BACKSLASH: n, REGEX_SPECIAL_CHARS: r, REGEX_SPECIAL_CHARS_GLOBAL: i } = xs();
|
|
3737
3627
|
e.isObject = (e) => typeof e == "object" && !!e && !Array.isArray(e), e.hasRegexChars = (e) => r.test(e), e.isRegexChar = (t) => t.length === 1 && e.hasRegexChars(t), e.escapeRegex = (e) => e.replace(i, "\\$1"), e.toPosixSlashes = (e) => e.replace(t, "/"), e.isWindows = () => {
|
|
3738
3628
|
if (typeof navigator < "u" && navigator.platform) {
|
|
3739
3629
|
let e = navigator.platform.toLowerCase();
|
|
@@ -3753,8 +3643,8 @@ var Es = /* @__PURE__ */ C(((e, t) => {
|
|
|
3753
3643
|
let n = e.split(t ? /[\\/]/ : "/"), r = n[n.length - 1];
|
|
3754
3644
|
return r === "" ? n[n.length - 2] : r;
|
|
3755
3645
|
};
|
|
3756
|
-
})),
|
|
3757
|
-
var n =
|
|
3646
|
+
})), Cs = /* @__PURE__ */ C(((e, t) => {
|
|
3647
|
+
var n = Ss(), { CHAR_ASTERISK: r, CHAR_AT: i, CHAR_BACKWARD_SLASH: a, CHAR_COMMA: o, CHAR_DOT: s, CHAR_EXCLAMATION_MARK: c, CHAR_FORWARD_SLASH: l, CHAR_LEFT_CURLY_BRACE: u, CHAR_LEFT_PARENTHESES: d, CHAR_LEFT_SQUARE_BRACKET: f, CHAR_PLUS: p, CHAR_QUESTION_MARK: m, CHAR_RIGHT_CURLY_BRACE: h, CHAR_RIGHT_PARENTHESES: ee, CHAR_RIGHT_SQUARE_BRACKET: te } = xs(), g = (e) => e === l || e === a, _ = (e) => {
|
|
3758
3648
|
e.isPrefix !== !0 && (e.depth = e.isGlobstar ? Infinity : 1);
|
|
3759
3649
|
};
|
|
3760
3650
|
t.exports = (e, t) => {
|
|
@@ -3903,8 +3793,8 @@ var Es = /* @__PURE__ */ C(((e, t) => {
|
|
|
3903
3793
|
}
|
|
3904
3794
|
return B;
|
|
3905
3795
|
};
|
|
3906
|
-
})),
|
|
3907
|
-
var n =
|
|
3796
|
+
})), ws = /* @__PURE__ */ C(((e, t) => {
|
|
3797
|
+
var n = xs(), r = Ss(), { MAX_LENGTH: i, POSIX_REGEX_SOURCE: a, REGEX_NON_SPECIAL_CHARS: o, REGEX_SPECIAL_CHARS_BACKREF: s, REPLACEMENTS: c } = n, l = (e, t) => {
|
|
3908
3798
|
if (typeof t.expandRange == "function") return t.expandRange(...e, t);
|
|
3909
3799
|
e.sort();
|
|
3910
3800
|
let n = `[${e.join("-")}]`;
|
|
@@ -4557,8 +4447,8 @@ var Es = /* @__PURE__ */ C(((e, t) => {
|
|
|
4557
4447
|
}, ne = S(r.removePrefix(e, y));
|
|
4558
4448
|
return ne && a.strictSlashes !== !0 && (ne += `${u}?`), ne;
|
|
4559
4449
|
}, t.exports = _;
|
|
4560
|
-
})),
|
|
4561
|
-
var n =
|
|
4450
|
+
})), Ts = /* @__PURE__ */ C(((e, t) => {
|
|
4451
|
+
var n = Cs(), r = ws(), i = Ss(), a = xs(), o = (e) => e && typeof e == "object" && !Array.isArray(e), s = (e, t, n = !1) => {
|
|
4562
4452
|
if (Array.isArray(e)) {
|
|
4563
4453
|
let r = e.map((e) => s(e, t, n));
|
|
4564
4454
|
return (e) => {
|
|
@@ -4638,8 +4528,8 @@ var Es = /* @__PURE__ */ C(((e, t) => {
|
|
|
4638
4528
|
return /$^/;
|
|
4639
4529
|
}
|
|
4640
4530
|
}, s.constants = a, t.exports = s;
|
|
4641
|
-
})),
|
|
4642
|
-
var n =
|
|
4531
|
+
})), Es = /* @__PURE__ */ T((/* @__PURE__ */ C(((e, t) => {
|
|
4532
|
+
var n = Ts(), r = Ss();
|
|
4643
4533
|
function i(e, t, i = !1) {
|
|
4644
4534
|
return t && (t.windows === null || t.windows === void 0) && (t = {
|
|
4645
4535
|
...t,
|
|
@@ -4648,52 +4538,52 @@ var Es = /* @__PURE__ */ C(((e, t) => {
|
|
|
4648
4538
|
}
|
|
4649
4539
|
Object.assign(i, n), t.exports = i;
|
|
4650
4540
|
})))(), 1);
|
|
4651
|
-
function
|
|
4541
|
+
function Ds(e, t) {
|
|
4652
4542
|
let r = n.relative(t, e);
|
|
4653
4543
|
return r === "" || !r.startsWith("..") && !n.isAbsolute(r);
|
|
4654
4544
|
}
|
|
4655
|
-
function
|
|
4545
|
+
function Os(e) {
|
|
4656
4546
|
return e.split(n.sep).includes("node_modules");
|
|
4657
4547
|
}
|
|
4658
|
-
function
|
|
4548
|
+
function ks(e) {
|
|
4659
4549
|
return e.startsWith("./") || e.startsWith("../");
|
|
4660
4550
|
}
|
|
4661
|
-
function
|
|
4551
|
+
function As(e) {
|
|
4662
4552
|
let t = [];
|
|
4663
|
-
for (let n of e.matchAll(
|
|
4553
|
+
for (let n of e.matchAll(z)) {
|
|
4664
4554
|
let e = n[1] ?? n[2];
|
|
4665
|
-
e &&
|
|
4555
|
+
e && ks(e) && t.push(e);
|
|
4666
4556
|
}
|
|
4667
|
-
for (let n of e.matchAll(
|
|
4557
|
+
for (let n of e.matchAll(ce)) {
|
|
4668
4558
|
let e = n[1];
|
|
4669
|
-
e &&
|
|
4559
|
+
e && ks(e) && t.push(e);
|
|
4670
4560
|
}
|
|
4671
4561
|
return t;
|
|
4672
4562
|
}
|
|
4673
|
-
function
|
|
4563
|
+
function js(e) {
|
|
4674
4564
|
return !h(e) || !g(e).isFile() ? null : n.resolve(e);
|
|
4675
4565
|
}
|
|
4676
|
-
function
|
|
4677
|
-
let r = n.resolve(e, t), i =
|
|
4566
|
+
function Ms(e, t) {
|
|
4567
|
+
let r = n.resolve(e, t), i = js(r);
|
|
4678
4568
|
if (i) return i;
|
|
4679
|
-
for (let e of
|
|
4680
|
-
let t =
|
|
4569
|
+
for (let e of R) {
|
|
4570
|
+
let t = js(r + e);
|
|
4681
4571
|
if (t) return t;
|
|
4682
4572
|
}
|
|
4683
|
-
for (let e of
|
|
4684
|
-
let t =
|
|
4573
|
+
for (let e of R) {
|
|
4574
|
+
let t = js(n.join(r, `index${e}`));
|
|
4685
4575
|
if (t) return t;
|
|
4686
4576
|
}
|
|
4687
4577
|
return null;
|
|
4688
4578
|
}
|
|
4689
|
-
function
|
|
4579
|
+
function Ns(e, t) {
|
|
4690
4580
|
let r = n.resolve(t.root), i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), o = (s) => {
|
|
4691
4581
|
let c = n.resolve(s);
|
|
4692
|
-
if (i.has(c) || (i.add(c), !
|
|
4582
|
+
if (i.has(c) || (i.add(c), !Ds(c, r)) || Os(c) || !h(c) || !g(c).isFile()) return;
|
|
4693
4583
|
(t.includeEntry || c !== n.resolve(e)) && a.add(c);
|
|
4694
4584
|
let l = ee(c, "utf8"), u = n.dirname(c);
|
|
4695
|
-
for (let e of
|
|
4696
|
-
let t =
|
|
4585
|
+
for (let e of As(l)) {
|
|
4586
|
+
let t = Ms(u, e);
|
|
4697
4587
|
t && o(t);
|
|
4698
4588
|
}
|
|
4699
4589
|
};
|
|
@@ -4701,46 +4591,72 @@ function Rs(e, t) {
|
|
|
4701
4591
|
}
|
|
4702
4592
|
//#endregion
|
|
4703
4593
|
//#region packages/cli/src/scanner/validation.ts
|
|
4704
|
-
var
|
|
4705
|
-
alive:
|
|
4706
|
-
scope:
|
|
4707
|
-
timeout:
|
|
4708
|
-
hooks:
|
|
4709
|
-
}),
|
|
4710
|
-
include:
|
|
4711
|
-
exclude:
|
|
4712
|
-
})]),
|
|
4594
|
+
var Ps = bo(p), Fs = Ho((e) => typeof e == "function"), Is = mo([Fs, lo(Fs)]), Ls = vo(Q(), Is).refine((e) => Object.keys(e).every((e) => Ps.safeParse(e).success), { message: "Invalid hook event name" }), Rs = fo({
|
|
4595
|
+
alive: ro().optional(),
|
|
4596
|
+
scope: bo(["local", "global"]).optional(),
|
|
4597
|
+
timeout: $a().optional(),
|
|
4598
|
+
hooks: Ls.optional()
|
|
4599
|
+
}), zs = mo([lo(Q()), fo({
|
|
4600
|
+
include: lo(Q()).optional(),
|
|
4601
|
+
exclude: lo(Q()).optional()
|
|
4602
|
+
})]), Bs = Ho((e) => typeof e == "function"), Vs = Ho((e) => typeof e == "function"), Hs = fo({
|
|
4603
|
+
listenAt: Q(),
|
|
4604
|
+
type: Q(),
|
|
4605
|
+
callback: Bs,
|
|
4606
|
+
activitySignal: Vs.optional()
|
|
4607
|
+
}), Us = fo({
|
|
4713
4608
|
name: Q().optional(),
|
|
4714
4609
|
injectAt: Q(),
|
|
4715
4610
|
component: Q(),
|
|
4716
|
-
framework:
|
|
4611
|
+
framework: bo([
|
|
4717
4612
|
"auto",
|
|
4718
4613
|
"Vue",
|
|
4719
4614
|
"React"
|
|
4720
4615
|
]).optional(),
|
|
4721
|
-
enabled:
|
|
4722
|
-
match:
|
|
4723
|
-
alive:
|
|
4724
|
-
scope:
|
|
4725
|
-
timeout:
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4616
|
+
enabled: ro().optional(),
|
|
4617
|
+
match: zs.optional(),
|
|
4618
|
+
alive: ro().optional(),
|
|
4619
|
+
scope: bo(["local", "global"]).optional(),
|
|
4620
|
+
timeout: $a().optional(),
|
|
4621
|
+
hooks: Ls.optional(),
|
|
4622
|
+
on: Hs.optional()
|
|
4623
|
+
}), Ws = Hs.extend({
|
|
4624
|
+
name: Q().optional(),
|
|
4625
|
+
enabled: ro().optional(),
|
|
4626
|
+
match: zs.optional()
|
|
4627
|
+
}), Gs = fo({
|
|
4628
|
+
injectionDefaults: Rs.optional(),
|
|
4629
|
+
injections: mo([lo(Us), vo(Q(), Us.omit({ name: !0 }))]).optional(),
|
|
4630
|
+
listeners: mo([lo(Ws), vo(Q(), Ws.omit({ name: !0 }))]).optional()
|
|
4631
|
+
}).strict().refine((e) => e.injections || e.listeners, { message: "Manifest must define injections or listeners" });
|
|
4730
4632
|
function Ks(e, t) {
|
|
4731
4633
|
let n = Gs.safeParse(e);
|
|
4732
|
-
if (!n.success) throw new
|
|
4733
|
-
return n.data;
|
|
4634
|
+
if (!n.success) throw new re(t, n.error.issues);
|
|
4635
|
+
return Js(n.data, t), n.data;
|
|
4734
4636
|
}
|
|
4735
4637
|
function qs(e, t) {
|
|
4736
|
-
let n =
|
|
4737
|
-
if (!n.success) throw new
|
|
4738
|
-
return n.data;
|
|
4638
|
+
let n = Us.safeParse(e);
|
|
4639
|
+
if (!n.success) throw new re(t, n.error.issues);
|
|
4640
|
+
return Ys(n.data.injectAt, t, "injectAt"), Ys(n.data.on?.listenAt, t, "on.listenAt"), n.data;
|
|
4641
|
+
}
|
|
4642
|
+
function Js(e, t) {
|
|
4643
|
+
Array.isArray(e.injections) ? e.injections.forEach((e, n) => {
|
|
4644
|
+
Ys(e.injectAt, t, `injections[${n}].injectAt`), Ys(e.on?.listenAt, t, `injections[${n}].on.listenAt`);
|
|
4645
|
+
}) : e.injections && Object.entries(e.injections).forEach(([e, n]) => {
|
|
4646
|
+
Ys(n.injectAt, t, `injections.${e}.injectAt`), Ys(n.on?.listenAt, t, `injections.${e}.on.listenAt`);
|
|
4647
|
+
}), Array.isArray(e.listeners) ? e.listeners.forEach((e, n) => {
|
|
4648
|
+
Ys(e.listenAt, t, `listeners[${n}].listenAt`);
|
|
4649
|
+
}) : e.listeners && Object.entries(e.listeners).forEach(([e, n]) => {
|
|
4650
|
+
Ys(n.listenAt, t, `listeners.${e}.listenAt`);
|
|
4651
|
+
});
|
|
4652
|
+
}
|
|
4653
|
+
function Ys(e, t, n) {
|
|
4654
|
+
if (e === "document" || e === "window") throw new j(t, n, e);
|
|
4739
4655
|
}
|
|
4740
4656
|
//#endregion
|
|
4741
4657
|
//#region packages/cli/src/scanner/load/loadManifes.ts
|
|
4742
|
-
async function
|
|
4743
|
-
if (!h(e.dir)) throw new
|
|
4658
|
+
async function Xs(e) {
|
|
4659
|
+
if (!h(e.dir)) throw new ae(e.dir);
|
|
4744
4660
|
let t = e.manifest, r = _(e.dir, { moduleCache: !1 });
|
|
4745
4661
|
for (let i of te(e.dir)) {
|
|
4746
4662
|
let a = n.join(e.dir, i);
|
|
@@ -4749,12 +4665,12 @@ async function Js(e) {
|
|
|
4749
4665
|
try {
|
|
4750
4666
|
t = await r.import(a, { default: !0 });
|
|
4751
4667
|
} catch (e) {
|
|
4752
|
-
throw new
|
|
4668
|
+
throw new se(a, void 0, e instanceof Error ? e : void 0);
|
|
4753
4669
|
}
|
|
4754
4670
|
return {
|
|
4755
4671
|
manifest: Ks(t, a),
|
|
4756
4672
|
manifestFile: a,
|
|
4757
|
-
dependencies:
|
|
4673
|
+
dependencies: Ns(a, { root: n.resolve(e.dir, "..") })
|
|
4758
4674
|
};
|
|
4759
4675
|
}
|
|
4760
4676
|
}
|
|
@@ -4762,7 +4678,7 @@ async function Js(e) {
|
|
|
4762
4678
|
}
|
|
4763
4679
|
//#endregion
|
|
4764
4680
|
//#region packages/cli/src/scanner/load/loadMeta.ts
|
|
4765
|
-
async function
|
|
4681
|
+
async function Zs(e) {
|
|
4766
4682
|
let t = m.readdirSync(e).filter((t) => {
|
|
4767
4683
|
let r = n.join(e, t);
|
|
4768
4684
|
return m.statSync(r).isFile();
|
|
@@ -4774,44 +4690,118 @@ async function Ys(e) {
|
|
|
4774
4690
|
try {
|
|
4775
4691
|
a = await r.import(t, { default: !0 });
|
|
4776
4692
|
} catch (e) {
|
|
4777
|
-
throw new
|
|
4693
|
+
throw new N(t, void 0, e instanceof Error ? e : void 0);
|
|
4778
4694
|
}
|
|
4779
4695
|
return {
|
|
4780
4696
|
moduleManifestFile: t,
|
|
4781
4697
|
moduleConfig: qs(a, t),
|
|
4782
|
-
dependencies:
|
|
4698
|
+
dependencies: Ns(t, { root: n.resolve(e, "..", "..") })
|
|
4783
4699
|
};
|
|
4784
4700
|
}
|
|
4785
4701
|
return null;
|
|
4786
4702
|
}
|
|
4787
4703
|
//#endregion
|
|
4704
|
+
//#region packages/cli/src/scanner/manifestBinding.ts
|
|
4705
|
+
function Qs(e) {
|
|
4706
|
+
let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = nc(e.manifest.injections), a = nc(e.manifest.listeners), o = os(e.manifest), s = ss(e.manifest);
|
|
4707
|
+
return e.manifestInjections.forEach((n, r) => {
|
|
4708
|
+
t.set(n.moduleId, {
|
|
4709
|
+
config: o[r],
|
|
4710
|
+
binding: {
|
|
4711
|
+
manifestFile: e.manifestFile,
|
|
4712
|
+
valuePath: ["injections", i[r]]
|
|
4713
|
+
}
|
|
4714
|
+
});
|
|
4715
|
+
}), e.moduleInjections.forEach((t) => {
|
|
4716
|
+
if (!t.moduleManifestFile) return;
|
|
4717
|
+
let r = e.moduleInjectionConfigs.get(t.moduleId);
|
|
4718
|
+
if (!r) throw new k("injection", t.moduleId);
|
|
4719
|
+
n.set(t.moduleId, {
|
|
4720
|
+
config: r,
|
|
4721
|
+
binding: {
|
|
4722
|
+
manifestFile: t.moduleManifestFile,
|
|
4723
|
+
valuePath: []
|
|
4724
|
+
}
|
|
4725
|
+
});
|
|
4726
|
+
}), e.manifestListeners.forEach((t, n) => {
|
|
4727
|
+
let i = {
|
|
4728
|
+
manifestFile: e.manifestFile,
|
|
4729
|
+
valuePath: ["listeners", a[n]]
|
|
4730
|
+
}, o = s[n];
|
|
4731
|
+
r.set(t.listenerId, {
|
|
4732
|
+
callback: tc(i, ["callback"]),
|
|
4733
|
+
activitySignal: o.activitySignal ? tc(i, ["activitySignal"]) : void 0
|
|
4734
|
+
});
|
|
4735
|
+
}), {
|
|
4736
|
+
injectionDefaults: e.manifest.injectionDefaults?.hooks ? { hooks: {
|
|
4737
|
+
manifestFile: e.manifestFile,
|
|
4738
|
+
valuePath: ["injectionDefaults", "hooks"]
|
|
4739
|
+
} } : void 0,
|
|
4740
|
+
injections: Object.fromEntries(e.enabledInjections.map((e) => {
|
|
4741
|
+
let r = t.get(e.moduleId), i = n.get(e.moduleId);
|
|
4742
|
+
if (!r && !i) throw new k("injection", e.moduleId);
|
|
4743
|
+
return [e.moduleId, $s(r, i)];
|
|
4744
|
+
})),
|
|
4745
|
+
listeners: rc(e.enabledListeners.map((e) => e.listenerId), r, "listener")
|
|
4746
|
+
};
|
|
4747
|
+
}
|
|
4748
|
+
function $s(e, t) {
|
|
4749
|
+
let n = ec("hooks", e, t), r = ec("on", e, t);
|
|
4750
|
+
return {
|
|
4751
|
+
hooks: n?.config.hooks ? tc(n.binding, ["hooks"]) : void 0,
|
|
4752
|
+
on: r?.config.on ? {
|
|
4753
|
+
callback: tc(r.binding, ["on", "callback"]),
|
|
4754
|
+
activitySignal: r.config.on.activitySignal ? tc(r.binding, ["on", "activitySignal"]) : void 0
|
|
4755
|
+
} : void 0
|
|
4756
|
+
};
|
|
4757
|
+
}
|
|
4758
|
+
function ec(e, t, n) {
|
|
4759
|
+
return n && Object.hasOwn(n.config, e) ? n : t;
|
|
4760
|
+
}
|
|
4761
|
+
function tc(e, t) {
|
|
4762
|
+
return {
|
|
4763
|
+
manifestFile: e.manifestFile,
|
|
4764
|
+
valuePath: [...e.valuePath, ...t]
|
|
4765
|
+
};
|
|
4766
|
+
}
|
|
4767
|
+
function nc(e) {
|
|
4768
|
+
return e ? Array.isArray(e) ? e.map((e, t) => t) : Object.keys(e) : [];
|
|
4769
|
+
}
|
|
4770
|
+
function rc(e, t, n) {
|
|
4771
|
+
return Object.fromEntries(e.map((e) => {
|
|
4772
|
+
let r = t.get(e);
|
|
4773
|
+
if (!r) throw new k(n, e);
|
|
4774
|
+
return [e, r];
|
|
4775
|
+
}));
|
|
4776
|
+
}
|
|
4777
|
+
//#endregion
|
|
4788
4778
|
//#region packages/cli/src/scanner/util.ts
|
|
4789
|
-
function
|
|
4779
|
+
function ic(e, t) {
|
|
4790
4780
|
let n = new Map(t.map((e) => [e.moduleId, e])), r = e.map((e) => n.get(e.moduleId) ?? e);
|
|
4791
4781
|
for (let n of t) e.some((e) => e.moduleId === n.moduleId) || r.push(n);
|
|
4792
4782
|
return r;
|
|
4793
4783
|
}
|
|
4794
4784
|
//#endregion
|
|
4795
4785
|
//#region packages/cli/src/scanner/scanner.ts
|
|
4796
|
-
async function
|
|
4797
|
-
let t = await
|
|
4798
|
-
if (!t) throw new
|
|
4786
|
+
async function ac(e) {
|
|
4787
|
+
let t = await Xs(e.source);
|
|
4788
|
+
if (!t) throw new oe(e.source.dir);
|
|
4799
4789
|
let r = new Set(t.dependencies), i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set();
|
|
4800
4790
|
for (let t of e.runtime.setup) {
|
|
4801
|
-
if (!h(t)) throw new
|
|
4791
|
+
if (!h(t)) throw new E(t);
|
|
4802
4792
|
a.add(t);
|
|
4803
|
-
for (let n of
|
|
4793
|
+
for (let n of Ns(t, { root: e.root })) o.add(n);
|
|
4804
4794
|
}
|
|
4805
|
-
let s =
|
|
4795
|
+
let s = us(t.manifest.injectionDefaults), c = gs(t.manifest, {
|
|
4806
4796
|
root: e.root,
|
|
4807
4797
|
source: e.source,
|
|
4808
4798
|
injectionDefaults: s
|
|
4809
|
-
}), l = te(e.source.dir, { withFileTypes: !0 }).filter((e) => e.isDirectory()).map((e) => e.name),
|
|
4810
|
-
for (let t of
|
|
4811
|
-
let r = n.join(e.source.dir, t), a = await
|
|
4799
|
+
}), l = os(t.manifest), u = new Map(c.map((e, t) => [e.moduleId, l[t]])), d = te(e.source.dir, { withFileTypes: !0 }).filter((e) => e.isDirectory()).map((e) => e.name), f = (0, Es.default)(e.source.include), p = (0, Es.default)(e.source.exclude), m = d.filter((e) => f(e) && !p(e)), ee = [], g = /* @__PURE__ */ new Map();
|
|
4800
|
+
for (let t of m) {
|
|
4801
|
+
let r = n.join(e.source.dir, t), a = await Zs(r);
|
|
4812
4802
|
if (!a) continue;
|
|
4813
4803
|
for (let e of a.dependencies) i.add(e);
|
|
4814
|
-
let o =
|
|
4804
|
+
let o = {
|
|
4815
4805
|
root: e.root,
|
|
4816
4806
|
source: e.source,
|
|
4817
4807
|
injectionDefaults: s,
|
|
@@ -4819,68 +4809,84 @@ async function Zs(e) {
|
|
|
4819
4809
|
componentPath: n.join(r, a.moduleConfig.component),
|
|
4820
4810
|
fallbackName: t,
|
|
4821
4811
|
moduleManifestFile: a.moduleManifestFile
|
|
4822
|
-
})
|
|
4823
|
-
|
|
4812
|
+
}, c = a.moduleConfig.name || t, l = u.get(c), d = hs(l ? {
|
|
4813
|
+
...l,
|
|
4814
|
+
...a.moduleConfig
|
|
4815
|
+
} : a.moduleConfig, o);
|
|
4816
|
+
ee.push(d), g.set(d.moduleId, a.moduleConfig);
|
|
4824
4817
|
}
|
|
4825
|
-
let
|
|
4826
|
-
if (
|
|
4827
|
-
|
|
4828
|
-
|
|
4818
|
+
let _ = ic(c, ee).filter((e) => e.enabled), v = vs(t.manifest, { root: e.root }), y = v.filter((e) => e.enabled);
|
|
4819
|
+
if (_.length === 0 && y.length === 0) throw new P();
|
|
4820
|
+
let b = Qs({
|
|
4821
|
+
manifest: t.manifest,
|
|
4822
|
+
manifestFile: t.manifestFile,
|
|
4823
|
+
manifestInjections: c,
|
|
4824
|
+
moduleInjections: ee,
|
|
4825
|
+
moduleInjectionConfigs: g,
|
|
4826
|
+
manifestListeners: v,
|
|
4827
|
+
enabledInjections: _,
|
|
4828
|
+
enabledListeners: y
|
|
4829
|
+
});
|
|
4830
|
+
_.sort((e, t) => e.moduleId.localeCompare(t.moduleId)), y.sort((e, t) => e.listenerId.localeCompare(t.listenerId));
|
|
4831
|
+
let x = [...new Set(_.map((e) => e.framework))];
|
|
4829
4832
|
return {
|
|
4830
4833
|
config: e,
|
|
4831
4834
|
injectionDefaults: s,
|
|
4832
4835
|
manifestFile: t.manifestFile,
|
|
4836
|
+
manifestBindings: b,
|
|
4833
4837
|
manifestDependencies: [...r].sort(),
|
|
4834
4838
|
moduleManifestDependencies: [...i].sort(),
|
|
4835
4839
|
runtimeSetupFiles: [...a].sort(),
|
|
4836
4840
|
runtimeDependencies: [...o].sort(),
|
|
4837
|
-
injections:
|
|
4838
|
-
|
|
4841
|
+
injections: _,
|
|
4842
|
+
listeners: y,
|
|
4843
|
+
frameworks: x
|
|
4839
4844
|
};
|
|
4840
4845
|
}
|
|
4841
4846
|
//#endregion
|
|
4842
4847
|
//#region packages/cli/src/shared/terminalColor.ts
|
|
4843
|
-
var
|
|
4848
|
+
var oc = {
|
|
4844
4849
|
reset: "\x1B[0m",
|
|
4845
4850
|
bold: "\x1B[1m",
|
|
4846
4851
|
cyan: "\x1B[36m",
|
|
4852
|
+
deepPink: "\x1B[38;5;162m",
|
|
4847
4853
|
green: "\x1B[32m",
|
|
4848
4854
|
dim: "\x1B[2m"
|
|
4849
|
-
},
|
|
4855
|
+
}, sc = (e, ...t) => `${t.join("")}${e}${oc.reset}`;
|
|
4850
4856
|
//#endregion
|
|
4851
4857
|
//#region packages/cli/src/vitePlugin/hmrController.ts
|
|
4852
|
-
function
|
|
4853
|
-
let t = e.moduleGraph.getModuleById(
|
|
4858
|
+
function cc(e) {
|
|
4859
|
+
let t = e.moduleGraph.getModuleById(le);
|
|
4854
4860
|
t && e.moduleGraph.invalidateModule(t);
|
|
4855
4861
|
}
|
|
4856
|
-
function
|
|
4862
|
+
function lc(e, t) {
|
|
4857
4863
|
let n = t instanceof Error ? t : Error(String(t));
|
|
4858
4864
|
e.hot.send({
|
|
4859
4865
|
type: "error",
|
|
4860
4866
|
err: {
|
|
4861
4867
|
message: n.message,
|
|
4862
4868
|
stack: n.stack ?? "",
|
|
4863
|
-
id:
|
|
4869
|
+
id: le,
|
|
4864
4870
|
frame: "",
|
|
4865
4871
|
plugin: "vite-plugin-makoo",
|
|
4866
4872
|
loc: void 0
|
|
4867
4873
|
}
|
|
4868
4874
|
});
|
|
4869
4875
|
}
|
|
4870
|
-
function
|
|
4876
|
+
function uc(e) {
|
|
4871
4877
|
e.moduleGraph.getModuleById("\0virtual:makoo/entry") && e.hot.send({
|
|
4872
4878
|
type: "update",
|
|
4873
4879
|
updates: [{
|
|
4874
4880
|
type: "js-update",
|
|
4875
|
-
path:
|
|
4876
|
-
acceptedPath:
|
|
4881
|
+
path: le,
|
|
4882
|
+
acceptedPath: le,
|
|
4877
4883
|
timestamp: Date.now(),
|
|
4878
4884
|
explicitImportRequired: !1,
|
|
4879
4885
|
isWithinCircularImport: !1
|
|
4880
4886
|
}]
|
|
4881
4887
|
});
|
|
4882
4888
|
}
|
|
4883
|
-
function
|
|
4889
|
+
function dc(e, t) {
|
|
4884
4890
|
e.hot.send({
|
|
4885
4891
|
type: "custom",
|
|
4886
4892
|
event: "makoo:structural-hmr",
|
|
@@ -4889,7 +4895,7 @@ function rc(e, t) {
|
|
|
4889
4895
|
}
|
|
4890
4896
|
//#endregion
|
|
4891
4897
|
//#region packages/cli/src/generator/render/import/importAdapter.ts
|
|
4892
|
-
function
|
|
4898
|
+
function fc(e) {
|
|
4893
4899
|
let t = /* @__PURE__ */ new Set();
|
|
4894
4900
|
return e.forEach((e) => {
|
|
4895
4901
|
t.add(e.framework);
|
|
@@ -4906,23 +4912,23 @@ function ic(e) {
|
|
|
4906
4912
|
}
|
|
4907
4913
|
//#endregion
|
|
4908
4914
|
//#region packages/cli/src/generator/render/import/importComp.ts
|
|
4909
|
-
var
|
|
4915
|
+
var pc = (e) => e.replace(/\\/g, "/"), mc = (e) => {
|
|
4910
4916
|
let t = e.replace(/[^a-zA-Z0-9_$]/g, "_");
|
|
4911
4917
|
return /^[a-zA-Z_$]/.test(t) ? t : `_${t}`;
|
|
4912
|
-
},
|
|
4918
|
+
}, hc = () => {
|
|
4913
4919
|
let e = /* @__PURE__ */ new Map();
|
|
4914
4920
|
return (t) => {
|
|
4915
|
-
let n = `Injection_${
|
|
4921
|
+
let n = `Injection_${mc(t)}`, r = e.get(n) ?? 0;
|
|
4916
4922
|
return e.set(n, r + 1), r === 0 ? n : `${n}_${r}`;
|
|
4917
4923
|
};
|
|
4918
4924
|
};
|
|
4919
|
-
function
|
|
4920
|
-
let t =
|
|
4925
|
+
function gc(e) {
|
|
4926
|
+
let t = hc(), n = e.map((e) => {
|
|
4921
4927
|
let n = t(e.moduleId);
|
|
4922
4928
|
return {
|
|
4923
4929
|
componentMeta: e,
|
|
4924
4930
|
componentName: n,
|
|
4925
|
-
code: `import ${n} from '${
|
|
4931
|
+
code: `import ${n} from '${pc(e.componentPath)}';`
|
|
4926
4932
|
};
|
|
4927
4933
|
}), r = n.map((e) => ({
|
|
4928
4934
|
code: e.code,
|
|
@@ -4936,34 +4942,145 @@ function cc(e) {
|
|
|
4936
4942
|
}
|
|
4937
4943
|
//#endregion
|
|
4938
4944
|
//#region packages/cli/src/generator/render/import/importMakooRuntime.ts
|
|
4939
|
-
function
|
|
4945
|
+
function _c() {
|
|
4940
4946
|
return "import { createMakoo, inject, listen } from '@makoojs/core'; \n";
|
|
4941
4947
|
}
|
|
4942
4948
|
//#endregion
|
|
4949
|
+
//#region packages/cli/src/generator/render/import/importManifest.ts
|
|
4950
|
+
var vc = (e) => e.replace(/\\/g, "/"), yc = (e) => {
|
|
4951
|
+
let t = bc(e).map((e) => e.manifestFile);
|
|
4952
|
+
return [...new Set(t.map(vc))].sort();
|
|
4953
|
+
}, bc = (e) => [
|
|
4954
|
+
...e.injectionDefaults ? [e.injectionDefaults.hooks] : [],
|
|
4955
|
+
...Object.values(e.injections).flatMap((e) => [
|
|
4956
|
+
e.hooks,
|
|
4957
|
+
e.on?.callback,
|
|
4958
|
+
e.on?.activitySignal
|
|
4959
|
+
].filter((e) => !!e)),
|
|
4960
|
+
...Object.values(e.listeners).flatMap((e) => [e.callback, e.activitySignal].filter((e) => !!e))
|
|
4961
|
+
], xc = (e) => e.map((e) => `[${JSON.stringify(e)}]`).join("");
|
|
4962
|
+
function Sc(e) {
|
|
4963
|
+
let t = new Map(yc(e).map((e, t) => [e, `Manifest_${t}`]));
|
|
4964
|
+
return {
|
|
4965
|
+
code: [...t].map(([e, t]) => `import ${t} from '${e}';`).join("\n"),
|
|
4966
|
+
renderReference(e) {
|
|
4967
|
+
let n = t.get(vc(e.manifestFile));
|
|
4968
|
+
if (!n) throw new A(e.manifestFile);
|
|
4969
|
+
return `${n}${xc(e.valuePath)}`;
|
|
4970
|
+
}
|
|
4971
|
+
};
|
|
4972
|
+
}
|
|
4973
|
+
//#endregion
|
|
4943
4974
|
//#region packages/cli/src/generator/render/import/importRuntimeSetup.ts
|
|
4944
|
-
var
|
|
4945
|
-
function
|
|
4946
|
-
return e.map((e) => `import '${
|
|
4975
|
+
var Cc = (e) => e.replace(/\\/g, "/");
|
|
4976
|
+
function wc(e) {
|
|
4977
|
+
return e.map((e) => `import '${Cc(e)}';`).join("\n");
|
|
4947
4978
|
}
|
|
4948
4979
|
//#endregion
|
|
4949
4980
|
//#region packages/cli/src/generator/render/util/value.ts
|
|
4950
|
-
var
|
|
4981
|
+
var Tc = (e) => `{${Object.entries(e).filter(([, e]) => e !== void 0).map(([e, t]) => `${JSON.stringify(e)}:${Ec(t)}`).join(",")}}`, Ec = (e) => {
|
|
4982
|
+
if (typeof e == "function") throw new M();
|
|
4983
|
+
return Array.isArray(e) ? `[${e.map((e) => Ec(e)).join(",")}]` : e && typeof e == "object" ? Tc(e) : JSON.stringify(e);
|
|
4984
|
+
};
|
|
4951
4985
|
//#endregion
|
|
4952
4986
|
//#region packages/cli/src/generator/render/init/initMakooRuntime.ts
|
|
4953
|
-
function
|
|
4954
|
-
let
|
|
4987
|
+
function Dc(e, t, n, r) {
|
|
4988
|
+
let i = "makoo", { hooks: a, ...o } = t, s = e.map((e) => `create${e}Adapter()`), c;
|
|
4989
|
+
if (a) {
|
|
4990
|
+
if (!n) throw new k("injectionDefaults", "hooks");
|
|
4991
|
+
c = r(n.hooks);
|
|
4992
|
+
}
|
|
4955
4993
|
return {
|
|
4956
|
-
code: [`${
|
|
4957
|
-
`defaults: ${
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
].filter(Boolean).join(",\n ")}\n});`, `const ${
|
|
4961
|
-
instanceName:
|
|
4994
|
+
code: [`${i} = createMakoo({\n ${[
|
|
4995
|
+
`defaults: ${Ec(o)}`,
|
|
4996
|
+
s.length > 0 ? `adapters: [${s.join(", ")}]` : null,
|
|
4997
|
+
c ? `hooks: ${c}` : null
|
|
4998
|
+
].filter(Boolean).join(",\n ")}\n});`, `const ${i}Tasks = [];`].join("\n"),
|
|
4999
|
+
instanceName: i
|
|
4962
5000
|
};
|
|
4963
5001
|
}
|
|
4964
5002
|
//#endregion
|
|
4965
5003
|
//#region packages/cli/src/generator/render/init/registerComp.ts
|
|
4966
|
-
|
|
5004
|
+
function Oc(e, t, n, r) {
|
|
5005
|
+
return {
|
|
5006
|
+
code: t.map((t) => {
|
|
5007
|
+
let i = n[t.componentMeta.moduleId], a = kc(t, i, r), o = `${e}Tasks.push(inject({${[
|
|
5008
|
+
`"id":${JSON.stringify(t.componentMeta.moduleId)}`,
|
|
5009
|
+
`"injectAt":${JSON.stringify(t.componentMeta.injectAt)}`,
|
|
5010
|
+
`"artifact":${t.componentName}`,
|
|
5011
|
+
`"options":${a}`
|
|
5012
|
+
].join(",")}}));`;
|
|
5013
|
+
return t.componentMeta.match ? [
|
|
5014
|
+
`if (matchUrl(location.href, ${Ec(t.componentMeta.match)})) {`,
|
|
5015
|
+
` ${o}`,
|
|
5016
|
+
"}"
|
|
5017
|
+
].join("\n") : o;
|
|
5018
|
+
}).join("\n"),
|
|
5019
|
+
instanceName: e
|
|
5020
|
+
};
|
|
5021
|
+
}
|
|
5022
|
+
function kc(e, t, n) {
|
|
5023
|
+
let { componentMeta: r } = e, i = {
|
|
5024
|
+
alive: r.alive,
|
|
5025
|
+
scope: r.scope,
|
|
5026
|
+
timeout: r.timeout
|
|
5027
|
+
}, a = Object.entries(i).filter(([, e]) => e !== void 0).map(([e, t]) => `${JSON.stringify(e)}:${Ec(t)}`);
|
|
5028
|
+
if (r.hooks) {
|
|
5029
|
+
if (!t?.hooks) throw new k("injection", `${r.moduleId}.hooks`);
|
|
5030
|
+
a.push(`"hooks":${n(t.hooks)}`);
|
|
5031
|
+
}
|
|
5032
|
+
if (r.on) {
|
|
5033
|
+
if (!t?.on) throw new k("injection", `${r.moduleId}.on`);
|
|
5034
|
+
let e = [
|
|
5035
|
+
`"listenAt":${JSON.stringify(r.on.listenAt)}`,
|
|
5036
|
+
`"type":${JSON.stringify(r.on.type)}`,
|
|
5037
|
+
`"callback":${n(t.on.callback)}`,
|
|
5038
|
+
r.on.activitySignal ? Ac(r.moduleId, t, n) : null
|
|
5039
|
+
].filter(Boolean).join(",");
|
|
5040
|
+
a.push(`"on":listen({${e}})`);
|
|
5041
|
+
}
|
|
5042
|
+
return `{${a.join(",")}}`;
|
|
5043
|
+
}
|
|
5044
|
+
function Ac(e, t, n) {
|
|
5045
|
+
let r = t.on?.activitySignal;
|
|
5046
|
+
if (!r) throw new k("injection", `${e}.on.activitySignal`);
|
|
5047
|
+
return `"activitySignal":${n(r)}`;
|
|
5048
|
+
}
|
|
5049
|
+
//#endregion
|
|
5050
|
+
//#region packages/cli/src/generator/render/init/registerListener.ts
|
|
5051
|
+
function jc(e, t, n, r) {
|
|
5052
|
+
return {
|
|
5053
|
+
code: t.map((t) => {
|
|
5054
|
+
let i = n[t.listenerId];
|
|
5055
|
+
if (!i) throw new k("listener", t.listenerId);
|
|
5056
|
+
let a = `${e}Tasks.push(listen({${[
|
|
5057
|
+
`"id":${JSON.stringify(t.listenerId)}`,
|
|
5058
|
+
`"listenAt":${JSON.stringify(t.listenAt)}`,
|
|
5059
|
+
`"type":${JSON.stringify(t.type)}`,
|
|
5060
|
+
`"callback":${r(i.callback)}`,
|
|
5061
|
+
t.activitySignal ? Mc(t.listenerId, i.activitySignal, r) : null
|
|
5062
|
+
].filter(Boolean).join(",")}}));`;
|
|
5063
|
+
return t.match ? [
|
|
5064
|
+
`if (matchUrl(location.href, ${Ec(t.match)})) {`,
|
|
5065
|
+
` ${a}`,
|
|
5066
|
+
"}"
|
|
5067
|
+
].join("\n") : a;
|
|
5068
|
+
}).join("\n"),
|
|
5069
|
+
instanceName: e
|
|
5070
|
+
};
|
|
5071
|
+
}
|
|
5072
|
+
function Mc(e, t, n) {
|
|
5073
|
+
if (!t) throw new k("listener", `${e}.activitySignal`);
|
|
5074
|
+
return `"activitySignal":${n(t)}`;
|
|
5075
|
+
}
|
|
5076
|
+
//#endregion
|
|
5077
|
+
//#region packages/cli/src/generator/render/run/renderMakooStart.ts
|
|
5078
|
+
function Nc(e) {
|
|
5079
|
+
return `${e}.start(${e}Tasks)`;
|
|
5080
|
+
}
|
|
5081
|
+
//#endregion
|
|
5082
|
+
//#region packages/cli/src/generator/render/util/match.ts
|
|
5083
|
+
var Pc = () => [
|
|
4967
5084
|
"const matchUrl = (url, match) => {",
|
|
4968
5085
|
" if (!match) return true;",
|
|
4969
5086
|
" const matches = (patterns) => {",
|
|
@@ -4977,57 +5094,25 @@ var hc = () => [
|
|
|
4977
5094
|
" return true;",
|
|
4978
5095
|
"};"
|
|
4979
5096
|
].join("\n");
|
|
4980
|
-
function gc(e, t) {
|
|
4981
|
-
let n = t.some((e) => e.componentMeta.match), r = t.map((t) => {
|
|
4982
|
-
let n = _c({
|
|
4983
|
-
alive: t.componentMeta.alive,
|
|
4984
|
-
scope: t.componentMeta.scope,
|
|
4985
|
-
timeout: t.componentMeta.timeout,
|
|
4986
|
-
hooks: t.componentMeta.hooks
|
|
4987
|
-
}, t.componentMeta.on), r = `${e}Tasks.push(inject({${[
|
|
4988
|
-
`"id":${JSON.stringify(t.componentMeta.moduleId)}`,
|
|
4989
|
-
`"injectAt":${JSON.stringify(t.componentMeta.injectAt)}`,
|
|
4990
|
-
`"artifact":${t.componentName}`,
|
|
4991
|
-
`"options":${n}`
|
|
4992
|
-
].join(",")}}));`;
|
|
4993
|
-
return t.componentMeta.match ? [
|
|
4994
|
-
`if (matchUrl(location.href, ${pc(t.componentMeta.match)})) {`,
|
|
4995
|
-
` ${r}`,
|
|
4996
|
-
"}"
|
|
4997
|
-
].join("\n") : r;
|
|
4998
|
-
});
|
|
4999
|
-
return {
|
|
5000
|
-
code: [n ? hc() : null, r.join("\n")].filter(Boolean).join("\n"),
|
|
5001
|
-
instanceName: e
|
|
5002
|
-
};
|
|
5003
|
-
}
|
|
5004
|
-
function _c(e, t) {
|
|
5005
|
-
let n = Object.entries(e).filter(([, e]) => e !== void 0).map(([e, t]) => `${JSON.stringify(e)}:${pc(t)}`);
|
|
5006
|
-
if (t) {
|
|
5007
|
-
let e = t.activitySignal ? `, { "activitySignal":${pc(t.activitySignal)} }` : "";
|
|
5008
|
-
n.push(`"on":listen(${JSON.stringify(t.listenAt)}, ${JSON.stringify(t.type)}, ${pc(t.callback)}${e})`);
|
|
5009
|
-
}
|
|
5010
|
-
return `{${n.join(",")}}`;
|
|
5011
|
-
}
|
|
5012
|
-
//#endregion
|
|
5013
|
-
//#region packages/cli/src/generator/render/run/renderMakooStart.ts
|
|
5014
|
-
function vc(e) {
|
|
5015
|
-
return `${e}.start(${e}Tasks)`;
|
|
5016
|
-
}
|
|
5017
5097
|
//#endregion
|
|
5018
5098
|
//#region packages/cli/src/generator/generator.ts
|
|
5019
|
-
function
|
|
5020
|
-
let t =
|
|
5099
|
+
function Fc(e) {
|
|
5100
|
+
let t = wc(e.config.runtime.setup), n = Sc(e.manifestBindings), r = gc(e.injections), i = fc(e.injections), a = Dc(e.frameworks, e.injectionDefaults, e.manifestBindings.injectionDefaults, n.renderReference), o = Oc(a.instanceName, r.component, e.manifestBindings.injections, n.renderReference), s = jc(a.instanceName, e.listeners, e.manifestBindings.listeners, n.renderReference), c = [
|
|
5021
5101
|
t,
|
|
5022
5102
|
n.code,
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5103
|
+
r.code,
|
|
5104
|
+
_c(),
|
|
5105
|
+
i.code
|
|
5106
|
+
].filter(Boolean).join("\n"), l = [
|
|
5026
5107
|
"try {",
|
|
5027
5108
|
...[
|
|
5028
|
-
i.code,
|
|
5029
5109
|
a.code,
|
|
5030
|
-
|
|
5110
|
+
[
|
|
5111
|
+
e.injections.some((e) => e.match) || e.listeners.some((e) => e.match) ? Pc() : null,
|
|
5112
|
+
o.code,
|
|
5113
|
+
s.code
|
|
5114
|
+
].filter(Boolean).join("\n"),
|
|
5115
|
+
Nc(a.instanceName)
|
|
5031
5116
|
].join("\n").split("\n").map((e) => ` ${e}`),
|
|
5032
5117
|
"} catch (e) {",
|
|
5033
5118
|
" console.error('[makoo] Injection startup failed:', e);",
|
|
@@ -5036,17 +5121,17 @@ function yc(e) {
|
|
|
5036
5121
|
].join("\n");
|
|
5037
5122
|
return {
|
|
5038
5123
|
code: [
|
|
5039
|
-
|
|
5040
|
-
`let ${
|
|
5041
|
-
|
|
5124
|
+
c,
|
|
5125
|
+
`let ${a.instanceName};`,
|
|
5126
|
+
l
|
|
5042
5127
|
].join("\n"),
|
|
5043
|
-
instanceName:
|
|
5128
|
+
instanceName: a.instanceName
|
|
5044
5129
|
};
|
|
5045
5130
|
}
|
|
5046
5131
|
//#endregion
|
|
5047
5132
|
//#region packages/cli/src/vitePlugin/virtualModule.ts
|
|
5048
|
-
function
|
|
5049
|
-
let n =
|
|
5133
|
+
function Ic(e, t) {
|
|
5134
|
+
let n = Fc(e), r = n.code;
|
|
5050
5135
|
return t ? `${r} \n ${`
|
|
5051
5136
|
if(import.meta.hot){
|
|
5052
5137
|
import.meta.hot.on('makoo:structural-hmr', (payload)=>{
|
|
@@ -5067,7 +5152,7 @@ function bc(e, t) {
|
|
|
5067
5152
|
}
|
|
5068
5153
|
//#endregion
|
|
5069
5154
|
//#region packages/cli/src/vitePlugin/watchList.ts
|
|
5070
|
-
function
|
|
5155
|
+
function Lc(e) {
|
|
5071
5156
|
let { config: t, injections: n, manifestDependencies: r, moduleManifestDependencies: i, runtimeSetupFiles: a, runtimeDependencies: o } = e, s = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set();
|
|
5072
5157
|
s.add(e.manifestFile);
|
|
5073
5158
|
for (let e of r) s.add(e);
|
|
@@ -5083,25 +5168,25 @@ function xc(e) {
|
|
|
5083
5168
|
dirs: [...c]
|
|
5084
5169
|
};
|
|
5085
5170
|
}
|
|
5086
|
-
function
|
|
5087
|
-
return
|
|
5171
|
+
function Rc(e, t) {
|
|
5172
|
+
return zc(e, t) !== null;
|
|
5088
5173
|
}
|
|
5089
|
-
function
|
|
5174
|
+
function zc(e, t) {
|
|
5090
5175
|
let { config: r } = t;
|
|
5091
5176
|
return e === t.manifestFile ? "top-level-manifest" : t.manifestDependencies.includes(e) ? "manifest-dependency" : t.moduleManifestDependencies.includes(e) ? "module-manifest-dependency" : t.runtimeDependencies.includes(e) ? "runtime-dependency" : t.runtimeSetupFiles.includes(e) ? "runtime-setup" : !n.relative(r.source.dir, e).startsWith("..") && n.basename(e, n.extname(e)) === "manifest" ? "module-manifest" : null;
|
|
5092
5177
|
}
|
|
5093
5178
|
//#endregion
|
|
5094
5179
|
//#region packages/cli/src/vitePlugin/makooMonkey.ts
|
|
5095
|
-
function
|
|
5180
|
+
function Bc(e) {
|
|
5096
5181
|
let t = null, r = !1, i = null, a = null;
|
|
5097
5182
|
async function o() {
|
|
5098
|
-
return a ||=
|
|
5183
|
+
return a ||= ac(e).then((e) => (t = e, !0)).catch((e) => (i ? lc(i, e) : console.error("[makoo]", e), !1)).finally(() => {
|
|
5099
5184
|
a = null;
|
|
5100
5185
|
}), a;
|
|
5101
5186
|
}
|
|
5102
5187
|
function s(e) {
|
|
5103
5188
|
if (!t) return;
|
|
5104
|
-
let { files: n, dirs: r } =
|
|
5189
|
+
let { files: n, dirs: r } = Lc(t);
|
|
5105
5190
|
for (let t of n) e.watcher.add(t);
|
|
5106
5191
|
for (let t of r) e.watcher.add(t);
|
|
5107
5192
|
}
|
|
@@ -5116,37 +5201,37 @@ function wc(e) {
|
|
|
5116
5201
|
await o();
|
|
5117
5202
|
},
|
|
5118
5203
|
resolveId(e) {
|
|
5119
|
-
if (e === "virtual:makoo/entry") return
|
|
5120
|
-
if (e === "makoo-entry.ts" || e === "./makoo-entry.ts" || e === "/makoo-entry.ts") return
|
|
5204
|
+
if (e === "virtual:makoo/entry") return le;
|
|
5205
|
+
if (e === "makoo-entry.ts" || e === "./makoo-entry.ts" || e === "/makoo-entry.ts") return ue;
|
|
5121
5206
|
},
|
|
5122
5207
|
load(e) {
|
|
5123
|
-
if (!(e !== "\0virtual:makoo/entry" && e !== "\0makoo-entry.ts")) return t ?
|
|
5208
|
+
if (!(e !== "\0virtual:makoo/entry" && e !== "\0makoo-entry.ts")) return t ? Ic(t, r) : "export {}";
|
|
5124
5209
|
},
|
|
5125
5210
|
async configureServer(r) {
|
|
5126
5211
|
i = r, await o() && s(r);
|
|
5127
5212
|
let a = async (i) => {
|
|
5128
|
-
if (!t || !
|
|
5129
|
-
let a =
|
|
5213
|
+
if (!t || !Rc(i, t)) return;
|
|
5214
|
+
let a = zc(i, t);
|
|
5130
5215
|
if (!a || !await o()) return;
|
|
5131
5216
|
let c = n.relative(e.root, i).replace(/\\/g, "/");
|
|
5132
|
-
r.config.logger.info(
|
|
5217
|
+
r.config.logger.info(`${sc("[makoo]", oc.deepPink)} ${sc("(client)", oc.dim)} ${sc("hmr update", oc.green)} ${sc(`${a}: ${c}`, oc.dim)}`, { timestamp: !0 }), s(r), cc(r), dc(r, {
|
|
5133
5218
|
file: i,
|
|
5134
5219
|
reason: a,
|
|
5135
5220
|
timestamp: Date.now()
|
|
5136
|
-
}),
|
|
5221
|
+
}), uc(r);
|
|
5137
5222
|
};
|
|
5138
5223
|
r.watcher.on("change", a), r.watcher.on("add", a), r.watcher.on("remove", a), r.watcher.on("unlink", a), r.watcher.on("addDir", a), r.watcher.on("unlinkDir", a);
|
|
5139
5224
|
},
|
|
5140
5225
|
handleHotUpdate({ file: e, modules: n }) {
|
|
5141
|
-
if (t) return
|
|
5226
|
+
if (t) return Rc(e, t) ? [] : n;
|
|
5142
5227
|
}
|
|
5143
5228
|
};
|
|
5144
5229
|
}
|
|
5145
5230
|
//#endregion
|
|
5146
5231
|
//#region packages/cli/src/vitePlugin/makoo.ts
|
|
5147
|
-
function
|
|
5148
|
-
let n =
|
|
5149
|
-
return [
|
|
5232
|
+
function Vc(t) {
|
|
5233
|
+
let n = ys(t, t.root), r = bs(n, t.monkey);
|
|
5234
|
+
return [Bc(n), ...e(r)];
|
|
5150
5235
|
}
|
|
5151
5236
|
//#endregion
|
|
5152
|
-
export { t as cdn,
|
|
5237
|
+
export { t as cdn, Vc as makoo };
|