@opentabs-dev/opentabs-plugin-linkedin 0.0.84 → 0.0.85

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.
@@ -6,443 +6,6 @@
6
6
  __defProp(target, name, { get: all[name], enumerable: true });
7
7
  };
8
8
 
9
- // node_modules/@opentabs-dev/plugin-sdk/dist/errors.js
10
- var ToolError = class _ToolError extends Error {
11
- code;
12
- /** Whether this error is retryable (defaults to false). */
13
- retryable;
14
- /** Suggested delay before retrying, in milliseconds. */
15
- retryAfterMs;
16
- /** Error category for structured error classification. */
17
- category;
18
- constructor(message, code, opts) {
19
- super(message);
20
- this.code = code;
21
- this.name = "ToolError";
22
- this.retryable = opts?.retryable ?? false;
23
- this.retryAfterMs = opts?.retryAfterMs;
24
- this.category = opts?.category;
25
- }
26
- /** Authentication or authorization error (not retryable). Accepts an optional domain-specific code. */
27
- static auth(message, code) {
28
- return new _ToolError(message, code ?? "AUTH_ERROR", { category: "auth", retryable: false });
29
- }
30
- /** Resource not found (not retryable). Accepts an optional domain-specific code. */
31
- static notFound(message, code) {
32
- return new _ToolError(message, code ?? "NOT_FOUND", { category: "not_found", retryable: false });
33
- }
34
- /** Rate limited (retryable). Accepts an optional retry delay in milliseconds and an optional domain-specific code. */
35
- static rateLimited(message, retryAfterMs, code) {
36
- return new _ToolError(message, code ?? "RATE_LIMITED", { category: "rate_limit", retryable: true, retryAfterMs });
37
- }
38
- /** Input validation error (not retryable). Accepts an optional domain-specific code. */
39
- static validation(message, code) {
40
- return new _ToolError(message, code ?? "VALIDATION_ERROR", { category: "validation", retryable: false });
41
- }
42
- /** Operation timed out (retryable). Accepts an optional domain-specific code. */
43
- static timeout(message, code) {
44
- return new _ToolError(message, code ?? "TIMEOUT", { category: "timeout", retryable: true });
45
- }
46
- /** Internal/unexpected error (not retryable). Accepts an optional domain-specific code. */
47
- static internal(message, code) {
48
- return new _ToolError(message, code ?? "INTERNAL_ERROR", { category: "internal", retryable: false });
49
- }
50
- };
51
-
52
- // node_modules/@opentabs-dev/plugin-sdk/dist/fetch.js
53
- var parseRetryAfterMs = (value) => {
54
- const seconds = Number(value);
55
- if (!Number.isNaN(seconds) && seconds >= 0) {
56
- return seconds * 1e3;
57
- }
58
- const date5 = Date.parse(value);
59
- if (!Number.isNaN(date5)) {
60
- const ms = date5 - Date.now();
61
- return ms > 0 ? ms : void 0;
62
- }
63
- return void 0;
64
- };
65
-
66
- // node_modules/@opentabs-dev/plugin-sdk/dist/timing.js
67
- var waitUntil = (predicate, opts) => {
68
- const interval = opts?.interval ?? 200;
69
- const timeout = opts?.timeout ?? 1e4;
70
- const signal = opts?.signal;
71
- const abortReason = () => signal?.reason instanceof Error ? signal.reason : new Error("waitUntil: aborted");
72
- if (signal?.aborted)
73
- return Promise.reject(abortReason());
74
- return new Promise((resolve, reject) => {
75
- let settled = false;
76
- let poller;
77
- const isSettled = () => settled;
78
- const cleanup = () => {
79
- settled = true;
80
- clearTimeout(timer);
81
- clearTimeout(poller);
82
- signal?.removeEventListener("abort", onAbort);
83
- };
84
- const onAbort = () => {
85
- if (isSettled())
86
- return;
87
- cleanup();
88
- reject(abortReason());
89
- };
90
- signal?.addEventListener("abort", onAbort, { once: true });
91
- const timer = setTimeout(() => {
92
- if (isSettled())
93
- return;
94
- cleanup();
95
- reject(new Error(`waitUntil: timed out after ${timeout}ms waiting for predicate to return true`));
96
- }, timeout);
97
- const check2 = async () => {
98
- if (isSettled())
99
- return;
100
- try {
101
- const result = await predicate();
102
- if (result) {
103
- cleanup();
104
- resolve();
105
- return;
106
- }
107
- } catch {
108
- }
109
- if (!isSettled()) {
110
- poller = setTimeout(() => void check2(), interval);
111
- }
112
- };
113
- void check2();
114
- });
115
- };
116
-
117
- // node_modules/@opentabs-dev/plugin-sdk/dist/log.js
118
- var MAX_DATA_LENGTH = 10;
119
- var MAX_STRING_LENGTH = 4096;
120
- var MAX_SERIALIZED_SIZE = 64 * 1024;
121
- var safeSerializeArg = (value) => {
122
- try {
123
- if (value === null || value === void 0)
124
- return value;
125
- const type = typeof value;
126
- if (type === "boolean" || type === "number")
127
- return value;
128
- if (type === "string") {
129
- return value.length > MAX_STRING_LENGTH ? `${value.slice(0, MAX_STRING_LENGTH)}\u2026` : value;
130
- }
131
- if (type === "function")
132
- return `[Function: ${value.name || "anonymous"}]`;
133
- if (type === "symbol")
134
- return `[Symbol: ${value.description ?? ""}]`;
135
- if (type === "bigint")
136
- return `[BigInt: ${value.toString()}]`;
137
- if (typeof value.nodeType === "number" && typeof value.nodeName === "string") {
138
- try {
139
- const node = value;
140
- let classStr = "";
141
- if (typeof node.className === "string") {
142
- classStr = node.className ? `.${node.className.split(" ")[0] ?? ""}` : "";
143
- } else if (node.className !== null && typeof node.className === "object") {
144
- const baseVal = node.className.baseVal;
145
- if (typeof baseVal === "string") {
146
- classStr = baseVal ? `.${baseVal.split(" ")[0] ?? ""}` : "";
147
- }
148
- }
149
- return `[${node.nodeName}${node.id ? `#${node.id}` : ""}${classStr}]`;
150
- } catch {
151
- }
152
- }
153
- if (value instanceof Error) {
154
- return { name: value.name, message: value.message, stack: value.stack };
155
- }
156
- if (value instanceof WeakRef)
157
- return "[WeakRef]";
158
- if (value instanceof WeakMap)
159
- return "[WeakMap]";
160
- if (value instanceof WeakSet)
161
- return "[WeakSet]";
162
- if (value instanceof ArrayBuffer)
163
- return "[ArrayBuffer]";
164
- if (typeof SharedArrayBuffer !== "undefined" && value instanceof SharedArrayBuffer)
165
- return "[SharedArrayBuffer]";
166
- try {
167
- const seen = /* @__PURE__ */ new WeakSet();
168
- const json2 = JSON.stringify(value, (_key, v) => {
169
- if (typeof v === "object" && v !== null) {
170
- if (seen.has(v))
171
- return "[Circular]";
172
- seen.add(v);
173
- }
174
- if (typeof v === "function")
175
- return `[Function: ${v.name || "anonymous"}]`;
176
- if (typeof v === "bigint")
177
- return `[BigInt: ${v.toString()}]`;
178
- if (typeof v === "symbol")
179
- return `[Symbol: ${v.description ?? ""}]`;
180
- if (v instanceof WeakRef)
181
- return "[WeakRef]";
182
- if (v instanceof WeakMap)
183
- return "[WeakMap]";
184
- if (v instanceof WeakSet)
185
- return "[WeakSet]";
186
- if (v instanceof ArrayBuffer)
187
- return "[ArrayBuffer]";
188
- if (typeof SharedArrayBuffer !== "undefined" && v instanceof SharedArrayBuffer)
189
- return "[SharedArrayBuffer]";
190
- return v;
191
- });
192
- if (json2.length > MAX_SERIALIZED_SIZE) {
193
- return `[Object truncated: ${json2.length} chars]`;
194
- }
195
- return JSON.parse(json2);
196
- } catch {
197
- return `[Unserializable: ${typeof value}]`;
198
- }
199
- } catch {
200
- return `[Unserializable: ${typeof value}]`;
201
- }
202
- };
203
- var safeSerialize = (args) => {
204
- const capped = args.length > MAX_DATA_LENGTH ? args.slice(0, MAX_DATA_LENGTH) : args;
205
- return capped.map(safeSerializeArg);
206
- };
207
- var CONSOLE_METHODS = {
208
- debug: "debug",
209
- info: "info",
210
- warning: "warn",
211
- error: "error"
212
- };
213
- var defaultTransport = (entry) => {
214
- const method = CONSOLE_METHODS[entry.level];
215
- console[method](`[sdk.log] ${entry.message}`, ...entry.data);
216
- };
217
- var activeTransport = defaultTransport;
218
- var _setLogTransport = (transport) => {
219
- const previous = activeTransport;
220
- activeTransport = transport;
221
- return () => {
222
- if (activeTransport === transport)
223
- activeTransport = previous;
224
- };
225
- };
226
- var makeLogMethod = (level) => (message, ...args) => {
227
- const entry = {
228
- level,
229
- message,
230
- data: safeSerialize(args),
231
- ts: (/* @__PURE__ */ new Date()).toISOString()
232
- };
233
- activeTransport(entry);
234
- };
235
- var log = Object.freeze({
236
- debug: makeLogMethod("debug"),
237
- info: makeLogMethod("info"),
238
- warn: makeLogMethod("warning"),
239
- error: makeLogMethod("error")
240
- });
241
- var ot = globalThis.__openTabs ?? {};
242
- globalThis.__openTabs = ot;
243
- ot._setLogTransport = _setLogTransport;
244
- ot.log = log;
245
-
246
- // node_modules/@opentabs-dev/plugin-sdk/dist/storage.js
247
- var getCookie = (name) => {
248
- try {
249
- const prefix = `${name}=`;
250
- const entries = document.cookie.split("; ");
251
- for (const entry of entries) {
252
- if (entry.startsWith(prefix)) {
253
- try {
254
- return decodeURIComponent(entry.slice(prefix.length));
255
- } catch {
256
- return entry.slice(prefix.length);
257
- }
258
- }
259
- }
260
- return null;
261
- } catch {
262
- return null;
263
- }
264
- };
265
-
266
- // node_modules/@opentabs-dev/plugin-sdk/dist/index.js
267
- var defineTool = (config2) => config2;
268
- var OpenTabsPlugin = class {
269
- /**
270
- * Chrome match patterns for URLs that should NOT match this plugin.
271
- * Tabs matching both urlPatterns and excludePatterns are excluded.
272
- * Useful when a broad urlPattern overlaps with another plugin's domain.
273
- * @see https://developer.chrome.com/docs/extensions/develop/concepts/match-patterns
274
- */
275
- excludePatterns;
276
- /**
277
- * URL to open when no matching tab exists and the user triggers an
278
- * 'open tab' action from the side panel. Should be a concrete URL
279
- * (e.g., 'https://github.com'), not a match pattern.
280
- */
281
- homepage;
282
- /** Typed configuration schema — declares settings that users provide via config.json or the side panel. */
283
- configSchema;
284
- };
285
-
286
- // src/linkedin-api.ts
287
- var VOYAGER_BASE = "/voyager/api";
288
- var MESSAGING_GRAPHQL_BASE = "/voyager/api/voyagerMessagingGraphQL/graphql";
289
- var getCsrfToken = () => {
290
- const value = getCookie("JSESSIONID");
291
- if (!value) return null;
292
- return value.replace(/"/g, "");
293
- };
294
- var isAuthenticated = () => getCsrfToken() !== null;
295
- var waitForAuth = () => waitUntil(() => isAuthenticated(), { interval: 500, timeout: 5e3 }).then(
296
- () => true,
297
- () => false
298
- );
299
- var getHeaders = () => {
300
- const csrf = getCsrfToken();
301
- if (!csrf) throw ToolError.auth("Not authenticated \u2014 please log in to LinkedIn.");
302
- return {
303
- "csrf-token": csrf,
304
- "x-restli-protocol-version": "2.0.0",
305
- "x-li-lang": "en_US",
306
- "x-li-track": JSON.stringify({
307
- clientVersion: "1.13.42665",
308
- mpVersion: "1.13.42665",
309
- osName: "web",
310
- timezoneOffset: (/* @__PURE__ */ new Date()).getTimezoneOffset() / -60,
311
- timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
312
- deviceFormFactor: "DESKTOP",
313
- mpName: "voyager-web",
314
- displayDensity: window.devicePixelRatio,
315
- displayWidth: window.screen.width,
316
- displayHeight: window.screen.height
317
- })
318
- };
319
- };
320
- var classifyError = (status, body, endpoint, headers) => {
321
- if (status === 429) {
322
- const retryAfter = headers.get("Retry-After");
323
- throw ToolError.rateLimited(`Rate limited: ${endpoint}`, retryAfter ? parseRetryAfterMs(retryAfter) : void 0);
324
- }
325
- if (status === 401 || status === 403) throw ToolError.auth(`Auth error (${status}): ${body}`);
326
- if (status === 404) throw ToolError.notFound(`Not found: ${endpoint}`);
327
- if (status === 422) throw ToolError.validation(`Validation error: ${body}`);
328
- throw ToolError.internal(`API error (${status}): ${endpoint} \u2014 ${body}`);
329
- };
330
- var api = async (endpoint, options = {}) => {
331
- const headers = getHeaders();
332
- let url2 = `${VOYAGER_BASE}${endpoint}`;
333
- if (options.query) {
334
- const params = new URLSearchParams();
335
- for (const [k, v] of Object.entries(options.query)) if (v !== void 0) params.append(k, String(v));
336
- const qs = params.toString();
337
- if (qs) url2 += `?${qs}`;
338
- }
339
- let fetchBody;
340
- if (options.body) {
341
- headers["Content-Type"] = "application/json";
342
- fetchBody = JSON.stringify(options.body);
343
- }
344
- const method = options.method ?? "GET";
345
- let response;
346
- try {
347
- response = await fetch(url2, {
348
- method,
349
- headers,
350
- body: fetchBody,
351
- credentials: "include",
352
- signal: AbortSignal.timeout(3e4)
353
- });
354
- } catch (err2) {
355
- if (err2 instanceof DOMException && err2.name === "TimeoutError") throw ToolError.timeout(`Timed out: ${endpoint}`);
356
- throw new ToolError(`Network error: ${err2 instanceof Error ? err2.message : String(err2)}`, "network_error", {
357
- category: "internal",
358
- retryable: true
359
- });
360
- }
361
- if (!response.ok) {
362
- const body = (await response.text().catch(() => "")).substring(0, 512);
363
- classifyError(response.status, body, endpoint, response.headers);
364
- }
365
- if (response.status === 204) return {};
366
- return await response.json();
367
- };
368
- var encodeUrn = (urn) => encodeURIComponent(urn).replace(/\(/g, "%28").replace(/\)/g, "%29");
369
- var getMyProfileUrn = async () => {
370
- const me = await api("/me");
371
- const profileUrn = me.miniProfile?.dashEntityUrn;
372
- if (!profileUrn) throw ToolError.auth("Could not determine current user profile URN.");
373
- return profileUrn;
374
- };
375
- var messagingGraphql = async (queryId, variables) => {
376
- const csrf = getCsrfToken();
377
- if (!csrf) throw ToolError.auth("Not authenticated \u2014 please log in to LinkedIn.");
378
- const headers = {
379
- "csrf-token": csrf,
380
- "x-restli-protocol-version": "2.0.0",
381
- accept: "application/graphql"
382
- };
383
- const url2 = `${MESSAGING_GRAPHQL_BASE}?queryId=${queryId}&variables=${variables}`;
384
- let response;
385
- try {
386
- response = await fetch(url2, {
387
- method: "GET",
388
- headers,
389
- credentials: "include",
390
- signal: AbortSignal.timeout(3e4)
391
- });
392
- } catch (err2) {
393
- if (err2 instanceof DOMException && err2.name === "TimeoutError")
394
- throw ToolError.timeout(`Timed out: messaging graphql ${queryId}`);
395
- throw new ToolError(`Network error: ${err2 instanceof Error ? err2.message : String(err2)}`, "network_error", {
396
- category: "internal",
397
- retryable: true
398
- });
399
- }
400
- if (!response.ok) {
401
- const body = (await response.text().catch(() => "")).substring(0, 512);
402
- if (response.status === 500 && body.includes('"status":500')) {
403
- throw ToolError.internal(
404
- "Persisted query hash expired \u2014 LinkedIn may have deployed a new client version. Try reloading the LinkedIn tab."
405
- );
406
- }
407
- classifyError(response.status, body, `messaging:${queryId}`, response.headers);
408
- }
409
- return await response.json();
410
- };
411
- var messagingAction = async (endpoint, body) => {
412
- const csrf = getCsrfToken();
413
- if (!csrf) throw ToolError.auth("Not authenticated \u2014 please log in to LinkedIn.");
414
- const headers = {
415
- "csrf-token": csrf,
416
- "x-restli-protocol-version": "2.0.0",
417
- "Content-Type": "application/json"
418
- };
419
- const url2 = `${VOYAGER_BASE}${endpoint}`;
420
- let response;
421
- try {
422
- response = await fetch(url2, {
423
- method: "POST",
424
- headers,
425
- body: JSON.stringify(body),
426
- credentials: "include",
427
- signal: AbortSignal.timeout(3e4)
428
- });
429
- } catch (err2) {
430
- if (err2 instanceof DOMException && err2.name === "TimeoutError") throw ToolError.timeout(`Timed out: ${endpoint}`);
431
- throw new ToolError(`Network error: ${err2 instanceof Error ? err2.message : String(err2)}`, "network_error", {
432
- category: "internal",
433
- retryable: true
434
- });
435
- }
436
- if (!response.ok) {
437
- const text2 = (await response.text().catch(() => "")).substring(0, 512);
438
- classifyError(response.status, text2, endpoint, response.headers);
439
- }
440
- if (response.status === 204) return {};
441
- const text = await response.text();
442
- if (!text) return {};
443
- return JSON.parse(text);
444
- };
445
-
446
9
  // node_modules/zod/v4/classic/external.js
447
10
  var external_exports = {};
448
11
  __export(external_exports, {
@@ -505,6 +68,7 @@
505
68
  ZodOptional: () => ZodOptional,
506
69
  ZodPipe: () => ZodPipe,
507
70
  ZodPrefault: () => ZodPrefault,
71
+ ZodPreprocess: () => ZodPreprocess,
508
72
  ZodPromise: () => ZodPromise,
509
73
  ZodReadonly: () => ZodReadonly,
510
74
  ZodRealError: () => ZodRealError,
@@ -583,6 +147,7 @@
583
147
  int32: () => int32,
584
148
  int64: () => int64,
585
149
  intersection: () => intersection,
150
+ invertCodec: () => invertCodec,
586
151
  ipv4: () => ipv42,
587
152
  ipv6: () => ipv62,
588
153
  iso: () => iso_exports,
@@ -764,6 +329,7 @@
764
329
  $ZodOptional: () => $ZodOptional,
765
330
  $ZodPipe: () => $ZodPipe,
766
331
  $ZodPrefault: () => $ZodPrefault,
332
+ $ZodPreprocess: () => $ZodPreprocess,
767
333
  $ZodPromise: () => $ZodPromise,
768
334
  $ZodReadonly: () => $ZodReadonly,
769
335
  $ZodRealError: () => $ZodRealError,
@@ -963,7 +529,8 @@
963
529
  });
964
530
 
965
531
  // node_modules/zod/v4/core/core.js
966
- var NEVER = Object.freeze({
532
+ var _a;
533
+ var NEVER = /* @__PURE__ */ Object.freeze({
967
534
  status: "aborted"
968
535
  });
969
536
  // @__NO_SIDE_EFFECTS__
@@ -998,10 +565,10 @@
998
565
  }
999
566
  Object.defineProperty(Definition, "name", { value: name });
1000
567
  function _(def) {
1001
- var _a2;
568
+ var _a3;
1002
569
  const inst = params?.Parent ? new Definition() : this;
1003
570
  init(inst, def);
1004
- (_a2 = inst._zod).deferred ?? (_a2.deferred = []);
571
+ (_a3 = inst._zod).deferred ?? (_a3.deferred = []);
1005
572
  for (const fn of inst._zod.deferred) {
1006
573
  fn();
1007
574
  }
@@ -1030,7 +597,8 @@
1030
597
  this.name = "ZodEncodeError";
1031
598
  }
1032
599
  };
1033
- var globalConfig = {};
600
+ (_a = globalThis).__zod_globalConfig ?? (_a.__zod_globalConfig = {});
601
+ var globalConfig = globalThis.__zod_globalConfig;
1034
602
  function config(newConfig) {
1035
603
  if (newConfig)
1036
604
  Object.assign(globalConfig, newConfig);
@@ -1063,6 +631,7 @@
1063
631
  defineLazy: () => defineLazy,
1064
632
  esc: () => esc,
1065
633
  escapeRegex: () => escapeRegex,
634
+ explicitlyAborted: () => explicitlyAborted,
1066
635
  extend: () => extend,
1067
636
  finalizeIssue: () => finalizeIssue,
1068
637
  floatSafeRemainder: () => floatSafeRemainder,
@@ -1151,19 +720,12 @@
1151
720
  return source.slice(start, end);
1152
721
  }
1153
722
  function floatSafeRemainder(val, step) {
1154
- const valDecCount = (val.toString().split(".")[1] || "").length;
1155
- const stepString = step.toString();
1156
- let stepDecCount = (stepString.split(".")[1] || "").length;
1157
- if (stepDecCount === 0 && /\d?e-\d?/.test(stepString)) {
1158
- const match = stepString.match(/\d?e-(\d?)/);
1159
- if (match?.[1]) {
1160
- stepDecCount = Number.parseInt(match[1]);
1161
- }
1162
- }
1163
- const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
1164
- const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
1165
- const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
1166
- return valInt % stepInt / 10 ** decCount;
723
+ const ratio = val / step;
724
+ const roundedRatio = Math.round(ratio);
725
+ const tolerance = Number.EPSILON * Math.max(Math.abs(ratio), 1);
726
+ if (Math.abs(ratio - roundedRatio) < tolerance)
727
+ return 0;
728
+ return ratio - roundedRatio;
1167
729
  }
1168
730
  var EVALUATING = /* @__PURE__ */ Symbol("evaluating");
1169
731
  function defineLazy(object2, key, getter) {
@@ -1245,7 +807,10 @@
1245
807
  function isObject(data) {
1246
808
  return typeof data === "object" && data !== null && !Array.isArray(data);
1247
809
  }
1248
- var allowsEval = cached(() => {
810
+ var allowsEval = /* @__PURE__ */ cached(() => {
811
+ if (globalConfig.jitless) {
812
+ return false;
813
+ }
1249
814
  if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) {
1250
815
  return false;
1251
816
  }
@@ -1278,6 +843,10 @@
1278
843
  return { ...o };
1279
844
  if (Array.isArray(o))
1280
845
  return [...o];
846
+ if (o instanceof Map)
847
+ return new Map(o);
848
+ if (o instanceof Set)
849
+ return new Set(o);
1281
850
  return o;
1282
851
  }
1283
852
  function numKeys(data) {
@@ -1334,7 +903,14 @@
1334
903
  }
1335
904
  };
1336
905
  var propertyKeyTypes = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
1337
- var primitiveTypes = /* @__PURE__ */ new Set(["string", "number", "bigint", "boolean", "symbol", "undefined"]);
906
+ var primitiveTypes = /* @__PURE__ */ new Set([
907
+ "string",
908
+ "number",
909
+ "bigint",
910
+ "boolean",
911
+ "symbol",
912
+ "undefined"
913
+ ]);
1338
914
  function escapeRegex(str) {
1339
915
  return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1340
916
  }
@@ -1503,6 +1079,9 @@
1503
1079
  return clone(schema, def);
1504
1080
  }
1505
1081
  function merge(a, b) {
1082
+ if (a._zod.def.checks?.length) {
1083
+ throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
1084
+ }
1506
1085
  const def = mergeDefs(a._zod.def, {
1507
1086
  get shape() {
1508
1087
  const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
@@ -1512,8 +1091,7 @@
1512
1091
  get catchall() {
1513
1092
  return b._zod.def.catchall;
1514
1093
  },
1515
- checks: []
1516
- // delete existing checks
1094
+ checks: b._zod.def.checks ?? []
1517
1095
  });
1518
1096
  return clone(a, def);
1519
1097
  }
@@ -1596,10 +1174,20 @@
1596
1174
  }
1597
1175
  return false;
1598
1176
  }
1177
+ function explicitlyAborted(x, startIndex = 0) {
1178
+ if (x.aborted === true)
1179
+ return true;
1180
+ for (let i = startIndex; i < x.issues.length; i++) {
1181
+ if (x.issues[i]?.continue === false) {
1182
+ return true;
1183
+ }
1184
+ }
1185
+ return false;
1186
+ }
1599
1187
  function prefixIssues(path, issues) {
1600
1188
  return issues.map((iss) => {
1601
- var _a2;
1602
- (_a2 = iss).path ?? (_a2.path = []);
1189
+ var _a3;
1190
+ (_a3 = iss).path ?? (_a3.path = []);
1603
1191
  iss.path.unshift(path);
1604
1192
  return iss;
1605
1193
  });
@@ -1608,17 +1196,14 @@
1608
1196
  return typeof message === "string" ? message : message?.message;
1609
1197
  }
1610
1198
  function finalizeIssue(iss, ctx, config2) {
1611
- const full = { ...iss, path: iss.path ?? [] };
1612
- if (!iss.message) {
1613
- const message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config2.customError?.(iss)) ?? unwrapMessage(config2.localeError?.(iss)) ?? "Invalid input";
1614
- full.message = message;
1199
+ const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config2.customError?.(iss)) ?? unwrapMessage(config2.localeError?.(iss)) ?? "Invalid input";
1200
+ const { inst: _inst, continue: _continue, input: _input, ...rest } = iss;
1201
+ rest.path ?? (rest.path = []);
1202
+ rest.message = message;
1203
+ if (ctx?.reportInput) {
1204
+ rest.input = _input;
1615
1205
  }
1616
- delete full.inst;
1617
- delete full.continue;
1618
- if (!ctx?.reportInput) {
1619
- delete full.input;
1620
- }
1621
- return full;
1206
+ return rest;
1622
1207
  }
