twenty-sdk 2.30.0 → 2.31.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.
Files changed (56) hide show
  1. package/dist/billing/index.cjs +20 -1
  2. package/dist/billing/index.cjs.map +1 -1
  3. package/dist/billing/index.mjs +2380 -18
  4. package/dist/billing/index.mjs.map +1 -1
  5. package/dist/{catalog-sync-WmgvkRw7.mjs → catalog-sync-Ch6nB5uf.mjs} +1 -1
  6. package/dist/catalog-sync-yH3B_al1.js +1 -0
  7. package/dist/cli/utilities/build/common/esbuild-watcher.d.ts +1 -1
  8. package/dist/cli/utilities/build/common/front-component-build/front-components-watcher.d.ts +40 -0
  9. package/dist/cli/utilities/build/common/front-component-build/shared-dependencies-build/build-shared-dependencies-bundle.d.ts +8 -0
  10. package/dist/cli/utilities/build/common/front-component-build/shared-dependencies-build/create-shared-dependencies-shim-plugin.d.ts +3 -0
  11. package/dist/cli/utilities/build/common/front-component-build/shared-dependencies-build/types/shared-dependencies-build-context.type.d.ts +4 -0
  12. package/dist/cli/utilities/build/common/front-component-build/shared-dependencies-build/types/shared-dependencies-export-names.type.d.ts +4 -0
  13. package/dist/cli/utilities/build/common/front-component-build/shared-dependencies-build/utils/enumerate-shared-dependencies-export-names.d.ts +5 -0
  14. package/dist/cli/utilities/build/common/front-component-build/shared-dependencies-build/utils/get-shared-dependencies-entry-source.d.ts +1 -0
  15. package/dist/cli/utilities/build/common/front-component-build/shared-dependencies-build/utils/get-shared-dependencies-namespace-collisions.d.ts +1 -0
  16. package/dist/cli/utilities/build/common/front-component-build/shared-dependencies-build/utils/get-shared-dependencies-shim-source.d.ts +5 -0
  17. package/dist/cli/utilities/build/common/front-component-build/shared-dependencies-build/utils/to-shared-dependencies-namespace-identifier.d.ts +1 -0
  18. package/dist/cli/utilities/build/common/front-component-build/utils/get-front-component-build-plugins.d.ts +2 -0
  19. package/dist/cli/utilities/build/manifest/utils/extract-front-component-shared-dependencies.d.ts +5 -0
  20. package/dist/cli/utilities/build/manifest/utils/normalize-front-component-shared-dependencies.d.ts +1 -0
  21. package/dist/cli.cjs +36 -36
  22. package/dist/cli.mjs +2147 -2051
  23. package/dist/define/index.cjs +24 -24
  24. package/dist/define/index.cjs.map +1 -1
  25. package/dist/define/index.d.ts +328 -844
  26. package/dist/define/index.mjs +6645 -6513
  27. package/dist/define/index.mjs.map +1 -1
  28. package/dist/front-component/index.cjs +3 -3
  29. package/dist/front-component/index.cjs.map +1 -1
  30. package/dist/front-component/index.mjs +460 -460
  31. package/dist/front-component/index.mjs.map +1 -1
  32. package/dist/front-component-renderer/build.cjs +1 -1
  33. package/dist/front-component-renderer/build.mjs +1 -1
  34. package/dist/get-front-component-build-plugins-C-Webbfn.js +196 -0
  35. package/dist/get-front-component-build-plugins-DA62IZes.mjs +9849 -0
  36. package/dist/{get-function-input-schema-GNk3NRLJ-DkTcUzrb.mjs → get-function-input-schema-GNk3NRLJ-C5HXalke.mjs} +1 -1
  37. package/dist/get-function-input-schema-GNk3NRLJ-DwfXUGPz.js +1 -0
  38. package/dist/logic-function/index.cjs +26 -7
  39. package/dist/logic-function/index.cjs.map +1 -1
  40. package/dist/logic-function/index.mjs +2420 -56
  41. package/dist/logic-function/index.mjs.map +1 -1
  42. package/dist/{login-BnGCnmge.mjs → login-BHgUJK94.mjs} +5750 -15164
  43. package/dist/login-BzHQgxeV.js +343 -0
  44. package/dist/operations.cjs +1 -1
  45. package/dist/operations.mjs +1 -1
  46. package/dist/utils/index.cjs +20 -1
  47. package/dist/utils/index.cjs.map +1 -1
  48. package/dist/utils/index.mjs +2375 -13
  49. package/dist/utils/index.mjs.map +1 -1
  50. package/package.json +2 -2
  51. package/dist/catalog-sync-61JsVcDP.js +0 -1
  52. package/dist/get-front-component-build-plugins-B5IvUvSS.mjs +0 -133
  53. package/dist/get-front-component-build-plugins-TJrFS3_p.js +0 -172
  54. package/dist/get-function-input-schema-GNk3NRLJ-D8x7FINz.js +0 -1
  55. package/dist/isDefined-Dtu5EYqP-Dp026Ry1.js +0 -1
  56. package/dist/login-CM2Aug-k.js +0 -365
