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