1623
1208
  function getSizableOrigin(input) {
1624
1209
  if (input instanceof Set)
@@ -1735,10 +1320,10 @@
1735
1320
  };
1736
1321
  var $ZodError = $constructor("$ZodError", initializer);
1737
1322
  var $ZodRealError = $constructor("$ZodError", initializer, { Parent: Error });
1738
- function flattenError(error48, mapper = (issue2) => issue2.message) {
1323
+ function flattenError(error51, mapper = (issue2) => issue2.message) {
1739
1324
  const fieldErrors = {};
1740
1325
  const formErrors = [];
1741
- for (const sub of error48.issues) {
1326
+ for (const sub of error51.issues) {
1742
1327
  if (sub.path.length > 0) {
1743
1328
  fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
1744
1329
  fieldErrors[sub.path[0]].push(mapper(sub));
@@ -1748,50 +1333,53 @@
1748
1333
  }
1749
1334
  return { formErrors, fieldErrors };
1750
1335
  }
1751
- function formatError(error48, mapper = (issue2) => issue2.message) {
1336
+ function formatError(error51, mapper = (issue2) => issue2.message) {
1752
1337
  const fieldErrors = { _errors: [] };
1753
- const processError = (error49) => {
1754
- for (const issue2 of error49.issues) {
1338
+ const processError = (error52, path = []) => {
1339
+ for (const issue2 of error52.issues) {
1755
1340
  if (issue2.code === "invalid_union" && issue2.errors.length) {
1756
- issue2.errors.map((issues) => processError({ issues }));
1341
+ issue2.errors.map((issues) => processError({ issues }, [...path, ...issue2.path]));
1757
1342
  } else if (issue2.code === "invalid_key") {
1758
- processError({ issues: issue2.issues });
1343
+ processError({ issues: issue2.issues }, [...path, ...issue2.path]);
1759
1344
  } else if (issue2.code === "invalid_element") {
1760
- processError({ issues: issue2.issues });
1761
- } else if (issue2.path.length === 0) {
1762
- fieldErrors._errors.push(mapper(issue2));
1345
+ processError({ issues: issue2.issues }, [...path, ...issue2.path]);
1763
1346
  } else {
1764
- let curr = fieldErrors;
1765
- let i = 0;
1766
- while (i < issue2.path.length) {
1767
- const el = issue2.path[i];
1768
- const terminal = i === issue2.path.length - 1;
1769
- if (!terminal) {
1770
- curr[el] = curr[el] || { _errors: [] };
1771
- } else {
1772
- curr[el] = curr[el] || { _errors: [] };
1773
- curr[el]._errors.push(mapper(issue2));
1347
+ const fullpath = [...path, ...issue2.path];
1348
+ if (fullpath.length === 0) {
1349
+ fieldErrors._errors.push(mapper(issue2));
1350
+ } else {
1351
+ let curr = fieldErrors;
1352
+ let i = 0;
1353
+ while (i < fullpath.length) {
1354
+ const el = fullpath[i];
1355
+ const terminal = i === fullpath.length - 1;
1356
+ if (!terminal) {
1357
+ curr[el] = curr[el] || { _errors: [] };
1358
+ } else {
1359
+ curr[el] = curr[el] || { _errors: [] };
1360
+ curr[el]._errors.push(mapper(issue2));
1361
+ }
1362
+ curr = curr[el];
1363
+ i++;
1774
1364
  }
1775
- curr = curr[el];
1776
- i++;
1777
1365
  }
1778
1366
  }
1779
1367
  }
1780
1368
  };
1781
- processError(error48);
1369
+ processError(error51);
1782
1370
  return fieldErrors;
1783
1371
  }
1784
- function treeifyError(error48, mapper = (issue2) => issue2.message) {
1372
+ function treeifyError(error51, mapper = (issue2) => issue2.message) {
1785
1373
  const result = { errors: [] };
1786
- const processError = (error49, path = []) => {
1787
- var _a2, _b;
1788
- for (const issue2 of error49.issues) {
1374
+ const processError = (error52, path = []) => {
1375
+ var _a3, _b;
1376
+ for (const issue2 of error52.issues) {
1789
1377
  if (issue2.code === "invalid_union" && issue2.errors.length) {
1790
- issue2.errors.map((issues) => processError({ issues }, issue2.path));
1378
+ issue2.errors.map((issues) => processError({ issues }, [...path, ...issue2.path]));
1791
1379
  } else if (issue2.code === "invalid_key") {
1792
- processError({ issues: issue2.issues }, issue2.path);
1380
+ processError({ issues: issue2.issues }, [...path, ...issue2.path]);
1793
1381
  } else if (issue2.code === "invalid_element") {
1794
- processError({ issues: issue2.issues }, issue2.path);
1382
+ processError({ issues: issue2.issues }, [...path, ...issue2.path]);
1795
1383
  } else {
1796
1384
  const fullpath = [...path, ...issue2.path];
1797
1385
  if (fullpath.length === 0) {
@@ -1805,7 +1393,7 @@
1805
1393
  const terminal = i === fullpath.length - 1;
1806
1394
  if (typeof el === "string") {
1807
1395
  curr.properties ?? (curr.properties = {});
1808
- (_a2 = curr.properties)[el] ?? (_a2[el] = { errors: [] });
1396
+ (_a3 = curr.properties)[el] ?? (_a3[el] = { errors: [] });
1809
1397
  curr = curr.properties[el];
1810
1398
  } else {
1811
1399
  curr.items ?? (curr.items = []);
@@ -1820,7 +1408,7 @@
1820
1408
  }
1821
1409
  }
1822
1410
  };
1823
- processError(error48);
1411
+ processError(error51);
1824
1412
  return result;
1825
1413
  }
1826
1414
  function toDotPath(_path) {
@@ -1841,9 +1429,9 @@
1841
1429
  }
1842
1430
  return segs.join("");
1843
1431
  }
1844
- function prettifyError(error48) {
1432
+ function prettifyError(error51) {
1845
1433
  const lines = [];
1846
- const issues = [...error48.issues].sort((a, b) => (a.path ?? []).length - (b.path ?? []).length);
1434
+ const issues = [...error51.issues].sort((a, b) => (a.path ?? []).length - (b.path ?? []).length);
1847
1435
  for (const issue2 of issues) {
1848
1436
  lines.push(`\u2716 ${issue2.message}`);
1849
1437
  if (issue2.path?.length)
@@ -1854,7 +1442,7 @@
1854
1442
 
1855
1443
  // node_modules/zod/v4/core/parse.js
1856
1444
  var _parse = (_Err) => (schema, value, _ctx, _params) => {
1857
- const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
1445
+ const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
1858
1446
  const result = schema._zod.run({ value, issues: [] }, ctx);
1859
1447
  if (result instanceof Promise) {
1860
1448
  throw new $ZodAsyncError();
@@ -1868,7 +1456,7 @@
1868
1456
  };
1869
1457
  var parse = /* @__PURE__ */ _parse($ZodRealError);
1870
1458
  var _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
1871
- const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
1459
+ const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
1872
1460
  let result = schema._zod.run({ value, issues: [] }, ctx);
1873
1461
  if (result instanceof Promise)
1874
1462
  result = await result;
@@ -1893,7 +1481,7 @@
1893
1481
  };
1894
1482
  var safeParse = /* @__PURE__ */ _safeParse($ZodRealError);
1895
1483
  var _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
1896
- const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
1484
+ const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
1897
1485
  let result = schema._zod.run({ value, issues: [] }, ctx);
1898
1486
  if (result instanceof Promise)
1899
1487
  result = await result;
@@ -1904,7 +1492,7 @@
1904
1492
  };
1905
1493
  var safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
1906
1494
  var _encode = (_Err) => (schema, value, _ctx) => {
1907
- const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
1495
+ const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
1908
1496
  return _parse(_Err)(schema, value, ctx);
1909
1497
  };
1910
1498
  var encode = /* @__PURE__ */ _encode($ZodRealError);
@@ -1913,7 +1501,7 @@
1913
1501
  };
1914
1502
  var decode = /* @__PURE__ */ _decode($ZodRealError);
1915
1503
  var _encodeAsync = (_Err) => async (schema, value, _ctx) => {
1916
- const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
1504
+ const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
1917
1505
  return _parseAsync(_Err)(schema, value, ctx);
1918
1506
  };
1919
1507
  var encodeAsync = /* @__PURE__ */ _encodeAsync($ZodRealError);
@@ -1922,7 +1510,7 @@
1922
1510
  };
1923
1511
  var decodeAsync = /* @__PURE__ */ _decodeAsync($ZodRealError);
1924
1512
  var _safeEncode = (_Err) => (schema, value, _ctx) => {
1925
- const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
1513
+ const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
1926
1514
  return _safeParse(_Err)(schema, value, ctx);
1927
1515
  };
1928
1516
  var safeEncode = /* @__PURE__ */ _safeEncode($ZodRealError);
@@ -1931,7 +1519,7 @@
1931
1519
  };
1932
1520
  var safeDecode = /* @__PURE__ */ _safeDecode($ZodRealError);
1933
1521
  var _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
1934
- const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
1522
+ const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
1935
1523
  return _safeParseAsync(_Err)(schema, value, ctx);
1936
1524
  };
1937
1525
  var safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync($ZodRealError);
@@ -1964,6 +1552,7 @@
1964
1552
  hex: () => hex,
1965
1553
  hostname: () => hostname,
1966
1554
  html5Email: () => html5Email,
1555
+ httpProtocol: () => httpProtocol,
1967
1556
  idnEmail: () => idnEmail,
1968
1557
  integer: () => integer,
1969
1558
  ipv4: () => ipv4,
@@ -2002,7 +1591,7 @@
2002
1591
  uuid7: () => uuid7,
2003
1592
  xid: () => xid
2004
1593
  });
2005
- var cuid = /^[cC][^\s-]{8,}$/;
1594
+ var cuid = /^[cC][0-9a-z]{6,}$/;
2006
1595
  var cuid2 = /^[0-9a-z]+$/;
2007
1596
  var ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
2008
1597
  var xid = /^[0-9a-vA-V]{20}$/;
@@ -2041,6 +1630,7 @@
2041
1630
  var base64url = /^[A-Za-z0-9_-]*$/;
2042
1631
  var hostname = /^(?=.{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])?)*\.?$/;
2043
1632
  var domain = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/;
1633
+ var httpProtocol = /^https?$/;
2044
1634
  var e164 = /^\+[1-9]\d{6,14}$/;
2045
1635
  var dateSource = `(?:(?:\\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])))`;
2046
1636
  var date = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
@@ -2099,10 +1689,10 @@
2099
1689
 
2100
1690
  // node_modules/zod/v4/core/checks.js
2101
1691
  var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
2102
- var _a2;
1692
+ var _a3;
2103
1693
  inst._zod ?? (inst._zod = {});
2104
1694
  inst._zod.def = def;
2105
- (_a2 = inst._zod).onattach ?? (_a2.onattach = []);
1695
+ (_a3 = inst._zod).onattach ?? (_a3.onattach = []);
2106
1696
  });
2107
1697
  var numericOriginMap = {
2108
1698
  number: "number",
@@ -2168,8 +1758,8 @@
2168
1758
  var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
2169
1759
  $ZodCheck.init(inst, def);
2170
1760
  inst._zod.onattach.push((inst2) => {
2171
- var _a2;
2172
- (_a2 = inst2._zod.bag).multipleOf ?? (_a2.multipleOf = def.value);
1761
+ var _a3;
1762
+ (_a3 = inst2._zod.bag).multipleOf ?? (_a3.multipleOf = def.value);
2173
1763
  });
2174
1764
  inst._zod.check = (payload) => {
2175
1765
  if (typeof payload.value !== typeof def.value)
@@ -2302,9 +1892,9 @@
2302
1892
  };
2303
1893
  });
2304
1894
  var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, def) => {
2305
- var _a2;
1895
+ var _a3;
2306
1896
  $ZodCheck.init(inst, def);
2307
- (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
1897
+ (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
2308
1898
  const val = payload.value;
2309
1899
  return !nullish(val) && val.size !== void 0;
2310
1900
  });
@@ -2330,9 +1920,9 @@
2330
1920
  };
2331
1921
  });
2332
1922
  var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, def) => {
2333
- var _a2;
1923
+ var _a3;
2334
1924
  $ZodCheck.init(inst, def);
2335
- (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
1925
+ (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
2336
1926
  const val = payload.value;
2337
1927
  return !nullish(val) && val.size !== void 0;
2338
1928
  });
@@ -2358,9 +1948,9 @@
2358
1948
  };
2359
1949
  });
2360
1950
  var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (inst, def) => {
2361
- var _a2;
1951
+ var _a3;
2362
1952
  $ZodCheck.init(inst, def);
2363
- (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
1953
+ (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
2364
1954
  const val = payload.value;
2365
1955
  return !nullish(val) && val.size !== void 0;
2366
1956
  });
@@ -2388,9 +1978,9 @@
2388
1978
  };
2389
1979
  });
2390
1980
  var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => {
2391
- var _a2;
1981
+ var _a3;
2392
1982
  $ZodCheck.init(inst, def);
2393
- (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
1983
+ (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
2394
1984
  const val = payload.value;
2395
1985
  return !nullish(val) && val.length !== void 0;
2396
1986
  });
@@ -2417,9 +2007,9 @@
2417
2007
  };
2418
2008
  });
2419
2009
  var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => {
2420
- var _a2;
2010
+ var _a3;
2421
2011
  $ZodCheck.init(inst, def);
2422
- (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
2012
+ (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
2423
2013
  const val = payload.value;
2424
2014
  return !nullish(val) && val.length !== void 0;
2425
2015
  });
@@ -2446,9 +2036,9 @@
2446
2036
  };
2447
2037
  });
2448
2038
  var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => {
2449
- var _a2;
2039
+ var _a3;
2450
2040
  $ZodCheck.init(inst, def);
2451
- (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
2041
+ (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
2452
2042
  const val = payload.value;
2453
2043
  return !nullish(val) && val.length !== void 0;
2454
2044
  });
@@ -2477,7 +2067,7 @@
2477
2067
  };
2478
2068
  });
2479
2069
  var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
2480
- var _a2, _b;
2070
+ var _a3, _b;
2481
2071
  $ZodCheck.init(inst, def);
2482
2072
  inst._zod.onattach.push((inst2) => {
2483
2073
  const bag = inst2._zod.bag;
@@ -2488,7 +2078,7 @@
2488
2078
  }
2489
2079
  });
2490
2080
  if (def.pattern)
