@xyd-js/ask-ai-edge 0.0.0-build-aebf977-20251203155725 → 0.0.0-build-2acf05c-20251207022018

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +1242 -1143
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -19020,7 +19020,7 @@ async function* executeTool({
19020
19020
  }
19021
19021
  }
19022
19022
 
19023
- // ../../node_modules/.pnpm/@ai-sdk+gateway@2.0.17_zod@3.25.76/node_modules/@ai-sdk/gateway/dist/index.mjs
19023
+ // ../../node_modules/.pnpm/@ai-sdk+gateway@2.0.18_zod@3.25.76/node_modules/@ai-sdk/gateway/dist/index.mjs
19024
19024
  var import_oidc = __toESM(require_dist(), 1);
19025
19025
  var import_oidc2 = __toESM(require_dist(), 1);
19026
19026
  var marker15 = "vercel.ai.gateway.error";
@@ -19658,7 +19658,7 @@ async function getVercelRequestId() {
19658
19658
  var _a82;
19659
19659
  return (_a82 = import_oidc.getContext().headers) == null ? undefined : _a82["x-vercel-id"];
19660
19660
  }
19661
- var VERSION2 = "2.0.17";
19661
+ var VERSION2 = "2.0.18";
19662
19662
  var AI_GATEWAY_PROTOCOL_VERSION = "0.0.1";
19663
19663
  function createGatewayProvider(options = {}) {
19664
19664
  var _a82, _b8;
@@ -19794,7 +19794,7 @@ async function getGatewayAuthToken(options) {
19794
19794
  }
19795
19795
  }
19796
19796
 
19797
- // ../../node_modules/.pnpm/ai@5.0.104_zod@3.25.76/node_modules/ai/dist/index.mjs
19797
+ // ../../node_modules/.pnpm/ai@5.0.108_zod@3.25.76/node_modules/ai/dist/index.mjs
19798
19798
  var import_api2 = __toESM(require_src(), 1);
19799
19799
  var import_api3 = __toESM(require_src(), 1);
19800
19800
  var __defProp2 = Object.defineProperty;
@@ -20198,7 +20198,7 @@ function detectMediaType({
20198
20198
  }
20199
20199
  return;
20200
20200
  }
20201
- var VERSION3 = "5.0.104";
20201
+ var VERSION3 = "5.0.108";
20202
20202
  var download = async ({ url: url2 }) => {
20203
20203
  var _a16;
20204
20204
  const urlText = url2.toString();
@@ -21191,7 +21191,8 @@ async function parseToolCall({
21191
21191
  input,
21192
21192
  dynamic: true,
21193
21193
  invalid: true,
21194
- error: error40
21194
+ error: error40,
21195
+ providerMetadata: toolCall.providerMetadata
21195
21196
  };
21196
21197
  }
21197
21198
  }
@@ -26668,8 +26669,8 @@ function S(t2) {
26668
26669
  }, S(t2);
26669
26670
  }
26670
26671
 
26671
- // ../../node_modules/.pnpm/@ai-sdk+anthropic@2.0.50_zod@3.25.76/node_modules/@ai-sdk/anthropic/dist/index.mjs
26672
- var VERSION5 = "2.0.50";
26672
+ // ../../node_modules/.pnpm/@ai-sdk+anthropic@2.0.53_zod@3.25.76/node_modules/@ai-sdk/anthropic/dist/index.mjs
26673
+ var VERSION5 = "2.0.53";
26673
26674
  var anthropicErrorDataSchema = lazySchema(() => zodSchema(exports_external.object({
26674
26675
  type: exports_external.literal("error"),
26675
26676
  error: exports_external.object({
@@ -28713,6 +28714,7 @@ var AnthropicMessagesLanguageModel = class {
28713
28714
  };
28714
28715
  }
28715
28716
  async doStream(options) {
28717
+ var _a16, _b9;
28716
28718
  const { args, warnings, betas, usesJsonResponseTool } = await this.getArgs({
28717
28719
  ...options,
28718
28720
  userSuppliedBetas: await this.getBetasFromHeaders(options.headers)
@@ -28742,24 +28744,12 @@ var AnthropicMessagesLanguageModel = class {
28742
28744
  let container = null;
28743
28745
  let blockType = undefined;
28744
28746
  const generateId3 = this.generateId;
28745
- let isFirstChunk = true;
28746
- let stream = undefined;
28747
- const returnPromise = new DelayedPromise;
28748
28747
  const transformedStream = response.pipeThrough(new TransformStream({
28749
28748
  start(controller) {
28750
28749
  controller.enqueue({ type: "stream-start", warnings });
28751
28750
  },
28752
- async flush() {
28753
- if (returnPromise.isPending()) {
28754
- returnPromise.resolve({
28755
- stream,
28756
- request: { body },
28757
- response: { headers: responseHeaders }
28758
- });
28759
- }
28760
- },
28761
28751
  transform(chunk, controller) {
28762
- var _a16, _b9, _c, _d, _e, _f, _g, _h, _i, _j;
28752
+ var _a25, _b23, _c, _d, _e, _f, _g, _h, _i, _j;
28763
28753
  if (options.includeRawChunks) {
28764
28754
  controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
28765
28755
  }
@@ -28767,27 +28757,6 @@ var AnthropicMessagesLanguageModel = class {
28767
28757
  controller.enqueue({ type: "error", error: chunk.error });
28768
28758
  return;
28769
28759
  }
28770
- if (isFirstChunk) {
28771
- if (chunk.value.type === "error") {
28772
- returnPromise.reject(new APICallError({
28773
- message: chunk.value.error.message,
28774
- url: url2,
28775
- requestBodyValues: body,
28776
- statusCode: chunk.value.error.type === "overloaded_error" ? 529 : 500,
28777
- responseHeaders,
28778
- responseBody: JSON.stringify(chunk.value.error),
28779
- isRetryable: chunk.value.error.type === "overloaded_error"
28780
- }));
28781
- controller.terminate();
28782
- return;
28783
- }
28784
- isFirstChunk = false;
28785
- returnPromise.resolve({
28786
- stream,
28787
- request: { body },
28788
- response: { headers: responseHeaders }
28789
- });
28790
- }
28791
28760
  const value = chunk.value;
28792
28761
  switch (value.type) {
28793
28762
  case "ping": {
@@ -28914,11 +28883,11 @@ var AnthropicMessagesLanguageModel = class {
28914
28883
  toolCallId: part.tool_use_id,
28915
28884
  toolName: "web_search",
28916
28885
  result: part.content.map((result) => {
28917
- var _a25;
28886
+ var _a34;
28918
28887
  return {
28919
28888
  url: result.url,
28920
28889
  title: result.title,
28921
- pageAge: (_a25 = result.page_age) != null ? _a25 : null,
28890
+ pageAge: (_a34 = result.page_age) != null ? _a34 : null,
28922
28891
  encryptedContent: result.encrypted_content,
28923
28892
  type: result.type
28924
28893
  };
@@ -28934,7 +28903,7 @@ var AnthropicMessagesLanguageModel = class {
28934
28903
  title: result.title,
28935
28904
  providerMetadata: {
28936
28905
  anthropic: {
28937
- pageAge: (_a16 = result.page_age) != null ? _a16 : null
28906
+ pageAge: (_a25 = result.page_age) != null ? _a25 : null
28938
28907
  }
28939
28908
  }
28940
28909
  });
@@ -29031,7 +29000,7 @@ var AnthropicMessagesLanguageModel = class {
29031
29000
  type: "tool-call",
29032
29001
  toolCallId: contentBlock.toolCallId,
29033
29002
  toolName,
29034
- input: contentBlock.input,
29003
+ input: contentBlock.input === "" ? "{}" : contentBlock.input,
29035
29004
  providerExecuted: contentBlock.providerExecuted
29036
29005
  });
29037
29006
  }
@@ -29127,7 +29096,7 @@ var AnthropicMessagesLanguageModel = class {
29127
29096
  }
29128
29097
  case "message_start": {
29129
29098
  usage.inputTokens = value.message.usage.input_tokens;
29130
- usage.cachedInputTokens = (_b9 = value.message.usage.cache_read_input_tokens) != null ? _b9 : undefined;
29099
+ usage.cachedInputTokens = (_b23 = value.message.usage.cache_read_input_tokens) != null ? _b23 : undefined;
29131
29100
  rawUsage = {
29132
29101
  ...value.message.usage
29133
29102
  };
@@ -29190,23 +29159,34 @@ var AnthropicMessagesLanguageModel = class {
29190
29159
  }
29191
29160
  }));
29192
29161
  const [streamForFirstChunk, streamForConsumer] = transformedStream.tee();
29193
- stream = streamForConsumer;
29194
- const reader = streamForFirstChunk.getReader();
29195
- (async () => {
29196
- try {
29197
- const { done } = await reader.read();
29198
- if (!done) {
29199
- await reader.cancel();
29200
- }
29201
- } catch (error40) {
29202
- try {
29203
- await reader.cancel();
29204
- } catch (e2) {}
29205
- } finally {
29206
- reader.releaseLock();
29162
+ const firstChunkReader = streamForFirstChunk.getReader();
29163
+ try {
29164
+ await firstChunkReader.read();
29165
+ let result = await firstChunkReader.read();
29166
+ if (((_a16 = result.value) == null ? undefined : _a16.type) === "raw") {
29167
+ result = await firstChunkReader.read();
29207
29168
  }
29208
- })();
29209
- return returnPromise.promise;
29169
+ if (((_b9 = result.value) == null ? undefined : _b9.type) === "error") {
29170
+ const error40 = result.value.error;
29171
+ throw new APICallError({
29172
+ message: error40.message,
29173
+ url: url2,
29174
+ requestBodyValues: body,
29175
+ statusCode: error40.type === "overloaded_error" ? 529 : 500,
29176
+ responseHeaders,
29177
+ responseBody: JSON.stringify(error40),
29178
+ isRetryable: error40.type === "overloaded_error"
29179
+ });
29180
+ }
29181
+ } finally {
29182
+ firstChunkReader.cancel().catch(() => {});
29183
+ firstChunkReader.releaseLock();
29184
+ }
29185
+ return {
29186
+ stream: streamForConsumer,
29187
+ request: { body },
29188
+ response: { headers: responseHeaders }
29189
+ };
29210
29190
  }
29211
29191
  };
29212
29192
  function getModelCapabilities(modelId) {
@@ -29468,7 +29448,7 @@ function createAnthropic(options = {}) {
29468
29448
  }
29469
29449
  var anthropic = createAnthropic();
29470
29450
 
29471
- // ../../node_modules/.pnpm/@ai-sdk+openai@2.0.75_zod@3.25.76/node_modules/@ai-sdk/openai/dist/index.mjs
29451
+ // ../../node_modules/.pnpm/@ai-sdk+openai@2.0.77_zod@3.25.76/node_modules/@ai-sdk/openai/dist/index.mjs
29472
29452
  var openaiErrorDataSchema = exports_external.object({
29473
29453
  error: exports_external.object({
29474
29454
  message: exports_external.string(),
@@ -30809,10 +30789,24 @@ var OpenAIEmbeddingModel = class {
30809
30789
  }
30810
30790
  };
30811
30791
  var openaiImageResponseSchema = lazyValidator(() => zodSchema(exports_external.object({
30792
+ created: exports_external.number().nullish(),
30812
30793
  data: exports_external.array(exports_external.object({
30813
30794
  b64_json: exports_external.string(),
30814
30795
  revised_prompt: exports_external.string().nullish()
30815
- }))
30796
+ })),
30797
+ background: exports_external.string().nullish(),
30798
+ output_format: exports_external.string().nullish(),
30799
+ size: exports_external.string().nullish(),
30800
+ quality: exports_external.string().nullish(),
30801
+ usage: exports_external.object({
30802
+ input_tokens: exports_external.number().nullish(),
30803
+ output_tokens: exports_external.number().nullish(),
30804
+ total_tokens: exports_external.number().nullish(),
30805
+ input_tokens_details: exports_external.object({
30806
+ image_tokens: exports_external.number().nullish(),
30807
+ text_tokens: exports_external.number().nullish()
30808
+ }).nullish()
30809
+ }).nullish()
30816
30810
  })));
30817
30811
  var modelMaxImagesPerCall = {
30818
30812
  "dall-e-3": 1,
@@ -30889,9 +30883,14 @@ var OpenAIImageModel = class {
30889
30883
  },
30890
30884
  providerMetadata: {
30891
30885
  openai: {
30892
- images: response.data.map((item) => item.revised_prompt ? {
30893
- revisedPrompt: item.revised_prompt
30894
- } : null)
30886
+ images: response.data.map((item) => ({
30887
+ ...item.revised_prompt ? { revisedPrompt: item.revised_prompt } : {},
30888
+ ...response.created != null ? { created: response.created } : {},
30889
+ ...response.size != null ? { size: response.size } : {},
30890
+ ...response.quality != null ? { quality: response.quality } : {},
30891
+ ...response.background != null ? { background: response.background } : {},
30892
+ ...response.output_format != null ? { outputFormat: response.output_format } : {}
30893
+ }))
30895
30894
  }
30896
30895
  }
30897
30896
  };
@@ -31022,12 +31021,12 @@ var webSearchOutputSchema = lazySchema(() => zodSchema(exports_external.object({
31022
31021
  }),
31023
31022
  exports_external.object({
31024
31023
  type: exports_external.literal("openPage"),
31025
- url: exports_external.string()
31024
+ url: exports_external.string().nullish()
31026
31025
  }),
31027
31026
  exports_external.object({
31028
31027
  type: exports_external.literal("find"),
31029
- url: exports_external.string(),
31030
- pattern: exports_external.string()
31028
+ url: exports_external.string().nullish(),
31029
+ pattern: exports_external.string().nullish()
31031
31030
  })
31032
31031
  ]),
31033
31032
  sources: exports_external.array(exports_external.discriminatedUnion("type", [
@@ -31061,12 +31060,12 @@ var webSearchPreviewOutputSchema = lazySchema(() => zodSchema(exports_external.o
31061
31060
  }),
31062
31061
  exports_external.object({
31063
31062
  type: exports_external.literal("openPage"),
31064
- url: exports_external.string()
31063
+ url: exports_external.string().nullish()
31065
31064
  }),
31066
31065
  exports_external.object({
31067
31066
  type: exports_external.literal("find"),
31068
- url: exports_external.string(),
31069
- pattern: exports_external.string()
31067
+ url: exports_external.string().nullish(),
31068
+ pattern: exports_external.string().nullish()
31070
31069
  })
31071
31070
  ])
31072
31071
  })));
@@ -31514,12 +31513,12 @@ var openaiResponsesChunkSchema = lazyValidator(() => zodSchema(exports_external.
31514
31513
  }),
31515
31514
  exports_external.object({
31516
31515
  type: exports_external.literal("open_page"),
31517
- url: exports_external.string()
31516
+ url: exports_external.string().nullish()
31518
31517
  }),
31519
31518
  exports_external.object({
31520
31519
  type: exports_external.literal("find"),
31521
- url: exports_external.string(),
31522
- pattern: exports_external.string()
31520
+ url: exports_external.string().nullish(),
31521
+ pattern: exports_external.string().nullish()
31523
31522
  })
31524
31523
  ])
31525
31524
  }),
@@ -31706,12 +31705,12 @@ var openaiResponsesResponseSchema = lazyValidator(() => zodSchema(exports_extern
31706
31705
  }),
31707
31706
  exports_external.object({
31708
31707
  type: exports_external.literal("open_page"),
31709
- url: exports_external.string()
31708
+ url: exports_external.string().nullish()
31710
31709
  }),
31711
31710
  exports_external.object({
31712
31711
  type: exports_external.literal("find"),
31713
- url: exports_external.string(),
31714
- pattern: exports_external.string()
31712
+ url: exports_external.string().nullish(),
31713
+ pattern: exports_external.string().nullish()
31715
31714
  })
31716
31715
  ])
31717
31716
  }),
@@ -33376,7 +33375,7 @@ var OpenAITranscriptionModel = class {
33376
33375
  };
33377
33376
  }
33378
33377
  };
33379
- var VERSION6 = "2.0.75";
33378
+ var VERSION6 = "2.0.77";
33380
33379
  function createOpenAI(options = {}) {
33381
33380
  var _a16, _b9;
33382
33381
  const baseURL = (_a16 = withoutTrailingSlash(loadOptionalSetting({
@@ -33524,10 +33523,10 @@ function P(n3) {
33524
33523
  return Object.defineProperty(this, "value", { value: e2 }), e2;
33525
33524
  } };
33526
33525
  }
33527
- function Z(n3) {
33526
+ function C(n3) {
33528
33527
  return n3 == null;
33529
33528
  }
33530
- function C(n3) {
33529
+ function Z(n3) {
33531
33530
  var e2 = n3.startsWith("^") ? 1 : 0, t2 = n3.endsWith("$") ? n3.length - 1 : n3.length;
33532
33531
  return n3.slice(e2, t2);
33533
33532
  }
@@ -33539,10 +33538,10 @@ function A(n3, e2, t2) {
33539
33538
  Object.defineProperty(n3, e2, { value: t3 });
33540
33539
  }, configurable: true });
33541
33540
  }
33542
- function U(n3, e2, t2) {
33541
+ function R(n3, e2, t2) {
33543
33542
  Object.defineProperty(n3, e2, { value: t2, writable: true, enumerable: true, configurable: true });
33544
33543
  }
33545
- function R(n3) {
33544
+ function U(n3) {
33546
33545
  return JSON.stringify(n3);
33547
33546
  }
33548
33547
  var S2 = Error.captureStackTrace ? Error.captureStackTrace : function() {};
@@ -33594,7 +33593,7 @@ function L(n3) {
33594
33593
  } }) : e2;
33595
33594
  }
33596
33595
  var D = { safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER], int32: [-2147483648, 2147483647], uint32: [0, 4294967295], float32: [-340282346638528860000000000000000000000, 340282346638528860000000000000000000000], float64: [-Number.MAX_VALUE, Number.MAX_VALUE] };