@@ -1,37 +1,2399 @@
1
- import "uuid";
2
- //#region ../twenty-shared/dist/FieldMetadataType-PppCGM82.mjs
3
- var e = /* @__PURE__ */ function(e) {
1
+ import { v4 as e } from "uuid";
2
+ Object.freeze({ status: "aborted" });
3
+ function t(e, t, n) {
4
+ function r(n, r) {
5
+ var i;
6
+ Object.defineProperty(n, "_zod", {
7
+ value: n._zod ?? {},
8
+ enumerable: !1
9
+ }), (i = n._zod).traits ?? (i.traits = /* @__PURE__ */ new Set()), n._zod.traits.add(e), t(n, r);
10
+ for (let e in o.prototype) e in n || Object.defineProperty(n, e, { value: o.prototype[e].bind(n) });
11
+ n._zod.constr = o, n._zod.def = r;
12
+ }
13
+ let i = n?.Parent ?? Object;
14
+ class a extends i {}
15
+ Object.defineProperty(a, "name", { value: e });
16
+ function o(e) {
17
+ var t;
18
+ let i = n?.Parent ? new a() : this;
19
+ r(i, e), (t = i._zod).deferred ?? (t.deferred = []);
20
+ for (let e of i._zod.deferred) e();
21
+ return i;
22
+ }
23
+ 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;
24
+ }
25
+ var n = class extends Error {
26
+ constructor() {
27
+ super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
28
+ }
29
+ }, r = class extends Error {
30
+ constructor(e) {
31
+ super(`Encountered unidirectional transform during encode: ${e}`), this.name = "ZodEncodeError";
32
+ }
33
+ }, i = {};
34
+ function a(e) {
35
+ return e && Object.assign(i, e), i;
36
+ }
37
+ //#endregion
38
+ //#region ../../node_modules/zod/v4/core/util.js
39
+ function o(e) {
40
+ let t = Object.values(e).filter((e) => typeof e == "number");
41
+ return Object.entries(e).filter(([e, n]) => t.indexOf(+e) === -1).map(([e, t]) => t);
42
+ }
43
+ function s(e, t) {
44
+ return typeof t == "bigint" ? t.toString() : t;
45
+ }
46
+ function c(e) {
47
+ return { get value() {
48
+ {
49
+ let t = e();
50
+ return Object.defineProperty(this, "value", { value: t }), t;
51
+ }
52
+ throw Error("cached value already set");
53
+ } };
54
+ }
55
+ function l(e) {
56
+ return e == null;
57
+ }
58
+ function u(e) {
59
+ let t = +!!e.startsWith("^"), n = e.endsWith("$") ? e.length - 1 : e.length;
60
+ return e.slice(t, n);
61
+ }
62
+ var d = Symbol("evaluating");
63
+ function f(e, t, n) {
64
+ let r;
65
+ Object.defineProperty(e, t, {
66
+ get() {
67
+ if (r !== d) return r === void 0 && (r = d, r = n()), r;
68
+ },
69
+ set(n) {
70
+ Object.defineProperty(e, t, { value: n });
71
+ },
72
+ configurable: !0
73
+ });
74
+ }
75
+ function p(e, t, n) {
76
+ Object.defineProperty(e, t, {
77
+ value: n,
78
+ writable: !0,
79
+ enumerable: !0,
80
+ configurable: !0
81
+ });
82
+ }
83
+ function m(...e) {
84
+ let t = {};
85
+ for (let n of e) Object.assign(t, Object.getOwnPropertyDescriptors(n));
86
+ return Object.defineProperties({}, t);
87
+ }
88
+ function h(e) {
89
+ return JSON.stringify(e);
90
+ }
91
+ var g = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {};
92
+ function _(e) {
93
+ return typeof e == "object" && !!e && !Array.isArray(e);
94
+ }
95
+ var ee = c(() => {
96
+ if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare")) return !1;
97
+ try {
98
+ return Function(""), !0;
99
+ } catch {
100
+ return !1;
101
+ }
102
+ });
103
+ function v(e) {
104
+ if (_(e) === !1) return !1;
105
+ let t = e.constructor;
106
+ if (t === void 0) return !0;
107
+ let n = t.prototype;
108
+ return !(_(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
109
+ }
110
+ function te(e) {
111
+ return v(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
112
+ }
113
+ var ne = new Set([
114
+ "string",
115
+ "number",
116
+ "symbol"
117
+ ]);
118
+ function y(e) {
119
+ return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
120
+ }
121
+ function b(e, t, n) {
122
+ let r = new e._zod.constr(t ?? e._zod.def);
123
+ return (!t || n?.parent) && (r._zod.parent = e), r;
124
+ }
125
+ function x(e) {
126
+ let t = e;
127
+ if (!t) return {};
128
+ if (typeof t == "string") return { error: () => t };
129
+ if (t?.message !== void 0) {
130
+ if (t?.error !== void 0) throw Error("Cannot specify both `message` and `error` params");
131
+ t.error = t.message;
132
+ }
133
+ return delete t.message, typeof t.error == "string" ? {
134
+ ...t,
135
+ error: () => t.error
136
+ } : t;
137
+ }
138
+ function re(e) {
139
+ return Object.keys(e).filter((t) => e[t]._zod.optin === "optional" && e[t]._zod.optout === "optional");
140
+ }
141
+ -Number.MAX_VALUE, Number.MAX_VALUE;
142
+ function ie(e, t) {
143
+ let n = e._zod.def;
144
+ return b(e, m(e._zod.def, {
145
+ get shape() {
146
+ let e = {};
147
+ for (let r in t) {
148
+ if (!(r in n.shape)) throw Error(`Unrecognized key: "${r}"`);
149
+ t[r] && (e[r] = n.shape[r]);
150
+ }
151
+ return p(this, "shape", e), e;
152
+ },
153
+ checks: []
154
+ }));
155
+ }
156
+ function ae(e, t) {
157
+ let n = e._zod.def;
158
+ return b(e, m(e._zod.def, {
159
+ get shape() {
160
+ let r = { ...e._zod.def.shape };
161
+ for (let e in t) {
162
+ if (!(e in n.shape)) throw Error(`Unrecognized key: "${e}"`);
163
+ t[e] && delete r[e];
164
+ }
165
+ return p(this, "shape", r), r;
166
+ },
167
+ checks: []
168
+ }));
169
+ }
170
+ function oe(e, t) {
171
+ if (!v(t)) throw Error("Invalid input to extend: expected a plain object");
172
+ let n = e._zod.def.checks;
173
+ if (n && n.length > 0) throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");
174
+ return b(e, m(e._zod.def, {
175
+ get shape() {
176
+ let n = {
177
+ ...e._zod.def.shape,
178
+ ...t
179
+ };
180
+ return p(this, "shape", n), n;
181
+ },
182
+ checks: []
183
+ }));
184
+ }
185
+ function se(e, t) {
186
+ if (!v(t)) throw Error("Invalid input to safeExtend: expected a plain object");
187
+ return b(e, {
188
+ ...e._zod.def,
189
+ get shape() {
190
+ let n = {
191
+ ...e._zod.def.shape,
192
+ ...t
193
+ };
194
+ return p(this, "shape", n), n;
195
+ },
196
+ checks: e._zod.def.checks
197
+ });
198
+ }
199
+ function ce(e, t) {
200
+ return b(e, m(e._zod.def, {
201
+ get shape() {
202
+ let n = {
203
+ ...e._zod.def.shape,
204
+ ...t._zod.def.shape
205
+ };
206
+ return p(this, "shape", n), n;
207
+ },
208
+ get catchall() {
209
+ return t._zod.def.catchall;
210
+ },
211
+ checks: []
212
+ }));
213
+ }
214
+ function le(e, t, n) {
215
+ return b(t, m(t._zod.def, {
216
+ get shape() {
217
+ let r = t._zod.def.shape, i = { ...r };
218
+ if (n) for (let t in n) {
219
+ if (!(t in r)) throw Error(`Unrecognized key: "${t}"`);
220
+ n[t] && (i[t] = e ? new e({
221
+ type: "optional",
222
+ innerType: r[t]
223
+ }) : r[t]);
224
+ }
225
+ else for (let t in r) i[t] = e ? new e({
226
+ type: "optional",
227
+ innerType: r[t]
228
+ }) : r[t];
229
+ return p(this, "shape", i), i;
230
+ },
231
+ checks: []
232
+ }));
233
+ }
234
+ function ue(e, t, n) {
235
+ return b(t, m(t._zod.def, {
236
+ get shape() {
237
+ let r = t._zod.def.shape, i = { ...r };
238
+ if (n) for (let t in n) {
239
+ if (!(t in i)) throw Error(`Unrecognized key: "${t}"`);
240
+ n[t] && (i[t] = new e({
241
+ type: "nonoptional",
242
+ innerType: r[t]
243
+ }));
244
+ }
245
+ else for (let t in r) i[t] = new e({
246
+ type: "nonoptional",
247
+ innerType: r[t]
248
+ });
249
+ return p(this, "shape", i), i;
250
+ },
251
+ checks: []
252
+ }));
253
+ }
254
+ function S(e, t = 0) {
255
+ if (e.aborted === !0) return !0;
256
+ for (let n = t; n < e.issues.length; n++) if (e.issues[n]?.continue !== !0) return !0;
257
+ return !1;
258
+ }
259
+ function de(e, t) {
260
+ return t.map((t) => {
261
+ var n;
262
+ return (n = t).path ?? (n.path = []), t.path.unshift(e), t;
263
+ });
264
+ }
265
+ function C(e) {
266
+ return typeof e == "string" ? e : e?.message;
267
+ }
268
+ function w(e, t, n) {
269
+ let r = {
270
+ ...e,
271
+ path: e.path ?? []
272
+ };
273
+ return e.message || (r.message = C(e.inst?._zod.def?.error?.(e)) ?? C(t?.error?.(e)) ?? C(n.customError?.(e)) ?? C(n.localeError?.(e)) ?? "Invalid input"), delete r.inst, delete r.continue, t?.reportInput || delete r.input, r;
274
+ }
275
+ function T(e) {
276
+ return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
277
+ }
278
+ function E(...e) {
279
+ let [t, n, r] = e;
280
+ return typeof t == "string" ? {
281
+ message: t,
282
+ code: "custom",
283
+ input: n,
284
+ inst: r
285
+ } : { ...t };
286
+ }
287
+ //#endregion
288
+ //#region ../../node_modules/zod/v4/core/errors.js
289
+ var fe = (e, t) => {
290
+ e.name = "$ZodError", Object.defineProperty(e, "_zod", {
291
+ value: e._zod,
292
+ enumerable: !1
293
+ }), Object.defineProperty(e, "issues", {
294
+ value: t,
295
+ enumerable: !1
296
+ }), e.message = JSON.stringify(t, s, 2), Object.defineProperty(e, "toString", {
297
+ value: () => e.message,
298
+ enumerable: !1
299
+ });
300
+ }, pe = t("$ZodError", fe), me = t("$ZodError", fe, { Parent: Error });
301
+ function he(e, t = (e) => e.message) {
302
+ let n = {}, r = [];
303
+ 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));
304
+ return {
305
+ formErrors: r,
306
+ fieldErrors: n
307
+ };
308
+ }
309
+ function ge(e, t) {
310
+ let n = t || function(e) {
311
+ return e.message;
312
+ }, r = { _errors: [] }, i = (e) => {
313
+ for (let t of e.issues) if (t.code === "invalid_union" && t.errors.length) t.errors.map((e) => i({ issues: e }));
314
+ else if (t.code === "invalid_key") i({ issues: t.issues });
315
+ else if (t.code === "invalid_element") i({ issues: t.issues });
316
+ else if (t.path.length === 0) r._errors.push(n(t));
317
+ else {
318
+ let e = r, i = 0;
319
+ for (; i < t.path.length;) {
320
+ let r = t.path[i];
321
+ i === t.path.length - 1 ? (e[r] = e[r] || { _errors: [] }, e[r]._errors.push(n(t))) : e[r] = e[r] || { _errors: [] }, e = e[r], i++;
322
+ }
323
+ }
324
+ };
325
+ return i(e), r;
326
+ }
327
+ //#endregion
328
+ //#region ../../node_modules/zod/v4/core/parse.js
329
+ var D = (e) => (t, r, i, o) => {
330
+ let s = i ? Object.assign(i, { async: !1 }) : { async: !1 }, c = t._zod.run({
331
+ value: r,
332
+ issues: []
333
+ }, s);
334
+ if (c instanceof Promise) throw new n();
335
+ if (c.issues.length) {
336
+ let t = new (o?.Err ?? e)(c.issues.map((e) => w(e, s, a())));
337
+ throw g(t, o?.callee), t;
338
+ }
339
+ return c.value;
340
+ }, O = (e) => async (t, n, r, i) => {
341
+ let o = r ? Object.assign(r, { async: !0 }) : { async: !0 }, s = t._zod.run({
342
+ value: n,
343
+ issues: []
344
+ }, o);
345
+ if (s instanceof Promise && (s = await s), s.issues.length) {
346
+ let t = new (i?.Err ?? e)(s.issues.map((e) => w(e, o, a())));
347
+ throw g(t, i?.callee), t;
348
+ }
349
+ return s.value;
350
+ }, k = (e) => (t, r, i) => {
351
+ let o = i ? {
352
+ ...i,
353
+ async: !1
354
+ } : { async: !1 }, s = t._zod.run({
355
+ value: r,
356
+ issues: []
357
+ }, o);
358
+ if (s instanceof Promise) throw new n();
359
+ return s.issues.length ? {
360
+ success: !1,
361
+ error: new (e ?? pe)(s.issues.map((e) => w(e, o, a())))
362
+ } : {
363
+ success: !0,
364
+ data: s.value
365
+ };
366
+ }, _e = /* @__PURE__*/ k(me), A = (e) => async (t, n, r) => {
367
+ let i = r ? Object.assign(r, { async: !0 }) : { async: !0 }, o = t._zod.run({
368
+ value: n,
369
+ issues: []
370
+ }, i);
371
+ return o instanceof Promise && (o = await o), o.issues.length ? {
372
+ success: !1,
373
+ error: new e(o.issues.map((e) => w(e, i, a())))
374
+ } : {
375
+ success: !0,
376
+ data: o.value
377
+ };
378
+ }, ve = /* @__PURE__*/ A(me), ye = (e) => (t, n, r) => {
379
+ let i = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
380
+ return D(e)(t, n, i);
381
+ }, be = (e) => (t, n, r) => D(e)(t, n, r), xe = (e) => async (t, n, r) => {
382
+ let i = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
383
+ return O(e)(t, n, i);
384
+ }, Se = (e) => async (t, n, r) => O(e)(t, n, r), Ce = (e) => (t, n, r) => {
385
+ let i = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
386
+ return k(e)(t, n, i);
387
+ }, we = (e) => (t, n, r) => k(e)(t, n, r), Te = (e) => async (t, n, r) => {
388
+ let i = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
389
+ return A(e)(t, n, i);
390
+ }, Ee = (e) => async (t, n, r) => A(e)(t, n, r), De = /^[cC][^\s-]{8,}$/, Oe = /^[0-9a-z]+$/, ke = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, Ae = /^[0-9a-vA-V]{20}$/, je = /^[A-Za-z0-9]{27}$/, Me = /^[a-zA-Z0-9_-]{21}$/, Ne = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, Pe = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, j = (e) => e ? RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, Fe = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Ie = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
391
+ function Le() {
392
+ return new RegExp(Ie, "u");
393
+ }
394
+ var Re = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, ze = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/, Be = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/, Ve = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, He = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, M = /^[A-Za-z0-9_-]*$/, Ue = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/, We = /^\+(?:[0-9]){6,14}[0-9]$/, N = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))", Ge = /*@__PURE__*/ RegExp(`^${N}$`);
395
+ function P(e) {
396
+ let t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
397
+ return typeof e.precision == "number" ? e.precision === -1 ? `${t}` : e.precision === 0 ? `${t}:[0-5]\\d` : `${t}:[0-5]\\d\\.\\d{${e.precision}}` : `${t}(?::[0-5]\\d(?:\\.\\d+)?)?`;
398
+ }
399
+ function Ke(e) {
400
+ return RegExp(`^${P(e)}$`);
401
+ }
402
+ function qe(e) {
403
+ let t = P({ precision: e.precision }), n = ["Z"];
404
+ e.local && n.push(""), e.offset && n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
405
+ let r = `${t}(?:${n.join("|")})`;
406
+ return RegExp(`^${N}T(?:${r})$`);
407
+ }
408
+ var Je = (e) => {
409
+ let t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
410
+ return RegExp(`^${t}$`);
411
+ }, Ye = /^[^A-Z]*$/, Xe = /^[^a-z]*$/, F = /*@__PURE__*/ t("$ZodCheck", (e, t) => {
412
+ var n;
413
+ e._zod ??= {}, e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []);
414
+ }), Ze = /*@__PURE__*/ t("$ZodCheckMaxLength", (e, t) => {
415
+ var n;
416
+ F.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => {
417
+ let t = e.value;
418
+ return !l(t) && t.length !== void 0;
419
+ }), e._zod.onattach.push((e) => {
420
+ let n = e._zod.bag.maximum ?? Infinity;
421
+ t.maximum < n && (e._zod.bag.maximum = t.maximum);
422
+ }), e._zod.check = (n) => {
423
+ let r = n.value;
424
+ if (r.length <= t.maximum) return;
425
+ let i = T(r);
426
+ n.issues.push({
427
+ origin: i,
428
+ code: "too_big",
429
+ maximum: t.maximum,
430
+ inclusive: !0,
431
+ input: r,
432
+ inst: e,
433
+ continue: !t.abort
434
+ });
435
+ };
436
+ }), Qe = /*@__PURE__*/ t("$ZodCheckMinLength", (e, t) => {
437
+ var n;
438
+ F.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => {
439
+ let t = e.value;
440
+ return !l(t) && t.length !== void 0;
441
+ }), e._zod.onattach.push((e) => {
442
+ let n = e._zod.bag.minimum ?? -Infinity;
443
+ t.minimum > n && (e._zod.bag.minimum = t.minimum);
444
+ }), e._zod.check = (n) => {
445
+ let r = n.value;
446
+ if (r.length >= t.minimum) return;
447
+ let i = T(r);
448
+ n.issues.push({
449
+ origin: i,
450
+ code: "too_small",
451
+ minimum: t.minimum,
452
+ inclusive: !0,
453
+ input: r,
454
+ inst: e,
455
+ continue: !t.abort
456
+ });
457
+ };
458
+ }), $e = /*@__PURE__*/ t("$ZodCheckLengthEquals", (e, t) => {
459
+ var n;
460
+ F.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => {
461
+ let t = e.value;
462
+ return !l(t) && t.length !== void 0;
463
+ }), e._zod.onattach.push((e) => {
464
+ let n = e._zod.bag;
465
+ n.minimum = t.length, n.maximum = t.length, n.length = t.length;
466
+ }), e._zod.check = (n) => {
467
+ let r = n.value, i = r.length;
468
+ if (i === t.length) return;
469
+ let a = T(r), o = i > t.length;
470
+ n.issues.push({
471
+ origin: a,
472
+ ...o ? {
473
+ code: "too_big",
474
+ maximum: t.length
475
+ } : {
476
+ code: "too_small",
477
+ minimum: t.length
478
+ },
479
+ inclusive: !0,
480
+ exact: !0,
481
+ input: n.value,
482
+ inst: e,
483
+ continue: !t.abort
484
+ });
485
+ };
486
+ }), I = /*@__PURE__*/ t("$ZodCheckStringFormat", (e, t) => {
487
+ var n, r;
488
+ F.init(e, t), e._zod.onattach.push((e) => {
489
+ let n = e._zod.bag;
490
+ n.format = t.format, t.pattern && (n.patterns ??= /* @__PURE__ */ new Set(), n.patterns.add(t.pattern));
491
+ }), t.pattern ? (n = e._zod).check ?? (n.check = (n) => {
492
+ t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
493
+ origin: "string",
494
+ code: "invalid_format",
495
+ format: t.format,
496
+ input: n.value,
497
+ ...t.pattern ? { pattern: t.pattern.toString() } : {},
498
+ inst: e,
499
+ continue: !t.abort
500
+ });
501
+ }) : (r = e._zod).check ?? (r.check = () => {});
502
+ }), et = /*@__PURE__*/ t("$ZodCheckRegex", (e, t) => {
503
+ I.init(e, t), e._zod.check = (n) => {
504
+ t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
505
+ origin: "string",
506
+ code: "invalid_format",
507
+ format: "regex",
508
+ input: n.value,
509
+ pattern: t.pattern.toString(),
510
+ inst: e,
511
+ continue: !t.abort
512
+ });
513
+ };
514
+ }), tt = /*@__PURE__*/ t("$ZodCheckLowerCase", (e, t) => {
515
+ t.pattern ??= Ye, I.init(e, t);
516
+ }), nt = /*@__PURE__*/ t("$ZodCheckUpperCase", (e, t) => {
517
+ t.pattern ??= Xe, I.init(e, t);
518
+ }), rt = /*@__PURE__*/ t("$ZodCheckIncludes", (e, t) => {
519
+ F.init(e, t);
520
+ let n = y(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
521
+ t.pattern = r, e._zod.onattach.push((e) => {
522
+ let t = e._zod.bag;
523
+ t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(r);
524
+ }), e._zod.check = (n) => {
525
+ n.value.includes(t.includes, t.position) || n.issues.push({
526
+ origin: "string",
527
+ code: "invalid_format",
528
+ format: "includes",
529
+ includes: t.includes,
530
+ input: n.value,
531
+ inst: e,
532
+ continue: !t.abort
533
+ });
534
+ };
535
+ }), it = /*@__PURE__*/ t("$ZodCheckStartsWith", (e, t) => {
536
+ F.init(e, t);
537
+ let n = RegExp(`^${y(t.prefix)}.*`);
538
+ t.pattern ??= n, e._zod.onattach.push((e) => {
539
+ let t = e._zod.bag;
540
+ t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(n);
541
+ }), e._zod.check = (n) => {
542
+ n.value.startsWith(t.prefix) || n.issues.push({
543
+ origin: "string",
544
+ code: "invalid_format",
545
+ format: "starts_with",
546
+ prefix: t.prefix,
547
+ input: n.value,
548
+ inst: e,
549
+ continue: !t.abort
550
+ });
551
+ };
552
+ }), at = /*@__PURE__*/ t("$ZodCheckEndsWith", (e, t) => {
553
+ F.init(e, t);
554
+ let n = RegExp(`.*${y(t.suffix)}$`);
555
+ t.pattern ??= n, e._zod.onattach.push((e) => {
556
+ let t = e._zod.bag;
557
+ t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(n);
558
+ }), e._zod.check = (n) => {
559
+ n.value.endsWith(t.suffix) || n.issues.push({
560
+ origin: "string",
561
+ code: "invalid_format",
562
+ format: "ends_with",
563
+ suffix: t.suffix,
564
+ input: n.value,
565
+ inst: e,
566
+ continue: !t.abort
567
+ });
568
+ };
569
+ }), ot = /*@__PURE__*/ t("$ZodCheckOverwrite", (e, t) => {
570
+ F.init(e, t), e._zod.check = (e) => {
571
+ e.value = t.tx(e.value);
572
+ };
573
+ }), st = class {
574
+ constructor(e = []) {
575
+ this.content = [], this.indent = 0, this && (this.args = e);
576
+ }
577
+ indented(e) {
578
+ this.indent += 1, e(this), --this.indent;
579
+ }
580
+ write(e) {
581
+ if (typeof e == "function") {
582
+ e(this, { execution: "sync" }), e(this, { execution: "async" });
583
+ return;
584
+ }
585
+ let t = e.split("\n").filter((e) => e), n = Math.min(...t.map((e) => e.length - e.trimStart().length)), r = t.map((e) => e.slice(n)).map((e) => " ".repeat(this.indent * 2) + e);
586
+ for (let e of r) this.content.push(e);
587
+ }
588
+ compile() {
589
+ let e = Function, t = this?.args, n = [...(this?.content ?? [""]).map((e) => ` ${e}`)];
590
+ return new e(...t, n.join("\n"));
591
+ }
592
+ }, ct = {
593
+ major: 4,
594
+ minor: 1,
595
+ patch: 11
596
+ }, L = /*@__PURE__*/ t("$ZodType", (e, t) => {
597
+ var r;
598
+ e ??= {}, e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = ct;
599
+ let i = [...e._zod.def.checks ?? []];
600
+ e._zod.traits.has("$ZodCheck") && i.unshift(e);
601
+ for (let t of i) for (let n of t._zod.onattach) n(e);
602
+ if (i.length === 0) (r = e._zod).deferred ?? (r.deferred = []), e._zod.deferred?.push(() => {
603
+ e._zod.run = e._zod.parse;
604
+ });
605
+ else {
606
+ let t = (e, t, r) => {
607
+ let i = S(e), a;
608
+ for (let o of t) {
609
+ if (o._zod.def.when) {
610
+ if (!o._zod.def.when(e)) continue;
611
+ } else if (i) continue;
612
+ let t = e.issues.length, s = o._zod.check(e);
613
+ if (s instanceof Promise && r?.async === !1) throw new n();
614
+ if (a || s instanceof Promise) a = (a ?? Promise.resolve()).then(async () => {
615
+ await s, e.issues.length !== t && (i ||= S(e, t));
616
+ });
617
+ else {
618
+ if (e.issues.length === t) continue;
619
+ i ||= S(e, t);
620
+ }
621
+ }
622
+ return a ? a.then(() => e) : e;
623
+ }, r = (r, a, o) => {
624
+ if (S(r)) return r.aborted = !0, r;
625
+ let s = t(a, i, o);
626
+ if (s instanceof Promise) {
627
+ if (o.async === !1) throw new n();
628
+ return s.then((t) => e._zod.parse(t, o));
629
+ }
630
+ return e._zod.parse(s, o);
631
+ };
632
+ e._zod.run = (a, o) => {
633
+ if (o.skipChecks) return e._zod.parse(a, o);
634
+ if (o.direction === "backward") {
635
+ let t = e._zod.parse({
636
+ value: a.value,
637
+ issues: []
638
+ }, {
639
+ ...o,
640
+ skipChecks: !0
641
+ });
642
+ return t instanceof Promise ? t.then((e) => r(e, a, o)) : r(t, a, o);
643
+ }
644
+ let s = e._zod.parse(a, o);
645
+ if (s instanceof Promise) {
646
+ if (o.async === !1) throw new n();
647
+ return s.then((e) => t(e, i, o));
648
+ }
649
+ return t(s, i, o);
650
+ };
651
+ }
652
+ e["~standard"] = {
653
+ validate: (t) => {
654
+ try {
655
+ let n = _e(e, t);
656
+ return n.success ? { value: n.data } : { issues: n.error?.issues };
657
+ } catch {
658
+ return ve(e, t).then((e) => e.success ? { value: e.data } : { issues: e.error?.issues });
659
+ }
660
+ },
661
+ vendor: "zod",
662
+ version: 1
663
+ };
664
+ }), R = /*@__PURE__*/ t("$ZodString", (e, t) => {
665
+ L.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? Je(e._zod.bag), e._zod.parse = (n, r) => {
666
+ if (t.coerce) try {
667
+ n.value = String(n.value);
668
+ } catch {}
669
+ return typeof n.value == "string" || n.issues.push({
670
+ expected: "string",
671
+ code: "invalid_type",
672
+ input: n.value,
673
+ inst: e
674
+ }), n;
675
+ };
676
+ }), z = /*@__PURE__*/ t("$ZodStringFormat", (e, t) => {
677
+ I.init(e, t), R.init(e, t);
678
+ }), lt = /*@__PURE__*/ t("$ZodGUID", (e, t) => {
679
+ t.pattern ??= Pe, z.init(e, t);
680
+ }), ut = /*@__PURE__*/ t("$ZodUUID", (e, t) => {
681
+ if (t.version) {
682
+ let e = {
683
+ v1: 1,
684
+ v2: 2,
685
+ v3: 3,
686
+ v4: 4,
687
+ v5: 5,
688
+ v6: 6,
689
+ v7: 7,
690
+ v8: 8
691
+ }[t.version];
692
+ if (e === void 0) throw Error(`Invalid UUID version: "${t.version}"`);
693
+ t.pattern ??= j(e);
694
+ } else t.pattern ??= j();
695
+ z.init(e, t);
696
+ }), dt = /*@__PURE__*/ t("$ZodEmail", (e, t) => {
697
+ t.pattern ??= Fe, z.init(e, t);
698
+ }), ft = /*@__PURE__*/ t("$ZodURL", (e, t) => {
699
+ z.init(e, t), e._zod.check = (n) => {
700
+ try {
701
+ let r = n.value.trim(), i = new URL(r);
702
+ t.hostname && (t.hostname.lastIndex = 0, t.hostname.test(i.hostname) || n.issues.push({
703
+ code: "invalid_format",
704
+ format: "url",
705
+ note: "Invalid hostname",
706
+ pattern: Ue.source,
707
+ input: n.value,
708
+ inst: e,
709
+ continue: !t.abort
710
+ })), t.protocol && (t.protocol.lastIndex = 0, t.protocol.test(i.protocol.endsWith(":") ? i.protocol.slice(0, -1) : i.protocol) || n.issues.push({
711
+ code: "invalid_format",
712
+ format: "url",
713
+ note: "Invalid protocol",
714
+ pattern: t.protocol.source,
715
+ input: n.value,
716
+ inst: e,
717
+ continue: !t.abort
718
+ })), t.normalize ? n.value = i.href : n.value = r;
719
+ return;
720
+ } catch {
721
+ n.issues.push({
722
+ code: "invalid_format",
723
+ format: "url",
724
+ input: n.value,
725
+ inst: e,
726
+ continue: !t.abort
727
+ });
728
+ }
729
+ };
730
+ }), pt = /*@__PURE__*/ t("$ZodEmoji", (e, t) => {
731
+ t.pattern ??= Le(), z.init(e, t);
732
+ }), mt = /*@__PURE__*/ t("$ZodNanoID", (e, t) => {
733
+ t.pattern ??= Me, z.init(e, t);
734
+ }), ht = /*@__PURE__*/ t("$ZodCUID", (e, t) => {
735
+ t.pattern ??= De, z.init(e, t);
736
+ }), gt = /*@__PURE__*/ t("$ZodCUID2", (e, t) => {
737
+ t.pattern ??= Oe, z.init(e, t);
738
+ }), _t = /*@__PURE__*/ t("$ZodULID", (e, t) => {
739
+ t.pattern ??= ke, z.init(e, t);
740
+ }), vt = /*@__PURE__*/ t("$ZodXID", (e, t) => {
741
+ t.pattern ??= Ae, z.init(e, t);
742
+ }), yt = /*@__PURE__*/ t("$ZodKSUID", (e, t) => {
743
+ t.pattern ??= je, z.init(e, t);
744
+ }), bt = /*@__PURE__*/ t("$ZodISODateTime", (e, t) => {
745
+ t.pattern ??= qe(t), z.init(e, t);
746
+ }), xt = /*@__PURE__*/ t("$ZodISODate", (e, t) => {
747
+ t.pattern ??= Ge, z.init(e, t);
748
+ }), St = /*@__PURE__*/ t("$ZodISOTime", (e, t) => {
749
+ t.pattern ??= Ke(t), z.init(e, t);
750
+ }), Ct = /*@__PURE__*/ t("$ZodISODuration", (e, t) => {
751
+ t.pattern ??= Ne, z.init(e, t);
752
+ }), wt = /*@__PURE__*/ t("$ZodIPv4", (e, t) => {
753
+ t.pattern ??= Re, z.init(e, t), e._zod.onattach.push((e) => {
754
+ let t = e._zod.bag;
755
+ t.format = "ipv4";
756
+ });
757
+ }), Tt = /*@__PURE__*/ t("$ZodIPv6", (e, t) => {
758
+ t.pattern ??= ze, z.init(e, t), e._zod.onattach.push((e) => {
759
+ let t = e._zod.bag;
760
+ t.format = "ipv6";
761
+ }), e._zod.check = (n) => {
762
+ try {
763
+ new URL(`http://[${n.value}]`);
764
+ } catch {
765
+ n.issues.push({
766
+ code: "invalid_format",
767
+ format: "ipv6",
768
+ input: n.value,
769
+ inst: e,
770
+ continue: !t.abort
771
+ });
772
+ }
773
+ };
774
+ }), Et = /*@__PURE__*/ t("$ZodCIDRv4", (e, t) => {
775
+ t.pattern ??= Be, z.init(e, t);
776
+ }), Dt = /*@__PURE__*/ t("$ZodCIDRv6", (e, t) => {
777
+ t.pattern ??= Ve, z.init(e, t), e._zod.check = (n) => {
778
+ let r = n.value.split("/");
779
+ try {
780
+ if (r.length !== 2) throw Error();
781
+ let [e, t] = r;
782
+ if (!t) throw Error();
783
+ let n = Number(t);
784
+ if (`${n}` !== t || n < 0 || n > 128) throw Error();
785
+ new URL(`http://[${e}]`);
786
+ } catch {
787
+ n.issues.push({
788
+ code: "invalid_format",
789
+ format: "cidrv6",
790
+ input: n.value,
791
+ inst: e,
792
+ continue: !t.abort
793
+ });
794
+ }
795
+ };
796
+ });
797
+ function Ot(e) {
798
+ if (e === "") return !0;
799
+ if (e.length % 4 != 0) return !1;
800
+ try {
801
+ return atob(e), !0;
802
+ } catch {
803
+ return !1;
804
+ }
805
+ }
806
+ var kt = /*@__PURE__*/ t("$ZodBase64", (e, t) => {
807
+ t.pattern ??= He, z.init(e, t), e._zod.onattach.push((e) => {
808
+ e._zod.bag.contentEncoding = "base64";
809
+ }), e._zod.check = (n) => {
810
+ Ot(n.value) || n.issues.push({
811
+ code: "invalid_format",
812
+ format: "base64",
813
+ input: n.value,
814
+ inst: e,
815
+ continue: !t.abort
816
+ });
817
+ };
818
+ });
819
+ function At(e) {
820
+ if (!M.test(e)) return !1;
821
+ let t = e.replace(/[-_]/g, (e) => e === "-" ? "+" : "/");
822
+ return Ot(t.padEnd(Math.ceil(t.length / 4) * 4, "="));
823
+ }
824
+ var jt = /*@__PURE__*/ t("$ZodBase64URL", (e, t) => {
825
+ t.pattern ??= M, z.init(e, t), e._zod.onattach.push((e) => {
826
+ e._zod.bag.contentEncoding = "base64url";
827
+ }), e._zod.check = (n) => {
828
+ At(n.value) || n.issues.push({
829
+ code: "invalid_format",
830
+ format: "base64url",
831
+ input: n.value,
832
+ inst: e,
833
+ continue: !t.abort
834
+ });
835
+ };
836
+ }), Mt = /*@__PURE__*/ t("$ZodE164", (e, t) => {
837
+ t.pattern ??= We, z.init(e, t);
838
+ });
839
+ function Nt(e, t = null) {
840
+ try {
841
+ let n = e.split(".");
842
+ if (n.length !== 3) return !1;
843
+ let [r] = n;
844
+ if (!r) return !1;
845
+ let i = JSON.parse(atob(r));
846
+ return !("typ" in i && i?.typ !== "JWT" || !i.alg || t && (!("alg" in i) || i.alg !== t));
847
+ } catch {
848
+ return !1;
849
+ }
850
+ }
851
+ var Pt = /*@__PURE__*/ t("$ZodJWT", (e, t) => {
852
+ z.init(e, t), e._zod.check = (n) => {
853
+ Nt(n.value, t.alg) || n.issues.push({
854
+ code: "invalid_format",
855
+ format: "jwt",
856
+ input: n.value,
857
+ inst: e,
858
+ continue: !t.abort
859
+ });
860
+ };
861
+ }), Ft = /*@__PURE__*/ t("$ZodUnknown", (e, t) => {
862
+ L.init(e, t), e._zod.parse = (e) => e;
863
+ }), It = /*@__PURE__*/ t("$ZodNever", (e, t) => {
864
+ L.init(e, t), e._zod.parse = (t, n) => (t.issues.push({
865
+ expected: "never",
866
+ code: "invalid_type",
867
+ input: t.value,
868
+ inst: e
869
+ }), t);
870
+ });
871
+ function Lt(e, t, n) {
872
+ e.issues.length && t.issues.push(...de(n, e.issues)), t.value[n] = e.value;
873
+ }
874
+ var Rt = /*@__PURE__*/ t("$ZodArray", (e, t) => {
875
+ L.init(e, t), e._zod.parse = (n, r) => {
876
+ let i = n.value;
877
+ if (!Array.isArray(i)) return n.issues.push({
878
+ expected: "array",
879
+ code: "invalid_type",
880
+ input: i,
881
+ inst: e
882
+ }), n;
883
+ n.value = Array(i.length);
884
+ let a = [];
885
+ for (let e = 0; e < i.length; e++) {
886
+ let o = i[e], s = t.element._zod.run({
887
+ value: o,
888
+ issues: []
889
+ }, r);
890
+ s instanceof Promise ? a.push(s.then((t) => Lt(t, n, e))) : Lt(s, n, e);
891
+ }
892
+ return a.length ? Promise.all(a).then(() => n) : n;
893
+ };
894
+ });
895
+ function B(e, t, n, r) {
896
+ e.issues.length && t.issues.push(...de(n, e.issues)), e.value === void 0 ? n in r && (t.value[n] = void 0) : t.value[n] = e.value;
897
+ }
898
+ function zt(e) {
899
+ let t = Object.keys(e.shape);
900
+ for (let n of t) if (!e.shape?.[n]?._zod?.traits?.has("$ZodType")) throw Error(`Invalid element at key "${n}": expected a Zod schema`);
901
+ let n = re(e.shape);
902
+ return {
903
+ ...e,
904
+ keys: t,
905
+ keySet: new Set(t),
906
+ numKeys: t.length,
907
+ optionalKeys: new Set(n)
908
+ };
909
+ }
910
+ function Bt(e, t, n, r, i, a) {
911
+ let o = [], s = i.keySet, c = i.catchall._zod, l = c.def.type;
912
+ for (let i of Object.keys(t)) {
913
+ if (s.has(i)) continue;
914
+ if (l === "never") {
915
+ o.push(i);
916
+ continue;
917
+ }
918
+ let a = c.run({
919
+ value: t[i],
920
+ issues: []
921
+ }, r);
922
+ a instanceof Promise ? e.push(a.then((e) => B(e, n, i, t))) : B(a, n, i, t);
923
+ }
924
+ return o.length && n.issues.push({
925
+ code: "unrecognized_keys",
926
+ keys: o,
927
+ input: t,
928
+ inst: a
929
+ }), e.length ? Promise.all(e).then(() => n) : n;
930
+ }
931
+ var Vt = /*@__PURE__*/ t("$ZodObject", (e, t) => {
932
+ if (L.init(e, t), !Object.getOwnPropertyDescriptor(t, "shape")?.get) {
933
+ let e = t.shape;
934
+ Object.defineProperty(t, "shape", { get: () => {
935
+ let n = { ...e };
936
+ return Object.defineProperty(t, "shape", { value: n }), n;
937
+ } });
938
+ }
939
+ let n = c(() => zt(t));
940
+ f(e._zod, "propValues", () => {
941
+ let e = t.shape, n = {};
942
+ for (let t in e) {
943
+ let r = e[t]._zod;
944
+ if (r.values) {
945
+ n[t] ?? (n[t] = /* @__PURE__ */ new Set());
946
+ for (let e of r.values) n[t].add(e);
947
+ }
948
+ }
949
+ return n;
950
+ });
951
+ let r = _, i = t.catchall, a;
952
+ e._zod.parse = (t, o) => {
953
+ a ??= n.value;
954
+ let s = t.value;
955
+ if (!r(s)) return t.issues.push({
956
+ expected: "object",
957
+ code: "invalid_type",
958
+ input: s,
959
+ inst: e
960
+ }), t;
961
+ t.value = {};
962
+ let c = [], l = a.shape;
963
+ for (let e of a.keys) {
964
+ let n = l[e]._zod.run({
965
+ value: s[e],
966
+ issues: []
967
+ }, o);
968
+ n instanceof Promise ? c.push(n.then((n) => B(n, t, e, s))) : B(n, t, e, s);
969
+ }
970
+ return i ? Bt(c, s, t, o, n.value, e) : c.length ? Promise.all(c).then(() => t) : t;
971
+ };
972
+ }), Ht = /*@__PURE__*/ t("$ZodObjectJIT", (e, t) => {
973
+ Vt.init(e, t);
974
+ let n = e._zod.parse, r = c(() => zt(t)), a = (e) => {
975
+ let t = new st([
976
+ "shape",
977
+ "payload",
978
+ "ctx"
979
+ ]), n = r.value, i = (e) => {
980
+ let t = h(e);
981
+ return `shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`;
982
+ };
983
+ t.write("const input = payload.value;");
984
+ let a = Object.create(null), o = 0;
985
+ for (let e of n.keys) a[e] = `key_${o++}`;
986
+ t.write("const newResult = {};");
987
+ for (let e of n.keys) {
988
+ let n = a[e], r = h(e);
989
+ t.write(`const ${n} = ${i(e)};`), t.write(`
990
+ if (${n}.issues.length) {
991
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
992
+ ...iss,
993
+ path: iss.path ? [${r}, ...iss.path] : [${r}]
994
+ })));
995
+ }
996
+
997
+
998
+ if (${n}.value === undefined) {
999
+ if (${r} in input) {
1000
+ newResult[${r}] = undefined;
1001
+ }
1002
+ } else {
1003
+ newResult[${r}] = ${n}.value;
1004
+ }
1005
+
1006
+ `);
1007
+ }
1008
+ t.write("payload.value = newResult;"), t.write("return payload;");
1009
+ let s = t.compile();
1010
+ return (t, n) => s(e, t, n);
1011
+ }, o, s = _, l = !i.jitless, u = l && ee.value, d = t.catchall, f;
1012
+ e._zod.parse = (i, c) => {
1013
+ f ??= r.value;
1014
+ let p = i.value;
1015
+ return s(p) ? l && u && c?.async === !1 && c.jitless !== !0 ? (o ||= a(t.shape), i = o(i, c), d ? Bt([], p, i, c, f, e) : i) : n(i, c) : (i.issues.push({
1016
+ expected: "object",
1017
+ code: "invalid_type",
1018
+ input: p,
1019
+ inst: e
1020
+ }), i);
1021
+ };
1022
+ });
1023
+ function Ut(e, t, n, r) {
1024
+ for (let n of e) if (n.issues.length === 0) return t.value = n.value, t;
1025
+ let i = e.filter((e) => !S(e));
1026
+ return i.length === 1 ? (t.value = i[0].value, i[0]) : (t.issues.push({
1027
+ code: "invalid_union",
1028
+ input: t.value,
1029
+ inst: n,
1030
+ errors: e.map((e) => e.issues.map((e) => w(e, r, a())))
1031
+ }), t);
1032
+ }
1033
+ var Wt = /*@__PURE__*/ t("$ZodUnion", (e, t) => {
1034
+ L.init(e, t), f(e._zod, "optin", () => t.options.some((e) => e._zod.optin === "optional") ? "optional" : void 0), f(e._zod, "optout", () => t.options.some((e) => e._zod.optout === "optional") ? "optional" : void 0), f(e._zod, "values", () => {
1035
+ if (t.options.every((e) => e._zod.values)) return new Set(t.options.flatMap((e) => Array.from(e._zod.values)));
1036
+ }), f(e._zod, "pattern", () => {
1037
+ if (t.options.every((e) => e._zod.pattern)) {
1038
+ let e = t.options.map((e) => e._zod.pattern);
1039
+ return RegExp(`^(${e.map((e) => u(e.source)).join("|")})$`);
1040
+ }
1041
+ });
1042
+ let n = t.options.length === 1, r = t.options[0]._zod.run;
1043
+ e._zod.parse = (i, a) => {
1044
+ if (n) return r(i, a);
1045
+ let o = !1, s = [];
1046
+ for (let e of t.options) {
1047
+ let t = e._zod.run({
1048
+ value: i.value,
1049
+ issues: []
1050
+ }, a);
1051
+ if (t instanceof Promise) s.push(t), o = !0;
1052
+ else {
1053
+ if (t.issues.length === 0) return t;
1054
+ s.push(t);
1055
+ }
1056
+ }
1057
+ return o ? Promise.all(s).then((t) => Ut(t, i, e, a)) : Ut(s, i, e, a);
1058
+ };
1059
+ }), Gt = /*@__PURE__*/ t("$ZodIntersection", (e, t) => {
1060
+ L.init(e, t), e._zod.parse = (e, n) => {
1061
+ let r = e.value, i = t.left._zod.run({
1062
+ value: r,
1063
+ issues: []
1064
+ }, n), a = t.right._zod.run({
1065
+ value: r,
1066
+ issues: []
1067
+ }, n);
1068
+ return i instanceof Promise || a instanceof Promise ? Promise.all([i, a]).then(([t, n]) => Kt(e, t, n)) : Kt(e, i, a);
1069
+ };
1070
+ });
1071
+ function V(e, t) {
1072
+ if (e === t || e instanceof Date && t instanceof Date && +e == +t) return {
1073
+ valid: !0,
1074
+ data: e
1075
+ };
1076
+ if (v(e) && v(t)) {
1077
+ let n = Object.keys(t), r = Object.keys(e).filter((e) => n.indexOf(e) !== -1), i = {
1078
+ ...e,
1079
+ ...t
1080
+ };
1081
+ for (let n of r) {
1082
+ let r = V(e[n], t[n]);
1083
+ if (!r.valid) return {
1084
+ valid: !1,
1085
+ mergeErrorPath: [n, ...r.mergeErrorPath]
1086
+ };
1087
+ i[n] = r.data;
1088
+ }
1089
+ return {
1090
+ valid: !0,
1091
+ data: i
1092
+ };
1093
+ }
1094
+ if (Array.isArray(e) && Array.isArray(t)) {
1095
+ if (e.length !== t.length) return {
1096
+ valid: !1,
1097
+ mergeErrorPath: []
1098
+ };
1099
+ let n = [];
1100
+ for (let r = 0; r < e.length; r++) {
1101
+ let i = e[r], a = t[r], o = V(i, a);
1102
+ if (!o.valid) return {
1103
+ valid: !1,
1104
+ mergeErrorPath: [r, ...o.mergeErrorPath]
1105
+ };
1106
+ n.push(o.data);
1107
+ }
1108
+ return {
1109
+ valid: !0,
1110
+ data: n
1111
+ };
1112
+ }
1113
+ return {
1114
+ valid: !1,
1115
+ mergeErrorPath: []
1116
+ };
1117
+ }
1118
+ function Kt(e, t, n) {
1119
+ if (t.issues.length && e.issues.push(...t.issues), n.issues.length && e.issues.push(...n.issues), S(e)) return e;
1120
+ let r = V(t.value, n.value);
1121
+ if (!r.valid) throw Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);
1122
+ return e.value = r.data, e;
1123
+ }
1124
+ var qt = /*@__PURE__*/ t("$ZodEnum", (e, t) => {
1125
+ L.init(e, t);
1126
+ let n = o(t.entries), r = new Set(n);
1127
+ e._zod.values = r, e._zod.pattern = RegExp(`^(${n.filter((e) => ne.has(typeof e)).map((e) => typeof e == "string" ? y(e) : e.toString()).join("|")})$`), e._zod.parse = (t, i) => {
1128
+ let a = t.value;
1129
+ return r.has(a) || t.issues.push({
1130
+ code: "invalid_value",
1131
+ values: n,
1132
+ input: a,
1133
+ inst: e
1134
+ }), t;
1135
+ };
1136
+ }), Jt = /*@__PURE__*/ t("$ZodTransform", (e, t) => {
1137
+ L.init(e, t), e._zod.parse = (i, a) => {
1138
+ if (a.direction === "backward") throw new r(e.constructor.name);
1139
+ let o = t.transform(i.value, i);
1140
+ if (a.async) return (o instanceof Promise ? o : Promise.resolve(o)).then((e) => (i.value = e, i));
1141
+ if (o instanceof Promise) throw new n();
1142
+ return i.value = o, i;
1143
+ };
1144
+ });
1145
+ function Yt(e, t) {
1146
+ return e.issues.length && t === void 0 ? {
1147
+ issues: [],
1148
+ value: void 0
1149
+ } : e;
1150
+ }
1151
+ var Xt = /*@__PURE__*/ t("$ZodOptional", (e, t) => {
1152
+ L.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", f(e._zod, "values", () => t.innerType._zod.values ? new Set([...t.innerType._zod.values, void 0]) : void 0), f(e._zod, "pattern", () => {
1153
+ let e = t.innerType._zod.pattern;
1154
+ return e ? RegExp(`^(${u(e.source)})?$`) : void 0;
1155
+ }), e._zod.parse = (e, n) => {
1156
+ if (t.innerType._zod.optin === "optional") {
1157
+ let r = t.innerType._zod.run(e, n);
1158
+ return r instanceof Promise ? r.then((t) => Yt(t, e.value)) : Yt(r, e.value);
1159
+ }
1160
+ return e.value === void 0 ? e : t.innerType._zod.run(e, n);
1161
+ };
1162
+ }), Zt = /*@__PURE__*/ t("$ZodNullable", (e, t) => {
1163
+ L.init(e, t), f(e._zod, "optin", () => t.innerType._zod.optin), f(e._zod, "optout", () => t.innerType._zod.optout), f(e._zod, "pattern", () => {
1164
+ let e = t.innerType._zod.pattern;
1165
+ return e ? RegExp(`^(${u(e.source)}|null)$`) : void 0;
1166
+ }), f(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);
1167
+ }), Qt = /*@__PURE__*/ t("$ZodDefault", (e, t) => {
1168
+ L.init(e, t), e._zod.optin = "optional", f(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (e, n) => {
1169
+ if (n.direction === "backward") return t.innerType._zod.run(e, n);
1170
+ if (e.value === void 0) return e.value = t.defaultValue, e;
1171
+ let r = t.innerType._zod.run(e, n);
1172
+ return r instanceof Promise ? r.then((e) => $t(e, t)) : $t(r, t);
1173
+ };
1174
+ });
1175
+ function $t(e, t) {
1176
+ return e.value === void 0 && (e.value = t.defaultValue), e;
1177
+ }
1178
+ var en = /*@__PURE__*/ t("$ZodPrefault", (e, t) => {
1179
+ L.init(e, t), e._zod.optin = "optional", f(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));
1180
+ }), tn = /*@__PURE__*/ t("$ZodNonOptional", (e, t) => {
1181
+ L.init(e, t), f(e._zod, "values", () => {
1182
+ let e = t.innerType._zod.values;
1183
+ return e ? new Set([...e].filter((e) => e !== void 0)) : void 0;
1184
+ }), e._zod.parse = (n, r) => {
1185
+ let i = t.innerType._zod.run(n, r);
1186
+ return i instanceof Promise ? i.then((t) => nn(t, e)) : nn(i, e);
1187
+ };
1188
+ });
1189
+ function nn(e, t) {
1190
+ return !e.issues.length && e.value === void 0 && e.issues.push({
1191
+ code: "invalid_type",
1192
+ expected: "nonoptional",
1193
+ input: e.value,
1194
+ inst: t
1195
+ }), e;
1196
+ }
1197
+ var rn = /*@__PURE__*/ t("$ZodCatch", (e, t) => {
1198
+ L.init(e, t), f(e._zod, "optin", () => t.innerType._zod.optin), f(e._zod, "optout", () => t.innerType._zod.optout), f(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (e, n) => {
1199
+ if (n.direction === "backward") return t.innerType._zod.run(e, n);
1200
+ let r = t.innerType._zod.run(e, n);
1201
+ return r instanceof Promise ? r.then((r) => (e.value = r.value, r.issues.length && (e.value = t.catchValue({
1202
+ ...e,
1203
+ error: { issues: r.issues.map((e) => w(e, n, a())) },
1204
+ input: e.value
1205
+ }), e.issues = []), e)) : (e.value = r.value, r.issues.length && (e.value = t.catchValue({
1206
+ ...e,
1207
+ error: { issues: r.issues.map((e) => w(e, n, a())) },
1208
+ input: e.value
1209
+ }), e.issues = []), e);
1210
+ };
1211
+ }), an = /*@__PURE__*/ t("$ZodPipe", (e, t) => {
1212
+ L.init(e, t), f(e._zod, "values", () => t.in._zod.values), f(e._zod, "optin", () => t.in._zod.optin), f(e._zod, "optout", () => t.out._zod.optout), f(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (e, n) => {
1213
+ if (n.direction === "backward") {
1214
+ let r = t.out._zod.run(e, n);
1215
+ return r instanceof Promise ? r.then((e) => H(e, t.in, n)) : H(r, t.in, n);
1216
+ }
1217
+ let r = t.in._zod.run(e, n);
1218
+ return r instanceof Promise ? r.then((e) => H(e, t.out, n)) : H(r, t.out, n);
1219
+ };
1220
+ });
1221
+ function H(e, t, n) {
1222
+ return e.issues.length ? (e.aborted = !0, e) : t._zod.run({
1223
+ value: e.value,
1224
+ issues: e.issues
1225
+ }, n);
1226
+ }
1227
+ var on = /*@__PURE__*/ t("$ZodReadonly", (e, t) => {
1228
+ L.init(e, t), f(e._zod, "propValues", () => t.innerType._zod.propValues), f(e._zod, "values", () => t.innerType._zod.values), f(e._zod, "optin", () => t.innerType._zod.optin), f(e._zod, "optout", () => t.innerType._zod.optout), e._zod.parse = (e, n) => {
1229
+ if (n.direction === "backward") return t.innerType._zod.run(e, n);
1230
+ let r = t.innerType._zod.run(e, n);
1231
+ return r instanceof Promise ? r.then(sn) : sn(r);
1232
+ };
1233
+ });
1234
+ function sn(e) {
1235
+ return e.value = Object.freeze(e.value), e;
1236
+ }
1237
+ var cn = /*@__PURE__*/ t("$ZodCustom", (e, t) => {
1238
+ F.init(e, t), L.init(e, t), e._zod.parse = (e, t) => e, e._zod.check = (n) => {
1239
+ let r = n.value, i = t.fn(r);
1240
+ if (i instanceof Promise) return i.then((t) => ln(t, n, r, e));
1241
+ ln(i, n, r, e);
1242
+ };
1243
+ });
1244
+ function ln(e, t, n, r) {
1245
+ if (!e) {
1246
+ let e = {
1247
+ code: "custom",
1248
+ input: n,
1249
+ inst: r,
1250
+ path: [...r._zod.def.path ?? []],
1251
+ continue: !r._zod.def.abort
1252
+ };
1253
+ r._zod.def.params && (e.params = r._zod.def.params), t.issues.push(E(e));
1254
+ }
1255
+ }
1256
+ //#endregion
1257
+ //#region ../../node_modules/zod/v4/core/registries.js
1258
+ var un = class {
1259
+ constructor() {
1260
+ this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
1261
+ }
1262
+ add(e, ...t) {
1263
+ let n = t[0];
1264
+ if (this._map.set(e, n), n && typeof n == "object" && "id" in n) {
1265
+ if (this._idmap.has(n.id)) throw Error(`ID ${n.id} already exists in the registry`);
1266
+ this._idmap.set(n.id, e);
1267
+ }
1268
+ return this;
1269
+ }
1270
+ clear() {
1271
+ return this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(), this;
1272
+ }
1273
+ remove(e) {
1274
+ let t = this._map.get(e);
1275
+ return t && typeof t == "object" && "id" in t && this._idmap.delete(t.id), this._map.delete(e), this;
1276
+ }
1277
+ get(e) {
1278
+ let t = e._zod.parent;
1279
+ if (t) {
1280
+ let n = { ...this.get(t) ?? {} };
1281
+ delete n.id;
1282
+ let r = {
1283
+ ...n,
1284
+ ...this._map.get(e)
1285
+ };
1286
+ return Object.keys(r).length ? r : void 0;
1287
+ }
1288
+ return this._map.get(e);
1289
+ }
1290
+ has(e) {
1291
+ return this._map.has(e);
1292
+ }
1293
+ };
1294
+ function dn() {
1295
+ return new un();
1296
+ }
1297
+ var U = /*@__PURE__*/ dn();
1298
+ //#endregion
1299
+ //#region ../../node_modules/zod/v4/core/api.js
1300
+ function fn(e, t) {
1301
+ return new e({
1302
+ type: "string",
1303
+ ...x(t)
1304
+ });
1305
+ }
1306
+ function pn(e, t) {
1307
+ return new e({
1308
+ type: "string",
1309
+ format: "email",
1310
+ check: "string_format",
1311
+ abort: !1,
1312
+ ...x(t)
1313
+ });
1314
+ }
1315
+ function mn(e, t) {
1316
+ return new e({
1317
+ type: "string",
1318
+ format: "guid",
1319
+ check: "string_format",
1320
+ abort: !1,
1321
+ ...x(t)
1322
+ });
1323
+ }
1324
+ function hn(e, t) {
1325
+ return new e({
1326
+ type: "string",
1327
+ format: "uuid",
1328
+ check: "string_format",
1329
+ abort: !1,
1330
+ ...x(t)
1331
+ });
1332
+ }
1333
+ function gn(e, t) {
1334
+ return new e({
1335
+ type: "string",
1336
+ format: "uuid",
1337
+ check: "string_format",
1338
+ abort: !1,
1339
+ version: "v4",
1340
+ ...x(t)
1341
+ });
1342
+ }
1343
+ function _n(e, t) {
1344
+ return new e({
1345
+ type: "string",
1346
+ format: "uuid",
1347
+ check: "string_format",
1348
+ abort: !1,
1349
+ version: "v6",
1350
+ ...x(t)
1351
+ });
1352
+ }
1353
+ function vn(e, t) {
1354
+ return new e({
1355
+ type: "string",
1356
+ format: "uuid",
1357
+ check: "string_format",
1358
+ abort: !1,
1359
+ version: "v7",
1360
+ ...x(t)
1361
+ });
1362
+ }
1363
+ function yn(e, t) {
1364
+ return new e({
1365
+ type: "string",
1366
+ format: "url",
1367
+ check: "string_format",
1368
+ abort: !1,
1369
+ ...x(t)
1370
+ });
1371
+ }
1372
+ function bn(e, t) {
1373
+ return new e({
1374
+ type: "string",
1375
+ format: "emoji",
1376
+ check: "string_format",
1377
+ abort: !1,
1378
+ ...x(t)
1379
+ });
1380
+ }
1381
+ function xn(e, t) {
1382
+ return new e({
1383
+ type: "string",
1384
+ format: "nanoid",
1385
+ check: "string_format",
1386
+ abort: !1,
1387
+ ...x(t)
1388
+ });
1389
+ }
1390
+ function Sn(e, t) {
1391
+ return new e({
1392
+ type: "string",
1393
+ format: "cuid",
1394
+ check: "string_format",
1395
+ abort: !1,
1396
+ ...x(t)
1397
+ });
1398
+ }
1399
+ function Cn(e, t) {
1400
+ return new e({
1401
+ type: "string",
1402
+ format: "cuid2",
1403
+ check: "string_format",
1404
+ abort: !1,
1405
+ ...x(t)
1406
+ });
1407
+ }
1408
+ function wn(e, t) {
1409
+ return new e({
1410
+ type: "string",
1411
+ format: "ulid",
1412
+ check: "string_format",
1413
+ abort: !1,
1414
+ ...x(t)
1415
+ });
1416
+ }
1417
+ function Tn(e, t) {
1418
+ return new e({
1419
+ type: "string",
1420
+ format: "xid",
1421
+ check: "string_format",
1422
+ abort: !1,
1423
+ ...x(t)
1424
+ });
1425
+ }
1426
+ function En(e, t) {
1427
+ return new e({
1428
+ type: "string",
1429
+ format: "ksuid",
1430
+ check: "string_format",
1431
+ abort: !1,
1432
+ ...x(t)
1433
+ });
1434
+ }
1435
+ function Dn(e, t) {
1436
+ return new e({
1437
+ type: "string",
1438
+ format: "ipv4",
1439
+ check: "string_format",
1440
+ abort: !1,
1441
+ ...x(t)
1442
+ });
1443
+ }
1444
+ function On(e, t) {
1445
+ return new e({
1446
+ type: "string",
1447
+ format: "ipv6",
1448
+ check: "string_format",
1449
+ abort: !1,
1450
+ ...x(t)
1451
+ });
1452
+ }
1453
+ function kn(e, t) {
1454
+ return new e({
1455
+ type: "string",
1456
+ format: "cidrv4",
1457
+ check: "string_format",
1458
+ abort: !1,
1459
+ ...x(t)
1460
+ });
1461
+ }
1462
+ function An(e, t) {
1463
+ return new e({
1464
+ type: "string",
1465
+ format: "cidrv6",
1466
+ check: "string_format",
1467
+ abort: !1,
1468
+ ...x(t)
1469
+ });
1470
+ }
1471
+ function jn(e, t) {
1472
+ return new e({
1473
+ type: "string",
1474
+ format: "base64",
1475
+ check: "string_format",
1476
+ abort: !1,
1477
+ ...x(t)
1478
+ });
1479
+ }
1480
+ function Mn(e, t) {
1481
+ return new e({
1482
+ type: "string",
1483
+ format: "base64url",
1484
+ check: "string_format",
1485
+ abort: !1,
1486
+ ...x(t)
1487
+ });
1488
+ }
1489
+ function Nn(e, t) {
1490
+ return new e({
1491
+ type: "string",
1492
+ format: "e164",
1493
+ check: "string_format",
1494
+ abort: !1,
1495
+ ...x(t)
1496
+ });
1497
+ }
1498
+ function Pn(e, t) {
1499
+ return new e({
1500
+ type: "string",
1501
+ format: "jwt",
1502
+ check: "string_format",
1503
+ abort: !1,
1504
+ ...x(t)
1505
+ });
1506
+ }
1507
+ function Fn(e, t) {
1508
+ return new e({
1509
+ type: "string",
1510
+ format: "datetime",
1511
+ check: "string_format",
1512
+ offset: !1,
1513
+ local: !1,
1514
+ precision: null,
1515
+ ...x(t)
1516
+ });
1517
+ }
1518
+ function In(e, t) {
1519
+ return new e({
1520
+ type: "string",
1521
+ format: "date",
1522
+ check: "string_format",
1523
+ ...x(t)
1524
+ });
1525
+ }
1526
+ function Ln(e, t) {
1527
+ return new e({
1528
+ type: "string",
1529
+ format: "time",
1530
+ check: "string_format",
1531
+ precision: null,
1532
+ ...x(t)
1533
+ });
1534
+ }
1535
+ function Rn(e, t) {
1536
+ return new e({
1537
+ type: "string",
1538
+ format: "duration",
1539
+ check: "string_format",
1540
+ ...x(t)
1541
+ });
1542
+ }
1543
+ function zn(e) {
1544
+ return new e({ type: "unknown" });
1545
+ }
1546
+ function Bn(e, t) {
1547
+ return new e({
1548
+ type: "never",
1549
+ ...x(t)
1550
+ });
1551
+ }
1552
+ function Vn(e, t) {
1553
+ return new Ze({
1554
+ check: "max_length",
1555
+ ...x(t),
1556
+ maximum: e
1557
+ });
1558
+ }
1559
+ function W(e, t) {
1560
+ return new Qe({
1561
+ check: "min_length",
1562
+ ...x(t),
1563
+ minimum: e
1564
+ });
1565
+ }
1566
+ function Hn(e, t) {
1567
+ return new $e({
1568
+ check: "length_equals",
1569
+ ...x(t),
1570
+ length: e
1571
+ });
1572
+ }
1573
+ function Un(e, t) {
1574
+ return new et({
1575
+ check: "string_format",
1576
+ format: "regex",
1577
+ ...x(t),
1578
+ pattern: e
1579
+ });
1580
+ }
1581
+ function Wn(e) {
1582
+ return new tt({
1583
+ check: "string_format",
1584
+ format: "lowercase",
1585
+ ...x(e)
1586
+ });
1587
+ }
1588
+ function Gn(e) {
1589
+ return new nt({
1590
+ check: "string_format",
1591
+ format: "uppercase",
1592
+ ...x(e)
1593
+ });
1594
+ }
1595
+ function Kn(e, t) {
1596
+ return new rt({
1597
+ check: "string_format",
1598
+ format: "includes",
1599
+ ...x(t),
1600
+ includes: e
1601
+ });
1602
+ }
1603
+ function qn(e, t) {
1604
+ return new it({
1605
+ check: "string_format",
1606
+ format: "starts_with",
1607
+ ...x(t),
1608
+ prefix: e
1609
+ });
1610
+ }
1611
+ function Jn(e, t) {
1612
+ return new at({
1613
+ check: "string_format",
1614
+ format: "ends_with",
1615
+ ...x(t),
1616
+ suffix: e
1617
+ });
1618
+ }
1619
+ function G(e) {
1620
+ return new ot({
1621
+ check: "overwrite",
1622
+ tx: e
1623
+ });
1624
+ }
1625
+ function Yn(e) {
1626
+ return G((t) => t.normalize(e));
1627
+ }
1628
+ function Xn() {
1629
+ return G((e) => e.trim());
1630
+ }
1631
+ function Zn() {
1632
+ return G((e) => e.toLowerCase());
1633
+ }
1634
+ function Qn() {
1635
+ return G((e) => e.toUpperCase());
1636
+ }
1637
+ function $n(e, t, n) {
1638
+ return new e({
1639
+ type: "array",
1640
+ element: t,
1641
+ ...x(n)
1642
+ });
1643
+ }
1644
+ function er(e, t, n) {
1645
+ return new e({
1646
+ type: "custom",
1647
+ check: "custom",
1648
+ fn: t,
1649
+ ...x(n)
1650
+ });
1651
+ }
1652
+ function tr(e) {
1653
+ let t = nr((n) => (n.addIssue = (e) => {
1654
+ if (typeof e == "string") n.issues.push(E(e, n.value, t._zod.def));
1655
+ else {
1656
+ let r = e;
1657
+ r.fatal && (r.continue = !1), r.code ??= "custom", r.input ??= n.value, r.inst ??= t, r.continue ??= !t._zod.def.abort, n.issues.push(E(r));
1658
+ }
1659
+ }, e(n.value, n)));
1660
+ return t;
1661
+ }
1662
+ function nr(e, t) {
1663
+ let n = new F({
1664
+ check: "custom",
1665
+ ...x(t)
1666
+ });
1667
+ return n._zod.check = e, n;
1668
+ }
1669
+ //#endregion
1670
+ //#region ../../node_modules/zod/v4/classic/iso.js
1671
+ var rr = /*@__PURE__*/ t("ZodISODateTime", (e, t) => {
1672
+ bt.init(e, t), J.init(e, t);
1673
+ });
1674
+ function ir(e) {
1675
+ return Fn(rr, e);
1676
+ }
1677
+ var ar = /*@__PURE__*/ t("ZodISODate", (e, t) => {
1678
+ xt.init(e, t), J.init(e, t);
1679
+ });
1680
+ function or(e) {
1681
+ return In(ar, e);
1682
+ }
1683
+ var sr = /*@__PURE__*/ t("ZodISOTime", (e, t) => {
1684
+ St.init(e, t), J.init(e, t);
1685
+ });
1686
+ function cr(e) {
1687
+ return Ln(sr, e);
1688
+ }
1689
+ var lr = /*@__PURE__*/ t("ZodISODuration", (e, t) => {
1690
+ Ct.init(e, t), J.init(e, t);
1691
+ });
1692
+ function ur(e) {
1693
+ return Rn(lr, e);
1694
+ }
1695
+ //#endregion
1696
+ //#region ../../node_modules/zod/v4/classic/errors.js
1697
+ var dr = (e, t) => {
1698
+ pe.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
1699
+ format: { value: (t) => ge(e, t) },
1700
+ flatten: { value: (t) => he(e, t) },
1701
+ addIssue: { value: (t) => {
1702
+ e.issues.push(t), e.message = JSON.stringify(e.issues, s, 2);
1703
+ } },
1704
+ addIssues: { value: (t) => {
1705
+ e.issues.push(...t), e.message = JSON.stringify(e.issues, s, 2);
1706
+ } },
1707
+ isEmpty: { get() {
1708
+ return e.issues.length === 0;
1709
+ } }
1710
+ });
1711
+ };
1712
+ t("ZodError", dr);
1713
+ var K = t("ZodError", dr, { Parent: Error }), fr = /* @__PURE__ */ D(K), pr = /* @__PURE__ */ O(K), mr = /* @__PURE__ */ k(K), hr = /* @__PURE__ */ A(K), gr = /* @__PURE__ */ ye(K), _r = /* @__PURE__ */ be(K), vr = /* @__PURE__ */ xe(K), yr = /* @__PURE__ */ Se(K), br = /* @__PURE__ */ Ce(K), xr = /* @__PURE__ */ we(K), Sr = /* @__PURE__ */ Te(K), Cr = /* @__PURE__ */ Ee(K), q = /*@__PURE__*/ t("ZodType", (e, t) => (L.init(e, t), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(m(t, { checks: [...t.checks ?? [], ...n.map((e) => typeof e == "function" ? { _zod: {
1714
+ check: e,
1715
+ def: { check: "custom" },
1716
+ onattach: []
1717
+ } } : e)] })), e.clone = (t, n) => b(e, t, n), e.brand = () => e, e.register = ((t, n) => (t.add(e, n), e)), e.parse = (t, n) => fr(e, t, n, { callee: e.parse }), e.safeParse = (t, n) => mr(e, t, n), e.parseAsync = async (t, n) => pr(e, t, n, { callee: e.parseAsync }), e.safeParseAsync = async (t, n) => hr(e, t, n), e.spa = e.safeParseAsync, e.encode = (t, n) => gr(e, t, n), e.decode = (t, n) => _r(e, t, n), e.encodeAsync = async (t, n) => vr(e, t, n), e.decodeAsync = async (t, n) => yr(e, t, n), e.safeEncode = (t, n) => br(e, t, n), e.safeDecode = (t, n) => xr(e, t, n), e.safeEncodeAsync = async (t, n) => Sr(e, t, n), e.safeDecodeAsync = async (t, n) => Cr(e, t, n), e.refine = (t, n) => e.check(Si(t, n)), e.superRefine = (t) => e.check(Ci(t)), e.overwrite = (t) => e.check(G(t)), e.optional = () => Z(e), e.nullable = () => ci(e), e.nullish = () => Z(ci(e)), e.nonoptional = (t) => mi(e, t), e.array = () => Xr(e), e.or = (t) => ei([e, t]), e.and = (t) => ni(e, t), e.transform = (t) => vi(e, ai(t)), e.default = (t) => ui(e, t), e.prefault = (t) => fi(e, t), e.catch = (t) => gi(e, t), e.pipe = (t) => vi(e, t), e.readonly = () => bi(e), e.describe = (t) => {
1718
+ let n = e.clone();
1719
+ return U.add(n, { description: t }), n;
1720
+ }, Object.defineProperty(e, "description", {
1721
+ get() {
1722
+ return U.get(e)?.description;
1723
+ },
1724
+ configurable: !0
1725
+ }), e.meta = (...t) => {
1726
+ if (t.length === 0) return U.get(e);
1727
+ let n = e.clone();
1728
+ return U.add(n, t[0]), n;
1729
+ }, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), wr = /*@__PURE__*/ t("_ZodString", (e, t) => {
1730
+ R.init(e, t), q.init(e, t);
1731
+ let n = e._zod.bag;
1732
+ e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...t) => e.check(Un(...t)), e.includes = (...t) => e.check(Kn(...t)), e.startsWith = (...t) => e.check(qn(...t)), e.endsWith = (...t) => e.check(Jn(...t)), e.min = (...t) => e.check(W(...t)), e.max = (...t) => e.check(Vn(...t)), e.length = (...t) => e.check(Hn(...t)), e.nonempty = (...t) => e.check(W(1, ...t)), e.lowercase = (t) => e.check(Wn(t)), e.uppercase = (t) => e.check(Gn(t)), e.trim = () => e.check(Xn()), e.normalize = (...t) => e.check(Yn(...t)), e.toLowerCase = () => e.check(Zn()), e.toUpperCase = () => e.check(Qn());
1733
+ }), Tr = /*@__PURE__*/ t("ZodString", (e, t) => {
1734
+ R.init(e, t), wr.init(e, t), e.email = (t) => e.check(pn(Dr, t)), e.url = (t) => e.check(yn(kr, t)), e.jwt = (t) => e.check(Pn(Wr, t)), e.emoji = (t) => e.check(bn(Ar, t)), e.guid = (t) => e.check(mn(Or, t)), e.uuid = (t) => e.check(hn(Y, t)), e.uuidv4 = (t) => e.check(gn(Y, t)), e.uuidv6 = (t) => e.check(_n(Y, t)), e.uuidv7 = (t) => e.check(vn(Y, t)), e.nanoid = (t) => e.check(xn(jr, t)), e.guid = (t) => e.check(mn(Or, t)), e.cuid = (t) => e.check(Sn(Mr, t)), e.cuid2 = (t) => e.check(Cn(Nr, t)), e.ulid = (t) => e.check(wn(Pr, t)), e.base64 = (t) => e.check(jn(Vr, t)), e.base64url = (t) => e.check(Mn(Hr, t)), e.xid = (t) => e.check(Tn(Fr, t)), e.ksuid = (t) => e.check(En(Ir, t)), e.ipv4 = (t) => e.check(Dn(Lr, t)), e.ipv6 = (t) => e.check(On(Rr, t)), e.cidrv4 = (t) => e.check(kn(zr, t)), e.cidrv6 = (t) => e.check(An(Br, t)), e.e164 = (t) => e.check(Nn(Ur, t)), e.datetime = (t) => e.check(ir(t)), e.date = (t) => e.check(or(t)), e.time = (t) => e.check(cr(t)), e.duration = (t) => e.check(ur(t));
1735
+ });
1736
+ function Er(e) {
1737
+ return fn(Tr, e);
1738
+ }
1739
+ var J = /*@__PURE__*/ t("ZodStringFormat", (e, t) => {
1740
+ z.init(e, t), wr.init(e, t);
1741
+ }), Dr = /*@__PURE__*/ t("ZodEmail", (e, t) => {
1742
+ dt.init(e, t), J.init(e, t);
1743
+ }), Or = /*@__PURE__*/ t("ZodGUID", (e, t) => {
1744
+ lt.init(e, t), J.init(e, t);
1745
+ }), Y = /*@__PURE__*/ t("ZodUUID", (e, t) => {
1746
+ ut.init(e, t), J.init(e, t);
1747
+ }), kr = /*@__PURE__*/ t("ZodURL", (e, t) => {
1748
+ ft.init(e, t), J.init(e, t);
1749
+ }), Ar = /*@__PURE__*/ t("ZodEmoji", (e, t) => {
1750
+ pt.init(e, t), J.init(e, t);
1751
+ }), jr = /*@__PURE__*/ t("ZodNanoID", (e, t) => {
1752
+ mt.init(e, t), J.init(e, t);
1753
+ }), Mr = /*@__PURE__*/ t("ZodCUID", (e, t) => {
1754
+ ht.init(e, t), J.init(e, t);
1755
+ }), Nr = /*@__PURE__*/ t("ZodCUID2", (e, t) => {
1756
+ gt.init(e, t), J.init(e, t);
1757
+ }), Pr = /*@__PURE__*/ t("ZodULID", (e, t) => {
1758
+ _t.init(e, t), J.init(e, t);
1759
+ }), Fr = /*@__PURE__*/ t("ZodXID", (e, t) => {
1760
+ vt.init(e, t), J.init(e, t);
1761
+ }), Ir = /*@__PURE__*/ t("ZodKSUID", (e, t) => {
1762
+ yt.init(e, t), J.init(e, t);
1763
+ }), Lr = /*@__PURE__*/ t("ZodIPv4", (e, t) => {
1764
+ wt.init(e, t), J.init(e, t);
1765
+ }), Rr = /*@__PURE__*/ t("ZodIPv6", (e, t) => {
1766
+ Tt.init(e, t), J.init(e, t);
1767
+ }), zr = /*@__PURE__*/ t("ZodCIDRv4", (e, t) => {
1768
+ Et.init(e, t), J.init(e, t);
1769
+ }), Br = /*@__PURE__*/ t("ZodCIDRv6", (e, t) => {
1770
+ Dt.init(e, t), J.init(e, t);
1771
+ }), Vr = /*@__PURE__*/ t("ZodBase64", (e, t) => {
1772
+ kt.init(e, t), J.init(e, t);
1773
+ }), Hr = /*@__PURE__*/ t("ZodBase64URL", (e, t) => {
1774
+ jt.init(e, t), J.init(e, t);
1775
+ }), Ur = /*@__PURE__*/ t("ZodE164", (e, t) => {
1776
+ Mt.init(e, t), J.init(e, t);
1777
+ }), Wr = /*@__PURE__*/ t("ZodJWT", (e, t) => {
1778
+ Pt.init(e, t), J.init(e, t);
1779
+ }), Gr = /*@__PURE__*/ t("ZodUnknown", (e, t) => {
1780
+ Ft.init(e, t), q.init(e, t);
1781
+ });
1782
+ function Kr() {
1783
+ return zn(Gr);
1784
+ }
1785
+ var qr = /*@__PURE__*/ t("ZodNever", (e, t) => {
1786
+ It.init(e, t), q.init(e, t);
1787
+ });
1788
+ function Jr(e) {
1789
+ return Bn(qr, e);
1790
+ }
1791
+ var Yr = /*@__PURE__*/ t("ZodArray", (e, t) => {
1792
+ Rt.init(e, t), q.init(e, t), e.element = t.element, e.min = (t, n) => e.check(W(t, n)), e.nonempty = (t) => e.check(W(1, t)), e.max = (t, n) => e.check(Vn(t, n)), e.length = (t, n) => e.check(Hn(t, n)), e.unwrap = () => e.element;
1793
+ });
1794
+ function Xr(e, t) {
1795
+ return $n(Yr, e, t);
1796
+ }
1797
+ var Zr = /*@__PURE__*/ t("ZodObject", (e, t) => {
1798
+ Ht.init(e, t), q.init(e, t), f(e, "shape", () => t.shape), e.keyof = () => ri(Object.keys(e._zod.def.shape)), e.catchall = (t) => e.clone({
1799
+ ...e._zod.def,
1800
+ catchall: t
1801
+ }), e.passthrough = () => e.clone({
1802
+ ...e._zod.def,
1803
+ catchall: Kr()
1804
+ }), e.loose = () => e.clone({
1805
+ ...e._zod.def,
1806
+ catchall: Kr()
1807
+ }), e.strict = () => e.clone({
1808
+ ...e._zod.def,
1809
+ catchall: Jr()
1810
+ }), e.strip = () => e.clone({
1811
+ ...e._zod.def,
1812
+ catchall: void 0
1813
+ }), e.extend = (t) => oe(e, t), e.safeExtend = (t) => se(e, t), e.merge = (t) => ce(e, t), e.pick = (t) => ie(e, t), e.omit = (t) => ae(e, t), e.partial = (...t) => le(oi, e, t[0]), e.required = (...t) => ue(pi, e, t[0]);
1814
+ });
1815
+ function Qr(e, t) {
1816
+ return new Zr({
1817
+ type: "object",
1818
+ shape: e ?? {},
1819
+ ...x(t)
1820
+ });
1821
+ }
1822
+ var $r = /*@__PURE__*/ t("ZodUnion", (e, t) => {
1823
+ Wt.init(e, t), q.init(e, t), e.options = t.options;
1824
+ });
1825
+ function ei(e, t) {
1826
+ return new $r({
1827
+ type: "union",
1828
+ options: e,
1829
+ ...x(t)
1830
+ });
1831
+ }
1832
+ var ti = /*@__PURE__*/ t("ZodIntersection", (e, t) => {
1833
+ Gt.init(e, t), q.init(e, t);
1834
+ });
1835
+ function ni(e, t) {
1836
+ return new ti({
1837
+ type: "intersection",
1838
+ left: e,
1839
+ right: t
1840
+ });
1841
+ }
1842
+ var X = /*@__PURE__*/ t("ZodEnum", (e, t) => {
1843
+ qt.init(e, t), q.init(e, t), e.enum = t.entries, e.options = Object.values(t.entries);
1844
+ let n = new Set(Object.keys(t.entries));
1845
+ e.extract = (e, r) => {
1846
+ let i = {};
1847
+ for (let r of e) if (n.has(r)) i[r] = t.entries[r];
1848
+ else throw Error(`Key ${r} not found in enum`);
1849
+ return new X({
1850
+ ...t,
1851
+ checks: [],
1852
+ ...x(r),
1853
+ entries: i
1854
+ });
1855
+ }, e.exclude = (e, r) => {
1856
+ let i = { ...t.entries };
1857
+ for (let t of e) if (n.has(t)) delete i[t];
1858
+ else throw Error(`Key ${t} not found in enum`);
1859
+ return new X({
1860
+ ...t,
1861
+ checks: [],
1862
+ ...x(r),
1863
+ entries: i
1864
+ });
1865
+ };
1866
+ });
1867
+ function ri(e, t) {
1868
+ return new X({
1869
+ type: "enum",
1870
+ entries: Array.isArray(e) ? Object.fromEntries(e.map((e) => [e, e])) : e,
1871
+ ...x(t)
1872
+ });
1873
+ }
1874
+ var ii = /*@__PURE__*/ t("ZodTransform", (e, t) => {
1875
+ Jt.init(e, t), q.init(e, t), e._zod.parse = (n, i) => {
1876
+ if (i.direction === "backward") throw new r(e.constructor.name);
1877
+ n.addIssue = (r) => {
1878
+ if (typeof r == "string") n.issues.push(E(r, n.value, t));
1879
+ else {
1880
+ let t = r;
1881
+ t.fatal && (t.continue = !1), t.code ??= "custom", t.input ??= n.value, t.inst ??= e, n.issues.push(E(t));
1882
+ }
1883
+ };
1884
+ let a = t.transform(n.value, n);
1885
+ return a instanceof Promise ? a.then((e) => (n.value = e, n)) : (n.value = a, n);
1886
+ };
1887
+ });
1888
+ function ai(e) {
1889
+ return new ii({
1890
+ type: "transform",
1891
+ transform: e
1892
+ });
1893
+ }
1894
+ var oi = /*@__PURE__*/ t("ZodOptional", (e, t) => {
1895
+ Xt.init(e, t), q.init(e, t), e.unwrap = () => e._zod.def.innerType;
1896
+ });
1897
+ function Z(e) {
1898
+ return new oi({
1899
+ type: "optional",
1900
+ innerType: e
1901
+ });
1902
+ }
1903
+ var si = /*@__PURE__*/ t("ZodNullable", (e, t) => {
1904
+ Zt.init(e, t), q.init(e, t), e.unwrap = () => e._zod.def.innerType;
1905
+ });
1906
+ function ci(e) {
1907
+ return new si({
1908
+ type: "nullable",
1909
+ innerType: e
1910
+ });
1911
+ }
1912
+ var li = /*@__PURE__*/ t("ZodDefault", (e, t) => {
1913
+ Qt.init(e, t), q.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
1914
+ });
1915
+ function ui(e, t) {
1916
+ return new li({
1917
+ type: "default",
1918
+ innerType: e,
1919
+ get defaultValue() {
1920
+ return typeof t == "function" ? t() : te(t);
1921
+ }
1922
+ });
1923
+ }
1924
+ var di = /*@__PURE__*/ t("ZodPrefault", (e, t) => {
1925
+ en.init(e, t), q.init(e, t), e.unwrap = () => e._zod.def.innerType;
1926
+ });
1927
+ function fi(e, t) {
1928
+ return new di({
1929
+ type: "prefault",
1930
+ innerType: e,
1931
+ get defaultValue() {
1932
+ return typeof t == "function" ? t() : te(t);
1933
+ }
1934
+ });
1935
+ }
1936
+ var pi = /*@__PURE__*/ t("ZodNonOptional", (e, t) => {
1937
+ tn.init(e, t), q.init(e, t), e.unwrap = () => e._zod.def.innerType;
1938
+ });
1939
+ function mi(e, t) {
1940
+ return new pi({
1941
+ type: "nonoptional",
1942
+ innerType: e,
1943
+ ...x(t)
1944
+ });
1945
+ }
1946
+ var hi = /*@__PURE__*/ t("ZodCatch", (e, t) => {
1947
+ rn.init(e, t), q.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
1948
+ });
1949
+ function gi(e, t) {
1950
+ return new hi({
1951
+ type: "catch",
1952
+ innerType: e,
1953
+ catchValue: typeof t == "function" ? t : () => t
1954
+ });
1955
+ }
1956
+ var _i = /*@__PURE__*/ t("ZodPipe", (e, t) => {
1957
+ an.init(e, t), q.init(e, t), e.in = t.in, e.out = t.out;
1958
+ });
1959
+ function vi(e, t) {
1960
+ return new _i({
1961
+ type: "pipe",
1962
+ in: e,
1963
+ out: t
1964
+ });
1965
+ }
1966
+ var yi = /*@__PURE__*/ t("ZodReadonly", (e, t) => {
1967
+ on.init(e, t), q.init(e, t), e.unwrap = () => e._zod.def.innerType;
1968
+ });
1969
+ function bi(e) {
1970
+ return new yi({
1971
+ type: "readonly",
1972
+ innerType: e
1973
+ });
1974
+ }
1975
+ var xi = /*@__PURE__*/ t("ZodCustom", (e, t) => {
1976
+ cn.init(e, t), q.init(e, t);
1977
+ });
1978
+ function Si(e, t = {}) {
1979
+ return er(xi, e, t);
1980
+ }
1981
+ function Ci(e) {
1982
+ return tr(e);
1983
+ }
1984
+ //#endregion
1985
+ //#region ../twenty-shared/node_modules/class-validator/esm5/metadata/ValidationMetadata.js
1986
+ var wi = function() {
1987
+ function e(e) {
1988
+ this.groups = [], this.each = !1, this.context = void 0, this.type = e.type, this.name = e.name, this.target = e.target, this.propertyName = e.propertyName, this.constraints = e?.constraints, this.constraintCls = e.constraintCls, this.validationTypeOptions = e.validationTypeOptions, e.validationOptions && (this.message = e.validationOptions.message, this.groups = e.validationOptions.groups, this.always = e.validationOptions.always, this.each = e.validationOptions.each, this.context = e.validationOptions.context);
1989
+ }
1990
+ return e;
1991
+ }(), Ti = function() {
1992
+ function e() {}
1993
+ return e.prototype.transform = function(e) {
1994
+ var t = [];
1995
+ return Object.keys(e.properties).forEach(function(n) {
1996
+ e.properties[n].forEach(function(r) {
1997
+ var i = {
1998
+ message: r.message,
1999
+ groups: r.groups,
2000
+ always: r.always,
2001
+ each: r.each
2002
+ }, a = {
2003
+ type: r.type,
2004
+ name: r.name,
2005
+ target: e.name,
2006
+ propertyName: n,
2007
+ constraints: r.constraints,
2008
+ validationTypeOptions: r.options,
2009
+ validationOptions: i
2010
+ };
2011
+ t.push(new wi(a));
2012
+ });
2013
+ }), t;
2014
+ }, e;
2015
+ }(), Ei = function(e) {
2016
+ var t = typeof Symbol == "function" && Symbol.iterator, n = t && e[t], r = 0;
2017
+ if (n) return n.call(e);
2018
+ if (e && typeof e.length == "number") return { next: function() {
2019
+ return e && r >= e.length && (e = void 0), {
2020
+ value: e && e[r++],
2021
+ done: !e
2022
+ };
2023
+ } };
2024
+ throw TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.");
2025
+ }, Di = function(e, t) {
2026
+ var n = typeof Symbol == "function" && e[Symbol.iterator];
2027
+ if (!n) return e;
2028
+ var r = n.call(e), i, a = [], o;
2029
+ try {
2030
+ for (; (t === void 0 || t-- > 0) && !(i = r.next()).done;) a.push(i.value);
2031
+ } catch (e) {
2032
+ o = { error: e };
2033
+ } finally {
2034
+ try {
2035
+ i && !i.done && (n = r.return) && n.call(r);
2036
+ } finally {
2037
+ if (o) throw o.error;
2038
+ }
2039
+ }
2040
+ return a;
2041
+ }, Oi = function(e, t, n) {
2042
+ if (n || arguments.length === 2) for (var r = 0, i = t.length, a; r < i; r++) (a || !(r in t)) && (a ||= Array.prototype.slice.call(t, 0, r), a[r] = t[r]);
2043
+ return e.concat(a || Array.prototype.slice.call(t));
2044
+ };
2045
+ (function() {
2046
+ function e() {
2047
+ this.validationMetadatas = /* @__PURE__ */ new Map(), this.constraintMetadatas = /* @__PURE__ */ new Map();
2048
+ }
2049
+ return Object.defineProperty(e.prototype, "hasValidationMetaData", {
2050
+ get: function() {
2051
+ return !!this.validationMetadatas.size;
2052
+ },
2053
+ enumerable: !1,
2054
+ configurable: !0
2055
+ }), e.prototype.addValidationSchema = function(e) {
2056
+ var t = this;
2057
+ new Ti().transform(e).forEach(function(e) {
2058
+ return t.addValidationMetadata(e);
2059
+ });
2060
+ }, e.prototype.addValidationMetadata = function(e) {
2061
+ var t = this.validationMetadatas.get(e.target);
2062
+ t ? t.push(e) : this.validationMetadatas.set(e.target, [e]);
2063
+ }, e.prototype.addConstraintMetadata = function(e) {
2064
+ var t = this.constraintMetadatas.get(e.target);
2065
+ t ? t.push(e) : this.constraintMetadatas.set(e.target, [e]);
2066
+ }, e.prototype.groupByPropertyName = function(e) {
2067
+ var t = {};
2068
+ return e.forEach(function(e) {
2069
+ t[e.propertyName] || (t[e.propertyName] = []), t[e.propertyName].push(e);
2070
+ }), t;
2071
+ }, e.prototype.getTargetValidationMetadatas = function(e, t, n, r, i) {
2072
+ var a, o, s = function(e) {
2073
+ return e.always === void 0 ? e.groups && e.groups.length ? !1 : n : e.always;
2074
+ }, c = function(e) {
2075
+ return !!(r && (!i || !i.length) && e.groups && e.groups.length);
2076
+ }, l = (this.validationMetadatas.get(e) || []).filter(function(n) {
2077
+ return n.target !== e && n.target !== t ? !1 : s(n) ? !0 : c(n) ? !1 : i && i.length > 0 ? n.groups && !!n.groups.find(function(e) {
2078
+ return i.indexOf(e) !== -1;
2079
+ }) : !0;
2080
+ }), u = [];
2081
+ try {
2082
+ for (var d = Ei(this.validationMetadatas.entries()), f = d.next(); !f.done; f = d.next()) {
2083
+ var p = Di(f.value, 2), m = p[0], h = p[1];
2084
+ e.prototype instanceof m && u.push.apply(u, Oi([], Di(h), !1));
2085
+ }
2086
+ } catch (e) {
2087
+ a = { error: e };
2088
+ } finally {
2089
+ try {
2090
+ f && !f.done && (o = d.return) && o.call(d);
2091
+ } finally {
2092
+ if (a) throw a.error;
2093
+ }
2094
+ }
2095
+ var g = u.filter(function(t) {
2096
+ return typeof t.target == "string" || t.target === e || t.target instanceof Function && !(e.prototype instanceof t.target) ? !1 : s(t) ? !0 : c(t) ? !1 : i && i.length > 0 ? t.groups && !!t.groups.find(function(e) {
2097
+ return i.indexOf(e) !== -1;
2098
+ }) : !0;
2099
+ }).filter(function(e) {
2100
+ return !l.find(function(t) {
2101
+ return t.propertyName === e.propertyName && t.type === e.type;
2102
+ });
2103
+ });
2104
+ return l.concat(g);
2105
+ }, e.prototype.getTargetValidatorConstraints = function(e) {
2106
+ return this.constraintMetadatas.get(e) || [];
2107
+ }, e;
2108
+ })(), function() {
2109
+ function e() {}
2110
+ return e.isValid = function(e) {
2111
+ var t = this;
2112
+ return e !== "isValid" && e !== "getMessage" && Object.keys(this).map(function(e) {
2113
+ return t[e];
2114
+ }).indexOf(e) !== -1;
2115
+ }, e.CUSTOM_VALIDATION = "customValidation", e.NESTED_VALIDATION = "nestedValidation", e.PROMISE_VALIDATION = "promiseValidation", e.CONDITIONAL_VALIDATION = "conditionalValidation", e.WHITELIST = "whitelistValidation", e.IS_DEFINED = "isDefined", e;
2116
+ }();
2117
+ //#endregion
2118
+ //#region ../twenty-shared/node_modules/class-validator/esm5/validation/ValidationTypes.js
2119
+ var ki = new (function() {
2120
+ function e() {
2121
+ this.instances = [];
2122
+ }
2123
+ return e.prototype.get = function(e) {
2124
+ var t = this.instances.find(function(t) {
2125
+ return t.type === e;
2126
+ });
2127
+ return t || (t = {
2128
+ type: e,
2129
+ object: new e()
2130
+ }, this.instances.push(t)), t.object;
2131
+ }, e;
2132
+ }())(), Ai, Q;
2133
+ function ji(e) {
2134
+ if (Ai) try {
2135
+ var t = Ai.get(e);
2136
+ if (t || !Q || !Q.fallback) return t;
2137
+ } catch (e) {
2138
+ if (!Q || !Q.fallbackOnErrors) throw e;
2139
+ }
2140
+ return ki.get(e);
2141
+ }
2142
+ (function() {
2143
+ function e(e, t, n) {
2144
+ n === void 0 && (n = !1), this.target = e, this.name = t, this.async = n;
2145
+ }
2146
+ return Object.defineProperty(e.prototype, "instance", {
2147
+ get: function() {
2148
+ return ji(this.target);
2149
+ },
2150
+ enumerable: !1,
2151
+ configurable: !0
2152
+ }), e;
2153
+ })();
2154
+ //#endregion
2155
+ //#region ../twenty-shared/node_modules/class-validator/esm5/metadata/ConstraintMetadata.js
2156
+ var $ = /* @__PURE__ */ function(e) {
4
2157
  return e.ACTOR = "ACTOR", e.ADDRESS = "ADDRESS", e.ARRAY = "ARRAY", e.BOOLEAN = "BOOLEAN", e.CURRENCY = "CURRENCY", e.DATE = "DATE", e.DATE_TIME = "DATE_TIME", e.EMAILS = "EMAILS", e.FILES = "FILES", e.FULL_NAME = "FULL_NAME", e.LINKS = "LINKS", e.MORPH_RELATION = "MORPH_RELATION", e.MULTI_SELECT = "MULTI_SELECT", e.NUMBER = "NUMBER", e.NUMERIC = "NUMERIC", e.PHONES = "PHONES", e.POSITION = "POSITION", e.RATING = "RATING", e.RAW_JSON = "RAW_JSON", e.RELATION = "RELATION", e.RICH_TEXT = "RICH_TEXT", e.SELECT = "SELECT", e.TEXT = "TEXT", e.TS_VECTOR = "TS_VECTOR", e.UUID = "UUID", e;
5
- }({});
6
- e.TEXT, e.ARRAY, e.BOOLEAN, e.DATE, e.DATE_TIME, e.NUMBER, e.NUMERIC, e.RAW_JSON, e.RICH_TEXT, e.SELECT, e.MULTI_SELECT;
2158
+ }({}), Mi = /* @__PURE__ */ function(e) {
2159
+ return e.EMAIL = "EMAIL", e.CALENDAR = "CALENDAR", e.WORKFLOW = "WORKFLOW", e.AGENT = "AGENT", e.API = "API", e.IMPORT = "IMPORT", e.MANUAL = "MANUAL", e.SYSTEM = "SYSTEM", e.WEBHOOK = "WEBHOOK", e.APPLICATION = "APPLICATION", e;
2160
+ }({}), Ni = {
2161
+ type: $.ACTOR,
2162
+ properties: [
2163
+ {
2164
+ name: "source",
2165
+ type: $.SELECT,
2166
+ hidden: !1,
2167
+ isRequired: !0,
2168
+ options: Object.keys(Mi).map((t, n) => ({
2169
+ id: e(),
2170
+ label: `${Mi[t].toLowerCase()}`,
2171
+ value: t,
2172
+ position: n
2173
+ }))
2174
+ },
2175
+ {
2176
+ name: "workspaceMemberId",
2177
+ type: $.UUID,
2178
+ hidden: "input",
2179
+ isRequired: !1
2180
+ },
2181
+ {
2182
+ name: "name",
2183
+ type: $.TEXT,
2184
+ hidden: "input",
2185
+ isRequired: !0
2186
+ },
2187
+ {
2188
+ name: "context",
2189
+ type: $.RAW_JSON,
2190
+ hidden: !1,
2191
+ isRequired: !1
2192
+ }
2193
+ ]
2194
+ }, Pi = {
2195
+ type: $.ADDRESS,
2196
+ properties: [
2197
+ {
2198
+ name: "addressStreet1",
2199
+ type: $.TEXT,
2200
+ hidden: !1,
2201
+ isRequired: !1
2202
+ },
2203
+ {
2204
+ name: "addressStreet2",
2205
+ type: $.TEXT,
2206
+ hidden: !1,
2207
+ isRequired: !1
2208
+ },
2209
+ {
2210
+ name: "addressCity",
2211
+ type: $.TEXT,
2212
+ hidden: !1,
2213
+ isRequired: !1
2214
+ },
2215
+ {
2216
+ name: "addressPostcode",
2217
+ type: $.TEXT,
2218
+ hidden: !1,
2219
+ isRequired: !1
2220
+ },
2221
+ {
2222
+ name: "addressState",
2223
+ type: $.TEXT,
2224
+ hidden: !1,
2225
+ isRequired: !1
2226
+ },
2227
+ {
2228
+ name: "addressCountry",
2229
+ type: $.TEXT,
2230
+ hidden: !1,
2231
+ isRequired: !1
2232
+ },
2233
+ {
2234
+ name: "addressLat",
2235
+ type: $.NUMERIC,
2236
+ hidden: !1,
2237
+ isRequired: !1
2238
+ },
2239
+ {
2240
+ name: "addressLng",
2241
+ type: $.NUMERIC,
2242
+ hidden: !1,
2243
+ isRequired: !1
2244
+ }
2245
+ ]
2246
+ }, Fi = {
2247
+ type: $.CURRENCY,
2248
+ properties: [{
2249
+ name: "amountMicros",
2250
+ type: $.NUMERIC,
2251
+ hidden: !1,
2252
+ isRequired: !1
2253
+ }, {
2254
+ name: "currencyCode",
2255
+ type: $.TEXT,
2256
+ hidden: !1,
2257
+ isRequired: !1
2258
+ }]
2259
+ }, Ii = {
2260
+ type: $.EMAILS,
2261
+ properties: [{
2262
+ name: "primaryEmail",
2263
+ type: $.TEXT,
2264
+ hidden: !1,
2265
+ isRequired: !1,
2266
+ isIncludedInUniqueConstraint: !0
2267
+ }, {
2268
+ name: "additionalEmails",
2269
+ type: $.RAW_JSON,
2270
+ hidden: !1,
2271
+ isRequired: !1
2272
+ }]
2273
+ }, Li = {
2274
+ type: $.FULL_NAME,
2275
+ properties: [{
2276
+ name: "firstName",
2277
+ type: $.TEXT,
2278
+ hidden: !1,
2279
+ isRequired: !1,
2280
+ isIncludedInUniqueConstraint: !1
2281
+ }, {
2282
+ name: "lastName",
2283
+ type: $.TEXT,
2284
+ hidden: !1,
2285
+ isRequired: !1,
2286
+ isIncludedInUniqueConstraint: !1
2287
+ }]
2288
+ }, Ri = {
2289
+ type: $.LINKS,
2290
+ properties: [
2291
+ {
2292
+ name: "primaryLinkLabel",
2293
+ type: $.TEXT,
2294
+ hidden: !1,
2295
+ isRequired: !1
2296
+ },
2297
+ {
2298
+ name: "primaryLinkUrl",
2299
+ type: $.TEXT,
2300
+ hidden: !1,
2301
+ isRequired: !1,
2302
+ isIncludedInUniqueConstraint: !0
2303
+ },
2304
+ {
2305
+ name: "secondaryLinks",
2306
+ type: $.RAW_JSON,
2307
+ hidden: !1,
2308
+ isRequired: !1
2309
+ }
2310
+ ]
2311
+ }, zi = {
2312
+ type: $.PHONES,
2313
+ properties: [
2314
+ {
2315
+ name: "primaryPhoneNumber",
2316
+ type: $.TEXT,
2317
+ hidden: !1,
2318
+ isRequired: !1,
2319
+ isIncludedInUniqueConstraint: !0
2320
+ },
2321
+ {
2322
+ name: "primaryPhoneCountryCode",
2323
+ type: $.TEXT,
2324
+ hidden: !1,
2325
+ isRequired: !1,
2326
+ isIncludedInUniqueConstraint: !0
2327
+ },
2328
+ {
2329
+ name: "primaryPhoneCallingCode",
2330
+ type: $.TEXT,
2331
+ hidden: !1,
2332
+ isRequired: !1,
2333
+ isIncludedInUniqueConstraint: !0
2334
+ },
2335
+ {
2336
+ name: "additionalPhones",
2337
+ type: $.RAW_JSON,
2338
+ hidden: !1,
2339
+ isRequired: !1
2340
+ }
2341
+ ]
2342
+ }, Bi = {
2343
+ type: $.RICH_TEXT,
2344
+ properties: [{
2345
+ name: "blocknote",
2346
+ type: $.TEXT,
2347
+ hidden: !1,
2348
+ isRequired: !1
2349
+ }, {
2350
+ name: "markdown",
2351
+ type: $.TEXT,
2352
+ hidden: !1,
2353
+ isRequired: !1
2354
+ }]
2355
+ };
2356
+ Qr({
2357
+ blocknote: Er().nullable().optional(),
2358
+ markdown: Er().nullable()
2359
+ }), new Map([
2360
+ [$.LINKS, Ri],
2361
+ [$.CURRENCY, Fi],
2362
+ [$.FULL_NAME, Li],
2363
+ [$.ADDRESS, Pi],
2364
+ [$.ACTOR, Ni],
2365
+ [$.EMAILS, Ii],
2366
+ [$.PHONES, zi],
2367
+ [$.RICH_TEXT, Bi]
2368
+ ]), $.RELATION, $.MORPH_RELATION, $.FILES, $.TS_VECTOR, $.TEXT, $.ARRAY, $.BOOLEAN, $.DATE, $.DATE_TIME, $.NUMBER, $.NUMERIC, $.RAW_JSON, $.RICH_TEXT, $.SELECT, $.MULTI_SELECT;
7
2369
  //#endregion