2491
- (_a2 = inst._zod).check ?? (_a2.check = (payload) => {
2081
+ (_a3 = inst._zod).check ?? (_a3.check = (payload) => {
2492
2082
  def.pattern.lastIndex = 0;
2493
2083
  if (def.pattern.test(payload.value))
2494
2084
  return;
@@ -2684,13 +2274,13 @@
2684
2274
  // node_modules/zod/v4/core/versions.js
2685
2275
  var version = {
2686
2276
  major: 4,
2687
- minor: 3,
2688
- patch: 6
2277
+ minor: 4,
2278
+ patch: 3
2689
2279
  };
2690
2280
 
2691
2281
  // node_modules/zod/v4/core/schemas.js
2692
2282
  var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
2693
- var _a2;
2283
+ var _a3;
2694
2284
  inst ?? (inst = {});
2695
2285
  inst._zod.def = def;
2696
2286
  inst._zod.bag = inst._zod.bag || {};
@@ -2705,7 +2295,7 @@
2705
2295
  }
2706
2296
  }
2707
2297
  if (checks.length === 0) {
2708
- (_a2 = inst._zod).deferred ?? (_a2.deferred = []);
2298
+ (_a3 = inst._zod).deferred ?? (_a3.deferred = []);
2709
2299
  inst._zod.deferred?.push(() => {
2710
2300
  inst._zod.run = inst._zod.parse;
2711
2301
  });
@@ -2715,6 +2305,8 @@
2715
2305
  let asyncResult;
2716
2306
  for (const ch of checks2) {
2717
2307
  if (ch._zod.def.when) {
2308
+ if (explicitlyAborted(payload))
2309
+ continue;
2718
2310
  const shouldRun = ch._zod.def.when(payload);
2719
2311
  if (!shouldRun)
2720
2312
  continue;
@@ -2855,6 +2447,19 @@
2855
2447
  inst._zod.check = (payload) => {
2856
2448
  try {
2857
2449
  const trimmed = payload.value.trim();
2450
+ if (!def.normalize && def.protocol?.source === httpProtocol.source) {
2451
+ if (!/^https?:\/\//i.test(trimmed)) {
2452
+ payload.issues.push({
2453
+ code: "invalid_format",
2454
+ format: "url",
2455
+ note: "Invalid URL format",
2456
+ input: payload.value,
2457
+ inst,
2458
+ continue: !def.abort
2459
+ });
2460
+ return;
2461
+ }
2462
+ }
2858
2463
  const url2 = new URL(trimmed);
2859
2464
  if (def.hostname) {
2860
2465
  def.hostname.lastIndex = 0;
@@ -3008,6 +2613,8 @@
3008
2613
  function isValidBase64(data) {
3009
2614
  if (data === "")
3010
2615
  return true;
2616
+ if (/\s/.test(data))
2617
+ return false;
3011
2618
  if (data.length % 4 !== 0)
3012
2619
  return false;
3013
2620
  try {
@@ -3200,8 +2807,6 @@
3200
2807
  $ZodType.init(inst, def);
3201
2808
  inst._zod.pattern = _undefined;
3202
2809
  inst._zod.values = /* @__PURE__ */ new Set([void 0]);
3203
- inst._zod.optin = "optional";
3204
- inst._zod.optout = "optional";
3205
2810
  inst._zod.parse = (payload, _ctx) => {
3206
2811
  const input = payload.value;
3207
2812
  if (typeof input === "undefined")
@@ -3330,15 +2935,27 @@
3330
2935
  return payload;
3331
2936
  };
3332
2937
  });
3333
- function handlePropertyResult(result, final, key, input, isOptionalOut) {
2938
+ function handlePropertyResult(result, final, key, input, isOptionalIn, isOptionalOut) {
2939
+ const isPresent = key in input;
3334
2940
  if (result.issues.length) {
3335
- if (isOptionalOut && !(key in input)) {
2941
+ if (isOptionalIn && isOptionalOut && !isPresent) {
3336
2942
  return;
3337
2943
  }
3338
2944
  final.issues.push(...prefixIssues(key, result.issues));
3339
2945
  }
2946
+ if (!isPresent && !isOptionalIn) {
2947
+ if (!result.issues.length) {
2948
+ final.issues.push({
2949
+ code: "invalid_type",
2950
+ expected: "nonoptional",
2951
+ input: void 0,
2952
+ path: [key]
2953
+ });
2954
+ }
2955
+ return;
2956
+ }
3340
2957
  if (result.value === void 0) {
3341
- if (key in input) {
2958
+ if (isPresent) {
3342
2959
  final.value[key] = void 0;
3343
2960
  }
3344
2961
  } else {
@@ -3366,8 +2983,11 @@
3366
2983
  const keySet = def.keySet;
3367
2984
  const _catchall = def.catchall._zod;
3368
2985
  const t = _catchall.def.type;
2986
+ const isOptionalIn = _catchall.optin === "optional";
3369
2987
  const isOptionalOut = _catchall.optout === "optional";
3370
2988
  for (const key in input) {
2989
+ if (key === "__proto__")
2990
+ continue;
3371
2991
  if (keySet.has(key))
3372
2992
  continue;
3373
2993
  if (t === "never") {
@@ -3376,9 +2996,9 @@
3376
2996
  }
3377
2997
  const r = _catchall.run({ value: input[key], issues: [] }, ctx);
3378
2998
  if (r instanceof Promise) {
3379
- proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input, isOptionalOut)));
2999
+ proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input, isOptionalIn, isOptionalOut)));
3380
3000
  } else {
3381
- handlePropertyResult(r, payload, key, input, isOptionalOut);
3001
+ handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
3382
3002
  }
3383
3003
  }
3384
3004
  if (unrecognized.length) {
@@ -3444,12 +3064,13 @@
3444
3064
  const shape = value.shape;
3445
3065
  for (const key of value.keys) {
3446
3066
  const el = shape[key];
3067
+ const isOptionalIn = el._zod.optin === "optional";
3447
3068
  const isOptionalOut = el._zod.optout === "optional";
3448
3069
  const r = el._zod.run({ value: input[key], issues: [] }, ctx);
3449
3070
  if (r instanceof Promise) {
3450
- proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input, isOptionalOut)));
3071
+ proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input, isOptionalIn, isOptionalOut)));
3451
3072
  } else {
3452
- handlePropertyResult(r, payload, key, input, isOptionalOut);
3073
+ handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
3453
3074
  }
3454
3075
  }
3455
3076
  if (!catchall) {
@@ -3480,9 +3101,10 @@
3480
3101
  const id = ids[key];
3481
3102
  const k = esc(key);
3482
3103
  const schema = shape[key];
3104
+ const isOptionalIn = schema?._zod?.optin === "optional";
3483
3105
  const isOptionalOut = schema?._zod?.optout === "optional";
3484
3106
  doc.write(`const ${id} = ${parseStr(key)};`);
3485
- if (isOptionalOut) {
3107
+ if (isOptionalIn && isOptionalOut) {
3486
3108
  doc.write(`
3487
3109
  if (${id}.issues.length) {
3488
3110
  if (${k} in input) {
@@ -3501,6 +3123,33 @@
3501
3123
  newResult[${k}] = ${id}.value;
3502
3124
  }
3503
3125
 
3126
+ `);
3127
+ } else if (!isOptionalIn) {
3128
+ doc.write(`
3129
+ const ${id}_present = ${k} in input;
3130
+ if (${id}.issues.length) {
3131
+ payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
3132
+ ...iss,
3133
+ path: iss.path ? [${k}, ...iss.path] : [${k}]
3134
+ })));
3135
+ }
3136
+ if (!${id}_present && !${id}.issues.length) {
3137
+ payload.issues.push({
3138
+ code: "invalid_type",
3139
+ expected: "nonoptional",
3140
+ input: undefined,
3141
+ path: [${k}]
3142
+ });
3143
+ }
3144
+
3145
+ if (${id}_present) {
3146
+ if (${id}.value === undefined) {
3147
+ newResult[${k}] = undefined;
3148
+ } else {
3149
+ newResult[${k}] = ${id}.value;
3150
+ }
3151
+ }
3152
+
3504
3153
  `);
3505
3154
  } else {
3506
3155
  doc.write(`
@@ -3594,10 +3243,9 @@
3594
3243
  }
3595
3244
  return void 0;
3596
3245
  });
3597
- const single = def.options.length === 1;
3598
- const first = def.options[0]._zod.run;
3246
+ const first = def.options.length === 1 ? def.options[0]._zod.run : null;
3599
3247
  inst._zod.parse = (payload, ctx) => {
3600
- if (single) {
3248
+ if (first) {
3601
3249
  return first(payload, ctx);
3602
3250
  }
3603
3251
  let async = false;
@@ -3650,10 +3298,9 @@
3650
3298
  var $ZodXor = /* @__PURE__ */ $constructor("$ZodXor", (inst, def) => {
3651
3299
  $ZodUnion.init(inst, def);
3652
3300
  def.inclusive = false;
3653
- const single = def.options.length === 1;
3654
- const first = def.options[0]._zod.run;
3301
+ const first = def.options.length === 1 ? def.options[0]._zod.run : null;
3655
3302
  inst._zod.parse = (payload, ctx) => {
3656
- if (single) {
3303
+ if (first) {
3657
3304
  return first(payload, ctx);
3658
3305
  }
3659
3306
  let async = false;
@@ -3728,7 +3375,7 @@
3728
3375
  if (opt) {
3729
3376
  return opt._zod.run(payload, ctx);
3730
3377
  }
3731
- if (def.unionFallback) {
3378
+ if (def.unionFallback || ctx.direction === "backward") {
3732
3379
  return _super(payload, ctx);
3733
3380
  }
3734
3381
  payload.issues.push({
@@ -3736,6 +3383,7 @@
3736
3383
  errors: [],
3737
3384
  note: "No matching discriminator",
3738
3385
  discriminator: def.discriminator,
3386
+ options: Array.from(disc.value.keys()),
3739
3387
  input,
3740
3388
  path: [def.discriminator],
3741
3389
  inst
@@ -3857,64 +3505,96 @@
3857
3505
  }
3858
3506
  payload.value = [];
3859
3507
  const proms = [];
3860
- const reversedIndex = [...items].reverse().findIndex((item) => item._zod.optin !== "optional");
3861
- const optStart = reversedIndex === -1 ? 0 : items.length - reversedIndex;
3508
+ const optinStart = getTupleOptStart(items, "optin");
3509
+ const optoutStart = getTupleOptStart(items, "optout");
3862
3510
  if (!def.rest) {
3863
- const tooBig = input.length > items.length;
3864
- const tooSmall = input.length < optStart - 1;
3865
- if (tooBig || tooSmall) {
3511
+ if (input.length < optinStart) {
3866
3512
  payload.issues.push({
3867
- ...tooBig ? { code: "too_big", maximum: items.length, inclusive: true } : { code: "too_small", minimum: items.length },
3513
+ code: "too_small",
3514
+ minimum: optinStart,
3515
+ inclusive: true,
3868
3516
  input,
3869
3517
  inst,
3870
3518
  origin: "array"
3871
3519
  });
3872
3520
  return payload;
3873
3521
  }
3874
- }
3875
- let i = -1;
3876
- for (const item of items) {
3877
- i++;
3878
- if (i >= input.length) {
3879
- if (i >= optStart)
3880
- continue;
3522
+ if (input.length > items.length) {
3523
+ payload.issues.push({
3524
+ code: "too_big",
3525
+ maximum: items.length,
3526
+ inclusive: true,
3527
+ input,
3528
+ inst,
3529
+ origin: "array"
3530
+ });
3881
3531
  }
3882
- const result = item._zod.run({
3883
- value: input[i],
3884
- issues: []
3885
- }, ctx);
3886
- if (result instanceof Promise) {
3887
- proms.push(result.then((result2) => handleTupleResult(result2, payload, i)));
3532
+ }
3533
+ const itemResults = new Array(items.length);
3534
+ for (let i = 0; i < items.length; i++) {
3535
+ const r = items[i]._zod.run({ value: input[i], issues: [] }, ctx);
3536
+ if (r instanceof Promise) {
3537
+ proms.push(r.then((rr) => {
3538
+ itemResults[i] = rr;
3539
+ }));
3888
3540
  } else {
3889
- handleTupleResult(result, payload, i);
3541
+ itemResults[i] = r;
3890
3542
  }
3891
3543
  }
3892
3544
  if (def.rest) {
3545
+ let i = items.length - 1;
3893
3546
  const rest = input.slice(items.length);
3894
3547
  for (const el of rest) {
3895
3548
  i++;
3896
- const result = def.rest._zod.run({
3897
- value: el,
3898
- issues: []
3899
- }, ctx);
3549
+ const result = def.rest._zod.run({ value: el, issues: [] }, ctx);
3900
3550
  if (result instanceof Promise) {
3901
- proms.push(result.then((result2) => handleTupleResult(result2, payload, i)));
3551
+ proms.push(result.then((r) => handleTupleResult(r, payload, i)));
3902
3552
  } else {
3903
3553
  handleTupleResult(result, payload, i);
3904
3554
  }
3905
3555
  }
3906
3556
  }
3907
- if (proms.length)
3908
- return Promise.all(proms).then(() => payload);
3909
- return payload;
3557
+ if (proms.length) {
3558
+ return Promise.all(proms).then(() => handleTupleResults(itemResults, payload, items, input, optoutStart));
3559
+ }
3560
+ return handleTupleResults(itemResults, payload, items, input, optoutStart);
3910
3561
  };
3911
3562
  });
3563
+ function getTupleOptStart(items, key) {
3564
+ for (let i = items.length - 1; i >= 0; i--) {
3565
+ if (items[i]._zod[key] !== "optional")
3566
+ return i + 1;
3567
+ }
3568
+ return 0;
3569
+ }
3912
3570
  function handleTupleResult(result, final, index) {
3913
3571
  if (result.issues.length) {
3914
3572
  final.issues.push(...prefixIssues(index, result.issues));
3915
3573
  }
3916
3574
  final.value[index] = result.value;
3917
3575
  }
3576
+ function handleTupleResults(itemResults, final, items, input, optoutStart) {
3577
+ for (let i = 0; i < items.length; i++) {
3578
+ const r = itemResults[i];
3579
+ const isPresent = i < input.length;
3580
+ if (r.issues.length) {
3581
+ if (!isPresent && i >= optoutStart) {
3582
+ final.value.length = i;
3583
+ break;
3584
+ }
3585
+ final.issues.push(...prefixIssues(i, r.issues));
3586
+ }
3587
+ final.value[i] = r.value;
3588
+ }
3589
+ for (let i = final.value.length - 1; i >= input.length; i--) {
3590
+ if (items[i]._zod.optout === "optional" && final.value[i] === void 0) {
3591
+ final.value.length = i;
3592
+ } else {
3593
+ break;
3594
+ }
3595
+ }
3596
+ return final;
3597
+ }
3918
3598
  var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
3919
3599
  $ZodType.init(inst, def);
3920
3600
  inst._zod.parse = (payload, ctx) => {
@@ -3936,19 +3616,35 @@
3936
3616
  for (const key of values) {
3937
3617
  if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
3938
3618
  recordKeys.add(typeof key === "number" ? key.toString() : key);
3619
+ const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
3620
+ if (keyResult instanceof Promise) {
3621
+ throw new Error("Async schemas not supported in object keys currently");
3622
+ }
3623
+ if (keyResult.issues.length) {
3624
+ payload.issues.push({
3625
+ code: "invalid_key",
3626
+ origin: "record",
3627
+ issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
3628
+ input: key,
3629
+ path: [key],
3630
+ inst
3631
+ });
3632
+ continue;
3633
+ }
3634
+ const outKey = keyResult.value;
3939
3635
  const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
3940
3636
  if (result instanceof Promise) {
3941
3637
  proms.push(result.then((result2) => {
3942
3638
  if (result2.issues.length) {
3943
3639
  payload.issues.push(...prefixIssues(key, result2.issues));
3944
3640
  }
3945
- payload.value[key] = result2.value;
3641
+ payload.value[outKey] = result2.value;
3946
3642
  }));
3947
3643
  } else {
3948
3644
  if (result.issues.length) {
3949
3645
  payload.issues.push(...prefixIssues(key, result.issues));
3950
3646
  }
3951
- payload.value[key] = result.value;
3647
+ payload.value[outKey] = result.value;
3952
3648
  }
3953
3649
  }
3954
3650
  }
@@ -3972,6 +3668,8 @@
3972
3668
  for (const key of Reflect.ownKeys(input)) {
3973
3669
  if (key === "__proto__")
3974
3670
  continue;
3671
+ if (!Object.prototype.propertyIsEnumerable.call(input, key))
3672
+ continue;
3975
3673
  let keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
3976
3674
  if (keyResult instanceof Promise) {
3977
3675
  throw new Error("Async schemas not supported in object keys currently");
@@ -4176,6 +3874,7 @@
4176
3874
  });
4177
3875
  var $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) => {
4178
3876
  $ZodType.init(inst, def);
3877
+ inst._zod.optin = "optional";
4179
3878
  inst._zod.parse = (payload, ctx) => {
4180
3879
  if (ctx.direction === "backward") {
4181
3880
  throw new $ZodEncodeError(inst.constructor.name);
@@ -4185,6 +3884,7 @@
4185
3884
  const output = _out instanceof Promise ? _out : Promise.resolve(_out);
4186
3885
  return output.then((output2) => {
4187
3886
  payload.value = output2;
3887
+ payload.fallback = true;
4188
3888
  return payload;
4189
3889
  });
4190
3890
  }
@@ -4192,11 +3892,12 @@
4192
3892
  throw new $ZodAsyncError();
4193
3893
  }
4194
3894
  payload.value = _out;
3895
+ payload.fallback = true;
4195
3896
  return payload;
4196
3897
  };
4197
3898
  });
4198
3899
  function handleOptionalResult(result, input) {
4199
- if (result.issues.length && input === void 0) {
3900
+ if (input === void 0 && (result.issues.length || result.fallback)) {
4200
3901
  return { issues: [], value: void 0 };
4201
3902
  }
4202
3903
  return result;
@@ -4214,10 +3915,11 @@
4214
3915
  });
4215
3916
  inst._zod.parse = (payload, ctx) => {
4216
3917
  if (def.innerType._zod.optin === "optional") {
3918
+ const input = payload.value;
4217
3919
  const result = def.innerType._zod.run(payload, ctx);
4218
3920
  if (result instanceof Promise)
4219
- return result.then((r) => handleOptionalResult(r, payload.value));
4220
- return handleOptionalResult(result, payload.value);
3921
+ return result.then((r) => handleOptionalResult(r, input));
3922
+ return handleOptionalResult(result, input);
4221
3923
  }
4222
3924
  if (payload.value === void 0) {
4223
3925
  return payload;
@@ -4333,7 +4035,7 @@
4333
4035
  });
4334
4036
  var $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
4335
4037
  $ZodType.init(inst, def);
4336
- defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
4038
+ inst._zod.optin = "optional";
4337
4039
  defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
4338
4040
  defineLazy(inst._zod, "values", () => def.innerType._zod.values);
4339
4041
  inst._zod.parse = (payload, ctx) => {
@@ -4353,6 +4055,7 @@
4353
4055
  input: payload.value
4354
4056
  });
4355
4057
  payload.issues = [];
4058
+ payload.fallback = true;
4356
4059
  }
4357
4060
  return payload;
4358
4061
  });
@@ -4367,6 +4070,7 @@
4367
4070
  input: payload.value
4368
4071
  });
4369
4072
  payload.issues = [];
4073
+ payload.fallback = true;
4370
4074
  }
4371
4075
  return payload;
4372
4076
  };
@@ -4412,7 +4116,7 @@
4412
4116
  left.aborted = true;
4413
4117
  return left;
4414
4118
  }
4415
- return next._zod.run({ value: left.value, issues: left.issues }, ctx);
4119
+ return next._zod.run({ value: left.value, issues: left.issues, fallback: left.fallback }, ctx);
4416
4120
  }
4417
4121
  var $ZodCodec = /* @__PURE__ */ $constructor("$ZodCodec", (inst, def) => {
4418
4122
  $ZodType.init(inst, def);
@@ -4464,6 +4168,9 @@
4464
4168
  }
4465
4169
  return nextSchema._zod.run({ value, issues: left.issues }, ctx);
4466
4170
  }
4171
+ var $ZodPreprocess = /* @__PURE__ */ $constructor("$ZodPreprocess", (inst, def) => {
4172
+ $ZodPipe.init(inst, def);
4173
+ });
4467
4174
  var $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) => {
4468
4175
  $ZodType.init(inst, def);
4469
4176
  defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
@@ -4615,7 +4322,12 @@
4615
4322
  });
4616
4323
  var $ZodLazy = /* @__PURE__ */ $constructor("$ZodLazy", (inst, def) => {
4617
4324
  $ZodType.init(inst, def);
4618
- defineLazy(inst._zod, "innerType", () => def.getter());
4325
+ defineLazy(inst._zod, "innerType", () => {
4326
+ const d = def;
4327
+ if (!d._cachedInner)
4328
+ d._cachedInner = def.getter();
4329
+ return d._cachedInner;
4330
+ });
4619
4331
  defineLazy(inst._zod, "pattern", () => inst._zod.innerType?._zod?.pattern);
4620
4332
  defineLazy(inst._zod, "propValues", () => inst._zod.innerType?._zod?.propValues);
4621
4333
  defineLazy(inst._zod, "optin", () => inst._zod.innerType?._zod?.optin ?? void 0);
@@ -4670,6 +4382,7 @@
4670
4382
  cs: () => cs_default,
4671
4383
  da: () => da_default,
4672
4384
  de: () => de_default,
4385
+ el: () => el_default,
4673
4386
  en: () => en_default,
4674
4387
  eo: () => eo_default,
4675
4388
  es: () => es_default,
@@ -4678,6 +4391,7 @@
4678
4391
  fr: () => fr_default,
4679
4392
  frCA: () => fr_CA_default,
4680
4393
  he: () => he_default,
4394
+ hr: () => hr_default,
4681
4395
  hu: () => hu_default,
4682
4396
  hy: () => hy_default,
4683
4397
  id: () => id_default,
@@ -4697,6 +4411,7 @@
4697
4411
  pl: () => pl_default,
4698
4412
  ps: () => ps_default,
4699
4413
  pt: () => pt_default,
4414
+ ro: () => ro_default,
4700
4415
  ru: () => ru_default,
4701
4416
  sl: () => sl_default,
4702
4417
  sv: () => sv_default,
@@ -5650,8 +5365,118 @@
5650
5365
  };
5651
5366
  }
5652
5367
 
5653
- // node_modules/zod/v4/locales/en.js
5368
+ // node_modules/zod/v4/locales/el.js
5654
5369
  var error9 = () => {
5370
+ const Sizable = {
5371
+ string: { unit: "\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2", verb: "\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9" },
5372
+ file: { unit: "bytes", verb: "\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9" },
5373
+ array: { unit: "\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1", verb: "\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9" },
5374
+ set: { unit: "\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1", verb: "\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9" },
5375
+ map: { unit: "\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2", verb: "\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9" }
5376
+ };
5377
+ function getSizing(origin) {
5378
+ return Sizable[origin] ?? null;
5379
+ }
5380
+ const FormatDictionary = {
5381
+ regex: "\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",
5382
+ email: "\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",
5383
+ url: "URL",
5384
+ emoji: "emoji",
5385
+ uuid: "UUID",
5386
+ uuidv4: "UUIDv4",
5387
+ uuidv6: "UUIDv6",
5388
+ nanoid: "nanoid",
5389
+ guid: "GUID",
5390
+ cuid: "cuid",
5391
+ cuid2: "cuid2",
5392
+ ulid: "ULID",
5393
+ xid: "XID",
5394
+ ksuid: "KSUID",
5395
+ datetime: "ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",
5396
+ date: "ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",
5397
+ time: "ISO \u03CE\u03C1\u03B1",
5398
+ duration: "ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",
5399
+ ipv4: "\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",
5400
+ ipv6: "\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",
5401
+ mac: "\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",
5402
+ cidrv4: "\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",
5403
+ cidrv6: "\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",
5404
+ base64: "\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",
5405
+ base64url: "\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",
5406
+ json_string: "\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",
5407
+ e164: "\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",
5408
+ jwt: "JWT",
5409
+ template_literal: "\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"
5410
+ };
5411
+ const TypeDictionary = {
5412
+ nan: "NaN"
5413
+ };
5414
+ return (issue2) => {
5415
+ switch (issue2.code) {
5416
+ case "invalid_type": {
5417
+ const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
5418
+ const receivedType = parsedType(issue2.input);
5419
+ const received = TypeDictionary[receivedType] ?? receivedType;
5420
+ if (typeof issue2.expected === "string" && /^[A-Z]/.test(issue2.expected)) {
5421
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${issue2.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${received}`;
5422
+ }
5423
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${received}`;
5424
+ }
5425
+ case "invalid_value":
5426
+ if (issue2.values.length === 1)
5427
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${stringifyPrimitive(issue2.values[0])}`;
5428
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${joinValues(issue2.values, "|")}`;
5429
+ case "too_big": {
5430
+ const adj = issue2.inclusive ? "<=" : "<";
5431
+ const sizing = getSizing(issue2.origin);
5432
+ if (sizing)
5433
+ return `\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${issue2.origin ?? "\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`;
5434
+ return `\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${issue2.origin ?? "\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${adj}${issue2.maximum.toString()}`;
5435
+ }
5436
+ case "too_small": {
5437
+ const adj = issue2.inclusive ? ">=" : ">";
5438
+ const sizing = getSizing(issue2.origin);
5439
+ if (sizing) {
5440
+ return `\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${issue2.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
5441
+ }
5442
+ return `\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${issue2.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${adj}${issue2.minimum.toString()}`;
5443
+ }
5444
+ case "invalid_format": {
5445
+ const _issue = issue2;
5446
+ if (_issue.format === "starts_with") {
5447
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${_issue.prefix}"`;
5448
+ }
5449
+ if (_issue.format === "ends_with")
5450
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${_issue.suffix}"`;
5451
+ if (_issue.format === "includes")
5452
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${_issue.includes}"`;
5453
+ if (_issue.format === "regex")
5454
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${_issue.pattern}`;
5455
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${FormatDictionary[_issue.format] ?? issue2.format}`;
5456
+ }
5457
+ case "not_multiple_of":
5458
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${issue2.divisor}`;
5459
+ case "unrecognized_keys":
5460
+ return `\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${issue2.keys.length > 1 ? "\u03B1" : "\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${issue2.keys.length > 1 ? "\u03B9\u03AC" : "\u03AF"}: ${joinValues(issue2.keys, ", ")}`;
5461
+ case "invalid_key":
5462
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${issue2.origin}`;
5463
+ case "invalid_union":
5464
+ return "\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";
5465
+ case "invalid_element":
5466
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${issue2.origin}`;
5467
+ default:
5468
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2`;
5469
+ }
5470
+ };
5471
+ };
5472
+ function el_default() {
5473
+ return {
5474
+ localeError: error9()
5475
+ };
5476
+ }
5477
+
5478
+ // node_modules/zod/v4/locales/en.js
5479
+ var error10 = () => {
5655
5480
  const Sizable = {
5656
5481
  string: { unit: "characters", verb: "to have" },
5657
5482
  file: { unit: "bytes", verb: "to have" },
@@ -5745,6 +5570,10 @@
5745
5570
  case "invalid_key":
5746
5571
  return `Invalid key in ${issue2.origin}`;
5747
5572
  case "invalid_union":
5573
+ if (issue2.options && Array.isArray(issue2.options) && issue2.options.length > 0) {
5574
+ const opts = issue2.options.map((o) => `'${o}'`).join(" | ");
5575
+ return `Invalid discriminator value. Expected ${opts}`;
5576
+ }
5748
5577
  return "Invalid input";
5749
5578
  case "invalid_element":
5750
5579
  return `Invalid value in ${issue2.origin}`;
@@ -5755,12 +5584,12 @@
5755
5584
  };
5756
5585
  function en_default() {
5757
5586
  return {
5758
- localeError: error9()
5587
+ localeError: error10()
5759
5588
  };
5760
5589
  }
5761
5590
 
5762
5591
  // node_modules/zod/v4/locales/eo.js
5763
- var error10 = () => {
5592
+ var error11 = () => {
5764
5593
  const Sizable = {
5765
5594
  string: { unit: "karaktrojn", verb: "havi" },
5766
5595
  file: { unit: "bajtojn", verb: "havi" },
@@ -5865,12 +5694,12 @@
5865
5694
  };
5866
5695
  function eo_default() {
5867
5696
  return {
5868
- localeError: error10()
5697
+ localeError: error11()
5869
5698
  };
5870
5699
  }
5871
5700
 
5872
5701
  // node_modules/zod/v4/locales/es.js
5873
- var error11 = () => {
5702
+ var error12 = () => {
5874
5703
  const Sizable = {
5875
5704
  string: { unit: "caracteres", verb: "tener" },
5876
5705
  file: { unit: "bytes", verb: "tener" },
@@ -5998,12 +5827,12 @@
5998
5827
  };
5999
5828
  function es_default() {
6000
5829
  return {
6001
- localeError: error11()
5830
+ localeError: error12()
6002
5831
  };
6003
5832
  }
6004
5833
 
6005
5834
  // node_modules/zod/v4/locales/fa.js
6006
- var error12 = () => {
5835
+ var error13 = () => {
6007
5836
  const Sizable = {
6008
5837
  string: { unit: "\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631", verb: "\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F" },
6009
5838
  file: { unit: "\u0628\u0627\u06CC\u062A", verb: "\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F" },
@@ -6113,12 +5942,12 @@
6113
5942
  };
6114
5943
  function fa_default() {
6115
5944
  return {
6116
- localeError: error12()
5945
+ localeError: error13()
6117
5946
  };
6118
5947
  }
6119
5948
 
6120
5949
  // node_modules/zod/v4/locales/fi.js
6121
- var error13 = () => {
5950
+ var error14 = () => {
6122
5951
  const Sizable = {
6123
5952
  string: { unit: "merkki\xE4", subject: "merkkijonon" },
6124
5953
  file: { unit: "tavua", subject: "tiedoston" },
@@ -6226,12 +6055,12 @@
6226
6055
  };
6227
6056
  function fi_default() {
6228
6057
  return {
6229
- localeError: error13()
6058
+ localeError: error14()
6230
6059
  };
6231
6060
  }
6232
6061
 
6233
6062
  // node_modules/zod/v4/locales/fr.js
6234
- var error14 = () => {
6063
+ var error15 = () => {
6235
6064
  const Sizable = {
6236
6065
  string: { unit: "caract\xE8res", verb: "avoir" },
6237
6066
  file: { unit: "octets", verb: "avoir" },
@@ -6272,9 +6101,27 @@
6272
6101
  template_literal: "entr\xE9e"
6273
6102
  };
6274
6103
  const TypeDictionary = {
6275
- nan: "NaN",
6104
+ string: "cha\xEEne",
6276
6105
  number: "nombre",
6277
- array: "tableau"
6106
+ int: "entier",
6107
+ boolean: "bool\xE9en",
6108
+ bigint: "grand entier",
6109
+ symbol: "symbole",
6110
+ undefined: "ind\xE9fini",
6111
+ null: "null",
6112
+ never: "jamais",
6113
+ void: "vide",
6114
+ date: "date",
6115
+ array: "tableau",
6116
+ object: "objet",
6117
+ tuple: "tuple",
6118
+ record: "enregistrement",
6119
+ map: "carte",
6120
+ set: "ensemble",
6121
+ file: "fichier",
6122
+ nonoptional: "non-optionnel",
6123
+ nan: "NaN",
6124
+ function: "fonction"
6278
6125
  };
6279
6126
  return (issue2) => {
6280
6127
  switch (issue2.code) {
@@ -6295,16 +6142,15 @@
6295
6142
  const adj = issue2.inclusive ? "<=" : "<";
6296
6143
  const sizing = getSizing(issue2.origin);
6297
6144
  if (sizing)
6298
- return `Trop grand : ${issue2.origin ?? "valeur"} doit ${sizing.verb} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "\xE9l\xE9ment(s)"}`;
6299
- return `Trop grand : ${issue2.origin ?? "valeur"} doit \xEAtre ${adj}${issue2.maximum.toString()}`;
6145
+ return `Trop grand : ${TypeDictionary[issue2.origin] ?? "valeur"} doit ${sizing.verb} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "\xE9l\xE9ment(s)"}`;
6146
+ return `Trop grand : ${TypeDictionary[issue2.origin] ?? "valeur"} doit \xEAtre ${adj}${issue2.maximum.toString()}`;
6300
6147
  }
6301
6148
  case "too_small": {
6302
6149
  const adj = issue2.inclusive ? ">=" : ">";
6303
6150
  const sizing = getSizing(issue2.origin);
6304
- if (sizing) {
6305
- return `Trop petit : ${issue2.origin} doit ${sizing.verb} ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
6306
- }
6307
- return `Trop petit : ${issue2.origin} doit \xEAtre ${adj}${issue2.minimum.toString()}`;
6151
+ if (sizing)
6152
+ return `Trop petit : ${TypeDictionary[issue2.origin] ?? "valeur"} doit ${sizing.verb} ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
6153
+ return `Trop petit : ${TypeDictionary[issue2.origin] ?? "valeur"} doit \xEAtre ${adj}${issue2.minimum.toString()}`;
6308
6154
  }
6309
6155
  case "invalid_format": {
6310
6156
  const _issue = issue2;
@@ -6335,12 +6181,12 @@
6335
6181
  };
6336
6182
  function fr_default() {
6337
6183
  return {
6338
- localeError: error14()
6184
+ localeError: error15()
6339
6185
  };
6340
6186
  }
6341
6187
 
6342
6188
  // node_modules/zod/v4/locales/fr-CA.js
6343
- var error15 = () => {
6189
+ var error16 = () => {
6344
6190
  const Sizable = {
6345
6191
  string: { unit: "caract\xE8res", verb: "avoir" },
6346
6192
  file: { unit: "octets", verb: "avoir" },
@@ -6443,12 +6289,12 @@
6443
6289
  };
6444
6290
  function fr_CA_default() {
6445
6291
  return {
6446
- localeError: error15()
6292
+ localeError: error16()
6447
6293
  };
6448
6294
  }
6449
6295
 
6450
6296
  // node_modules/zod/v4/locales/he.js
6451
- var error16 = () => {
6297
+ var error17 = () => {
6452
6298
  const TypeNames = {
6453
6299
  string: { label: "\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA", gender: "f" },
6454
6300
  number: { label: "\u05DE\u05E1\u05E4\u05E8", gender: "m" },
@@ -6632,18 +6478,141 @@
6632
6478
  return `\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${place}`;
6633
6479
  }
6634
6480
  default:
6635
- return `\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF`;
6481
+ return `\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF`;
6482
+ }
6483
+ };
6484
+ };
6485
+ function he_default() {
6486
+ return {
6487
+ localeError: error17()
6488
+ };
6489
+ }
6490
+
6491
+ // node_modules/zod/v4/locales/hr.js
6492
+ var error18 = () => {
6493
+ const Sizable = {
6494
+ string: { unit: "znakova", verb: "imati" },
6495
+ file: { unit: "bajtova", verb: "imati" },
6496
+ array: { unit: "stavki", verb: "imati" },
6497
+ set: { unit: "stavki", verb: "imati" }
6498
+ };
6499
+ function getSizing(origin) {
6500
+ return Sizable[origin] ?? null;
6501
+ }
6502
+ const FormatDictionary = {
6503
+ regex: "unos",
6504
+ email: "email adresa",
6505
+ url: "URL",
6506
+ emoji: "emoji",
6507
+ uuid: "UUID",
6508
+ uuidv4: "UUIDv4",
6509
+ uuidv6: "UUIDv6",
6510
+ nanoid: "nanoid",
6511
+ guid: "GUID",
6512
+ cuid: "cuid",
6513
+ cuid2: "cuid2",
6514
+ ulid: "ULID",
6515
+ xid: "XID",
6516
+ ksuid: "KSUID",
6517
+ datetime: "ISO datum i vrijeme",
6518
+ date: "ISO datum",
6519
+ time: "ISO vrijeme",
6520
+ duration: "ISO trajanje",
6521
+ ipv4: "IPv4 adresa",
6522
+ ipv6: "IPv6 adresa",
6523
+ cidrv4: "IPv4 raspon",
6524
+ cidrv6: "IPv6 raspon",
6525
+ base64: "base64 kodirani tekst",
6526
+ base64url: "base64url kodirani tekst",
6527
+ json_string: "JSON tekst",
6528
+ e164: "E.164 broj",
6529
+ jwt: "JWT",
6530
+ template_literal: "unos"
6531
+ };
6532
+ const TypeDictionary = {
6533
+ nan: "NaN",
6534
+ string: "tekst",
6535
+ number: "broj",
6536
+ boolean: "boolean",
6537
+ array: "niz",
6538
+ object: "objekt",
6539
+ set: "skup",
6540
+ file: "datoteka",
6541
+ date: "datum",
6542
+ bigint: "bigint",
6543
+ symbol: "simbol",
6544
+ undefined: "undefined",
6545
+ null: "null",
6546
+ function: "funkcija",
6547
+ map: "mapa"
6548
+ };
6549
+ return (issue2) => {
6550
+ switch (issue2.code) {
6551
+ case "invalid_type": {
6552
+ const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
6553
+ const receivedType = parsedType(issue2.input);
6554
+ const received = TypeDictionary[receivedType] ?? receivedType;
6555
+ if (/^[A-Z]/.test(issue2.expected)) {
6556
+ return `Neispravan unos: o\u010Dekuje se instanceof ${issue2.expected}, a primljeno je ${received}`;
6557
+ }
6558
+ return `Neispravan unos: o\u010Dekuje se ${expected}, a primljeno je ${received}`;
6559
+ }
6560
+ case "invalid_value":
6561
+ if (issue2.values.length === 1)
6562
+ return `Neispravna vrijednost: o\u010Dekivano ${stringifyPrimitive(issue2.values[0])}`;
6563
+ return `Neispravna opcija: o\u010Dekivano jedno od ${joinValues(issue2.values, "|")}`;
6564
+ case "too_big": {
6565
+ const adj = issue2.inclusive ? "<=" : "<";
6566
+ const sizing = getSizing(issue2.origin);
6567
+ const origin = TypeDictionary[issue2.origin] ?? issue2.origin;
6568
+ if (sizing)
6569
+ return `Preveliko: o\u010Dekivano da ${origin ?? "vrijednost"} ima ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elemenata"}`;
6570
+ return `Preveliko: o\u010Dekivano da ${origin ?? "vrijednost"} bude ${adj}${issue2.maximum.toString()}`;
6571
+ }
6572
+ case "too_small": {
6573
+ const adj = issue2.inclusive ? ">=" : ">";
6574
+ const sizing = getSizing(issue2.origin);
6575
+ const origin = TypeDictionary[issue2.origin] ?? issue2.origin;
6576
+ if (sizing) {
6577
+ return `Premalo: o\u010Dekivano da ${origin} ima ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
6578
+ }
6579
+ return `Premalo: o\u010Dekivano da ${origin} bude ${adj}${issue2.minimum.toString()}`;
6580
+ }
6581
+ case "invalid_format": {
6582
+ const _issue = issue2;
6583
+ if (_issue.format === "starts_with")
6584
+ return `Neispravan tekst: mora zapo\u010Dinjati s "${_issue.prefix}"`;
6585
+ if (_issue.format === "ends_with")
6586
+ return `Neispravan tekst: mora zavr\u0161avati s "${_issue.suffix}"`;
6587
+ if (_issue.format === "includes")
6588
+ return `Neispravan tekst: mora sadr\u017Eavati "${_issue.includes}"`;
6589
+ if (_issue.format === "regex")
6590
+ return `Neispravan tekst: mora odgovarati uzorku ${_issue.pattern}`;
6591
+ return `Neispravna ${FormatDictionary[_issue.format] ?? issue2.format}`;
6592
+ }
6593
+ case "not_multiple_of":
6594
+ return `Neispravan broj: mora biti vi\u0161ekratnik od ${issue2.divisor}`;
6595
+ case "unrecognized_keys":
6596
+ return `Neprepoznat${issue2.keys.length > 1 ? "i klju\u010Devi" : " klju\u010D"}: ${joinValues(issue2.keys, ", ")}`;
6597
+ case "invalid_key":
6598
+ return `Neispravan klju\u010D u ${TypeDictionary[issue2.origin] ?? issue2.origin}`;
6599
+ case "invalid_union":
6600
+ return "Neispravan unos";
6601
+ case "invalid_element":
6602
+ return `Neispravna vrijednost u ${TypeDictionary[issue2.origin] ?? issue2.origin}`;
6603
+ default:
6604
+ return `Neispravan unos`;
6636
6605
  }
6637
6606
  };
6638
6607
  };
6639
- function he_default() {
6608
+ function hr_default() {
6640
6609
  return {
6641
- localeError: error16()
6610
+ localeError: error18()
6642
6611
  };
6643
6612
  }
6644
6613
 
6645
6614
  // node_modules/zod/v4/locales/hu.js
6646
- var error17 = () => {
6615
+ var error19 = () => {
6647
6616
  const Sizable = {
6648
6617
  string: { unit: "karakter", verb: "legyen" },
6649
6618
  file: { unit: "byte", verb: "legyen" },
@@ -6747,7 +6716,7 @@
6747
6716
  };
6748
6717
  function hu_default() {
6749
6718
  return {
6750
- localeError: error17()
6719
+ localeError: error19()
6751
6720
  };
6752
6721
  }
6753
6722
 
@@ -6762,7 +6731,7 @@
6762
6731
  const lastChar = word[word.length - 1];
6763
6732
  return word + (vowels.includes(lastChar) ? "\u0576" : "\u0568");
6764
6733
  }
6765
- var error18 = () => {
6734
+ var error20 = () => {
6766
6735
  const Sizable = {
6767
6736
  string: {
6768
6737
  unit: {
@@ -6895,12 +6864,12 @@
6895
6864
  };
6896
6865
  function hy_default() {
6897
6866
  return {
6898
- localeError: error18()
6867
+ localeError: error20()
6899
6868
  };
6900
6869
  }
6901
6870
 
6902
6871
  // node_modules/zod/v4/locales/id.js
6903
- var error19 = () => {
6872
+ var error21 = () => {
6904
6873
  const Sizable = {
6905
6874
  string: { unit: "karakter", verb: "memiliki" },
6906
6875
  file: { unit: "byte", verb: "memiliki" },
@@ -7002,12 +6971,12 @@
7002
6971
  };
7003
6972
  function id_default() {
7004
6973
  return {
7005
- localeError: error19()
6974
+ localeError: error21()
7006
6975
  };
7007
6976
  }
7008
6977
 
7009
6978
  // node_modules/zod/v4/locales/is.js
7010
- var error20 = () => {
6979
+ var error22 = () => {
7011
6980
  const Sizable = {
7012
6981
  string: { unit: "stafi", verb: "a\xF0 hafa" },
7013
6982
  file: { unit: "b\xE6ti", verb: "a\xF0 hafa" },
@@ -7112,12 +7081,12 @@
7112
7081
  };
7113
7082
  function is_default() {
7114
7083
  return {
7115
- localeError: error20()
7084
+ localeError: error22()
7116
7085
  };
7117
7086
  }
7118
7087
 
7119
7088
  // node_modules/zod/v4/locales/it.js
7120
- var error21 = () => {
7089
+ var error23 = () => {
7121
7090
  const Sizable = {
7122
7091
  string: { unit: "caratteri", verb: "avere" },
7123
7092
  file: { unit: "byte", verb: "avere" },
@@ -7202,7 +7171,7 @@
7202
7171
  return `Stringa non valida: deve includere "${_issue.includes}"`;
7203
7172
  if (_issue.format === "regex")
7204
7173
  return `Stringa non valida: deve corrispondere al pattern ${_issue.pattern}`;
7205
- return `Invalid ${FormatDictionary[_issue.format] ?? issue2.format}`;
7174
+ return `Input non valido: ${FormatDictionary[_issue.format] ?? issue2.format}`;
7206
7175
  }
7207
7176
  case "not_multiple_of":
7208
7177
  return `Numero non valido: deve essere un multiplo di ${issue2.divisor}`;
@@ -7221,12 +7190,12 @@
7221
7190
  };
7222
7191
  function it_default() {
7223
7192
  return {
7224
- localeError: error21()
7193
+ localeError: error23()
7225
7194
  };
7226
7195
  }
7227
7196
 
7228
7197
  // node_modules/zod/v4/locales/ja.js
7229
- var error22 = () => {
7198
+ var error24 = () => {
7230
7199
  const Sizable = {
7231
7200
  string: { unit: "\u6587\u5B57", verb: "\u3067\u3042\u308B" },
7232
7201
  file: { unit: "\u30D0\u30A4\u30C8", verb: "\u3067\u3042\u308B" },
@@ -7329,12 +7298,12 @@
7329
7298
  };
7330
7299
  function ja_default() {
7331
7300
  return {
7332
- localeError: error22()
7301
+ localeError: error24()
7333
7302
  };
7334
7303
  }
7335
7304
 
7336
7305
  // node_modules/zod/v4/locales/ka.js
7337
- var error23 = () => {
7306
+ var error25 = () => {
7338
7307
  const Sizable = {
7339
7308
  string: { unit: "\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD", verb: "\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1" },
7340
7309
  file: { unit: "\u10D1\u10D0\u10D8\u10E2\u10D8", verb: "\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1" },
@@ -7367,9 +7336,9 @@
7367
7336
  ipv6: "IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",
7368
7337
  cidrv4: "IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",
7369
7338
  cidrv6: "IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",
7370
- base64: "base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",
7371
- base64url: "base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",
7372
- json_string: "JSON \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",
7339
+ base64: "base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",
7340
+ base64url: "base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",
7341
+ json_string: "JSON \u10D5\u10D4\u10DA\u10D8",
7373
7342
  e164: "E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",
7374
7343
  jwt: "JWT",
7375
7344
  template_literal: "\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"
@@ -7377,7 +7346,7 @@
7377
7346
  const TypeDictionary = {
7378
7347
  nan: "NaN",
7379
7348
  number: "\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",
7380
- string: "\u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",
7349
+ string: "\u10D5\u10D4\u10DA\u10D8",
7381
7350
  boolean: "\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",
7382
7351
  function: "\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",
7383
7352
  array: "\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"
@@ -7415,14 +7384,14 @@
7415
7384
  case "invalid_format": {
7416
7385
  const _issue = issue2;
7417
7386
  if (_issue.format === "starts_with") {
7418
- return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${_issue.prefix}"-\u10D8\u10D7`;
7387
+ return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${_issue.prefix}"-\u10D8\u10D7`;
7419
7388
  }
7420
7389
  if (_issue.format === "ends_with")
7421
- return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${_issue.suffix}"-\u10D8\u10D7`;
7390
+ return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${_issue.suffix}"-\u10D8\u10D7`;
7422
7391
  if (_issue.format === "includes")
7423
- return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${_issue.includes}"-\u10E1`;
7392
+ return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${_issue.includes}"-\u10E1`;
7424
7393
  if (_issue.format === "regex")
7425
- return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${_issue.pattern}`;
7394
+ return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${_issue.pattern}`;
7426
7395
  return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${FormatDictionary[_issue.format] ?? issue2.format}`;
7427
7396
  }
7428
7397
  case "not_multiple_of":
@@ -7442,12 +7411,12 @@
7442
7411
  };
7443
7412
  function ka_default() {
7444
7413
  return {
7445
- localeError: error23()
7414
+ localeError: error25()
7446
7415
  };
7447
7416
  }
7448
7417
 
7449
7418
  // node_modules/zod/v4/locales/km.js
7450
- var error24 = () => {
7419
+ var error26 = () => {
7451
7420
  const Sizable = {
7452
7421
  string: { unit: "\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A", verb: "\u1782\u17BD\u179A\u1798\u17B6\u1793" },
7453
7422
  file: { unit: "\u1794\u17C3", verb: "\u1782\u17BD\u179A\u1798\u17B6\u1793" },
@@ -7553,7 +7522,7 @@
7553
7522
  };
7554
7523
  function km_default() {
7555
7524
  return {
7556
- localeError: error24()
7525
+ localeError: error26()
7557
7526
  };
7558
7527
  }
7559
7528
 
@@ -7563,7 +7532,7 @@
7563
7532
  }
7564
7533
 
7565
7534
  // node_modules/zod/v4/locales/ko.js
7566
- var error25 = () => {
7535
+ var error27 = () => {
7567
7536
  const Sizable = {
7568
7537
  string: { unit: "\uBB38\uC790", verb: "to have" },
7569
7538
  file: { unit: "\uBC14\uC774\uD2B8", verb: "to have" },
@@ -7670,7 +7639,7 @@
7670
7639
  };
7671
7640
  function ko_default() {
7672
7641
  return {
7673
- localeError: error25()
7642
+ localeError: error27()
7674
7643
  };
7675
7644
  }
7676
7645
 
@@ -7688,7 +7657,7 @@
7688
7657
  return "one";
7689
7658
  return "few";
7690
7659
  }
7691
- var error26 = () => {
7660
+ var error28 = () => {
7692
7661
  const Sizable = {
7693
7662
  string: {
7694
7663
  unit: {
@@ -7874,12 +7843,12 @@
7874
7843
  };
7875
7844
  function lt_default() {
7876
7845
  return {
7877
- localeError: error26()
7846
+ localeError: error28()
7878
7847
  };
7879
7848
  }
7880
7849
 
7881
7850
  // node_modules/zod/v4/locales/mk.js
7882
- var error27 = () => {
7851
+ var error29 = () => {
7883
7852
  const Sizable = {
7884
7853
  string: { unit: "\u0437\u043D\u0430\u0446\u0438", verb: "\u0434\u0430 \u0438\u043C\u0430\u0430\u0442" },
7885
7854
  file: { unit: "\u0431\u0430\u0458\u0442\u0438", verb: "\u0434\u0430 \u0438\u043C\u0430\u0430\u0442" },
@@ -7984,12 +7953,12 @@
7984
7953
  };
7985
7954
  function mk_default() {
7986
7955
  return {
7987
- localeError: error27()
7956
+ localeError: error29()
7988
7957
  };
7989
7958
  }
7990
7959
 
7991
7960
  // node_modules/zod/v4/locales/ms.js
7992
- var error28 = () => {
7961
+ var error30 = () => {
7993
7962
  const Sizable = {
7994
7963
  string: { unit: "aksara", verb: "mempunyai" },
7995
7964
  file: { unit: "bait", verb: "mempunyai" },
@@ -8092,12 +8061,12 @@
8092
8061
  };
8093
8062
  function ms_default() {
8094
8063
  return {
8095
- localeError: error28()
8064
+ localeError: error30()
8096
8065
  };
8097
8066
  }
8098
8067
 
8099
8068
  // node_modules/zod/v4/locales/nl.js
8100
- var error29 = () => {
8069
+ var error31 = () => {
8101
8070
  const Sizable = {
8102
8071
  string: { unit: "tekens", verb: "heeft" },
8103
8072
  file: { unit: "bytes", verb: "heeft" },
@@ -8203,12 +8172,12 @@
8203
8172
  };
8204
8173
  function nl_default() {
8205
8174
  return {
8206
- localeError: error29()
8175
+ localeError: error31()
8207
8176
  };
8208
8177
  }
8209
8178
 
8210
8179
  // node_modules/zod/v4/locales/no.js
8211
- var error30 = () => {
8180
+ var error32 = () => {
8212
8181
  const Sizable = {
8213
8182
  string: { unit: "tegn", verb: "\xE5 ha" },
8214
8183
  file: { unit: "bytes", verb: "\xE5 ha" },
@@ -8312,12 +8281,12 @@
8312
8281
  };
8313
8282
  function no_default() {
8314
8283
  return {
8315
- localeError: error30()
8284
+ localeError: error32()
8316
8285
  };
8317
8286
  }
8318
8287
 
8319
8288
  // node_modules/zod/v4/locales/ota.js
8320
- var error31 = () => {
8289
+ var error33 = () => {
8321
8290
  const Sizable = {
8322
8291
  string: { unit: "harf", verb: "olmal\u0131d\u0131r" },
8323
8292
  file: { unit: "bayt", verb: "olmal\u0131d\u0131r" },
@@ -8422,12 +8391,12 @@
8422
8391
  };
8423
8392
  function ota_default() {
8424
8393
  return {
8425
- localeError: error31()
8394
+ localeError: error33()
8426
8395
  };
8427
8396
  }
8428
8397
 
8429
8398
  // node_modules/zod/v4/locales/ps.js
8430
- var error32 = () => {
8399
+ var error34 = () => {
8431
8400
  const Sizable = {
8432
8401
  string: { unit: "\u062A\u0648\u06A9\u064A", verb: "\u0648\u0644\u0631\u064A" },
8433
8402
  file: { unit: "\u0628\u0627\u06CC\u067C\u0633", verb: "\u0648\u0644\u0631\u064A" },
@@ -8537,12 +8506,12 @@
8537
8506
  };
8538
8507
  function ps_default() {
8539
8508
  return {
8540
- localeError: error32()
8509
+ localeError: error34()
8541
8510
  };
8542
8511
  }
8543
8512
 
8544
8513
  // node_modules/zod/v4/locales/pl.js
8545
- var error33 = () => {
8514
+ var error35 = () => {
8546
8515
  const Sizable = {
8547
8516
  string: { unit: "znak\xF3w", verb: "mie\u0107" },
8548
8517
  file: { unit: "bajt\xF3w", verb: "mie\u0107" },
@@ -8647,12 +8616,12 @@
8647
8616
  };
8648
8617
  function pl_default() {
8649
8618
  return {
8650
- localeError: error33()
8619
+ localeError: error35()
8651
8620
  };
8652
8621
  }
8653
8622
 
8654
8623
  // node_modules/zod/v4/locales/pt.js
8655
- var error34 = () => {
8624
+ var error36 = () => {
8656
8625
  const Sizable = {
8657
8626
  string: { unit: "caracteres", verb: "ter" },
8658
8627
  file: { unit: "bytes", verb: "ter" },
@@ -8756,7 +8725,127 @@
8756
8725
  };
8757
8726
  function pt_default() {
8758
8727
  return {
8759
- localeError: error34()
8728
+ localeError: error36()
8729
+ };
8730
+ }
8731
+
8732
+ // node_modules/zod/v4/locales/ro.js
8733
+ var error37 = () => {
8734
+ const Sizable = {
8735
+ string: { unit: "caractere", verb: "s\u0103 aib\u0103" },
8736
+ file: { unit: "octe\u021Bi", verb: "s\u0103 aib\u0103" },
8737
+ array: { unit: "elemente", verb: "s\u0103 aib\u0103" },
8738
+ set: { unit: "elemente", verb: "s\u0103 aib\u0103" },
8739
+ map: { unit: "intr\u0103ri", verb: "s\u0103 aib\u0103" }
8740
+ };
8741
+ function getSizing(origin) {
8742
+ return Sizable[origin] ?? null;
8743
+ }
8744
+ const FormatDictionary = {
8745
+ regex: "intrare",
8746
+ email: "adres\u0103 de email",
8747
+ url: "URL",
8748
+ emoji: "emoji",
8749
+ uuid: "UUID",
8750
+ uuidv4: "UUIDv4",
8751
+ uuidv6: "UUIDv6",
8752
+ nanoid: "nanoid",
8753
+ guid: "GUID",
8754
+ cuid: "cuid",
8755
+ cuid2: "cuid2",
8756
+ ulid: "ULID",
8757
+ xid: "XID",
8758
+ ksuid: "KSUID",
8759
+ datetime: "dat\u0103 \u0219i or\u0103 ISO",
8760
+ date: "dat\u0103 ISO",
8761
+ time: "or\u0103 ISO",
8762
+ duration: "durat\u0103 ISO",
8763
+ ipv4: "adres\u0103 IPv4",
8764
+ ipv6: "adres\u0103 IPv6",
8765
+ mac: "adres\u0103 MAC",
8766
+ cidrv4: "interval IPv4",
8767
+ cidrv6: "interval IPv6",
8768
+ base64: "\u0219ir codat base64",
8769
+ base64url: "\u0219ir codat base64url",
8770
+ json_string: "\u0219ir JSON",
8771
+ e164: "num\u0103r E.164",
8772
+ jwt: "JWT",
8773
+ template_literal: "intrare"
8774
+ };
8775
+ const TypeDictionary = {
8776
+ nan: "NaN",
8777
+ string: "\u0219ir",
8778
+ number: "num\u0103r",
8779
+ boolean: "boolean",
8780
+ function: "func\u021Bie",
8781
+ array: "matrice",
8782
+ object: "obiect",
8783
+ undefined: "nedefinit",
8784
+ symbol: "simbol",
8785
+ bigint: "num\u0103r mare",
8786
+ void: "void",
8787
+ never: "never",
8788
+ map: "hart\u0103",
8789
+ set: "set"
8790
+ };
8791
+ return (issue2) => {
8792
+ switch (issue2.code) {
8793
+ case "invalid_type": {
8794
+ const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
8795
+ const receivedType = parsedType(issue2.input);
8796
+ const received = TypeDictionary[receivedType] ?? receivedType;
8797
+ return `Intrare invalid\u0103: a\u0219teptat ${expected}, primit ${received}`;
8798
+ }
8799
+ case "invalid_value":
8800
+ if (issue2.values.length === 1)
8801
+ return `Intrare invalid\u0103: a\u0219teptat ${stringifyPrimitive(issue2.values[0])}`;
8802
+ return `Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${joinValues(issue2.values, "|")}`;
8803
+ case "too_big": {
8804
+ const adj = issue2.inclusive ? "<=" : "<";
8805
+ const sizing = getSizing(issue2.origin);
8806
+ if (sizing)
8807
+ return `Prea mare: a\u0219teptat ca ${issue2.origin ?? "valoarea"} ${sizing.verb} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elemente"}`;
8808
+ return `Prea mare: a\u0219teptat ca ${issue2.origin ?? "valoarea"} s\u0103 fie ${adj}${issue2.maximum.toString()}`;
8809
+ }
8810
+ case "too_small": {
8811
+ const adj = issue2.inclusive ? ">=" : ">";
8812
+ const sizing = getSizing(issue2.origin);
8813
+ if (sizing) {
8814
+ return `Prea mic: a\u0219teptat ca ${issue2.origin} ${sizing.verb} ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
8815
+ }
8816
+ return `Prea mic: a\u0219teptat ca ${issue2.origin} s\u0103 fie ${adj}${issue2.minimum.toString()}`;
8817
+ }
8818
+ case "invalid_format": {
8819
+ const _issue = issue2;
8820
+ if (_issue.format === "starts_with") {
8821
+ return `\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${_issue.prefix}"`;
8822
+ }
8823
+ if (_issue.format === "ends_with")
8824
+ return `\u0218ir invalid: trebuie s\u0103 se termine cu "${_issue.suffix}"`;
8825
+ if (_issue.format === "includes")
8826
+ return `\u0218ir invalid: trebuie s\u0103 includ\u0103 "${_issue.includes}"`;
8827
+ if (_issue.format === "regex")
8828
+ return `\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${_issue.pattern}`;
8829
+ return `Format invalid: ${FormatDictionary[_issue.format] ?? issue2.format}`;
8830
+ }
8831
+ case "not_multiple_of":
8832
+ return `Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${issue2.divisor}`;
8833
+ case "unrecognized_keys":
8834
+ return `Chei nerecunoscute: ${joinValues(issue2.keys, ", ")}`;
8835
+ case "invalid_key":
8836
+ return `Cheie invalid\u0103 \xEEn ${issue2.origin}`;
8837
+ case "invalid_union":
8838
+ return "Intrare invalid\u0103";
8839
+ case "invalid_element":
8840
+ return `Valoare invalid\u0103 \xEEn ${issue2.origin}`;
8841
+ default:
8842
+ return `Intrare invalid\u0103`;
8843
+ }
8844
+ };
8845
+ };
8846
+ function ro_default() {
8847
+ return {
8848
+ localeError: error37()
8760
8849
  };
8761
8850
  }