33597
- function V(n3) {
33596
+ function q(n3) {
33598
33597
  for (var e2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;e2 < n3.issues.length; e2++) {
33599
33598
  var t2;
33600
33599
  if (((t2 = n3.issues[e2]) === null || t2 === undefined ? undefined : t2.continue) !== true)
@@ -33602,7 +33601,7 @@ function V(n3) {
33602
33601
  }
33603
33602
  return false;
33604
33603
  }
33605
- function q(n3, e2) {
33604
+ function V(n3, e2) {
33606
33605
  return e2.map(function(e3) {
33607
33606
  var t2, r2;
33608
33607
  return (t2 = (r2 = e3).path) !== null && t2 !== undefined || (r2.path = []), e3.path.unshift(n3), e3;
@@ -33740,8 +33739,8 @@ var hn = function(n3) {
33740
33739
  var vn = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
33741
33740
  var mn = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
33742
33741
  var _n = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/;
33743
- var yn = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;
33744
- var gn = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
33742
+ var gn = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;
33743
+ var yn = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
33745
33744
  var wn = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
33746
33745
  var kn = /^[A-Za-z0-9_-]*$/;
33747
33746
  var bn = /^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;
@@ -33754,17 +33753,18 @@ function Tn(n3) {
33754
33753
  }
33755
33754
  var En = /^\d+$/;
33756
33755
  var Pn = /^-?\d+(?:\.\d+)?/i;
33757
- var Zn = /true|false/i;
33758
- var Cn = /^[^A-Z]*$/;
33759
- var An = /^[^a-z]*$/;
33756
+ var Cn = /true|false/i;
33757
+ var Zn = /null/i;
33758
+ var An = /^[^A-Z]*$/;
33759
+ var Rn = /^[^a-z]*$/;
33760
33760
  var Un = z("$ZodCheck", function(n3, e2) {
33761
33761
  var t2, r2, o2;
33762
33762
  (t2 = n3._zod) !== null && t2 !== undefined || (n3._zod = {}), n3._zod.def = e2, (r2 = (o2 = n3._zod).onattach) !== null && r2 !== undefined || (o2.onattach = []);
33763
33763
  });
33764
- var Rn = { number: "number", bigint: "bigint", object: "date" };
33765
- var Sn = z("$ZodCheckLessThan", function(n3, e2) {
33764
+ var Sn = { number: "number", bigint: "bigint", object: "date" };
33765
+ var On = z("$ZodCheckLessThan", function(n3, e2) {
33766
33766
  Un.init(n3, e2);
33767
- var t2 = Rn[j(e2.value)];
33767
+ var t2 = Sn[j(e2.value)];
33768
33768
  n3._zod.onattach.push(function(n4) {
33769
33769
  var t3, r2 = n4._zod.bag, o2 = (t3 = e2.inclusive ? r2.maximum : r2.exclusiveMaximum) !== null && t3 !== undefined ? t3 : Number.POSITIVE_INFINITY;
33770
33770
  e2.value < o2 && (e2.inclusive ? r2.maximum = e2.value : r2.exclusiveMaximum = e2.value);
@@ -33772,9 +33772,9 @@ var Sn = z("$ZodCheckLessThan", function(n3, e2) {
33772
33772
  (e2.inclusive ? r2.value <= e2.value : r2.value < e2.value) || r2.issues.push({ origin: t2, code: "too_big", maximum: e2.value, input: r2.value, inclusive: e2.inclusive, inst: n3, continue: !e2.abort });
33773
33773
  };
33774
33774
  });
33775
- var On = z("$ZodCheckGreaterThan", function(n3, e2) {
33775
+ var $n = z("$ZodCheckGreaterThan", function(n3, e2) {
33776
33776
  Un.init(n3, e2);
33777
- var t2 = Rn[j(e2.value)];
33777
+ var t2 = Sn[j(e2.value)];
33778
33778
  n3._zod.onattach.push(function(n4) {
33779
33779
  var t3, r2 = n4._zod.bag, o2 = (t3 = e2.inclusive ? r2.minimum : r2.exclusiveMinimum) !== null && t3 !== undefined ? t3 : Number.NEGATIVE_INFINITY;
33780
33780
  e2.value > o2 && (e2.inclusive ? r2.minimum = e2.value : r2.exclusiveMinimum = e2.value);
@@ -33782,7 +33782,7 @@ var On = z("$ZodCheckGreaterThan", function(n3, e2) {
33782
33782
  (e2.inclusive ? r2.value >= e2.value : r2.value > e2.value) || r2.issues.push({ origin: t2, code: "too_small", minimum: e2.value, input: r2.value, inclusive: e2.inclusive, inst: n3, continue: !e2.abort });
33783
33783
  };
33784
33784
  });
33785
- var $n = z("$ZodCheckMultipleOf", function(n3, e2) {
33785
+ var jn = z("$ZodCheckMultipleOf", function(n3, e2) {
33786
33786
  Un.init(n3, e2), n3._zod.onattach.push(function(n4) {
33787
33787
  var t2, r2;
33788
33788
  (t2 = (r2 = n4._zod.bag).multipleOf) !== null && t2 !== undefined || (r2.multipleOf = e2.value);
@@ -33793,7 +33793,7 @@ var $n = z("$ZodCheckMultipleOf", function(n3, e2) {
33793
33793
  (typeof t2.value == "bigint" ? t2.value % e2.value === BigInt(0) : (r2 = t2.value, o2 = e2.value, i2 = (r2.toString().split(".")[1] || "").length, a2 = (o2.toString().split(".")[1] || "").length, u2 = i2 > a2 ? i2 : a2, Number.parseInt(r2.toFixed(u2).replace(".", "")) % Number.parseInt(o2.toFixed(u2).replace(".", "")) / Math.pow(10, u2)) === 0) || t2.issues.push({ origin: j(t2.value), code: "not_multiple_of", divisor: e2.value, input: t2.value, inst: n3, continue: !e2.abort });
33794
33794
  };
33795
33795
  });
33796
- var jn = z("$ZodCheckNumberFormat", function(n3, e2) {
33796
+ var Nn = z("$ZodCheckNumberFormat", function(n3, e2) {
33797
33797
  var t2;
33798
33798
  Un.init(n3, e2), e2.format = e2.format || "float64";
33799
33799
  var r2 = (t2 = e2.format) === null || t2 === undefined ? undefined : t2.includes("int"), o2 = r2 ? "int" : "number", i2 = m(D[e2.format], 2), a2 = i2[0], u2 = i2[1];
@@ -33811,11 +33811,11 @@ var jn = z("$ZodCheckNumberFormat", function(n3, e2) {
33811
33811
  i3 < a2 && t3.issues.push({ origin: "number", input: i3, code: "too_small", minimum: a2, inclusive: true, inst: n3, continue: !e2.abort }), i3 > u2 && t3.issues.push({ origin: "number", input: i3, code: "too_big", maximum: u2, inst: n3 });
33812
33812
  };
33813
33813
  });
33814
- var Nn = z("$ZodCheckMaxSize", function(n3, e2) {
33814
+ var Mn = z("$ZodCheckMaxSize", function(n3, e2) {
33815
33815
  var t2, r2;
33816
33816
  Un.init(n3, e2), (t2 = (r2 = n3._zod.def).when) !== null && t2 !== undefined || (r2.when = function(n4) {
33817
33817
  var e3 = n4.value;
33818
- return !Z(e3) && e3.size !== undefined;
33818
+ return !C(e3) && e3.size !== undefined;
33819
33819
  }), n3._zod.onattach.push(function(n4) {
33820
33820
  var t3, r3 = (t3 = n4._zod.bag.maximum) !== null && t3 !== undefined ? t3 : Number.POSITIVE_INFINITY;
33821
33821
  e2.maximum < r3 && (n4._zod.bag.maximum = e2.maximum);
@@ -33824,11 +33824,11 @@ var Nn = z("$ZodCheckMaxSize", function(n3, e2) {
33824
33824
  r3.size <= e2.maximum || t3.issues.push({ origin: B(r3), code: "too_big", maximum: e2.maximum, input: r3, inst: n3, continue: !e2.abort });
33825
33825
  };
33826
33826
  });
33827
- var Mn = z("$ZodCheckMinSize", function(n3, e2) {
33827
+ var Fn = z("$ZodCheckMinSize", function(n3, e2) {
33828
33828
  var t2, r2;
33829
33829
  Un.init(n3, e2), (t2 = (r2 = n3._zod.def).when) !== null && t2 !== undefined || (r2.when = function(n4) {
33830
33830
  var e3 = n4.value;
33831
- return !Z(e3) && e3.size !== undefined;
33831
+ return !C(e3) && e3.size !== undefined;
33832
33832
  }), n3._zod.onattach.push(function(n4) {
33833
33833
  var t3, r3 = (t3 = n4._zod.bag.minimum) !== null && t3 !== undefined ? t3 : Number.NEGATIVE_INFINITY;
33834
33834
  e2.minimum > r3 && (n4._zod.bag.minimum = e2.minimum);
@@ -33837,11 +33837,11 @@ var Mn = z("$ZodCheckMinSize", function(n3, e2) {
33837
33837
  r3.size >= e2.minimum || t3.issues.push({ origin: B(r3), code: "too_small", minimum: e2.minimum, input: r3, inst: n3, continue: !e2.abort });
33838
33838
  };
33839
33839
  });
33840
- var Fn = z("$ZodCheckSizeEquals", function(n3, e2) {
33840
+ var Ln = z("$ZodCheckSizeEquals", function(n3, e2) {
33841
33841
  var t2, r2;
33842
33842
  Un.init(n3, e2), (t2 = (r2 = n3._zod.def).when) !== null && t2 !== undefined || (r2.when = function(n4) {
33843
33843
  var e3 = n4.value;
33844
- return !Z(e3) && e3.size !== undefined;
33844
+ return !C(e3) && e3.size !== undefined;
33845
33845
  }), n3._zod.onattach.push(function(n4) {
33846
33846
  var t3 = n4._zod.bag;
33847
33847
  t3.minimum = e2.size, t3.maximum = e2.size, t3.size = e2.size;
@@ -33853,11 +33853,11 @@ var Fn = z("$ZodCheckSizeEquals", function(n3, e2) {
33853
33853
  }
33854
33854
  };
33855
33855
  });
33856
- var Ln = z("$ZodCheckMaxLength", function(n3, e2) {
33856
+ var Dn = z("$ZodCheckMaxLength", function(n3, e2) {
33857
33857
  var t2, r2;
33858
33858
  Un.init(n3, e2), (t2 = (r2 = n3._zod.def).when) !== null && t2 !== undefined || (r2.when = function(n4) {
33859
33859
  var e3 = n4.value;
33860
- return !Z(e3) && e3.length !== undefined;
33860
+ return !C(e3) && e3.length !== undefined;
33861
33861
  }), n3._zod.onattach.push(function(n4) {
33862
33862
  var t3, r3 = (t3 = n4._zod.bag.maximum) !== null && t3 !== undefined ? t3 : Number.POSITIVE_INFINITY;
33863
33863
  e2.maximum < r3 && (n4._zod.bag.maximum = e2.maximum);
@@ -33869,11 +33869,11 @@ var Ln = z("$ZodCheckMaxLength", function(n3, e2) {
33869
33869
  }
33870
33870
  };
33871
33871
  });
33872
- var Dn = z("$ZodCheckMinLength", function(n3, e2) {
33872
+ var qn = z("$ZodCheckMinLength", function(n3, e2) {
33873
33873
  var t2, r2;
33874
33874
  Un.init(n3, e2), (t2 = (r2 = n3._zod.def).when) !== null && t2 !== undefined || (r2.when = function(n4) {
33875
33875
  var e3 = n4.value;
33876
- return !Z(e3) && e3.length !== undefined;
33876
+ return !C(e3) && e3.length !== undefined;
33877
33877
  }), n3._zod.onattach.push(function(n4) {
33878
33878
  var t3, r3 = (t3 = n4._zod.bag.minimum) !== null && t3 !== undefined ? t3 : Number.NEGATIVE_INFINITY;
33879
33879
  e2.minimum > r3 && (n4._zod.bag.minimum = e2.minimum);
@@ -33889,7 +33889,7 @@ var Vn = z("$ZodCheckLengthEquals", function(n3, e2) {
33889
33889
  var t2, r2;
33890
33890
  Un.init(n3, e2), (t2 = (r2 = n3._zod.def).when) !== null && t2 !== undefined || (r2.when = function(n4) {
33891
33891
  var e3 = n4.value;
33892
- return !Z(e3) && e3.length !== undefined;
33892
+ return !C(e3) && e3.length !== undefined;
33893
33893
  }), n3._zod.onattach.push(function(n4) {
33894
33894
  var t3 = n4._zod.bag;
33895
33895
  t3.minimum = e2.length, t3.maximum = e2.length, t3.length = e2.length;
@@ -33901,7 +33901,7 @@ var Vn = z("$ZodCheckLengthEquals", function(n3, e2) {
33901
33901
  }
33902
33902
  };
33903
33903
  });
33904
- var qn = z("$ZodCheckStringFormat", function(n3, e2) {
33904
+ var Wn = z("$ZodCheckStringFormat", function(n3, e2) {
33905
33905
  var t2, r2, i2, a2;
33906
33906
  Un.init(n3, e2), n3._zod.onattach.push(function(n4) {
33907
33907
  var t3, r3 = n4._zod.bag;
@@ -33910,20 +33910,20 @@ var qn = z("$ZodCheckStringFormat", function(n3, e2) {
33910
33910
  e2.pattern.lastIndex = 0, e2.pattern.test(t3.value) || t3.issues.push(b(b({ origin: "string", code: "invalid_format", format: e2.format, input: t3.value }, e2.pattern ? { pattern: e2.pattern.toString() } : {}), {}, { inst: n3, continue: !e2.abort }));
33911
33911
  }) : (r2 = (a2 = n3._zod).check) !== null && r2 !== undefined || (a2.check = function() {});
33912
33912
  });
33913
- var Wn = z("$ZodCheckRegex", function(n3, e2) {
33914
- qn.init(n3, e2), n3._zod.check = function(t2) {
33913
+ var Hn = z("$ZodCheckRegex", function(n3, e2) {
33914
+ Wn.init(n3, e2), n3._zod.check = function(t2) {
33915
33915
  e2.pattern.lastIndex = 0, e2.pattern.test(t2.value) || t2.issues.push({ origin: "string", code: "invalid_format", format: "regex", input: t2.value, pattern: e2.pattern.toString(), inst: n3, continue: !e2.abort });
33916
33916
  };
33917
33917
  });
33918
- var Hn = z("$ZodCheckLowerCase", function(n3, e2) {
33918
+ var Bn = z("$ZodCheckLowerCase", function(n3, e2) {
33919
33919
  var t2;
33920
- (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = Cn), qn.init(n3, e2);
33920
+ (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = An), Wn.init(n3, e2);
33921
33921
  });
33922
- var Bn = z("$ZodCheckUpperCase", function(n3, e2) {
33922
+ var Gn = z("$ZodCheckUpperCase", function(n3, e2) {
33923
33923
  var t2;
33924
- (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = An), qn.init(n3, e2);
33924
+ (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = Rn), Wn.init(n3, e2);
33925
33925
  });
33926
- var Gn = z("$ZodCheckIncludes", function(n3, e2) {
33926
+ var Jn = z("$ZodCheckIncludes", function(n3, e2) {
33927
33927
  Un.init(n3, e2);
33928
33928
  var t2 = M(e2.includes), r2 = new RegExp(typeof e2.position == "number" ? "^.{".concat(e2.position, "}").concat(t2) : t2);
33929
33929
  e2.pattern = r2, n3._zod.onattach.push(function(n4) {
@@ -33933,7 +33933,7 @@ var Gn = z("$ZodCheckIncludes", function(n3, e2) {
33933
33933
  t3.value.includes(e2.includes, e2.position) || t3.issues.push({ origin: "string", code: "invalid_format", format: "includes", includes: e2.includes, input: t3.value, inst: n3, continue: !e2.abort });
33934
33934
  };
33935
33935
  });
33936
- var Jn = z("$ZodCheckStartsWith", function(n3, e2) {
33936
+ var Kn = z("$ZodCheckStartsWith", function(n3, e2) {
33937
33937
  var t2;
33938
33938
  Un.init(n3, e2);
33939
33939
  var r2 = new RegExp("^".concat(M(e2.prefix), ".*"));
@@ -33944,7 +33944,7 @@ var Jn = z("$ZodCheckStartsWith", function(n3, e2) {
33944
33944
  t3.value.startsWith(e2.prefix) || t3.issues.push({ origin: "string", code: "invalid_format", format: "starts_with", prefix: e2.prefix, input: t3.value, inst: n3, continue: !e2.abort });
33945
33945
  };
33946
33946
  });
33947
- var Kn = z("$ZodCheckEndsWith", function(n3, e2) {
33947
+ var Yn = z("$ZodCheckEndsWith", function(n3, e2) {
33948
33948
  var t2;
33949
33949
  Un.init(n3, e2);
33950
33950
  var r2 = new RegExp(".*".concat(M(e2.suffix), "$"));
@@ -33955,21 +33955,21 @@ var Kn = z("$ZodCheckEndsWith", function(n3, e2) {
33955
33955
  t3.value.endsWith(e2.suffix) || t3.issues.push({ origin: "string", code: "invalid_format", format: "ends_with", suffix: e2.suffix, input: t3.value, inst: n3, continue: !e2.abort });
33956
33956
  };
33957
33957
  });
33958
- function Yn(n3, e2, t2) {
33958
+ function Xn(n3, e2, t2) {
33959
33959
  var r2;
33960
- n3.issues.length && (r2 = e2.issues).push.apply(r2, O(q(t2, n3.issues)));
33960
+ n3.issues.length && (r2 = e2.issues).push.apply(r2, O(V(t2, n3.issues)));
33961
33961
  }
33962
- var Xn = z("$ZodCheckProperty", function(n3, e2) {
33962
+ var Qn = z("$ZodCheckProperty", function(n3, e2) {
33963
33963
  Un.init(n3, e2), n3._zod.check = function(n4) {
33964
33964
  var t2 = e2.schema._zod.run({ value: n4.value[e2.property], issues: [] }, {});
33965
33965
  if (t2 instanceof Promise)
33966
33966
  return t2.then(function(t3) {
33967
- return Yn(t3, n4, e2.property);
33967
+ return Xn(t3, n4, e2.property);
33968
33968
  });
33969
- Yn(t2, n4, e2.property);
33969
+ Xn(t2, n4, e2.property);
33970
33970
  };
33971
33971
  });
33972
- var Qn = z("$ZodCheckMimeType", function(n3, e2) {
33972
+ var ne = z("$ZodCheckMimeType", function(n3, e2) {
33973
33973
  Un.init(n3, e2);
33974
33974
  var t2 = new Set(e2.mime);
33975
33975
  n3._zod.onattach.push(function(n4) {
@@ -33978,12 +33978,12 @@ var Qn = z("$ZodCheckMimeType", function(n3, e2) {
33978
33978
  t2.has(r2.value.type) || r2.issues.push({ code: "invalid_value", values: e2.mime, input: r2.value.type, inst: n3 });
33979
33979
  };
33980
33980
  });
33981
- var ne = z("$ZodCheckOverwrite", function(n3, e2) {
33981
+ var ee = z("$ZodCheckOverwrite", function(n3, e2) {
33982
33982
  Un.init(n3, e2), n3._zod.check = function(n4) {
33983
33983
  n4.value = e2.tx(n4.value);
33984
33984
  };
33985
33985
  });
33986
- var ee = function() {
33986
+ var te = function() {
33987
33987
  return c(function n() {
33988
33988
  var e2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
33989
33989
  o(this, n), this.content = [], this.indent = 0, this && (this.args = e2);
@@ -34021,10 +34021,10 @@ var ee = function() {
34021
34021
  `)]));
34022
34022
  } }]);
34023
34023
  }();
34024
- var te = { major: 4, minor: 0, patch: 0 };
34025
- var re = z("$ZodType", function(n3, e2) {
34024
+ var re = { major: 4, minor: 0, patch: 0 };
34025
+ var oe = z("$ZodType", function(n3, e2) {
34026
34026
  var t2, r2;
34027
- n3 != null || (n3 = {}), n3._zod.def = e2, n3._zod.bag = n3._zod.bag || {}, n3._zod.version = te;
34027
+ n3 != null || (n3 = {}), n3._zod.def = e2, n3._zod.bag = n3._zod.bag || {}, n3._zod.version = re;
34028
34028
  var o2 = O((t2 = n3._zod.def.checks) !== null && t2 !== undefined ? t2 : []);
34029
34029
  n3._zod.traits.has("$ZodCheck") && o2.unshift(n3);
34030
34030
  var u2, s2 = a(o2);
@@ -34053,7 +34053,7 @@ var re = z("$ZodType", function(n3, e2) {
34053
34053
  });
34054
34054
  } else {
34055
34055
  var m2 = function(n4, e3, t3) {
34056
- var r3, o3, u3 = V(n4), s3 = a(e3);
34056
+ var r3, o3, u3 = q(n4), s3 = a(e3);
34057
34057
  try {
34058
34058
  var l3 = function() {
34059
34059
  var e4 = o3.value;
@@ -34079,7 +34079,7 @@ var re = z("$ZodType", function(n3, e2) {
34079
34079
  }
34080
34080
  return e5.a(2);
34081
34081
  case 2:
34082
- u3 || (u3 = V(n4, s4));
34082
+ u3 || (u3 = q(n4, s4));
34083
34083
  case 3:
34084
34084
  return e5.a(2);
34085
34085
  }
@@ -34088,7 +34088,7 @@ var re = z("$ZodType", function(n3, e2) {
34088
34088
  else {
34089
34089
  if (n4.issues.length === s4)
34090
34090
  return 0;
34091
- u3 || (u3 = V(n4, s4));
34091
+ u3 || (u3 = q(n4, s4));
34092
34092
  }
34093
34093
  };
34094
34094
  for (s3.s();!(o3 = s3.n()).done; )
@@ -34126,9 +34126,9 @@ var re = z("$ZodType", function(n3, e2) {
34126
34126
  }
34127
34127
  }, vendor: "zod", version: 1 };
34128
34128
  });
34129
- var oe = z("$ZodString", function(n3, e2) {
34129
+ var ie = z("$ZodString", function(n3, e2) {
34130
34130
  var t2, r2, o2, i2, a2, u2, s2;
34131
- re.init(n3, e2), n3._zod.pattern = (t2 = O((r2 = n3 == null || (o2 = n3._zod.bag) === null || o2 === undefined ? undefined : o2.patterns) !== null && r2 !== undefined ? r2 : []).pop()) !== null && t2 !== undefined ? t2 : (i2 = n3._zod.bag, s2 = i2 ? "[\\s\\S]{".concat((a2 = i2 == null ? undefined : i2.minimum) !== null && a2 !== undefined ? a2 : 0, ",").concat((u2 = i2 == null ? undefined : i2.maximum) !== null && u2 !== undefined ? u2 : "", "}") : "[\\s\\S]*", new RegExp("^".concat(s2, "$"))), n3._zod.parse = function(t3, r3) {
34131
+ oe.init(n3, e2), n3._zod.pattern = (t2 = O((r2 = n3 == null || (o2 = n3._zod.bag) === null || o2 === undefined ? undefined : o2.patterns) !== null && r2 !== undefined ? r2 : []).pop()) !== null && t2 !== undefined ? t2 : (i2 = n3._zod.bag, s2 = i2 ? "[\\s\\S]{".concat((a2 = i2 == null ? undefined : i2.minimum) !== null && a2 !== undefined ? a2 : 0, ",").concat((u2 = i2 == null ? undefined : i2.maximum) !== null && u2 !== undefined ? u2 : "", "}") : "[\\s\\S]*", new RegExp("^".concat(s2, "$"))), n3._zod.parse = function(t3, r3) {
34132
34132
  if (e2.coerce)
34133
34133
  try {
34134
34134
  t3.value = String(t3.value);
@@ -34136,14 +34136,14 @@ var oe = z("$ZodString", function(n3, e2) {
34136
34136
  return typeof t3.value == "string" || t3.issues.push({ expected: "string", code: "invalid_type", input: t3.value, inst: n3 }), t3;
34137
34137
  };
34138
34138
  });
34139
- var ie = z("$ZodStringFormat", function(n3, e2) {
34140
- qn.init(n3, e2), oe.init(n3, e2);
34139
+ var ae = z("$ZodStringFormat", function(n3, e2) {
34140
+ Wn.init(n3, e2), ie.init(n3, e2);
34141
34141
  });
34142
- var ae = z("$ZodGUID", function(n3, e2) {
34142
+ var ue = z("$ZodGUID", function(n3, e2) {
34143
34143
  var t2;
34144
- (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = fn), ie.init(n3, e2);
34144
+ (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = fn), ae.init(n3, e2);
34145
34145
  });
34146
- var ue = z("$ZodUUID", function(n3, e2) {
34146
+ var se = z("$ZodUUID", function(n3, e2) {
34147
34147
  var t2;
34148
34148
  if (e2.version) {
34149
34149
  var r2, o2 = { v1: 1, v2: 2, v3: 3, v4: 4, v5: 5, v6: 6, v7: 7, v8: 8 }[e2.version];
@@ -34152,14 +34152,14 @@ var ue = z("$ZodUUID", function(n3, e2) {
34152
34152
  (r2 = e2.pattern) !== null && r2 !== undefined || (e2.pattern = hn(o2));
34153
34153
  } else
34154
34154
  (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = hn());
34155
- ie.init(n3, e2);
34155
+ ae.init(n3, e2);
34156
34156
  });
34157
- var se = z("$ZodEmail", function(n3, e2) {
34157
+ var ce = z("$ZodEmail", function(n3, e2) {
34158
34158
  var t2;
34159
- (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = vn), ie.init(n3, e2);
34159
+ (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = vn), ae.init(n3, e2);
34160
34160
  });
34161
- var ce = z("$ZodURL", function(n3, e2) {
34162
- ie.init(n3, e2), n3._zod.check = function(t2) {
34161
+ var le = z("$ZodURL", function(n3, e2) {
34162
+ ae.init(n3, e2), n3._zod.check = function(t2) {
34163
34163
  try {
34164
34164
  var r2 = t2.value, o2 = new URL(r2), i2 = o2.href;
34165
34165
  return e2.hostname && (e2.hostname.lastIndex = 0, e2.hostname.test(o2.hostname) || t2.issues.push({ code: "invalid_format", format: "url", note: "Invalid hostname", pattern: bn.source, input: t2.value, inst: n3, continue: !e2.abort })), e2.protocol && (e2.protocol.lastIndex = 0, e2.protocol.test(o2.protocol.endsWith(":") ? o2.protocol.slice(0, -1) : o2.protocol) || t2.issues.push({ code: "invalid_format", format: "url", note: "Invalid protocol", pattern: e2.protocol.source, input: t2.value, inst: n3, continue: !e2.abort })), void (!r2.endsWith("/") && i2.endsWith("/") ? t2.value = i2.slice(0, -1) : t2.value = i2);
@@ -34168,64 +34168,64 @@ var ce = z("$ZodURL", function(n3, e2) {
34168
34168
  }
34169
34169
  };
34170
34170
  });
34171
- var le = z("$ZodEmoji", function(n3, e2) {
34171
+ var de = z("$ZodEmoji", function(n3, e2) {
34172
34172
  var t2;
34173
- (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")), ie.init(n3, e2);
34173
+ (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")), ae.init(n3, e2);
34174
34174
  });
34175
- var de = z("$ZodNanoID", function(n3, e2) {
34175
+ var pe = z("$ZodNanoID", function(n3, e2) {
34176
34176
  var t2;
34177
- (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = dn), ie.init(n3, e2);
34177
+ (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = dn), ae.init(n3, e2);
34178
34178
  });
34179
- var pe = z("$ZodCUID", function(n3, e2) {
34179
+ var fe = z("$ZodCUID", function(n3, e2) {
34180
34180
  var t2;
34181
- (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = an), ie.init(n3, e2);
34181
+ (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = an), ae.init(n3, e2);
34182
34182
  });
34183
- var fe = z("$ZodCUID2", function(n3, e2) {
34183
+ var he = z("$ZodCUID2", function(n3, e2) {
34184
34184
  var t2;
34185
- (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = un), ie.init(n3, e2);
34185
+ (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = un), ae.init(n3, e2);
34186
34186
  });
34187
- var he = z("$ZodULID", function(n3, e2) {
34187
+ var ve = z("$ZodULID", function(n3, e2) {
34188
34188
  var t2;
34189
- (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = sn), ie.init(n3, e2);
34189
+ (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = sn), ae.init(n3, e2);
34190
34190
  });
34191
- var ve = z("$ZodXID", function(n3, e2) {
34191
+ var me = z("$ZodXID", function(n3, e2) {
34192
34192
  var t2;
34193
- (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = cn), ie.init(n3, e2);
34193
+ (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = cn), ae.init(n3, e2);
34194
34194
  });
34195
- var me = z("$ZodKSUID", function(n3, e2) {
34195
+ var _e = z("$ZodKSUID", function(n3, e2) {
34196
34196
  var t2;
34197
- (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = ln), ie.init(n3, e2);
34197
+ (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = ln), ae.init(n3, e2);
34198
34198
  });
34199
- var _e = z("$ZodISODateTime", function(n3, e2) {
34199
+ var ge = z("$ZodISODateTime", function(n3, e2) {
34200
34200
  var t2;
34201
34201
  (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = function(n4) {
34202
34202
  var e3 = Tn({ precision: n4.precision }), t3 = ["Z"];
34203
34203
  n4.local && t3.push(""), n4.offset && t3.push("([+-]\\d{2}:\\d{2})");
34204
34204
  var r2 = "".concat(e3, "(?:").concat(t3.join("|"), ")");
34205
34205
  return new RegExp("^".concat(xn, "T(?:").concat(r2, ")$"));
34206
- }(e2)), ie.init(n3, e2);
34206
+ }(e2)), ae.init(n3, e2);
34207
34207
  });
34208
34208
  var ye = z("$ZodISODate", function(n3, e2) {
34209
34209
  var t2;
34210
- (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = In), ie.init(n3, e2);
34210
+ (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = In), ae.init(n3, e2);
34211
34211
  });
34212
- var ge = z("$ZodISOTime", function(n3, e2) {
34212
+ var we = z("$ZodISOTime", function(n3, e2) {
34213
34213
  var t2;
34214
- (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = new RegExp("^".concat(Tn(e2), "$"))), ie.init(n3, e2);
34214
+ (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = new RegExp("^".concat(Tn(e2), "$"))), ae.init(n3, e2);
34215
34215
  });
34216
- var we = z("$ZodISODuration", function(n3, e2) {
34216
+ var ke = z("$ZodISODuration", function(n3, e2) {
34217
34217
  var t2;
34218
- (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = pn), ie.init(n3, e2);
34218
+ (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = pn), ae.init(n3, e2);
34219
34219
  });
34220
- var ke = z("$ZodIPv4", function(n3, e2) {
34220
+ var be = z("$ZodIPv4", function(n3, e2) {
34221
34221
  var t2;
34222
- (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = mn), ie.init(n3, e2), n3._zod.onattach.push(function(n4) {
34222
+ (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = mn), ae.init(n3, e2), n3._zod.onattach.push(function(n4) {
34223
34223
  n4._zod.bag.format = "ipv4";
34224
34224
  });
34225
34225
  });
34226
- var be = z("$ZodIPv6", function(n3, e2) {
34226
+ var ze = z("$ZodIPv6", function(n3, e2) {
34227
34227
  var t2;
34228
- (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = _n), ie.init(n3, e2), n3._zod.onattach.push(function(n4) {
34228
+ (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = _n), ae.init(n3, e2), n3._zod.onattach.push(function(n4) {
34229
34229
  n4._zod.bag.format = "ipv6";
34230
34230
  }), n3._zod.check = function(t3) {
34231
34231
  try {
@@ -34235,13 +34235,13 @@ var be = z("$ZodIPv6", function(n3, e2) {
34235
34235
  }
34236
34236
  };
34237
34237
  });
34238
- var ze = z("$ZodCIDRv4", function(n3, e2) {
34238
+ var xe = z("$ZodCIDRv4", function(n3, e2) {
34239
34239
  var t2;
34240
- (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = yn), ie.init(n3, e2);
34240
+ (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = gn), ae.init(n3, e2);
34241
34241
  });
34242
- var xe = z("$ZodCIDRv6", function(n3, e2) {
34242
+ var Ie = z("$ZodCIDRv6", function(n3, e2) {
34243
34243
  var t2;
34244
- (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = gn), ie.init(n3, e2), n3._zod.check = function(t3) {
34244
+ (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = yn), ae.init(n3, e2), n3._zod.check = function(t3) {
34245
34245
  var r2 = t3.value.split("/"), o2 = m(r2, 2), i2 = o2[0], a2 = o2[1];
34246
34246
  try {
34247
34247
  if (!a2)
@@ -34257,7 +34257,7 @@ var xe = z("$ZodCIDRv6", function(n3, e2) {
34257
34257
  }
34258
34258
  };
34259
34259
  });
34260
- function Ie(n3) {
34260
+ function Te(n3) {
34261
34261
  if (n3 === "")
34262
34262
  return true;
34263
34263
  if (n3.length % 4 != 0)
@@ -34268,17 +34268,17 @@ function Ie(n3) {
34268
34268
  return false;
34269
34269
  }
34270
34270
  }
34271
- var Te = z("$ZodBase64", function(n3, e2) {
34271
+ var Ee = z("$ZodBase64", function(n3, e2) {
34272
34272
  var t2;
34273
- (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = wn), ie.init(n3, e2), n3._zod.onattach.push(function(n4) {
34273
+ (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = wn), ae.init(n3, e2), n3._zod.onattach.push(function(n4) {
34274
34274
  n4._zod.bag.contentEncoding = "base64";
34275
34275
  }), n3._zod.check = function(t3) {
34276
- Ie(t3.value) || t3.issues.push({ code: "invalid_format", format: "base64", input: t3.value, inst: n3, continue: !e2.abort });
34276
+ Te(t3.value) || t3.issues.push({ code: "invalid_format", format: "base64", input: t3.value, inst: n3, continue: !e2.abort });
34277
34277
  };
34278
34278
  });
34279
- var Ee = z("$ZodBase64URL", function(n3, e2) {
34279
+ var Pe = z("$ZodBase64URL", function(n3, e2) {
34280
34280
  var t2;
34281
- (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = kn), ie.init(n3, e2), n3._zod.onattach.push(function(n4) {
34281
+ (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = kn), ae.init(n3, e2), n3._zod.onattach.push(function(n4) {
34282
34282
  n4._zod.bag.contentEncoding = "base64url";
34283
34283
  }), n3._zod.check = function(t3) {
34284
34284
  (function(n4) {
@@ -34287,16 +34287,16 @@ var Ee = z("$ZodBase64URL", function(n3, e2) {
34287
34287
  var e3 = n4.replace(/[-_]/g, function(n5) {
34288
34288
  return n5 === "-" ? "+" : "/";
34289
34289
  });
34290
- return Ie(e3.padEnd(4 * Math.ceil(e3.length / 4), "="));
34290
+ return Te(e3.padEnd(4 * Math.ceil(e3.length / 4), "="));
34291
34291
  })(t3.value) || t3.issues.push({ code: "invalid_format", format: "base64url", input: t3.value, inst: n3, continue: !e2.abort });
34292
34292
  };
34293
34293
  });
34294
- var Pe = z("$ZodE164", function(n3, e2) {
34294
+ var Ce = z("$ZodE164", function(n3, e2) {
34295
34295
  var t2;
34296
- (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = zn), ie.init(n3, e2);
34296
+ (t2 = e2.pattern) !== null && t2 !== undefined || (e2.pattern = zn), ae.init(n3, e2);
34297
34297
  });
34298
34298
  var Ze = z("$ZodJWT", function(n3, e2) {
34299
- ie.init(n3, e2), n3._zod.check = function(t2) {
34299
+ ae.init(n3, e2), n3._zod.check = function(t2) {
34300
34300
  (function(n4) {
34301
34301
  var e3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
34302
34302
  try {
@@ -34314,9 +34314,9 @@ var Ze = z("$ZodJWT", function(n3, e2) {
34314
34314
  })(t2.value, e2.alg) || t2.issues.push({ code: "invalid_format", format: "jwt", input: t2.value, inst: n3, continue: !e2.abort });
34315
34315
  };
34316
34316
  });
34317
- var Ce = z("$ZodNumber", function(n3, e2) {
34317
+ var Ae = z("$ZodNumber", function(n3, e2) {
34318
34318
  var t2;
34319
- re.init(n3, e2), n3._zod.pattern = (t2 = n3._zod.bag.pattern) !== null && t2 !== undefined ? t2 : Pn, n3._zod.parse = function(t3, r2) {
34319
+ oe.init(n3, e2), n3._zod.pattern = (t2 = n3._zod.bag.pattern) !== null && t2 !== undefined ? t2 : Pn, n3._zod.parse = function(t3, r2) {
34320
34320
  if (e2.coerce)
34321
34321
  try {
34322
34322
  t3.value = Number(t3.value);
@@ -34328,11 +34328,11 @@ var Ce = z("$ZodNumber", function(n3, e2) {
34328
34328
  return t3.issues.push(b({ expected: "number", code: "invalid_type", input: i2, inst: n3 }, a2 ? { received: a2 } : {})), t3;
34329
34329
  };
34330
34330
  });
34331
- var Ae = z("$ZodNumber", function(n3, e2) {
34332
- jn.init(n3, e2), Ce.init(n3, e2);
34331
+ var Re = z("$ZodNumber", function(n3, e2) {
34332
+ Nn.init(n3, e2), Ae.init(n3, e2);
34333
34333
  });
34334
34334
  var Ue = z("$ZodBoolean", function(n3, e2) {
34335
- re.init(n3, e2), n3._zod.pattern = Zn, n3._zod.parse = function(t2, r2) {
34335
+ oe.init(n3, e2), n3._zod.pattern = Cn, n3._zod.parse = function(t2, r2) {
34336
34336
  if (e2.coerce)
34337
34337
  try {
34338
34338
  t2.value = Boolean(t2.value);
@@ -34341,28 +34341,34 @@ var Ue = z("$ZodBoolean", function(n3, e2) {
34341
34341
  return typeof o2 == "boolean" || t2.issues.push({ expected: "boolean", code: "invalid_type", input: o2, inst: n3 }), t2;
34342
34342
  };
34343
34343
  });
34344
- var Re = z("$ZodAny", function(n3, e2) {
34345
- re.init(n3, e2), n3._zod.parse = function(n4) {
34344
+ var Se = z("$ZodNull", function(n3, e2) {
34345
+ oe.init(n3, e2), n3._zod.pattern = Zn, n3._zod.values = new Set([null]), n3._zod.parse = function(e3, t2) {
34346
+ var r2 = e3.value;
34347
+ return r2 === null || e3.issues.push({ expected: "null", code: "invalid_type", input: r2, inst: n3 }), e3;
34348
+ };
34349
+ });
34350
+ var Oe = z("$ZodAny", function(n3, e2) {
34351
+ oe.init(n3, e2), n3._zod.parse = function(n4) {
34346
34352
  return n4;
34347
34353
  };
34348
34354
  });
34349
- var Se = z("$ZodUnknown", function(n3, e2) {
34350
- re.init(n3, e2), n3._zod.parse = function(n4) {
34355
+ var $e = z("$ZodUnknown", function(n3, e2) {
34356
+ oe.init(n3, e2), n3._zod.parse = function(n4) {
34351
34357
  return n4;
34352
34358
  };
34353
34359
  });
34354
- var Oe = z("$ZodNever", function(n3, e2) {
34355
- re.init(n3, e2), n3._zod.parse = function(e3, t2) {
34360
+ var je = z("$ZodNever", function(n3, e2) {
34361
+ oe.init(n3, e2), n3._zod.parse = function(e3, t2) {
34356
34362
  return e3.issues.push({ expected: "never", code: "invalid_type", input: e3.value, inst: n3 }), e3;
34357
34363
  };
34358
34364
  });
34359
- function $e(n3, e2, t2) {
34365
+ function Ne(n3, e2, t2) {
34360
34366
  var r2;
34361
- n3.issues.length && (r2 = e2.issues).push.apply(r2, O(q(t2, n3.issues)));
34367
+ n3.issues.length && (r2 = e2.issues).push.apply(r2, O(V(t2, n3.issues)));
34362
34368
  e2.value[t2] = n3.value;
34363
34369
  }
34364
- var je = z("$ZodArray", function(n3, e2) {
34365
- re.init(n3, e2), n3._zod.parse = function(t2, r2) {
34370
+ var Me = z("$ZodArray", function(n3, e2) {
34371
+ oe.init(n3, e2), n3._zod.parse = function(t2, r2) {
34366
34372
  var o2 = t2.value;
34367
34373
  if (!Array.isArray(o2))
34368
34374
  return t2.issues.push({ expected: "array", code: "invalid_type", input: o2, inst: n3 }), t2;
@@ -34370,8 +34376,8 @@ var je = z("$ZodArray", function(n3, e2) {
34370
34376
  for (var i2 = [], a2 = function(n4) {
34371
34377
  var a3 = o2[n4], u3 = e2.element._zod.run({ value: a3, issues: [] }, r2);
34372
34378
  u3 instanceof Promise ? i2.push(u3.then(function(e3) {
34373
- return $e(e3, t2, n4);
34374
- })) : $e(u3, t2, n4);
34379
+ return Ne(e3, t2, n4);
34380
+ })) : Ne(u3, t2, n4);
34375
34381
  }, u2 = 0;u2 < o2.length; u2++)
34376
34382
  a2(u2);
34377
34383
  return i2.length ? Promise.all(i2).then(function() {
@@ -34379,21 +34385,21 @@ var je = z("$ZodArray", function(n3, e2) {
34379
34385
  }) : t2;
34380
34386
  };
34381
34387
  });
34382
- function Ne(n3, e2, t2) {
34388
+ function Fe(n3, e2, t2) {
34383
34389
  var r2;
34384
- n3.issues.length && (r2 = e2.issues).push.apply(r2, O(q(t2, n3.issues)));
34390
+ n3.issues.length && (r2 = e2.issues).push.apply(r2, O(V(t2, n3.issues)));
34385
34391
  e2.value[t2] = n3.value;
34386
34392
  }
34387
- function Me(n3, e2, t2, r2) {
34393
+ function Le(n3, e2, t2, r2) {
34388
34394
  var o2;
34389
- n3.issues.length ? r2[t2] === undefined ? e2.value[t2] = t2 in r2 ? undefined : n3.value : (o2 = e2.issues).push.apply(o2, O(q(t2, n3.issues))) : n3.value === undefined ? t2 in r2 && (e2.value[t2] = undefined) : e2.value[t2] = n3.value;
34395
+ n3.issues.length ? r2[t2] === undefined ? e2.value[t2] = t2 in r2 ? undefined : n3.value : (o2 = e2.issues).push.apply(o2, O(V(t2, n3.issues))) : n3.value === undefined ? t2 in r2 && (e2.value[t2] = undefined) : e2.value[t2] = n3.value;
34390
34396
  }
34391
- var Fe = z("$ZodObject", function(n3, e2) {
34392
- re.init(n3, e2);
34397
+ var De = z("$ZodObject", function(n3, e2) {
34398
+ oe.init(n3, e2);
34393
34399
  var t2 = P(function() {
34394
34400
  for (var n4 = Object.keys(e2.shape), t3 = 0, r3 = n4;t3 < r3.length; t3++) {
34395
34401
  var o3 = r3[t3];
34396
- if (!(e2.shape[o3] instanceof re))
34402
+ if (!(e2.shape[o3] instanceof oe))
34397
34403
  throw new Error('Invalid element at key "'.concat(o3, '": expected a Zod schema'));
34398
34404
  }
34399
34405
  var i3, a3 = (i3 = e2.shape, Object.keys(i3).filter(function(n5) {
@@ -34432,8 +34438,8 @@ var Fe = z("$ZodObject", function(n3, e2) {
34432
34438
  var f2 = [];
34433
34439
  if (a2 && u2 && (d2 == null ? undefined : d2.async) === false && d2.jitless !== true)
34434
34440
  r2 || (r2 = function(n4) {
34435
- var e3 = new ee(["shape", "payload", "ctx"]), r3 = t2.value, o3 = function(n5) {
34436
- var e4 = R(n5);
34441
+ var e3 = new te(["shape", "payload", "ctx"]), r3 = t2.value, o3 = function(n5) {
34442
+ var e4 = U(n5);
34437
34443
  return "shape[".concat(e4, "]._zod.run({ value: input[").concat(e4, "], issues: [] }, ctx)");
34438
34444
  };
34439
34445
  e3.write("const input = payload.value;");
@@ -34454,7 +34460,7 @@ var Fe = z("$ZodObject", function(n3, e2) {
34454
34460
  if (r3.optionalKeys.has(p3)) {
34455
34461
  var f3 = a3[p3];
34456
34462
  e3.write("const ".concat(f3, " = ").concat(o3(p3), ";"));
34457
- var h3 = R(p3);
34463
+ var h3 = U(p3);
34458
34464
  e3.write(`
34459
34465
  if (`.concat(f3, `.issues.length) {
34460
34466
  if (input[`).concat(h3, `] === undefined) {
@@ -34480,8 +34486,8 @@ var Fe = z("$ZodObject", function(n3, e2) {
34480
34486
  e3.write("const ".concat(v3, " = ").concat(o3(p3), ";")), e3.write(`
34481
34487
  if (`.concat(v3, ".issues.length) payload.issues = payload.issues.concat(").concat(v3, `.issues.map(iss => ({
34482
34488
  ...iss,
34483
- path: iss.path ? [`).concat(R(p3), ", ...iss.path] : [").concat(R(p3), `]
34484
- })));`)), e3.write("newResult[".concat(R(p3), "] = ").concat(v3, ".value"));
34489
+ path: iss.path ? [`).concat(U(p3), ", ...iss.path] : [").concat(U(p3), `]
34490
+ })));`)), e3.write("newResult[".concat(U(p3), "] = ").concat(v3, ".value"));
34485
34491
  }
34486
34492
  }
34487
34493
  } catch (n5) {
@@ -34502,8 +34508,8 @@ var Fe = z("$ZodObject", function(n3, e2) {
34502
34508
  var _ = function() {
34503
34509
  var n4 = h2.value, e3 = v2[n4], t3 = e3._zod.run({ value: p2[n4], issues: [] }, d2), r3 = e3._zod.optin === "optional" && e3._zod.optout === "optional";
34504
34510
  t3 instanceof Promise ? f2.push(t3.then(function(e4) {
34505
- return r3 ? Me(e4, l2, n4, p2) : Ne(e4, l2, n4);
34506
- })) : r3 ? Me(t3, l2, n4, p2) : Ne(t3, l2, n4);
34511
+ return r3 ? Le(e4, l2, n4, p2) : Fe(e4, l2, n4);
34512
+ })) : r3 ? Le(t3, l2, n4, p2) : Fe(t3, l2, n4);
34507
34513
  };
34508
34514
  for (m2.s();!(h2 = m2.n()).done; )
34509
34515
  _();
@@ -34517,24 +34523,24 @@ var Fe = z("$ZodObject", function(n3, e2) {
34517
34523
  return f2.length ? Promise.all(f2).then(function() {
34518
34524
  return l2;
34519
34525
  }) : l2;
34520
- for (var y2 = [], g2 = o2.keySet, w2 = s2._zod, k2 = w2.def.type, b3 = function() {
34526
+ for (var g2 = [], y2 = o2.keySet, w2 = s2._zod, k2 = w2.def.type, b3 = function() {
34521
34527
  var n4 = x2[z2];
34522
- if (g2.has(n4))
34528
+ if (y2.has(n4))
34523
34529
  return 0;
34524
34530
  if (k2 === "never")
34525
- return y2.push(n4), 0;
34531
+ return g2.push(n4), 0;
34526
34532
  var e3 = w2.run({ value: p2[n4], issues: [] }, d2);
34527
34533
  e3 instanceof Promise ? f2.push(e3.then(function(e4) {
34528
- return Ne(e4, l2, n4);
34529
- })) : Ne(e3, l2, n4);
34534
+ return Fe(e4, l2, n4);
34535
+ })) : Fe(e3, l2, n4);
34530
34536
  }, z2 = 0, x2 = Object.keys(p2);z2 < x2.length; z2++)
34531
34537
  b3();
34532
- return y2.length && l2.issues.push({ code: "unrecognized_keys", keys: y2, input: p2, inst: n3 }), f2.length ? Promise.all(f2).then(function() {
34538
+ return g2.length && l2.issues.push({ code: "unrecognized_keys", keys: g2, input: p2, inst: n3 }), f2.length ? Promise.all(f2).then(function() {
34533
34539
  return l2;
34534
34540
  }) : l2;
34535
34541
  };
34536
34542
  });
34537
- function Le(n3, e2, t2, r2) {
34543
+ function qe(n3, e2, t2, r2) {
34538
34544
  var o2, i2 = a(n3);
34539
34545
  try {
34540
34546
  for (i2.s();!(o2 = i2.n()).done; ) {
@@ -34553,8 +34559,8 @@ function Le(n3, e2, t2, r2) {
34553
34559
  });
34554
34560
  }) }), e2;
34555
34561
  }
34556
- var De = z("$ZodUnion", function(n3, e2) {
34557
- re.init(n3, e2), A(n3._zod, "optin", function() {
34562
+ var Ve = z("$ZodUnion", function(n3, e2) {
34563
+ oe.init(n3, e2), A(n3._zod, "optin", function() {
34558
34564
  return e2.options.some(function(n4) {
34559
34565
  return n4._zod.optin === "optional";
34560
34566
  }) ? "optional" : undefined;
@@ -34577,7 +34583,7 @@ var De = z("$ZodUnion", function(n3, e2) {
34577
34583
  return n5._zod.pattern;
34578
34584
  });
34579
34585
  return new RegExp("^(".concat(n4.map(function(n5) {
34580
- return C(n5.source);
34586
+ return Z(n5.source);
34581
34587
  }).join("|"), ")$"));
34582
34588
  }
34583
34589
  }), n3._zod.parse = function(t2, r2) {
@@ -34599,12 +34605,12 @@ var De = z("$ZodUnion", function(n3, e2) {
34599
34605
  u2.f();
34600
34606
  }
34601
34607
  return i2 ? Promise.all(a2).then(function(e3) {
34602
- return Le(e3, t2, n3, r2);
34603
- }) : Le(a2, t2, n3, r2);
34608
+ return qe(e3, t2, n3, r2);
34609
+ }) : qe(a2, t2, n3, r2);
34604
34610
  };
34605
34611
  });
34606
- var Ve = z("$ZodDiscriminatedUnion", function(n3, e2) {
34607
- De.init(n3, e2);
34612
+ var We = z("$ZodDiscriminatedUnion", function(n3, e2) {
34613
+ Ve.init(n3, e2);
34608
34614
  var t2 = n3._zod.parse;
34609
34615
  A(n3._zod, "propValues", function() {
34610
34616
  var n4, t3 = {}, r3 = a(e2.options);
@@ -34672,16 +34678,16 @@ var Ve = z("$ZodDiscriminatedUnion", function(n3, e2) {
34672
34678
  return u2 ? u2._zod.run(o2, i2) : e2.unionFallback ? t2(o2, i2) : (o2.issues.push({ code: "invalid_union", errors: [], note: "No matching discriminator", input: a2, path: [e2.discriminator], inst: n3 }), o2);
34673
34679
  };
34674
34680
  });
34675
- var qe = z("$ZodIntersection", function(n3, e2) {
34676
- re.init(n3, e2), n3._zod.parse = function(n4, t2) {
34681
+ var He = z("$ZodIntersection", function(n3, e2) {
34682
+ oe.init(n3, e2), n3._zod.parse = function(n4, t2) {
34677
34683
  var r2 = n4.value, o2 = e2.left._zod.run({ value: r2, issues: [] }, t2), i2 = e2.right._zod.run({ value: r2, issues: [] }, t2);
34678
34684
  return o2 instanceof Promise || i2 instanceof Promise ? Promise.all([o2, i2]).then(function(e3) {
34679
34685
  var t3 = m(e3, 2), r3 = t3[0], o3 = t3[1];
34680
- return He(n4, r3, o3);
34681
- }) : He(n4, o2, i2);
34686
+ return Ge(n4, r3, o3);
34687
+ }) : Ge(n4, o2, i2);
34682
34688
  };
34683
34689
  });
34684
- function We(n3, e2) {
34690
+ function Be(n3, e2) {
34685
34691
  if (n3 === e2)
34686
34692
  return { valid: true, data: n3 };
34687
34693
  if (n3 instanceof Date && e2 instanceof Date && +n3 === +e2)
@@ -34692,7 +34698,7 @@ function We(n3, e2) {
34692
34698
  }), a2 = b(b({}, n3), e2), u2 = a(i2);
34693
34699
  try {
34694
34700
  for (u2.s();!(t2 = u2.n()).done; ) {
34695
- var s2 = t2.value, l2 = We(n3[s2], e2[s2]);
34701
+ var s2 = t2.value, l2 = Be(n3[s2], e2[s2]);
34696
34702
  if (!l2.valid)
34697
34703
  return { valid: false, mergeErrorPath: [s2].concat(O(l2.mergeErrorPath)) };
34698
34704
  a2[s2] = l2.data;
@@ -34708,7 +34714,7 @@ function We(n3, e2) {
34708
34714
  if (n3.length !== e2.length)
34709
34715
  return { valid: false, mergeErrorPath: [] };
34710
34716
  for (var d2 = [], p2 = 0;p2 < n3.length; p2++) {
34711
- var f2 = We(n3[p2], e2[p2]);
34717
+ var f2 = Be(n3[p2], e2[p2]);
34712
34718
  if (!f2.valid)
34713
34719
  return { valid: false, mergeErrorPath: [p2].concat(O(f2.mergeErrorPath)) };
34714
34720
  d2.push(f2.data);
@@ -34717,19 +34723,19 @@ function We(n3, e2) {
34717
34723
  }
34718
34724
  return { valid: false, mergeErrorPath: [] };
34719
34725
  }
34720
- function He(n3, e2, t2) {
34726
+ function Ge(n3, e2, t2) {
34721
34727
  var r2, o2;
34722
34728
  e2.issues.length && (r2 = n3.issues).push.apply(r2, O(e2.issues));
34723
34729
  t2.issues.length && (o2 = n3.issues).push.apply(o2, O(t2.issues));
34724
- if (V(n3))
34730
+ if (q(n3))
34725
34731
  return n3;
34726
- var i2 = We(e2.value, t2.value);
34732
+ var i2 = Be(e2.value, t2.value);
34727
34733
  if (!i2.valid)
34728
34734
  throw new Error("Unmergable intersection. Error path: " + "".concat(JSON.stringify(i2.mergeErrorPath)));
34729
34735
  return n3.value = i2.data, n3;
34730
34736
  }
34731
- var Be = z("$ZodRecord", function(n3, e2) {
34732
- re.init(n3, e2), n3._zod.parse = function(t2, r2) {
34737
+ var Je = z("$ZodRecord", function(n3, e2) {
34738
+ oe.init(n3, e2), n3._zod.parse = function(t2, r2) {
34733
34739
  var o2 = t2.value;
34734
34740
  if (!j2(o2))
34735
34741
  return t2.issues.push({ expected: "record", code: "invalid_type", input: o2, inst: n3 }), t2;
@@ -34746,13 +34752,13 @@ var Be = z("$ZodRecord", function(n3, e2) {
34746
34752
  if (a3 instanceof Promise)
34747
34753
  i2.push(a3.then(function(e3) {
34748
34754
  var r3;
34749
- e3.issues.length && (r3 = t2.issues).push.apply(r3, O(q(n4, e3.issues)));
34755
+ e3.issues.length && (r3 = t2.issues).push.apply(r3, O(V(n4, e3.issues)));
34750
34756
  t2.value[n4] = e3.value;
34751
34757
  }));
34752
34758
  else {
34753
34759
  var s3;
34754
34760
  if (a3.issues.length)
34755
- (s3 = t2.issues).push.apply(s3, O(q(n4, a3.issues)));
34761
+ (s3 = t2.issues).push.apply(s3, O(V(n4, a3.issues)));
34756
34762
  t2.value[n4] = a3.value;
34757
34763
  }
34758
34764
  }
@@ -34786,13 +34792,13 @@ var Be = z("$ZodRecord", function(n3, e2) {
34786
34792
  if (s3 instanceof Promise)
34787
34793
  i2.push(s3.then(function(n4) {
34788
34794
  var e3;
34789
- n4.issues.length && (e3 = t2.issues).push.apply(e3, O(q(a3, n4.issues)));
34795
+ n4.issues.length && (e3 = t2.issues).push.apply(e3, O(V(a3, n4.issues)));
34790
34796
  t2.value[u3.value] = n4.value;
34791
34797
  }));
34792
34798
  else {
34793
34799
  var c2;
34794
34800
  if (s3.issues.length)
34795
- (c2 = t2.issues).push.apply(c2, O(q(a3, s3.issues)));
34801
+ (c2 = t2.issues).push.apply(c2, O(V(a3, s3.issues)));
34796
34802
  t2.value[u3.value] = s3.value;
34797
34803
  }
34798
34804
  };
@@ -34809,8 +34815,8 @@ var Be = z("$ZodRecord", function(n3, e2) {
34809
34815
  }) : t2;
34810
34816
  };
34811
34817
  });
34812
- var Ge = z("$ZodEnum", function(n3, e2) {
34813
- re.init(n3, e2);
34818
+ var Ke = z("$ZodEnum", function(n3, e2) {
34819
+ oe.init(n3, e2);
34814
34820
  var t2, r2, o2 = (t2 = e2.entries, r2 = Object.values(t2).filter(function(n4) {
34815
34821
  return typeof n4 == "number";
34816
34822
  }), Object.entries(t2).filter(function(n4) {
@@ -34829,16 +34835,16 @@ var Ge = z("$ZodEnum", function(n3, e2) {
34829
34835
  return n3._zod.values.has(r3) || e3.issues.push({ code: "invalid_value", values: o2, input: r3, inst: n3 }), e3;
34830
34836
  };
34831
34837
  });
34832
- var Je = z("$ZodLiteral", function(n3, e2) {
34833
- re.init(n3, e2), n3._zod.values = new Set(e2.values), n3._zod.pattern = new RegExp("^(".concat(e2.values.map(function(n4) {
34838
+ var Ye = z("$ZodLiteral", function(n3, e2) {
34839
+ oe.init(n3, e2), n3._zod.values = new Set(e2.values), n3._zod.pattern = new RegExp("^(".concat(e2.values.map(function(n4) {
34834
34840
  return typeof n4 == "string" ? M(n4) : n4 ? n4.toString() : String(n4);
34835
34841
  }).join("|"), ")$")), n3._zod.parse = function(t2, r2) {
34836
34842
  var o2 = t2.value;
34837
34843
  return n3._zod.values.has(o2) || t2.issues.push({ code: "invalid_value", values: e2.values, input: o2, inst: n3 }), t2;
34838
34844
  };
34839
34845
  });
34840
- var Ke = z("$ZodTransform", function(n3, e2) {
34841
- re.init(n3, e2), n3._zod.parse = function(n4, t2) {
34846
+ var Xe = z("$ZodTransform", function(n3, e2) {
34847
+ oe.init(n3, e2), n3._zod.parse = function(n4, t2) {
34842
34848
  var r2 = e2.transform(n4.value, n4);
34843
34849
  if (t2.async)
34844
34850
  return (r2 instanceof Promise ? r2 : Promise.resolve(r2)).then(function(e3) {
@@ -34849,54 +34855,54 @@ var Ke = z("$ZodTransform", function(n3, e2) {
34849
34855
  return n4.value = r2, n4;
34850
34856
  };
34851
34857
  });
34852
- var Ye = z("$ZodOptional", function(n3, e2) {
34853
- re.init(n3, e2), n3._zod.optin = "optional", n3._zod.optout = "optional", A(n3._zod, "values", function() {
34858
+ var Qe = z("$ZodOptional", function(n3, e2) {
34859
+ oe.init(n3, e2), n3._zod.optin = "optional", n3._zod.optout = "optional", A(n3._zod, "values", function() {
34854
34860
  return e2.innerType._zod.values ? new Set([].concat(O(e2.innerType._zod.values), [undefined])) : undefined;
34855
34861
  }), A(n3._zod, "pattern", function() {
34856
34862
  var n4 = e2.innerType._zod.pattern;
34857
- return n4 ? new RegExp("^(".concat(C(n4.source), ")?$")) : undefined;
34863
+ return n4 ? new RegExp("^(".concat(Z(n4.source), ")?$")) : undefined;
34858
34864
  }), n3._zod.parse = function(n4, t2) {
34859
34865
  return e2.innerType._zod.optin === "optional" ? e2.innerType._zod.run(n4, t2) : n4.value === undefined ? n4 : e2.innerType._zod.run(n4, t2);
34860
34866
  };
34861
34867
  });
34862
- var Xe = z("$ZodNullable", function(n3, e2) {
34863
- re.init(n3, e2), A(n3._zod, "optin", function() {
34868
+ var nt = z("$ZodNullable", function(n3, e2) {
34869
+ oe.init(n3, e2), A(n3._zod, "optin", function() {
34864
34870
  return e2.innerType._zod.optin;
34865
34871
  }), A(n3._zod, "optout", function() {
34866
34872
  return e2.innerType._zod.optout;
34867
34873
  }), A(n3._zod, "pattern", function() {
34868
34874
  var n4 = e2.innerType._zod.pattern;
34869
- return n4 ? new RegExp("^(".concat(C(n4.source), "|null)$")) : undefined;
34875
+ return n4 ? new RegExp("^(".concat(Z(n4.source), "|null)$")) : undefined;
34870
34876
  }), A(n3._zod, "values", function() {
34871
34877
  return e2.innerType._zod.values ? new Set([].concat(O(e2.innerType._zod.values), [null])) : undefined;
34872
34878
  }), n3._zod.parse = function(n4, t2) {
34873
34879
  return n4.value === null ? n4 : e2.innerType._zod.run(n4, t2);
34874
34880
  };
34875
34881
  });
34876
- var Qe = z("$ZodDefault", function(n3, e2) {
34877
- re.init(n3, e2), n3._zod.optin = "optional", A(n3._zod, "values", function() {
34882
+ var et = z("$ZodDefault", function(n3, e2) {
34883
+ oe.init(n3, e2), n3._zod.optin = "optional", A(n3._zod, "values", function() {
34878
34884
  return e2.innerType._zod.values;
34879
34885
  }), n3._zod.parse = function(n4, t2) {
34880
34886
  if (n4.value === undefined)
34881
34887
  return n4.value = e2.defaultValue, n4;
34882
34888
  var r2 = e2.innerType._zod.run(n4, t2);
34883
34889
  return r2 instanceof Promise ? r2.then(function(n5) {
34884
- return nt(n5, e2);
34885
- }) : nt(r2, e2);
34890
+ return tt(n5, e2);
34891
+ }) : tt(r2, e2);
34886
34892
  };
34887
34893
  });
34888
- function nt(n3, e2) {
34894
+ function tt(n3, e2) {
34889
34895
  return n3.value === undefined && (n3.value = e2.defaultValue), n3;
34890
34896
  }
34891
- var et = z("$ZodPrefault", function(n3, e2) {
34892
- re.init(n3, e2), n3._zod.optin = "optional", A(n3._zod, "values", function() {
34897
+ var rt = z("$ZodPrefault", function(n3, e2) {
34898
+ oe.init(n3, e2), n3._zod.optin = "optional", A(n3._zod, "values", function() {
34893
34899
  return e2.innerType._zod.values;
34894
34900
  }), n3._zod.parse = function(n4, t2) {
34895
34901
  return n4.value === undefined && (n4.value = e2.defaultValue), e2.innerType._zod.run(n4, t2);
34896
34902
  };
34897
34903
  });
34898
- var tt = z("$ZodNonOptional", function(n3, e2) {
34899
- re.init(n3, e2), A(n3._zod, "values", function() {
34904
+ var ot = z("$ZodNonOptional", function(n3, e2) {
34905
+ oe.init(n3, e2), A(n3._zod, "values", function() {
34900
34906
  var n4 = e2.innerType._zod.values;
34901
34907
  return n4 ? new Set(O(n4).filter(function(n5) {
34902
34908
  return n5 !== undefined;
@@ -34904,15 +34910,15 @@ var tt = z("$ZodNonOptional", function(n3, e2) {
34904
34910
  }), n3._zod.parse = function(t2, r2) {
34905
34911
  var o2 = e2.innerType._zod.run(t2, r2);
34906
34912
  return o2 instanceof Promise ? o2.then(function(e3) {
34907
- return rt(e3, n3);
34908
- }) : rt(o2, n3);
34913
+ return it(e3, n3);
34914
+ }) : it(o2, n3);
34909
34915
  };
34910
34916
  });
34911
- function rt(n3, e2) {
34917
+ function it(n3, e2) {
34912
34918
  return n3.issues.length || n3.value !== undefined || n3.issues.push({ code: "invalid_type", expected: "nonoptional", input: n3.value, inst: e2 }), n3;
34913
34919
  }
34914
- var ot = z("$ZodCatch", function(n3, e2) {
34915
- re.init(n3, e2), n3._zod.optin = "optional", A(n3._zod, "optout", function() {
34920
+ var at = z("$ZodCatch", function(n3, e2) {
34921
+ oe.init(n3, e2), n3._zod.optin = "optional", A(n3._zod, "optout", function() {
34916
34922
  return e2.innerType._zod.optout;
34917
34923
  }), A(n3._zod, "values", function() {
34918
34924
  return e2.innerType._zod.values;
@@ -34927,8 +34933,8 @@ var ot = z("$ZodCatch", function(n3, e2) {
34927
34933
  }) }, input: n4.value })), n4.issues = []), n4);
34928
34934
  };
34929
34935
  });
34930
- var it = z("$ZodPipe", function(n3, e2) {
34931
- re.init(n3, e2), A(n3._zod, "values", function() {
34936
+ var ut = z("$ZodPipe", function(n3, e2) {
34937
+ oe.init(n3, e2), A(n3._zod, "values", function() {
34932
34938
  return e2.in._zod.values;
34933
34939
  }), A(n3._zod, "optin", function() {
34934
34940
  return e2.in._zod.optin;
@@ -34937,15 +34943,15 @@ var it = z("$ZodPipe", function(n3, e2) {
34937
34943
  }), n3._zod.parse = function(n4, t2) {
34938
34944
  var r2 = e2.in._zod.run(n4, t2);
34939
34945
  return r2 instanceof Promise ? r2.then(function(n5) {
34940
- return at(n5, e2, t2);
34941
- }) : at(r2, e2, t2);
34946
+ return st(n5, e2, t2);
34947
+ }) : st(r2, e2, t2);
34942
34948
  };
34943
34949
  });
34944
- function at(n3, e2, t2) {
34945
- return V(n3) ? n3 : e2.out._zod.run({ value: n3.value, issues: n3.issues }, t2);
34950
+ function st(n3, e2, t2) {
34951
+ return q(n3) ? n3 : e2.out._zod.run({ value: n3.value, issues: n3.issues }, t2);
34946
34952
  }
34947
- var ut = z("$ZodReadonly", function(n3, e2) {
34948
- re.init(n3, e2), A(n3._zod, "propValues", function() {
34953
+ var ct = z("$ZodReadonly", function(n3, e2) {
34954
+ oe.init(n3, e2), A(n3._zod, "propValues", function() {
34949
34955
  return e2.innerType._zod.propValues;
34950
34956
  }), A(n3._zod, "values", function() {
34951
34957
  return e2.innerType._zod.values;
@@ -34955,31 +34961,31 @@ var ut = z("$ZodReadonly", function(n3, e2) {
34955
34961
  return e2.innerType._zod.optout;
34956
34962
  }), n3._zod.parse = function(n4, t2) {
34957
34963
  var r2 = e2.innerType._zod.run(n4, t2);
34958
- return r2 instanceof Promise ? r2.then(st) : st(r2);
34964
+ return r2 instanceof Promise ? r2.then(lt) : lt(r2);
34959
34965
  };
34960
34966
  });
34961
- function st(n3) {
34967
+ function lt(n3) {
34962
34968
  return n3.value = Object.freeze(n3.value), n3;
34963
34969
  }
34964
- var ct = z("$ZodCustom", function(n3, e2) {
34965
- Un.init(n3, e2), re.init(n3, e2), n3._zod.parse = function(n4, e3) {
34970
+ var dt = z("$ZodCustom", function(n3, e2) {
34971
+ Un.init(n3, e2), oe.init(n3, e2), n3._zod.parse = function(n4, e3) {
34966
34972
  return n4;
34967
34973
  }, n3._zod.check = function(t2) {
34968
34974
  var r2 = t2.value, o2 = e2.fn(r2);
34969
34975
  if (o2 instanceof Promise)
34970
34976
  return o2.then(function(e3) {
34971
- return lt(e3, t2, r2, n3);
34977
+ return pt(e3, t2, r2, n3);
34972
34978
  });
34973
- lt(o2, t2, r2, n3);
34979
+ pt(o2, t2, r2, n3);
34974
34980
  };
34975
34981
  });
34976
- function lt(n3, e2, t2, r2) {
34982
+ function pt(n3, e2, t2, r2) {
34977
34983
  if (!n3) {
34978
34984
  var o2, i2 = { code: "custom", input: t2, inst: r2, path: O((o2 = r2._zod.def.path) !== null && o2 !== undefined ? o2 : []), continue: !r2._zod.def.abort };
34979
34985
  r2._zod.def.params && (i2.params = r2._zod.def.params), e2.issues.push(J(i2));
34980
34986
  }
34981
34987
  }
34982
- var dt = function() {
34988
+ var ft = function() {
34983
34989
  return c(function n() {
34984
34990
  o(this, n), this._map = new Map, this._idmap = new Map;
34985
34991
  }, [{ key: "add", value: function(n3) {
@@ -35006,133 +35012,133 @@ var dt = function() {
35006
35012
  return this._map.has(n3);
35007
35013
  } }]);
35008
35014
  }();
35009
- function pt() {
35010
- return new dt;
35015
+ function ht() {
35016
+ return new ft;
35011
35017
  }
35012
- var ft = pt();
35013
- function ht(n3, e2) {
35018
+ var vt = ht();
35019
+ function mt(n3, e2) {
35014
35020
  return new n3(b({ type: "string", format: "guid", check: "string_format", abort: false }, L(e2)));
35015
35021
  }
35016
- function vt(n3, e2) {
35022
+ function _t(n3, e2) {
35017
35023
  return new n3(b({ type: "string", format: "url", check: "string_format", abort: false }, L(e2)));
35018
35024
  }
35019
- function mt(n3, e2) {
35020
- return new Sn(b(b({ check: "less_than" }, L(e2)), {}, { value: n3, inclusive: false }));
35021
- }
35022
- function _t(n3, e2) {
35023
- return new Sn(b(b({ check: "less_than" }, L(e2)), {}, { value: n3, inclusive: true }));
35025
+ function gt(n3, e2) {
35026
+ return new On(b(b({ check: "less_than" }, L(e2)), {}, { value: n3, inclusive: false }));
35024
35027
  }
35025
35028
  function yt(n3, e2) {
35026
- return new On(b(b({ check: "greater_than" }, L(e2)), {}, { value: n3, inclusive: false }));
35027
- }
35028
- function gt(n3, e2) {
35029
- return new On(b(b({ check: "greater_than" }, L(e2)), {}, { value: n3, inclusive: true }));
35029
+ return new On(b(b({ check: "less_than" }, L(e2)), {}, { value: n3, inclusive: true }));
35030
35030
  }
35031
35031
  function wt(n3, e2) {
35032
- return new $n(b(b({ check: "multiple_of" }, L(e2)), {}, { value: n3 }));
35032
+ return new $n(b(b({ check: "greater_than" }, L(e2)), {}, { value: n3, inclusive: false }));
35033
35033
  }
35034
35034
  function kt(n3, e2) {
35035
- return new Ln(b(b({ check: "max_length" }, L(e2)), {}, { maximum: n3 }));
35035
+ return new $n(b(b({ check: "greater_than" }, L(e2)), {}, { value: n3, inclusive: true }));
35036
35036
  }
35037
35037
  function bt(n3, e2) {
35038
- return new Dn(b(b({ check: "min_length" }, L(e2)), {}, { minimum: n3 }));
35038
+ return new jn(b(b({ check: "multiple_of" }, L(e2)), {}, { value: n3 }));
35039
35039
  }
35040
35040
  function zt(n3, e2) {
35041
- return new Vn(b(b({ check: "length_equals" }, L(e2)), {}, { length: n3 }));
35041
+ return new Dn(b(b({ check: "max_length" }, L(e2)), {}, { maximum: n3 }));
35042
35042
  }
35043
35043
  function xt(n3, e2) {
35044
- return new Wn(b(b({ check: "string_format", format: "regex" }, L(e2)), {}, { pattern: n3 }));
35044
+ return new qn(b(b({ check: "min_length" }, L(e2)), {}, { minimum: n3 }));
35045
35045
  }
35046
- function It(n3) {
35047
- return new Hn(b({ check: "string_format", format: "lowercase" }, L(n3)));
35046
+ function It(n3, e2) {
35047
+ return new Vn(b(b({ check: "length_equals" }, L(e2)), {}, { length: n3 }));
35048
+ }
35049
+ function Tt(n3, e2) {
35050
+ return new Hn(b(b({ check: "string_format", format: "regex" }, L(e2)), {}, { pattern: n3 }));
35048
35051
  }
35049
- function Tt(n3) {
35050
- return new Bn(b({ check: "string_format", format: "uppercase" }, L(n3)));
35052
+ function Et(n3) {
35053
+ return new Bn(b({ check: "string_format", format: "lowercase" }, L(n3)));
35051
35054
  }
35052
- function Et(n3, e2) {
35053
- return new Gn(b(b({ check: "string_format", format: "includes" }, L(e2)), {}, { includes: n3 }));
35055
+ function Pt(n3) {
35056
+ return new Gn(b({ check: "string_format", format: "uppercase" }, L(n3)));
35054
35057
  }
35055
- function Pt(n3, e2) {
35056
- return new Jn(b(b({ check: "string_format", format: "starts_with" }, L(e2)), {}, { prefix: n3 }));
35058
+ function Ct(n3, e2) {
35059
+ return new Jn(b(b({ check: "string_format", format: "includes" }, L(e2)), {}, { includes: n3 }));
35057
35060
  }
35058
35061
  function Zt(n3, e2) {
35059
- return new Kn(b(b({ check: "string_format", format: "ends_with" }, L(e2)), {}, { suffix: n3 }));
35062
+ return new Kn(b(b({ check: "string_format", format: "starts_with" }, L(e2)), {}, { prefix: n3 }));
35063
+ }
35064
+ function At(n3, e2) {
35065
+ return new Yn(b(b({ check: "string_format", format: "ends_with" }, L(e2)), {}, { suffix: n3 }));
35060
35066
  }
35061
- function Ct(n3) {
35062
- return new ne({ check: "overwrite", tx: n3 });
35067
+ function Rt(n3) {
35068
+ return new ee({ check: "overwrite", tx: n3 });
35063
35069
  }
35064
- function At(n3) {
35065
- return Ct(function(e2) {
35070
+ function Ut(n3) {
35071
+ return Rt(function(e2) {
35066
35072
  return e2.normalize(n3);
35067
35073
  });
35068
35074
  }
35069
- function Ut() {
35070
- return Ct(function(n3) {
35075
+ function St() {
35076
+ return Rt(function(n3) {
35071
35077
  return n3.trim();
35072
35078
  });
35073
35079
  }
35074
- function Rt() {
35075
- return Ct(function(n3) {
35080
+ function Ot() {
35081
+ return Rt(function(n3) {
35076
35082
  return n3.toLowerCase();
35077
35083
  });
35078
35084
  }
35079
- function St() {
35080
- return Ct(function(n3) {
35085
+ function $t() {
35086
+ return Rt(function(n3) {
35081
35087
  return n3.toUpperCase();
35082
35088
  });
35083
35089
  }
35084
- var Ot = Object.freeze({ __proto__: null, endsWith: Zt, gt: yt, gte: gt, includes: Et, length: zt, lowercase: It, lt: mt, lte: _t, maxLength: kt, maxSize: function(n3, e2) {
35085
- return new Nn(b(b({ check: "max_size" }, L(e2)), {}, { maximum: n3 }));
35090
+ var jt = Object.freeze({ __proto__: null, endsWith: At, gt: wt, gte: kt, includes: Ct, length: It, lowercase: Et, lt: gt, lte: yt, maxLength: zt, maxSize: function(n3, e2) {
35091
+ return new Mn(b(b({ check: "max_size" }, L(e2)), {}, { maximum: n3 }));
35086
35092
  }, mime: function(n3, e2) {
35087
- return new Qn(b({ check: "mime_type", mime: n3 }, L(e2)));
35088
- }, minLength: bt, minSize: function(n3, e2) {
35089
- return new Mn(b(b({ check: "min_size" }, L(e2)), {}, { minimum: n3 }));
35090
- }, multipleOf: wt, negative: function(n3) {
35091
- return mt(0, n3);
35092
- }, nonnegative: function(n3) {
35093
+ return new ne(b({ check: "mime_type", mime: n3 }, L(e2)));
35094
+ }, minLength: xt, minSize: function(n3, e2) {
35095
+ return new Fn(b(b({ check: "min_size" }, L(e2)), {}, { minimum: n3 }));
35096
+ }, multipleOf: bt, negative: function(n3) {
35093
35097
  return gt(0, n3);
35098
+ }, nonnegative: function(n3) {
35099
+ return kt(0, n3);
35094
35100
  }, nonpositive: function(n3) {
35095
- return _t(0, n3);
35096
- }, normalize: At, overwrite: Ct, positive: function(n3) {
35097
35101
  return yt(0, n3);
35102
+ }, normalize: Ut, overwrite: Rt, positive: function(n3) {
35103
+ return wt(0, n3);
35098
35104
  }, property: function(n3, e2, t2) {
35099
- return new Xn(b({ check: "property", property: n3, schema: e2 }, L(t2)));
35100
- }, regex: xt, size: function(n3, e2) {
35101
- return new Fn(b(b({ check: "size_equals" }, L(e2)), {}, { size: n3 }));
35102
- }, startsWith: Pt, toLowerCase: Rt, toUpperCase: St, trim: Ut, uppercase: Tt });
35103
- var $t = z("ZodISODateTime", function(n3, e2) {
35104
- _e.init(n3, e2), Qt.init(n3, e2);
35105
- });
35106
- function jt(n3) {
35105
+ return new Qn(b({ check: "property", property: n3, schema: e2 }, L(t2)));
35106
+ }, regex: Tt, size: function(n3, e2) {
35107
+ return new Ln(b(b({ check: "size_equals" }, L(e2)), {}, { size: n3 }));
35108
+ }, startsWith: Zt, toLowerCase: Ot, toUpperCase: $t, trim: St, uppercase: Pt });
35109
+ var Nt = z("ZodISODateTime", function(n3, e2) {
35110
+ ge.init(n3, e2), er.init(n3, e2);
35111
+ });
35112
+ function Mt(n3) {
35107
35113
  return function(n4, e2) {
35108
35114
  return new n4(b({ type: "string", format: "datetime", check: "string_format", offset: false, local: false, precision: null }, L(e2)));
35109
- }($t, n3);
35115
+ }(Nt, n3);
35110
35116
  }
35111
- var Nt = z("ZodISODate", function(n3, e2) {
35112
- ye.init(n3, e2), Qt.init(n3, e2);
35117
+ var Ft = z("ZodISODate", function(n3, e2) {
35118
+ ye.init(n3, e2), er.init(n3, e2);
35113
35119
  });
35114
- function Mt(n3) {
35120
+ function Lt(n3) {
35115
35121
  return function(n4, e2) {
35116
35122
  return new n4(b({ type: "string", format: "date", check: "string_format" }, L(e2)));
35117
- }(Nt, n3);
35123
+ }(Ft, n3);
35118
35124
  }
35119
- var Ft = z("ZodISOTime", function(n3, e2) {
35120
- ge.init(n3, e2), Qt.init(n3, e2);
35125
+ var Dt = z("ZodISOTime", function(n3, e2) {
35126
+ we.init(n3, e2), er.init(n3, e2);
35121
35127
  });
35122
- function Lt(n3) {
35128
+ function qt(n3) {
35123
35129
  return function(n4, e2) {
35124
35130
  return new n4(b({ type: "string", format: "time", check: "string_format", precision: null }, L(e2)));
35125
- }(Ft, n3);
35131
+ }(Dt, n3);
35126
35132
  }
35127
- var Dt = z("ZodISODuration", function(n3, e2) {
35128
- we.init(n3, e2), Qt.init(n3, e2);
35133
+ var Vt = z("ZodISODuration", function(n3, e2) {
35134
+ ke.init(n3, e2), er.init(n3, e2);
35129
35135
  });
35130
- function Vt(n3) {
35136
+ function Wt(n3) {
35131
35137
  return function(n4, e2) {
35132
35138
  return new n4(b({ type: "string", format: "duration", check: "string_format" }, L(e2)));
35133
- }(Dt, n3);
35139
+ }(Vt, n3);
35134
35140
  }
35135
- var qt = z("ZodError", function(n3, e2) {
35141
+ var Ht = z("ZodError", function(n3, e2) {
35136
35142
  Y.init(n3, e2), n3.name = "ZodError", Object.defineProperties(n3, { format: { value: function(e3) {
35137
35143
  return function(n4, e4) {
35138
35144
  var t2 = e4 || function(n5) {
@@ -35192,12 +35198,12 @@ var qt = z("ZodError", function(n3, e2) {
35192
35198
  return n3.issues.length === 0;
35193
35199
  } } });
35194
35200
  }, { Parent: Error });
35195
- var Wt = Q(qt);
35196
- var Ht = nn(qt);
35197
- var Bt = en(qt);
35198
- var Gt = rn(qt);
35199
- var Jt = z("ZodType", function(n3, e2) {
35200
- return re.init(n3, e2), n3.def = e2, Object.defineProperty(n3, "_def", { value: e2 }), n3.check = function() {
35201
+ var Bt = Q(Ht);
35202
+ var Gt = nn(Ht);
35203
+ var Jt = en(Ht);
35204
+ var Kt = rn(Ht);
35205
+ var Yt = z("ZodType", function(n3, e2) {
35206
+ return oe.init(n3, e2), n3.def = e2, Object.defineProperty(n3, "_def", { value: e2 }), n3.check = function() {
35201
35207
  for (var t2, r2 = arguments.length, i2 = new Array(r2), a2 = 0;a2 < r2; a2++)
35202
35208
  i2[a2] = arguments[a2];
35203
35209
  return n3.clone(b(b({}, e2), {}, { checks: [].concat(O((t2 = e2.checks) !== null && t2 !== undefined ? t2 : []), O(i2.map(function(n4) {
@@ -35210,15 +35216,15 @@ var Jt = z("ZodType", function(n3, e2) {
35210
35216
  }, n3.register = function(e3, t2) {
35211
35217
  return e3.add(n3, t2), n3;
35212
35218
  }, n3.parse = function(e3, t2) {
35213
- return Wt(n3, e3, t2, { callee: n3.parse });
35219
+ return Bt(n3, e3, t2, { callee: n3.parse });
35214
35220
  }, n3.safeParse = function(e3, t2) {
35215
- return Bt(n3, e3, t2);
35221
+ return Jt(n3, e3, t2);
35216
35222
  }, n3.parseAsync = function() {
35217
35223
  var e3 = e(v().m(function e(t2, r2) {
35218
35224
  return v().w(function(e4) {
35219
35225
  for (;; )
35220
35226
  if (e4.n === 0)
35221
- return e4.a(2, Ht(n3, t2, r2, { callee: n3.parseAsync }));
35227
+ return e4.a(2, Gt(n3, t2, r2, { callee: n3.parseAsync }));
35222
35228
  }, e);
35223
35229
  }));
35224
35230
  return function(n4, t2) {
@@ -35229,7 +35235,7 @@ var Jt = z("ZodType", function(n3, e2) {
35229
35235
  return v().w(function(e4) {
35230
35236
  for (;; )
35231
35237
  if (e4.n === 0)
35232
- return e4.a(2, Gt(n3, t2, r2));
35238
+ return e4.a(2, Kt(n3, t2, r2));
35233
35239
  }, e);
35234
35240
  }));
35235
35241
  return function(n4, t2) {
@@ -35240,7 +35246,7 @@ var Jt = z("ZodType", function(n3, e2) {
35240
35246
  var e4 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
35241
35247
  return function(n5, e5, t3) {
35242
35248
  return new n5(b({ type: "custom", check: "custom", fn: e5 }, L(t3)));
35243
- }(io, n4, e4);
35249
+ }(lo, n4, e4);
35244
35250
  }(e3, t2));
35245
35251
  }, n3.superRefine = function(e3) {
35246
35252
  return n3.check((t2 = e3, r2 = function(n4) {
@@ -35258,364 +35264,372 @@ var Jt = z("ZodType", function(n3, e2) {
35258
35264
  })));
35259
35265
  var t2, r2;
35260
35266
  }, n3.overwrite = function(e3) {
35261
- return n3.check(Ct(e3));
35267
+ return n3.check(Rt(e3));
35262
35268
  }, n3.optional = function() {
35263
- return Jr(n3);
35269
+ return no(n3);
35264
35270
  }, n3.nullable = function() {
35265
- return Yr(n3);
35271
+ return to(n3);
35266
35272
  }, n3.nullish = function() {
35267
- return Jr(Yr(n3));
35273
+ return no(to(n3));
35268
35274
  }, n3.nonoptional = function(e3) {
35269
35275
  return function(n4, e4) {
35270
- return new no(b({ type: "nonoptional", innerType: n4 }, L(e4)));
35276
+ return new io(b({ type: "nonoptional", innerType: n4 }, L(e4)));
35271
35277
  }(n3, e3);
35272
35278
  }, n3.array = function() {
35273
- return Ar(n3);
35279
+ return Or(n3);
35274
35280
  }, n3.or = function(e3) {
35275
- return $r([n3, e3]);
35281
+ return Fr([n3, e3]);
35276
35282
  }, n3.and = function(e3) {
35277
- return Mr(n3, e3);
35283
+ return Vr(n3, e3);
35278
35284
  }, n3.transform = function(e3) {
35279
- return ro(n3, Br(e3));
35285
+ return so(n3, Xr(e3));
35280
35286
  }, n3.default = function(e3) {
35281
- return t2 = e3, new Xr({ type: "default", innerType: n3, get defaultValue() {
35287
+ return t2 = e3, new ro({ type: "default", innerType: n3, get defaultValue() {
35282
35288
  return typeof t2 == "function" ? t2() : t2;
35283
35289
  } });
35284
35290
  var t2;
35285
35291
  }, n3.prefault = function(e3) {
35286
- return t2 = e3, new Qr({ type: "prefault", innerType: n3, get defaultValue() {
35292
+ return t2 = e3, new oo({ type: "prefault", innerType: n3, get defaultValue() {
35287
35293
  return typeof t2 == "function" ? t2() : t2;
35288
35294
  } });
35289
35295
  var t2;
35290
35296
  }, n3.catch = function(e3) {
35291
- return new eo({ type: "catch", innerType: n3, catchValue: typeof (t2 = e3) == "function" ? t2 : function() {
35297
+ return new ao({ type: "catch", innerType: n3, catchValue: typeof (t2 = e3) == "function" ? t2 : function() {
35292
35298
  return t2;
35293
35299
  } });
35294
35300
  var t2;
35295
35301
  }, n3.pipe = function(e3) {
35296
- return ro(n3, e3);
35302
+ return so(n3, e3);
35297
35303
  }, n3.readonly = function() {
35298
- return new oo({ type: "readonly", innerType: n3 });
35304
+ return new co({ type: "readonly", innerType: n3 });
35299
35305
  }, n3.describe = function(e3) {
35300
35306
  var t2 = n3.clone();
35301
- return ft.add(t2, { description: e3 }), t2;
35307
+ return vt.add(t2, { description: e3 }), t2;
35302
35308
  }, Object.defineProperty(n3, "description", { get: function() {
35303
35309
  var e3;
35304
- return (e3 = ft.get(n3)) === null || e3 === undefined ? undefined : e3.description;
35310
+ return (e3 = vt.get(n3)) === null || e3 === undefined ? undefined : e3.description;
35305
35311
  }, configurable: true }), n3.meta = function() {
35306
35312
  if (arguments.length === 0)
35307
- return ft.get(n3);
35313
+ return vt.get(n3);
35308
35314
  var e3 = n3.clone();
35309
- return ft.add(e3, arguments.length <= 0 ? undefined : arguments[0]), e3;
35315
+ return vt.add(e3, arguments.length <= 0 ? undefined : arguments[0]), e3;
35310
35316
  }, n3.isOptional = function() {
35311
35317
  return n3.safeParse(undefined).success;
35312
35318
  }, n3.isNullable = function() {
35313
35319
  return n3.safeParse(null).success;
35314
35320
  }, n3;
35315
35321
  });
35316
- var Kt = z("_ZodString", function(n3, e2) {
35322
+ var Xt = z("_ZodString", function(n3, e2) {
35317
35323
  var t2, r2, o2;
35318
- oe.init(n3, e2), Jt.init(n3, e2);
35324
+ ie.init(n3, e2), Yt.init(n3, e2);
35319
35325
  var i2 = n3._zod.bag;
35320
35326
  n3.format = (t2 = i2.format) !== null && t2 !== undefined ? t2 : null, n3.minLength = (r2 = i2.minimum) !== null && r2 !== undefined ? r2 : null, n3.maxLength = (o2 = i2.maximum) !== null && o2 !== undefined ? o2 : null, n3.regex = function() {
35321
- return n3.check(xt.apply(Ot, arguments));
35327
+ return n3.check(Tt.apply(jt, arguments));
35322
35328
  }, n3.includes = function() {
35323
- return n3.check(Et.apply(Ot, arguments));
35329
+ return n3.check(Ct.apply(jt, arguments));
35324
35330
  }, n3.startsWith = function() {
35325
- return n3.check(Pt.apply(Ot, arguments));
35331
+ return n3.check(Zt.apply(jt, arguments));
35326
35332
  }, n3.endsWith = function() {
35327
- return n3.check(Zt.apply(Ot, arguments));
35333
+ return n3.check(At.apply(jt, arguments));
35328
35334
  }, n3.min = function() {
35329
- return n3.check(bt.apply(Ot, arguments));
35335
+ return n3.check(xt.apply(jt, arguments));
35330
35336
  }, n3.max = function() {
35331
- return n3.check(kt.apply(Ot, arguments));
35337
+ return n3.check(zt.apply(jt, arguments));
35332
35338
  }, n3.length = function() {
35333
- return n3.check(zt.apply(Ot, arguments));
35339
+ return n3.check(It.apply(jt, arguments));
35334
35340
  }, n3.nonempty = function() {
35335
35341
  for (var e3 = arguments.length, t3 = new Array(e3), r3 = 0;r3 < e3; r3++)
35336
35342
  t3[r3] = arguments[r3];
35337
- return n3.check(bt.apply(Ot, [1].concat(t3)));
35343
+ return n3.check(xt.apply(jt, [1].concat(t3)));
35338
35344
  }, n3.lowercase = function(e3) {
35339
- return n3.check(It(e3));
35345
+ return n3.check(Et(e3));
35340
35346
  }, n3.uppercase = function(e3) {
35341
- return n3.check(Tt(e3));
35347
+ return n3.check(Pt(e3));
35342
35348
  }, n3.trim = function() {
35343
- return n3.check(Ut());
35349
+ return n3.check(St());
35344
35350
  }, n3.normalize = function() {
35345
- return n3.check(At.apply(Ot, arguments));
35351
+ return n3.check(Ut.apply(jt, arguments));
35346
35352
  }, n3.toLowerCase = function() {
35347
- return n3.check(Rt());
35353
+ return n3.check(Ot());
35348
35354
  }, n3.toUpperCase = function() {
35349
- return n3.check(St());
35355
+ return n3.check($t());
35350
35356
  };
35351
35357
  });
35352
- var Yt = z("ZodString", function(n3, e2) {
35353
- oe.init(n3, e2), Kt.init(n3, e2), n3.email = function(e3) {
35358
+ var Qt = z("ZodString", function(n3, e2) {
35359
+ ie.init(n3, e2), Xt.init(n3, e2), n3.email = function(e3) {
35354
35360
  return n3.check(function(n4, e4) {
35355
35361
  return new n4(b({ type: "string", format: "email", check: "string_format", abort: false }, L(e4)));
35356
- }(nr, e3));
35362
+ }(tr, e3));
35357
35363
  }, n3.url = function(e3) {
35358
- return n3.check(vt(rr, e3));
35364
+ return n3.check(_t(ir, e3));
35359
35365
  }, n3.jwt = function(e3) {
35360
35366
  return n3.check(function(n4, e4) {
35361
35367
  return new n4(b({ type: "string", format: "jwt", check: "string_format", abort: false }, L(e4)));
35362
- }(yr, e3));
35368
+ }(wr, e3));
35363
35369
  }, n3.emoji = function(e3) {
35364
35370
  return n3.check(function(n4, e4) {
35365
35371
  return new n4(b({ type: "string", format: "emoji", check: "string_format", abort: false }, L(e4)));
35366
- }(or, e3));
35372
+ }(ar, e3));
35367
35373
  }, n3.guid = function(e3) {
35368
- return n3.check(ht(er, e3));
35374
+ return n3.check(mt(rr, e3));
35369
35375
  }, n3.uuid = function(e3) {
35370
35376
  return n3.check(function(n4, e4) {
35371
35377
  return new n4(b({ type: "string", format: "uuid", check: "string_format", abort: false }, L(e4)));
35372
- }(tr, e3));
35378
+ }(or, e3));
35373
35379
  }, n3.uuidv4 = function(e3) {
35374
35380
  return n3.check(function(n4, e4) {
35375
35381
  return new n4(b({ type: "string", format: "uuid", check: "string_format", abort: false, version: "v4" }, L(e4)));
35376
- }(tr, e3));
35382
+ }(or, e3));
35377
35383
  }, n3.uuidv6 = function(e3) {
35378
35384
  return n3.check(function(n4, e4) {
35379
35385
  return new n4(b({ type: "string", format: "uuid", check: "string_format", abort: false, version: "v6" }, L(e4)));
35380
- }(tr, e3));
35386
+ }(or, e3));
35381
35387
  }, n3.uuidv7 = function(e3) {
35382
35388
  return n3.check(function(n4, e4) {
35383
35389
  return new n4(b({ type: "string", format: "uuid", check: "string_format", abort: false, version: "v7" }, L(e4)));
35384
- }(tr, e3));
35390
+ }(or, e3));
35385
35391
  }, n3.nanoid = function(e3) {
35386
35392
  return n3.check(function(n4, e4) {
35387
35393
  return new n4(b({ type: "string", format: "nanoid", check: "string_format", abort: false }, L(e4)));
35388
- }(ir, e3));
35394
+ }(ur, e3));
35389
35395
  }, n3.guid = function(e3) {
35390
- return n3.check(ht(er, e3));
35396
+ return n3.check(mt(rr, e3));
35391
35397
  }, n3.cuid = function(e3) {
35392
35398
  return n3.check(function(n4, e4) {
35393
35399
  return new n4(b({ type: "string", format: "cuid", check: "string_format", abort: false }, L(e4)));
35394
- }(ar, e3));
35400
+ }(sr, e3));
35395
35401
  }, n3.cuid2 = function(e3) {
35396
35402
  return n3.check(function(n4, e4) {
35397
35403
  return new n4(b({ type: "string", format: "cuid2", check: "string_format", abort: false }, L(e4)));
35398
- }(ur, e3));
35404
+ }(cr, e3));
35399
35405
  }, n3.ulid = function(e3) {
35400
35406
  return n3.check(function(n4, e4) {
35401
35407
  return new n4(b({ type: "string", format: "ulid", check: "string_format", abort: false }, L(e4)));
35402
- }(sr, e3));
35408
+ }(lr, e3));
35403
35409
  }, n3.base64 = function(e3) {
35404
35410
  return n3.check(function(n4, e4) {
35405
35411
  return new n4(b({ type: "string", format: "base64", check: "string_format", abort: false }, L(e4)));
35406
- }(vr, e3));
35412
+ }(_r, e3));
35407
35413
  }, n3.base64url = function(e3) {
35408
35414
  return n3.check(function(n4, e4) {
35409
35415
  return new n4(b({ type: "string", format: "base64url", check: "string_format", abort: false }, L(e4)));
35410
- }(mr, e3));
35416
+ }(gr, e3));
35411
35417
  }, n3.xid = function(e3) {
35412
35418
  return n3.check(function(n4, e4) {
35413
35419
  return new n4(b({ type: "string", format: "xid", check: "string_format", abort: false }, L(e4)));
35414
- }(cr, e3));
35420
+ }(dr, e3));
35415
35421
  }, n3.ksuid = function(e3) {
35416
35422
  return n3.check(function(n4, e4) {
35417
35423
  return new n4(b({ type: "string", format: "ksuid", check: "string_format", abort: false }, L(e4)));
35418
- }(lr, e3));
35424
+ }(pr, e3));
35419
35425
  }, n3.ipv4 = function(e3) {
35420
35426
  return n3.check(function(n4, e4) {
35421
35427
  return new n4(b({ type: "string", format: "ipv4", check: "string_format", abort: false }, L(e4)));
35422
- }(dr, e3));
35428
+ }(fr, e3));
35423
35429
  }, n3.ipv6 = function(e3) {
35424
35430
  return n3.check(function(n4, e4) {
35425
35431
  return new n4(b({ type: "string", format: "ipv6", check: "string_format", abort: false }, L(e4)));
35426
- }(pr, e3));
35432
+ }(hr, e3));
35427
35433
  }, n3.cidrv4 = function(e3) {
35428
35434
  return n3.check(function(n4, e4) {
35429
35435
  return new n4(b({ type: "string", format: "cidrv4", check: "string_format", abort: false }, L(e4)));
35430
- }(fr, e3));
35436
+ }(vr, e3));
35431
35437
  }, n3.cidrv6 = function(e3) {
35432
35438
  return n3.check(function(n4, e4) {
35433
35439
  return new n4(b({ type: "string", format: "cidrv6", check: "string_format", abort: false }, L(e4)));
35434
- }(hr, e3));
35440
+ }(mr, e3));
35435
35441
  }, n3.e164 = function(e3) {
35436
35442
  return n3.check(function(n4, e4) {
35437
35443
  return new n4(b({ type: "string", format: "e164", check: "string_format", abort: false }, L(e4)));
35438
- }(_r, e3));
35444
+ }(yr, e3));
35439
35445
  }, n3.datetime = function(e3) {
35440
- return n3.check(jt(e3));
35441
- }, n3.date = function(e3) {
35442
35446
  return n3.check(Mt(e3));
35443
- }, n3.time = function(e3) {
35447
+ }, n3.date = function(e3) {
35444
35448
  return n3.check(Lt(e3));
35449
+ }, n3.time = function(e3) {
35450
+ return n3.check(qt(e3));
35445
35451
  }, n3.duration = function(e3) {
35446
- return n3.check(Vt(e3));
35452
+ return n3.check(Wt(e3));
35447
35453
  };
35448
35454
  });
35449
- function Xt(n3) {
35455
+ function nr(n3) {
35450
35456
  return function(n4, e2) {
35451
35457
  return new n4(b({ type: "string" }, L(e2)));
35452
- }(Yt, n3);
35458
+ }(Qt, n3);
35453
35459
  }
35454
- var Qt = z("ZodStringFormat", function(n3, e2) {
35455
- ie.init(n3, e2), Kt.init(n3, e2);
35460
+ var er = z("ZodStringFormat", function(n3, e2) {
35461
+ ae.init(n3, e2), Xt.init(n3, e2);
35456
35462
  });
35457
- var nr = z("ZodEmail", function(n3, e2) {
35458
- se.init(n3, e2), Qt.init(n3, e2);
35463
+ var tr = z("ZodEmail", function(n3, e2) {
35464
+ ce.init(n3, e2), er.init(n3, e2);
35459
35465
  });
35460
- var er = z("ZodGUID", function(n3, e2) {
35461
- ae.init(n3, e2), Qt.init(n3, e2);
35466
+ var rr = z("ZodGUID", function(n3, e2) {
35467
+ ue.init(n3, e2), er.init(n3, e2);
35462
35468
  });
35463
- var tr = z("ZodUUID", function(n3, e2) {
35464
- ue.init(n3, e2), Qt.init(n3, e2);
35469
+ var or = z("ZodUUID", function(n3, e2) {
35470
+ se.init(n3, e2), er.init(n3, e2);
35465
35471
  });
35466
- var rr = z("ZodURL", function(n3, e2) {
35467
- ce.init(n3, e2), Qt.init(n3, e2);
35472
+ var ir = z("ZodURL", function(n3, e2) {
35473
+ le.init(n3, e2), er.init(n3, e2);
35468
35474
  });
35469
- var or = z("ZodEmoji", function(n3, e2) {
35470
- le.init(n3, e2), Qt.init(n3, e2);
35475
+ var ar = z("ZodEmoji", function(n3, e2) {
35476
+ de.init(n3, e2), er.init(n3, e2);
35471
35477
  });
35472
- var ir = z("ZodNanoID", function(n3, e2) {
35473
- de.init(n3, e2), Qt.init(n3, e2);
35478
+ var ur = z("ZodNanoID", function(n3, e2) {
35479
+ pe.init(n3, e2), er.init(n3, e2);
35474
35480
  });
35475
- var ar = z("ZodCUID", function(n3, e2) {
35476
- pe.init(n3, e2), Qt.init(n3, e2);
35481
+ var sr = z("ZodCUID", function(n3, e2) {
35482
+ fe.init(n3, e2), er.init(n3, e2);
35477
35483
  });
35478
- var ur = z("ZodCUID2", function(n3, e2) {
35479
- fe.init(n3, e2), Qt.init(n3, e2);
35484
+ var cr = z("ZodCUID2", function(n3, e2) {
35485
+ he.init(n3, e2), er.init(n3, e2);
35480
35486
  });
35481
- var sr = z("ZodULID", function(n3, e2) {
35482
- he.init(n3, e2), Qt.init(n3, e2);
35487
+ var lr = z("ZodULID", function(n3, e2) {
35488
+ ve.init(n3, e2), er.init(n3, e2);
35483
35489
  });
35484
- var cr = z("ZodXID", function(n3, e2) {
35485
- ve.init(n3, e2), Qt.init(n3, e2);
35490
+ var dr = z("ZodXID", function(n3, e2) {
35491
+ me.init(n3, e2), er.init(n3, e2);
35486
35492
  });
35487
- var lr = z("ZodKSUID", function(n3, e2) {
35488
- me.init(n3, e2), Qt.init(n3, e2);
35493
+ var pr = z("ZodKSUID", function(n3, e2) {
35494
+ _e.init(n3, e2), er.init(n3, e2);
35489
35495
  });
35490
- var dr = z("ZodIPv4", function(n3, e2) {
35491
- ke.init(n3, e2), Qt.init(n3, e2);
35496
+ var fr = z("ZodIPv4", function(n3, e2) {
35497
+ be.init(n3, e2), er.init(n3, e2);
35492
35498
  });
35493
- var pr = z("ZodIPv6", function(n3, e2) {
35494
- be.init(n3, e2), Qt.init(n3, e2);
35499
+ var hr = z("ZodIPv6", function(n3, e2) {
35500
+ ze.init(n3, e2), er.init(n3, e2);
35495
35501
  });
35496
- var fr = z("ZodCIDRv4", function(n3, e2) {
35497
- ze.init(n3, e2), Qt.init(n3, e2);
35502
+ var vr = z("ZodCIDRv4", function(n3, e2) {
35503
+ xe.init(n3, e2), er.init(n3, e2);
35498
35504
  });
35499
- var hr = z("ZodCIDRv6", function(n3, e2) {
35500
- xe.init(n3, e2), Qt.init(n3, e2);
35505
+ var mr = z("ZodCIDRv6", function(n3, e2) {
35506
+ Ie.init(n3, e2), er.init(n3, e2);
35501
35507
  });
35502
- var vr = z("ZodBase64", function(n3, e2) {
35503
- Te.init(n3, e2), Qt.init(n3, e2);
35508
+ var _r = z("ZodBase64", function(n3, e2) {
35509
+ Ee.init(n3, e2), er.init(n3, e2);
35504
35510
  });
35505
- var mr = z("ZodBase64URL", function(n3, e2) {
35506
- Ee.init(n3, e2), Qt.init(n3, e2);
35511
+ var gr = z("ZodBase64URL", function(n3, e2) {
35512
+ Pe.init(n3, e2), er.init(n3, e2);
35507
35513
  });
35508
- var _r = z("ZodE164", function(n3, e2) {
35509
- Pe.init(n3, e2), Qt.init(n3, e2);
35514
+ var yr = z("ZodE164", function(n3, e2) {
35515
+ Ce.init(n3, e2), er.init(n3, e2);
35510
35516
  });
35511
- var yr = z("ZodJWT", function(n3, e2) {
35512
- Ze.init(n3, e2), Qt.init(n3, e2);
35517
+ var wr = z("ZodJWT", function(n3, e2) {
35518
+ Ze.init(n3, e2), er.init(n3, e2);
35513
35519
  });
35514
- var gr = z("ZodNumber", function(n3, e2) {
35520
+ var kr = z("ZodNumber", function(n3, e2) {
35515
35521
  var t2, r2, o2, i2, a2, u2, s2, c2, l2;
35516
- Ce.init(n3, e2), Jt.init(n3, e2), n3.gt = function(e3, t3) {
35517
- return n3.check(yt(e3, t3));
35522
+ Ae.init(n3, e2), Yt.init(n3, e2), n3.gt = function(e3, t3) {
35523
+ return n3.check(wt(e3, t3));
35518
35524
  }, n3.gte = function(e3, t3) {
35519
- return n3.check(gt(e3, t3));
35525
+ return n3.check(kt(e3, t3));
35520
35526
  }, n3.min = function(e3, t3) {
35521
- return n3.check(gt(e3, t3));
35527
+ return n3.check(kt(e3, t3));
35522
35528
  }, n3.lt = function(e3, t3) {
35523
- return n3.check(mt(e3, t3));
35529
+ return n3.check(gt(e3, t3));
35524
35530
  }, n3.lte = function(e3, t3) {
35525
- return n3.check(_t(e3, t3));
35531
+ return n3.check(yt(e3, t3));
35526
35532
  }, n3.max = function(e3, t3) {
35527
- return n3.check(_t(e3, t3));
35533
+ return n3.check(yt(e3, t3));
35528
35534
  }, n3.int = function(e3) {
35529
- return n3.check(br(e3));
35535
+ return n3.check(xr(e3));
35530
35536
  }, n3.safe = function(e3) {
35531
- return n3.check(br(e3));
35537
+ return n3.check(xr(e3));
35532
35538
  }, n3.positive = function(e3) {
35533
- return n3.check(yt(0, e3));
35539
+ return n3.check(wt(0, e3));
35534
35540
  }, n3.nonnegative = function(e3) {
35535
- return n3.check(gt(0, e3));
35541
+ return n3.check(kt(0, e3));
35536
35542
  }, n3.negative = function(e3) {
35537
- return n3.check(mt(0, e3));
35543
+ return n3.check(gt(0, e3));
35538
35544
  }, n3.nonpositive = function(e3) {
35539
- return n3.check(_t(0, e3));
35545
+ return n3.check(yt(0, e3));
35540
35546
  }, n3.multipleOf = function(e3, t3) {
35541
- return n3.check(wt(e3, t3));
35547
+ return n3.check(bt(e3, t3));
35542
35548
  }, n3.step = function(e3, t3) {
35543
- return n3.check(wt(e3, t3));
35549
+ return n3.check(bt(e3, t3));
35544
35550
  }, n3.finite = function() {
35545
35551
  return n3;
35546
35552
  };
35547
35553
  var d2 = n3._zod.bag;
35548
35554
  n3.minValue = (t2 = Math.max((r2 = d2.minimum) !== null && r2 !== undefined ? r2 : Number.NEGATIVE_INFINITY, (o2 = d2.exclusiveMinimum) !== null && o2 !== undefined ? o2 : Number.NEGATIVE_INFINITY)) !== null && t2 !== undefined ? t2 : null, n3.maxValue = (i2 = Math.min((a2 = d2.maximum) !== null && a2 !== undefined ? a2 : Number.POSITIVE_INFINITY, (u2 = d2.exclusiveMaximum) !== null && u2 !== undefined ? u2 : Number.POSITIVE_INFINITY)) !== null && i2 !== undefined ? i2 : null, n3.isInt = ((s2 = d2.format) !== null && s2 !== undefined ? s2 : "").includes("int") || Number.isSafeInteger((c2 = d2.multipleOf) !== null && c2 !== undefined ? c2 : 0.5), n3.isFinite = true, n3.format = (l2 = d2.format) !== null && l2 !== undefined ? l2 : null;
35549
35555
  });
35550
- function wr(n3) {
35556
+ function br(n3) {
35551
35557
  return function(n4, e2) {
35552
35558
  return new n4(b({ type: "number", checks: [] }, L(e2)));
35553
- }(gr, n3);
35559
+ }(kr, n3);
35554
35560
  }
35555
- var kr = z("ZodNumberFormat", function(n3, e2) {
35556
- Ae.init(n3, e2), gr.init(n3, e2);
35561
+ var zr = z("ZodNumberFormat", function(n3, e2) {
35562
+ Re.init(n3, e2), kr.init(n3, e2);
35557
35563
  });
35558
- function br(n3) {
35564
+ function xr(n3) {
35559
35565
  return function(n4, e2) {
35560
35566
  return new n4(b({ type: "number", check: "number_format", abort: false, format: "safeint" }, L(e2)));
35561
- }(kr, n3);
35567
+ }(zr, n3);
35562
35568
  }
35563
- var zr = z("ZodBoolean", function(n3, e2) {
35564
- Ue.init(n3, e2), Jt.init(n3, e2);
35569
+ var Ir = z("ZodBoolean", function(n3, e2) {
35570
+ Ue.init(n3, e2), Yt.init(n3, e2);
35565
35571
  });
35566
- function xr(n3) {
35572
+ function Tr(n3) {
35567
35573
  return function(n4, e2) {
35568
35574
  return new n4(b({ type: "boolean" }, L(e2)));
35569
- }(zr, n3);
35575
+ }(Ir, n3);
35570
35576
  }
35571
- var Ir = z("ZodAny", function(n3, e2) {
35572
- Re.init(n3, e2), Jt.init(n3, e2);
35577
+ var Er = z("ZodNull", function(n3, e2) {
35578
+ Se.init(n3, e2), Yt.init(n3, e2);
35573
35579
  });
35574
- var Tr = z("ZodUnknown", function(n3, e2) {
35575
- Se.init(n3, e2), Jt.init(n3, e2);
35580
+ function Pr(n3) {
35581
+ return function(n4, e2) {
35582
+ return new n4(b({ type: "null" }, L(e2)));
35583
+ }(Er, n3);
35584
+ }
35585
+ var Cr = z("ZodAny", function(n3, e2) {
35586
+ Oe.init(n3, e2), Yt.init(n3, e2);
35587
+ });
35588
+ var Zr = z("ZodUnknown", function(n3, e2) {
35589
+ $e.init(n3, e2), Yt.init(n3, e2);
35576
35590
  });
35577
- function Er() {
35578
- return new Tr({ type: "unknown" });
35591
+ function Ar() {
35592
+ return new Zr({ type: "unknown" });
35579
35593
  }
35580
- var Pr = z("ZodNever", function(n3, e2) {
35581
- Oe.init(n3, e2), Jt.init(n3, e2);
35594
+ var Rr = z("ZodNever", function(n3, e2) {
35595
+ je.init(n3, e2), Yt.init(n3, e2);
35582
35596
  });
35583
- function Zr(n3) {
35597
+ function Ur(n3) {
35584
35598
  return function(n4, e2) {
35585
35599
  return new n4(b({ type: "never" }, L(e2)));
35586
- }(Pr, n3);
35600
+ }(Rr, n3);
35587
35601
  }
35588
- var Cr = z("ZodArray", function(n3, e2) {
35589
- je.init(n3, e2), Jt.init(n3, e2), n3.element = e2.element, n3.min = function(e3, t2) {
35590
- return n3.check(bt(e3, t2));
35602
+ var Sr = z("ZodArray", function(n3, e2) {
35603
+ Me.init(n3, e2), Yt.init(n3, e2), n3.element = e2.element, n3.min = function(e3, t2) {
35604
+ return n3.check(xt(e3, t2));
35591
35605
  }, n3.nonempty = function(e3) {
35592
- return n3.check(bt(1, e3));
35606
+ return n3.check(xt(1, e3));
35593
35607
  }, n3.max = function(e3, t2) {
35594
- return n3.check(kt(e3, t2));
35595
- }, n3.length = function(e3, t2) {
35596
35608
  return n3.check(zt(e3, t2));
35609
+ }, n3.length = function(e3, t2) {
35610
+ return n3.check(It(e3, t2));
35597
35611
  }, n3.unwrap = function() {
35598
35612
  return n3.element;
35599
35613
  };
35600
35614
  });
35601
- function Ar(n3, e2) {
35615
+ function Or(n3, e2) {
35602
35616
  return function(n4, e3, t2) {
35603
35617
  return new n4(b({ type: "array", element: e3 }, L(t2)));
35604
- }(Cr, n3, e2);
35618
+ }(Sr, n3, e2);
35605
35619
  }
35606
- var Ur = z("ZodObject", function(n3, e2) {
35607
- Fe.init(n3, e2), Jt.init(n3, e2), A(n3, "shape", function() {
35620
+ var $r = z("ZodObject", function(n3, e2) {
35621
+ De.init(n3, e2), Yt.init(n3, e2), A(n3, "shape", function() {
35608
35622
  return e2.shape;
35609
35623
  }), n3.keyof = function() {
35610
- return Vr(Object.keys(n3._zod.def.shape));
35624
+ return Gr(Object.keys(n3._zod.def.shape));
35611
35625
  }, n3.catchall = function(e3) {
35612
35626
  return n3.clone(b(b({}, n3._zod.def), {}, { catchall: e3 }));
35613
35627
  }, n3.passthrough = function() {
35614
- return n3.clone(b(b({}, n3._zod.def), {}, { catchall: Er() }));
35628
+ return n3.clone(b(b({}, n3._zod.def), {}, { catchall: Ar() }));
35615
35629
  }, n3.loose = function() {
35616
- return n3.clone(b(b({}, n3._zod.def), {}, { catchall: Er() }));
35630
+ return n3.clone(b(b({}, n3._zod.def), {}, { catchall: Ar() }));
35617
35631
  }, n3.strict = function() {
35618
- return n3.clone(b(b({}, n3._zod.def), {}, { catchall: Zr() }));
35632
+ return n3.clone(b(b({}, n3._zod.def), {}, { catchall: Ur() }));
35619
35633
  }, n3.strip = function() {
35620
35634
  return n3.clone(b(b({}, n3._zod.def), {}, { catchall: undefined }));
35621
35635
  }, n3.extend = function(e3) {
@@ -35624,14 +35638,14 @@ var Ur = z("ZodObject", function(n3, e2) {
35624
35638
  throw new Error("Invalid input to extend: expected a plain object");
35625
35639
  var t2 = b(b({}, n4._zod.def), {}, { get shape() {
35626
35640
  var t3 = b(b({}, n4._zod.def.shape), e4);
35627
- return U(this, "shape", t3), t3;
35641
+ return R(this, "shape", t3), t3;
35628
35642
  }, checks: [] });
35629
35643
  return F(n4, t2);
35630
35644
  }(n3, e3);
35631
35645
  }, n3.merge = function(e3) {
35632
35646
  return r2 = e3, F(t2 = n3, b(b({}, t2._zod.def), {}, { get shape() {
35633
35647
  var n4 = b(b({}, t2._zod.def.shape), r2._zod.def.shape);
35634
- return U(this, "shape", n4), n4;
35648
+ return R(this, "shape", n4), n4;
35635
35649
  }, catchall: r2._zod.def.catchall, checks: [] }));
35636
35650
  var t2, r2;
35637
35651
  }, n3.pick = function(e3) {
@@ -35667,7 +35681,7 @@ var Ur = z("ZodObject", function(n3, e2) {
35667
35681
  for (var u2 in r2)
35668
35682
  i2[u2] = n4 ? new n4({ type: "optional", innerType: r2[u2] }) : r2[u2];
35669
35683
  return F(e3, b(b({}, e3._zod.def), {}, { shape: i2, checks: [] }));
35670
- }(Gr, n3, arguments.length <= 0 ? undefined : arguments[0]);
35684
+ }(Qr, n3, arguments.length <= 0 ? undefined : arguments[0]);
35671
35685
  }, n3.required = function() {
35672
35686
  return function(n4, e3, t2) {
35673
35687
  var r2 = e3._zod.def.shape, i2 = b({}, r2);
@@ -35681,43 +35695,46 @@ var Ur = z("ZodObject", function(n3, e2) {
35681
35695
  for (var u2 in r2)
35682
35696
  i2[u2] = new n4({ type: "nonoptional", innerType: r2[u2] });
35683
35697
  return F(e3, b(b({}, e3._zod.def), {}, { shape: i2, checks: [] }));
35684
- }(no, n3, arguments.length <= 0 ? undefined : arguments[0]);
35698
+ }(io, n3, arguments.length <= 0 ? undefined : arguments[0]);
35685
35699
  };
35686
35700
  });
35687
- function Rr(n3, e2) {
35701
+ function jr(n3, e2) {
35688
35702
  var t2 = b({ type: "object", get shape() {
35689
- return U(this, "shape", b({}, n3)), this.shape;
35703
+ return R(this, "shape", b({}, n3)), this.shape;
35690
35704
  } }, L(e2));
35691
- return new Ur(t2);
35705
+ return new $r(t2);
35692
35706
  }
35693
- function Sr(n3, e2) {
35694
- return new Ur(b({ type: "object", get shape() {
35695
- return U(this, "shape", b({}, n3)), this.shape;
35696
- }, catchall: Er() }, L(e2)));
35707
+ function Nr(n3, e2) {
35708
+ return new $r(b({ type: "object", get shape() {
35709
+ return R(this, "shape", b({}, n3)), this.shape;
35710
+ }, catchall: Ar() }, L(e2)));
35697
35711
  }
35698
- var Or = z("ZodUnion", function(n3, e2) {
35699
- De.init(n3, e2), Jt.init(n3, e2), n3.options = e2.options;
35712
+ var Mr = z("ZodUnion", function(n3, e2) {
35713
+ Ve.init(n3, e2), Yt.init(n3, e2), n3.options = e2.options;
35700
35714
  });
35701
- function $r(n3, e2) {
35702
- return new Or(b({ type: "union", options: n3 }, L(e2)));
35715
+ function Fr(n3, e2) {
35716
+ return new Mr(b({ type: "union", options: n3 }, L(e2)));
35703
35717
  }
35704
- var jr = z("ZodDiscriminatedUnion", function(n3, e2) {
35705
- Or.init(n3, e2), Ve.init(n3, e2);
35718
+ var Lr = z("ZodDiscriminatedUnion", function(n3, e2) {
35719
+ Mr.init(n3, e2), We.init(n3, e2);
35706
35720
  });
35707
- var Nr = z("ZodIntersection", function(n3, e2) {
35708
- qe.init(n3, e2), Jt.init(n3, e2);
35721
+ function Dr(n3, e2, t2) {
35722
+ return new Lr(b({ type: "union", options: e2, discriminator: n3 }, L(t2)));
35723
+ }
35724
+ var qr = z("ZodIntersection", function(n3, e2) {
35725
+ He.init(n3, e2), Yt.init(n3, e2);
35709
35726
  });
35710
- function Mr(n3, e2) {
35711
- return new Nr({ type: "intersection", left: n3, right: e2 });
35727
+ function Vr(n3, e2) {
35728
+ return new qr({ type: "intersection", left: n3, right: e2 });
35712
35729
  }
35713
- var Fr = z("ZodRecord", function(n3, e2) {
35714
- Be.init(n3, e2), Jt.init(n3, e2), n3.keyType = e2.keyType, n3.valueType = e2.valueType;
35730
+ var Wr = z("ZodRecord", function(n3, e2) {
35731
+ Je.init(n3, e2), Yt.init(n3, e2), n3.keyType = e2.keyType, n3.valueType = e2.valueType;
35715
35732
  });
35716
- function Lr(n3, e2, t2) {
35717
- return new Fr(b({ type: "record", keyType: n3, valueType: e2 }, L(t2)));
35733
+ function Hr(n3, e2, t2) {
35734
+ return new Wr(b({ type: "record", keyType: n3, valueType: e2 }, L(t2)));
35718
35735
  }
35719
- var Dr = z("ZodEnum", function(n3, e2) {
35720
- Ge.init(n3, e2), Jt.init(n3, e2), n3.enum = e2.entries, n3.options = Object.values(e2.entries);
35736
+ var Br = z("ZodEnum", function(n3, e2) {
35737
+ Ke.init(n3, e2), Yt.init(n3, e2), n3.enum = e2.entries, n3.options = Object.values(e2.entries);
35721
35738
  var t2 = new Set(Object.keys(e2.entries));
35722
35739
  n3.extract = function(n4, r2) {
35723
35740
  var i2, a2 = {}, u2 = a(n4);
@@ -35733,7 +35750,7 @@ var Dr = z("ZodEnum", function(n3, e2) {
35733
35750
  } finally {
35734
35751
  u2.f();
35735
35752
  }
35736
- return new Dr(b(b(b({}, e2), {}, { checks: [] }, L(r2)), {}, { entries: a2 }));
35753
+ return new Br(b(b(b({}, e2), {}, { checks: [] }, L(r2)), {}, { entries: a2 }));
35737
35754
  }, n3.exclude = function(n4, r2) {
35738
35755
  var i2, a2 = b({}, e2.entries), u2 = a(n4);
35739
35756
  try {
@@ -35748,27 +35765,27 @@ var Dr = z("ZodEnum", function(n3, e2) {
35748
35765
  } finally {
35749
35766
  u2.f();
35750
35767
  }
35751
- return new Dr(b(b(b({}, e2), {}, { checks: [] }, L(r2)), {}, { entries: a2 }));
35768
+ return new Br(b(b(b({}, e2), {}, { checks: [] }, L(r2)), {}, { entries: a2 }));
35752
35769
  };
35753
35770
  });
35754
- function Vr(n3, e2) {
35771
+ function Gr(n3, e2) {
35755
35772
  var t2 = Array.isArray(n3) ? Object.fromEntries(n3.map(function(n4) {
35756
35773
  return [n4, n4];
35757
35774
  })) : n3;
35758
- return new Dr(b({ type: "enum", entries: t2 }, L(e2)));
35775
+ return new Br(b({ type: "enum", entries: t2 }, L(e2)));
35759
35776
  }
35760
- var qr = z("ZodLiteral", function(n3, e2) {
35761
- Je.init(n3, e2), Jt.init(n3, e2), n3.values = new Set(e2.values), Object.defineProperty(n3, "value", { get: function() {
35777
+ var Jr = z("ZodLiteral", function(n3, e2) {
35778
+ Ye.init(n3, e2), Yt.init(n3, e2), n3.values = new Set(e2.values), Object.defineProperty(n3, "value", { get: function() {
35762
35779
  if (e2.values.length > 1)
35763
35780
  throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
35764
35781
  return e2.values[0];
35765
35782
  } });
35766
35783
  });
35767
- function Wr(n3, e2) {
35768
- return new qr(b({ type: "literal", values: Array.isArray(n3) ? n3 : [n3] }, L(e2)));
35784
+ function Kr(n3, e2) {
35785
+ return new Jr(b({ type: "literal", values: Array.isArray(n3) ? n3 : [n3] }, L(e2)));
35769
35786
  }
35770
- var Hr = z("ZodTransform", function(n3, e2) {
35771
- Ke.init(n3, e2), Jt.init(n3, e2), n3._zod.parse = function(t2, r2) {
35787
+ var Yr = z("ZodTransform", function(n3, e2) {
35788
+ Xe.init(n3, e2), Yt.init(n3, e2), n3._zod.parse = function(t2, r2) {
35772
35789
  t2.addIssue = function(r3) {
35773
35790
  if (typeof r3 == "string")
35774
35791
  t2.issues.push(J(r3, t2.value, e2));
@@ -35783,239 +35800,263 @@ var Hr = z("ZodTransform", function(n3, e2) {
35783
35800
  }) : (t2.value = o2, t2);
35784
35801
  };
35785
35802
  });
35786
- function Br(n3) {
35787
- return new Hr({ type: "transform", transform: n3 });
35803
+ function Xr(n3) {
35804
+ return new Yr({ type: "transform", transform: n3 });
35788
35805
  }
35789
- var Gr = z("ZodOptional", function(n3, e2) {
35790
- Ye.init(n3, e2), Jt.init(n3, e2), n3.unwrap = function() {
35806
+ var Qr = z("ZodOptional", function(n3, e2) {
35807
+ Qe.init(n3, e2), Yt.init(n3, e2), n3.unwrap = function() {
35791
35808
  return n3._zod.def.innerType;
35792
35809
  };
35793
35810
  });
35794
- function Jr(n3) {
35795
- return new Gr({ type: "optional", innerType: n3 });
35811
+ function no(n3) {
35812
+ return new Qr({ type: "optional", innerType: n3 });
35796
35813
  }
35797
- var Kr = z("ZodNullable", function(n3, e2) {
35798
- Xe.init(n3, e2), Jt.init(n3, e2), n3.unwrap = function() {
35814
+ var eo = z("ZodNullable", function(n3, e2) {
35815
+ nt.init(n3, e2), Yt.init(n3, e2), n3.unwrap = function() {
35799
35816
  return n3._zod.def.innerType;
35800
35817
  };
35801
35818
  });
35802
- function Yr(n3) {
35803
- return new Kr({ type: "nullable", innerType: n3 });
35819
+ function to(n3) {
35820
+ return new eo({ type: "nullable", innerType: n3 });
35804
35821
  }
35805
- var Xr = z("ZodDefault", function(n3, e2) {
35806
- Qe.init(n3, e2), Jt.init(n3, e2), n3.unwrap = function() {
35822
+ var ro = z("ZodDefault", function(n3, e2) {
35823
+ et.init(n3, e2), Yt.init(n3, e2), n3.unwrap = function() {
35807
35824
  return n3._zod.def.innerType;
35808
35825
  }, n3.removeDefault = n3.unwrap;
35809
35826
  });
35810
- var Qr = z("ZodPrefault", function(n3, e2) {
35811
- et.init(n3, e2), Jt.init(n3, e2), n3.unwrap = function() {
35827
+ var oo = z("ZodPrefault", function(n3, e2) {
35828
+ rt.init(n3, e2), Yt.init(n3, e2), n3.unwrap = function() {
35812
35829
  return n3._zod.def.innerType;
35813
35830
  };
35814
35831
  });
35815
- var no = z("ZodNonOptional", function(n3, e2) {
35816
- tt.init(n3, e2), Jt.init(n3, e2), n3.unwrap = function() {
35832
+ var io = z("ZodNonOptional", function(n3, e2) {
35833
+ ot.init(n3, e2), Yt.init(n3, e2), n3.unwrap = function() {
35817
35834
  return n3._zod.def.innerType;
35818
35835
  };
35819
35836
  });
35820
- var eo = z("ZodCatch", function(n3, e2) {
35821
- ot.init(n3, e2), Jt.init(n3, e2), n3.unwrap = function() {
35837
+ var ao = z("ZodCatch", function(n3, e2) {
35838
+ at.init(n3, e2), Yt.init(n3, e2), n3.unwrap = function() {
35822
35839
  return n3._zod.def.innerType;
35823
35840
  }, n3.removeCatch = n3.unwrap;
35824
35841
  });
35825
- var to = z("ZodPipe", function(n3, e2) {
35826
- it.init(n3, e2), Jt.init(n3, e2), n3.in = e2.in, n3.out = e2.out;
35842
+ var uo = z("ZodPipe", function(n3, e2) {
35843
+ ut.init(n3, e2), Yt.init(n3, e2), n3.in = e2.in, n3.out = e2.out;
35827
35844
  });
35828
- function ro(n3, e2) {
35829
- return new to({ type: "pipe", in: n3, out: e2 });
35845
+ function so(n3, e2) {
35846
+ return new uo({ type: "pipe", in: n3, out: e2 });
35830
35847
  }
35831
- var oo = z("ZodReadonly", function(n3, e2) {
35832
- ut.init(n3, e2), Jt.init(n3, e2);
35848
+ var co = z("ZodReadonly", function(n3, e2) {
35849
+ ct.init(n3, e2), Yt.init(n3, e2);
35833
35850
  });
35834
- var io = z("ZodCustom", function(n3, e2) {
35835
- ct.init(n3, e2), Jt.init(n3, e2);
35851
+ var lo = z("ZodCustom", function(n3, e2) {
35852
+ dt.init(n3, e2), Yt.init(n3, e2);
35836
35853
  });
35837
- var ao;
35838
- var uo;
35839
- var so;
35840
- var co = "custom";
35841
- var lo = "2025-06-18";
35842
- var po = "2.0";
35843
- var fo = function(n3, e2, t2) {
35854
+ function po(n3, e2) {
35855
+ return so(Xr(n3), e2);
35856
+ }
35857
+ var fo = "custom";
35858
+ var ho;
35859
+ var vo;
35860
+ var mo;
35861
+ var _o = "2025-11-25";
35862
+ var go = "io.modelcontextprotocol/related-task";
35863
+ var yo = "2.0";
35864
+ var wo = function(n3, e2, t2) {
35844
35865
  var r2, i2 = L(t2);
35845
35866
  return (r2 = i2.abort) !== null && r2 !== undefined || (i2.abort = true), new n3(b({ type: "custom", check: "custom", fn: e2 }, i2));
35846
- }(io, (ao = function(n3) {
35867
+ }(lo, (ho = function(n3) {
35847
35868
  return n3 !== null && (j(n3) === "object" || typeof n3 == "function");
35848
- }) != null ? ao : function() {
35869
+ }) != null ? ho : function() {
35849
35870
  return true;
35850
- }, uo);
35851
- var ho = $r([Xt(), wr().int()]);
35852
- var vo = Xt();
35853
- var mo = Sr({ progressToken: ho.optional() });
35854
- var _o = Sr({ _meta: mo.optional() });
35855
- var yo = Rr({ method: Xt(), params: _o.optional() });
35856
- var go = Sr({ _meta: Lr(Xt(), Er()).optional() });
35857
- var wo = Rr({ method: Xt(), params: go.optional() });
35858
- var ko = Sr({ _meta: Lr(Xt(), Er()).optional() });
35859
- var bo = $r([Xt(), wr().int()]);
35860
- var zo = Rr(b({ jsonrpc: Wr(po), id: bo }, yo.shape)).strict();
35861
- var xo = function(n3) {
35862
- return zo.safeParse(n3).success;
35871
+ }, vo);
35872
+ var ko = Fr([nr(), br().int()]);
35873
+ var bo = nr();
35874
+ var zo = Nr({ ttl: Fr([br(), Pr()]).optional(), pollInterval: br().optional() });
35875
+ var xo = Nr({ taskId: nr() });
35876
+ var Io = Nr(f({ progressToken: ko.optional() }, go, xo.optional()));
35877
+ var To = Nr({ task: zo.optional(), _meta: Io.optional() });
35878
+ var Eo = jr({ method: nr(), params: To.optional() });
35879
+ var Po = Nr({ _meta: jr(f({}, go, no(xo))).passthrough().optional() });
35880
+ var Co = jr({ method: nr(), params: Po.optional() });
35881
+ var Zo = Nr({ _meta: Nr(f({}, go, xo.optional())).optional() });
35882
+ var Ao = Fr([nr(), br().int()]);
35883
+ var Ro = jr(b({ jsonrpc: Kr(yo), id: Ao }, Eo.shape)).strict();
35884
+ var Uo = function(n3) {
35885
+ return Ro.safeParse(n3).success;
35863
35886
  };
35864
- var Io = Rr(b({ jsonrpc: Wr(po) }, wo.shape)).strict();
35865
- var To = Rr({ jsonrpc: Wr(po), id: bo, result: ko }).strict();
35866
- var Eo = function(n3) {
35867
- return To.safeParse(n3).success;
35887
+ var So = jr(b({ jsonrpc: Kr(yo) }, Co.shape)).strict();
35888
+ var Oo = jr({ jsonrpc: Kr(yo), id: Ao, result: Zo }).strict();
35889
+ var $o = function(n3) {
35890
+ return Oo.safeParse(n3).success;
35868
35891
  };
35869
35892
  (function(n3) {
35870
35893
  n3[n3.ConnectionClosed = -32000] = "ConnectionClosed", n3[n3.RequestTimeout = -32001] = "RequestTimeout", n3[n3.ParseError = -32700] = "ParseError", n3[n3.InvalidRequest = -32600] = "InvalidRequest", n3[n3.MethodNotFound = -32601] = "MethodNotFound", n3[n3.InvalidParams = -32602] = "InvalidParams", n3[n3.InternalError = -32603] = "InternalError", n3[n3.UrlElicitationRequired = -32042] = "UrlElicitationRequired";
35871
- })(so || (so = {}));
35872
- var Po = Rr({ jsonrpc: Wr(po), id: bo, error: Rr({ code: wr().int(), message: Xt(), data: Jr(Er()) }) }).strict();
35873
- var Zo = $r([zo, Io, To, Po]);
35874
- var Co = ko.strict();
35875
- var Ao = go.extend({ requestId: bo, reason: Xt().optional() });
35876
- var Uo = wo.extend({ method: Wr("notifications/cancelled"), params: Ao });
35877
- var Ro = Rr({ src: Xt(), mimeType: Xt().optional(), sizes: Ar(Xt()).optional() });
35878
- var So = Rr({ icons: Ar(Ro).optional() });
35879
- var Oo = Rr({ name: Xt(), title: Xt().optional() });
35880
- var $o = Oo.extend(b(b(b({}, Oo.shape), So.shape), {}, { version: Xt(), websiteUrl: Xt().optional() }));
35881
- var jo = Mr(Rr({ applyDefaults: xr().optional() }), Lr(Xt(), Er()));
35882
- var No = function(n3, e2) {
35883
- return ro(Br(n3), e2);
35884
- }(function(n3) {
35894
+ })(mo || (mo = {}));
35895
+ var jo = jr({ jsonrpc: Kr(yo), id: Ao, error: jr({ code: br().int(), message: nr(), data: no(Ar()) }) }).strict();
35896
+ var No = Fr([Ro, So, Oo, jo]);
35897
+ var Mo = Zo.strict();
35898
+ var Fo = Po.extend({ requestId: Ao, reason: nr().optional() });
35899
+ var Lo = Co.extend({ method: Kr("notifications/cancelled"), params: Fo });
35900
+ var Do = jr({ src: nr(), mimeType: nr().optional(), sizes: Or(nr()).optional() });
35901
+ var qo = jr({ icons: Or(Do).optional() });
35902
+ var Vo = jr({ name: nr(), title: nr().optional() });
35903
+ var Wo = Vo.extend(b(b(b({}, Vo.shape), qo.shape), {}, { version: nr(), websiteUrl: nr().optional() }));
35904
+ var Ho = Vr(jr({ applyDefaults: Tr().optional() }), Hr(nr(), Ar()));
35905
+ var Bo = po(function(n3) {
35885
35906
  return n3 && j(n3) === "object" && !Array.isArray(n3) && Object.keys(n3).length === 0 ? { form: {} } : n3;
35886
- }, Mr(Rr({ form: jo.optional(), url: fo.optional() }), Lr(Xt(), Er()).optional()));
35887
- var Mo = Rr({ experimental: Lr(Xt(), fo).optional(), sampling: Rr({ context: fo.optional(), tools: fo.optional() }).optional(), elicitation: No.optional(), roots: Rr({ listChanged: xr().optional() }).optional() });
35888
- var Fo = _o.extend({ protocolVersion: Xt(), capabilities: Mo, clientInfo: $o });
35889
- var Lo = yo.extend({ method: Wr("initialize"), params: Fo });
35890
- var Do = Rr({ experimental: Lr(Xt(), fo).optional(), logging: fo.optional(), completions: fo.optional(), prompts: Jr(Rr({ listChanged: Jr(xr()) })), resources: Rr({ subscribe: xr().optional(), listChanged: xr().optional() }).optional(), tools: Rr({ listChanged: xr().optional() }).optional() });
35891
- var Vo = ko.extend({ protocolVersion: Xt(), capabilities: Do, serverInfo: $o, instructions: Xt().optional() });
35892
- var qo = wo.extend({ method: Wr("notifications/initialized") });
35893
- var Wo = function(n3) {
35894
- return qo.safeParse(n3).success;
35907
+ }, Vr(jr({ form: Ho.optional(), url: wo.optional() }), Hr(nr(), Ar()).optional()));
35908
+ var Go = jr({ list: no(jr({}).passthrough()), cancel: no(jr({}).passthrough()), requests: no(jr({ sampling: no(jr({ createMessage: no(jr({}).passthrough()) }).passthrough()), elicitation: no(jr({ create: no(jr({}).passthrough()) }).passthrough()) }).passthrough()) }).passthrough();
35909
+ var Jo = jr({ list: no(jr({}).passthrough()), cancel: no(jr({}).passthrough()), requests: no(jr({ tools: no(jr({ call: no(jr({}).passthrough()) }).passthrough()) }).passthrough()) }).passthrough();
35910
+ var Ko = jr({ experimental: Hr(nr(), wo).optional(), sampling: jr({ context: wo.optional(), tools: wo.optional() }).optional(), elicitation: Bo.optional(), roots: jr({ listChanged: Tr().optional() }).optional(), tasks: no(Go) });
35911
+ var Yo = To.extend({ protocolVersion: nr(), capabilities: Ko, clientInfo: Wo });
35912
+ var Xo = Eo.extend({ method: Kr("initialize"), params: Yo });
35913
+ var Qo = jr({ experimental: Hr(nr(), wo).optional(), logging: wo.optional(), completions: wo.optional(), prompts: no(jr({ listChanged: no(Tr()) })), resources: jr({ subscribe: Tr().optional(), listChanged: Tr().optional() }).optional(), tools: jr({ listChanged: Tr().optional() }).optional(), tasks: no(Jo) }).passthrough();
35914
+ var ni = Zo.extend({ protocolVersion: nr(), capabilities: Qo, serverInfo: Wo, instructions: nr().optional() });
35915
+ var ei = Co.extend({ method: Kr("notifications/initialized") });
35916
+ var ti = function(n3) {
35917
+ return ei.safeParse(n3).success;
35895
35918
  };
35896
- var Ho = yo.extend({ method: Wr("ping") });
35897
- var Bo = Rr({ progress: wr(), total: Jr(wr()), message: Jr(Xt()) });
35898
- var Go = Rr(b(b(b({}, go.shape), Bo.shape), {}, { progressToken: ho }));
35899
- var Jo = wo.extend({ method: Wr("notifications/progress"), params: Go });
35900
- var Ko = _o.extend({ cursor: vo.optional() });
35901
- var Yo = yo.extend({ params: Ko.optional() });
35902
- var Xo = ko.extend({ nextCursor: Jr(vo) });
35903
- var Qo = Rr({ uri: Xt(), mimeType: Jr(Xt()), _meta: Lr(Xt(), Er()).optional() });
35904
- var ni = Qo.extend({ text: Xt() });
35905
- var ei = Xt().refine(function(n3) {
35919
+ var ri = Eo.extend({ method: Kr("ping") });
35920
+ var oi = jr({ progress: br(), total: no(br()), message: no(nr()) });
35921
+ var ii = jr(b(b(b({}, Po.shape), oi.shape), {}, { progressToken: ko }));
35922
+ var ai = Co.extend({ method: Kr("notifications/progress"), params: ii });
35923
+ var ui = To.extend({ cursor: bo.optional() });
35924
+ var si = Eo.extend({ params: ui.optional() });
35925
+ var ci = Zo.extend({ nextCursor: no(bo) });
35926
+ var li = jr({ taskId: nr(), status: Gr(["working", "input_required", "completed", "failed", "cancelled"]), ttl: Fr([br(), Pr()]), createdAt: nr(), lastUpdatedAt: nr(), pollInterval: no(br()), statusMessage: no(nr()) });
35927
+ var di = Zo.extend({ task: li });
35928
+ var pi = Po.merge(li);
35929
+ var fi = Co.extend({ method: Kr("notifications/tasks/status"), params: pi });
35930
+ var hi = Eo.extend({ method: Kr("tasks/get"), params: To.extend({ taskId: nr() }) });
35931
+ var vi = Zo.merge(li);
35932
+ var mi = Eo.extend({ method: Kr("tasks/result"), params: To.extend({ taskId: nr() }) });
35933
+ var _i = si.extend({ method: Kr("tasks/list") });
35934
+ var gi = ci.extend({ tasks: Or(li) });
35935
+ Eo.extend({ method: Kr("tasks/cancel"), params: To.extend({ taskId: nr() }) }), Zo.merge(li);
35936
+ var yi = jr({ uri: nr(), mimeType: no(nr()), _meta: Hr(nr(), Ar()).optional() });
35937
+ var wi = yi.extend({ text: nr() });
35938
+ var ki = nr().refine(function(n3) {
35906
35939
  try {
35907
35940
  return atob(n3), true;
35908
35941
  } catch (n4) {
35909
35942
  return false;
35910
35943
  }
35911
35944
  }, { message: "Invalid Base64 string" });
35912
- var ti = Qo.extend({ blob: ei });
35913
- var ri = Rr(b(b(b({}, Oo.shape), So.shape), {}, { uri: Xt(), description: Jr(Xt()), mimeType: Jr(Xt()), _meta: Jr(Sr({})) }));
35914
- var oi = Rr(b(b(b({}, Oo.shape), So.shape), {}, { uriTemplate: Xt(), description: Jr(Xt()), mimeType: Jr(Xt()), _meta: Jr(Sr({})) }));
35915
- var ii = Yo.extend({ method: Wr("resources/list") });
35916
- var ai = Xo.extend({ resources: Ar(ri) });
35917
- var ui = Yo.extend({ method: Wr("resources/templates/list") });
35918
- var si = Xo.extend({ resourceTemplates: Ar(oi) });
35919
- var ci = _o.extend({ uri: Xt() });
35920
- var li = ci;
35921
- var di = yo.extend({ method: Wr("resources/read"), params: li });
35922
- var pi = ko.extend({ contents: Ar($r([ni, ti])) });
35923
- var fi = wo.extend({ method: Wr("notifications/resources/list_changed") });
35924
- var hi = ci;
35925
- var vi = yo.extend({ method: Wr("resources/subscribe"), params: hi });
35926
- var mi = ci;
35927
- var _i = yo.extend({ method: Wr("resources/unsubscribe"), params: mi });
35928
- var yi = go.extend({ uri: Xt() });
35929
- var gi = wo.extend({ method: Wr("notifications/resources/updated"), params: yi });
35930
- var wi = Rr({ name: Xt(), description: Jr(Xt()), required: Jr(xr()) });
35931
- var ki = Rr(b(b(b({}, Oo.shape), So.shape), {}, { description: Jr(Xt()), arguments: Jr(Ar(wi)), _meta: Jr(Sr({})) }));
35932
- var bi = Yo.extend({ method: Wr("prompts/list") });
35933
- var zi = Xo.extend({ prompts: Ar(ki) });
35934
- var xi = _o.extend({ name: Xt(), arguments: Lr(Xt(), Xt()).optional() });
35935
- var Ii = yo.extend({ method: Wr("prompts/get"), params: xi });
35936
- var Ti = Rr({ type: Wr("text"), text: Xt(), _meta: Lr(Xt(), Er()).optional() });
35937
- var Ei = Rr({ type: Wr("image"), data: ei, mimeType: Xt(), _meta: Lr(Xt(), Er()).optional() });
35938
- var Pi = Rr({ type: Wr("audio"), data: ei, mimeType: Xt(), _meta: Lr(Xt(), Er()).optional() });
35939
- var Zi = Rr({ type: Wr("tool_use"), name: Xt(), id: Xt(), input: Rr({}).passthrough(), _meta: Jr(Rr({}).passthrough()) }).passthrough();
35940
- var Ci = Rr({ type: Wr("resource"), resource: $r([ni, ti]), _meta: Lr(Xt(), Er()).optional() });
35941
- var Ai = $r([Ti, Ei, Pi, ri.extend({ type: Wr("resource_link") }), Ci]);
35942
- var Ui = Rr({ role: Vr(["user", "assistant"]), content: Ai });
35943
- var Ri = ko.extend({ description: Jr(Xt()), messages: Ar(Ui) });
35944
- var Si = wo.extend({ method: Wr("notifications/prompts/list_changed") });
35945
- var Oi = Rr({ title: Xt().optional(), readOnlyHint: xr().optional(), destructiveHint: xr().optional(), idempotentHint: xr().optional(), openWorldHint: xr().optional() });
35946
- var $i = Rr(b(b(b({}, Oo.shape), So.shape), {}, { description: Xt().optional(), inputSchema: Rr({ type: Wr("object"), properties: Lr(Xt(), fo).optional(), required: Ar(Xt()).optional() }).catchall(Er()), outputSchema: Rr({ type: Wr("object"), properties: Lr(Xt(), fo).optional(), required: Ar(Xt()).optional() }).catchall(Er()).optional(), annotations: Jr(Oi), _meta: Lr(Xt(), Er()).optional() }));
35947
- var ji = Yo.extend({ method: Wr("tools/list") });
35948
- var Ni = Xo.extend({ tools: Ar($i) });
35949
- var Mi = ko.extend({ content: Ar(Ai).default([]), structuredContent: Lr(Xt(), Er()).optional(), isError: Jr(xr()) });
35950
- Mi.or(ko.extend({ toolResult: Er() }));
35951
- var Fi;
35952
- var Li = _o.extend({ name: Xt(), arguments: Jr(Lr(Xt(), Er())) });
35953
- var Di = yo.extend({ method: Wr("tools/call"), params: Li });
35954
- var Vi = wo.extend({ method: Wr("notifications/tools/list_changed") });
35955
- var qi = Vr(["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]);
35956
- var Wi = _o.extend({ level: qi });
35957
- var Hi = yo.extend({ method: Wr("logging/setLevel"), params: Wi });
35958
- var Bi = go.extend({ level: qi, logger: Xt().optional(), data: Er() });
35959
- var Gi = wo.extend({ method: Wr("notifications/message"), params: Bi });
35960
- var Ji = Rr({ name: Xt().optional() });
35961
- var Ki = Rr({ hints: Jr(Ar(Ji)), costPriority: Jr(wr().min(0).max(1)), speedPriority: Jr(wr().min(0).max(1)), intelligencePriority: Jr(wr().min(0).max(1)) });
35962
- var Yi = Rr({ mode: Jr(Vr(["auto", "required", "none"])) });
35963
- var Xi = Rr({ type: Wr("tool_result"), toolUseId: Xt().describe("The unique identifier for the corresponding tool call."), content: Ar(Ai).default([]), structuredContent: Rr({}).passthrough().optional(), isError: Jr(xr()), _meta: Jr(Rr({}).passthrough()) }).passthrough();
35964
- var Qi = new jr(b({ type: "union", options: [Ti, Ei, Pi, Zi, Xi], discriminator: "type" }, L(Fi)));
35965
- var na = Rr({ role: Vr(["user", "assistant"]), content: $r([Qi, Ar(Qi)]), _meta: Jr(Rr({}).passthrough()) }).passthrough();
35966
- var ea = _o.extend({ messages: Ar(na), modelPreferences: Ki.optional(), systemPrompt: Xt().optional(), includeContext: Vr(["none", "thisServer", "allServers"]).optional(), temperature: wr().optional(), maxTokens: wr().int(), stopSequences: Ar(Xt()).optional(), metadata: fo.optional(), tools: Jr(Ar($i)), toolChoice: Jr(Yi) });
35967
- var ta = yo.extend({ method: Wr("sampling/createMessage"), params: ea });
35968
- var ra = ko.extend({ model: Xt(), stopReason: Jr(Vr(["endTurn", "stopSequence", "maxTokens", "toolUse"]).or(Xt())), role: Vr(["user", "assistant"]), content: $r([Qi, Ar(Qi)]) });
35969
- var oa = Rr({ type: Wr("boolean"), title: Xt().optional(), description: Xt().optional(), default: xr().optional() });
35970
- var ia = Rr({ type: Wr("string"), title: Xt().optional(), description: Xt().optional(), minLength: wr().optional(), maxLength: wr().optional(), format: Vr(["email", "uri", "date", "date-time"]).optional(), default: Xt().optional() });
35971
- var aa = Rr({ type: Vr(["number", "integer"]), title: Xt().optional(), description: Xt().optional(), minimum: wr().optional(), maximum: wr().optional(), default: wr().optional() });
35972
- var ua = Rr({ type: Wr("string"), title: Xt().optional(), description: Xt().optional(), enum: Ar(Xt()), default: Xt().optional() });
35973
- var sa = Rr({ type: Wr("string"), title: Xt().optional(), description: Xt().optional(), oneOf: Ar(Rr({ const: Xt(), title: Xt() })), default: Xt().optional() });
35974
- var ca = Rr({ type: Wr("string"), title: Xt().optional(), description: Xt().optional(), enum: Ar(Xt()), enumNames: Ar(Xt()).optional(), default: Xt().optional() });
35975
- var la = $r([ua, sa]);
35976
- var da = $r([Rr({ type: Wr("array"), title: Xt().optional(), description: Xt().optional(), minItems: wr().optional(), maxItems: wr().optional(), items: Rr({ type: Wr("string"), enum: Ar(Xt()) }), default: Ar(Xt()).optional() }), Rr({ type: Wr("array"), title: Xt().optional(), description: Xt().optional(), minItems: wr().optional(), maxItems: wr().optional(), items: Rr({ anyOf: Ar(Rr({ const: Xt(), title: Xt() })) }), default: Ar(Xt()).optional() })]);
35977
- var pa = $r([ca, la, da]);
35978
- var fa = $r([pa, oa, ia, aa]);
35979
- var ha = $r([_o.extend({ mode: Wr("form").optional(), message: Xt(), requestedSchema: Rr({ type: Wr("object"), properties: Lr(Xt(), fa), required: Ar(Xt()).optional() }) }), _o.extend({ mode: Wr("url"), message: Xt(), elicitationId: Xt(), url: Xt().url() })]);
35980
- var va = yo.extend({ method: Wr("elicitation/create"), params: ha });
35981
- var ma = go.extend({ elicitationId: Xt() });
35982
- var _a19 = wo.extend({ method: Wr("notifications/elicitation/complete"), params: ma });
35983
- var ya = ko.extend({ action: Vr(["accept", "decline", "cancel"]), content: Lr(Xt(), $r([Xt(), wr(), xr(), Ar(Xt())])).optional() });
35984
- var ga = Rr({ type: Wr("ref/resource"), uri: Xt() });
35985
- var wa = Rr({ type: Wr("ref/prompt"), name: Xt() });
35986
- var ka = _o.extend({ ref: $r([wa, ga]), argument: Rr({ name: Xt(), value: Xt() }), context: Rr({ arguments: Lr(Xt(), Xt()).optional() }).optional() });
35987
- var ba = yo.extend({ method: Wr("completion/complete"), params: ka });
35988
- var za = ko.extend({ completion: Sr({ values: Ar(Xt()).max(100), total: Jr(wr().int()), hasMore: Jr(xr()) }) });
35989
- var xa = Rr({ uri: Xt().startsWith("file://"), name: Xt().optional(), _meta: Lr(Xt(), Er()).optional() });
35990
- var Ia = yo.extend({ method: Wr("roots/list") });
35991
- var Ta = ko.extend({ roots: Ar(xa) });
35992
- var Ea = wo.extend({ method: Wr("notifications/roots/list_changed") });
35993
- $r([Ho, Lo, ba, Hi, Ii, bi, ii, ui, di, vi, _i, Di, ji]), $r([Uo, Jo, qo, Ea]), $r([Co, ra, ya, Ta]), $r([Ho, ta, va, Ia]), $r([Uo, Jo, Gi, gi, fi, Vi, Si, _a19]), $r([Co, Vo, za, Ri, zi, ai, si, pi, Mi, Ni]);
35994
- var Pa;
35995
- var Za = function(n3) {
35996
- return vt(rr, n3);
35997
- }().superRefine(function(n3, e2) {
35945
+ var bi = yi.extend({ blob: ki });
35946
+ var zi = jr({ audience: Or(Gr(["user", "assistant"])).optional(), priority: br().min(0).max(1).optional(), lastModified: Mt({ offset: true }).optional() });
35947
+ var xi = jr(b(b(b({}, Vo.shape), qo.shape), {}, { uri: nr(), description: no(nr()), mimeType: no(nr()), annotations: zi.optional(), _meta: no(Nr({})) }));
35948
+ var Ii = jr(b(b(b({}, Vo.shape), qo.shape), {}, { uriTemplate: nr(), description: no(nr()), mimeType: no(nr()), annotations: zi.optional(), _meta: no(Nr({})) }));
35949
+ var Ti = si.extend({ method: Kr("resources/list") });
35950
+ var Ei = ci.extend({ resources: Or(xi) });
35951
+ var Pi = si.extend({ method: Kr("resources/templates/list") });
35952
+ var Ci = ci.extend({ resourceTemplates: Or(Ii) });
35953
+ var Zi = To.extend({ uri: nr() });
35954
+ var Ai = Zi;
35955
+ var Ri = Eo.extend({ method: Kr("resources/read"), params: Ai });
35956
+ var Ui = Zo.extend({ contents: Or(Fr([wi, bi])) });
35957
+ var Si = Co.extend({ method: Kr("notifications/resources/list_changed") });
35958
+ var Oi = Zi;
35959
+ var $i = Eo.extend({ method: Kr("resources/subscribe"), params: Oi });
35960
+ var ji = Zi;
35961
+ var Ni = Eo.extend({ method: Kr("resources/unsubscribe"), params: ji });
35962
+ var Mi = Po.extend({ uri: nr() });
35963
+ var Fi = Co.extend({ method: Kr("notifications/resources/updated"), params: Mi });
35964
+ var Li = jr({ name: nr(), description: no(nr()), required: no(Tr()) });
35965
+ var Di = jr(b(b(b({}, Vo.shape), qo.shape), {}, { description: no(nr()), arguments: no(Or(Li)), _meta: no(Nr({})) }));
35966
+ var qi = si.extend({ method: Kr("prompts/list") });
35967
+ var Vi = ci.extend({ prompts: Or(Di) });
35968
+ var Wi = To.extend({ name: nr(), arguments: Hr(nr(), nr()).optional() });
35969
+ var Hi = Eo.extend({ method: Kr("prompts/get"), params: Wi });
35970
+ var Bi = jr({ type: Kr("text"), text: nr(), annotations: zi.optional(), _meta: Hr(nr(), Ar()).optional() });
35971
+ var Gi = jr({ type: Kr("image"), data: ki, mimeType: nr(), annotations: zi.optional(), _meta: Hr(nr(), Ar()).optional() });
35972
+ var Ji = jr({ type: Kr("audio"), data: ki, mimeType: nr(), annotations: zi.optional(), _meta: Hr(nr(), Ar()).optional() });
35973
+ var Ki = jr({ type: Kr("tool_use"), name: nr(), id: nr(), input: jr({}).passthrough(), _meta: no(jr({}).passthrough()) }).passthrough();
35974
+ var Yi = jr({ type: Kr("resource"), resource: Fr([wi, bi]), annotations: zi.optional(), _meta: Hr(nr(), Ar()).optional() });
35975
+ var Xi = Fr([Bi, Gi, Ji, xi.extend({ type: Kr("resource_link") }), Yi]);
35976
+ var Qi = jr({ role: Gr(["user", "assistant"]), content: Xi });
35977
+ var na = Zo.extend({ description: no(nr()), messages: Or(Qi) });
35978
+ var ea = Co.extend({ method: Kr("notifications/prompts/list_changed") });
35979
+ var ta = jr({ title: nr().optional(), readOnlyHint: Tr().optional(), destructiveHint: Tr().optional(), idempotentHint: Tr().optional(), openWorldHint: Tr().optional() });
35980
+ var ra = jr({ taskSupport: Gr(["required", "optional", "forbidden"]).optional() });
35981
+ var oa = jr(b(b(b({}, Vo.shape), qo.shape), {}, { description: nr().optional(), inputSchema: jr({ type: Kr("object"), properties: Hr(nr(), wo).optional(), required: Or(nr()).optional() }).catchall(Ar()), outputSchema: jr({ type: Kr("object"), properties: Hr(nr(), wo).optional(), required: Or(nr()).optional() }).catchall(Ar()).optional(), annotations: no(ta), execution: no(ra), _meta: Hr(nr(), Ar()).optional() }));
35982
+ var ia = si.extend({ method: Kr("tools/list") });
35983
+ var aa = ci.extend({ tools: Or(oa) });
35984
+ var ua = Zo.extend({ content: Or(Xi).default([]), structuredContent: Hr(nr(), Ar()).optional(), isError: no(Tr()) });
35985
+ ua.or(Zo.extend({ toolResult: Ar() }));
35986
+ var sa = To.extend({ name: nr(), arguments: no(Hr(nr(), Ar())) });
35987
+ var ca = Eo.extend({ method: Kr("tools/call"), params: sa });
35988
+ var la = Co.extend({ method: Kr("notifications/tools/list_changed") });
35989
+ var da = Gr(["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]);
35990
+ var pa = To.extend({ level: da });
35991
+ var fa = Eo.extend({ method: Kr("logging/setLevel"), params: pa });
35992
+ var ha = Po.extend({ level: da, logger: nr().optional(), data: Ar() });
35993
+ var va = Co.extend({ method: Kr("notifications/message"), params: ha });
35994
+ var ma = jr({ name: nr().optional() });
35995
+ var _a19 = jr({ hints: no(Or(ma)), costPriority: no(br().min(0).max(1)), speedPriority: no(br().min(0).max(1)), intelligencePriority: no(br().min(0).max(1)) });
35996
+ var ga = jr({ mode: no(Gr(["auto", "required", "none"])) });
35997
+ var ya = jr({ type: Kr("tool_result"), toolUseId: nr().describe("The unique identifier for the corresponding tool call."), content: Or(Xi).default([]), structuredContent: jr({}).passthrough().optional(), isError: no(Tr()), _meta: no(jr({}).passthrough()) }).passthrough();
35998
+ var wa = Dr("type", [Bi, Gi, Ji]);
35999
+ var ka = Dr("type", [Bi, Gi, Ji, Ki, ya]);
36000
+ var ba = jr({ role: Gr(["user", "assistant"]), content: Fr([ka, Or(ka)]), _meta: no(jr({}).passthrough()) }).passthrough();
36001
+ var za = To.extend({ messages: Or(ba), modelPreferences: _a19.optional(), systemPrompt: nr().optional(), includeContext: Gr(["none", "thisServer", "allServers"]).optional(), temperature: br().optional(), maxTokens: br().int(), stopSequences: Or(nr()).optional(), metadata: wo.optional(), tools: no(Or(oa)), toolChoice: no(ga) });
36002
+ var xa = Eo.extend({ method: Kr("sampling/createMessage"), params: za });
36003
+ var Ia = Zo.extend({ model: nr(), stopReason: no(Gr(["endTurn", "stopSequence", "maxTokens"]).or(nr())), role: Gr(["user", "assistant"]), content: wa });
36004
+ var Ta = Zo.extend({ model: nr(), stopReason: no(Gr(["endTurn", "stopSequence", "maxTokens", "toolUse"]).or(nr())), role: Gr(["user", "assistant"]), content: Fr([ka, Or(ka)]) });
36005
+ var Ea = jr({ type: Kr("boolean"), title: nr().optional(), description: nr().optional(), default: Tr().optional() });
36006
+ var Pa = jr({ type: Kr("string"), title: nr().optional(), description: nr().optional(), minLength: br().optional(), maxLength: br().optional(), format: Gr(["email", "uri", "date", "date-time"]).optional(), default: nr().optional() });
36007
+ var Ca = jr({ type: Gr(["number", "integer"]), title: nr().optional(), description: nr().optional(), minimum: br().optional(), maximum: br().optional(), default: br().optional() });
36008
+ var Za = jr({ type: Kr("string"), title: nr().optional(), description: nr().optional(), enum: Or(nr()), default: nr().optional() });
36009
+ var Aa = jr({ type: Kr("string"), title: nr().optional(), description: nr().optional(), oneOf: Or(jr({ const: nr(), title: nr() })), default: nr().optional() });
36010
+ var Ra = jr({ type: Kr("string"), title: nr().optional(), description: nr().optional(), enum: Or(nr()), enumNames: Or(nr()).optional(), default: nr().optional() });
36011
+ var Ua = Fr([Za, Aa]);
36012
+ var Sa = Fr([jr({ type: Kr("array"), title: nr().optional(), description: nr().optional(), minItems: br().optional(), maxItems: br().optional(), items: jr({ type: Kr("string"), enum: Or(nr()) }), default: Or(nr()).optional() }), jr({ type: Kr("array"), title: nr().optional(), description: nr().optional(), minItems: br().optional(), maxItems: br().optional(), items: jr({ anyOf: Or(jr({ const: nr(), title: nr() })) }), default: Or(nr()).optional() })]);
36013
+ var Oa = Fr([Ra, Ua, Sa]);
36014
+ var $a = Fr([Oa, Ea, Pa, Ca]);
36015
+ var ja = Fr([To.extend({ mode: Kr("form").optional(), message: nr(), requestedSchema: jr({ type: Kr("object"), properties: Hr(nr(), $a), required: Or(nr()).optional() }) }), To.extend({ mode: Kr("url"), message: nr(), elicitationId: nr(), url: nr().url() })]);
36016
+ var Na = Eo.extend({ method: Kr("elicitation/create"), params: ja });
36017
+ var Ma = Po.extend({ elicitationId: nr() });
36018
+ var Fa = Co.extend({ method: Kr("notifications/elicitation/complete"), params: Ma });
36019
+ var La = Zo.extend({ action: Gr(["accept", "decline", "cancel"]), content: po(function(n3) {
36020
+ return n3 === null ? undefined : n3;
36021
+ }, Hr(nr(), Fr([nr(), br(), Tr(), Or(nr())])).optional()) });
36022
+ var Da = jr({ type: Kr("ref/resource"), uri: nr() });
36023
+ var qa = jr({ type: Kr("ref/prompt"), name: nr() });
36024
+ var Va = To.extend({ ref: Fr([qa, Da]), argument: jr({ name: nr(), value: nr() }), context: jr({ arguments: Hr(nr(), nr()).optional() }).optional() });
36025
+ var Wa = Eo.extend({ method: Kr("completion/complete"), params: Va });
36026
+ var Ha = Zo.extend({ completion: Nr({ values: Or(nr()).max(100), total: no(br().int()), hasMore: no(Tr()) }) });
36027
+ var Ba = jr({ uri: nr().startsWith("file://"), name: nr().optional(), _meta: Hr(nr(), Ar()).optional() });
36028
+ var Ga = Eo.extend({ method: Kr("roots/list") });
36029
+ var Ja = Zo.extend({ roots: Or(Ba) });
36030
+ var Ka = Co.extend({ method: Kr("notifications/roots/list_changed") });
36031
+ Fr([ri, Xo, Wa, fa, Hi, qi, Ti, Pi, Ri, $i, Ni, ca, ia, hi, mi, _i]), Fr([Lo, ai, ei, Ka, fi]), Fr([Mo, Ia, Ta, La, Ja, vi, gi, di]), Fr([ri, xa, Na, Ga, hi, mi, _i]), Fr([Lo, ai, va, Fi, Si, la, ea, fi, Fa]), Fr([Mo, ni, Ha, na, Vi, Ei, Ci, Ui, ua, aa, vi, gi, di]);
36032
+ var Ya;
36033
+ var Xa;
36034
+ var Qa = _t(ir, Ya).superRefine(function(n3, e2) {
35998
36035
  if (!URL.canParse(n3))
35999
- return e2.addIssue({ code: co, message: "URL must be parseable", fatal: true }), b2;
36036
+ return e2.addIssue({ code: fo, message: "URL must be parseable", fatal: true }), b2;
36000
36037
  }).refine(function(n3) {
36001
36038
  var e2 = new URL(n3);
36002
36039
  return e2.protocol !== "javascript:" && e2.protocol !== "data:" && e2.protocol !== "vbscript:";
36003
36040
  }, { message: "URL cannot use javascript:, data:, or vbscript: scheme" });
36004
- var Ca = Sr({ resource: Xt().url(), authorization_servers: Ar(Za).optional(), jwks_uri: Xt().url().optional(), scopes_supported: Ar(Xt()).optional(), bearer_methods_supported: Ar(Xt()).optional(), resource_signing_alg_values_supported: Ar(Xt()).optional(), resource_name: Xt().optional(), resource_documentation: Xt().optional(), resource_policy_uri: Xt().url().optional(), resource_tos_uri: Xt().url().optional(), tls_client_certificate_bound_access_tokens: xr().optional(), authorization_details_types_supported: Ar(Xt()).optional(), dpop_signing_alg_values_supported: Ar(Xt()).optional(), dpop_bound_access_tokens_required: xr().optional() });
36005
- var Aa = Sr({ issuer: Xt(), authorization_endpoint: Za, token_endpoint: Za, registration_endpoint: Za.optional(), scopes_supported: Ar(Xt()).optional(), response_types_supported: Ar(Xt()), response_modes_supported: Ar(Xt()).optional(), grant_types_supported: Ar(Xt()).optional(), token_endpoint_auth_methods_supported: Ar(Xt()).optional(), token_endpoint_auth_signing_alg_values_supported: Ar(Xt()).optional(), service_documentation: Za.optional(), revocation_endpoint: Za.optional(), revocation_endpoint_auth_methods_supported: Ar(Xt()).optional(), revocation_endpoint_auth_signing_alg_values_supported: Ar(Xt()).optional(), introspection_endpoint: Xt().optional(), introspection_endpoint_auth_methods_supported: Ar(Xt()).optional(), introspection_endpoint_auth_signing_alg_values_supported: Ar(Xt()).optional(), code_challenge_methods_supported: Ar(Xt()).optional(), client_id_metadata_document_supported: xr().optional() });
36006
- var Ua = Sr({ issuer: Xt(), authorization_endpoint: Za, token_endpoint: Za, userinfo_endpoint: Za.optional(), jwks_uri: Za, registration_endpoint: Za.optional(), scopes_supported: Ar(Xt()).optional(), response_types_supported: Ar(Xt()), response_modes_supported: Ar(Xt()).optional(), grant_types_supported: Ar(Xt()).optional(), acr_values_supported: Ar(Xt()).optional(), subject_types_supported: Ar(Xt()), id_token_signing_alg_values_supported: Ar(Xt()), id_token_encryption_alg_values_supported: Ar(Xt()).optional(), id_token_encryption_enc_values_supported: Ar(Xt()).optional(), userinfo_signing_alg_values_supported: Ar(Xt()).optional(), userinfo_encryption_alg_values_supported: Ar(Xt()).optional(), userinfo_encryption_enc_values_supported: Ar(Xt()).optional(), request_object_signing_alg_values_supported: Ar(Xt()).optional(), request_object_encryption_alg_values_supported: Ar(Xt()).optional(), request_object_encryption_enc_values_supported: Ar(Xt()).optional(), token_endpoint_auth_methods_supported: Ar(Xt()).optional(), token_endpoint_auth_signing_alg_values_supported: Ar(Xt()).optional(), display_values_supported: Ar(Xt()).optional(), claim_types_supported: Ar(Xt()).optional(), claims_supported: Ar(Xt()).optional(), service_documentation: Xt().optional(), claims_locales_supported: Ar(Xt()).optional(), ui_locales_supported: Ar(Xt()).optional(), claims_parameter_supported: xr().optional(), request_parameter_supported: xr().optional(), request_uri_parameter_supported: xr().optional(), require_request_uri_registration: xr().optional(), op_policy_uri: Za.optional(), op_tos_uri: Za.optional(), client_id_metadata_document_supported: xr().optional() });
36007
- var Ra = Rr(b(b({}, Ua.shape), Aa.pick({ code_challenge_methods_supported: true }).shape));
36008
- var Sa = Rr({ access_token: Xt(), id_token: Xt().optional(), token_type: Xt(), expires_in: wr().optional(), scope: Xt().optional(), refresh_token: Xt().optional() }).strip();
36009
- var Oa = Rr({ error: Xt(), error_description: Xt().optional(), error_uri: Xt().optional() });
36010
- var $a = Za.optional().or(Wr("").transform(function() {}));
36011
- var ja = Rr({ redirect_uris: Ar(Za), token_endpoint_auth_method: Xt().optional(), grant_types: Ar(Xt()).optional(), response_types: Ar(Xt()).optional(), client_name: Xt().optional(), client_uri: Za.optional(), logo_uri: $a, scope: Xt().optional(), contacts: Ar(Xt()).optional(), tos_uri: $a, policy_uri: Xt().optional(), jwks_uri: Za.optional(), jwks: new Ir({ type: "any" }).optional(), software_id: Xt().optional(), software_version: Xt().optional(), software_statement: Xt().optional() }).strip();
36012
- var Na = Rr({ client_id: Xt(), client_secret: Xt().optional(), client_id_issued_at: wr().optional(), client_secret_expires_at: wr().optional() }).strip();
36013
- var Ma = ja.merge(Na);
36014
- function Fa(n3) {
36041
+ var nu = Nr({ resource: nr().url(), authorization_servers: Or(Qa).optional(), jwks_uri: nr().url().optional(), scopes_supported: Or(nr()).optional(), bearer_methods_supported: Or(nr()).optional(), resource_signing_alg_values_supported: Or(nr()).optional(), resource_name: nr().optional(), resource_documentation: nr().optional(), resource_policy_uri: nr().url().optional(), resource_tos_uri: nr().url().optional(), tls_client_certificate_bound_access_tokens: Tr().optional(), authorization_details_types_supported: Or(nr()).optional(), dpop_signing_alg_values_supported: Or(nr()).optional(), dpop_bound_access_tokens_required: Tr().optional() });
36042
+ var eu = Nr({ issuer: nr(), authorization_endpoint: Qa, token_endpoint: Qa, registration_endpoint: Qa.optional(), scopes_supported: Or(nr()).optional(), response_types_supported: Or(nr()), response_modes_supported: Or(nr()).optional(), grant_types_supported: Or(nr()).optional(), token_endpoint_auth_methods_supported: Or(nr()).optional(), token_endpoint_auth_signing_alg_values_supported: Or(nr()).optional(), service_documentation: Qa.optional(), revocation_endpoint: Qa.optional(), revocation_endpoint_auth_methods_supported: Or(nr()).optional(), revocation_endpoint_auth_signing_alg_values_supported: Or(nr()).optional(), introspection_endpoint: nr().optional(), introspection_endpoint_auth_methods_supported: Or(nr()).optional(), introspection_endpoint_auth_signing_alg_values_supported: Or(nr()).optional(), code_challenge_methods_supported: Or(nr()).optional(), client_id_metadata_document_supported: Tr().optional() });
36043
+ var tu = Nr({ issuer: nr(), authorization_endpoint: Qa, token_endpoint: Qa, userinfo_endpoint: Qa.optional(), jwks_uri: Qa, registration_endpoint: Qa.optional(), scopes_supported: Or(nr()).optional(), response_types_supported: Or(nr()), response_modes_supported: Or(nr()).optional(), grant_types_supported: Or(nr()).optional(), acr_values_supported: Or(nr()).optional(), subject_types_supported: Or(nr()), id_token_signing_alg_values_supported: Or(nr()), id_token_encryption_alg_values_supported: Or(nr()).optional(), id_token_encryption_enc_values_supported: Or(nr()).optional(), userinfo_signing_alg_values_supported: Or(nr()).optional(), userinfo_encryption_alg_values_supported: Or(nr()).optional(), userinfo_encryption_enc_values_supported: Or(nr()).optional(), request_object_signing_alg_values_supported: Or(nr()).optional(), request_object_encryption_alg_values_supported: Or(nr()).optional(), request_object_encryption_enc_values_supported: Or(nr()).optional(), token_endpoint_auth_methods_supported: Or(nr()).optional(), token_endpoint_auth_signing_alg_values_supported: Or(nr()).optional(), display_values_supported: Or(nr()).optional(), claim_types_supported: Or(nr()).optional(), claims_supported: Or(nr()).optional(), service_documentation: nr().optional(), claims_locales_supported: Or(nr()).optional(), ui_locales_supported: Or(nr()).optional(), claims_parameter_supported: Tr().optional(), request_parameter_supported: Tr().optional(), request_uri_parameter_supported: Tr().optional(), require_request_uri_registration: Tr().optional(), op_policy_uri: Qa.optional(), op_tos_uri: Qa.optional(), client_id_metadata_document_supported: Tr().optional() });
36044
+ var ru = jr(b(b({}, tu.shape), eu.pick({ code_challenge_methods_supported: true }).shape));
36045
+ var ou = jr({ access_token: nr(), id_token: nr().optional(), token_type: nr(), expires_in: function(n3) {
36046
+ return function(n4, e2) {
36047
+ return new n4(b({ type: "number", coerce: true, checks: [] }, L(e2)));
36048
+ }(kr, n3);
36049
+ }().optional(), scope: nr().optional(), refresh_token: nr().optional() }).strip();
36050
+ var iu = jr({ error: nr(), error_description: nr().optional(), error_uri: nr().optional() });
36051
+ var au = Qa.optional().or(Kr("").transform(function() {}));
36052
+ var uu = jr({ redirect_uris: Or(Qa), token_endpoint_auth_method: nr().optional(), grant_types: Or(nr()).optional(), response_types: Or(nr()).optional(), client_name: nr().optional(), client_uri: Qa.optional(), logo_uri: au, scope: nr().optional(), contacts: Or(nr()).optional(), tos_uri: au, policy_uri: nr().optional(), jwks_uri: Qa.optional(), jwks: new Cr({ type: "any" }).optional(), software_id: nr().optional(), software_version: nr().optional(), software_statement: nr().optional() }).strip();
36053
+ var su = jr({ client_id: nr(), client_secret: nr().optional(), client_id_issued_at: br().optional(), client_secret_expires_at: br().optional() }).strip();
36054
+ var cu = uu.merge(su);
36055
+ function lu(n3) {
36015
36056
  var e2 = typeof n3 == "string" ? new URL(n3) : new URL(n3.href);
36016
36057
  return e2.hash = "", e2;
36017
36058
  }
36018
- function La(n3) {
36059
+ function du(n3) {
36019
36060
  var { requestedResource: e2, configuredResource: t2 } = n3, r2 = typeof e2 == "string" ? new URL(e2) : new URL(e2.href), o2 = typeof t2 == "string" ? new URL(t2) : new URL(t2.href);
36020
36061
  if (r2.origin !== o2.origin)
36021
36062
  return false;
@@ -36024,8 +36065,8 @@ function La(n3) {
36024
36065
  var i2 = r2.pathname.endsWith("/") ? r2.pathname : r2.pathname + "/", a2 = o2.pathname.endsWith("/") ? o2.pathname : o2.pathname + "/";
36025
36066
  return i2.startsWith(a2);
36026
36067
  }
36027
- Rr({ error: Xt(), error_description: Xt().optional() }).strip(), Rr({ token: Xt(), token_type_hint: Xt().optional() }).strip();
36028
- var Da = function(n3) {
36068
+ jr({ error: nr(), error_description: nr().optional() }).strip(), jr({ token: nr(), token_type_hint: nr().optional() }).strip();
36069
+ var pu = function(n3) {
36029
36070
  function e2(n4, t2) {
36030
36071
  var r2;
36031
36072
  return o(this, e2), (r2 = n(this, e2, [n4])).errorUri = t2, r2.name = r2.constructor.name, r2;
@@ -36037,132 +36078,139 @@ var Da = function(n3) {
36037
36078
  return this.constructor.errorCode;
36038
36079
  } }]);
36039
36080
  }(S(Error));
36040
- var Va = function() {
36081
+ var fu = function() {
36082
+ function n3() {
36083
+ return o(this, n3), n(this, n3, arguments);
36084
+ }
36085
+ return y(n3, pu), c(n3);
36086
+ }();
36087
+ fu.errorCode = "invalid_request";
36088
+ var hu = function() {
36041
36089
  function n3() {
36042
36090
  return o(this, n3), n(this, n3, arguments);
36043
36091
  }
36044
- return y(n3, Da), c(n3);
36092
+ return y(n3, pu), c(n3);
36045
36093
  }();
36046
- Va.errorCode = "invalid_request";
36047
- var qa = function() {
36094
+ hu.errorCode = "invalid_client";
36095
+ var vu = function() {
36048
36096
  function n3() {
36049
36097
  return o(this, n3), n(this, n3, arguments);
36050
36098
  }
36051
- return y(n3, Da), c(n3);
36099
+ return y(n3, pu), c(n3);
36052
36100
  }();
36053
- qa.errorCode = "invalid_client";
36054
- var Wa = function() {
36101
+ vu.errorCode = "invalid_grant";
36102
+ var mu = function() {
36055
36103
  function n3() {
36056
36104
  return o(this, n3), n(this, n3, arguments);
36057
36105
  }
36058
- return y(n3, Da), c(n3);
36106
+ return y(n3, pu), c(n3);
36059
36107
  }();
36060
- Wa.errorCode = "invalid_grant";
36061
- var Ha = function() {
36108
+ mu.errorCode = "unauthorized_client";
36109
+ var _u = function() {
36062
36110
  function n3() {
36063
36111
  return o(this, n3), n(this, n3, arguments);
36064
36112
  }
36065
- return y(n3, Da), c(n3);
36113
+ return y(n3, pu), c(n3);
36066
36114
  }();
36067
- Ha.errorCode = "unauthorized_client";
36068
- var Ba = function() {
36115
+ _u.errorCode = "unsupported_grant_type";
36116
+ var gu = function() {
36069
36117
  function n3() {
36070
36118
  return o(this, n3), n(this, n3, arguments);
36071
36119
  }
36072
- return y(n3, Da), c(n3);
36120
+ return y(n3, pu), c(n3);
36073
36121
  }();
36074
- Ba.errorCode = "unsupported_grant_type";
36075
- var Ga = function() {
36122
+ gu.errorCode = "invalid_scope";
36123
+ var yu = function() {
36076
36124
  function n3() {
36077
36125
  return o(this, n3), n(this, n3, arguments);
36078
36126
  }
36079
- return y(n3, Da), c(n3);
36127
+ return y(n3, pu), c(n3);
36080
36128
  }();
36081
- Ga.errorCode = "invalid_scope";
36082
- var Ja = function() {
36129
+ yu.errorCode = "access_denied";
36130
+ var wu = function() {
36083
36131
  function n3() {
36084
36132
  return o(this, n3), n(this, n3, arguments);
36085
36133
  }
36086
- return y(n3, Da), c(n3);
36134
+ return y(n3, pu), c(n3);
36087
36135
  }();
36088
- Ja.errorCode = "access_denied";
36089
- var Ka = function() {
36136
+ wu.errorCode = "server_error";
36137
+ var ku = function() {
36090
36138
  function n3() {
36091
36139
  return o(this, n3), n(this, n3, arguments);
36092
36140
  }
36093
- return y(n3, Da), c(n3);
36141
+ return y(n3, pu), c(n3);
36094
36142
  }();
36095
- Ka.errorCode = "server_error";
36096
- var Ya = function() {
36143
+ ku.errorCode = "temporarily_unavailable";
36144
+ var bu = function() {
36097
36145
  function n3() {
36098
36146
  return o(this, n3), n(this, n3, arguments);
36099
36147
  }
36100
- return y(n3, Da), c(n3);
36148
+ return y(n3, pu), c(n3);
36101
36149
  }();
36102
- Ya.errorCode = "temporarily_unavailable";
36103
- var Xa = function() {
36150
+ bu.errorCode = "unsupported_response_type";
36151
+ var zu = function() {
36104
36152
  function n3() {
36105
36153
  return o(this, n3), n(this, n3, arguments);
36106
36154
  }
36107
- return y(n3, Da), c(n3);
36155
+ return y(n3, pu), c(n3);
36108
36156
  }();
36109
- Xa.errorCode = "unsupported_response_type";
36110
- var Qa = function() {
36157
+ zu.errorCode = "unsupported_token_type";
36158
+ var xu = function() {
36111
36159
  function n3() {
36112
36160
  return o(this, n3), n(this, n3, arguments);
36113
36161
  }
36114
- return y(n3, Da), c(n3);
36162
+ return y(n3, pu), c(n3);
36115
36163
  }();
36116
- Qa.errorCode = "unsupported_token_type";
36117
- var nu = function() {
36164
+ xu.errorCode = "invalid_token";
36165
+ var Iu = function() {
36118
36166
  function n3() {
36119
36167
  return o(this, n3), n(this, n3, arguments);
36120
36168
  }
36121
- return y(n3, Da), c(n3);
36169
+ return y(n3, pu), c(n3);
36122
36170
  }();
36123
- nu.errorCode = "invalid_token";
36124
- var eu = function() {
36171
+ Iu.errorCode = "method_not_allowed";
36172
+ var Tu = function() {
36125
36173
  function n3() {
36126
36174
  return o(this, n3), n(this, n3, arguments);
36127
36175
  }
36128
- return y(n3, Da), c(n3);
36176
+ return y(n3, pu), c(n3);
36129
36177
  }();
36130
- eu.errorCode = "method_not_allowed";
36131
- var tu = function() {
36178
+ Tu.errorCode = "too_many_requests";
36179
+ var Eu = function() {
36132
36180
  function n3() {
36133
36181
  return o(this, n3), n(this, n3, arguments);
36134
36182
  }
36135
- return y(n3, Da), c(n3);
36183
+ return y(n3, pu), c(n3);
36136
36184
  }();
36137
- tu.errorCode = "too_many_requests";
36138
- var ru = function() {
36185
+ Eu.errorCode = "invalid_client_metadata";
36186
+ var Pu = function() {
36139
36187
  function n3() {
36140
36188
  return o(this, n3), n(this, n3, arguments);
36141
36189
  }
36142
- return y(n3, Da), c(n3);
36190
+ return y(n3, pu), c(n3);
36143
36191
  }();
36144
- ru.errorCode = "invalid_client_metadata";
36145
- var ou = function() {
36192
+ Pu.errorCode = "insufficient_scope";
36193
+ var Cu = function() {
36146
36194
  function n3() {
36147
36195
  return o(this, n3), n(this, n3, arguments);
36148
36196
  }
36149
- return y(n3, Da), c(n3);
36197
+ return y(n3, pu), c(n3);
36150
36198
  }();
36151
- ou.errorCode = "insufficient_scope";
36152
- var iu = (f(f(f(f(f(f(f(f(f(f(Pa = {}, Va.errorCode, Va), qa.errorCode, qa), Wa.errorCode, Wa), Ha.errorCode, Ha), Ba.errorCode, Ba), Ga.errorCode, Ga), Ja.errorCode, Ja), Ka.errorCode, Ka), Ya.errorCode, Ya), Xa.errorCode, Xa), f(f(f(f(f(f(Pa, Qa.errorCode, Qa), nu.errorCode, nu), eu.errorCode, eu), tu.errorCode, tu), ru.errorCode, ru), ou.errorCode, ou));
36153
- var au = function(n3) {
36199
+ Cu.errorCode = "invalid_target";
36200
+ var Zu = (f(f(f(f(f(f(f(f(f(f(Xa = {}, fu.errorCode, fu), hu.errorCode, hu), vu.errorCode, vu), mu.errorCode, mu), _u.errorCode, _u), gu.errorCode, gu), yu.errorCode, yu), wu.errorCode, wu), ku.errorCode, ku), bu.errorCode, bu), f(f(f(f(f(f(f(Xa, zu.errorCode, zu), xu.errorCode, xu), Iu.errorCode, Iu), Tu.errorCode, Tu), Eu.errorCode, Eu), Pu.errorCode, Pu), Cu.errorCode, Cu));
36201
+ var Au = function(n3) {
36154
36202
  function e2(n4) {
36155
36203
  return o(this, e2), n(this, e2, [n4 != null ? n4 : "Unauthorized"]);
36156
36204
  }
36157
36205
  return y(e2, n3), c(e2);
36158
36206
  }(S(Error));
36159
- var uu = "code";
36160
- var su = "S256";
36161
- function cu(n3, e2) {
36207
+ var Ru = "code";
36208
+ var Uu = "S256";
36209
+ function Su(n3, e2) {
36162
36210
  var t2, r2 = n3.client_secret !== undefined;
36163
36211
  return e2.length === 0 ? r2 ? "client_secret_post" : "none" : ("token_endpoint_auth_method" in n3) && n3.token_endpoint_auth_method && (t2 = n3.token_endpoint_auth_method, ["client_secret_basic", "client_secret_post", "none"].includes(t2)) && e2.includes(n3.token_endpoint_auth_method) ? n3.token_endpoint_auth_method : r2 && e2.includes("client_secret_basic") ? "client_secret_basic" : r2 && e2.includes("client_secret_post") ? "client_secret_post" : e2.includes("none") ? "none" : r2 ? "client_secret_post" : "none";
36164
36212
  }
36165
- function lu(n3, e2, t2, r2) {
36213
+ function Ou(n3, e2, t2, r2) {
36166
36214
  var { client_id: o2, client_secret: i2 } = e2;
36167
36215
  switch (n3) {
36168
36216
  case "client_secret_basic":
@@ -36184,11 +36232,11 @@ function lu(n3, e2, t2, r2) {
36184
36232
  throw new Error("Unsupported client authentication method: ".concat(n3));
36185
36233
  }
36186
36234
  }
36187
- function du(n3) {
36188
- return pu.apply(this, arguments);
36235
+ function $u(n3) {
36236
+ return ju.apply(this, arguments);
36189
36237
  }
36190
- function pu() {
36191
- return (pu = e(v().m(function n(e2) {
36238
+ function ju() {
36239
+ return (ju = e(v().m(function n(e2) {
36192
36240
  var t2, r2, o2, i2, u2, s2, c2, l2, d2, p2;
36193
36241
  return v().w(function(n3) {
36194
36242
  for (;; )
@@ -36205,72 +36253,72 @@ function pu() {
36205
36253
  case 2:
36206
36254
  d2 = e2;
36207
36255
  case 3:
36208
- return r2 = d2, n3.p = 4, o2 = Oa.parse(JSON.parse(r2)), i2 = o2.error, u2 = o2.error_description, s2 = o2.error_uri, c2 = iu[i2] || Ka, n3.a(2, new c2(u2 || "", s2));
36256
+ return r2 = d2, n3.p = 4, o2 = iu.parse(JSON.parse(r2)), i2 = o2.error, u2 = o2.error_description, s2 = o2.error_uri, c2 = Zu[i2] || wu, n3.a(2, new c2(u2 || "", s2));
36209
36257
  case 5:
36210
- return n3.p = 5, p2 = n3.v, l2 = "".concat(t2 ? "HTTP ".concat(t2, ": ") : "", "Invalid OAuth error response: ").concat(p2, ". Raw body: ").concat(r2), n3.a(2, new Ka(l2));
36258
+ return n3.p = 5, p2 = n3.v, l2 = "".concat(t2 ? "HTTP ".concat(t2, ": ") : "", "Invalid OAuth error response: ").concat(p2, ". Raw body: ").concat(r2), n3.a(2, new wu(l2));
36211
36259
  }
36212
36260
  }, n, null, [[4, 5]]);
36213
36261
  }))).apply(this, arguments);
36214
36262
  }
36215
- function fu(n3, e2) {
36216
- return hu.apply(this, arguments);
36263
+ function Nu(n3, e2) {
36264
+ return Mu.apply(this, arguments);
36217
36265
  }
36218
- function hu() {
36219
- return hu = e(v().m(function n(e2, t2) {
36266
+ function Mu() {
36267
+ return (Mu = e(v().m(function n(e2, t2) {
36220
36268
  var r2, o2, i2;
36221
36269
  return v().w(function(n3) {
36222
36270
  for (;; )
36223
36271
  switch (n3.p = n3.n) {
36224
36272
  case 0:
36225
- return n3.p = 0, n3.n = 1, vu(e2, t2);
36273
+ return n3.p = 0, n3.n = 1, Fu(e2, t2);
36226
36274
  case 1:
36227
36275
  case 4:
36228
36276
  case 7:
36229
36277
  return n3.a(2, n3.v);
36230
36278
  case 2:
36231
- if (n3.p = 2, !((i2 = n3.v) instanceof qa || i2 instanceof Ha)) {
36279
+ if (n3.p = 2, !((i2 = n3.v) instanceof hu || i2 instanceof mu)) {
36232
36280
  n3.n = 5;
36233
36281
  break;
36234
36282
  }
36235
36283
  return n3.n = 3, (r2 = e2.invalidateCredentials) === null || r2 === undefined ? undefined : r2.call(e2, "all");
36236
36284
  case 3:
36237
- return n3.n = 4, vu(e2, t2);
36285
+ return n3.n = 4, Fu(e2, t2);
36238
36286
  case 5:
36239
- if (!(i2 instanceof Wa)) {
36287
+ if (!(i2 instanceof vu)) {
36240
36288
  n3.n = 8;
36241
36289
  break;
36242
36290
  }
36243
36291
  return n3.n = 6, (o2 = e2.invalidateCredentials) === null || o2 === undefined ? undefined : o2.call(e2, "tokens");
36244
36292
  case 6:
36245
- return n3.n = 7, vu(e2, t2);
36293
+ return n3.n = 7, Fu(e2, t2);
36246
36294
  case 8:
36247
36295
  throw i2;
36248
36296
  case 9:
36249
36297
  return n3.a(2);
36250
36298
  }
36251
36299
  }, n, null, [[0, 2]]);
36252
- })), hu.apply(this, arguments);
36300
+ }))).apply(this, arguments);
36253
36301
  }
36254
- function vu(n3, e2) {
36255
- return mu.apply(this, arguments);
36302
+ function Fu(n3, e2) {
36303
+ return Lu.apply(this, arguments);
36256
36304
  }
36257
- function mu() {
36258
- return (mu = e(v().m(function n(e2, t2) {
36259
- var r2, o2, i2, u2, s2, c2, l2, d2, p2, f2, h2, v2, m2, _, y2, g2, w2, k2, b3, z2, x2, I2, T2, E2, P2;
36305
+ function Lu() {
36306
+ return (Lu = e(v().m(function n(e2, t2) {
36307
+ var r2, o2, i2, u2, s2, c2, l2, d2, p2, f2, h2, v2, m2, _, g2, y2, w2, k2, b3, z2, x2, I2, T2, E2, P2;
36260
36308
  return v().w(function(n3) {
36261
36309
  for (;; )
36262
36310
  switch (n3.p = n3.n) {
36263
36311
  case 0:
36264
- return r2 = t2.serverUrl, o2 = t2.authorizationCode, i2 = t2.scope, u2 = t2.resourceMetadataUrl, s2 = t2.fetchFn, n3.p = 1, n3.n = 2, bu(r2, { resourceMetadataUrl: u2 }, s2);
36312
+ return r2 = t2.serverUrl, o2 = t2.authorizationCode, i2 = t2.scope, u2 = t2.resourceMetadataUrl, s2 = t2.fetchFn, n3.p = 1, n3.n = 2, Bu(r2, { resourceMetadataUrl: u2 }, s2);
36265
36313
  case 2:
36266
36314
  (d2 = n3.v).authorization_servers && d2.authorization_servers.length > 0 && (p2 = d2.authorization_servers[0]), n3.n = 4;
36267
36315
  break;
36268
36316
  case 3:
36269
36317
  n3.p = 3, n3.v;
36270
36318
  case 4:
36271
- return p2 || (p2 = new URL("/", r2)), n3.n = 5, yu(r2, e2, d2);
36319
+ return p2 || (p2 = new URL("/", r2)), n3.n = 5, qu(r2, e2, d2);
36272
36320
  case 5:
36273
- return f2 = n3.v, n3.n = 6, Ru(p2, { fetchFn: s2 });
36321
+ return f2 = n3.v, n3.n = 6, os(p2, { fetchFn: s2 });
36274
36322
  case 6:
36275
36323
  return h2 = n3.v, n3.n = 7, Promise.resolve(e2.clientInformation());
36276
36324
  case 7:
@@ -36284,11 +36332,11 @@ function mu() {
36284
36332
  }
36285
36333
  throw new Error("Existing OAuth client information is required when exchanging an authorization code");
36286
36334
  case 8:
36287
- if (m2 = (h2 == null ? undefined : h2.client_id_metadata_document_supported) === true, !(_ = e2.clientMetadataUrl) || _u(_)) {
36335
+ if (m2 = (h2 == null ? undefined : h2.client_id_metadata_document_supported) === true, !(_ = e2.clientMetadataUrl) || Du(_)) {
36288
36336
  n3.n = 9;
36289
36337
  break;
36290
36338
  }
36291
- throw new ru("clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ".concat(_));
36339
+ throw new Eu("clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ".concat(_));
36292
36340
  case 9:
36293
36341
  if (!(m2 && _)) {
36294
36342
  n3.n = 11;
@@ -36305,68 +36353,66 @@ function mu() {
36305
36353
  }
36306
36354
  throw new Error("OAuth client information must be saveable for dynamic registration");
36307
36355
  case 12:
36308
- return n3.n = 13, Lu(p2, { metadata: h2, clientMetadata: e2.clientMetadata, fetchFn: s2 });
36356
+ return n3.n = 13, vs(p2, { metadata: h2, clientMetadata: e2.clientMetadata, fetchFn: s2 });
36309
36357
  case 13:
36310
- return y2 = n3.v, n3.n = 14, e2.saveClientInformation(y2);
36358
+ return g2 = n3.v, n3.n = 14, e2.saveClientInformation(g2);
36311
36359
  case 14:
36312
- v2 = y2;
36360
+ v2 = g2;
36313
36361
  case 15:
36314
- if (o2 === undefined) {
36315
- n3.n = 19;
36362
+ if (y2 = !e2.redirectUrl, o2 === undefined && !y2) {
36363
+ n3.n = 18;
36316
36364
  break;
36317
36365
  }
36318
- return n3.n = 16, e2.codeVerifier();
36366
+ return n3.n = 16, fs(e2, p2, { metadata: h2, resource: f2, authorizationCode: o2, fetchFn: s2 });
36319
36367
  case 16:
36320
- return g2 = n3.v, n3.n = 17, ju(p2, { metadata: h2, clientInformation: v2, authorizationCode: o2, codeVerifier: g2, redirectUri: e2.redirectUrl, resource: f2, addClientAuthentication: e2.addClientAuthentication, fetchFn: s2 });
36368
+ return w2 = n3.v, n3.n = 17, e2.saveTokens(w2);
36321
36369
  case 17:
36322
- return w2 = n3.v, n3.n = 18, e2.saveTokens(w2);
36323
- case 18:
36324
36370
  return n3.a(2, "AUTHORIZED");
36371
+ case 18:
36372
+ return n3.n = 19, e2.tokens();
36325
36373
  case 19:
36326
- return n3.n = 20, e2.tokens();
36327
- case 20:
36328
36374
  if (!((k2 = n3.v) == null ? undefined : k2.refresh_token)) {
36329
- n3.n = 26;
36375
+ n3.n = 25;
36330
36376
  break;
36331
36377
  }
36332
- return n3.p = 21, n3.n = 22, Mu(p2, { metadata: h2, clientInformation: v2, refreshToken: k2.refresh_token, resource: f2, addClientAuthentication: e2.addClientAuthentication, fetchFn: s2 });
36378
+ return n3.p = 20, n3.n = 21, ds(p2, { metadata: h2, clientInformation: v2, refreshToken: k2.refresh_token, resource: f2, addClientAuthentication: e2.addClientAuthentication, fetchFn: s2 });
36379
+ case 21:
36380
+ return b3 = n3.v, n3.n = 22, e2.saveTokens(b3);
36333
36381
  case 22:
36334
- return b3 = n3.v, n3.n = 23, e2.saveTokens(b3);
36335
- case 23:
36336
36382
  return n3.a(2, "AUTHORIZED");
36337
- case 24:
36338
- if (n3.p = 24, (E2 = n3.v) instanceof Da && !(E2 instanceof Ka)) {
36339
- n3.n = 25;
36383
+ case 23:
36384
+ if (n3.p = 23, (E2 = n3.v) instanceof pu && !(E2 instanceof wu)) {
36385
+ n3.n = 24;
36340
36386
  break;
36341
36387
  }
36342
- n3.n = 26;
36388
+ n3.n = 25;
36343
36389
  break;
36344
- case 25:
36390
+ case 24:
36345
36391
  throw E2;
36346
- case 26:
36392
+ case 25:
36347
36393
  if (!e2.state) {
36348
- n3.n = 28;
36394
+ n3.n = 27;
36349
36395
  break;
36350
36396
  }
36351
- return n3.n = 27, e2.state();
36352
- case 27:
36353
- P2 = n3.v, n3.n = 29;
36397
+ return n3.n = 26, e2.state();
36398
+ case 26:
36399
+ P2 = n3.v, n3.n = 28;
36354
36400
  break;
36355
- case 28:
36401
+ case 27:
36356
36402
  P2 = undefined;
36403
+ case 28:
36404
+ return z2 = P2, n3.n = 29, as(p2, { metadata: h2, clientInformation: v2, state: z2, redirectUrl: e2.redirectUrl, scope: i2 || ((l2 = d2 == null ? undefined : d2.scopes_supported) === null || l2 === undefined ? undefined : l2.join(" ")) || e2.clientMetadata.scope, resource: f2 });
36357
36405
  case 29:
36358
- return z2 = P2, n3.n = 30, Ou(p2, { metadata: h2, clientInformation: v2, state: z2, redirectUrl: e2.redirectUrl, scope: i2 || ((l2 = d2 == null ? undefined : d2.scopes_supported) === null || l2 === undefined ? undefined : l2.join(" ")) || e2.clientMetadata.scope, resource: f2 });
36406
+ return x2 = n3.v, I2 = x2.authorizationUrl, T2 = x2.codeVerifier, n3.n = 30, e2.saveCodeVerifier(T2);
36359
36407
  case 30:
36360
- return x2 = n3.v, I2 = x2.authorizationUrl, T2 = x2.codeVerifier, n3.n = 31, e2.saveCodeVerifier(T2);
36408
+ return n3.n = 31, e2.redirectToAuthorization(I2);
36361
36409
  case 31:
36362
- return n3.n = 32, e2.redirectToAuthorization(I2);
36363
- case 32:
36364
36410
  return n3.a(2, "REDIRECT");
36365
36411
  }
36366
- }, n, null, [[21, 24], [1, 3]]);
36412
+ }, n, null, [[20, 23], [1, 3]]);
36367
36413
  }))).apply(this, arguments);
36368
36414
  }
36369
- function _u(n3) {
36415
+ function Du(n3) {
36370
36416
  if (!n3)
36371
36417
  return false;
36372
36418
  try {
@@ -36376,17 +36422,17 @@ function _u(n3) {
36376
36422
  return false;
36377
36423
  }
36378
36424
  }
36379
- function yu(n3, e2, t2) {
36380
- return gu.apply(this, arguments);
36425
+ function qu(n3, e2, t2) {
36426
+ return Vu.apply(this, arguments);
36381
36427
  }
36382
- function gu() {
36383
- return (gu = e(v().m(function n(e2, t2, r2) {
36428
+ function Vu() {
36429
+ return (Vu = e(v().m(function n(e2, t2, r2) {
36384
36430
  var o2;
36385
36431
  return v().w(function(n3) {
36386
36432
  for (;; )
36387
36433
  switch (n3.n) {
36388
36434
  case 0:
36389
- if (o2 = Fa(e2), !t2.validateResourceURL) {
36435
+ if (o2 = lu(e2), !t2.validateResourceURL) {
36390
36436
  n3.n = 2;
36391
36437
  break;
36392
36438
  }
@@ -36400,7 +36446,7 @@ function gu() {
36400
36446
  }
36401
36447
  return n3.a(2, undefined);
36402
36448
  case 3:
36403
- if (La({ requestedResource: o2, configuredResource: r2.resource })) {
36449
+ if (du({ requestedResource: o2, configuredResource: r2.resource })) {
36404
36450
  n3.n = 4;
36405
36451
  break;
36406
36452
  }
@@ -36411,63 +36457,67 @@ function gu() {
36411
36457
  }, n);
36412
36458
  }))).apply(this, arguments);
36413
36459
  }
36414
- function wu(n3) {
36460
+ function Wu(n3) {
36415
36461
  var e2 = n3.headers.get("WWW-Authenticate");
36416
36462
  if (!e2)
36417
36463
  return {};
36418
36464
  var t2 = e2.split(" "), r2 = m(t2, 2), o2 = r2[0], i2 = r2[1];
36419
36465
  if (o2.toLowerCase() !== "bearer" || !i2)
36420
36466
  return {};
36421
- var a2, u2 = ku(n3, "resource_metadata") || undefined;
36467
+ var a2, u2 = Hu(n3, "resource_metadata") || undefined;
36422
36468
  if (u2)
36423
36469
  try {
36424
36470
  a2 = new URL(u2);
36425
36471
  } catch (n4) {}
36426
- return { resourceMetadataUrl: a2, scope: ku(n3, "scope") || undefined, error: ku(n3, "error") || undefined };
36472
+ return { resourceMetadataUrl: a2, scope: Hu(n3, "scope") || undefined, error: Hu(n3, "error") || undefined };
36427
36473
  }
36428
- function ku(n3, e2) {
36474
+ function Hu(n3, e2) {
36429
36475
  var t2 = n3.headers.get("WWW-Authenticate");
36430
36476
  if (!t2)
36431
36477
  return null;
36432
36478
  var r2 = new RegExp("".concat(e2, '=(?:"([^"]+)"|([^\\s,]+))')), o2 = t2.match(r2);
36433
36479
  return o2 ? o2[1] || o2[2] : null;
36434
36480
  }
36435
- function bu(n3, e2) {
36436
- return zu.apply(this, arguments);
36481
+ function Bu(n3, e2) {
36482
+ return Gu.apply(this, arguments);
36437
36483
  }
36438
- function zu() {
36439
- return zu = e(v().m(function n(e2, t2) {
36440
- var r2, o2, i2, u2 = arguments;
36484
+ function Gu() {
36485
+ return Gu = e(v().m(function n(e2, t2) {
36486
+ var r2, o2, i2, u2, s2, c2 = arguments;
36441
36487
  return v().w(function(n3) {
36442
36488
  for (;; )
36443
36489
  switch (n3.n) {
36444
36490
  case 0:
36445
- return r2 = u2.length > 2 && u2[2] !== undefined ? u2[2] : fetch, n3.n = 1, Cu(e2, "oauth-protected-resource", r2, { protocolVersion: t2 == null ? undefined : t2.protocolVersion, metadataUrl: t2 == null ? undefined : t2.resourceMetadataUrl });
36491
+ return r2 = c2.length > 2 && c2[2] !== undefined ? c2[2] : fetch, n3.n = 1, es(e2, "oauth-protected-resource", r2, { protocolVersion: t2 == null ? undefined : t2.protocolVersion, metadataUrl: t2 == null ? undefined : t2.resourceMetadataUrl });
36446
36492
  case 1:
36447
- if ((o2 = n3.v) && o2.status !== 404) {
36448
- n3.n = 2;
36493
+ if ((u2 = n3.v) && u2.status !== 404) {
36494
+ n3.n = 3;
36449
36495
  break;
36450
36496
  }
36451
- throw new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");
36497
+ return n3.n = 2, (o2 = u2 == null ? undefined : u2.body) === null || o2 === undefined ? undefined : o2.cancel();
36452
36498
  case 2:
36453
- if (o2.ok) {
36454
- n3.n = 3;
36499
+ throw new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");
36500
+ case 3:
36501
+ if (u2.ok) {
36502
+ n3.n = 5;
36455
36503
  break;
36456
36504
  }
36457
- throw new Error("HTTP ".concat(o2.status, " trying to load well-known OAuth protected resource metadata."));
36458
- case 3:
36459
- return i2 = Ca, n3.n = 4, o2.json();
36505
+ return n3.n = 4, (i2 = u2.body) === null || i2 === undefined ? undefined : i2.cancel();
36460
36506
  case 4:
36461
- return n3.a(2, i2.parse.call(i2, n3.v));
36507
+ throw new Error("HTTP ".concat(u2.status, " trying to load well-known OAuth protected resource metadata."));
36508
+ case 5:
36509
+ return s2 = nu, n3.n = 6, u2.json();
36510
+ case 6:
36511
+ return n3.a(2, s2.parse.call(s2, n3.v));
36462
36512
  }
36463
36513
  }, n);
36464
- })), zu.apply(this, arguments);
36514
+ })), Gu.apply(this, arguments);
36465
36515
  }
36466
- function xu(n3, e2) {
36467
- return Iu.apply(this, arguments);
36516
+ function Ju(n3, e2) {
36517
+ return Ku.apply(this, arguments);
36468
36518
  }
36469
- function Iu() {
36470
- return Iu = e(v().m(function n(e2, t2) {
36519
+ function Ku() {
36520
+ return Ku = e(v().m(function n(e2, t2) {
36471
36521
  var r2, o2, i2 = arguments;
36472
36522
  return v().w(function(n3) {
36473
36523
  for (;; )
@@ -36485,7 +36535,7 @@ function Iu() {
36485
36535
  n3.n = 4;
36486
36536
  break;
36487
36537
  }
36488
- return n3.a(2, xu(e2, undefined, r2));
36538
+ return n3.a(2, Ju(e2, undefined, r2));
36489
36539
  case 4:
36490
36540
  return n3.a(2, undefined);
36491
36541
  case 5:
@@ -36494,132 +36544,134 @@ function Iu() {
36494
36544
  return n3.a(2);
36495
36545
  }
36496
36546
  }, n, null, [[1, 3]]);
36497
- })), Iu.apply(this, arguments);
36547
+ })), Ku.apply(this, arguments);
36498
36548
  }
36499
- function Tu(n3) {
36549
+ function Yu(n3) {
36500
36550
  var e2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "", t2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
36501
36551
  return e2.endsWith("/") && (e2 = e2.slice(0, -1)), t2.prependPathname ? "".concat(e2, "/.well-known/").concat(n3) : "/.well-known/".concat(n3).concat(e2);
36502
36552
  }
36503
- function Eu(n3, e2) {
36504
- return Pu.apply(this, arguments);
36553
+ function Xu(n3, e2) {
36554
+ return Qu.apply(this, arguments);
36505
36555
  }
36506
- function Pu() {
36507
- return Pu = e(v().m(function n(e2, t2) {
36556
+ function Qu() {
36557
+ return Qu = e(v().m(function n(e2, t2) {
36508
36558
  var r2, o2, i2 = arguments;
36509
36559
  return v().w(function(n3) {
36510
36560
  for (;; )
36511
36561
  switch (n3.n) {
36512
36562
  case 0:
36513
- return r2 = i2.length > 2 && i2[2] !== undefined ? i2[2] : fetch, o2 = { "MCP-Protocol-Version": t2 }, n3.n = 1, xu(e2, o2, r2);
36563
+ return r2 = i2.length > 2 && i2[2] !== undefined ? i2[2] : fetch, o2 = { "MCP-Protocol-Version": t2 }, n3.n = 1, Ju(e2, o2, r2);
36514
36564
  case 1:
36515
36565
  return n3.a(2, n3.v);
36516
36566
  }
36517
36567
  }, n);
36518
- })), Pu.apply(this, arguments);
36568
+ })), Qu.apply(this, arguments);
36519
36569
  }
36520
- function Zu(n3, e2) {
36570
+ function ns(n3, e2) {
36521
36571
  return !n3 || n3.status >= 400 && n3.status < 500 && e2 !== "/";
36522
36572
  }
36523
- function Cu(n3, e2, t2, r2) {
36524
- return Au.apply(this, arguments);
36573
+ function es(n3, e2, t2, r2) {
36574
+ return ts.apply(this, arguments);
36525
36575
  }
36526
- function Au() {
36527
- return Au = e(v().m(function n(e2, t2, r2, o2) {
36576
+ function ts() {
36577
+ return ts = e(v().m(function n(e2, t2, r2, o2) {
36528
36578
  var i2, u2, s2, c2, l2, d2, p2, f2;
36529
36579
  return v().w(function(n3) {
36530
36580
  for (;; )
36531
36581
  switch (n3.n) {
36532
36582
  case 0:
36533
- return s2 = new URL(e2), c2 = (i2 = o2 == null ? undefined : o2.protocolVersion) !== null && i2 !== undefined ? i2 : lo, (o2 == null ? undefined : o2.metadataUrl) ? l2 = new URL(o2.metadataUrl) : (d2 = Tu(t2, s2.pathname), (l2 = new URL(d2, (u2 = o2 == null ? undefined : o2.metadataServerUrl) !== null && u2 !== undefined ? u2 : s2)).search = s2.search), n3.n = 1, Eu(l2, c2, r2);
36583
+ return s2 = new URL(e2), c2 = (i2 = o2 == null ? undefined : o2.protocolVersion) !== null && i2 !== undefined ? i2 : _o, (o2 == null ? undefined : o2.metadataUrl) ? l2 = new URL(o2.metadataUrl) : (d2 = Yu(t2, s2.pathname), (l2 = new URL(d2, (u2 = o2 == null ? undefined : o2.metadataServerUrl) !== null && u2 !== undefined ? u2 : s2)).search = s2.search), n3.n = 1, Xu(l2, c2, r2);
36534
36584
  case 1:
36535
- if (p2 = n3.v, (o2 == null ? undefined : o2.metadataUrl) || !Zu(p2, s2.pathname)) {
36585
+ if (p2 = n3.v, (o2 == null ? undefined : o2.metadataUrl) || !ns(p2, s2.pathname)) {
36536
36586
  n3.n = 3;
36537
36587
  break;
36538
36588
  }
36539
- return f2 = new URL("/.well-known/".concat(t2), s2), n3.n = 2, Eu(f2, c2, r2);
36589
+ return f2 = new URL("/.well-known/".concat(t2), s2), n3.n = 2, Xu(f2, c2, r2);
36540
36590
  case 2:
36541
36591
  p2 = n3.v;
36542
36592
  case 3:
36543
36593
  return n3.a(2, p2);
36544
36594
  }
36545
36595
  }, n);
36546
- })), Au.apply(this, arguments);
36596
+ })), ts.apply(this, arguments);
36547
36597
  }
36548
- function Uu(n3) {
36598
+ function rs(n3) {
36549
36599
  var e2 = typeof n3 == "string" ? new URL(n3) : n3, t2 = [];
36550
36600
  if (!(e2.pathname !== "/"))
36551
36601
  return t2.push({ url: new URL("/.well-known/oauth-authorization-server", e2.origin), type: "oauth" }), t2.push({ url: new URL("/.well-known/openid-configuration", e2.origin), type: "oidc" }), t2;
36552
36602
  var r2 = e2.pathname;
36553
36603
  return r2.endsWith("/") && (r2 = r2.slice(0, -1)), t2.push({ url: new URL("/.well-known/oauth-authorization-server".concat(r2), e2.origin), type: "oauth" }), t2.push({ url: new URL("/.well-known/openid-configuration".concat(r2), e2.origin), type: "oidc" }), t2.push({ url: new URL("".concat(r2, "/.well-known/openid-configuration"), e2.origin), type: "oidc" }), t2;
36554
36604
  }
36555
- function Ru(n3) {
36556
- return Su.apply(this, arguments);
36605
+ function os(n3) {
36606
+ return is.apply(this, arguments);
36557
36607
  }
36558
- function Su() {
36559
- return Su = e(v().m(function n(e2) {
36560
- var t2, r2, o2, i2, u2, s2, l2, d2, p2, f2, h2, v2, m2, _, y2, g2 = arguments;
36608
+ function is() {
36609
+ return is = e(v().m(function n(e2) {
36610
+ var t2, r2, o2, i2, u2, s2, l2, d2, p2, f2, h2, v2, m2, _, g2, y2, w2 = arguments;
36561
36611
  return v().w(function(n3) {
36562
36612
  for (;; )
36563
36613
  switch (n3.p = n3.n) {
36564
36614
  case 0:
36565
- r2 = (t2 = g2.length > 1 && g2[1] !== undefined ? g2[1] : {}).fetchFn, o2 = r2 === undefined ? fetch : r2, i2 = t2.protocolVersion, u2 = { "MCP-Protocol-Version": i2 === undefined ? lo : i2, Accept: "application/json" }, s2 = Uu(e2), l2 = a(s2), n3.p = 1, l2.s();
36615
+ r2 = (t2 = w2.length > 1 && w2[1] !== undefined ? w2[1] : {}).fetchFn, o2 = r2 === undefined ? fetch : r2, i2 = t2.protocolVersion, s2 = { "MCP-Protocol-Version": i2 === undefined ? _o : i2, Accept: "application/json" }, l2 = rs(e2), d2 = a(l2), n3.p = 1, d2.s();
36566
36616
  case 2:
36567
- if ((d2 = l2.n()).done) {
36568
- n3.n = 11;
36617
+ if ((p2 = d2.n()).done) {
36618
+ n3.n = 12;
36569
36619
  break;
36570
36620
  }
36571
- return p2 = d2.value, f2 = p2.url, h2 = p2.type, n3.n = 3, xu(f2, u2, o2);
36621
+ return f2 = p2.value, h2 = f2.url, v2 = f2.type, n3.n = 3, Ju(h2, s2, o2);
36572
36622
  case 3:
36573
- if (v2 = n3.v) {
36623
+ if (m2 = n3.v) {
36574
36624
  n3.n = 4;
36575
36625
  break;
36576
36626
  }
36577
- return n3.a(3, 10);
36627
+ return n3.a(3, 11);
36578
36628
  case 4:
36579
- if (v2.ok) {
36580
- n3.n = 6;
36629
+ if (m2.ok) {
36630
+ n3.n = 7;
36581
36631
  break;
36582
36632
  }
36583
- if (!(v2.status >= 400 && v2.status < 500)) {
36584
- n3.n = 5;
36633
+ return n3.n = 5, (u2 = m2.body) === null || u2 === undefined ? undefined : u2.cancel();
36634
+ case 5:
36635
+ if (!(m2.status >= 400 && m2.status < 500)) {
36636
+ n3.n = 6;
36585
36637
  break;
36586
36638
  }
36587
- return n3.a(3, 10);
36588
- case 5:
36589
- throw new Error("HTTP ".concat(v2.status, " trying to load ").concat(h2 === "oauth" ? "OAuth" : "OpenID provider", " metadata from ").concat(f2));
36639
+ return n3.a(3, 11);
36590
36640
  case 6:
36591
- if (h2 !== "oauth") {
36592
- n3.n = 8;
36641
+ throw new Error("HTTP ".concat(m2.status, " trying to load ").concat(v2 === "oauth" ? "OAuth" : "OpenID provider", " metadata from ").concat(h2));
36642
+ case 7:
36643
+ if (v2 !== "oauth") {
36644
+ n3.n = 9;
36593
36645
  break;
36594
36646
  }
36595
- return m2 = Aa, n3.n = 7, v2.json();
36596
- case 7:
36597
- return n3.a(2, m2.parse.call(m2, n3.v));
36647
+ return _ = eu, n3.n = 8, m2.json();
36598
36648
  case 8:
36599
- return _ = Ra, n3.n = 9, v2.json();
36600
- case 9:
36601
36649
  return n3.a(2, _.parse.call(_, n3.v));
36650
+ case 9:
36651
+ return g2 = ru, n3.n = 10, m2.json();
36602
36652
  case 10:
36603
- n3.n = 2;
36604
- break;
36653
+ return n3.a(2, g2.parse.call(g2, n3.v));
36605
36654
  case 11:
36606
- n3.n = 13;
36655
+ n3.n = 2;
36607
36656
  break;
36608
36657
  case 12:
36609
- n3.p = 12, y2 = n3.v, l2.e(y2);
36658
+ n3.n = 14;
36659
+ break;
36610
36660
  case 13:
36611
- return n3.p = 13, l2.f(), n3.f(13);
36661
+ n3.p = 13, y2 = n3.v, d2.e(y2);
36612
36662
  case 14:
36663
+ return n3.p = 14, d2.f(), n3.f(14);
36664
+ case 15:
36613
36665
  return n3.a(2, undefined);
36614
36666
  }
36615
- }, n, null, [[1, 12, 13, 14]]);
36616
- })), Su.apply(this, arguments);
36667
+ }, n, null, [[1, 13, 14, 15]]);
36668
+ })), is.apply(this, arguments);
36617
36669
  }
36618
- function Ou(n3, e2) {
36619
- return $u.apply(this, arguments);
36670
+ function as(n3, e2) {
36671
+ return us.apply(this, arguments);
36620
36672
  }
36621
- function $u() {
36622
- return ($u = e(v().m(function n(e2, t2) {
36673
+ function us() {
36674
+ return (us = e(v().m(function n(e2, t2) {
36623
36675
  var r2, o2, i2, u2, s2, c2, l2, d2, p2, f2;
36624
36676
  return v().w(function(n3) {
36625
36677
  for (;; )
@@ -36629,17 +36681,17 @@ function $u() {
36629
36681
  n3.n = 3;
36630
36682
  break;
36631
36683
  }
36632
- if (l2 = new URL(r2.authorization_endpoint), r2.response_types_supported.includes(uu)) {
36684
+ if (l2 = new URL(r2.authorization_endpoint), r2.response_types_supported.includes(Ru)) {
36633
36685
  n3.n = 1;
36634
36686
  break;
36635
36687
  }
36636
- throw new Error("Incompatible auth server: does not support response type ".concat(uu));
36688
+ throw new Error("Incompatible auth server: does not support response type ".concat(Ru));
36637
36689
  case 1:
36638
- if (!r2.code_challenge_methods_supported || r2.code_challenge_methods_supported.includes(su)) {
36690
+ if (!r2.code_challenge_methods_supported || r2.code_challenge_methods_supported.includes(Uu)) {
36639
36691
  n3.n = 2;
36640
36692
  break;
36641
36693
  }
36642
- throw new Error("Incompatible auth server: does not support code challenge method ".concat(su));
36694
+ throw new Error("Incompatible auth server: does not support code challenge method ".concat(Uu));
36643
36695
  case 2:
36644
36696
  n3.n = 4;
36645
36697
  break;
@@ -36648,91 +36700,119 @@ function $u() {
36648
36700
  case 4:
36649
36701
  return n3.n = 5, pkceChallenge();
36650
36702
  case 5:
36651
- return d2 = n3.v, p2 = d2.code_verifier, f2 = d2.code_challenge, l2.searchParams.set("response_type", uu), l2.searchParams.set("client_id", o2.client_id), l2.searchParams.set("code_challenge", f2), l2.searchParams.set("code_challenge_method", su), l2.searchParams.set("redirect_uri", String(i2)), s2 && l2.searchParams.set("state", s2), u2 && l2.searchParams.set("scope", u2), (u2 == null ? undefined : u2.includes("offline_access")) && l2.searchParams.append("prompt", "consent"), c2 && l2.searchParams.set("resource", c2.href), n3.a(2, { authorizationUrl: l2, codeVerifier: p2 });
36703
+ return d2 = n3.v, p2 = d2.code_verifier, f2 = d2.code_challenge, l2.searchParams.set("response_type", Ru), l2.searchParams.set("client_id", o2.client_id), l2.searchParams.set("code_challenge", f2), l2.searchParams.set("code_challenge_method", Uu), l2.searchParams.set("redirect_uri", String(i2)), s2 && l2.searchParams.set("state", s2), u2 && l2.searchParams.set("scope", u2), (u2 == null ? undefined : u2.includes("offline_access")) && l2.searchParams.append("prompt", "consent"), c2 && l2.searchParams.set("resource", c2.href), n3.a(2, { authorizationUrl: l2, codeVerifier: p2 });
36652
36704
  }
36653
36705
  }, n);
36654
36706
  }))).apply(this, arguments);
36655
36707
  }
36656
- function ju(n3, e2) {
36657
- return Nu.apply(this, arguments);
36708
+ function ss(n3, e2, t2) {
36709
+ return new URLSearchParams({ grant_type: "authorization_code", code: n3, code_verifier: e2, redirect_uri: String(t2) });
36710
+ }
36711
+ function cs(n3, e2) {
36712
+ return ls.apply(this, arguments);
36658
36713
  }
36659
- function Nu() {
36660
- return Nu = e(v().m(function n(e2, t2) {
36661
- var r2, o2, i2, u2, s2, c2, l2, d2, p2, f2, h2, v2, m2, _, y2, g2;
36714
+ function ls() {
36715
+ return (ls = e(v().m(function n(e2, t2) {
36716
+ var r2, o2, i2, u2, s2, c2, l2, d2, p2, f2, h2, v2;
36662
36717
  return v().w(function(n3) {
36663
36718
  for (;; )
36664
36719
  switch (n3.n) {
36665
36720
  case 0:
36666
- if (r2 = t2.metadata, o2 = t2.clientInformation, i2 = t2.authorizationCode, u2 = t2.codeVerifier, s2 = t2.redirectUri, c2 = t2.resource, l2 = t2.addClientAuthentication, d2 = t2.fetchFn, f2 = "authorization_code", h2 = (r2 == null ? undefined : r2.token_endpoint) ? new URL(r2.token_endpoint) : new URL("/token", e2), !(r2 == null ? undefined : r2.grant_types_supported) || r2.grant_types_supported.includes(f2)) {
36667
- n3.n = 1;
36721
+ if (r2 = t2.metadata, o2 = t2.tokenRequestParams, i2 = t2.clientInformation, u2 = t2.addClientAuthentication, s2 = t2.resource, c2 = t2.fetchFn, d2 = (r2 == null ? undefined : r2.token_endpoint) ? new URL(r2.token_endpoint) : new URL("/token", e2), p2 = new Headers({ "Content-Type": "application/x-www-form-urlencoded", Accept: "application/json" }), s2 && o2.set("resource", s2.href), !u2) {
36722
+ n3.n = 2;
36668
36723
  break;
36669
36724
  }
36670
- throw new Error("Incompatible auth server: does not support grant type ".concat(f2));
36725
+ return n3.n = 1, u2(p2, o2, d2, r2);
36671
36726
  case 1:
36672
- return v2 = new Headers({ "Content-Type": "application/x-www-form-urlencoded", Accept: "application/json" }), m2 = new URLSearchParams({ grant_type: f2, code: i2, code_verifier: u2, redirect_uri: String(s2) }), l2 ? l2(v2, m2, e2, r2) : (_ = (p2 = r2 == null ? undefined : r2.token_endpoint_auth_methods_supported) !== null && p2 !== undefined ? p2 : [], lu(cu(o2, _), o2, v2, m2)), c2 && m2.set("resource", c2.href), n3.n = 2, (d2 != null ? d2 : fetch)(h2, { method: "POST", headers: v2, body: m2 });
36727
+ n3.n = 3;
36728
+ break;
36673
36729
  case 2:
36674
- if ((y2 = n3.v).ok) {
36675
- n3.n = 4;
36676
- break;
36677
- }
36678
- return n3.n = 3, du(y2);
36730
+ i2 && (f2 = (l2 = r2 == null ? undefined : r2.token_endpoint_auth_methods_supported) !== null && l2 !== undefined ? l2 : [], Ou(Su(i2, f2), i2, p2, o2));
36679
36731
  case 3:
36680
- throw n3.v;
36732
+ return n3.n = 4, (c2 != null ? c2 : fetch)(d2, { method: "POST", headers: p2, body: o2 });
36681
36733
  case 4:
36682
- return g2 = Sa, n3.n = 5, y2.json();
36734
+ if ((h2 = n3.v).ok) {
36735
+ n3.n = 6;
36736
+ break;
36737
+ }
36738
+ return n3.n = 5, $u(h2);
36683
36739
  case 5:
36684
- return n3.a(2, g2.parse.call(g2, n3.v));
36740
+ throw n3.v;
36741
+ case 6:
36742
+ return v2 = ou, n3.n = 7, h2.json();
36743
+ case 7:
36744
+ return n3.a(2, v2.parse.call(v2, n3.v));
36685
36745
  }
36686
36746
  }, n);
36687
- })), Nu.apply(this, arguments);
36747
+ }))).apply(this, arguments);
36748
+ }
36749
+ function ds(n3, e2) {
36750
+ return ps.apply(this, arguments);
36751
+ }
36752
+ function ps() {
36753
+ return (ps = e(v().m(function n(e2, t2) {
36754
+ var r2, i2, u2, s2, c2, l2, d2, p2;
36755
+ return v().w(function(n3) {
36756
+ for (;; )
36757
+ switch (n3.n) {
36758
+ case 0:
36759
+ return r2 = t2.metadata, i2 = t2.clientInformation, u2 = t2.refreshToken, s2 = t2.resource, c2 = t2.addClientAuthentication, l2 = t2.fetchFn, d2 = new URLSearchParams({ grant_type: "refresh_token", refresh_token: u2 }), n3.n = 1, cs(e2, { metadata: r2, tokenRequestParams: d2, clientInformation: i2, addClientAuthentication: c2, resource: s2, fetchFn: l2 });
36760
+ case 1:
36761
+ return p2 = n3.v, n3.a(2, b({ refresh_token: u2 }, p2));
36762
+ }
36763
+ }, n);
36764
+ }))).apply(this, arguments);
36688
36765
  }
36689
- function Mu(n3, e2) {
36690
- return Fu.apply(this, arguments);
36766
+ function fs(n3, e2) {
36767
+ return hs.apply(this, arguments);
36691
36768
  }
36692
- function Fu() {
36693
- return Fu = e(v().m(function n(e2, t2) {
36694
- var r2, i2, u2, s2, c2, l2, d2, p2, f2, h2, v2, m2, _, y2, g2, w2;
36769
+ function hs() {
36770
+ return hs = e(v().m(function n(e2, t2) {
36771
+ var r2, o2, i2, u2, s2, c2, l2, d2, p2, f2 = arguments;
36695
36772
  return v().w(function(n3) {
36696
36773
  for (;; )
36697
36774
  switch (n3.n) {
36698
36775
  case 0:
36699
- if (r2 = t2.metadata, i2 = t2.clientInformation, u2 = t2.refreshToken, s2 = t2.resource, c2 = t2.addClientAuthentication, l2 = t2.fetchFn, p2 = "refresh_token", !r2) {
36776
+ if (o2 = (r2 = f2.length > 2 && f2[2] !== undefined ? f2[2] : {}).metadata, i2 = r2.resource, u2 = r2.authorizationCode, s2 = r2.fetchFn, c2 = e2.clientMetadata.scope, !e2.prepareTokenRequest) {
36700
36777
  n3.n = 2;
36701
36778
  break;
36702
36779
  }
36703
- if (f2 = new URL(r2.token_endpoint), !r2.grant_types_supported || r2.grant_types_supported.includes(p2)) {
36704
- n3.n = 1;
36705
- break;
36706
- }
36707
- throw new Error("Incompatible auth server: does not support grant type ".concat(p2));
36780
+ return n3.n = 1, e2.prepareTokenRequest(c2);
36708
36781
  case 1:
36709
- n3.n = 3;
36710
- break;
36782
+ l2 = n3.v;
36711
36783
  case 2:
36712
- f2 = new URL("/token", e2);
36713
- case 3:
36714
- return h2 = new Headers({ "Content-Type": "application/x-www-form-urlencoded" }), v2 = new URLSearchParams({ grant_type: p2, refresh_token: u2 }), c2 ? c2(h2, v2, e2, r2) : (m2 = (d2 = r2 == null ? undefined : r2.token_endpoint_auth_methods_supported) !== null && d2 !== undefined ? d2 : [], lu(cu(i2, m2), i2, h2, v2)), s2 && v2.set("resource", s2.href), n3.n = 4, (l2 != null ? l2 : fetch)(f2, { method: "POST", headers: h2, body: v2 });
36715
- case 4:
36716
- if ((_ = n3.v).ok) {
36784
+ if (l2) {
36717
36785
  n3.n = 6;
36718
36786
  break;
36719
36787
  }
36720
- return n3.n = 5, du(_);
36788
+ if (u2) {
36789
+ n3.n = 3;
36790
+ break;
36791
+ }
36792
+ throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");
36793
+ case 3:
36794
+ if (e2.redirectUrl) {
36795
+ n3.n = 4;
36796
+ break;
36797
+ }
36798
+ throw new Error("redirectUrl is required for authorization_code flow");
36799
+ case 4:
36800
+ return n3.n = 5, e2.codeVerifier();
36721
36801
  case 5:
36722
- throw n3.v;
36802
+ d2 = n3.v, l2 = ss(u2, d2, e2.redirectUrl);
36723
36803
  case 6:
36724
- return y2 = Sa, g2 = b, w2 = { refresh_token: u2 }, n3.n = 7, _.json();
36804
+ return n3.n = 7, e2.clientInformation();
36725
36805
  case 7:
36726
- return n3.a(2, y2.parse.call(y2, g2(w2, n3.v)));
36806
+ return p2 = n3.v, n3.a(2, cs(t2, { metadata: o2, tokenRequestParams: l2, clientInformation: p2 != null ? p2 : undefined, addClientAuthentication: e2.addClientAuthentication, resource: i2, fetchFn: s2 }));
36727
36807
  }
36728
36808
  }, n);
36729
- })), Fu.apply(this, arguments);
36809
+ })), hs.apply(this, arguments);
36730
36810
  }
36731
- function Lu(n3, e2) {
36732
- return Du.apply(this, arguments);
36811
+ function vs(n3, e2) {
36812
+ return ms.apply(this, arguments);
36733
36813
  }
36734
- function Du() {
36735
- return (Du = e(v().m(function n(e2, t2) {
36814
+ function ms() {
36815
+ return (ms = e(v().m(function n(e2, t2) {
36736
36816
  var r2, o2, i2, u2, s2, c2;
36737
36817
  return v().w(function(n3) {
36738
36818
  for (;; )
@@ -36759,29 +36839,29 @@ function Du() {
36759
36839
  n3.n = 6;
36760
36840
  break;
36761
36841
  }
36762
- return n3.n = 5, du(s2);
36842
+ return n3.n = 5, $u(s2);
36763
36843
  case 5:
36764
36844
  throw n3.v;
36765
36845
  case 6:
36766
- return c2 = Ma, n3.n = 7, s2.json();
36846
+ return c2 = cu, n3.n = 7, s2.json();
36767
36847
  case 7:
36768
36848
  return n3.a(2, c2.parse.call(c2, n3.v));
36769
36849
  }
36770
36850
  }, n);
36771
36851
  }))).apply(this, arguments);
36772
36852
  }
36773
- var Vu = function(n3) {
36853
+ var _s = function(n3) {
36774
36854
  function e2(n4, t2) {
36775
36855
  var r2;
36776
36856
  return o(this, e2), (r2 = n(this, e2, [n4])).name = "ParseError", r2.type = t2.type, r2.field = t2.field, r2.value = t2.value, r2.line = t2.line, r2;
36777
36857
  }
36778
36858
  return y(e2, n3), c(e2);
36779
36859
  }(S(Error));
36780
- function qu(n3) {}
36781
- function Wu(n3) {
36860
+ function gs(n3) {}
36861
+ function ys(n3) {
36782
36862
  if (typeof n3 == "function")
36783
36863
  throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");
36784
- var e2, t2 = n3.onEvent, r2 = t2 === undefined ? qu : t2, o2 = n3.onError, i2 = o2 === undefined ? qu : o2, a2 = n3.onRetry, u2 = a2 === undefined ? qu : a2, s2 = n3.onComment, l2 = "", d2 = true, p2 = "", f2 = "";
36864
+ var e2, t2 = n3.onEvent, r2 = t2 === undefined ? gs : t2, o2 = n3.onError, i2 = o2 === undefined ? gs : o2, a2 = n3.onRetry, u2 = a2 === undefined ? gs : a2, s2 = n3.onComment, l2 = "", d2 = true, p2 = "", f2 = "";
36785
36865
  function v2(n4) {
36786
36866
  if (n4 === "")
36787
36867
  return p2.length > 0 && r2({ id: e2, event: f2 || undefined, data: p2.endsWith(`
@@ -36811,10 +36891,10 @@ function Wu(n3) {
36811
36891
  e2 = t3.includes("\x00") ? undefined : t3;
36812
36892
  break;
36813
36893
  case "retry":
36814
- /^\d+$/.test(t3) ? u2(parseInt(t3, 10)) : i2(new Vu('Invalid `retry` value: "'.concat(t3, '"'), { type: "invalid-retry", value: t3, line: r3 }));
36894
+ /^\d+$/.test(t3) ? u2(parseInt(t3, 10)) : i2(new _s('Invalid `retry` value: "'.concat(t3, '"'), { type: "invalid-retry", value: t3, line: r3 }));
36815
36895
  break;
36816
36896
  default:
36817
- i2(new Vu('Unknown field "'.concat(n4.length > 20 ? "".concat(n4.slice(0, 20), "…") : n4, '"'), { type: "unknown-field", field: n4, value: t3, line: r3 }));
36897
+ i2(new _s('Unknown field "'.concat(n4.length > 20 ? "".concat(n4.slice(0, 20), "…") : n4, '"'), { type: "unknown-field", field: n4, value: t3, line: r3 }));
36818
36898
  }
36819
36899
  }
36820
36900
  return { feed: function(n4) {
@@ -36846,11 +36926,11 @@ function Wu(n3) {
36846
36926
  l2 && (arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}).consume && v2(l2), d2 = true, e2 = undefined, p2 = "", f2 = "", l2 = "";
36847
36927
  } };
36848
36928
  }
36849
- var Hu = function(n3) {
36929
+ var ws = function(n3) {
36850
36930
  function e2() {
36851
36931
  var n4, t2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, r2 = t2.onError, o2 = t2.onRetry, i2 = t2.onComment;
36852
36932
  return o(this, e2), n(this, e2, [{ start: function(e3) {
36853
- n4 = Wu({ onEvent: function(n5) {
36933
+ n4 = ys({ onEvent: function(n5) {
36854
36934
  e3.enqueue(n5);
36855
36935
  }, onError: function(n5) {
36856
36936
  r2 === "terminate" ? e3.error(n5) : typeof r2 == "function" && r2(n5);
@@ -36861,15 +36941,15 @@ var Hu = function(n3) {
36861
36941
  }
36862
36942
  return y(e2, n3), c(e2);
36863
36943
  }(S(TransformStream));
36864
- var Bu = { initialReconnectionDelay: 1000, maxReconnectionDelay: 30000, reconnectionDelayGrowFactor: 1.5, maxRetries: 2 };
36865
- var Gu = function(n3) {
36944
+ var ks = { initialReconnectionDelay: 1000, maxReconnectionDelay: 30000, reconnectionDelayGrowFactor: 1.5, maxRetries: 2 };
36945
+ var bs = function(n3) {
36866
36946
  function e2(n4, t2) {
36867
36947
  var r2;
36868
36948
  return o(this, e2), (r2 = n(this, e2, ["Streamable HTTP error: ".concat(t2)])).code = n4, r2;
36869
36949
  }
36870
36950
  return y(e2, n3), c(e2);
36871
36951
  }(S(Error));
36872
- var Ju = function() {
36952
+ var zs = function() {
36873
36953
  return c(function n(e3, t3) {
36874
36954
  var r3;
36875
36955
  o(this, n), this._hasCompletedAuthFlow = false, this._url = e3, this._resourceMetadataUrl = undefined, this._scope = undefined, this._requestInit = t3 == null ? undefined : t3.requestInit, this._authProvider = t3 == null ? undefined : t3.authProvider, this._fetch = t3 == null ? undefined : t3.fetch, this._fetchWithInit = function() {
@@ -36887,7 +36967,7 @@ var Ju = function() {
36887
36967
  return t4.apply(this, arguments);
36888
36968
  };
36889
36969
  }() : n4;
36890
- }(t3 == null ? undefined : t3.fetch, t3 == null ? undefined : t3.requestInit), this._sessionId = t3 == null ? undefined : t3.sessionId, this._reconnectionOptions = (r3 = t3 == null ? undefined : t3.reconnectionOptions) !== null && r3 !== undefined ? r3 : Bu;
36970
+ }(t3 == null ? undefined : t3.fetch, t3 == null ? undefined : t3.requestInit), this._sessionId = t3 == null ? undefined : t3.sessionId, this._reconnectionOptions = (r3 = t3 == null ? undefined : t3.reconnectionOptions) !== null && r3 !== undefined ? r3 : ks;
36891
36971
  }, [{ key: "_authThenStart", value: (h2 = e(v().m(function n() {
36892
36972
  var e3, t3, r3;
36893
36973
  return v().w(function(n4) {
@@ -36898,9 +36978,9 @@ var Ju = function() {
36898
36978
  n4.n = 1;
36899
36979
  break;
36900
36980
  }
36901
- throw new au("No auth provider");
36981
+ throw new Au("No auth provider");
36902
36982
  case 1:
36903
- return n4.p = 1, n4.n = 2, fu(this._authProvider, { serverUrl: this._url, resourceMetadataUrl: this._resourceMetadataUrl, scope: this._scope, fetchFn: this._fetchWithInit });
36983
+ return n4.p = 1, n4.n = 2, Nu(this._authProvider, { serverUrl: this._url, resourceMetadataUrl: this._resourceMetadataUrl, scope: this._scope, fetchFn: this._fetchWithInit });
36904
36984
  case 2:
36905
36985
  t3 = n4.v, n4.n = 4;
36906
36986
  break;
@@ -36911,7 +36991,7 @@ var Ju = function() {
36911
36991
  n4.n = 5;
36912
36992
  break;
36913
36993
  }
36914
- throw new au;
36994
+ throw new Au;
36915
36995
  case 5:
36916
36996
  return n4.n = 6, this._startOrAuthSse({ resumptionToken: undefined });
36917
36997
  case 6:
@@ -36940,43 +37020,45 @@ var Ju = function() {
36940
37020
  })), function() {
36941
37021
  return f2.apply(this, arguments);
36942
37022
  }) }, { key: "_startOrAuthSse", value: (p2 = e(v().m(function n(e3) {
36943
- var t3, r3, o2, i2, u3, s2, c2;
37023
+ var t3, r3, o2, i2, u3, s2, c2, l2;
36944
37024
  return v().w(function(n4) {
36945
37025
  for (;; )
36946
37026
  switch (n4.p = n4.n) {
36947
37027
  case 0:
36948
- return i2 = e3.resumptionToken, n4.p = 1, n4.n = 2, this._commonHeaders();
37028
+ return u3 = e3.resumptionToken, n4.p = 1, n4.n = 2, this._commonHeaders();
36949
37029
  case 2:
36950
- return (u3 = n4.v).set("Accept", "text/event-stream"), i2 && u3.set("last-event-id", i2), n4.n = 3, ((t3 = this._fetch) !== null && t3 !== undefined ? t3 : fetch)(this._url, { method: "GET", headers: u3, signal: (r3 = this._abortController) === null || r3 === undefined ? undefined : r3.signal });
37030
+ return (s2 = n4.v).set("Accept", "text/event-stream"), u3 && s2.set("last-event-id", u3), n4.n = 3, ((t3 = this._fetch) !== null && t3 !== undefined ? t3 : fetch)(this._url, { method: "GET", headers: s2, signal: (r3 = this._abortController) === null || r3 === undefined ? undefined : r3.signal });
36951
37031
  case 3:
36952
- if ((s2 = n4.v).ok) {
36953
- n4.n = 7;
37032
+ if ((c2 = n4.v).ok) {
37033
+ n4.n = 8;
36954
37034
  break;
36955
37035
  }
36956
- if (s2.status !== 401 || !this._authProvider) {
36957
- n4.n = 5;
37036
+ return n4.n = 4, (o2 = c2.body) === null || o2 === undefined ? undefined : o2.cancel();
37037
+ case 4:
37038
+ if (c2.status !== 401 || !this._authProvider) {
37039
+ n4.n = 6;
36958
37040
  break;
36959
37041
  }
36960
- return n4.n = 4, this._authThenStart();
36961
- case 4:
36962
- return n4.a(2, n4.v);
37042
+ return n4.n = 5, this._authThenStart();
36963
37043
  case 5:
36964
- if (s2.status !== 405) {
36965
- n4.n = 6;
37044
+ return n4.a(2, n4.v);
37045
+ case 6:
37046
+ if (c2.status !== 405) {
37047
+ n4.n = 7;
36966
37048
  break;
36967
37049
  }
36968
37050
  return n4.a(2);
36969
- case 6:
36970
- throw new Gu(s2.status, "Failed to open SSE stream: ".concat(s2.statusText));
36971
37051
  case 7:
36972
- this._handleSseStream(s2.body, e3, true), n4.n = 9;
36973
- break;
37052
+ throw new bs(c2.status, "Failed to open SSE stream: ".concat(c2.statusText));
36974
37053
  case 8:
36975
- throw n4.p = 8, c2 = n4.v, (o2 = this.onerror) === null || o2 === undefined || o2.call(this, c2), c2;
37054
+ this._handleSseStream(c2.body, e3, true), n4.n = 10;
37055
+ break;
36976
37056
  case 9:
37057
+ throw n4.p = 9, l2 = n4.v, (i2 = this.onerror) === null || i2 === undefined || i2.call(this, l2), l2;
37058
+ case 10:
36977
37059
  return n4.a(2);
36978
37060
  }
36979
- }, n, this, [[1, 8]]);
37061
+ }, n, this, [[1, 9]]);
36980
37062
  })), function(n4) {
36981
37063
  return p2.apply(this, arguments);
36982
37064
  }) }, { key: "_getNextReconnectionDelay", value: function(n4) {
@@ -36986,11 +37068,11 @@ var Ju = function() {
36986
37068
  return Math.min(e3 * Math.pow(t3, n4), r3);
36987
37069
  } }, { key: "_scheduleReconnection", value: function(n4) {
36988
37070
  var e3, t3 = this, r3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0, o2 = this._reconnectionOptions.maxRetries;
36989
- if (o2 > 0 && r3 >= o2)
37071
+ if (r3 >= o2)
36990
37072
  (e3 = this.onerror) === null || e3 === undefined || e3.call(this, new Error("Maximum reconnection attempts (".concat(o2, ") exceeded.")));
36991
37073
  else {
36992
37074
  var i2 = this._getNextReconnectionDelay(r3);
36993
- setTimeout(function() {
37075
+ this._reconnectionTimeout = setTimeout(function() {
36994
37076
  t3._startOrAuthSse(n4).catch(function(e4) {
36995
37077
  var o3;
36996
37078
  (o3 = t3.onerror) === null || o3 === undefined || o3.call(t3, new Error("Failed to reconnect SSE stream: ".concat(e4 instanceof Error ? e4.message : String(e4)))), t3._scheduleReconnection(n4, r3 + 1);
@@ -37000,53 +37082,59 @@ var Ju = function() {
37000
37082
  } }, { key: "_handleSseStream", value: function(n4, e3, t3) {
37001
37083
  var r3 = this;
37002
37084
  if (n4) {
37003
- var o2, u3 = e3.onresumptiontoken, s2 = e3.replayMessageId, c2 = false, l2 = function() {
37085
+ var o2, u3 = e3.onresumptiontoken, s2 = e3.replayMessageId, c2 = false, l2 = false, d3 = function() {
37004
37086
  var e4 = e(v().m(function e() {
37005
- var i2, l3, d3, p3, f3, h3, v2, m2, _;
37087
+ var i2, d4, p3, f3, h3, v2, m2, _, g2;
37006
37088
  return v().w(function(e5) {
37007
37089
  for (;; )
37008
37090
  switch (e5.p = e5.n) {
37009
37091
  case 0:
37010
- e5.p = 0, f3 = n4.pipeThrough(new TextDecoderStream).pipeThrough(new Hu({ onRetry: function(n5) {
37092
+ e5.p = 0, h3 = n4.pipeThrough(new TextDecoderStream).pipeThrough(new ws({ onRetry: function(n5) {
37011
37093
  r3._serverRetryMs = n5;
37012
37094
  } })).getReader();
37013
37095
  case 1:
37014
- return e5.n = 2, f3.read();
37096
+ return e5.n = 2, h3.read();
37015
37097
  case 2:
37016
- if (h3 = e5.v, v2 = h3.value, !h3.done) {
37098
+ if (v2 = e5.v, m2 = v2.value, !v2.done) {
37017
37099
  e5.n = 3;
37018
37100
  break;
37019
37101
  }
37020
- return e5.a(3, 4);
37102
+ return e5.a(3, 5);
37021
37103
  case 3:
37022
- if (v2.id && (o2 = v2.id, c2 = true, u3 == null || u3(v2.id)), !v2.event || v2.event === "message")
37104
+ if (m2.id && (o2 = m2.id, c2 = true, u3 == null || u3(m2.id)), m2.data) {
37105
+ e5.n = 4;
37106
+ break;
37107
+ }
37108
+ return e5.a(3, 1);
37109
+ case 4:
37110
+ if (!m2.event || m2.event === "message")
37023
37111
  try {
37024
- m2 = Zo.parse(JSON.parse(v2.data)), s2 !== undefined && Eo(m2) && (m2.id = s2), (i2 = r3.onmessage) === null || i2 === undefined || i2.call(r3, m2);
37112
+ _ = No.parse(JSON.parse(m2.data)), $o(_) && (l2 = true, s2 !== undefined && (_.id = s2)), (i2 = r3.onmessage) === null || i2 === undefined || i2.call(r3, _);
37025
37113
  } catch (n5) {
37026
- (l3 = r3.onerror) === null || l3 === undefined || l3.call(r3, n5);
37114
+ (d4 = r3.onerror) === null || d4 === undefined || d4.call(r3, n5);
37027
37115
  }
37028
37116
  e5.n = 1;
37029
37117
  break;
37030
- case 4:
37031
- (t3 || c2) && r3._abortController && !r3._abortController.signal.aborted && r3._scheduleReconnection({ resumptionToken: o2, onresumptiontoken: u3, replayMessageId: s2 }, 0), e5.n = 6;
37032
- break;
37033
37118
  case 5:
37034
- if (e5.p = 5, _ = e5.v, (d3 = r3.onerror) === null || d3 === undefined || d3.call(r3, new Error("SSE stream disconnected: ".concat(_))), (t3 || c2) && r3._abortController && !r3._abortController.signal.aborted)
37119
+ (t3 || c2) && !l2 && r3._abortController && !r3._abortController.signal.aborted && r3._scheduleReconnection({ resumptionToken: o2, onresumptiontoken: u3, replayMessageId: s2 }, 0), e5.n = 7;
37120
+ break;
37121
+ case 6:
37122
+ if (e5.p = 6, g2 = e5.v, (p3 = r3.onerror) === null || p3 === undefined || p3.call(r3, new Error("SSE stream disconnected: ".concat(g2))), (t3 || c2) && !l2 && r3._abortController && !r3._abortController.signal.aborted)
37035
37123
  try {
37036
37124
  r3._scheduleReconnection({ resumptionToken: o2, onresumptiontoken: u3, replayMessageId: s2 }, 0);
37037
37125
  } catch (n5) {
37038
- (p3 = r3.onerror) === null || p3 === undefined || p3.call(r3, new Error("Failed to reconnect: ".concat(n5 instanceof Error ? n5.message : String(n5))));
37126
+ (f3 = r3.onerror) === null || f3 === undefined || f3.call(r3, new Error("Failed to reconnect: ".concat(n5 instanceof Error ? n5.message : String(n5))));
37039
37127
  }
37040
- case 6:
37128
+ case 7:
37041
37129
  return e5.a(2);
37042
37130
  }
37043
- }, e, null, [[0, 5]]);
37131
+ }, e, null, [[0, 6]]);
37044
37132
  }));
37045
37133
  return function() {
37046
37134
  return e4.apply(this, arguments);
37047
37135
  };
37048
37136
  }();
37049
- l2();
37137
+ d3();
37050
37138
  }
37051
37139
  } }, { key: "start", value: (d2 = e(v().m(function n() {
37052
37140
  return v().w(function(n4) {
@@ -37075,15 +37163,15 @@ var Ju = function() {
37075
37163
  n4.n = 1;
37076
37164
  break;
37077
37165
  }
37078
- throw new au("No auth provider");
37166
+ throw new Au("No auth provider");
37079
37167
  case 1:
37080
- return n4.n = 2, fu(this._authProvider, { serverUrl: this._url, authorizationCode: e3, resourceMetadataUrl: this._resourceMetadataUrl, scope: this._scope, fetchFn: this._fetchWithInit });
37168
+ return n4.n = 2, Nu(this._authProvider, { serverUrl: this._url, authorizationCode: e3, resourceMetadataUrl: this._resourceMetadataUrl, scope: this._scope, fetchFn: this._fetchWithInit });
37081
37169
  case 2:
37082
37170
  if (n4.v === "AUTHORIZED") {
37083
37171
  n4.n = 3;
37084
37172
  break;
37085
37173
  }
37086
- throw new au("Failed to authorize");
37174
+ throw new Au("Failed to authorize");
37087
37175
  case 3:
37088
37176
  return n4.a(2);
37089
37177
  }
@@ -37096,7 +37184,7 @@ var Ju = function() {
37096
37184
  for (;; )
37097
37185
  switch (n4.n) {
37098
37186
  case 0:
37099
- (e3 = this._abortController) === null || e3 === undefined || e3.abort(), (t3 = this.onclose) === null || t3 === undefined || t3.call(this);
37187
+ this._reconnectionTimeout && (clearTimeout(this._reconnectionTimeout), this._reconnectionTimeout = undefined), (e3 = this._abortController) === null || e3 === undefined || e3.abort(), (t3 = this.onclose) === null || t3 === undefined || t3.call(this);
37100
37188
  case 1:
37101
37189
  return n4.a(2);
37102
37190
  }
@@ -37104,136 +37192,145 @@ var Ju = function() {
37104
37192
  })), function() {
37105
37193
  return r2.apply(this, arguments);
37106
37194
  }) }, { key: "send", value: (t2 = e(v().m(function n(e3, t3) {
37107
- var r3, i2, u3, s2, l2, d3, p3, f3, h3, v2, m2, _, y2, g2, w2, k2, b3, z2, x2, I2, T2, E2, P2, Z2, C2, A2, U2, R2, S3 = this;
37195
+ var r3, i2, u3, s2, l2, d3, p3, f3, h3, v2, m2, _, g2, y2, w2, k2, b3, z2, x2, I2, T2, E2, P2, C2, Z2, A2, R2, U2, S3, O3, $2, j3 = this;
37108
37196
  return v().w(function(n4) {
37109
37197
  for (;; )
37110
37198
  switch (n4.p = n4.n) {
37111
37199
  case 0:
37112
- if (n4.p = 0, d3 = (l2 = t3 || {}).resumptionToken, p3 = l2.onresumptiontoken, !d3) {
37200
+ if (n4.p = 0, h3 = (f3 = t3 || {}).resumptionToken, v2 = f3.onresumptiontoken, !h3) {
37113
37201
  n4.n = 1;
37114
37202
  break;
37115
37203
  }
37116
- return this._startOrAuthSse({ resumptionToken: d3, replayMessageId: xo(e3) ? e3.id : undefined }).catch(function(n5) {
37204
+ return this._startOrAuthSse({ resumptionToken: h3, replayMessageId: Uo(e3) ? e3.id : undefined }).catch(function(n5) {
37117
37205
  var e4;
37118
- return (e4 = S3.onerror) === null || e4 === undefined ? undefined : e4.call(S3, n5);
37206
+ return (e4 = j3.onerror) === null || e4 === undefined ? undefined : e4.call(j3, n5);
37119
37207
  }), n4.a(2);
37120
37208
  case 1:
37121
37209
  return n4.n = 2, this._commonHeaders();
37122
37210
  case 2:
37123
- return (f3 = n4.v).set("content-type", "application/json"), f3.set("accept", "application/json, text/event-stream"), h3 = b(b({}, this._requestInit), {}, { method: "POST", headers: f3, body: JSON.stringify(e3), signal: (r3 = this._abortController) === null || r3 === undefined ? undefined : r3.signal }), n4.n = 3, ((i2 = this._fetch) !== null && i2 !== undefined ? i2 : fetch)(this._url, h3);
37211
+ return (m2 = n4.v).set("content-type", "application/json"), m2.set("accept", "application/json, text/event-stream"), _ = b(b({}, this._requestInit), {}, { method: "POST", headers: m2, body: JSON.stringify(e3), signal: (r3 = this._abortController) === null || r3 === undefined ? undefined : r3.signal }), n4.n = 3, ((i2 = this._fetch) !== null && i2 !== undefined ? i2 : fetch)(this._url, _);
37124
37212
  case 3:
37125
- if (v2 = n4.v, (m2 = v2.headers.get("mcp-session-id")) && (this._sessionId = m2), v2.ok) {
37213
+ if (g2 = n4.v, (y2 = g2.headers.get("mcp-session-id")) && (this._sessionId = y2), g2.ok) {
37126
37214
  n4.n = 13;
37127
37215
  break;
37128
37216
  }
37129
- if (v2.status !== 401 || !this._authProvider) {
37130
- n4.n = 7;
37217
+ return n4.n = 4, g2.text().catch(function() {
37218
+ return null;
37219
+ });
37220
+ case 4:
37221
+ if (w2 = n4.v, g2.status !== 401 || !this._authProvider) {
37222
+ n4.n = 8;
37131
37223
  break;
37132
37224
  }
37133
37225
  if (!this._hasCompletedAuthFlow) {
37134
- n4.n = 4;
37226
+ n4.n = 5;
37135
37227
  break;
37136
37228
  }
37137
- throw new Gu(401, "Server returned 401 after successful authentication");
37138
- case 4:
37139
- return _ = wu(v2), y2 = _.resourceMetadataUrl, g2 = _.scope, this._resourceMetadataUrl = y2, this._scope = g2, n4.n = 5, fu(this._authProvider, { serverUrl: this._url, resourceMetadataUrl: this._resourceMetadataUrl, scope: this._scope, fetchFn: this._fetchWithInit });
37229
+ throw new bs(401, "Server returned 401 after successful authentication");
37140
37230
  case 5:
37231
+ return k2 = Wu(g2), b3 = k2.resourceMetadataUrl, z2 = k2.scope, this._resourceMetadataUrl = b3, this._scope = z2, n4.n = 6, Nu(this._authProvider, { serverUrl: this._url, resourceMetadataUrl: this._resourceMetadataUrl, scope: this._scope, fetchFn: this._fetchWithInit });
37232
+ case 6:
37141
37233
  if (n4.v === "AUTHORIZED") {
37142
- n4.n = 6;
37234
+ n4.n = 7;
37143
37235
  break;
37144
37236
  }
37145
- throw new au;
37146
- case 6:
37147
- return this._hasCompletedAuthFlow = true, n4.a(2, this.send(e3));
37237
+ throw new Au;
37148
37238
  case 7:
37149
- if (v2.status !== 403 || !this._authProvider) {
37150
- n4.n = 11;
37239
+ return this._hasCompletedAuthFlow = true, n4.a(2, this.send(e3));
37240
+ case 8:
37241
+ if (g2.status !== 403 || !this._authProvider) {
37242
+ n4.n = 12;
37151
37243
  break;
37152
37244
  }
37153
- if (w2 = wu(v2), k2 = w2.resourceMetadataUrl, b3 = w2.scope, w2.error !== "insufficient_scope") {
37154
- n4.n = 11;
37245
+ if (x2 = Wu(g2), I2 = x2.resourceMetadataUrl, T2 = x2.scope, x2.error !== "insufficient_scope") {
37246
+ n4.n = 12;
37155
37247
  break;
37156
37248
  }
37157
- if (z2 = v2.headers.get("WWW-Authenticate"), this._lastUpscopingHeader !== z2) {
37158
- n4.n = 8;
37249
+ if (E2 = g2.headers.get("WWW-Authenticate"), this._lastUpscopingHeader !== E2) {
37250
+ n4.n = 9;
37159
37251
  break;
37160
37252
  }
37161
- throw new Gu(403, "Server returned 403 after trying upscoping");
37162
- case 8:
37163
- return b3 && (this._scope = b3), k2 && (this._resourceMetadataUrl = k2), this._lastUpscopingHeader = z2 != null ? z2 : undefined, n4.n = 9, fu(this._authProvider, { serverUrl: this._url, resourceMetadataUrl: this._resourceMetadataUrl, scope: this._scope, fetchFn: this._fetch });
37253
+ throw new bs(403, "Server returned 403 after trying upscoping");
37164
37254
  case 9:
37255
+ return T2 && (this._scope = T2), I2 && (this._resourceMetadataUrl = I2), this._lastUpscopingHeader = E2 != null ? E2 : undefined, n4.n = 10, Nu(this._authProvider, { serverUrl: this._url, resourceMetadataUrl: this._resourceMetadataUrl, scope: this._scope, fetchFn: this._fetch });
37256
+ case 10:
37165
37257
  if (n4.v === "AUTHORIZED") {
37166
- n4.n = 10;
37258
+ n4.n = 11;
37167
37259
  break;
37168
37260
  }
37169
- throw new au;
37170
- case 10:
37171
- return n4.a(2, this.send(e3));
37261
+ throw new Au;
37172
37262
  case 11:
37173
- return n4.n = 12, v2.text().catch(function() {
37174
- return null;
37175
- });
37263
+ return n4.a(2, this.send(e3));
37176
37264
  case 12:
37177
- throw x2 = n4.v, new Error("Error POSTing to endpoint (HTTP ".concat(v2.status, "): ").concat(x2));
37265
+ throw new bs(g2.status, "Error POSTing to endpoint: ".concat(w2));
37178
37266
  case 13:
37179
- if (this._hasCompletedAuthFlow = false, this._lastUpscopingHeader = undefined, v2.status !== 202) {
37180
- n4.n = 14;
37267
+ if (this._hasCompletedAuthFlow = false, this._lastUpscopingHeader = undefined, g2.status !== 202) {
37268
+ n4.n = 15;
37181
37269
  break;
37182
37270
  }
37183
- return Wo(e3) && this._startOrAuthSse({ resumptionToken: undefined }).catch(function(n5) {
37271
+ return n4.n = 14, (u3 = g2.body) === null || u3 === undefined ? undefined : u3.cancel();
37272
+ case 14:
37273
+ return ti(e3) && this._startOrAuthSse({ resumptionToken: undefined }).catch(function(n5) {
37184
37274
  var e4;
37185
- return (e4 = S3.onerror) === null || e4 === undefined ? undefined : e4.call(S3, n5);
37275
+ return (e4 = j3.onerror) === null || e4 === undefined ? undefined : e4.call(j3, n5);
37186
37276
  }), n4.a(2);
37187
- case 14:
37188
- if (I2 = Array.isArray(e3) ? e3 : [e3], T2 = I2.filter(function(n5) {
37277
+ case 15:
37278
+ if (P2 = Array.isArray(e3) ? e3 : [e3], C2 = P2.filter(function(n5) {
37189
37279
  return "method" in n5 && "id" in n5 && n5.id !== undefined;
37190
- }).length > 0, E2 = v2.headers.get("content-type"), !T2) {
37191
- n4.n = 18;
37280
+ }).length > 0, Z2 = g2.headers.get("content-type"), !C2) {
37281
+ n4.n = 21;
37192
37282
  break;
37193
37283
  }
37194
- if (!(E2 == null ? undefined : E2.includes("text/event-stream"))) {
37195
- n4.n = 15;
37284
+ if (!(Z2 == null ? undefined : Z2.includes("text/event-stream"))) {
37285
+ n4.n = 16;
37196
37286
  break;
37197
37287
  }
37198
- this._handleSseStream(v2.body, { onresumptiontoken: p3 }, false), n4.n = 18;
37288
+ this._handleSseStream(g2.body, { onresumptiontoken: v2 }, false), n4.n = 20;
37199
37289
  break;
37200
- case 15:
37201
- if (!(E2 == null ? undefined : E2.includes("application/json"))) {
37202
- n4.n = 17;
37290
+ case 16:
37291
+ if (!(Z2 == null ? undefined : Z2.includes("application/json"))) {
37292
+ n4.n = 18;
37203
37293
  break;
37204
37294
  }
37205
- return n4.n = 16, v2.json();
37206
- case 16:
37207
- P2 = n4.v, Z2 = Array.isArray(P2) ? P2.map(function(n5) {
37208
- return Zo.parse(n5);
37209
- }) : [Zo.parse(P2)], C2 = a(Z2);
37295
+ return n4.n = 17, g2.json();
37296
+ case 17:
37297
+ A2 = n4.v, R2 = Array.isArray(A2) ? A2.map(function(n5) {
37298
+ return No.parse(n5);
37299
+ }) : [No.parse(A2)], U2 = a(R2);
37210
37300
  try {
37211
- for (C2.s();!(A2 = C2.n()).done; )
37212
- U2 = A2.value, (u3 = this.onmessage) === null || u3 === undefined || u3.call(this, U2);
37301
+ for (U2.s();!(S3 = U2.n()).done; )
37302
+ O3 = S3.value, (s2 = this.onmessage) === null || s2 === undefined || s2.call(this, O3);
37213
37303
  } catch (n5) {
37214
- C2.e(n5);
37304
+ U2.e(n5);
37215
37305
  } finally {
37216
- C2.f();
37306
+ U2.f();
37217
37307
  }
37218
- n4.n = 18;
37219
- break;
37220
- case 17:
37221
- throw new Gu(-1, "Unexpected content type: ".concat(E2));
37222
- case 18:
37223
37308
  n4.n = 20;
37224
37309
  break;
37310
+ case 18:
37311
+ return n4.n = 19, (l2 = g2.body) === null || l2 === undefined ? undefined : l2.cancel();
37225
37312
  case 19:
37226
- throw n4.p = 19, R2 = n4.v, (s2 = this.onerror) === null || s2 === undefined || s2.call(this, R2), R2;
37313
+ throw new bs(-1, "Unexpected content type: ".concat(Z2));
37227
37314
  case 20:
37315
+ n4.n = 22;
37316
+ break;
37317
+ case 21:
37318
+ return n4.n = 22, (d3 = g2.body) === null || d3 === undefined ? undefined : d3.cancel();
37319
+ case 22:
37320
+ n4.n = 24;
37321
+ break;
37322
+ case 23:
37323
+ throw n4.p = 23, $2 = n4.v, (p3 = this.onerror) === null || p3 === undefined || p3.call(this, $2), $2;
37324
+ case 24:
37228
37325
  return n4.a(2);
37229
37326
  }
37230
- }, n, this, [[0, 19]]);
37327
+ }, n, this, [[0, 23]]);
37231
37328
  })), function(n4, e3) {
37232
37329
  return t2.apply(this, arguments);
37233
37330
  }) }, { key: "sessionId", get: function() {
37234
37331
  return this._sessionId;
37235
37332
  } }, { key: "terminateSession", value: (e2 = e(v().m(function n() {
37236
- var e3, t3, r3, i2, u3, s2, c2;
37333
+ var e3, t3, r3, i2, u3, s2, c2, l2;
37237
37334
  return v().w(function(n4) {
37238
37335
  for (;; )
37239
37336
  switch (n4.p = n4.n) {
@@ -37246,22 +37343,24 @@ var Ju = function() {
37246
37343
  case 1:
37247
37344
  return n4.p = 1, n4.n = 2, this._commonHeaders();
37248
37345
  case 2:
37249
- return i2 = n4.v, u3 = b(b({}, this._requestInit), {}, { method: "DELETE", headers: i2, signal: (e3 = this._abortController) === null || e3 === undefined ? undefined : e3.signal }), n4.n = 3, ((t3 = this._fetch) !== null && t3 !== undefined ? t3 : fetch)(this._url, u3);
37346
+ return u3 = n4.v, s2 = b(b({}, this._requestInit), {}, { method: "DELETE", headers: u3, signal: (e3 = this._abortController) === null || e3 === undefined ? undefined : e3.signal }), n4.n = 3, ((t3 = this._fetch) !== null && t3 !== undefined ? t3 : fetch)(this._url, s2);
37250
37347
  case 3:
37251
- if ((s2 = n4.v).ok || s2.status === 405) {
37252
- n4.n = 4;
37348
+ return c2 = n4.v, n4.n = 4, (r3 = c2.body) === null || r3 === undefined ? undefined : r3.cancel();
37349
+ case 4:
37350
+ if (c2.ok || c2.status === 405) {
37351
+ n4.n = 5;
37253
37352
  break;
37254
37353
  }
37255
- throw new Gu(s2.status, "Failed to terminate session: ".concat(s2.statusText));
37256
- case 4:
37257
- this._sessionId = undefined, n4.n = 6;
37258
- break;
37354
+ throw new bs(c2.status, "Failed to terminate session: ".concat(c2.statusText));
37259
37355
  case 5:
37260
- throw n4.p = 5, c2 = n4.v, (r3 = this.onerror) === null || r3 === undefined || r3.call(this, c2), c2;
37356
+ this._sessionId = undefined, n4.n = 7;
37357
+ break;
37261
37358
  case 6:
37359
+ throw n4.p = 6, l2 = n4.v, (i2 = this.onerror) === null || i2 === undefined || i2.call(this, l2), l2;
37360
+ case 7:
37262
37361
  return n4.a(2);
37263
37362
  }
37264
- }, n, this, [[1, 5]]);
37363
+ }, n, this, [[1, 6]]);
37265
37364
  })), function() {
37266
37365
  return e2.apply(this, arguments);
37267
37366
  }) }, { key: "setProtocolVersion", value: function(n4) {
@@ -37283,36 +37382,36 @@ var Ju = function() {
37283
37382
  }) }]);
37284
37383
  var n3, e2, t2, r2, u2, d2, p2, f2, h2;
37285
37384
  }();
37286
- var Ku;
37287
- var Yu;
37288
- var Xu;
37289
- async function Qu(n3, o2, i2, a2, u2) {
37385
+ var xs;
37386
+ var Is;
37387
+ var Ts;
37388
+ async function Es(n3, o2, i2, a2, u2) {
37290
37389
  try {
37291
- if (!Ku) {
37292
- const e2 = new Ju(new URL(n3 || "http://localhost:3000/mcp"));
37293
- Ku = await createMCPClient({ transport: e2 });
37390
+ if (!xs) {
37391
+ const e2 = new zs(new URL(n3 || "http://localhost:3000/mcp"));
37392
+ xs = await createMCPClient({ transport: e2 });
37294
37393
  }
37295
- if (!Yu)
37394
+ if (!Is)
37296
37395
  switch (o2) {
37297
37396
  case "openai":
37298
37397
  const n4 = createOpenAI({ apiKey: a2 });
37299
- Yu = n4(i2);
37398
+ Is = n4(i2);
37300
37399
  break;
37301
37400
  case "anthropic":
37302
37401
  const e2 = createAnthropic({ apiKey: a2 });
37303
- Yu = e2(i2);
37402
+ Is = e2(i2);
37304
37403
  break;
37305
37404
  default:
37306
37405
  throw new Error("Invalid AI provider");
37307
37406
  }
37308
- Xu || (Xu = await Ku.tools());
37309
- return (await streamText({ model: Yu, tools: Xu, stopWhen: stepCountIs(5), messages: [{ role: "user", content: [{ type: "text", text: u2 }] }] })).textStream;
37407
+ Ts || (Ts = await xs.tools());
37408
+ return (await streamText({ model: Is, tools: Ts, stopWhen: stepCountIs(5), messages: [{ role: "user", content: [{ type: "text", text: u2 }] }] })).textStream;
37310
37409
  } catch (n4) {
37311
37410
  throw console.error(n4), n4;
37312
37411
  }
37313
37412
  }
37314
37413
 
37315
- class ns {
37414
+ class Ps {
37316
37415
  constructor(n3) {
37317
37416
  this.config = n3, this.corsHeaders = n3.corsHeaders || { "Access-Control-Allow-Origin": "*", "Access-Control-Allow-Headers": "Content-Type", "Access-Control-Allow-Methods": "POST, OPTIONS" };
37318
37417
  }
@@ -37320,7 +37419,7 @@ class ns {
37320
37419
  return { mcpUrl: n2.MCP_URL || "", aiProvider: n2.AI_PROVIDER || "", aiModel: n2.AI_MODEL || "", aiToken: n2.AI_TOKEN || "" };
37321
37420
  }
37322
37421
  static New(n3) {
37323
- const e2 = new ns(n3);
37422
+ const e2 = new Ps(n3);
37324
37423
  return (n4) => e2.handle(n4);
37325
37424
  }
37326
37425
  async handle(e2) {
@@ -37332,7 +37431,7 @@ class ns {
37332
37431
  const t2 = (await e2.json()).prompt;
37333
37432
  if (!t2)
37334
37433
  return this.error(400, "Missing prompt");
37335
- const r2 = [this.config.mcpUrl || n2.MCP_URL || "", this.config.aiProvider || n2.AI_PROVIDER || "", this.config.aiModel || n2.AI_MODEL || "", this.config.aiToken || n2.AI_TOKEN || "", t2], o2 = await Qu(r2[0], r2[1], r2[2], r2[3], r2[4]), i2 = new TextEncoder, a2 = new ReadableStream({ async start(n3) {
37434
+ const r2 = [this.config.mcpUrl || n2.MCP_URL || "", this.config.aiProvider || n2.AI_PROVIDER || "", this.config.aiModel || n2.AI_MODEL || "", this.config.aiToken || n2.AI_TOKEN || "", t2], o2 = await Es(r2[0], r2[1], r2[2], r2[3], r2[4]), i2 = new TextEncoder, a2 = new ReadableStream({ async start(n3) {
37336
37435
  try {
37337
37436
  for await (const e3 of o2)
37338
37437
  n3.enqueue(i2.encode(e3));
@@ -37351,12 +37450,12 @@ class ns {
37351
37450
  return console.error("Error:", { status: n3, message: e2 }), new Response(JSON.stringify({ error: e2 }), { status: n3, headers: { ...this.corsHeaders, "Content-Type": "application/json" } });
37352
37451
  }
37353
37452
  }
37354
- function es(n3) {
37453
+ function Cs(n3) {
37355
37454
  if (n3 instanceof Request) {
37356
- return ns.New({ ...ns.defaultConfig() })(n3);
37455
+ return Ps.New({ ...Ps.defaultConfig() })(n3);
37357
37456
  }
37358
- return ns.New(n3);
37457
+ return Ps.New(n3);
37359
37458
  }
37360
37459
  export {
37361
- es as handler
37460
+ Cs as handler
37362
37461
  };