8
2370
  //#region ../twenty-shared/dist/application.mjs
9
- var t = "TWENTY_API_URL", n = "TWENTY_APP_ACCESS_TOKEN", r = 5e3, i = async ({ creditsUsedMicro: e, operationType: i, quantity: a = 1, resourceContext: o }) => {
10
- let s = process.env[t], c = process.env[n];
11
- if (!(!s || !c)) try {
12
- let t = await fetch(`${s.replace(/\/$/, "")}/app/billing/charge`, {
2371
+ var Vi = "TWENTY_API_URL", Hi = "TWENTY_APP_ACCESS_TOKEN", Ui = 5e3, Wi = async ({ creditsUsedMicro: e, operationType: t, quantity: n = 1, resourceContext: r }) => {
2372
+ let i = process.env[Vi], a = process.env[Hi];
2373
+ if (!(!i || !a)) try {
2374
+ let o = await fetch(`${i.replace(/\/$/, "")}/app/billing/charge`, {
13
2375
  method: "POST",
14
2376
  headers: {
15
- Authorization: `Bearer ${c}`,
2377
+ Authorization: `Bearer ${a}`,
16
2378
  "Content-Type": "application/json"
17
2379
  },
18
2380
  body: JSON.stringify({
19
2381
  creditsUsedMicro: e,
20
- quantity: a,
21
- operationType: i,
22
- resourceContext: o
2382
+ quantity: n,
2383
+ operationType: t,
2384
+ resourceContext: r
23
2385
  }),
24
- signal: AbortSignal.timeout(r)
2386
+ signal: AbortSignal.timeout(Ui)
25
2387
  });
26
- if (!t.ok) {
27
- let e = await t.text().catch(() => "");
28
- console.error(`chargeCredits: ${t.status} ${t.statusText}: ${e}`);
2388
+ if (!o.ok) {
2389
+ let e = await o.text().catch(() => "");
2390
+ console.error(`chargeCredits: ${o.status} ${o.statusText}: ${e}`);
29
2391
  }
30
2392
  } catch (e) {
31
2393
  console.error(`chargeCredits: ${e instanceof Error ? e.message : String(e)}`);
32
2394
  }
33
2395
  };
34
2396
  //#endregion
35
- export { i as chargeCredits };
2397
+ export { Wi as chargeCredits };
36
2398
 
37
2399
  //# sourceMappingURL=index.mjs.map