8762
8851
 
@@ -8776,7 +8865,7 @@
8776
8865
  }
8777
8866
  return many;
8778
8867
  }
8779
- var error35 = () => {
8868
+ var error38 = () => {
8780
8869
  const Sizable = {
8781
8870
  string: {
8782
8871
  unit: {
@@ -8913,12 +9002,12 @@
8913
9002
  };
8914
9003
  function ru_default() {
8915
9004
  return {
8916
- localeError: error35()
9005
+ localeError: error38()
8917
9006
  };
8918
9007
  }
8919
9008
 
8920
9009
  // node_modules/zod/v4/locales/sl.js
8921
- var error36 = () => {
9010
+ var error39 = () => {
8922
9011
  const Sizable = {
8923
9012
  string: { unit: "znakov", verb: "imeti" },
8924
9013
  file: { unit: "bajtov", verb: "imeti" },
@@ -9023,12 +9112,12 @@
9023
9112
  };
9024
9113
  function sl_default() {
9025
9114
  return {
9026
- localeError: error36()
9115
+ localeError: error39()
9027
9116
  };
9028
9117
  }
9029
9118
 
9030
9119
  // node_modules/zod/v4/locales/sv.js
9031
- var error37 = () => {
9120
+ var error40 = () => {
9032
9121
  const Sizable = {
9033
9122
  string: { unit: "tecken", verb: "att ha" },
9034
9123
  file: { unit: "bytes", verb: "att ha" },
@@ -9134,12 +9223,12 @@
9134
9223
  };
9135
9224
  function sv_default() {
9136
9225
  return {
9137
- localeError: error37()
9226
+ localeError: error40()
9138
9227
  };
9139
9228
  }
9140
9229
 
9141
9230
  // node_modules/zod/v4/locales/ta.js
9142
- var error38 = () => {
9231
+ var error41 = () => {
9143
9232
  const Sizable = {
9144
9233
  string: { unit: "\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD", verb: "\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD" },
9145
9234
  file: { unit: "\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD", verb: "\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD" },
@@ -9245,12 +9334,12 @@
9245
9334
  };
9246
9335
  function ta_default() {
9247
9336
  return {
9248
- localeError: error38()
9337
+ localeError: error41()
9249
9338
  };
9250
9339
  }
9251
9340
 
9252
9341
  // node_modules/zod/v4/locales/th.js
9253
- var error39 = () => {
9342
+ var error42 = () => {
9254
9343
  const Sizable = {
9255
9344
  string: { unit: "\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
9256
9345
  file: { unit: "\u0E44\u0E1A\u0E15\u0E4C", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
@@ -9356,12 +9445,12 @@
9356
9445
  };
9357
9446
  function th_default() {
9358
9447
  return {
9359
- localeError: error39()
9448
+ localeError: error42()
9360
9449
  };
9361
9450
  }
9362
9451
 
9363
9452
  // node_modules/zod/v4/locales/tr.js
9364
- var error40 = () => {
9453
+ var error43 = () => {
9365
9454
  const Sizable = {
9366
9455
  string: { unit: "karakter", verb: "olmal\u0131" },
9367
9456
  file: { unit: "bayt", verb: "olmal\u0131" },
@@ -9462,12 +9551,12 @@
9462
9551
  };
9463
9552
  function tr_default() {
9464
9553
  return {
9465
- localeError: error40()
9554
+ localeError: error43()
9466
9555
  };
9467
9556
  }
9468
9557
 
9469
9558
  // node_modules/zod/v4/locales/uk.js
9470
- var error41 = () => {
9559
+ var error44 = () => {
9471
9560
  const Sizable = {
9472
9561
  string: { unit: "\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
9473
9562
  file: { unit: "\u0431\u0430\u0439\u0442\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
@@ -9571,7 +9660,7 @@
9571
9660
  };
9572
9661
  function uk_default() {
9573
9662
  return {
9574
- localeError: error41()
9663
+ localeError: error44()
9575
9664
  };
9576
9665
  }
9577
9666
 
@@ -9581,7 +9670,7 @@
9581
9670
  }
9582
9671
 
9583
9672
  // node_modules/zod/v4/locales/ur.js
9584
- var error42 = () => {
9673
+ var error45 = () => {
9585
9674
  const Sizable = {
9586
9675
  string: { unit: "\u062D\u0631\u0648\u0641", verb: "\u06C1\u0648\u0646\u0627" },
9587
9676
  file: { unit: "\u0628\u0627\u0626\u0679\u0633", verb: "\u06C1\u0648\u0646\u0627" },
@@ -9687,17 +9776,18 @@
9687
9776
  };
9688
9777
  function ur_default() {
9689
9778
  return {
9690
- localeError: error42()
9779
+ localeError: error45()
9691
9780
  };
9692
9781
  }
9693
9782
 
9694
9783
  // node_modules/zod/v4/locales/uz.js
9695
- var error43 = () => {
9784
+ var error46 = () => {
9696
9785
  const Sizable = {
9697
9786
  string: { unit: "belgi", verb: "bo\u2018lishi kerak" },
9698
9787
  file: { unit: "bayt", verb: "bo\u2018lishi kerak" },
9699
9788
  array: { unit: "element", verb: "bo\u2018lishi kerak" },
9700
- set: { unit: "element", verb: "bo\u2018lishi kerak" }
9789
+ set: { unit: "element", verb: "bo\u2018lishi kerak" },
9790
+ map: { unit: "yozuv", verb: "bo\u2018lishi kerak" }
9701
9791
  };
9702
9792
  function getSizing(origin) {
9703
9793
  return Sizable[origin] ?? null;
@@ -9797,12 +9887,12 @@
9797
9887
  };
9798
9888
  function uz_default() {
9799
9889
  return {
9800
- localeError: error43()
9890
+ localeError: error46()
9801
9891
  };
9802
9892
  }
9803
9893
 
9804
9894
  // node_modules/zod/v4/locales/vi.js
9805
- var error44 = () => {
9895
+ var error47 = () => {
9806
9896
  const Sizable = {
9807
9897
  string: { unit: "k\xFD t\u1EF1", verb: "c\xF3" },
9808
9898
  file: { unit: "byte", verb: "c\xF3" },
@@ -9906,12 +9996,12 @@
9906
9996
  };
9907
9997
  function vi_default() {
9908
9998
  return {
9909
- localeError: error44()
9999
+ localeError: error47()
9910
10000
  };
9911
10001
  }
9912
10002
 
9913
10003
  // node_modules/zod/v4/locales/zh-CN.js
9914
- var error45 = () => {
10004
+ var error48 = () => {
9915
10005
  const Sizable = {
9916
10006
  string: { unit: "\u5B57\u7B26", verb: "\u5305\u542B" },
9917
10007
  file: { unit: "\u5B57\u8282", verb: "\u5305\u542B" },
@@ -10016,12 +10106,12 @@
10016
10106
  };
10017
10107
  function zh_CN_default() {
10018
10108
  return {
10019
- localeError: error45()
10109
+ localeError: error48()
10020
10110
  };
10021
10111
  }
10022
10112
 
10023
10113
  // node_modules/zod/v4/locales/zh-TW.js
10024
- var error46 = () => {
10114
+ var error49 = () => {
10025
10115
  const Sizable = {
10026
10116
  string: { unit: "\u5B57\u5143", verb: "\u64C1\u6709" },
10027
10117
  file: { unit: "\u4F4D\u5143\u7D44", verb: "\u64C1\u6709" },
@@ -10124,12 +10214,12 @@
10124
10214
  };
10125
10215
  function zh_TW_default() {
10126
10216
  return {
10127
- localeError: error46()
10217
+ localeError: error49()
10128
10218
  };
10129
10219
  }
10130
10220
 
10131
10221
  // node_modules/zod/v4/locales/yo.js
10132
- var error47 = () => {
10222
+ var error50 = () => {
10133
10223
  const Sizable = {
10134
10224
  string: { unit: "\xE0mi", verb: "n\xED" },
10135
10225
  file: { unit: "bytes", verb: "n\xED" },
@@ -10232,12 +10322,12 @@
10232
10322
  };
10233
10323
  function yo_default() {
10234
10324
  return {
10235
- localeError: error47()
10325
+ localeError: error50()
10236
10326
  };
10237
10327
  }
10238
10328
 
10239
10329
  // node_modules/zod/v4/core/registries.js
10240
- var _a;
10330
+ var _a2;
10241
10331
  var $output = /* @__PURE__ */ Symbol("ZodOutput");
10242
10332
  var $input = /* @__PURE__ */ Symbol("ZodInput");
10243
10333
  var $ZodRegistry = class {
@@ -10283,7 +10373,7 @@
10283
10373
  function registry() {
10284
10374
  return new $ZodRegistry();
10285
10375
  }
10286
- (_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
10376
+ (_a2 = globalThis).__zod_globalRegistry ?? (_a2.__zod_globalRegistry = registry());
10287
10377
  var globalRegistry = globalThis.__zod_globalRegistry;
10288
10378
 
10289
10379
  // node_modules/zod/v4/core/api.js
@@ -11201,7 +11291,7 @@
11201
11291
  return schema;
11202
11292
  }
11203
11293
  // @__NO_SIDE_EFFECTS__
11204
- function _superRefine(fn) {
11294
+ function _superRefine(fn, params) {
11205
11295
  const ch = /* @__PURE__ */ _check((payload) => {
11206
11296
  payload.addIssue = (issue2) => {
11207
11297
  if (typeof issue2 === "string") {
@@ -11218,7 +11308,7 @@
11218
11308
  }
11219
11309
  };
11220
11310
  return fn(payload.value, payload);
11221
- });
11311
+ }, params);
11222
11312
  return ch;
11223
11313
  }
11224
11314
  // @__NO_SIDE_EFFECTS__
@@ -11348,7 +11438,7 @@
11348
11438
  };
11349
11439
  }
11350
11440
  function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
11351
- var _a2;
11441
+ var _a3;
11352
11442
  const def = schema._zod.def;
11353
11443
  const seen = ctx.seen.get(schema);
11354
11444
  if (seen) {
@@ -11395,8 +11485,8 @@
11395
11485
  delete result.schema.examples;
11396
11486
  delete result.schema.default;
11397
11487
  }
11398
- if (ctx.io === "input" && result.schema._prefault)
11399
- (_a2 = result.schema).default ?? (_a2.default = result.schema._prefault);
11488
+ if (ctx.io === "input" && "_prefault" in result.schema)
11489
+ (_a3 = result.schema).default ?? (_a3.default = result.schema._prefault);
11400
11490
  delete result.schema._prefault;
11401
11491
  const _result = ctx.seen.get(schema);
11402
11492
  return _result.schema;
@@ -11577,10 +11667,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11577
11667
  result.$id = ctx.external.uri(id);
11578
11668
  }
11579
11669
  Object.assign(result, root.def ?? root.schema);
11670
+ const rootMetaId = ctx.metadataRegistry.get(schema)?.id;
11671
+ if (rootMetaId !== void 0 && result.id === rootMetaId)
11672
+ delete result.id;
11580
11673
  const defs = ctx.external?.defs ?? {};
11581
11674
  for (const entry of ctx.seen.entries()) {
11582
11675
  const seen = entry[1];
11583
11676
  if (seen.def && seen.defId) {
11677
+ if (seen.def.id === seen.defId)
11678
+ delete seen.def.id;
11584
11679
  defs[seen.defId] = seen.def;
11585
11680
  }
11586
11681
  }
@@ -11636,6 +11731,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11636
11731
  return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
11637
11732
  }
11638
11733
  if (def.type === "pipe") {
11734
+ if (_schema._zod.traits.has("$ZodCodec"))
11735
+ return true;
11639
11736
  return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
11640
11737
  }
11641
11738
  if (def.type === "object") {
@@ -11725,39 +11822,28 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11725
11822
  json2.type = "integer";
11726
11823
  else
11727
11824
  json2.type = "number";
11728
- if (typeof exclusiveMinimum === "number") {
11729
- if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
11825
+ const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
11826
+ const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
11827
+ const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
11828
+ if (exMin) {
11829
+ if (legacy) {
11730
11830
  json2.minimum = exclusiveMinimum;
11731
11831
  json2.exclusiveMinimum = true;
11732
11832
  } else {
11733
11833
  json2.exclusiveMinimum = exclusiveMinimum;
11734
11834
  }
11735
- }
11736
- if (typeof minimum === "number") {
11835
+ } else if (typeof minimum === "number") {
11737
11836
  json2.minimum = minimum;
11738
- if (typeof exclusiveMinimum === "number" && ctx.target !== "draft-04") {
11739
- if (exclusiveMinimum >= minimum)
11740
- delete json2.minimum;
11741
- else
11742
- delete json2.exclusiveMinimum;
11743
- }
11744
11837
  }
11745
- if (typeof exclusiveMaximum === "number") {
11746
- if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
11838
+ if (exMax) {
11839
+ if (legacy) {
11747
11840
  json2.maximum = exclusiveMaximum;
11748
11841
  json2.exclusiveMaximum = true;
11749
11842
  } else {
11750
11843
  json2.exclusiveMaximum = exclusiveMaximum;
11751
11844
  }
11752
- }
11753
- if (typeof maximum === "number") {
11845
+ } else if (typeof maximum === "number") {
11754
11846
  json2.maximum = maximum;
11755
- if (typeof exclusiveMaximum === "number" && ctx.target !== "draft-04") {
11756
- if (exclusiveMaximum <= maximum)
11757
- delete json2.maximum;
11758
- else
11759
- delete json2.exclusiveMaximum;
11760
- }
11761
11847
  }
11762
11848
  if (typeof multipleOf === "number")
11763
11849
  json2.multipleOf = multipleOf;
@@ -11929,7 +12015,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11929
12015
  if (typeof maximum === "number")
11930
12016
  json2.maxItems = maximum;
11931
12017
  json2.type = "array";
11932
- json2.items = process2(def.element, ctx, { ...params, path: [...params.path, "items"] });
12018
+ json2.items = process2(def.element, ctx, {
12019
+ ...params,
12020
+ path: [...params.path, "items"]
12021
+ });
11933
12022
  };
11934
12023
  var objectProcessor = (schema, ctx, _json, params) => {
11935
12024
  const json2 = _json;
@@ -12122,7 +12211,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
12122
12211
  };
12123
12212
  var pipeProcessor = (schema, ctx, _json, params) => {
12124
12213
  const def = schema._zod.def;
12125
- const innerType = ctx.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
12214
+ const inIsTransform = def.in._zod.traits.has("$ZodTransform");
12215
+ const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
12126
12216
  process2(innerType, ctx, params);
12127
12217
  const seen = ctx.seen.get(schema);
12128
12218
  seen.ref = innerType;
@@ -12356,6 +12446,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
12356
12446
  ZodOptional: () => ZodOptional,
12357
12447
  ZodPipe: () => ZodPipe,
12358
12448
  ZodPrefault: () => ZodPrefault,
12449
+ ZodPreprocess: () => ZodPreprocess,
12359
12450
  ZodPromise: () => ZodPromise,
12360
12451
  ZodReadonly: () => ZodReadonly,
12361
12452
  ZodRecord: () => ZodRecord,
@@ -12416,6 +12507,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
12416
12507
  int32: () => int32,
12417
12508
  int64: () => int64,
12418
12509
  intersection: () => intersection,
12510
+ invertCodec: () => invertCodec,
12419
12511
  ipv4: () => ipv42,
12420
12512
  ipv6: () => ipv62,
12421
12513
  json: () => json,
@@ -12585,8 +12677,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
12585
12677
  }
12586
12678
  });
12587
12679
  };
12588
- var ZodError = $constructor("ZodError", initializer2);
12589
- var ZodRealError = $constructor("ZodError", initializer2, {
12680
+ var ZodError = /* @__PURE__ */ $constructor("ZodError", initializer2);
12681
+ var ZodRealError = /* @__PURE__ */ $constructor("ZodError", initializer2, {
12590
12682
  Parent: Error
12591
12683
  });
12592
12684
 
@@ -12605,6 +12697,43 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
12605
12697
  var safeDecodeAsync2 = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
12606
12698
 
12607
12699
  // node_modules/zod/v4/classic/schemas.js
12700
+ var _installedGroups = /* @__PURE__ */ new WeakMap();
12701
+ function _installLazyMethods(inst, group, methods) {
12702
+ const proto = Object.getPrototypeOf(inst);
12703
+ let installed = _installedGroups.get(proto);
12704
+ if (!installed) {
12705
+ installed = /* @__PURE__ */ new Set();
12706
+ _installedGroups.set(proto, installed);
12707
+ }
12708
+ if (installed.has(group))
12709
+ return;
12710
+ installed.add(group);
12711
+ for (const key in methods) {
12712
+ const fn = methods[key];
12713
+ Object.defineProperty(proto, key, {
12714
+ configurable: true,
12715
+ enumerable: false,
12716
+ get() {
12717
+ const bound = fn.bind(this);
12718
+ Object.defineProperty(this, key, {
12719
+ configurable: true,
12720
+ writable: true,
12721
+ enumerable: true,
12722
+ value: bound
12723
+ });
12724
+ return bound;
12725
+ },
12726
+ set(v) {
12727
+ Object.defineProperty(this, key, {
12728
+ configurable: true,
12729
+ writable: true,
12730
+ enumerable: true,
12731
+ value: v
12732
+ });
12733
+ }
12734
+ });
12735
+ }
12736
+ }
12608
12737
  var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
12609
12738
  $ZodType.init(inst, def);
12610
12739
  Object.assign(inst["~standard"], {
@@ -12613,79 +12742,125 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
12613
12742
  output: createStandardJSONSchemaMethod(inst, "output")
12614
12743
  }
12615
12744
  });
12616
- inst.toJSONSchema = createToJSONSchemaMethod(inst, {});
12617
- inst.def = def;
12618
- inst.type = def.type;
12619
- Object.defineProperty(inst, "_def", { value: def });
12620
- inst.check = (...checks) => {
12621
- return inst.clone(util_exports.mergeDefs(def, {
12622
- checks: [
12623
- ...def.checks ?? [],
12624
- ...checks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch)
12625
- ]
12626
- }), {
12627
- parent: true
12628
- });
12629
- };
12630
- inst.with = inst.check;
12631
- inst.clone = (def2, params) => clone(inst, def2, params);
12632
- inst.brand = () => inst;
12633
- inst.register = ((reg, meta3) => {
12634
- reg.add(inst, meta3);
12635
- return inst;
12636
- });
12637
- inst.parse = (data, params) => parse2(inst, data, params, { callee: inst.parse });
12638
- inst.safeParse = (data, params) => safeParse2(inst, data, params);
12639
- inst.parseAsync = async (data, params) => parseAsync2(inst, data, params, { callee: inst.parseAsync });
12640
- inst.safeParseAsync = async (data, params) => safeParseAsync2(inst, data, params);
12641
- inst.spa = inst.safeParseAsync;
12642
- inst.encode = (data, params) => encode2(inst, data, params);
12643
- inst.decode = (data, params) => decode2(inst, data, params);
12644
- inst.encodeAsync = async (data, params) => encodeAsync2(inst, data, params);
12645
- inst.decodeAsync = async (data, params) => decodeAsync2(inst, data, params);
12646
- inst.safeEncode = (data, params) => safeEncode2(inst, data, params);
12647
- inst.safeDecode = (data, params) => safeDecode2(inst, data, params);
12648
- inst.safeEncodeAsync = async (data, params) => safeEncodeAsync2(inst, data, params);
12649
- inst.safeDecodeAsync = async (data, params) => safeDecodeAsync2(inst, data, params);
12650
- inst.refine = (check2, params) => inst.check(refine(check2, params));
12651
- inst.superRefine = (refinement) => inst.check(superRefine(refinement));
12652
- inst.overwrite = (fn) => inst.check(_overwrite(fn));
12653
- inst.optional = () => optional(inst);
12654
- inst.exactOptional = () => exactOptional(inst);
12655
- inst.nullable = () => nullable(inst);
12656
- inst.nullish = () => optional(nullable(inst));
12657
- inst.nonoptional = (params) => nonoptional(inst, params);
12658
- inst.array = () => array(inst);
12659
- inst.or = (arg) => union([inst, arg]);
12660
- inst.and = (arg) => intersection(inst, arg);
12661
- inst.transform = (tx) => pipe(inst, transform(tx));
12662
- inst.default = (def2) => _default2(inst, def2);
12663
- inst.prefault = (def2) => prefault(inst, def2);
12664
- inst.catch = (params) => _catch2(inst, params);
12665
- inst.pipe = (target) => pipe(inst, target);
12666
- inst.readonly = () => readonly(inst);
12667
- inst.describe = (description) => {
12668
- const cl = inst.clone();
12669
- globalRegistry.add(cl, { description });
12670
- return cl;
12671
- };
12745
+ inst.toJSONSchema = createToJSONSchemaMethod(inst, {});
12746
+ inst.def = def;
12747
+ inst.type = def.type;
12748
+ Object.defineProperty(inst, "_def", { value: def });
12749
+ inst.parse = (data, params) => parse2(inst, data, params, { callee: inst.parse });
12750
+ inst.safeParse = (data, params) => safeParse2(inst, data, params);
12751
+ inst.parseAsync = async (data, params) => parseAsync2(inst, data, params, { callee: inst.parseAsync });
12752
+ inst.safeParseAsync = async (data, params) => safeParseAsync2(inst, data, params);
12753
+ inst.spa = inst.safeParseAsync;
12754
+ inst.encode = (data, params) => encode2(inst, data, params);
12755
+ inst.decode = (data, params) => decode2(inst, data, params);
12756
+ inst.encodeAsync = async (data, params) => encodeAsync2(inst, data, params);
12757
+ inst.decodeAsync = async (data, params) => decodeAsync2(inst, data, params);
12758
+ inst.safeEncode = (data, params) => safeEncode2(inst, data, params);
12759
+ inst.safeDecode = (data, params) => safeDecode2(inst, data, params);
12760
+ inst.safeEncodeAsync = async (data, params) => safeEncodeAsync2(inst, data, params);
12761
+ inst.safeDecodeAsync = async (data, params) => safeDecodeAsync2(inst, data, params);
12762
+ _installLazyMethods(inst, "ZodType", {
12763
+ check(...chks) {
12764
+ const def2 = this.def;
12765
+ return this.clone(util_exports.mergeDefs(def2, {
12766
+ checks: [
12767
+ ...def2.checks ?? [],
12768
+ ...chks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch)
12769
+ ]
12770
+ }), { parent: true });
12771
+ },
12772
+ with(...chks) {
12773
+ return this.check(...chks);
12774
+ },
12775
+ clone(def2, params) {
12776
+ return clone(this, def2, params);
12777
+ },
12778
+ brand() {
12779
+ return this;
12780
+ },
12781
+ register(reg, meta3) {
12782
+ reg.add(this, meta3);
12783
+ return this;
12784
+ },
12785
+ refine(check2, params) {
12786
+ return this.check(refine(check2, params));
12787
+ },
12788
+ superRefine(refinement, params) {
12789
+ return this.check(superRefine(refinement, params));
12790
+ },
12791
+ overwrite(fn) {
12792
+ return this.check(_overwrite(fn));
12793
+ },
12794
+ optional() {
12795
+ return optional(this);
12796
+ },
12797
+ exactOptional() {
12798
+ return exactOptional(this);
12799
+ },
12800
+ nullable() {
12801
+ return nullable(this);
12802
+ },
12803
+ nullish() {
12804
+ return optional(nullable(this));
12805
+ },
12806
+ nonoptional(params) {
12807
+ return nonoptional(this, params);
12808
+ },
12809
+ array() {
12810
+ return array(this);
12811
+ },
12812
+ or(arg) {
12813
+ return union([this, arg]);
12814
+ },
12815
+ and(arg) {
12816
+ return intersection(this, arg);
12817
+ },
12818
+ transform(tx) {
12819
+ return pipe(this, transform(tx));
12820
+ },
12821
+ default(d) {
12822
+ return _default2(this, d);
12823
+ },
12824
+ prefault(d) {
12825
+ return prefault(this, d);
12826
+ },
12827
+ catch(params) {
12828
+ return _catch2(this, params);
12829
+ },
12830
+ pipe(target) {
12831
+ return pipe(this, target);
12832
+ },
12833
+ readonly() {
12834
+ return readonly(this);
12835
+ },
12836
+ describe(description) {
12837
+ const cl = this.clone();
12838
+ globalRegistry.add(cl, { description });
12839
+ return cl;
12840
+ },
12841
+ meta(...args) {
12842
+ if (args.length === 0)
12843
+ return globalRegistry.get(this);
12844
+ const cl = this.clone();
12845
+ globalRegistry.add(cl, args[0]);
12846
+ return cl;
12847
+ },
12848
+ isOptional() {
12849
+ return this.safeParse(void 0).success;
12850
+ },
12851
+ isNullable() {
12852
+ return this.safeParse(null).success;
12853
+ },
12854
+ apply(fn) {
12855
+ return fn(this);
12856
+ }
12857
+ });
12672
12858
  Object.defineProperty(inst, "description", {
12673
12859
  get() {
12674
12860
  return globalRegistry.get(inst)?.description;
12675
12861
  },
12676
12862
  configurable: true
12677
12863
  });
12678
- inst.meta = (...args) => {
12679
- if (args.length === 0) {
12680
- return globalRegistry.get(inst);
12681
- }
12682
- const cl = inst.clone();
12683
- globalRegistry.add(cl, args[0]);
12684
- return cl;
12685
- };
12686
- inst.isOptional = () => inst.safeParse(void 0).success;
12687
- inst.isNullable = () => inst.safeParse(null).success;
12688
- inst.apply = (fn) => fn(inst);
12689
12864
  return inst;
12690
12865
  });
12691
12866
  var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
@@ -12696,21 +12871,53 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
12696
12871
  inst.format = bag.format ?? null;
12697
12872
  inst.minLength = bag.minimum ?? null;
12698
12873
  inst.maxLength = bag.maximum ?? null;
12699
- inst.regex = (...args) => inst.check(_regex(...args));
12700
- inst.includes = (...args) => inst.check(_includes(...args));
12701
- inst.startsWith = (...args) => inst.check(_startsWith(...args));
12702
- inst.endsWith = (...args) => inst.check(_endsWith(...args));
12703
- inst.min = (...args) => inst.check(_minLength(...args));
12704
- inst.max = (...args) => inst.check(_maxLength(...args));
12705
- inst.length = (...args) => inst.check(_length(...args));
12706
- inst.nonempty = (...args) => inst.check(_minLength(1, ...args));
12707
- inst.lowercase = (params) => inst.check(_lowercase(params));
12708
- inst.uppercase = (params) => inst.check(_uppercase(params));
12709
- inst.trim = () => inst.check(_trim());
12710
- inst.normalize = (...args) => inst.check(_normalize(...args));
12711
- inst.toLowerCase = () => inst.check(_toLowerCase());
12712
- inst.toUpperCase = () => inst.check(_toUpperCase());
12713
- inst.slugify = () => inst.check(_slugify());
12874
+ _installLazyMethods(inst, "_ZodString", {
12875
+ regex(...args) {
12876
+ return this.check(_regex(...args));
12877
+ },
12878
+ includes(...args) {
12879
+ return this.check(_includes(...args));
12880
+ },
12881
+ startsWith(...args) {
12882
+ return this.check(_startsWith(...args));
12883
+ },
12884
+ endsWith(...args) {
12885
+ return this.check(_endsWith(...args));
12886
+ },
12887
+ min(...args) {
12888
+ return this.check(_minLength(...args));
12889
+ },
12890
+ max(...args) {
12891
+ return this.check(_maxLength(...args));
12892
+ },
12893
+ length(...args) {
12894
+ return this.check(_length(...args));
12895
+ },
12896
+ nonempty(...args) {
12897
+ return this.check(_minLength(1, ...args));
12898
+ },
12899
+ lowercase(params) {
12900
+ return this.check(_lowercase(params));
12901
+ },
12902
+ uppercase(params) {
12903
+ return this.check(_uppercase(params));
12904
+ },
12905
+ trim() {
12906
+ return this.check(_trim());
12907
+ },
12908
+ normalize(...args) {
12909
+ return this.check(_normalize(...args));
12910
+ },
12911
+ toLowerCase() {
12912
+ return this.check(_toLowerCase());
12913
+ },
12914
+ toUpperCase() {
12915
+ return this.check(_toUpperCase());
12916
+ },
12917
+ slugify() {
12918
+ return this.check(_slugify());
12919
+ }
12920
+ });
12714
12921
  });
12715
12922
  var ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
12716
12923
  $ZodString.init(inst, def);
@@ -12789,7 +12996,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
12789
12996
  }
12790
12997
  function httpUrl(params) {
12791
12998
  return _url(ZodURL, {
12792
- protocol: /^https?$/,
12999
+ protocol: regexes_exports.httpProtocol,
12793
13000
  hostname: regexes_exports.domain,
12794
13001
  ...util_exports.normalizeParams(params)
12795
13002
  });
@@ -12931,21 +13138,53 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
12931
13138
  $ZodNumber.init(inst, def);
12932
13139
  ZodType.init(inst, def);
12933
13140
  inst._zod.processJSONSchema = (ctx, json2, params) => numberProcessor(inst, ctx, json2, params);
12934
- inst.gt = (value, params) => inst.check(_gt(value, params));
12935
- inst.gte = (value, params) => inst.check(_gte(value, params));
12936
- inst.min = (value, params) => inst.check(_gte(value, params));
12937
- inst.lt = (value, params) => inst.check(_lt(value, params));
12938
- inst.lte = (value, params) => inst.check(_lte(value, params));
12939
- inst.max = (value, params) => inst.check(_lte(value, params));
12940
- inst.int = (params) => inst.check(int(params));
12941
- inst.safe = (params) => inst.check(int(params));
12942
- inst.positive = (params) => inst.check(_gt(0, params));
12943
- inst.nonnegative = (params) => inst.check(_gte(0, params));
12944
- inst.negative = (params) => inst.check(_lt(0, params));
12945
- inst.nonpositive = (params) => inst.check(_lte(0, params));
12946
- inst.multipleOf = (value, params) => inst.check(_multipleOf(value, params));
12947
- inst.step = (value, params) => inst.check(_multipleOf(value, params));
12948
- inst.finite = () => inst;
13141
+ _installLazyMethods(inst, "ZodNumber", {
13142
+ gt(value, params) {
13143
+ return this.check(_gt(value, params));
13144
+ },
13145
+ gte(value, params) {
13146
+ return this.check(_gte(value, params));
13147
+ },
13148
+ min(value, params) {
13149
+ return this.check(_gte(value, params));
13150
+ },
13151
+ lt(value, params) {
13152
+ return this.check(_lt(value, params));
13153
+ },
13154
+ lte(value, params) {
13155
+ return this.check(_lte(value, params));
13156
+ },
13157
+ max(value, params) {
13158
+ return this.check(_lte(value, params));
13159
+ },
13160
+ int(params) {
13161
+ return this.check(int(params));
13162
+ },
13163
+ safe(params) {
13164
+ return this.check(int(params));
13165
+ },
13166
+ positive(params) {
13167
+ return this.check(_gt(0, params));
13168
+ },
13169
+ nonnegative(params) {
13170
+ return this.check(_gte(0, params));
13171
+ },
13172
+ negative(params) {
13173
+ return this.check(_lt(0, params));
13174
+ },
13175
+ nonpositive(params) {
13176
+ return this.check(_lte(0, params));
13177
+ },
13178
+ multipleOf(value, params) {
13179
+ return this.check(_multipleOf(value, params));
13180
+ },
13181
+ step(value, params) {
13182
+ return this.check(_multipleOf(value, params));
13183
+ },
13184
+ finite() {
13185
+ return this;
13186
+ }
13187
+ });
12949
13188
  const bag = inst._zod.bag;
12950
13189
  inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
12951
13190
  inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
@@ -13092,11 +13331,23 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
13092
13331
  ZodType.init(inst, def);
13093
13332
  inst._zod.processJSONSchema = (ctx, json2, params) => arrayProcessor(inst, ctx, json2, params);
13094
13333
  inst.element = def.element;
13095
- inst.min = (minLength, params) => inst.check(_minLength(minLength, params));
13096
- inst.nonempty = (params) => inst.check(_minLength(1, params));
13097
- inst.max = (maxLength, params) => inst.check(_maxLength(maxLength, params));
13098
- inst.length = (len, params) => inst.check(_length(len, params));
13099
- inst.unwrap = () => inst.element;
13334
+ _installLazyMethods(inst, "ZodArray", {
13335
+ min(n, params) {
13336
+ return this.check(_minLength(n, params));
13337
+ },
13338
+ nonempty(params) {
13339
+ return this.check(_minLength(1, params));
13340
+ },
13341
+ max(n, params) {
13342
+ return this.check(_maxLength(n, params));
13343
+ },
13344
+ length(n, params) {
13345
+ return this.check(_length(n, params));
13346
+ },
13347
+ unwrap() {
13348
+ return this.element;
13349
+ }
13350
+ });
13100
13351
  });
13101
13352
  function array(element, params) {
13102
13353
  return _array(ZodArray, element, params);
@@ -13112,23 +13363,47 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
13112
13363
  util_exports.defineLazy(inst, "shape", () => {
13113
13364
  return def.shape;
13114
13365
  });
13115
- inst.keyof = () => _enum2(Object.keys(inst._zod.def.shape));
13116
- inst.catchall = (catchall) => inst.clone({ ...inst._zod.def, catchall });
13117
- inst.passthrough = () => inst.clone({ ...inst._zod.def, catchall: unknown() });
13118
- inst.loose = () => inst.clone({ ...inst._zod.def, catchall: unknown() });
13119
- inst.strict = () => inst.clone({ ...inst._zod.def, catchall: never() });
13120
- inst.strip = () => inst.clone({ ...inst._zod.def, catchall: void 0 });
13121
- inst.extend = (incoming) => {
13122
- return util_exports.extend(inst, incoming);
13123
- };
13124
- inst.safeExtend = (incoming) => {
13125
- return util_exports.safeExtend(inst, incoming);
13126
- };
13127
- inst.merge = (other) => util_exports.merge(inst, other);
13128
- inst.pick = (mask) => util_exports.pick(inst, mask);
13129
- inst.omit = (mask) => util_exports.omit(inst, mask);
13130
- inst.partial = (...args) => util_exports.partial(ZodOptional, inst, args[0]);
13131
- inst.required = (...args) => util_exports.required(ZodNonOptional, inst, args[0]);
13366
+ _installLazyMethods(inst, "ZodObject", {
13367
+ keyof() {
13368
+ return _enum2(Object.keys(this._zod.def.shape));
13369
+ },
13370
+ catchall(catchall) {
13371
+ return this.clone({ ...this._zod.def, catchall });
13372
+ },
13373
+ passthrough() {
13374
+ return this.clone({ ...this._zod.def, catchall: unknown() });
13375
+ },
13376
+ loose() {
13377
+ return this.clone({ ...this._zod.def, catchall: unknown() });
13378
+ },
13379
+ strict() {
13380
+ return this.clone({ ...this._zod.def, catchall: never() });
13381
+ },
13382
+ strip() {
13383
+ return this.clone({ ...this._zod.def, catchall: void 0 });
13384
+ },
13385
+ extend(incoming) {
13386
+ return util_exports.extend(this, incoming);
13387
+ },
13388
+ safeExtend(incoming) {
13389
+ return util_exports.safeExtend(this, incoming);
13390
+ },
13391
+ merge(other) {
13392
+ return util_exports.merge(this, other);
13393
+ },
13394
+ pick(mask) {
13395
+ return util_exports.pick(this, mask);
13396
+ },
13397
+ omit(mask) {
13398
+ return util_exports.omit(this, mask);
13399
+ },
13400
+ partial(...args) {
13401
+ return util_exports.partial(ZodOptional, this, args[0]);
13402
+ },
13403
+ required(...args) {
13404
+ return util_exports.required(ZodNonOptional, this, args[0]);
13405
+ }
13406
+ });
13132
13407
  });
13133
13408
  function object(shape, params) {
13134
13409
  const def = {
@@ -13233,6 +13508,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
13233
13508
  inst.valueType = def.valueType;
13234
13509
  });
13235
13510
  function record(keyType, valueType, params) {
13511
+ if (!valueType || !valueType._zod) {
13512
+ return new ZodRecord({
13513
+ type: "record",
13514
+ keyType: string2(),
13515
+ valueType: keyType,
13516
+ ...util_exports.normalizeParams(valueType)
13517
+ });
13518
+ }
13236
13519
  return new ZodRecord({
13237
13520
  type: "record",
13238
13521
  keyType,
@@ -13404,10 +13687,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
13404
13687
  if (output instanceof Promise) {
13405
13688
  return output.then((output2) => {
13406
13689
  payload.value = output2;
13690
+ payload.fallback = true;
13407
13691
  return payload;
13408
13692
  });
13409
13693
  }
13410
13694
  payload.value = output;
13695
+ payload.fallback = true;
13411
13696
  return payload;
13412
13697
  };
13413
13698
  });
@@ -13562,6 +13847,20 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
13562
13847
  reverseTransform: params.encode
13563
13848
  });
13564
13849
  }
13850
+ function invertCodec(codec2) {
13851
+ const def = codec2._zod.def;
13852
+ return new ZodCodec({
13853
+ type: "pipe",
13854
+ in: def.out,
13855
+ out: def.in,
13856
+ transform: def.reverseTransform,
13857
+ reverseTransform: def.transform
13858
+ });
13859
+ }
13860
+ var ZodPreprocess = /* @__PURE__ */ $constructor("ZodPreprocess", (inst, def) => {
13861
+ ZodPipe.init(inst, def);
13862
+ $ZodPreprocess.init(inst, def);
13863
+ });
13565
13864
  var ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => {
13566
13865
  $ZodReadonly.init(inst, def);
13567
13866
  ZodType.init(inst, def);
@@ -13641,8 +13940,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
13641
13940
  function refine(fn, _params = {}) {
13642
13941
  return _refine(ZodCustom, fn, _params);
13643
13942
  }
13644
- function superRefine(fn) {
13645
- return _superRefine(fn);
13943
+ function superRefine(fn, params) {
13944
+ return _superRefine(fn, params);
13646
13945
  }
13647
13946
  var describe2 = describe;
13648
13947
  var meta2 = meta;
@@ -13665,551 +13964,1001 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
13665
13964
  path: [...inst._zod.def.path ?? []]
13666
13965
  });
13667
13966
  }
13668
- };
13669
- return inst;
13670
- }
13671
- var stringbool = (...args) => _stringbool({
13672
- Codec: ZodCodec,
13673
- Boolean: ZodBoolean,
13674
- String: ZodString
13675
- }, ...args);
13676
- function json(params) {
13677
- const jsonSchema = lazy(() => {
13678
- return union([string2(params), number2(), boolean2(), _null3(), array(jsonSchema), record(string2(), jsonSchema)]);
13679
- });
13680
- return jsonSchema;
13681
- }
13682
- function preprocess(fn, schema) {
13683
- return pipe(transform(fn), schema);
13684
- }
13685
-
13686
- // node_modules/zod/v4/classic/compat.js
13687
- var ZodIssueCode = {
13688
- invalid_type: "invalid_type",
13689
- too_big: "too_big",
13690
- too_small: "too_small",
13691
- invalid_format: "invalid_format",
13692
- not_multiple_of: "not_multiple_of",
13693
- unrecognized_keys: "unrecognized_keys",
13694
- invalid_union: "invalid_union",
13695
- invalid_key: "invalid_key",
13696
- invalid_element: "invalid_element",
13697
- invalid_value: "invalid_value",
13698
- custom: "custom"
13699
- };
13700
- function setErrorMap(map2) {
13701
- config({
13702
- customError: map2
13703
- });
13704
- }
13705
- function getErrorMap() {
13706
- return config().customError;
13967
+ };
13968
+ return inst;
13969
+ }
13970
+ var stringbool = (...args) => _stringbool({
13971
+ Codec: ZodCodec,
13972
+ Boolean: ZodBoolean,
13973
+ String: ZodString
13974
+ }, ...args);
13975
+ function json(params) {
13976
+ const jsonSchema = lazy(() => {
13977
+ return union([string2(params), number2(), boolean2(), _null3(), array(jsonSchema), record(string2(), jsonSchema)]);
13978
+ });
13979
+ return jsonSchema;
13980
+ }
13981
+ function preprocess(fn, schema) {
13982
+ return new ZodPreprocess({
13983
+ type: "pipe",
13984
+ in: transform(fn),
13985
+ out: schema
13986
+ });
13987
+ }
13988
+
13989
+ // node_modules/zod/v4/classic/compat.js
13990
+ var ZodIssueCode = {
13991
+ invalid_type: "invalid_type",
13992
+ too_big: "too_big",
13993
+ too_small: "too_small",
13994
+ invalid_format: "invalid_format",
13995
+ not_multiple_of: "not_multiple_of",
13996
+ unrecognized_keys: "unrecognized_keys",
13997
+ invalid_union: "invalid_union",
13998
+ invalid_key: "invalid_key",
13999
+ invalid_element: "invalid_element",
14000
+ invalid_value: "invalid_value",
14001
+ custom: "custom"
14002
+ };
14003
+ function setErrorMap(map2) {
14004
+ config({
14005
+ customError: map2
14006
+ });
14007
+ }
14008
+ function getErrorMap() {
14009
+ return config().customError;
14010
+ }
14011
+ var ZodFirstPartyTypeKind;
14012
+ /* @__PURE__ */ (function(ZodFirstPartyTypeKind2) {
14013
+ })(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
14014
+
14015
+ // node_modules/zod/v4/classic/from-json-schema.js
14016
+ var z = {
14017
+ ...schemas_exports2,
14018
+ ...checks_exports2,
14019
+ iso: iso_exports
14020
+ };
14021
+ var RECOGNIZED_KEYS = /* @__PURE__ */ new Set([
14022
+ // Schema identification
14023
+ "$schema",
14024
+ "$ref",
14025
+ "$defs",
14026
+ "definitions",
14027
+ // Core schema keywords
14028
+ "$id",
14029
+ "id",
14030
+ "$comment",
14031
+ "$anchor",
14032
+ "$vocabulary",
14033
+ "$dynamicRef",
14034
+ "$dynamicAnchor",
14035
+ // Type
14036
+ "type",
14037
+ "enum",
14038
+ "const",
14039
+ // Composition
14040
+ "anyOf",
14041
+ "oneOf",
14042
+ "allOf",
14043
+ "not",
14044
+ // Object
14045
+ "properties",
14046
+ "required",
14047
+ "additionalProperties",
14048
+ "patternProperties",
14049
+ "propertyNames",
14050
+ "minProperties",
14051
+ "maxProperties",
14052
+ // Array
14053
+ "items",
14054
+ "prefixItems",
14055
+ "additionalItems",
14056
+ "minItems",
14057
+ "maxItems",
14058
+ "uniqueItems",
14059
+ "contains",
14060
+ "minContains",
14061
+ "maxContains",
14062
+ // String
14063
+ "minLength",
14064
+ "maxLength",
14065
+ "pattern",
14066
+ "format",
14067
+ // Number
14068
+ "minimum",
14069
+ "maximum",
14070
+ "exclusiveMinimum",
14071
+ "exclusiveMaximum",
14072
+ "multipleOf",
14073
+ // Already handled metadata
14074
+ "description",
14075
+ "default",
14076
+ // Content
14077
+ "contentEncoding",
14078
+ "contentMediaType",
14079
+ "contentSchema",
14080
+ // Unsupported (error-throwing)
14081
+ "unevaluatedItems",
14082
+ "unevaluatedProperties",
14083
+ "if",
14084
+ "then",
14085
+ "else",
14086
+ "dependentSchemas",
14087
+ "dependentRequired",
14088
+ // OpenAPI
14089
+ "nullable",
14090
+ "readOnly"
14091
+ ]);
14092
+ function detectVersion(schema, defaultTarget) {
14093
+ const $schema = schema.$schema;
14094
+ if ($schema === "https://json-schema.org/draft/2020-12/schema") {
14095
+ return "draft-2020-12";
14096
+ }
14097
+ if ($schema === "http://json-schema.org/draft-07/schema#") {
14098
+ return "draft-7";
14099
+ }
14100
+ if ($schema === "http://json-schema.org/draft-04/schema#") {
14101
+ return "draft-4";
14102
+ }
14103
+ return defaultTarget ?? "draft-2020-12";
14104
+ }
14105
+ function resolveRef(ref, ctx) {
14106
+ if (!ref.startsWith("#")) {
14107
+ throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
14108
+ }
14109
+ const path = ref.slice(1).split("/").filter(Boolean);
14110
+ if (path.length === 0) {
14111
+ return ctx.rootSchema;
14112
+ }
14113
+ const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
14114
+ if (path[0] === defsKey) {
14115
+ const key = path[1];
14116
+ if (!key || !ctx.defs[key]) {
14117
+ throw new Error(`Reference not found: ${ref}`);
14118
+ }
14119
+ return ctx.defs[key];
14120
+ }
14121
+ throw new Error(`Reference not found: ${ref}`);
14122
+ }
14123
+ function convertBaseSchema(schema, ctx) {
14124
+ if (schema.not !== void 0) {
14125
+ if (typeof schema.not === "object" && Object.keys(schema.not).length === 0) {
14126
+ return z.never();
14127
+ }
14128
+ throw new Error("not is not supported in Zod (except { not: {} } for never)");
14129
+ }
14130
+ if (schema.unevaluatedItems !== void 0) {
14131
+ throw new Error("unevaluatedItems is not supported");
14132
+ }
14133
+ if (schema.unevaluatedProperties !== void 0) {
14134
+ throw new Error("unevaluatedProperties is not supported");
14135
+ }
14136
+ if (schema.if !== void 0 || schema.then !== void 0 || schema.else !== void 0) {
14137
+ throw new Error("Conditional schemas (if/then/else) are not supported");
14138
+ }
14139
+ if (schema.dependentSchemas !== void 0 || schema.dependentRequired !== void 0) {
14140
+ throw new Error("dependentSchemas and dependentRequired are not supported");
14141
+ }
14142
+ if (schema.$ref) {
14143
+ const refPath = schema.$ref;
14144
+ if (ctx.refs.has(refPath)) {
14145
+ return ctx.refs.get(refPath);
14146
+ }
14147
+ if (ctx.processing.has(refPath)) {
14148
+ return z.lazy(() => {
14149
+ if (!ctx.refs.has(refPath)) {
14150
+ throw new Error(`Circular reference not resolved: ${refPath}`);
14151
+ }
14152
+ return ctx.refs.get(refPath);
14153
+ });
14154
+ }
14155
+ ctx.processing.add(refPath);
14156
+ const resolved = resolveRef(refPath, ctx);
14157
+ const zodSchema2 = convertSchema(resolved, ctx);
14158
+ ctx.refs.set(refPath, zodSchema2);
14159
+ ctx.processing.delete(refPath);
14160
+ return zodSchema2;
14161
+ }
14162
+ if (schema.enum !== void 0) {
14163
+ const enumValues = schema.enum;
14164
+ if (ctx.version === "openapi-3.0" && schema.nullable === true && enumValues.length === 1 && enumValues[0] === null) {
14165
+ return z.null();
14166
+ }
14167
+ if (enumValues.length === 0) {
14168
+ return z.never();
14169
+ }
14170
+ if (enumValues.length === 1) {
14171
+ return z.literal(enumValues[0]);
14172
+ }
14173
+ if (enumValues.every((v) => typeof v === "string")) {
14174
+ return z.enum(enumValues);
14175
+ }
14176
+ const literalSchemas = enumValues.map((v) => z.literal(v));
14177
+ if (literalSchemas.length < 2) {
14178
+ return literalSchemas[0];
14179
+ }
14180
+ return z.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
14181
+ }
14182
+ if (schema.const !== void 0) {
14183
+ return z.literal(schema.const);
14184
+ }
14185
+ const type = schema.type;
14186
+ if (Array.isArray(type)) {
14187
+ const typeSchemas = type.map((t) => {
14188
+ const typeSchema = { ...schema, type: t };
14189
+ return convertBaseSchema(typeSchema, ctx);
14190
+ });
14191
+ if (typeSchemas.length === 0) {
14192
+ return z.never();
14193
+ }
14194
+ if (typeSchemas.length === 1) {
14195
+ return typeSchemas[0];
14196
+ }
14197
+ return z.union(typeSchemas);
14198
+ }
14199
+ if (!type) {
14200
+ return z.any();
14201
+ }
14202
+ let zodSchema;
14203
+ switch (type) {
14204
+ case "string": {
14205
+ let stringSchema = z.string();
14206
+ if (schema.format) {
14207
+ const format = schema.format;
14208
+ if (format === "email") {
14209
+ stringSchema = stringSchema.check(z.email());
14210
+ } else if (format === "uri" || format === "uri-reference") {
14211
+ stringSchema = stringSchema.check(z.url());
14212
+ } else if (format === "uuid" || format === "guid") {
14213
+ stringSchema = stringSchema.check(z.uuid());
14214
+ } else if (format === "date-time") {
14215
+ stringSchema = stringSchema.check(z.iso.datetime());
14216
+ } else if (format === "date") {
14217
+ stringSchema = stringSchema.check(z.iso.date());
14218
+ } else if (format === "time") {
14219
+ stringSchema = stringSchema.check(z.iso.time());
14220
+ } else if (format === "duration") {
14221
+ stringSchema = stringSchema.check(z.iso.duration());
14222
+ } else if (format === "ipv4") {
14223
+ stringSchema = stringSchema.check(z.ipv4());
14224
+ } else if (format === "ipv6") {
14225
+ stringSchema = stringSchema.check(z.ipv6());
14226
+ } else if (format === "mac") {
14227
+ stringSchema = stringSchema.check(z.mac());
14228
+ } else if (format === "cidr") {
14229
+ stringSchema = stringSchema.check(z.cidrv4());
14230
+ } else if (format === "cidr-v6") {
14231
+ stringSchema = stringSchema.check(z.cidrv6());
14232
+ } else if (format === "base64") {
14233
+ stringSchema = stringSchema.check(z.base64());
14234
+ } else if (format === "base64url") {
14235
+ stringSchema = stringSchema.check(z.base64url());
14236
+ } else if (format === "e164") {
14237
+ stringSchema = stringSchema.check(z.e164());
14238
+ } else if (format === "jwt") {
14239
+ stringSchema = stringSchema.check(z.jwt());
14240
+ } else if (format === "emoji") {
14241
+ stringSchema = stringSchema.check(z.emoji());
14242
+ } else if (format === "nanoid") {
14243
+ stringSchema = stringSchema.check(z.nanoid());
14244
+ } else if (format === "cuid") {
14245
+ stringSchema = stringSchema.check(z.cuid());
14246
+ } else if (format === "cuid2") {
14247
+ stringSchema = stringSchema.check(z.cuid2());
14248
+ } else if (format === "ulid") {
14249
+ stringSchema = stringSchema.check(z.ulid());
14250
+ } else if (format === "xid") {
14251
+ stringSchema = stringSchema.check(z.xid());
14252
+ } else if (format === "ksuid") {
14253
+ stringSchema = stringSchema.check(z.ksuid());
14254
+ }
14255
+ }
14256
+ if (typeof schema.minLength === "number") {
14257
+ stringSchema = stringSchema.min(schema.minLength);
14258
+ }
14259
+ if (typeof schema.maxLength === "number") {
14260
+ stringSchema = stringSchema.max(schema.maxLength);
14261
+ }
14262
+ if (schema.pattern) {
14263
+ stringSchema = stringSchema.regex(new RegExp(schema.pattern));
14264
+ }
14265
+ zodSchema = stringSchema;
14266
+ break;
14267
+ }
14268
+ case "number":
14269
+ case "integer": {
14270
+ let numberSchema = type === "integer" ? z.number().int() : z.number();
14271
+ if (typeof schema.minimum === "number") {
14272
+ numberSchema = numberSchema.min(schema.minimum);
14273
+ }
14274
+ if (typeof schema.maximum === "number") {
14275
+ numberSchema = numberSchema.max(schema.maximum);
14276
+ }
14277
+ if (typeof schema.exclusiveMinimum === "number") {
14278
+ numberSchema = numberSchema.gt(schema.exclusiveMinimum);
14279
+ } else if (schema.exclusiveMinimum === true && typeof schema.minimum === "number") {
14280
+ numberSchema = numberSchema.gt(schema.minimum);
14281
+ }
14282
+ if (typeof schema.exclusiveMaximum === "number") {
14283
+ numberSchema = numberSchema.lt(schema.exclusiveMaximum);
14284
+ } else if (schema.exclusiveMaximum === true && typeof schema.maximum === "number") {
14285
+ numberSchema = numberSchema.lt(schema.maximum);
14286
+ }
14287
+ if (typeof schema.multipleOf === "number") {
14288
+ numberSchema = numberSchema.multipleOf(schema.multipleOf);
14289
+ }
14290
+ zodSchema = numberSchema;
14291
+ break;
14292
+ }
14293
+ case "boolean": {
14294
+ zodSchema = z.boolean();
14295
+ break;
14296
+ }
14297
+ case "null": {
14298
+ zodSchema = z.null();
14299
+ break;
14300
+ }
14301
+ case "object": {
14302
+ const shape = {};
14303
+ const properties = schema.properties || {};
14304
+ const requiredSet = new Set(schema.required || []);
14305
+ for (const [key, propSchema] of Object.entries(properties)) {
14306
+ const propZodSchema = convertSchema(propSchema, ctx);
14307
+ shape[key] = requiredSet.has(key) ? propZodSchema : propZodSchema.optional();
14308
+ }
14309
+ if (schema.propertyNames) {
14310
+ const keySchema = convertSchema(schema.propertyNames, ctx);
14311
+ const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : z.any();
14312
+ if (Object.keys(shape).length === 0) {
14313
+ zodSchema = z.record(keySchema, valueSchema);
14314
+ break;
14315
+ }
14316
+ const objectSchema2 = z.object(shape).passthrough();
14317
+ const recordSchema = z.looseRecord(keySchema, valueSchema);
14318
+ zodSchema = z.intersection(objectSchema2, recordSchema);
14319
+ break;
14320
+ }
14321
+ if (schema.patternProperties) {
14322
+ const patternProps = schema.patternProperties;
14323
+ const patternKeys = Object.keys(patternProps);
14324
+ const looseRecords = [];
14325
+ for (const pattern of patternKeys) {
14326
+ const patternValue = convertSchema(patternProps[pattern], ctx);
14327
+ const keySchema = z.string().regex(new RegExp(pattern));
14328
+ looseRecords.push(z.looseRecord(keySchema, patternValue));
14329
+ }
14330
+ const schemasToIntersect = [];
14331
+ if (Object.keys(shape).length > 0) {
14332
+ schemasToIntersect.push(z.object(shape).passthrough());
14333
+ }
14334
+ schemasToIntersect.push(...looseRecords);
14335
+ if (schemasToIntersect.length === 0) {
14336
+ zodSchema = z.object({}).passthrough();
14337
+ } else if (schemasToIntersect.length === 1) {
14338
+ zodSchema = schemasToIntersect[0];
14339
+ } else {
14340
+ let result = z.intersection(schemasToIntersect[0], schemasToIntersect[1]);
14341
+ for (let i = 2; i < schemasToIntersect.length; i++) {
14342
+ result = z.intersection(result, schemasToIntersect[i]);
14343
+ }
14344
+ zodSchema = result;
14345
+ }
14346
+ break;
14347
+ }
14348
+ const objectSchema = z.object(shape);
14349
+ if (schema.additionalProperties === false) {
14350
+ zodSchema = objectSchema.strict();
14351
+ } else if (typeof schema.additionalProperties === "object") {
14352
+ zodSchema = objectSchema.catchall(convertSchema(schema.additionalProperties, ctx));
14353
+ } else {
14354
+ zodSchema = objectSchema.passthrough();
14355
+ }
14356
+ break;
14357
+ }
14358
+ case "array": {
14359
+ const prefixItems = schema.prefixItems;
14360
+ const items = schema.items;
14361
+ if (prefixItems && Array.isArray(prefixItems)) {
14362
+ const tupleItems = prefixItems.map((item) => convertSchema(item, ctx));
14363
+ const rest = items && typeof items === "object" && !Array.isArray(items) ? convertSchema(items, ctx) : void 0;
14364
+ if (rest) {
14365
+ zodSchema = z.tuple(tupleItems).rest(rest);
14366
+ } else {
14367
+ zodSchema = z.tuple(tupleItems);
14368
+ }
14369
+ if (typeof schema.minItems === "number") {
14370
+ zodSchema = zodSchema.check(z.minLength(schema.minItems));
14371
+ }
14372
+ if (typeof schema.maxItems === "number") {
14373
+ zodSchema = zodSchema.check(z.maxLength(schema.maxItems));
14374
+ }
14375
+ } else if (Array.isArray(items)) {
14376
+ const tupleItems = items.map((item) => convertSchema(item, ctx));
14377
+ const rest = schema.additionalItems && typeof schema.additionalItems === "object" ? convertSchema(schema.additionalItems, ctx) : void 0;
14378
+ if (rest) {
14379
+ zodSchema = z.tuple(tupleItems).rest(rest);
14380
+ } else {
14381
+ zodSchema = z.tuple(tupleItems);
14382
+ }
14383
+ if (typeof schema.minItems === "number") {
14384
+ zodSchema = zodSchema.check(z.minLength(schema.minItems));
14385
+ }
14386
+ if (typeof schema.maxItems === "number") {
14387
+ zodSchema = zodSchema.check(z.maxLength(schema.maxItems));
14388
+ }
14389
+ } else if (items !== void 0) {
14390
+ const element = convertSchema(items, ctx);
14391
+ let arraySchema = z.array(element);
14392
+ if (typeof schema.minItems === "number") {
14393
+ arraySchema = arraySchema.min(schema.minItems);
14394
+ }
14395
+ if (typeof schema.maxItems === "number") {
14396
+ arraySchema = arraySchema.max(schema.maxItems);
14397
+ }
14398
+ zodSchema = arraySchema;
14399
+ } else {
14400
+ zodSchema = z.array(z.any());
14401
+ }
14402
+ break;
14403
+ }
14404
+ default:
14405
+ throw new Error(`Unsupported type: ${type}`);
14406
+ }
14407
+ return zodSchema;
13707
14408
  }
13708
- var ZodFirstPartyTypeKind;
13709
- /* @__PURE__ */ (function(ZodFirstPartyTypeKind2) {
13710
- })(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
13711
-
13712
- // node_modules/zod/v4/classic/from-json-schema.js
13713
- var z = {
13714
- ...schemas_exports2,
13715
- ...checks_exports2,
13716
- iso: iso_exports
13717
- };
13718
- var RECOGNIZED_KEYS = /* @__PURE__ */ new Set([
13719
- // Schema identification
13720
- "$schema",
13721
- "$ref",
13722
- "$defs",
13723
- "definitions",
13724
- // Core schema keywords
13725
- "$id",
13726
- "id",
13727
- "$comment",
13728
- "$anchor",
13729
- "$vocabulary",
13730
- "$dynamicRef",
13731
- "$dynamicAnchor",
13732
- // Type
13733
- "type",
13734
- "enum",
13735
- "const",
13736
- // Composition
13737
- "anyOf",
13738
- "oneOf",
13739
- "allOf",
13740
- "not",
13741
- // Object
13742
- "properties",
13743
- "required",
13744
- "additionalProperties",
13745
- "patternProperties",
13746
- "propertyNames",
13747
- "minProperties",
13748
- "maxProperties",
13749
- // Array
13750
- "items",
13751
- "prefixItems",
13752
- "additionalItems",
13753
- "minItems",
13754
- "maxItems",
13755
- "uniqueItems",
13756
- "contains",
13757
- "minContains",
13758
- "maxContains",
13759
- // String
13760
- "minLength",
13761
- "maxLength",
13762
- "pattern",
13763
- "format",
13764
- // Number
13765
- "minimum",
13766
- "maximum",
13767
- "exclusiveMinimum",
13768
- "exclusiveMaximum",
13769
- "multipleOf",
13770
- // Already handled metadata
13771
- "description",
13772
- "default",
13773
- // Content
13774
- "contentEncoding",
13775
- "contentMediaType",
13776
- "contentSchema",
13777
- // Unsupported (error-throwing)
13778
- "unevaluatedItems",
13779
- "unevaluatedProperties",
13780
- "if",
13781
- "then",
13782
- "else",
13783
- "dependentSchemas",
13784
- "dependentRequired",
13785
- // OpenAPI
13786
- "nullable",
13787
- "readOnly"
13788
- ]);
13789
- function detectVersion(schema, defaultTarget) {
13790
- const $schema = schema.$schema;
13791
- if ($schema === "https://json-schema.org/draft/2020-12/schema") {
13792
- return "draft-2020-12";
14409
+ function convertSchema(schema, ctx) {
14410
+ if (typeof schema === "boolean") {
14411
+ return schema ? z.any() : z.never();
13793
14412
  }
13794
- if ($schema === "http://json-schema.org/draft-07/schema#") {
13795
- return "draft-7";
14413
+ let baseSchema = convertBaseSchema(schema, ctx);
14414
+ const hasExplicitType = schema.type || schema.enum !== void 0 || schema.const !== void 0;
14415
+ if (schema.anyOf && Array.isArray(schema.anyOf)) {
14416
+ const options = schema.anyOf.map((s) => convertSchema(s, ctx));
14417
+ const anyOfUnion = z.union(options);
14418
+ baseSchema = hasExplicitType ? z.intersection(baseSchema, anyOfUnion) : anyOfUnion;
13796
14419
  }
13797
- if ($schema === "http://json-schema.org/draft-04/schema#") {
13798
- return "draft-4";
14420
+ if (schema.oneOf && Array.isArray(schema.oneOf)) {
14421
+ const options = schema.oneOf.map((s) => convertSchema(s, ctx));
14422
+ const oneOfUnion = z.xor(options);
14423
+ baseSchema = hasExplicitType ? z.intersection(baseSchema, oneOfUnion) : oneOfUnion;
13799
14424
  }
13800
- return defaultTarget ?? "draft-2020-12";
13801
- }
13802
- function resolveRef(ref, ctx) {
13803
- if (!ref.startsWith("#")) {
13804
- throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
14425
+ if (schema.allOf && Array.isArray(schema.allOf)) {
14426
+ if (schema.allOf.length === 0) {
14427
+ baseSchema = hasExplicitType ? baseSchema : z.any();
14428
+ } else {
14429
+ let result = hasExplicitType ? baseSchema : convertSchema(schema.allOf[0], ctx);
14430
+ const startIdx = hasExplicitType ? 0 : 1;
14431
+ for (let i = startIdx; i < schema.allOf.length; i++) {
14432
+ result = z.intersection(result, convertSchema(schema.allOf[i], ctx));
14433
+ }
14434
+ baseSchema = result;
14435
+ }
13805
14436
  }
13806
- const path = ref.slice(1).split("/").filter(Boolean);
13807
- if (path.length === 0) {
13808
- return ctx.rootSchema;
14437
+ if (schema.nullable === true && ctx.version === "openapi-3.0") {
14438
+ baseSchema = z.nullable(baseSchema);
13809
14439
  }
13810
- const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
13811
- if (path[0] === defsKey) {
13812
- const key = path[1];
13813
- if (!key || !ctx.defs[key]) {
13814
- throw new Error(`Reference not found: ${ref}`);
14440
+ if (schema.readOnly === true) {
14441
+ baseSchema = z.readonly(baseSchema);
14442
+ }
14443
+ if (schema.default !== void 0) {
14444
+ baseSchema = baseSchema.default(schema.default);
14445
+ }
14446
+ const extraMeta = {};
14447
+ const coreMetadataKeys = ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"];
14448
+ for (const key of coreMetadataKeys) {
14449
+ if (key in schema) {
14450
+ extraMeta[key] = schema[key];
13815
14451
  }
13816
- return ctx.defs[key];
13817
14452
  }
13818
- throw new Error(`Reference not found: ${ref}`);
14453
+ const contentMetadataKeys = ["contentEncoding", "contentMediaType", "contentSchema"];
14454
+ for (const key of contentMetadataKeys) {
14455
+ if (key in schema) {
14456
+ extraMeta[key] = schema[key];
14457
+ }
14458
+ }
14459
+ for (const key of Object.keys(schema)) {
14460
+ if (!RECOGNIZED_KEYS.has(key)) {
14461
+ extraMeta[key] = schema[key];
14462
+ }
14463
+ }
14464
+ if (Object.keys(extraMeta).length > 0) {
14465
+ ctx.registry.add(baseSchema, extraMeta);
14466
+ }
14467
+ if (schema.description) {
14468
+ baseSchema = baseSchema.describe(schema.description);
14469
+ }
14470
+ return baseSchema;
14471
+ }
14472
+ function fromJSONSchema(schema, params) {
14473
+ if (typeof schema === "boolean") {
14474
+ return schema ? z.any() : z.never();
14475
+ }
14476
+ let normalized;
14477
+ try {
14478
+ normalized = JSON.parse(JSON.stringify(schema));
14479
+ } catch {
14480
+ throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas");
14481
+ }
14482
+ const version2 = detectVersion(normalized, params?.defaultTarget);
14483
+ const defs = normalized.$defs || normalized.definitions || {};
14484
+ const ctx = {
14485
+ version: version2,
14486
+ defs,
14487
+ refs: /* @__PURE__ */ new Map(),
14488
+ processing: /* @__PURE__ */ new Set(),
14489
+ rootSchema: normalized,
14490
+ registry: params?.registry ?? globalRegistry
14491
+ };
14492
+ return convertSchema(normalized, ctx);
14493
+ }
14494
+
14495
+ // node_modules/zod/v4/classic/coerce.js
14496
+ var coerce_exports = {};
14497
+ __export(coerce_exports, {
14498
+ bigint: () => bigint3,
14499
+ boolean: () => boolean3,
14500
+ date: () => date4,
14501
+ number: () => number3,
14502
+ string: () => string3
14503
+ });
14504
+ function string3(params) {
14505
+ return _coercedString(ZodString, params);
14506
+ }
14507
+ function number3(params) {
14508
+ return _coercedNumber(ZodNumber, params);
14509
+ }
14510
+ function boolean3(params) {
14511
+ return _coercedBoolean(ZodBoolean, params);
14512
+ }
14513
+ function bigint3(params) {
14514
+ return _coercedBigint(ZodBigInt, params);
13819
14515
  }
13820
- function convertBaseSchema(schema, ctx) {
13821
- if (schema.not !== void 0) {
13822
- if (typeof schema.not === "object" && Object.keys(schema.not).length === 0) {
13823
- return z.never();
13824
- }
13825
- throw new Error("not is not supported in Zod (except { not: {} } for never)");
13826
- }
13827
- if (schema.unevaluatedItems !== void 0) {
13828
- throw new Error("unevaluatedItems is not supported");
14516
+ function date4(params) {
14517
+ return _coercedDate(ZodDate, params);
14518
+ }
14519
+
14520
+ // node_modules/zod/v4/classic/external.js
14521
+ config(en_default());
14522
+
14523
+ // node_modules/@opentabs-dev/plugin-sdk/dist/errors.js
14524
+ var ToolError = class _ToolError extends Error {
14525
+ code;
14526
+ /** Whether this error is retryable (defaults to false). */
14527
+ retryable;
14528
+ /** Suggested delay before retrying, in milliseconds. */
14529
+ retryAfterMs;
14530
+ /** Error category for structured error classification. */
14531
+ category;
14532
+ constructor(message, code, opts) {
14533
+ super(message);
14534
+ this.code = code;
14535
+ this.name = "ToolError";
14536
+ this.retryable = opts?.retryable ?? false;
14537
+ this.retryAfterMs = opts?.retryAfterMs;
14538
+ this.category = opts?.category;
13829
14539
  }
13830
- if (schema.unevaluatedProperties !== void 0) {
13831
- throw new Error("unevaluatedProperties is not supported");
14540
+ /** Authentication or authorization error (not retryable). Accepts an optional domain-specific code. */
14541
+ static auth(message, code) {
14542
+ return new _ToolError(message, code ?? "AUTH_ERROR", { category: "auth", retryable: false });
13832
14543
  }
13833
- if (schema.if !== void 0 || schema.then !== void 0 || schema.else !== void 0) {
13834
- throw new Error("Conditional schemas (if/then/else) are not supported");
14544
+ /** Resource not found (not retryable). Accepts an optional domain-specific code. */
14545
+ static notFound(message, code) {
14546
+ return new _ToolError(message, code ?? "NOT_FOUND", { category: "not_found", retryable: false });
13835
14547
  }
13836
- if (schema.dependentSchemas !== void 0 || schema.dependentRequired !== void 0) {
13837
- throw new Error("dependentSchemas and dependentRequired are not supported");
14548
+ /** Rate limited (retryable). Accepts an optional retry delay in milliseconds and an optional domain-specific code. */
14549
+ static rateLimited(message, retryAfterMs, code) {
14550
+ return new _ToolError(message, code ?? "RATE_LIMITED", { category: "rate_limit", retryable: true, retryAfterMs });
13838
14551
  }
13839
- if (schema.$ref) {
13840
- const refPath = schema.$ref;
13841
- if (ctx.refs.has(refPath)) {
13842
- return ctx.refs.get(refPath);
13843
- }
13844
- if (ctx.processing.has(refPath)) {
13845
- return z.lazy(() => {
13846
- if (!ctx.refs.has(refPath)) {
13847
- throw new Error(`Circular reference not resolved: ${refPath}`);
13848
- }
13849
- return ctx.refs.get(refPath);
13850
- });
13851
- }
13852
- ctx.processing.add(refPath);
13853
- const resolved = resolveRef(refPath, ctx);
13854
- const zodSchema2 = convertSchema(resolved, ctx);
13855
- ctx.refs.set(refPath, zodSchema2);
13856
- ctx.processing.delete(refPath);
13857
- return zodSchema2;
14552
+ /** Input validation error (not retryable). Accepts an optional domain-specific code. */
14553
+ static validation(message, code) {
14554
+ return new _ToolError(message, code ?? "VALIDATION_ERROR", { category: "validation", retryable: false });
13858
14555
  }
13859
- if (schema.enum !== void 0) {
13860
- const enumValues = schema.enum;
13861
- if (ctx.version === "openapi-3.0" && schema.nullable === true && enumValues.length === 1 && enumValues[0] === null) {
13862
- return z.null();
13863
- }
13864
- if (enumValues.length === 0) {
13865
- return z.never();
13866
- }
13867
- if (enumValues.length === 1) {
13868
- return z.literal(enumValues[0]);
13869
- }
13870
- if (enumValues.every((v) => typeof v === "string")) {
13871
- return z.enum(enumValues);
13872
- }
13873
- const literalSchemas = enumValues.map((v) => z.literal(v));
13874
- if (literalSchemas.length < 2) {
13875
- return literalSchemas[0];
13876
- }
13877
- return z.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
14556
+ /** Operation timed out (retryable). Accepts an optional domain-specific code. */
14557
+ static timeout(message, code) {
14558
+ return new _ToolError(message, code ?? "TIMEOUT", { category: "timeout", retryable: true });
13878
14559
  }
13879
- if (schema.const !== void 0) {
13880
- return z.literal(schema.const);
14560
+ /** Internal/unexpected error (not retryable). Accepts an optional domain-specific code. */
14561
+ static internal(message, code) {
14562
+ return new _ToolError(message, code ?? "INTERNAL_ERROR", { category: "internal", retryable: false });
13881
14563
  }
13882
- const type = schema.type;
13883
- if (Array.isArray(type)) {
13884
- const typeSchemas = type.map((t) => {
13885
- const typeSchema = { ...schema, type: t };
13886
- return convertBaseSchema(typeSchema, ctx);
13887
- });
13888
- if (typeSchemas.length === 0) {
13889
- return z.never();
13890
- }
13891
- if (typeSchemas.length === 1) {
13892
- return typeSchemas[0];
13893
- }
13894
- return z.union(typeSchemas);
14564
+ };
14565
+
14566
+ // node_modules/@opentabs-dev/plugin-sdk/dist/fetch.js
14567
+ var parseRetryAfterMs = (value) => {
14568
+ const seconds = Number(value);
14569
+ if (!Number.isNaN(seconds) && seconds >= 0) {
14570
+ return seconds * 1e3;
13895
14571
  }
13896
- if (!type) {
13897
- return z.any();
14572
+ const date5 = Date.parse(value);
14573
+ if (!Number.isNaN(date5)) {
14574
+ const ms = date5 - Date.now();
14575
+ return ms > 0 ? ms : void 0;
13898
14576
  }
13899
- let zodSchema;
13900
- switch (type) {
13901
- case "string": {
13902
- let stringSchema = z.string();
13903
- if (schema.format) {
13904
- const format = schema.format;
13905
- if (format === "email") {
13906
- stringSchema = stringSchema.check(z.email());
13907
- } else if (format === "uri" || format === "uri-reference") {
13908
- stringSchema = stringSchema.check(z.url());
13909
- } else if (format === "uuid" || format === "guid") {
13910
- stringSchema = stringSchema.check(z.uuid());
13911
- } else if (format === "date-time") {
13912
- stringSchema = stringSchema.check(z.iso.datetime());
13913
- } else if (format === "date") {
13914
- stringSchema = stringSchema.check(z.iso.date());
13915
- } else if (format === "time") {
13916
- stringSchema = stringSchema.check(z.iso.time());
13917
- } else if (format === "duration") {
13918
- stringSchema = stringSchema.check(z.iso.duration());
13919
- } else if (format === "ipv4") {
13920
- stringSchema = stringSchema.check(z.ipv4());
13921
- } else if (format === "ipv6") {
13922
- stringSchema = stringSchema.check(z.ipv6());
13923
- } else if (format === "mac") {
13924
- stringSchema = stringSchema.check(z.mac());
13925
- } else if (format === "cidr") {
13926
- stringSchema = stringSchema.check(z.cidrv4());
13927
- } else if (format === "cidr-v6") {
13928
- stringSchema = stringSchema.check(z.cidrv6());
13929
- } else if (format === "base64") {
13930
- stringSchema = stringSchema.check(z.base64());
13931
- } else if (format === "base64url") {
13932
- stringSchema = stringSchema.check(z.base64url());
13933
- } else if (format === "e164") {
13934
- stringSchema = stringSchema.check(z.e164());
13935
- } else if (format === "jwt") {
13936
- stringSchema = stringSchema.check(z.jwt());
13937
- } else if (format === "emoji") {
13938
- stringSchema = stringSchema.check(z.emoji());
13939
- } else if (format === "nanoid") {
13940
- stringSchema = stringSchema.check(z.nanoid());
13941
- } else if (format === "cuid") {
13942
- stringSchema = stringSchema.check(z.cuid());
13943
- } else if (format === "cuid2") {
13944
- stringSchema = stringSchema.check(z.cuid2());
13945
- } else if (format === "ulid") {
13946
- stringSchema = stringSchema.check(z.ulid());
13947
- } else if (format === "xid") {
13948
- stringSchema = stringSchema.check(z.xid());
13949
- } else if (format === "ksuid") {
13950
- stringSchema = stringSchema.check(z.ksuid());
13951
- }
13952
- }
13953
- if (typeof schema.minLength === "number") {
13954
- stringSchema = stringSchema.min(schema.minLength);
13955
- }
13956
- if (typeof schema.maxLength === "number") {
13957
- stringSchema = stringSchema.max(schema.maxLength);
13958
- }
13959
- if (schema.pattern) {
13960
- stringSchema = stringSchema.regex(new RegExp(schema.pattern));
13961
- }
13962
- zodSchema = stringSchema;
13963
- break;
13964
- }
13965
- case "number":
13966
- case "integer": {
13967
- let numberSchema = type === "integer" ? z.number().int() : z.number();
13968
- if (typeof schema.minimum === "number") {
13969
- numberSchema = numberSchema.min(schema.minimum);
13970
- }
13971
- if (typeof schema.maximum === "number") {
13972
- numberSchema = numberSchema.max(schema.maximum);
13973
- }
13974
- if (typeof schema.exclusiveMinimum === "number") {
13975
- numberSchema = numberSchema.gt(schema.exclusiveMinimum);
13976
- } else if (schema.exclusiveMinimum === true && typeof schema.minimum === "number") {
13977
- numberSchema = numberSchema.gt(schema.minimum);
13978
- }
13979
- if (typeof schema.exclusiveMaximum === "number") {
13980
- numberSchema = numberSchema.lt(schema.exclusiveMaximum);
13981
- } else if (schema.exclusiveMaximum === true && typeof schema.maximum === "number") {
13982
- numberSchema = numberSchema.lt(schema.maximum);
13983
- }
13984
- if (typeof schema.multipleOf === "number") {
13985
- numberSchema = numberSchema.multipleOf(schema.multipleOf);
13986
- }
13987
- zodSchema = numberSchema;
13988
- break;
13989
- }
13990
- case "boolean": {
13991
- zodSchema = z.boolean();
13992
- break;
13993
- }
13994
- case "null": {
13995
- zodSchema = z.null();
13996
- break;
13997
- }
13998
- case "object": {
13999
- const shape = {};
14000
- const properties = schema.properties || {};
14001
- const requiredSet = new Set(schema.required || []);
14002
- for (const [key, propSchema] of Object.entries(properties)) {
14003
- const propZodSchema = convertSchema(propSchema, ctx);
14004
- shape[key] = requiredSet.has(key) ? propZodSchema : propZodSchema.optional();
14005
- }
14006
- if (schema.propertyNames) {
14007
- const keySchema = convertSchema(schema.propertyNames, ctx);
14008
- const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : z.any();
14009
- if (Object.keys(shape).length === 0) {
14010
- zodSchema = z.record(keySchema, valueSchema);
14011
- break;
14577
+ return void 0;
14578
+ };
14579
+
14580
+ // node_modules/@opentabs-dev/plugin-sdk/dist/timing.js
14581
+ var waitUntil = (predicate, opts) => {
14582
+ const interval = opts?.interval ?? 200;
14583
+ const timeout = opts?.timeout ?? 1e4;
14584
+ const signal = opts?.signal;
14585
+ const abortReason = () => signal?.reason instanceof Error ? signal.reason : new Error("waitUntil: aborted");
14586
+ if (signal?.aborted)
14587
+ return Promise.reject(abortReason());
14588
+ return new Promise((resolve, reject) => {
14589
+ let settled = false;
14590
+ let poller;
14591
+ let lastPredicateError;
14592
+ const isSettled = () => settled;
14593
+ const cleanup = () => {
14594
+ settled = true;
14595
+ clearTimeout(timer);
14596
+ clearTimeout(poller);
14597
+ signal?.removeEventListener("abort", onAbort);
14598
+ };
14599
+ const onAbort = () => {
14600
+ if (isSettled())
14601
+ return;
14602
+ cleanup();
14603
+ reject(abortReason());
14604
+ };
14605
+ signal?.addEventListener("abort", onAbort, { once: true });
14606
+ const timer = setTimeout(() => {
14607
+ if (isSettled())
14608
+ return;
14609
+ cleanup();
14610
+ const errorContext = lastPredicateError instanceof Error ? `: predicate last threw \u2014 ${lastPredicateError.message}` : "";
14611
+ reject(new Error(`waitUntil: timed out after ${timeout}ms waiting for predicate to return true${errorContext}`));
14612
+ }, timeout);
14613
+ const check2 = async () => {
14614
+ if (isSettled())
14615
+ return;
14616
+ try {
14617
+ const result = await predicate();
14618
+ if (result) {
14619
+ cleanup();
14620
+ resolve();
14621
+ return;
14012
14622
  }
14013
- const objectSchema2 = z.object(shape).passthrough();
14014
- const recordSchema = z.looseRecord(keySchema, valueSchema);
14015
- zodSchema = z.intersection(objectSchema2, recordSchema);
14016
- break;
14623
+ } catch (err2) {
14624
+ lastPredicateError = err2;
14017
14625
  }
14018
- if (schema.patternProperties) {
14019
- const patternProps = schema.patternProperties;
14020
- const patternKeys = Object.keys(patternProps);
14021
- const looseRecords = [];
14022
- for (const pattern of patternKeys) {
14023
- const patternValue = convertSchema(patternProps[pattern], ctx);
14024
- const keySchema = z.string().regex(new RegExp(pattern));
14025
- looseRecords.push(z.looseRecord(keySchema, patternValue));
14026
- }
14027
- const schemasToIntersect = [];
14028
- if (Object.keys(shape).length > 0) {
14029
- schemasToIntersect.push(z.object(shape).passthrough());
14030
- }
14031
- schemasToIntersect.push(...looseRecords);
14032
- if (schemasToIntersect.length === 0) {
14033
- zodSchema = z.object({}).passthrough();
14034
- } else if (schemasToIntersect.length === 1) {
14035
- zodSchema = schemasToIntersect[0];
14036
- } else {
14037
- let result = z.intersection(schemasToIntersect[0], schemasToIntersect[1]);
14038
- for (let i = 2; i < schemasToIntersect.length; i++) {
14039
- result = z.intersection(result, schemasToIntersect[i]);
14626
+ if (!isSettled()) {
14627
+ poller = setTimeout(() => void check2(), interval);
14628
+ }
14629
+ };
14630
+ void check2();
14631
+ });
14632
+ };
14633
+
14634
+ // node_modules/@opentabs-dev/plugin-sdk/dist/log.js
14635
+ var MAX_DATA_LENGTH = 10;
14636
+ var MAX_STRING_LENGTH = 4096;
14637
+ var MAX_SERIALIZED_SIZE = 64 * 1024;
14638
+ var safeSerializeArg = (value) => {
14639
+ try {
14640
+ if (value === null || value === void 0)
14641
+ return value;
14642
+ const type = typeof value;
14643
+ if (type === "boolean" || type === "number")
14644
+ return value;
14645
+ if (type === "string") {
14646
+ return value.length > MAX_STRING_LENGTH ? `${value.slice(0, MAX_STRING_LENGTH)}\u2026` : value;
14647
+ }
14648
+ if (type === "function")
14649
+ return `[Function: ${value.name || "anonymous"}]`;
14650
+ if (type === "symbol")
14651
+ return `[Symbol: ${value.description ?? ""}]`;
14652
+ if (type === "bigint")
14653
+ return `[BigInt: ${value.toString()}]`;
14654
+ if (typeof value.nodeType === "number" && typeof value.nodeName === "string") {
14655
+ try {
14656
+ const node = value;
14657
+ let classStr = "";
14658
+ if (typeof node.className === "string") {
14659
+ classStr = node.className ? `.${node.className.split(" ")[0] ?? ""}` : "";
14660
+ } else if (node.className !== null && typeof node.className === "object") {
14661
+ const baseVal = node.className.baseVal;
14662
+ if (typeof baseVal === "string") {
14663
+ classStr = baseVal ? `.${baseVal.split(" ")[0] ?? ""}` : "";
14040
14664
  }
14041
- zodSchema = result;
14042
14665
  }
14043
- break;
14044
- }
14045
- const objectSchema = z.object(shape);
14046
- if (schema.additionalProperties === false) {
14047
- zodSchema = objectSchema.strict();
14048
- } else if (typeof schema.additionalProperties === "object") {
14049
- zodSchema = objectSchema.catchall(convertSchema(schema.additionalProperties, ctx));
14050
- } else {
14051
- zodSchema = objectSchema.passthrough();
14666
+ return `[${node.nodeName}${node.id ? `#${node.id}` : ""}${classStr}]`;
14667
+ } catch {
14052
14668
  }
14053
- break;
14054
14669
  }
14055
- case "array": {
14056
- const prefixItems = schema.prefixItems;
14057
- const items = schema.items;
14058
- if (prefixItems && Array.isArray(prefixItems)) {
14059
- const tupleItems = prefixItems.map((item) => convertSchema(item, ctx));
14060
- const rest = items && typeof items === "object" && !Array.isArray(items) ? convertSchema(items, ctx) : void 0;
14061
- if (rest) {
14062
- zodSchema = z.tuple(tupleItems).rest(rest);
14063
- } else {
14064
- zodSchema = z.tuple(tupleItems);
14065
- }
14066
- if (typeof schema.minItems === "number") {
14067
- zodSchema = zodSchema.check(z.minLength(schema.minItems));
14068
- }
14069
- if (typeof schema.maxItems === "number") {
14070
- zodSchema = zodSchema.check(z.maxLength(schema.maxItems));
14071
- }
14072
- } else if (Array.isArray(items)) {
14073
- const tupleItems = items.map((item) => convertSchema(item, ctx));
14074
- const rest = schema.additionalItems && typeof schema.additionalItems === "object" ? convertSchema(schema.additionalItems, ctx) : void 0;
14075
- if (rest) {
14076
- zodSchema = z.tuple(tupleItems).rest(rest);
14077
- } else {
14078
- zodSchema = z.tuple(tupleItems);
14079
- }
14080
- if (typeof schema.minItems === "number") {
14081
- zodSchema = zodSchema.check(z.minLength(schema.minItems));
14082
- }
14083
- if (typeof schema.maxItems === "number") {
14084
- zodSchema = zodSchema.check(z.maxLength(schema.maxItems));
14085
- }
14086
- } else if (items !== void 0) {
14087
- const element = convertSchema(items, ctx);
14088
- let arraySchema = z.array(element);
14089
- if (typeof schema.minItems === "number") {
14090
- arraySchema = arraySchema.min(schema.minItems);
14091
- }
14092
- if (typeof schema.maxItems === "number") {
14093
- arraySchema = arraySchema.max(schema.maxItems);
14670
+ if (value instanceof Error) {
14671
+ return { name: value.name, message: value.message, stack: value.stack };
14672
+ }
14673
+ if (value instanceof WeakRef)
14674
+ return "[WeakRef]";
14675
+ if (value instanceof WeakMap)
14676
+ return "[WeakMap]";
14677
+ if (value instanceof WeakSet)
14678
+ return "[WeakSet]";
14679
+ if (value instanceof ArrayBuffer)
14680
+ return "[ArrayBuffer]";
14681
+ if (typeof SharedArrayBuffer !== "undefined" && value instanceof SharedArrayBuffer)
14682
+ return "[SharedArrayBuffer]";
14683
+ try {
14684
+ const seen = /* @__PURE__ */ new WeakSet();
14685
+ const json2 = JSON.stringify(value, (_key, v) => {
14686
+ if (typeof v === "object" && v !== null) {
14687
+ if (seen.has(v))
14688
+ return "[Circular]";
14689
+ seen.add(v);
14094
14690
  }
14095
- zodSchema = arraySchema;
14096
- } else {
14097
- zodSchema = z.array(z.any());
14691
+ if (typeof v === "function")
14692
+ return `[Function: ${v.name || "anonymous"}]`;
14693
+ if (typeof v === "bigint")
14694
+ return `[BigInt: ${v.toString()}]`;
14695
+ if (typeof v === "symbol")
14696
+ return `[Symbol: ${v.description ?? ""}]`;
14697
+ if (v instanceof WeakRef)
14698
+ return "[WeakRef]";
14699
+ if (v instanceof WeakMap)
14700
+ return "[WeakMap]";
14701
+ if (v instanceof WeakSet)
14702
+ return "[WeakSet]";
14703
+ if (v instanceof ArrayBuffer)
14704
+ return "[ArrayBuffer]";
14705
+ if (typeof SharedArrayBuffer !== "undefined" && v instanceof SharedArrayBuffer)
14706
+ return "[SharedArrayBuffer]";
14707
+ return v;
14708
+ });
14709
+ if (json2.length > MAX_SERIALIZED_SIZE) {
14710
+ return `[Object truncated: ${json2.length} chars]`;
14098
14711
  }
14099
- break;
14712
+ return JSON.parse(json2);
14713
+ } catch {
14714
+ return `[Unserializable: ${typeof value}]`;
14100
14715
  }
14101
- default:
14102
- throw new Error(`Unsupported type: ${type}`);
14103
- }
14104
- if (schema.description) {
14105
- zodSchema = zodSchema.describe(schema.description);
14106
- }
14107
- if (schema.default !== void 0) {
14108
- zodSchema = zodSchema.default(schema.default);
14109
- }
14110
- return zodSchema;
14111
- }
14112
- function convertSchema(schema, ctx) {
14113
- if (typeof schema === "boolean") {
14114
- return schema ? z.any() : z.never();
14115
- }
14116
- let baseSchema = convertBaseSchema(schema, ctx);
14117
- const hasExplicitType = schema.type || schema.enum !== void 0 || schema.const !== void 0;
14118
- if (schema.anyOf && Array.isArray(schema.anyOf)) {
14119
- const options = schema.anyOf.map((s) => convertSchema(s, ctx));
14120
- const anyOfUnion = z.union(options);
14121
- baseSchema = hasExplicitType ? z.intersection(baseSchema, anyOfUnion) : anyOfUnion;
14122
- }
14123
- if (schema.oneOf && Array.isArray(schema.oneOf)) {
14124
- const options = schema.oneOf.map((s) => convertSchema(s, ctx));
14125
- const oneOfUnion = z.xor(options);
14126
- baseSchema = hasExplicitType ? z.intersection(baseSchema, oneOfUnion) : oneOfUnion;
14716
+ } catch {
14717
+ return `[Unserializable: ${typeof value}]`;
14127
14718
  }
14128
- if (schema.allOf && Array.isArray(schema.allOf)) {
14129
- if (schema.allOf.length === 0) {
14130
- baseSchema = hasExplicitType ? baseSchema : z.any();
14131
- } else {
14132
- let result = hasExplicitType ? baseSchema : convertSchema(schema.allOf[0], ctx);
14133
- const startIdx = hasExplicitType ? 0 : 1;
14134
- for (let i = startIdx; i < schema.allOf.length; i++) {
14135
- result = z.intersection(result, convertSchema(schema.allOf[i], ctx));
14719
+ };
14720
+ var safeSerialize = (args) => {
14721
+ const capped = args.length > MAX_DATA_LENGTH ? args.slice(0, MAX_DATA_LENGTH) : args;
14722
+ return capped.map(safeSerializeArg);
14723
+ };
14724
+ var CONSOLE_METHODS = {
14725
+ debug: "debug",
14726
+ info: "info",
14727
+ warning: "warn",
14728
+ error: "error"
14729
+ };
14730
+ var defaultTransport = (entry) => {
14731
+ const method = CONSOLE_METHODS[entry.level];
14732
+ console[method](`[sdk.log] ${entry.message}`, ...entry.data);
14733
+ };
14734
+ var activeTransport = defaultTransport;
14735
+ var _setLogTransport = (transport) => {
14736
+ const previous = activeTransport;
14737
+ activeTransport = transport;
14738
+ return () => {
14739
+ if (activeTransport === transport)
14740
+ activeTransport = previous;
14741
+ };
14742
+ };
14743
+ var makeLogMethod = (level) => (message, ...args) => {
14744
+ const entry = {
14745
+ level,
14746
+ message,
14747
+ data: safeSerialize(args),
14748
+ ts: (/* @__PURE__ */ new Date()).toISOString()
14749
+ };
14750
+ activeTransport(entry);
14751
+ };
14752
+ var log = Object.freeze({
14753
+ debug: makeLogMethod("debug"),
14754
+ info: makeLogMethod("info"),
14755
+ warn: makeLogMethod("warning"),
14756
+ error: makeLogMethod("error")
14757
+ });
14758
+ var ot = globalThis.__openTabs ?? {};
14759
+ globalThis.__openTabs = ot;
14760
+ ot._setLogTransport = _setLogTransport;
14761
+ ot.log = log;
14762
+
14763
+ // node_modules/@opentabs-dev/plugin-sdk/dist/storage.js
14764
+ var getCookie = (name) => {
14765
+ try {
14766
+ const prefix = `${name}=`;
14767
+ const entries = document.cookie.split("; ");
14768
+ for (const entry of entries) {
14769
+ if (entry.startsWith(prefix)) {
14770
+ try {
14771
+ return decodeURIComponent(entry.slice(prefix.length));
14772
+ } catch {
14773
+ return entry.slice(prefix.length);
14774
+ }
14136
14775
  }
14137
- baseSchema = result;
14138
14776
  }
14777
+ return null;
14778
+ } catch {
14779
+ return null;
14139
14780
  }
14140
- if (schema.nullable === true && ctx.version === "openapi-3.0") {
14141
- baseSchema = z.nullable(baseSchema);
14781
+ };
14782
+
14783
+ // node_modules/@opentabs-dev/plugin-sdk/dist/index.js
14784
+ var defineTool = (config2) => config2;
14785
+ var OpenTabsPlugin = class {
14786
+ /**
14787
+ * Chrome match patterns for URLs that should NOT match this plugin.
14788
+ * Tabs matching both urlPatterns and excludePatterns are excluded.
14789
+ * Useful when a broad urlPattern overlaps with another plugin's domain.
14790
+ * @see https://developer.chrome.com/docs/extensions/develop/concepts/match-patterns
14791
+ */
14792
+ excludePatterns;
14793
+ /**
14794
+ * URL to open when no matching tab exists and the user triggers an
14795
+ * 'open tab' action from the side panel. Should be a concrete URL
14796
+ * (e.g., 'https://github.com'), not a match pattern.
14797
+ */
14798
+ homepage;
14799
+ /** Typed configuration schema — declares settings that users provide via config.json or the side panel. */
14800
+ configSchema;
14801
+ };
14802
+
14803
+ // src/linkedin-api.ts
14804
+ var VOYAGER_BASE = "/voyager/api";
14805
+ var MESSAGING_GRAPHQL_BASE = "/voyager/api/voyagerMessagingGraphQL/graphql";
14806
+ var getCsrfToken = () => {
14807
+ const value = getCookie("JSESSIONID");
14808
+ if (!value) return null;
14809
+ return value.replace(/"/g, "");
14810
+ };
14811
+ var isAuthenticated = () => getCsrfToken() !== null;
14812
+ var waitForAuth = () => waitUntil(() => isAuthenticated(), { interval: 500, timeout: 5e3 }).then(
14813
+ () => true,
14814
+ () => false
14815
+ );
14816
+ var getHeaders = () => {
14817
+ const csrf = getCsrfToken();
14818
+ if (!csrf) throw ToolError.auth("Not authenticated \u2014 please log in to LinkedIn.");
14819
+ return {
14820
+ "csrf-token": csrf,
14821
+ "x-restli-protocol-version": "2.0.0",
14822
+ "x-li-lang": "en_US",
14823
+ "x-li-track": JSON.stringify({
14824
+ clientVersion: "1.13.42665",
14825
+ mpVersion: "1.13.42665",
14826
+ osName: "web",
14827
+ timezoneOffset: (/* @__PURE__ */ new Date()).getTimezoneOffset() / -60,
14828
+ timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
14829
+ deviceFormFactor: "DESKTOP",
14830
+ mpName: "voyager-web",
14831
+ displayDensity: window.devicePixelRatio,
14832
+ displayWidth: window.screen.width,
14833
+ displayHeight: window.screen.height
14834
+ })
14835
+ };
14836
+ };
14837
+ var classifyError = (status, body, endpoint, headers) => {
14838
+ if (status === 429) {
14839
+ const retryAfter = headers.get("Retry-After");
14840
+ throw ToolError.rateLimited(`Rate limited: ${endpoint}`, retryAfter ? parseRetryAfterMs(retryAfter) : void 0);
14142
14841
  }
14143
- if (schema.readOnly === true) {
14144
- baseSchema = z.readonly(baseSchema);
14842
+ if (status === 401 || status === 403) throw ToolError.auth(`Auth error (${status}): ${body}`);
14843
+ if (status === 404) throw ToolError.notFound(`Not found: ${endpoint}`);
14844
+ if (status === 422) throw ToolError.validation(`Validation error: ${body}`);
14845
+ throw ToolError.internal(`API error (${status}): ${endpoint} \u2014 ${body}`);
14846
+ };
14847
+ var api = async (endpoint, options = {}) => {
14848
+ const headers = getHeaders();
14849
+ let url2 = `${VOYAGER_BASE}${endpoint}`;
14850
+ if (options.query) {
14851
+ const params = new URLSearchParams();
14852
+ for (const [k, v] of Object.entries(options.query)) if (v !== void 0) params.append(k, String(v));
14853
+ const qs = params.toString();
14854
+ if (qs) url2 += `?${qs}`;
14145
14855
  }
14146
- const extraMeta = {};
14147
- const coreMetadataKeys = ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"];
14148
- for (const key of coreMetadataKeys) {
14149
- if (key in schema) {
14150
- extraMeta[key] = schema[key];
14151
- }
14856
+ let fetchBody;
14857
+ if (options.body) {
14858
+ headers["Content-Type"] = "application/json";
14859
+ fetchBody = JSON.stringify(options.body);
14152
14860
  }
14153
- const contentMetadataKeys = ["contentEncoding", "contentMediaType", "contentSchema"];
14154
- for (const key of contentMetadataKeys) {
14155
- if (key in schema) {
14156
- extraMeta[key] = schema[key];
14157
- }
14861
+ const method = options.method ?? "GET";
14862
+ let response;
14863
+ try {
14864
+ response = await fetch(url2, {
14865
+ method,
14866
+ headers,
14867
+ body: fetchBody,
14868
+ credentials: "include",
14869
+ signal: AbortSignal.timeout(3e4)
14870
+ });
14871
+ } catch (err2) {
14872
+ if (err2 instanceof DOMException && err2.name === "TimeoutError") throw ToolError.timeout(`Timed out: ${endpoint}`);
14873
+ throw new ToolError(`Network error: ${err2 instanceof Error ? err2.message : String(err2)}`, "network_error", {
14874
+ category: "internal",
14875
+ retryable: true
14876
+ });
14158
14877
  }
14159
- for (const key of Object.keys(schema)) {
14160
- if (!RECOGNIZED_KEYS.has(key)) {
14161
- extraMeta[key] = schema[key];
14162
- }
14878
+ if (!response.ok) {
14879
+ const body = (await response.text().catch(() => "")).substring(0, 512);
14880
+ classifyError(response.status, body, endpoint, response.headers);
14163
14881
  }
14164
- if (Object.keys(extraMeta).length > 0) {
14165
- ctx.registry.add(baseSchema, extraMeta);
14882
+ if (response.status === 204) return {};
14883
+ return await response.json();
14884
+ };
14885
+ var encodeUrn = (urn) => encodeURIComponent(urn).replace(/\(/g, "%28").replace(/\)/g, "%29");
14886
+ var getMyProfileUrn = async () => {
14887
+ const me = await api("/me");
14888
+ const profileUrn = me.miniProfile?.dashEntityUrn;
14889
+ if (!profileUrn) throw ToolError.auth("Could not determine current user profile URN.");
14890
+ return profileUrn;
14891
+ };
14892
+ var messagingGraphql = async (queryId, variables) => {
14893
+ const csrf = getCsrfToken();
14894
+ if (!csrf) throw ToolError.auth("Not authenticated \u2014 please log in to LinkedIn.");
14895
+ const headers = {
14896
+ "csrf-token": csrf,
14897
+ "x-restli-protocol-version": "2.0.0",
14898
+ accept: "application/graphql"
14899
+ };
14900
+ const url2 = `${MESSAGING_GRAPHQL_BASE}?queryId=${queryId}&variables=${variables}`;
14901
+ let response;
14902
+ try {
14903
+ response = await fetch(url2, {
14904
+ method: "GET",
14905
+ headers,
14906
+ credentials: "include",
14907
+ signal: AbortSignal.timeout(3e4)
14908
+ });
14909
+ } catch (err2) {
14910
+ if (err2 instanceof DOMException && err2.name === "TimeoutError")
14911
+ throw ToolError.timeout(`Timed out: messaging graphql ${queryId}`);
14912
+ throw new ToolError(`Network error: ${err2 instanceof Error ? err2.message : String(err2)}`, "network_error", {
14913
+ category: "internal",
14914
+ retryable: true
14915
+ });
14166
14916
  }
14167
- return baseSchema;
14168
- }
14169
- function fromJSONSchema(schema, params) {
14170
- if (typeof schema === "boolean") {
14171
- return schema ? z.any() : z.never();
14917
+ if (!response.ok) {
14918
+ const body = (await response.text().catch(() => "")).substring(0, 512);
14919
+ if (response.status === 500 && body.includes('"status":500')) {
14920
+ throw ToolError.internal(
14921
+ "Persisted query hash expired \u2014 LinkedIn may have deployed a new client version. Try reloading the LinkedIn tab."
14922
+ );
14923
+ }
14924
+ classifyError(response.status, body, `messaging:${queryId}`, response.headers);
14172
14925
  }
14173
- const version2 = detectVersion(schema, params?.defaultTarget);
14174
- const defs = schema.$defs || schema.definitions || {};
14175
- const ctx = {
14176
- version: version2,
14177
- defs,
14178
- refs: /* @__PURE__ */ new Map(),
14179
- processing: /* @__PURE__ */ new Set(),
14180
- rootSchema: schema,
14181
- registry: params?.registry ?? globalRegistry
14926
+ return await response.json();
14927
+ };
14928
+ var messagingAction = async (endpoint, body) => {
14929
+ const csrf = getCsrfToken();
14930
+ if (!csrf) throw ToolError.auth("Not authenticated \u2014 please log in to LinkedIn.");
14931
+ const headers = {
14932
+ "csrf-token": csrf,
14933
+ "x-restli-protocol-version": "2.0.0",
14934
+ "Content-Type": "application/json"
14182
14935
  };
14183
- return convertSchema(schema, ctx);
14184
- }
14185
-
14186
- // node_modules/zod/v4/classic/coerce.js
14187
- var coerce_exports = {};
14188
- __export(coerce_exports, {
14189
- bigint: () => bigint3,
14190
- boolean: () => boolean3,
14191
- date: () => date4,
14192
- number: () => number3,
14193
- string: () => string3
14194
- });
14195
- function string3(params) {
14196
- return _coercedString(ZodString, params);
14197
- }
14198
- function number3(params) {
14199
- return _coercedNumber(ZodNumber, params);
14200
- }
14201
- function boolean3(params) {
14202
- return _coercedBoolean(ZodBoolean, params);
14203
- }
14204
- function bigint3(params) {
14205
- return _coercedBigint(ZodBigInt, params);
14206
- }
14207
- function date4(params) {
14208
- return _coercedDate(ZodDate, params);
14209
- }
14210
-
14211
- // node_modules/zod/v4/classic/external.js
14212
- config(en_default());
14936
+ const url2 = `${VOYAGER_BASE}${endpoint}`;
14937
+ let response;
14938
+ try {
14939
+ response = await fetch(url2, {
14940
+ method: "POST",
14941
+ headers,
14942
+ body: JSON.stringify(body),
14943
+ credentials: "include",
14944
+ signal: AbortSignal.timeout(3e4)
14945
+ });
14946
+ } catch (err2) {
14947
+ if (err2 instanceof DOMException && err2.name === "TimeoutError") throw ToolError.timeout(`Timed out: ${endpoint}`);
14948
+ throw new ToolError(`Network error: ${err2 instanceof Error ? err2.message : String(err2)}`, "network_error", {
14949
+ category: "internal",
14950
+ retryable: true
14951
+ });
14952
+ }
14953
+ if (!response.ok) {
14954
+ const text2 = (await response.text().catch(() => "")).substring(0, 512);
14955
+ classifyError(response.status, text2, endpoint, response.headers);
14956
+ }
14957
+ if (response.status === 204) return {};
14958
+ const text = await response.text();
14959
+ if (!text) return {};
14960
+ return JSON.parse(text);
14961
+ };
14213
14962
 
14214
14963
  // src/tools/schemas.ts
14215
14964
  var buildPictureUrl = (rootUrl, artifacts) => {
@@ -14515,7 +15264,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
14515
15264
  };
14516
15265
  var src_default = new LinkedInPlugin();
14517
15266
 
14518
- // dist/_adapter_entry_148383e7-f6a7-4bd2-ae0c-94acf82656c0.ts
15267
+ // dist/_adapter_entry_70d0ff71-751a-4e1e-a83c-bda6eeedf74a.ts
15268
+ external_exports.config({ jitless: true });
14519
15269
  if (!globalThis.__openTabs) {
14520
15270
  globalThis.__openTabs = {};
14521
15271
  } else {
@@ -14603,6 +15353,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
14603
15353
  const origHandle = tool.handle;
14604
15354
  tool.handle = async function(...handleArgs) {
14605
15355
  const startTime = performance.now();
15356
+ const runtime = globalThis.__openTabs;
15357
+ runtime._pluginName = "linkedin";
14606
15358
  if (hasLifecycleHooks && typeof src_default.onToolInvocationStart === "function") {
14607
15359
  try {
14608
15360
  src_default.onToolInvocationStart(tool.name);
@@ -14731,5 +15483,5 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
14731
15483
  };
14732
15484
  delete src_default.onDeactivate;
14733
15485
  }
14734
- })();(function(){var o=(globalThis).__openTabs;if(o&&o.adapters&&o.adapters["linkedin"]){var a=o.adapters["linkedin"];a.__adapterHash="53411639085ce18981f1c52399fed3315a2ef8fb45369f16c5dc7a9122143cc1";if(a.tools&&Array.isArray(a.tools)){for(var i=0;i<a.tools.length;i++){Object.freeze(a.tools[i]);}Object.freeze(a.tools);}Object.freeze(a);Object.defineProperty(o.adapters,"linkedin",{value:a,writable:false,configurable:false,enumerable:true});Object.defineProperty(o,"adapters",{value:o.adapters,writable:false,configurable:false});}})();
15486
+ })();(function(){var o=(globalThis).__openTabs;if(o&&o.adapters&&o.adapters["linkedin"]){var a=o.adapters["linkedin"];a.__adapterHash="db0e5f13638fa62205a61e9b48c7cc9e246021a3d0679aefa7127def7ead6bb5";if(a.tools&&Array.isArray(a.tools)){for(var i=0;i<a.tools.length;i++){Object.freeze(a.tools[i]);}Object.freeze(a.tools);}Object.freeze(a);Object.defineProperty(o.adapters,"linkedin",{value:a,writable:false,configurable:false,enumerable:true});Object.defineProperty(o,"adapters",{value:o.adapters,writable:false,configurable:false});}})();
14735
15487
  //# sourceMappingURL=adapter.iife.js.map