bc-telemetry-buddy-mcp 3.4.0 → 3.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [3.4.1] - 2026-06-01
11
+
12
+ _Highest blast-radius rating across all plans landed in this release: `low-risk`._
13
+
14
+ ### Fixed
15
+ - **`bctb-setup-write-config` crashed with a raw ENOENT stack trace when `--folder` pointed at a non-existent directory.** It now validates the target folder up front (`validateTargetFolder`, unit-tested) and exits with a clear message — `Target folder does not exist: <path>` — instead of an unhandled `fs.writeFileSync` error.
16
+
10
17
  ## [3.4.0] - 2026-06-01
11
18
 
12
19
  _Highest blast-radius rating across all plans landed in this release: `low-risk`._
package/dist/cli.js CHANGED
@@ -100,7 +100,7 @@ To skip this manual step in future, set \`BCTB_GITHUB_TOKEN\` in your environmen
100
100
  `),new Error("BCTB_WORKSPACE_PATH environment variable is required");return{connectionName:process.env.BCTB_CONNECTION_NAME||"Default",tenantId:process.env.BCTB_TENANT_ID||"",clientId:process.env.BCTB_CLIENT_ID,clientSecret:process.env.BCTB_CLIENT_SECRET,authFlow:process.env.BCTB_AUTH_FLOW||"azure_cli",applicationInsightsAppId:process.env.BCTB_APP_INSIGHTS_ID||"",kustoClusterUrl:process.env.BCTB_KUSTO_URL||"",cacheEnabled:process.env.BCTB_CACHE_ENABLED!=="false",cacheTTLSeconds:parseInt(process.env.BCTB_CACHE_TTL||"3600",10),removePII:process.env.BCTB_REMOVE_PII==="true",port:parseInt(process.env.BCTB_PORT||"52345",10),workspacePath:n,queriesFolder:process.env.BCTB_QUERIES_FOLDER||"queries",references:Rlr(process.env.BCTB_REFERENCES||"[]")}}function Rlr(n){try{let e=JSON.parse(n);return Array.isArray(e)?e:[]}catch(e){return console.error("Failed to parse references:",e),[]}}function y8e(n,e,i=new Set){if(i.has(e))throw new Error(`Circular profile inheritance detected: ${e}`);i.add(e);let s=n[e];if(!s)throw new Error(`Profile '${e}' not found`);if(!s.extends)return s3(s);let o=y8e(n,s.extends,i),c=g8e(o,s);return delete c.extends,s3(c)}function g8e(n,e){let i={...n};for(let s in e)s!=="extends"&&(typeof e[s]=="object"&&!Array.isArray(e[s])&&e[s]!==null?i[s]=g8e(n[s]||{},e[s]):i[s]=e[s]);return i}function s3(n){let e=Array.isArray(n)?[]:{};for(let i in n){let s=n[i];typeof s=="string"?e[i]=s.replace(/\$\{([^}]+)\}/g,(o,c)=>process.env[c]||""):typeof s=="object"&&s!==null?e[i]=s3(s):e[i]=s}return e}function Nlr(n){let e=[];return n.authFlow!=="azure_cli"&&n.authFlow!=="vscode_auth"&&!n.tenantId&&e.push("BCTB_TENANT_ID is required (unless using azure_cli or vscode_auth auth flow)"),n.applicationInsightsAppId||e.push("BCTB_APP_INSIGHTS_ID is required"),n.kustoClusterUrl||e.push("BCTB_KUSTO_URL is required"),n.authFlow==="client_credentials"&&!n.clientId&&e.push("BCTB_CLIENT_ID is required for client_credentials auth flow"),n.authFlow==="client_credentials"&&!n.clientSecret&&e.push("BCTB_CLIENT_SECRET is required for client_credentials auth flow"),e.length>0&&(console.error(`
101
101
  \u26A0\uFE0F Configuration Incomplete:`),e.forEach(i=>console.error(` - ${i}`)),console.error(`
102
102
  Server will start but queries will fail until configuration is complete.`),console.error(`Run "BC Telemetry Buddy: Setup Wizard" from Command Palette to configure.
103
- `)),e}});var mC=f(Mn=>{"use strict";var wlr=Mn&&Mn.__createBinding||(Object.create?(function(n,e,i,s){s===void 0&&(s=i);var o=Object.getOwnPropertyDescriptor(e,i);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(n,s,o)}):(function(n,e,i,s){s===void 0&&(s=i),n[s]=e[i]})),Rp=Mn&&Mn.__exportStar||function(n,e){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(e,i)&&wlr(e,n,i)};Object.defineProperty(Mn,"__esModule",{value:!0});Mn.expandEnvironmentVariables=Mn.resolveProfileInheritance=Mn.validateConfig=Mn.loadConfig=Mn.TELEMETRY_CONNECTION_STRING=void 0;Rp(wze(),Mn);Rp(WGe(),Mn);Rp(JGe(),Mn);Rp(XGe(),Mn);Rp(o8e(),Mn);Rp(l8e(),Mn);Rp(d8e(),Mn);Rp(h8e(),Mn);Rp(ipe(),Mn);Rp(tpe(),Mn);Rp(Jue(),Mn);var Ilr=m8e();Object.defineProperty(Mn,"TELEMETRY_CONNECTION_STRING",{enumerable:!0,get:function(){return Ilr.TELEMETRY_CONNECTION_STRING}});var c3=v8e();Object.defineProperty(Mn,"loadConfig",{enumerable:!0,get:function(){return c3.loadConfig}});Object.defineProperty(Mn,"validateConfig",{enumerable:!0,get:function(){return c3.validateConfig}});Object.defineProperty(Mn,"resolveProfileInheritance",{enumerable:!0,get:function(){return c3.resolveProfileInheritance}});Object.defineProperty(Mn,"expandEnvironmentVariables",{enumerable:!0,get:function(){return c3.expandEnvironmentVariables}})});var oi,yC=L(()=>{"use strict";oi="3.4.0"});var u3,mpe=L(()=>{"use strict";u3=`# BC Telemetry Buddy \u2014 Connection Setup
103
+ `)),e}});var mC=f(Mn=>{"use strict";var wlr=Mn&&Mn.__createBinding||(Object.create?(function(n,e,i,s){s===void 0&&(s=i);var o=Object.getOwnPropertyDescriptor(e,i);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(n,s,o)}):(function(n,e,i,s){s===void 0&&(s=i),n[s]=e[i]})),Rp=Mn&&Mn.__exportStar||function(n,e){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(e,i)&&wlr(e,n,i)};Object.defineProperty(Mn,"__esModule",{value:!0});Mn.expandEnvironmentVariables=Mn.resolveProfileInheritance=Mn.validateConfig=Mn.loadConfig=Mn.TELEMETRY_CONNECTION_STRING=void 0;Rp(wze(),Mn);Rp(WGe(),Mn);Rp(JGe(),Mn);Rp(XGe(),Mn);Rp(o8e(),Mn);Rp(l8e(),Mn);Rp(d8e(),Mn);Rp(h8e(),Mn);Rp(ipe(),Mn);Rp(tpe(),Mn);Rp(Jue(),Mn);var Ilr=m8e();Object.defineProperty(Mn,"TELEMETRY_CONNECTION_STRING",{enumerable:!0,get:function(){return Ilr.TELEMETRY_CONNECTION_STRING}});var c3=v8e();Object.defineProperty(Mn,"loadConfig",{enumerable:!0,get:function(){return c3.loadConfig}});Object.defineProperty(Mn,"validateConfig",{enumerable:!0,get:function(){return c3.validateConfig}});Object.defineProperty(Mn,"resolveProfileInheritance",{enumerable:!0,get:function(){return c3.resolveProfileInheritance}});Object.defineProperty(Mn,"expandEnvironmentVariables",{enumerable:!0,get:function(){return c3.expandEnvironmentVariables}})});var oi,yC=L(()=>{"use strict";oi="3.4.1"});var u3,mpe=L(()=>{"use strict";u3=`# BC Telemetry Buddy \u2014 Connection Setup
104
104
 
105
105
  You are helping the user set up a connection to their Microsoft Dynamics 365 Business Central telemetry (Azure Application Insights). Follow these steps **in order**. After each step, briefly tell the user what you did and what is next.
106
106
 
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var k=Object.create;var g=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var R=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty;var b=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of _(t))!S.call(e,i)&&i!==n&&g(e,i,{get:()=>t[i],enumerable:!(o=A(t,i))||o.enumerable});return e};var h=(e,t,n)=>(n=e!=null?k(R(e)):{},b(t||!e||!e.__esModule?g(n,"default",{value:e,enumerable:!0}):n,e));var l=h(require("fs")),P=h(require("path"));var f="https://raw.githubusercontent.com/waldo1001/waldo.BCTelemetryBuddy/main/packages/mcp/config-schema.json",C="00000000-0000-0000-0000-000000000000",L="https://api.applicationinsights.io";function I(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function $(e){let t={connectionName:e.connectionName,authFlow:e.authFlow,tenantId:e.tenantId||C,applicationInsightsAppId:e.applicationInsightsAppId,kustoClusterUrl:e.kustoClusterUrl||L,cacheEnabled:!0,cacheTTLSeconds:3600,removePII:!1,workspacePath:"${workspaceFolder}",queriesFolder:"queries",references:[]};return e.clientId&&(t.clientId=e.clientId),t}var w=["connectionName","authFlow","tenantId","clientId","clientSecret","applicationInsightsAppId","kustoClusterUrl","cacheEnabled","cacheTTLSeconds","removePII","port","workspacePath","queriesFolder"];function x(e){let t={};for(let n of w)e[n]!==void 0&&(t[n]=e[n]);return e.references!==void 0&&(t.references=e.references),t}function N(e,t){let n=$(t);if(!e||e.trim()===""){if(t.profileName){let c={$schema:f,defaultProfile:t.profileName,profiles:{[t.profileName]:n}};return{content:d(c),mode:"created",profileName:t.profileName}}let r={$schema:f,...n};return{content:d(r),mode:"created"}}let o=JSON.parse(e),i=t.profileName||I(t.connectionName),s=o.profiles&&typeof o.profiles=="object";if(!!t.profileName||s){let r={...o};if(r.$schema||(r.$schema=f),s)r.profiles={...o.profiles};else{let c=o.connectionName?I(o.connectionName):"default",m=x(o);r.profiles={[c]:m},r.defaultProfile=r.defaultProfile||c;for(let y of[...w,"references"])delete r[y]}return r.profiles[i]=n,r.defaultProfile||(r.defaultProfile=i),{content:d(r),mode:"merged-profile",profileName:i}}let u={...o,$schema:o.$schema||f,...n};return{content:d(u),mode:"updated"}}function d(e){return JSON.stringify(e,null,2)+`
3
- `}var F=["azure_cli","vscode_auth","device_code","client_credentials"];function U(e){let t={};for(let n=0;n<e.length;n++){let o=e[n];if(o.startsWith("--")){let i=o.slice(2),s=e[n+1]&&!e[n+1].startsWith("--")?e[++n]:"true";t[i]=s}}return t}function p(e){process.stderr.write(`${e}
4
- `),process.exit(1)}function O(){let e=U(process.argv.slice(2)),t=e.folder,n=e.connectionName,o=e.authFlow,i=e.appId;t||p("--folder is required (absolute path to the workspace folder to configure)"),n||p("--connectionName is required"),(!o||!F.includes(o))&&p(`--authFlow is required and must be one of: ${F.join(", ")}`),i||p("--appId is required (Application Insights Application ID)");let s={connectionName:n,authFlow:o,applicationInsightsAppId:i,tenantId:e.tenantId,clientId:e.clientId,profileName:e.profile},a=P.join(t,".bctb-config.json"),u=l.existsSync(a)?l.readFileSync(a,"utf8"):null,{content:r,mode:c,profileName:m}=N(u,s);l.writeFileSync(a,r,"utf8"),process.stdout.write(JSON.stringify({filePath:a,mode:c,profileName:m},null,2)+`
5
- `)}O();
2
+ "use strict";var A=Object.create;var h=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,R=Object.prototype.hasOwnProperty;var b=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of _(t))!R.call(e,i)&&i!==o&&h(e,i,{get:()=>t[i],enumerable:!(n=S(t,i))||n.enumerable});return e};var I=(e,t,o)=>(o=e!=null?A(x(e)):{},b(t||!e||!e.__esModule?h(o,"default",{value:e,enumerable:!0}):o,e));var s=I(require("fs")),k=I(require("path"));var d="https://raw.githubusercontent.com/waldo1001/waldo.BCTelemetryBuddy/main/packages/mcp/config-schema.json",L="00000000-0000-0000-0000-000000000000",T="https://api.applicationinsights.io";function w(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function $(e){let t={connectionName:e.connectionName,authFlow:e.authFlow,tenantId:e.tenantId||L,applicationInsightsAppId:e.applicationInsightsAppId,kustoClusterUrl:e.kustoClusterUrl||T,cacheEnabled:!0,cacheTTLSeconds:3600,removePII:!1,workspacePath:"${workspaceFolder}",queriesFolder:"queries",references:[]};return e.clientId&&(t.clientId=e.clientId),t}var F=["connectionName","authFlow","tenantId","clientId","clientSecret","applicationInsightsAppId","kustoClusterUrl","cacheEnabled","cacheTTLSeconds","removePII","port","workspacePath","queriesFolder"];function C(e){let t={};for(let o of F)e[o]!==void 0&&(t[o]=e[o]);return e.references!==void 0&&(t.references=e.references),t}function N(e,t){let o=$(t);if(!e||e.trim()===""){if(t.profileName){let a={$schema:d,defaultProfile:t.profileName,profiles:{[t.profileName]:o}};return{content:p(a),mode:"created",profileName:t.profileName}}let r={$schema:d,...o};return{content:p(r),mode:"created"}}let n=JSON.parse(e),i=t.profileName||w(t.connectionName),c=n.profiles&&typeof n.profiles=="object";if(!!t.profileName||c){let r={...n};if(r.$schema||(r.$schema=d),c)r.profiles={...n.profiles};else{let a=n.connectionName?w(n.connectionName):"default",g=C(n);r.profiles={[a]:g},r.defaultProfile=r.defaultProfile||a;for(let m of[...F,"references"])delete r[m]}return r.profiles[i]=o,r.defaultProfile||(r.defaultProfile=i),{content:p(r),mode:"merged-profile",profileName:i}}let u={...n,$schema:n.$schema||d,...o};return{content:p(u),mode:"updated"}}function p(e){return JSON.stringify(e,null,2)+`
3
+ `}function y(e,t){if(!t.existsSync(e))throw new Error(`Target folder does not exist: ${e}
4
+ Pass --folder pointing at an existing workspace folder (create it first if needed).`);if(!t.statSync(e).isDirectory())throw new Error(`Target path is not a directory: ${e}`)}var P=["azure_cli","vscode_auth","device_code","client_credentials"];function E(e){let t={};for(let o=0;o<e.length;o++){let n=e[o];if(n.startsWith("--")){let i=n.slice(2),c=e[o+1]&&!e[o+1].startsWith("--")?e[++o]:"true";t[i]=c}}return t}function f(e){process.stderr.write(`${e}
5
+ `),process.exit(1)}function v(){let e=E(process.argv.slice(2)),t=e.folder,o=e.connectionName,n=e.authFlow,i=e.appId;t||f("--folder is required (absolute path to the workspace folder to configure)"),o||f("--connectionName is required"),(!n||!P.includes(n))&&f(`--authFlow is required and must be one of: ${P.join(", ")}`),i||f("--appId is required (Application Insights Application ID)");try{y(t,s)}catch(m){f(m.message)}let c={connectionName:o,authFlow:n,applicationInsightsAppId:i,tenantId:e.tenantId,clientId:e.clientId,profileName:e.profile},l=k.join(t,".bctb-config.json"),u=s.existsSync(l)?s.readFileSync(l,"utf8"):null,{content:r,mode:a,profileName:g}=N(u,c);s.writeFileSync(l,r,"utf8"),process.stdout.write(JSON.stringify({filePath:l,mode:a,profileName:g},null,2)+`
6
+ `)}v();
6
7
  //# sourceMappingURL=write-config.js.map
package/dist/server.js CHANGED
@@ -269,7 +269,7 @@ Server will start but queries will fail until configuration is complete.`),conso
269
269
  Searched locations:`),process.env.BCTB_WORKSPACE_PATH&&console.error(` - ${Nd.join(process.env.BCTB_WORKSPACE_PATH,".bctb-config.json")} (workspace)`),console.error(` - ${Nd.join(wI.homedir(),".bctb","config.json")} (home directory)`),console.error(` - ${Nd.join(wI.homedir(),".bctb-config.json")} (home directory)`),console.error(`
270
270
  To create a config file, run:
271
271
  node path/to/mcp/dist/cli.js init
272
- `),null;i||(console.error(`\u{1F4C4} Loading config from: ${s}`),console.error(`[Config] BCTB_WORKSPACE_PATH env var = ${process.env.BCTB_WORKSPACE_PATH||"(not set)"}`));let c=Mh.readFileSync(s,"utf-8"),r=JSON.parse(c);if(r.profiles){let a=e||process.env.BCTB_PROFILE||r.defaultProfile;if(!a)throw new Error("No profile specified. Use --profile <name> or set BCTB_PROFILE env var");if(!r.profiles[a])throw new Error(`Profile '${a}' not found in config`);console.error(`\u{1F4CB} Using profile: "${a}"`);let u=nze(r.profiles,a),l={...u,cacheEnabled:u.cacheEnabled??r.cache?.enabled??!0,cacheTTLSeconds:u.cacheTTLSeconds??r.cache?.ttlSeconds??3600,removePII:u.removePII??r.sanitize?.removePII??!1,references:u.references??r.references??[],port:u.port??52345,workspacePath:u.workspacePath??process.env.BCTB_WORKSPACE_PATH??process.cwd(),queriesFolder:u.queriesFolder??"queries",connectionName:u.connectionName??"Default",tenantId:u.tenantId??"",authFlow:u.authFlow??"azure_cli",applicationInsightsAppId:u.applicationInsightsAppId??"",kustoClusterUrl:u.kustoClusterUrl??"",configFilePath:s};return qj(l)}let t={connectionName:r.connectionName??"Default",tenantId:r.tenantId??"",clientId:r.clientId,clientSecret:r.clientSecret,authFlow:r.authFlow??"azure_cli",applicationInsightsAppId:r.applicationInsightsAppId??"",kustoClusterUrl:r.kustoClusterUrl??"",cacheEnabled:r.cacheEnabled??!0,cacheTTLSeconds:r.cacheTTLSeconds??3600,removePII:r.removePII??!1,port:r.port??52345,workspacePath:r.workspacePath??process.env.BCTB_WORKSPACE_PATH??process.cwd(),queriesFolder:r.queriesFolder??"queries",references:r.references??[],configFilePath:s};return qj(t)}function nze(n,e,i=new Set){if(i.has(e))throw new Error(`Circular profile inheritance detected: ${e}`);i.add(e);let s=n[e];if(!s)throw new Error(`Profile '${e}' not found`);if(!s.extends)return s;let o=nze(n,s.extends,i),c=ize(o,s);return delete c.extends,c}function ize(n,e){let i={...n};for(let s in e)s!=="extends"&&(typeof e[s]=="object"&&!Array.isArray(e[s])&&e[s]!==null?i[s]=ize(n[s]||{},e[s]):i[s]=e[s]);return i}function qj(n){if(typeof n=="string")return n.replace(/\$\{([^}]+)\}/g,(e,i)=>{if(i==="workspaceFolder"){let s=process.env.BCTB_WORKSPACE_PATH||process.cwd();return console.error(`[Config] Expanding \${workspaceFolder} to: ${s}`),s}return process.env[i]||""});if(Array.isArray(n))return n.map(e=>qj(e));if(typeof n=="object"&&n!==null){let e={};for(let i in n)e[i]=qj(n[i]);return e}return n}var Xt=Te(H3());var bi="3.4.0";var j8t=Te(require("https"));var hR=Te(OFt()),us=Te(require("fs")),oU=Te(require("path")),AFt=Te(require("crypto")),PFt=Te(require("os")),F1e=class{client;constructor(e,i,s){hR.setup(e).setAutoCollectRequests(!1).setAutoCollectPerformance(!1,!1).setAutoCollectExceptions(!1).setAutoCollectDependencies(!1).setAutoCollectConsole(!1).setUseDiskRetryCaching(!0),hR.start(),this.client=hR.defaultClient,this.client.commonProperties={installationId:i,version:s,component:"MCP"}}trackEvent(e,i,s){let o={};if(i)for(let[c,r]of Object.entries(i))o[c]=String(r);this.client.trackEvent({name:e,properties:o,measurements:s})}trackException(e,i){this.client.trackException({exception:e,properties:{errorName:e.name,errorMessage:e.message,...i}})}trackDependency(e,i,s,o,c,r){this.client.trackDependency({name:e,data:i,duration:s,success:o,resultCode:c||(o?"200":"500"),dependencyTypeName:"External",properties:r})}trackTrace(e,i){this.client.trackTrace({message:e,properties:i})}async flush(){return new Promise(e=>{this.client.flush(),setTimeout(e,2e3)})}},RFt=".bctb-installation-id",qRn=".bctb",jRn="installation-id";function BRn(){let n=PFt.homedir();return oU.join(n,qRn)}function aU(n){let e=BRn(),i=oU.join(e,jRn);try{if(us.existsSync(i)){let c=us.readFileSync(i,"utf8").trim();if(c)return VRn(n),c}}catch{}let s=oU.join(n,RFt);try{if(us.existsSync(s)){let c=us.readFileSync(s,"utf8").trim();if(c)return xFt(e),us.writeFileSync(i,c,"utf8"),us.unlinkSync(s),c}}catch(c){console.error(`Failed to migrate workspace installation ID: ${c}`)}let o=AFt.randomUUID();try{xFt(e),us.writeFileSync(i,o,"utf8")}catch(c){console.error(`Failed to write installation ID file: ${c}`)}return o}function xFt(n){us.existsSync(n)||us.mkdirSync(n,{recursive:!0})}function VRn(n){let e=oU.join(n,RFt);try{us.existsSync(e)&&us.unlinkSync(e)}catch{}}function Mte(n,e,i){if(!n||n.trim()==="")return null;try{let s=aU(e);return new F1e(n,s,i)}catch(s){return console.error(`Failed to initialize MCP usage telemetry: ${s}`),null}}var h2e=Te(require("crypto"));var kr;(function(n){n.assertEqual=o=>{};function e(o){}n.assertIs=e;function i(o){throw new Error}n.assertNever=i,n.arrayToEnum=o=>{let c={};for(let r of o)c[r]=r;return c},n.getValidEnumValues=o=>{let c=n.objectKeys(o).filter(t=>typeof o[o[t]]!="number"),r={};for(let t of c)r[t]=o[t];return n.objectValues(r)},n.objectValues=o=>n.objectKeys(o).map(function(c){return o[c]}),n.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let c=[];for(let r in o)Object.prototype.hasOwnProperty.call(o,r)&&c.push(r);return c},n.find=(o,c)=>{for(let r of o)if(c(r))return r},n.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function s(o,c=" | "){return o.map(r=>typeof r=="string"?`'${r}'`:r).join(c)}n.joinValues=s,n.jsonStringifyReplacer=(o,c)=>typeof c=="bigint"?c.toString():c})(kr||(kr={}));var NFt;(function(n){n.mergeShapes=(e,i)=>({...e,...i})})(NFt||(NFt={}));var Xe=kr.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),qm=n=>{switch(typeof n){case"undefined":return Xe.undefined;case"string":return Xe.string;case"number":return Number.isNaN(n)?Xe.nan:Xe.number;case"boolean":return Xe.boolean;case"function":return Xe.function;case"bigint":return Xe.bigint;case"symbol":return Xe.symbol;case"object":return Array.isArray(n)?Xe.array:n===null?Xe.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?Xe.promise:typeof Map<"u"&&n instanceof Map?Xe.map:typeof Set<"u"&&n instanceof Set?Xe.set:typeof Date<"u"&&n instanceof Date?Xe.date:Xe.object;default:return Xe.unknown}};var Oe=kr.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);var fu=class n extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};let i=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,i):this.__proto__=i,this.name="ZodError",this.issues=e}format(e){let i=e||function(c){return c.message},s={_errors:[]},o=c=>{for(let r of c.issues)if(r.code==="invalid_union")r.unionErrors.map(o);else if(r.code==="invalid_return_type")o(r.returnTypeError);else if(r.code==="invalid_arguments")o(r.argumentsError);else if(r.path.length===0)s._errors.push(i(r));else{let t=s,a=0;for(;a<r.path.length;){let u=r.path[a];a===r.path.length-1?(t[u]=t[u]||{_errors:[]},t[u]._errors.push(i(r))):t[u]=t[u]||{_errors:[]},t=t[u],a++}}};return o(this),s}static assert(e){if(!(e instanceof n))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,kr.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=i=>i.message){let i=Object.create(null),s=[];for(let o of this.issues)if(o.path.length>0){let c=o.path[0];i[c]=i[c]||[],i[c].push(e(o))}else s.push(e(o));return{formErrors:s,fieldErrors:i}}get formErrors(){return this.flatten()}};fu.create=n=>new fu(n);var FRn=(n,e)=>{let i;switch(n.code){case Oe.invalid_type:n.received===Xe.undefined?i="Required":i=`Expected ${n.expected}, received ${n.received}`;break;case Oe.invalid_literal:i=`Invalid literal value, expected ${JSON.stringify(n.expected,kr.jsonStringifyReplacer)}`;break;case Oe.unrecognized_keys:i=`Unrecognized key(s) in object: ${kr.joinValues(n.keys,", ")}`;break;case Oe.invalid_union:i="Invalid input";break;case Oe.invalid_union_discriminator:i=`Invalid discriminator value. Expected ${kr.joinValues(n.options)}`;break;case Oe.invalid_enum_value:i=`Invalid enum value. Expected ${kr.joinValues(n.options)}, received '${n.received}'`;break;case Oe.invalid_arguments:i="Invalid function arguments";break;case Oe.invalid_return_type:i="Invalid function return type";break;case Oe.invalid_date:i="Invalid date";break;case Oe.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(i=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(i=`${i} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?i=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?i=`Invalid input: must end with "${n.validation.endsWith}"`:kr.assertNever(n.validation):n.validation!=="regex"?i=`Invalid ${n.validation}`:i="Invalid";break;case Oe.too_small:n.type==="array"?i=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?i=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?i=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="bigint"?i=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?i=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:i="Invalid input";break;case Oe.too_big:n.type==="array"?i=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?i=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?i=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?i=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?i=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:i="Invalid input";break;case Oe.custom:i="Invalid input";break;case Oe.invalid_intersection_types:i="Intersection results could not be merged";break;case Oe.not_multiple_of:i=`Number must be a multiple of ${n.multipleOf}`;break;case Oe.not_finite:i="Number must be finite";break;default:i=e.defaultError,kr.assertNever(n)}return{message:i}},mv=FRn;var $Rn=mv;function sU(){return $Rn}var Lte=n=>{let{data:e,path:i,errorMaps:s,issueData:o}=n,c=[...i,...o.path||[]],r={...o,path:c};if(o.message!==void 0)return{...o,path:c,message:o.message};let t="",a=s.filter(u=>!!u).slice().reverse();for(let u of a)t=u(r,{data:e,defaultError:t}).message;return{...o,path:c,message:t}};function Ve(n,e){let i=sU(),s=Lte({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,i,i===mv?void 0:mv].filter(o=>!!o)});n.common.issues.push(s)}var ls=class n{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,i){let s=[];for(let o of i){if(o.status==="aborted")return Ct;o.status==="dirty"&&e.dirty(),s.push(o.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,i){let s=[];for(let o of i){let c=await o.key,r=await o.value;s.push({key:c,value:r})}return n.mergeObjectSync(e,s)}static mergeObjectSync(e,i){let s={};for(let o of i){let{key:c,value:r}=o;if(c.status==="aborted"||r.status==="aborted")return Ct;c.status==="dirty"&&e.dirty(),r.status==="dirty"&&e.dirty(),c.value!=="__proto__"&&(typeof r.value<"u"||o.alwaysSet)&&(s[c.value]=r.value)}return{status:e.value,value:s}}},Ct=Object.freeze({status:"aborted"}),mR=n=>({status:"dirty",value:n}),Ds=n=>({status:"valid",value:n}),$1e=n=>n.status==="aborted",z1e=n=>n.status==="dirty",QT=n=>n.status==="valid",cU=n=>typeof Promise<"u"&&n instanceof Promise;var ot;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e?.message})(ot||(ot={}));var Xl=class{constructor(e,i,s,o){this._cachedPath=[],this.parent=e,this.data=i,this._path=s,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},IFt=(n,e)=>{if(QT(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let i=new fu(n.common.issues);return this._error=i,this._error}}};function er(n){if(!n)return{};let{errorMap:e,invalid_type_error:i,required_error:s,description:o}=n;if(e&&(i||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(r,t)=>{let{message:a}=n;return r.code==="invalid_enum_value"?{message:a??t.defaultError}:typeof t.data>"u"?{message:a??s??t.defaultError}:r.code!=="invalid_type"?{message:t.defaultError}:{message:a??i??t.defaultError}},description:o}}var mr=class{get description(){return this._def.description}_getType(e){return qm(e.data)}_getOrReturnCtx(e,i){return i||{common:e.parent.common,data:e.data,parsedType:qm(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ls,ctx:{common:e.parent.common,data:e.data,parsedType:qm(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let i=this._parse(e);if(cU(i))throw new Error("Synchronous parse encountered promise.");return i}_parseAsync(e){let i=this._parse(e);return Promise.resolve(i)}parse(e,i){let s=this.safeParse(e,i);if(s.success)return s.data;throw s.error}safeParse(e,i){let s={common:{issues:[],async:i?.async??!1,contextualErrorMap:i?.errorMap},path:i?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:qm(e)},o=this._parseSync({data:e,path:s.path,parent:s});return IFt(s,o)}"~validate"(e){let i={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:qm(e)};if(!this["~standard"].async)try{let s=this._parseSync({data:e,path:[],parent:i});return QT(s)?{value:s.value}:{issues:i.common.issues}}catch(s){s?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),i.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:i}).then(s=>QT(s)?{value:s.value}:{issues:i.common.issues})}async parseAsync(e,i){let s=await this.safeParseAsync(e,i);if(s.success)return s.data;throw s.error}async safeParseAsync(e,i){let s={common:{issues:[],contextualErrorMap:i?.errorMap,async:!0},path:i?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:qm(e)},o=this._parse({data:e,path:s.path,parent:s}),c=await(cU(o)?o:Promise.resolve(o));return IFt(s,c)}refine(e,i){let s=o=>typeof i=="string"||typeof i>"u"?{message:i}:typeof i=="function"?i(o):i;return this._refinement((o,c)=>{let r=e(o),t=()=>c.addIssue({code:Oe.custom,...s(o)});return typeof Promise<"u"&&r instanceof Promise?r.then(a=>a?!0:(t(),!1)):r?!0:(t(),!1)})}refinement(e,i){return this._refinement((s,o)=>e(s)?!0:(o.addIssue(typeof i=="function"?i(s,o):i),!1))}_refinement(e){return new od({schema:this,typeName:Re.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:i=>this["~validate"](i)}}optional(){return id.create(this,this._def)}nullable(){return Vm.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return gv.create(this)}promise(){return eS.create(this,this._def)}or(e){return bR.create([this,e],this._def)}and(e){return TR.create(this,e,this._def)}transform(e){return new od({...er(this._def),schema:this,typeName:Re.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let i=typeof e=="function"?e:()=>e;return new AR({...er(this._def),innerType:this,defaultValue:i,typeName:Re.ZodDefault})}brand(){return new kte({typeName:Re.ZodBranded,type:this,...er(this._def)})}catch(e){let i=typeof e=="function"?e:()=>e;return new PR({...er(this._def),innerType:this,catchValue:i,typeName:Re.ZodCatch})}describe(e){let i=this.constructor;return new i({...this._def,description:e})}pipe(e){return Dte.create(this,e)}readonly(){return RR.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},zRn=/^c[^\s-]{8,}$/i,HRn=/^[0-9a-z]+$/,GRn=/^[0-9A-HJKMNP-TV-Z]{26}$/i,KRn=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,YRn=/^[a-z0-9_-]{21}$/i,WRn=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,JRn=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,ZRn=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,XRn="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",H1e,QRn=/^(?:(?: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])$/,eNn=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,tNn=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,rNn=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,nNn=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,iNn=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,wFt="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",oNn=new RegExp(`^${wFt}$`);function CFt(n){let e="[0-5]\\d";n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`);let i=n.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${i}`}function aNn(n){return new RegExp(`^${CFt(n)}$`)}function sNn(n){let e=`${wFt}T${CFt(n)}`,i=[];return i.push(n.local?"Z?":"Z"),n.offset&&i.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${i.join("|")})`,new RegExp(`^${e}$`)}function cNn(n,e){return!!((e==="v4"||!e)&&QRn.test(n)||(e==="v6"||!e)&&tNn.test(n))}function uNn(n,e){if(!WRn.test(n))return!1;try{let[i]=n.split(".");if(!i)return!1;let s=i.replace(/-/g,"+").replace(/_/g,"/").padEnd(i.length+(4-i.length%4)%4,"="),o=JSON.parse(atob(s));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function lNn(n,e){return!!((e==="v4"||!e)&&eNn.test(n)||(e==="v6"||!e)&&rNn.test(n))}var gR=class n extends mr{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Xe.string){let c=this._getOrReturnCtx(e);return Ve(c,{code:Oe.invalid_type,expected:Xe.string,received:c.parsedType}),Ct}let s=new ls,o;for(let c of this._def.checks)if(c.kind==="min")e.data.length<c.value&&(o=this._getOrReturnCtx(e,o),Ve(o,{code:Oe.too_small,minimum:c.value,type:"string",inclusive:!0,exact:!1,message:c.message}),s.dirty());else if(c.kind==="max")e.data.length>c.value&&(o=this._getOrReturnCtx(e,o),Ve(o,{code:Oe.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!1,message:c.message}),s.dirty());else if(c.kind==="length"){let r=e.data.length>c.value,t=e.data.length<c.value;(r||t)&&(o=this._getOrReturnCtx(e,o),r?Ve(o,{code:Oe.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}):t&&Ve(o,{code:Oe.too_small,minimum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}),s.dirty())}else if(c.kind==="email")ZRn.test(e.data)||(o=this._getOrReturnCtx(e,o),Ve(o,{validation:"email",code:Oe.invalid_string,message:c.message}),s.dirty());else if(c.kind==="emoji")H1e||(H1e=new RegExp(XRn,"u")),H1e.test(e.data)||(o=this._getOrReturnCtx(e,o),Ve(o,{validation:"emoji",code:Oe.invalid_string,message:c.message}),s.dirty());else if(c.kind==="uuid")KRn.test(e.data)||(o=this._getOrReturnCtx(e,o),Ve(o,{validation:"uuid",code:Oe.invalid_string,message:c.message}),s.dirty());else if(c.kind==="nanoid")YRn.test(e.data)||(o=this._getOrReturnCtx(e,o),Ve(o,{validation:"nanoid",code:Oe.invalid_string,message:c.message}),s.dirty());else if(c.kind==="cuid")zRn.test(e.data)||(o=this._getOrReturnCtx(e,o),Ve(o,{validation:"cuid",code:Oe.invalid_string,message:c.message}),s.dirty());else if(c.kind==="cuid2")HRn.test(e.data)||(o=this._getOrReturnCtx(e,o),Ve(o,{validation:"cuid2",code:Oe.invalid_string,message:c.message}),s.dirty());else if(c.kind==="ulid")GRn.test(e.data)||(o=this._getOrReturnCtx(e,o),Ve(o,{validation:"ulid",code:Oe.invalid_string,message:c.message}),s.dirty());else if(c.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),Ve(o,{validation:"url",code:Oe.invalid_string,message:c.message}),s.dirty()}else c.kind==="regex"?(c.regex.lastIndex=0,c.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),Ve(o,{validation:"regex",code:Oe.invalid_string,message:c.message}),s.dirty())):c.kind==="trim"?e.data=e.data.trim():c.kind==="includes"?e.data.includes(c.value,c.position)||(o=this._getOrReturnCtx(e,o),Ve(o,{code:Oe.invalid_string,validation:{includes:c.value,position:c.position},message:c.message}),s.dirty()):c.kind==="toLowerCase"?e.data=e.data.toLowerCase():c.kind==="toUpperCase"?e.data=e.data.toUpperCase():c.kind==="startsWith"?e.data.startsWith(c.value)||(o=this._getOrReturnCtx(e,o),Ve(o,{code:Oe.invalid_string,validation:{startsWith:c.value},message:c.message}),s.dirty()):c.kind==="endsWith"?e.data.endsWith(c.value)||(o=this._getOrReturnCtx(e,o),Ve(o,{code:Oe.invalid_string,validation:{endsWith:c.value},message:c.message}),s.dirty()):c.kind==="datetime"?sNn(c).test(e.data)||(o=this._getOrReturnCtx(e,o),Ve(o,{code:Oe.invalid_string,validation:"datetime",message:c.message}),s.dirty()):c.kind==="date"?oNn.test(e.data)||(o=this._getOrReturnCtx(e,o),Ve(o,{code:Oe.invalid_string,validation:"date",message:c.message}),s.dirty()):c.kind==="time"?aNn(c).test(e.data)||(o=this._getOrReturnCtx(e,o),Ve(o,{code:Oe.invalid_string,validation:"time",message:c.message}),s.dirty()):c.kind==="duration"?JRn.test(e.data)||(o=this._getOrReturnCtx(e,o),Ve(o,{validation:"duration",code:Oe.invalid_string,message:c.message}),s.dirty()):c.kind==="ip"?cNn(e.data,c.version)||(o=this._getOrReturnCtx(e,o),Ve(o,{validation:"ip",code:Oe.invalid_string,message:c.message}),s.dirty()):c.kind==="jwt"?uNn(e.data,c.alg)||(o=this._getOrReturnCtx(e,o),Ve(o,{validation:"jwt",code:Oe.invalid_string,message:c.message}),s.dirty()):c.kind==="cidr"?lNn(e.data,c.version)||(o=this._getOrReturnCtx(e,o),Ve(o,{validation:"cidr",code:Oe.invalid_string,message:c.message}),s.dirty()):c.kind==="base64"?nNn.test(e.data)||(o=this._getOrReturnCtx(e,o),Ve(o,{validation:"base64",code:Oe.invalid_string,message:c.message}),s.dirty()):c.kind==="base64url"?iNn.test(e.data)||(o=this._getOrReturnCtx(e,o),Ve(o,{validation:"base64url",code:Oe.invalid_string,message:c.message}),s.dirty()):kr.assertNever(c);return{status:s.value,value:e.data}}_regex(e,i,s){return this.refinement(o=>e.test(o),{validation:i,code:Oe.invalid_string,...ot.errToObj(s)})}_addCheck(e){return new n({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ot.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ot.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ot.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ot.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ot.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ot.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ot.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ot.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ot.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...ot.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...ot.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ot.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...ot.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...ot.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...ot.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...ot.errToObj(e)})}regex(e,i){return this._addCheck({kind:"regex",regex:e,...ot.errToObj(i)})}includes(e,i){return this._addCheck({kind:"includes",value:e,position:i?.position,...ot.errToObj(i?.message)})}startsWith(e,i){return this._addCheck({kind:"startsWith",value:e,...ot.errToObj(i)})}endsWith(e,i){return this._addCheck({kind:"endsWith",value:e,...ot.errToObj(i)})}min(e,i){return this._addCheck({kind:"min",value:e,...ot.errToObj(i)})}max(e,i){return this._addCheck({kind:"max",value:e,...ot.errToObj(i)})}length(e,i){return this._addCheck({kind:"length",value:e,...ot.errToObj(i)})}nonempty(e){return this.min(1,ot.errToObj(e))}trim(){return new n({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new n({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new n({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let i of this._def.checks)i.kind==="min"&&(e===null||i.value>e)&&(e=i.value);return e}get maxLength(){let e=null;for(let i of this._def.checks)i.kind==="max"&&(e===null||i.value<e)&&(e=i.value);return e}};gR.create=n=>new gR({checks:[],typeName:Re.ZodString,coerce:n?.coerce??!1,...er(n)});function pNn(n,e){let i=(n.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,o=i>s?i:s,c=Number.parseInt(n.toFixed(o).replace(".","")),r=Number.parseInt(e.toFixed(o).replace(".",""));return c%r/10**o}var uU=class n extends mr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Xe.number){let c=this._getOrReturnCtx(e);return Ve(c,{code:Oe.invalid_type,expected:Xe.number,received:c.parsedType}),Ct}let s,o=new ls;for(let c of this._def.checks)c.kind==="int"?kr.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),Ve(s,{code:Oe.invalid_type,expected:"integer",received:"float",message:c.message}),o.dirty()):c.kind==="min"?(c.inclusive?e.data<c.value:e.data<=c.value)&&(s=this._getOrReturnCtx(e,s),Ve(s,{code:Oe.too_small,minimum:c.value,type:"number",inclusive:c.inclusive,exact:!1,message:c.message}),o.dirty()):c.kind==="max"?(c.inclusive?e.data>c.value:e.data>=c.value)&&(s=this._getOrReturnCtx(e,s),Ve(s,{code:Oe.too_big,maximum:c.value,type:"number",inclusive:c.inclusive,exact:!1,message:c.message}),o.dirty()):c.kind==="multipleOf"?pNn(e.data,c.value)!==0&&(s=this._getOrReturnCtx(e,s),Ve(s,{code:Oe.not_multiple_of,multipleOf:c.value,message:c.message}),o.dirty()):c.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),Ve(s,{code:Oe.not_finite,message:c.message}),o.dirty()):kr.assertNever(c);return{status:o.value,value:e.data}}gte(e,i){return this.setLimit("min",e,!0,ot.toString(i))}gt(e,i){return this.setLimit("min",e,!1,ot.toString(i))}lte(e,i){return this.setLimit("max",e,!0,ot.toString(i))}lt(e,i){return this.setLimit("max",e,!1,ot.toString(i))}setLimit(e,i,s,o){return new n({...this._def,checks:[...this._def.checks,{kind:e,value:i,inclusive:s,message:ot.toString(o)}]})}_addCheck(e){return new n({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ot.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ot.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ot.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ot.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ot.toString(e)})}multipleOf(e,i){return this._addCheck({kind:"multipleOf",value:e,message:ot.toString(i)})}finite(e){return this._addCheck({kind:"finite",message:ot.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ot.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ot.toString(e)})}get minValue(){let e=null;for(let i of this._def.checks)i.kind==="min"&&(e===null||i.value>e)&&(e=i.value);return e}get maxValue(){let e=null;for(let i of this._def.checks)i.kind==="max"&&(e===null||i.value<e)&&(e=i.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&kr.isInteger(e.value))}get isFinite(){let e=null,i=null;for(let s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(i===null||s.value>i)&&(i=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(i)&&Number.isFinite(e)}};uU.create=n=>new uU({checks:[],typeName:Re.ZodNumber,coerce:n?.coerce||!1,...er(n)});var lU=class n extends mr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Xe.bigint)return this._getInvalidInput(e);let s,o=new ls;for(let c of this._def.checks)c.kind==="min"?(c.inclusive?e.data<c.value:e.data<=c.value)&&(s=this._getOrReturnCtx(e,s),Ve(s,{code:Oe.too_small,type:"bigint",minimum:c.value,inclusive:c.inclusive,message:c.message}),o.dirty()):c.kind==="max"?(c.inclusive?e.data>c.value:e.data>=c.value)&&(s=this._getOrReturnCtx(e,s),Ve(s,{code:Oe.too_big,type:"bigint",maximum:c.value,inclusive:c.inclusive,message:c.message}),o.dirty()):c.kind==="multipleOf"?e.data%c.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),Ve(s,{code:Oe.not_multiple_of,multipleOf:c.value,message:c.message}),o.dirty()):kr.assertNever(c);return{status:o.value,value:e.data}}_getInvalidInput(e){let i=this._getOrReturnCtx(e);return Ve(i,{code:Oe.invalid_type,expected:Xe.bigint,received:i.parsedType}),Ct}gte(e,i){return this.setLimit("min",e,!0,ot.toString(i))}gt(e,i){return this.setLimit("min",e,!1,ot.toString(i))}lte(e,i){return this.setLimit("max",e,!0,ot.toString(i))}lt(e,i){return this.setLimit("max",e,!1,ot.toString(i))}setLimit(e,i,s,o){return new n({...this._def,checks:[...this._def.checks,{kind:e,value:i,inclusive:s,message:ot.toString(o)}]})}_addCheck(e){return new n({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ot.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ot.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ot.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ot.toString(e)})}multipleOf(e,i){return this._addCheck({kind:"multipleOf",value:e,message:ot.toString(i)})}get minValue(){let e=null;for(let i of this._def.checks)i.kind==="min"&&(e===null||i.value>e)&&(e=i.value);return e}get maxValue(){let e=null;for(let i of this._def.checks)i.kind==="max"&&(e===null||i.value<e)&&(e=i.value);return e}};lU.create=n=>new lU({checks:[],typeName:Re.ZodBigInt,coerce:n?.coerce??!1,...er(n)});var pU=class extends mr{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Xe.boolean){let s=this._getOrReturnCtx(e);return Ve(s,{code:Oe.invalid_type,expected:Xe.boolean,received:s.parsedType}),Ct}return Ds(e.data)}};pU.create=n=>new pU({typeName:Re.ZodBoolean,coerce:n?.coerce||!1,...er(n)});var dU=class n extends mr{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Xe.date){let c=this._getOrReturnCtx(e);return Ve(c,{code:Oe.invalid_type,expected:Xe.date,received:c.parsedType}),Ct}if(Number.isNaN(e.data.getTime())){let c=this._getOrReturnCtx(e);return Ve(c,{code:Oe.invalid_date}),Ct}let s=new ls,o;for(let c of this._def.checks)c.kind==="min"?e.data.getTime()<c.value&&(o=this._getOrReturnCtx(e,o),Ve(o,{code:Oe.too_small,message:c.message,inclusive:!0,exact:!1,minimum:c.value,type:"date"}),s.dirty()):c.kind==="max"?e.data.getTime()>c.value&&(o=this._getOrReturnCtx(e,o),Ve(o,{code:Oe.too_big,message:c.message,inclusive:!0,exact:!1,maximum:c.value,type:"date"}),s.dirty()):kr.assertNever(c);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new n({...this._def,checks:[...this._def.checks,e]})}min(e,i){return this._addCheck({kind:"min",value:e.getTime(),message:ot.toString(i)})}max(e,i){return this._addCheck({kind:"max",value:e.getTime(),message:ot.toString(i)})}get minDate(){let e=null;for(let i of this._def.checks)i.kind==="min"&&(e===null||i.value>e)&&(e=i.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let i of this._def.checks)i.kind==="max"&&(e===null||i.value<e)&&(e=i.value);return e!=null?new Date(e):null}};dU.create=n=>new dU({checks:[],coerce:n?.coerce||!1,typeName:Re.ZodDate,...er(n)});var fU=class extends mr{_parse(e){if(this._getType(e)!==Xe.symbol){let s=this._getOrReturnCtx(e);return Ve(s,{code:Oe.invalid_type,expected:Xe.symbol,received:s.parsedType}),Ct}return Ds(e.data)}};fU.create=n=>new fU({typeName:Re.ZodSymbol,...er(n)});var vR=class extends mr{_parse(e){if(this._getType(e)!==Xe.undefined){let s=this._getOrReturnCtx(e);return Ve(s,{code:Oe.invalid_type,expected:Xe.undefined,received:s.parsedType}),Ct}return Ds(e.data)}};vR.create=n=>new vR({typeName:Re.ZodUndefined,...er(n)});var _R=class extends mr{_parse(e){if(this._getType(e)!==Xe.null){let s=this._getOrReturnCtx(e);return Ve(s,{code:Oe.invalid_type,expected:Xe.null,received:s.parsedType}),Ct}return Ds(e.data)}};_R.create=n=>new _R({typeName:Re.ZodNull,...er(n)});var hU=class extends mr{constructor(){super(...arguments),this._any=!0}_parse(e){return Ds(e.data)}};hU.create=n=>new hU({typeName:Re.ZodAny,...er(n)});var yv=class extends mr{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ds(e.data)}};yv.create=n=>new yv({typeName:Re.ZodUnknown,...er(n)});var bh=class extends mr{_parse(e){let i=this._getOrReturnCtx(e);return Ve(i,{code:Oe.invalid_type,expected:Xe.never,received:i.parsedType}),Ct}};bh.create=n=>new bh({typeName:Re.ZodNever,...er(n)});var mU=class extends mr{_parse(e){if(this._getType(e)!==Xe.undefined){let s=this._getOrReturnCtx(e);return Ve(s,{code:Oe.invalid_type,expected:Xe.void,received:s.parsedType}),Ct}return Ds(e.data)}};mU.create=n=>new mU({typeName:Re.ZodVoid,...er(n)});var gv=class n extends mr{_parse(e){let{ctx:i,status:s}=this._processInputParams(e),o=this._def;if(i.parsedType!==Xe.array)return Ve(i,{code:Oe.invalid_type,expected:Xe.array,received:i.parsedType}),Ct;if(o.exactLength!==null){let r=i.data.length>o.exactLength.value,t=i.data.length<o.exactLength.value;(r||t)&&(Ve(i,{code:r?Oe.too_big:Oe.too_small,minimum:t?o.exactLength.value:void 0,maximum:r?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),s.dirty())}if(o.minLength!==null&&i.data.length<o.minLength.value&&(Ve(i,{code:Oe.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),s.dirty()),o.maxLength!==null&&i.data.length>o.maxLength.value&&(Ve(i,{code:Oe.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),s.dirty()),i.common.async)return Promise.all([...i.data].map((r,t)=>o.type._parseAsync(new Xl(i,r,i.path,t)))).then(r=>ls.mergeArray(s,r));let c=[...i.data].map((r,t)=>o.type._parseSync(new Xl(i,r,i.path,t)));return ls.mergeArray(s,c)}get element(){return this._def.type}min(e,i){return new n({...this._def,minLength:{value:e,message:ot.toString(i)}})}max(e,i){return new n({...this._def,maxLength:{value:e,message:ot.toString(i)}})}length(e,i){return new n({...this._def,exactLength:{value:e,message:ot.toString(i)}})}nonempty(e){return this.min(1,e)}};gv.create=(n,e)=>new gv({type:n,minLength:null,maxLength:null,exactLength:null,typeName:Re.ZodArray,...er(e)});function yR(n){if(n instanceof hu){let e={};for(let i in n.shape){let s=n.shape[i];e[i]=id.create(yR(s))}return new hu({...n._def,shape:()=>e})}else return n instanceof gv?new gv({...n._def,type:yR(n.element)}):n instanceof id?id.create(yR(n.unwrap())):n instanceof Vm?Vm.create(yR(n.unwrap())):n instanceof Bm?Bm.create(n.items.map(e=>yR(e))):n}var hu=class n extends mr{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),i=kr.objectKeys(e);return this._cached={shape:e,keys:i},this._cached}_parse(e){if(this._getType(e)!==Xe.object){let u=this._getOrReturnCtx(e);return Ve(u,{code:Oe.invalid_type,expected:Xe.object,received:u.parsedType}),Ct}let{status:s,ctx:o}=this._processInputParams(e),{shape:c,keys:r}=this._getCached(),t=[];if(!(this._def.catchall instanceof bh&&this._def.unknownKeys==="strip"))for(let u in o.data)r.includes(u)||t.push(u);let a=[];for(let u of r){let l=c[u],p=o.data[u];a.push({key:{status:"valid",value:u},value:l._parse(new Xl(o,p,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof bh){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of t)a.push({key:{status:"valid",value:l},value:{status:"valid",value:o.data[l]}});else if(u==="strict")t.length>0&&(Ve(o,{code:Oe.unrecognized_keys,keys:t}),s.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let l of t){let p=o.data[l];a.push({key:{status:"valid",value:l},value:u._parse(new Xl(o,p,o.path,l)),alwaysSet:l in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let u=[];for(let l of a){let p=await l.key,d=await l.value;u.push({key:p,value:d,alwaysSet:l.alwaysSet})}return u}).then(u=>ls.mergeObjectSync(s,u)):ls.mergeObjectSync(s,a)}get shape(){return this._def.shape()}strict(e){return ot.errToObj,new n({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(i,s)=>{let o=this._def.errorMap?.(i,s).message??s.defaultError;return i.code==="unrecognized_keys"?{message:ot.errToObj(e).message??o}:{message:o}}}:{}})}strip(){return new n({...this._def,unknownKeys:"strip"})}passthrough(){return new n({...this._def,unknownKeys:"passthrough"})}extend(e){return new n({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new n({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Re.ZodObject})}setKey(e,i){return this.augment({[e]:i})}catchall(e){return new n({...this._def,catchall:e})}pick(e){let i={};for(let s of kr.objectKeys(e))e[s]&&this.shape[s]&&(i[s]=this.shape[s]);return new n({...this._def,shape:()=>i})}omit(e){let i={};for(let s of kr.objectKeys(this.shape))e[s]||(i[s]=this.shape[s]);return new n({...this._def,shape:()=>i})}deepPartial(){return yR(this)}partial(e){let i={};for(let s of kr.objectKeys(this.shape)){let o=this.shape[s];e&&!e[s]?i[s]=o:i[s]=o.optional()}return new n({...this._def,shape:()=>i})}required(e){let i={};for(let s of kr.objectKeys(this.shape))if(e&&!e[s])i[s]=this.shape[s];else{let c=this.shape[s];for(;c instanceof id;)c=c._def.innerType;i[s]=c}return new n({...this._def,shape:()=>i})}keyof(){return MFt(kr.objectKeys(this.shape))}};hu.create=(n,e)=>new hu({shape:()=>n,unknownKeys:"strip",catchall:bh.create(),typeName:Re.ZodObject,...er(e)});hu.strictCreate=(n,e)=>new hu({shape:()=>n,unknownKeys:"strict",catchall:bh.create(),typeName:Re.ZodObject,...er(e)});hu.lazycreate=(n,e)=>new hu({shape:n,unknownKeys:"strip",catchall:bh.create(),typeName:Re.ZodObject,...er(e)});var bR=class extends mr{_parse(e){let{ctx:i}=this._processInputParams(e),s=this._def.options;function o(c){for(let t of c)if(t.result.status==="valid")return t.result;for(let t of c)if(t.result.status==="dirty")return i.common.issues.push(...t.ctx.common.issues),t.result;let r=c.map(t=>new fu(t.ctx.common.issues));return Ve(i,{code:Oe.invalid_union,unionErrors:r}),Ct}if(i.common.async)return Promise.all(s.map(async c=>{let r={...i,common:{...i.common,issues:[]},parent:null};return{result:await c._parseAsync({data:i.data,path:i.path,parent:r}),ctx:r}})).then(o);{let c,r=[];for(let a of s){let u={...i,common:{...i.common,issues:[]},parent:null},l=a._parseSync({data:i.data,path:i.path,parent:u});if(l.status==="valid")return l;l.status==="dirty"&&!c&&(c={result:l,ctx:u}),u.common.issues.length&&r.push(u.common.issues)}if(c)return i.common.issues.push(...c.ctx.common.issues),c.result;let t=r.map(a=>new fu(a));return Ve(i,{code:Oe.invalid_union,unionErrors:t}),Ct}}get options(){return this._def.options}};bR.create=(n,e)=>new bR({options:n,typeName:Re.ZodUnion,...er(e)});var jm=n=>n instanceof SR?jm(n.schema):n instanceof od?jm(n.innerType()):n instanceof ER?[n.value]:n instanceof OR?n.options:n instanceof xR?kr.objectValues(n.enum):n instanceof AR?jm(n._def.innerType):n instanceof vR?[void 0]:n instanceof _R?[null]:n instanceof id?[void 0,...jm(n.unwrap())]:n instanceof Vm?[null,...jm(n.unwrap())]:n instanceof kte||n instanceof RR?jm(n.unwrap()):n instanceof PR?jm(n._def.innerType):[],G1e=class n extends mr{_parse(e){let{ctx:i}=this._processInputParams(e);if(i.parsedType!==Xe.object)return Ve(i,{code:Oe.invalid_type,expected:Xe.object,received:i.parsedType}),Ct;let s=this.discriminator,o=i.data[s],c=this.optionsMap.get(o);return c?i.common.async?c._parseAsync({data:i.data,path:i.path,parent:i}):c._parseSync({data:i.data,path:i.path,parent:i}):(Ve(i,{code:Oe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),Ct)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,i,s){let o=new Map;for(let c of i){let r=jm(c.shape[e]);if(!r.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let t of r){if(o.has(t))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(t)}`);o.set(t,c)}}return new n({typeName:Re.ZodDiscriminatedUnion,discriminator:e,options:i,optionsMap:o,...er(s)})}};function K1e(n,e){let i=qm(n),s=qm(e);if(n===e)return{valid:!0,data:n};if(i===Xe.object&&s===Xe.object){let o=kr.objectKeys(e),c=kr.objectKeys(n).filter(t=>o.indexOf(t)!==-1),r={...n,...e};for(let t of c){let a=K1e(n[t],e[t]);if(!a.valid)return{valid:!1};r[t]=a.data}return{valid:!0,data:r}}else if(i===Xe.array&&s===Xe.array){if(n.length!==e.length)return{valid:!1};let o=[];for(let c=0;c<n.length;c++){let r=n[c],t=e[c],a=K1e(r,t);if(!a.valid)return{valid:!1};o.push(a.data)}return{valid:!0,data:o}}else return i===Xe.date&&s===Xe.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}var TR=class extends mr{_parse(e){let{status:i,ctx:s}=this._processInputParams(e),o=(c,r)=>{if($1e(c)||$1e(r))return Ct;let t=K1e(c.value,r.value);return t.valid?((z1e(c)||z1e(r))&&i.dirty(),{status:i.value,value:t.data}):(Ve(s,{code:Oe.invalid_intersection_types}),Ct)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([c,r])=>o(c,r)):o(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}};TR.create=(n,e,i)=>new TR({left:n,right:e,typeName:Re.ZodIntersection,...er(i)});var Bm=class n extends mr{_parse(e){let{status:i,ctx:s}=this._processInputParams(e);if(s.parsedType!==Xe.array)return Ve(s,{code:Oe.invalid_type,expected:Xe.array,received:s.parsedType}),Ct;if(s.data.length<this._def.items.length)return Ve(s,{code:Oe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ct;!this._def.rest&&s.data.length>this._def.items.length&&(Ve(s,{code:Oe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i.dirty());let c=[...s.data].map((r,t)=>{let a=this._def.items[t]||this._def.rest;return a?a._parse(new Xl(s,r,s.path,t)):null}).filter(r=>!!r);return s.common.async?Promise.all(c).then(r=>ls.mergeArray(i,r)):ls.mergeArray(i,c)}get items(){return this._def.items}rest(e){return new n({...this._def,rest:e})}};Bm.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Bm({items:n,typeName:Re.ZodTuple,rest:null,...er(e)})};var Y1e=class n extends mr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:i,ctx:s}=this._processInputParams(e);if(s.parsedType!==Xe.object)return Ve(s,{code:Oe.invalid_type,expected:Xe.object,received:s.parsedType}),Ct;let o=[],c=this._def.keyType,r=this._def.valueType;for(let t in s.data)o.push({key:c._parse(new Xl(s,t,s.path,t)),value:r._parse(new Xl(s,s.data[t],s.path,t)),alwaysSet:t in s.data});return s.common.async?ls.mergeObjectAsync(i,o):ls.mergeObjectSync(i,o)}get element(){return this._def.valueType}static create(e,i,s){return i instanceof mr?new n({keyType:e,valueType:i,typeName:Re.ZodRecord,...er(s)}):new n({keyType:gR.create(),valueType:e,typeName:Re.ZodRecord,...er(i)})}},yU=class extends mr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:i,ctx:s}=this._processInputParams(e);if(s.parsedType!==Xe.map)return Ve(s,{code:Oe.invalid_type,expected:Xe.map,received:s.parsedType}),Ct;let o=this._def.keyType,c=this._def.valueType,r=[...s.data.entries()].map(([t,a],u)=>({key:o._parse(new Xl(s,t,s.path,[u,"key"])),value:c._parse(new Xl(s,a,s.path,[u,"value"]))}));if(s.common.async){let t=new Map;return Promise.resolve().then(async()=>{for(let a of r){let u=await a.key,l=await a.value;if(u.status==="aborted"||l.status==="aborted")return Ct;(u.status==="dirty"||l.status==="dirty")&&i.dirty(),t.set(u.value,l.value)}return{status:i.value,value:t}})}else{let t=new Map;for(let a of r){let u=a.key,l=a.value;if(u.status==="aborted"||l.status==="aborted")return Ct;(u.status==="dirty"||l.status==="dirty")&&i.dirty(),t.set(u.value,l.value)}return{status:i.value,value:t}}}};yU.create=(n,e,i)=>new yU({valueType:e,keyType:n,typeName:Re.ZodMap,...er(i)});var gU=class n extends mr{_parse(e){let{status:i,ctx:s}=this._processInputParams(e);if(s.parsedType!==Xe.set)return Ve(s,{code:Oe.invalid_type,expected:Xe.set,received:s.parsedType}),Ct;let o=this._def;o.minSize!==null&&s.data.size<o.minSize.value&&(Ve(s,{code:Oe.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),i.dirty()),o.maxSize!==null&&s.data.size>o.maxSize.value&&(Ve(s,{code:Oe.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),i.dirty());let c=this._def.valueType;function r(a){let u=new Set;for(let l of a){if(l.status==="aborted")return Ct;l.status==="dirty"&&i.dirty(),u.add(l.value)}return{status:i.value,value:u}}let t=[...s.data.values()].map((a,u)=>c._parse(new Xl(s,a,s.path,u)));return s.common.async?Promise.all(t).then(a=>r(a)):r(t)}min(e,i){return new n({...this._def,minSize:{value:e,message:ot.toString(i)}})}max(e,i){return new n({...this._def,maxSize:{value:e,message:ot.toString(i)}})}size(e,i){return this.min(e,i).max(e,i)}nonempty(e){return this.min(1,e)}};gU.create=(n,e)=>new gU({valueType:n,minSize:null,maxSize:null,typeName:Re.ZodSet,...er(e)});var W1e=class n extends mr{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:i}=this._processInputParams(e);if(i.parsedType!==Xe.function)return Ve(i,{code:Oe.invalid_type,expected:Xe.function,received:i.parsedType}),Ct;function s(t,a){return Lte({data:t,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,sU(),mv].filter(u=>!!u),issueData:{code:Oe.invalid_arguments,argumentsError:a}})}function o(t,a){return Lte({data:t,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,sU(),mv].filter(u=>!!u),issueData:{code:Oe.invalid_return_type,returnTypeError:a}})}let c={errorMap:i.common.contextualErrorMap},r=i.data;if(this._def.returns instanceof eS){let t=this;return Ds(async function(...a){let u=new fu([]),l=await t._def.args.parseAsync(a,c).catch(h=>{throw u.addIssue(s(a,h)),u}),p=await Reflect.apply(r,this,l);return await t._def.returns._def.type.parseAsync(p,c).catch(h=>{throw u.addIssue(o(p,h)),u})})}else{let t=this;return Ds(function(...a){let u=t._def.args.safeParse(a,c);if(!u.success)throw new fu([s(a,u.error)]);let l=Reflect.apply(r,this,u.data),p=t._def.returns.safeParse(l,c);if(!p.success)throw new fu([o(l,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new n({...this._def,args:Bm.create(e).rest(yv.create())})}returns(e){return new n({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,i,s){return new n({args:e||Bm.create([]).rest(yv.create()),returns:i||yv.create(),typeName:Re.ZodFunction,...er(s)})}},SR=class extends mr{get schema(){return this._def.getter()}_parse(e){let{ctx:i}=this._processInputParams(e);return this._def.getter()._parse({data:i.data,path:i.path,parent:i})}};SR.create=(n,e)=>new SR({getter:n,typeName:Re.ZodLazy,...er(e)});var ER=class extends mr{_parse(e){if(e.data!==this._def.value){let i=this._getOrReturnCtx(e);return Ve(i,{received:i.data,code:Oe.invalid_literal,expected:this._def.value}),Ct}return{status:"valid",value:e.data}}get value(){return this._def.value}};ER.create=(n,e)=>new ER({value:n,typeName:Re.ZodLiteral,...er(e)});function MFt(n,e){return new OR({values:n,typeName:Re.ZodEnum,...er(e)})}var OR=class n extends mr{_parse(e){if(typeof e.data!="string"){let i=this._getOrReturnCtx(e),s=this._def.values;return Ve(i,{expected:kr.joinValues(s),received:i.parsedType,code:Oe.invalid_type}),Ct}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let i=this._getOrReturnCtx(e),s=this._def.values;return Ve(i,{received:i.data,code:Oe.invalid_enum_value,options:s}),Ct}return Ds(e.data)}get options(){return this._def.values}get enum(){let e={};for(let i of this._def.values)e[i]=i;return e}get Values(){let e={};for(let i of this._def.values)e[i]=i;return e}get Enum(){let e={};for(let i of this._def.values)e[i]=i;return e}extract(e,i=this._def){return n.create(e,{...this._def,...i})}exclude(e,i=this._def){return n.create(this.options.filter(s=>!e.includes(s)),{...this._def,...i})}};OR.create=MFt;var xR=class extends mr{_parse(e){let i=kr.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==Xe.string&&s.parsedType!==Xe.number){let o=kr.objectValues(i);return Ve(s,{expected:kr.joinValues(o),received:s.parsedType,code:Oe.invalid_type}),Ct}if(this._cache||(this._cache=new Set(kr.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=kr.objectValues(i);return Ve(s,{received:s.data,code:Oe.invalid_enum_value,options:o}),Ct}return Ds(e.data)}get enum(){return this._def.values}};xR.create=(n,e)=>new xR({values:n,typeName:Re.ZodNativeEnum,...er(e)});var eS=class extends mr{unwrap(){return this._def.type}_parse(e){let{ctx:i}=this._processInputParams(e);if(i.parsedType!==Xe.promise&&i.common.async===!1)return Ve(i,{code:Oe.invalid_type,expected:Xe.promise,received:i.parsedType}),Ct;let s=i.parsedType===Xe.promise?i.data:Promise.resolve(i.data);return Ds(s.then(o=>this._def.type.parseAsync(o,{path:i.path,errorMap:i.common.contextualErrorMap})))}};eS.create=(n,e)=>new eS({type:n,typeName:Re.ZodPromise,...er(e)});var od=class extends mr{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Re.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:i,ctx:s}=this._processInputParams(e),o=this._def.effect||null,c={addIssue:r=>{Ve(s,r),r.fatal?i.abort():i.dirty()},get path(){return s.path}};if(c.addIssue=c.addIssue.bind(c),o.type==="preprocess"){let r=o.transform(s.data,c);if(s.common.async)return Promise.resolve(r).then(async t=>{if(i.value==="aborted")return Ct;let a=await this._def.schema._parseAsync({data:t,path:s.path,parent:s});return a.status==="aborted"?Ct:a.status==="dirty"?mR(a.value):i.value==="dirty"?mR(a.value):a});{if(i.value==="aborted")return Ct;let t=this._def.schema._parseSync({data:r,path:s.path,parent:s});return t.status==="aborted"?Ct:t.status==="dirty"?mR(t.value):i.value==="dirty"?mR(t.value):t}}if(o.type==="refinement"){let r=t=>{let a=o.refinement(t,c);if(s.common.async)return Promise.resolve(a);if(a instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return t};if(s.common.async===!1){let t=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return t.status==="aborted"?Ct:(t.status==="dirty"&&i.dirty(),r(t.value),{status:i.value,value:t.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(t=>t.status==="aborted"?Ct:(t.status==="dirty"&&i.dirty(),r(t.value).then(()=>({status:i.value,value:t.value}))))}if(o.type==="transform")if(s.common.async===!1){let r=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!QT(r))return Ct;let t=o.transform(r.value,c);if(t instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:i.value,value:t}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(r=>QT(r)?Promise.resolve(o.transform(r.value,c)).then(t=>({status:i.value,value:t})):Ct);kr.assertNever(o)}};od.create=(n,e,i)=>new od({schema:n,typeName:Re.ZodEffects,effect:e,...er(i)});od.createWithPreprocess=(n,e,i)=>new od({schema:e,effect:{type:"preprocess",transform:n},typeName:Re.ZodEffects,...er(i)});var id=class extends mr{_parse(e){return this._getType(e)===Xe.undefined?Ds(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};id.create=(n,e)=>new id({innerType:n,typeName:Re.ZodOptional,...er(e)});var Vm=class extends mr{_parse(e){return this._getType(e)===Xe.null?Ds(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Vm.create=(n,e)=>new Vm({innerType:n,typeName:Re.ZodNullable,...er(e)});var AR=class extends mr{_parse(e){let{ctx:i}=this._processInputParams(e),s=i.data;return i.parsedType===Xe.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:i.path,parent:i})}removeDefault(){return this._def.innerType}};AR.create=(n,e)=>new AR({innerType:n,typeName:Re.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...er(e)});var PR=class extends mr{_parse(e){let{ctx:i}=this._processInputParams(e),s={...i,common:{...i.common,issues:[]}},o=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return cU(o)?o.then(c=>({status:"valid",value:c.status==="valid"?c.value:this._def.catchValue({get error(){return new fu(s.common.issues)},input:s.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new fu(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}};PR.create=(n,e)=>new PR({innerType:n,typeName:Re.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...er(e)});var vU=class extends mr{_parse(e){if(this._getType(e)!==Xe.nan){let s=this._getOrReturnCtx(e);return Ve(s,{code:Oe.invalid_type,expected:Xe.nan,received:s.parsedType}),Ct}return{status:"valid",value:e.data}}};vU.create=n=>new vU({typeName:Re.ZodNaN,...er(n)});var hyi=Symbol("zod_brand"),kte=class extends mr{_parse(e){let{ctx:i}=this._processInputParams(e),s=i.data;return this._def.type._parse({data:s,path:i.path,parent:i})}unwrap(){return this._def.type}},Dte=class n extends mr{_parse(e){let{status:i,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{let c=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return c.status==="aborted"?Ct:c.status==="dirty"?(i.dirty(),mR(c.value)):this._def.out._parseAsync({data:c.value,path:s.path,parent:s})})();{let o=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?Ct:o.status==="dirty"?(i.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:s.path,parent:s})}}static create(e,i){return new n({in:e,out:i,typeName:Re.ZodPipeline})}},RR=class extends mr{_parse(e){let i=this._def.innerType._parse(e),s=o=>(QT(o)&&(o.value=Object.freeze(o.value)),o);return cU(i)?i.then(o=>s(o)):s(i)}unwrap(){return this._def.innerType}};RR.create=(n,e)=>new RR({innerType:n,typeName:Re.ZodReadonly,...er(e)});var myi={object:hu.lazycreate},Re;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(Re||(Re={}));var yyi=gR.create,gyi=uU.create,vyi=vU.create,_yi=lU.create,byi=pU.create,Tyi=dU.create,Syi=fU.create,Eyi=vR.create,Oyi=_R.create,xyi=hU.create,Ayi=yv.create,Pyi=bh.create,Ryi=mU.create,Nyi=gv.create,LFt=hu.create,Iyi=hu.strictCreate,wyi=bR.create,Cyi=G1e.create,Myi=TR.create,Lyi=Bm.create,kyi=Y1e.create,Dyi=yU.create,Uyi=gU.create,qyi=W1e.create,jyi=SR.create,Byi=ER.create,Vyi=OR.create,Fyi=xR.create,$yi=eS.create,zyi=od.create,Hyi=id.create,Gyi=Vm.create,Kyi=od.createWithPreprocess,Yyi=Dte.create;var yu={};gn(yu,{$ZodAny:()=>Dre,$ZodArray:()=>Vre,$ZodAsyncError:()=>ad,$ZodBase64:()=>Are,$ZodBase64URL:()=>Pre,$ZodBigInt:()=>CU,$ZodBigIntFormat:()=>Cre,$ZodBoolean:()=>jR,$ZodCIDRv4:()=>Ore,$ZodCIDRv6:()=>xre,$ZodCUID:()=>dre,$ZodCUID2:()=>fre,$ZodCatch:()=>one,$ZodCheck:()=>xn,$ZodCheckBigIntFormat:()=>kMe,$ZodCheckEndsWith:()=>KMe,$ZodCheckGreaterThan:()=>ere,$ZodCheckIncludes:()=>HMe,$ZodCheckLengthEquals:()=>VMe,$ZodCheckLessThan:()=>Qte,$ZodCheckLowerCase:()=>$Me,$ZodCheckMaxLength:()=>jMe,$ZodCheckMaxSize:()=>DMe,$ZodCheckMimeType:()=>WMe,$ZodCheckMinLength:()=>BMe,$ZodCheckMinSize:()=>UMe,$ZodCheckMultipleOf:()=>MMe,$ZodCheckNumberFormat:()=>LMe,$ZodCheckOverwrite:()=>JMe,$ZodCheckProperty:()=>YMe,$ZodCheckRegex:()=>FMe,$ZodCheckSizeEquals:()=>qMe,$ZodCheckStartsWith:()=>GMe,$ZodCheckStringFormat:()=>qR,$ZodCheckUpperCase:()=>zMe,$ZodCodec:()=>VR,$ZodCustom:()=>fne,$ZodCustomStringFormat:()=>Ire,$ZodDate:()=>Bre,$ZodDefault:()=>tne,$ZodDiscriminatedUnion:()=>zre,$ZodE164:()=>Rre,$ZodEmail:()=>cre,$ZodEmoji:()=>lre,$ZodEncodeError:()=>vv,$ZodEnum:()=>Wre,$ZodError:()=>PU,$ZodExactOptional:()=>Qre,$ZodFile:()=>Zre,$ZodFunction:()=>lne,$ZodGUID:()=>are,$ZodIPv4:()=>Tre,$ZodIPv6:()=>Sre,$ZodISODate:()=>vre,$ZodISODateTime:()=>gre,$ZodISODuration:()=>bre,$ZodISOTime:()=>_re,$ZodIntersection:()=>Hre,$ZodJWT:()=>Nre,$ZodKSUID:()=>yre,$ZodLazy:()=>dne,$ZodLiteral:()=>Jre,$ZodMAC:()=>Ere,$ZodMap:()=>Kre,$ZodNaN:()=>ane,$ZodNanoID:()=>pre,$ZodNever:()=>qre,$ZodNonOptional:()=>nne,$ZodNull:()=>kre,$ZodNullable:()=>ene,$ZodNumber:()=>wU,$ZodNumberFormat:()=>wre,$ZodObject:()=>Fre,$ZodObjectJIT:()=>eLe,$ZodOptional:()=>LU,$ZodPipe:()=>sne,$ZodPrefault:()=>rne,$ZodPromise:()=>pne,$ZodReadonly:()=>cne,$ZodRealError:()=>kc,$ZodRecord:()=>Gre,$ZodRegistry:()=>gne,$ZodSet:()=>Yre,$ZodString:()=>xv,$ZodStringFormat:()=>mn,$ZodSuccess:()=>ine,$ZodSymbol:()=>Mre,$ZodTemplateLiteral:()=>une,$ZodTransform:()=>Xre,$ZodTuple:()=>MU,$ZodType:()=>Lt,$ZodULID:()=>hre,$ZodURL:()=>ure,$ZodUUID:()=>sre,$ZodUndefined:()=>Lre,$ZodUnion:()=>BR,$ZodUnknown:()=>Ure,$ZodVoid:()=>jre,$ZodXID:()=>mre,$ZodXor:()=>$re,$brand:()=>bU,$constructor:()=>z,$input:()=>_ne,$output:()=>vne,Doc:()=>IU,JSONSchema:()=>_$t,JSONSchemaGenerator:()=>sie,NEVER:()=>Ute,TimePrecision:()=>Ene,_any:()=>zne,_array:()=>tLe,_base64:()=>QU,_base64url:()=>e2,_bigint:()=>Une,_boolean:()=>kne,_catch:()=>_wn,_check:()=>v$t,_cidrv4:()=>ZU,_cidrv6:()=>XU,_coercedBigint:()=>qne,_coercedBoolean:()=>Dne,_coercedDate:()=>Wne,_coercedNumber:()=>Nne,_coercedString:()=>Tne,_cuid:()=>zU,_cuid2:()=>HU,_custom:()=>Xne,_date:()=>Yne,_decode:()=>zte,_decodeAsync:()=>Gte,_default:()=>ywn,_discriminatedUnion:()=>iwn,_e164:()=>t2,_email:()=>UU,_emoji:()=>FU,_encode:()=>$te,_encodeAsync:()=>Hte,_endsWith:()=>lS,_enum:()=>lwn,_file:()=>Zne,_float32:()=>wne,_float64:()=>Cne,_gt:()=>cd,_gte:()=>Sa,_guid:()=>zR,_includes:()=>cS,_int:()=>Ine,_int32:()=>Mne,_int64:()=>jne,_intersection:()=>own,_ipv4:()=>WU,_ipv6:()=>JU,_isoDate:()=>xne,_isoDateTime:()=>One,_isoDuration:()=>Pne,_isoTime:()=>Ane,_jwt:()=>r2,_ksuid:()=>YU,_lazy:()=>Ewn,_length:()=>Rv,_literal:()=>dwn,_lowercase:()=>aS,_lt:()=>sd,_lte:()=>Us,_mac:()=>Sne,_map:()=>cwn,_max:()=>Us,_maxLength:()=>Pv,_maxSize:()=>zm,_mime:()=>pS,_min:()=>Sa,_minLength:()=>Th,_minSize:()=>ud,_multipleOf:()=>$m,_nan:()=>Jne,_nanoid:()=>$U,_nativeEnum:()=>pwn,_negative:()=>i2,_never:()=>Gne,_nonnegative:()=>a2,_nonoptional:()=>gwn,_nonpositive:()=>o2,_normalize:()=>dS,_null:()=>$ne,_nullable:()=>mwn,_number:()=>Rne,_optional:()=>hwn,_overwrite:()=>ep,_parse:()=>LR,_parseAsync:()=>kR,_pipe:()=>bwn,_positive:()=>n2,_promise:()=>Own,_property:()=>s2,_readonly:()=>Twn,_record:()=>swn,_refine:()=>Qne,_regex:()=>oS,_safeDecode:()=>Yte,_safeDecodeAsync:()=>Jte,_safeEncode:()=>Kte,_safeEncodeAsync:()=>Wte,_safeParse:()=>DR,_safeParseAsync:()=>UR,_set:()=>uwn,_size:()=>Av,_slugify:()=>GR,_startsWith:()=>uS,_string:()=>bne,_stringFormat:()=>yS,_stringbool:()=>nie,_success:()=>vwn,_superRefine:()=>eie,_symbol:()=>Vne,_templateLiteral:()=>Swn,_toLowerCase:()=>hS,_toUpperCase:()=>mS,_transform:()=>fwn,_trim:()=>fS,_tuple:()=>awn,_uint32:()=>Lne,_uint64:()=>Bne,_ulid:()=>GU,_undefined:()=>Fne,_union:()=>rwn,_unknown:()=>Hne,_uppercase:()=>sS,_url:()=>HR,_uuid:()=>qU,_uuidv4:()=>jU,_uuidv6:()=>BU,_uuidv7:()=>VU,_void:()=>Kne,_xid:()=>KU,_xor:()=>nwn,clone:()=>ia,config:()=>Ri,createStandardJSONSchemaMethod:()=>KR,createToJSONSchemaMethod:()=>rLe,decode:()=>KFt,decodeAsync:()=>WFt,describe:()=>tie,encode:()=>GFt,encodeAsync:()=>YFt,extractDefs:()=>Iv,finalize:()=>wv,flattenError:()=>CR,formatError:()=>MR,globalConfig:()=>_U,globalRegistry:()=>oa,initializeContext:()=>Nv,isValidBase64:()=>QMe,isValidBase64URL:()=>g4t,isValidJWT:()=>v4t,locales:()=>$R,meta:()=>rie,parse:()=>rS,parseAsync:()=>nS,prettifyError:()=>Fte,process:()=>pn,regexes:()=>Dc,registry:()=>DU,safeDecode:()=>ZFt,safeDecodeAsync:()=>QFt,safeEncode:()=>JFt,safeEncodeAsync:()=>XFt,safeParse:()=>Ev,safeParseAsync:()=>Ov,toDotPath:()=>HFt,toJSONSchema:()=>gS,treeifyError:()=>Vte,util:()=>xe,version:()=>ZMe});var Ute=Object.freeze({status:"aborted"});function z(n,e,i){function s(t,a){if(t._zod||Object.defineProperty(t,"_zod",{value:{def:a,constr:r,traits:new Set},enumerable:!1}),t._zod.traits.has(n))return;t._zod.traits.add(n),e(t,a);let u=r.prototype,l=Object.keys(u);for(let p=0;p<l.length;p++){let d=l[p];d in t||(t[d]=u[d].bind(t))}}let o=i?.Parent??Object;class c extends o{}Object.defineProperty(c,"name",{value:n});function r(t){var a;let u=i?.Parent?new c:this;s(u,t),(a=u._zod).deferred??(a.deferred=[]);for(let l of u._zod.deferred)l();return u}return Object.defineProperty(r,"init",{value:s}),Object.defineProperty(r,Symbol.hasInstance,{value:t=>i?.Parent&&t instanceof i.Parent?!0:t?._zod?.traits?.has(n)}),Object.defineProperty(r,"name",{value:n}),r}var bU=Symbol("zod_brand"),ad=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},vv=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},_U={};function Ri(n){return n&&Object.assign(_U,n),_U}var xe={};gn(xe,{BIGINT_FORMAT_RANGES:()=>iMe,Class:()=>Z1e,NUMBER_FORMAT_RANGES:()=>nMe,aborted:()=>Sv,allowsEval:()=>eMe,assert:()=>vNn,assertEqual:()=>hNn,assertIs:()=>yNn,assertNever:()=>gNn,assertNotEqual:()=>mNn,assignProp:()=>bv,base64ToUint8Array:()=>FFt,base64urlToUint8Array:()=>NNn,cached:()=>IR,captureStackTrace:()=>jte,cleanEnum:()=>RNn,cleanRegex:()=>EU,clone:()=>ia,cloneDef:()=>bNn,createTransparentProxy:()=>ANn,defineLazy:()=>tr,esc:()=>qte,escapeRegex:()=>Ql,extend:()=>qFt,finalizeIssue:()=>Lc,floatSafeRemainder:()=>X1e,getElementAtPath:()=>TNn,getEnumValues:()=>SU,getLengthableOrigin:()=>AU,getParsedType:()=>xNn,getSizableOrigin:()=>xU,hexToUint8Array:()=>wNn,isObject:()=>tS,isPlainObject:()=>Tv,issue:()=>wR,joinValues:()=>re,jsonStringifyReplacer:()=>NR,merge:()=>PNn,mergeDefs:()=>Fm,normalizeParams:()=>Ne,nullish:()=>_v,numKeys:()=>ONn,objectClone:()=>_Nn,omit:()=>UFt,optionalKeys:()=>rMe,parsedType:()=>Ae,partial:()=>BFt,pick:()=>DFt,prefixIssues:()=>mu,primitiveTypes:()=>tMe,promiseAllObject:()=>SNn,propertyKeyTypes:()=>OU,randomString:()=>ENn,required:()=>VFt,safeExtend:()=>jFt,shallowClone:()=>Bte,slugify:()=>Q1e,stringifyPrimitive:()=>Se,uint8ArrayToBase64:()=>$Ft,uint8ArrayToBase64url:()=>INn,uint8ArrayToHex:()=>CNn,unwrapMessage:()=>TU});function hNn(n){return n}function mNn(n){return n}function yNn(n){}function gNn(n){throw new Error("Unexpected value in exhaustive check")}function vNn(n){}function SU(n){let e=Object.values(n).filter(s=>typeof s=="number");return Object.entries(n).filter(([s,o])=>e.indexOf(+s)===-1).map(([s,o])=>o)}function re(n,e="|"){return n.map(i=>Se(i)).join(e)}function NR(n,e){return typeof e=="bigint"?e.toString():e}function IR(n){return{get value(){{let i=n();return Object.defineProperty(this,"value",{value:i}),i}throw new Error("cached value already set")}}}function _v(n){return n==null}function EU(n){let e=n.startsWith("^")?1:0,i=n.endsWith("$")?n.length-1:n.length;return n.slice(e,i)}function X1e(n,e){let i=(n.toString().split(".")[1]||"").length,s=e.toString(),o=(s.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(s)){let a=s.match(/\d?e-(\d?)/);a?.[1]&&(o=Number.parseInt(a[1]))}let c=i>o?i:o,r=Number.parseInt(n.toFixed(c).replace(".","")),t=Number.parseInt(e.toFixed(c).replace(".",""));return r%t/10**c}var kFt=Symbol("evaluating");function tr(n,e,i){let s;Object.defineProperty(n,e,{get(){if(s!==kFt)return s===void 0&&(s=kFt,s=i()),s},set(o){Object.defineProperty(n,e,{value:o})},configurable:!0})}function _Nn(n){return Object.create(Object.getPrototypeOf(n),Object.getOwnPropertyDescriptors(n))}function bv(n,e,i){Object.defineProperty(n,e,{value:i,writable:!0,enumerable:!0,configurable:!0})}function Fm(...n){let e={};for(let i of n){let s=Object.getOwnPropertyDescriptors(i);Object.assign(e,s)}return Object.defineProperties({},e)}function bNn(n){return Fm(n._zod.def)}function TNn(n,e){return e?e.reduce((i,s)=>i?.[s],n):n}function SNn(n){let e=Object.keys(n),i=e.map(s=>n[s]);return Promise.all(i).then(s=>{let o={};for(let c=0;c<e.length;c++)o[e[c]]=s[c];return o})}function ENn(n=10){let e="abcdefghijklmnopqrstuvwxyz",i="";for(let s=0;s<n;s++)i+=e[Math.floor(Math.random()*e.length)];return i}function qte(n){return JSON.stringify(n)}function Q1e(n){return n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var jte="captureStackTrace"in Error?Error.captureStackTrace:(...n)=>{};function tS(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}var eMe=IR(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let n=Function;return new n(""),!0}catch{return!1}});function Tv(n){if(tS(n)===!1)return!1;let e=n.constructor;if(e===void 0||typeof e!="function")return!0;let i=e.prototype;return!(tS(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function Bte(n){return Tv(n)?{...n}:Array.isArray(n)?[...n]:n}function ONn(n){let e=0;for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&e++;return e}var xNn=n=>{let e=typeof n;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(n)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(n)?"array":n===null?"null":n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?"promise":typeof Map<"u"&&n instanceof Map?"map":typeof Set<"u"&&n instanceof Set?"set":typeof Date<"u"&&n instanceof Date?"date":typeof File<"u"&&n instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},OU=new Set(["string","number","symbol"]),tMe=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ql(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ia(n,e,i){let s=new n._zod.constr(e??n._zod.def);return(!e||i?.parent)&&(s._zod.parent=n),s}function Ne(n){let e=n;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function ANn(n){let e;return new Proxy({},{get(i,s,o){return e??(e=n()),Reflect.get(e,s,o)},set(i,s,o,c){return e??(e=n()),Reflect.set(e,s,o,c)},has(i,s){return e??(e=n()),Reflect.has(e,s)},deleteProperty(i,s){return e??(e=n()),Reflect.deleteProperty(e,s)},ownKeys(i){return e??(e=n()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(i,s){return e??(e=n()),Reflect.getOwnPropertyDescriptor(e,s)},defineProperty(i,s,o){return e??(e=n()),Reflect.defineProperty(e,s,o)}})}function Se(n){return typeof n=="bigint"?n.toString()+"n":typeof n=="string"?`"${n}"`:`${n}`}function rMe(n){return Object.keys(n).filter(e=>n[e]._zod.optin==="optional"&&n[e]._zod.optout==="optional")}var nMe={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},iMe={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function DFt(n,e){let i=n._zod.def,s=i.checks;if(s&&s.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let c=Fm(n._zod.def,{get shape(){let r={};for(let t in e){if(!(t in i.shape))throw new Error(`Unrecognized key: "${t}"`);e[t]&&(r[t]=i.shape[t])}return bv(this,"shape",r),r},checks:[]});return ia(n,c)}function UFt(n,e){let i=n._zod.def,s=i.checks;if(s&&s.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let c=Fm(n._zod.def,{get shape(){let r={...n._zod.def.shape};for(let t in e){if(!(t in i.shape))throw new Error(`Unrecognized key: "${t}"`);e[t]&&delete r[t]}return bv(this,"shape",r),r},checks:[]});return ia(n,c)}function qFt(n,e){if(!Tv(e))throw new Error("Invalid input to extend: expected a plain object");let i=n._zod.def.checks;if(i&&i.length>0){let c=n._zod.def.shape;for(let r in e)if(Object.getOwnPropertyDescriptor(c,r)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let o=Fm(n._zod.def,{get shape(){let c={...n._zod.def.shape,...e};return bv(this,"shape",c),c}});return ia(n,o)}function jFt(n,e){if(!Tv(e))throw new Error("Invalid input to safeExtend: expected a plain object");let i=Fm(n._zod.def,{get shape(){let s={...n._zod.def.shape,...e};return bv(this,"shape",s),s}});return ia(n,i)}function PNn(n,e){let i=Fm(n._zod.def,{get shape(){let s={...n._zod.def.shape,...e._zod.def.shape};return bv(this,"shape",s),s},get catchall(){return e._zod.def.catchall},checks:[]});return ia(n,i)}function BFt(n,e,i){let o=e._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let r=Fm(e._zod.def,{get shape(){let t=e._zod.def.shape,a={...t};if(i)for(let u in i){if(!(u in t))throw new Error(`Unrecognized key: "${u}"`);i[u]&&(a[u]=n?new n({type:"optional",innerType:t[u]}):t[u])}else for(let u in t)a[u]=n?new n({type:"optional",innerType:t[u]}):t[u];return bv(this,"shape",a),a},checks:[]});return ia(e,r)}function VFt(n,e,i){let s=Fm(e._zod.def,{get shape(){let o=e._zod.def.shape,c={...o};if(i)for(let r in i){if(!(r in c))throw new Error(`Unrecognized key: "${r}"`);i[r]&&(c[r]=new n({type:"nonoptional",innerType:o[r]}))}else for(let r in o)c[r]=new n({type:"nonoptional",innerType:o[r]});return bv(this,"shape",c),c}});return ia(e,s)}function Sv(n,e=0){if(n.aborted===!0)return!0;for(let i=e;i<n.issues.length;i++)if(n.issues[i]?.continue!==!0)return!0;return!1}function mu(n,e){return e.map(i=>{var s;return(s=i).path??(s.path=[]),i.path.unshift(n),i})}function TU(n){return typeof n=="string"?n:n?.message}function Lc(n,e,i){let s={...n,path:n.path??[]};if(!n.message){let o=TU(n.inst?._zod.def?.error?.(n))??TU(e?.error?.(n))??TU(i.customError?.(n))??TU(i.localeError?.(n))??"Invalid input";s.message=o}return delete s.inst,delete s.continue,e?.reportInput||delete s.input,s}function xU(n){return n instanceof Set?"set":n instanceof Map?"map":n instanceof File?"file":"unknown"}function AU(n){return Array.isArray(n)?"array":typeof n=="string"?"string":"unknown"}function Ae(n){let e=typeof n;switch(e){case"number":return Number.isNaN(n)?"nan":"number";case"object":{if(n===null)return"null";if(Array.isArray(n))return"array";let i=n;if(i&&Object.getPrototypeOf(i)!==Object.prototype&&"constructor"in i&&i.constructor)return i.constructor.name}}return e}function wR(...n){let[e,i,s]=n;return typeof e=="string"?{message:e,code:"custom",input:i,inst:s}:{...e}}function RNn(n){return Object.entries(n).filter(([e,i])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function FFt(n){let e=atob(n),i=new Uint8Array(e.length);for(let s=0;s<e.length;s++)i[s]=e.charCodeAt(s);return i}function $Ft(n){let e="";for(let i=0;i<n.length;i++)e+=String.fromCharCode(n[i]);return btoa(e)}function NNn(n){let e=n.replace(/-/g,"+").replace(/_/g,"/"),i="=".repeat((4-e.length%4)%4);return FFt(e+i)}function INn(n){return $Ft(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function wNn(n){let e=n.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let i=new Uint8Array(e.length/2);for(let s=0;s<e.length;s+=2)i[s/2]=Number.parseInt(e.slice(s,s+2),16);return i}function CNn(n){return Array.from(n).map(e=>e.toString(16).padStart(2,"0")).join("")}var Z1e=class{constructor(...e){}};var zFt=(n,e)=>{n.name="$ZodError",Object.defineProperty(n,"_zod",{value:n._zod,enumerable:!1}),Object.defineProperty(n,"issues",{value:e,enumerable:!1}),n.message=JSON.stringify(e,NR,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},PU=z("$ZodError",zFt),kc=z("$ZodError",zFt,{Parent:Error});function CR(n,e=i=>i.message){let i={},s=[];for(let o of n.issues)o.path.length>0?(i[o.path[0]]=i[o.path[0]]||[],i[o.path[0]].push(e(o))):s.push(e(o));return{formErrors:s,fieldErrors:i}}function MR(n,e=i=>i.message){let i={_errors:[]},s=o=>{for(let c of o.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(r=>s({issues:r}));else if(c.code==="invalid_key")s({issues:c.issues});else if(c.code==="invalid_element")s({issues:c.issues});else if(c.path.length===0)i._errors.push(e(c));else{let r=i,t=0;for(;t<c.path.length;){let a=c.path[t];t===c.path.length-1?(r[a]=r[a]||{_errors:[]},r[a]._errors.push(e(c))):r[a]=r[a]||{_errors:[]},r=r[a],t++}}};return s(n),i}function Vte(n,e=i=>i.message){let i={errors:[]},s=(o,c=[])=>{var r,t;for(let a of o.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(u=>s({issues:u},a.path));else if(a.code==="invalid_key")s({issues:a.issues},a.path);else if(a.code==="invalid_element")s({issues:a.issues},a.path);else{let u=[...c,...a.path];if(u.length===0){i.errors.push(e(a));continue}let l=i,p=0;for(;p<u.length;){let d=u[p],h=p===u.length-1;typeof d=="string"?(l.properties??(l.properties={}),(r=l.properties)[d]??(r[d]={errors:[]}),l=l.properties[d]):(l.items??(l.items=[]),(t=l.items)[d]??(t[d]={errors:[]}),l=l.items[d]),h&&l.errors.push(e(a)),p++}}};return s(n),i}function HFt(n){let e=[],i=n.map(s=>typeof s=="object"?s.key:s);for(let s of i)typeof s=="number"?e.push(`[${s}]`):typeof s=="symbol"?e.push(`[${JSON.stringify(String(s))}]`):/[^\w$]/.test(s)?e.push(`[${JSON.stringify(s)}]`):(e.length&&e.push("."),e.push(s));return e.join("")}function Fte(n){let e=[],i=[...n.issues].sort((s,o)=>(s.path??[]).length-(o.path??[]).length);for(let s of i)e.push(`\u2716 ${s.message}`),s.path?.length&&e.push(` \u2192 at ${HFt(s.path)}`);return e.join(`
272
+ `),null;i||(console.error(`\u{1F4C4} Loading config from: ${s}`),console.error(`[Config] BCTB_WORKSPACE_PATH env var = ${process.env.BCTB_WORKSPACE_PATH||"(not set)"}`));let c=Mh.readFileSync(s,"utf-8"),r=JSON.parse(c);if(r.profiles){let a=e||process.env.BCTB_PROFILE||r.defaultProfile;if(!a)throw new Error("No profile specified. Use --profile <name> or set BCTB_PROFILE env var");if(!r.profiles[a])throw new Error(`Profile '${a}' not found in config`);console.error(`\u{1F4CB} Using profile: "${a}"`);let u=nze(r.profiles,a),l={...u,cacheEnabled:u.cacheEnabled??r.cache?.enabled??!0,cacheTTLSeconds:u.cacheTTLSeconds??r.cache?.ttlSeconds??3600,removePII:u.removePII??r.sanitize?.removePII??!1,references:u.references??r.references??[],port:u.port??52345,workspacePath:u.workspacePath??process.env.BCTB_WORKSPACE_PATH??process.cwd(),queriesFolder:u.queriesFolder??"queries",connectionName:u.connectionName??"Default",tenantId:u.tenantId??"",authFlow:u.authFlow??"azure_cli",applicationInsightsAppId:u.applicationInsightsAppId??"",kustoClusterUrl:u.kustoClusterUrl??"",configFilePath:s};return qj(l)}let t={connectionName:r.connectionName??"Default",tenantId:r.tenantId??"",clientId:r.clientId,clientSecret:r.clientSecret,authFlow:r.authFlow??"azure_cli",applicationInsightsAppId:r.applicationInsightsAppId??"",kustoClusterUrl:r.kustoClusterUrl??"",cacheEnabled:r.cacheEnabled??!0,cacheTTLSeconds:r.cacheTTLSeconds??3600,removePII:r.removePII??!1,port:r.port??52345,workspacePath:r.workspacePath??process.env.BCTB_WORKSPACE_PATH??process.cwd(),queriesFolder:r.queriesFolder??"queries",references:r.references??[],configFilePath:s};return qj(t)}function nze(n,e,i=new Set){if(i.has(e))throw new Error(`Circular profile inheritance detected: ${e}`);i.add(e);let s=n[e];if(!s)throw new Error(`Profile '${e}' not found`);if(!s.extends)return s;let o=nze(n,s.extends,i),c=ize(o,s);return delete c.extends,c}function ize(n,e){let i={...n};for(let s in e)s!=="extends"&&(typeof e[s]=="object"&&!Array.isArray(e[s])&&e[s]!==null?i[s]=ize(n[s]||{},e[s]):i[s]=e[s]);return i}function qj(n){if(typeof n=="string")return n.replace(/\$\{([^}]+)\}/g,(e,i)=>{if(i==="workspaceFolder"){let s=process.env.BCTB_WORKSPACE_PATH||process.cwd();return console.error(`[Config] Expanding \${workspaceFolder} to: ${s}`),s}return process.env[i]||""});if(Array.isArray(n))return n.map(e=>qj(e));if(typeof n=="object"&&n!==null){let e={};for(let i in n)e[i]=qj(n[i]);return e}return n}var Xt=Te(H3());var bi="3.4.1";var j8t=Te(require("https"));var hR=Te(OFt()),us=Te(require("fs")),oU=Te(require("path")),AFt=Te(require("crypto")),PFt=Te(require("os")),F1e=class{client;constructor(e,i,s){hR.setup(e).setAutoCollectRequests(!1).setAutoCollectPerformance(!1,!1).setAutoCollectExceptions(!1).setAutoCollectDependencies(!1).setAutoCollectConsole(!1).setUseDiskRetryCaching(!0),hR.start(),this.client=hR.defaultClient,this.client.commonProperties={installationId:i,version:s,component:"MCP"}}trackEvent(e,i,s){let o={};if(i)for(let[c,r]of Object.entries(i))o[c]=String(r);this.client.trackEvent({name:e,properties:o,measurements:s})}trackException(e,i){this.client.trackException({exception:e,properties:{errorName:e.name,errorMessage:e.message,...i}})}trackDependency(e,i,s,o,c,r){this.client.trackDependency({name:e,data:i,duration:s,success:o,resultCode:c||(o?"200":"500"),dependencyTypeName:"External",properties:r})}trackTrace(e,i){this.client.trackTrace({message:e,properties:i})}async flush(){return new Promise(e=>{this.client.flush(),setTimeout(e,2e3)})}},RFt=".bctb-installation-id",qRn=".bctb",jRn="installation-id";function BRn(){let n=PFt.homedir();return oU.join(n,qRn)}function aU(n){let e=BRn(),i=oU.join(e,jRn);try{if(us.existsSync(i)){let c=us.readFileSync(i,"utf8").trim();if(c)return VRn(n),c}}catch{}let s=oU.join(n,RFt);try{if(us.existsSync(s)){let c=us.readFileSync(s,"utf8").trim();if(c)return xFt(e),us.writeFileSync(i,c,"utf8"),us.unlinkSync(s),c}}catch(c){console.error(`Failed to migrate workspace installation ID: ${c}`)}let o=AFt.randomUUID();try{xFt(e),us.writeFileSync(i,o,"utf8")}catch(c){console.error(`Failed to write installation ID file: ${c}`)}return o}function xFt(n){us.existsSync(n)||us.mkdirSync(n,{recursive:!0})}function VRn(n){let e=oU.join(n,RFt);try{us.existsSync(e)&&us.unlinkSync(e)}catch{}}function Mte(n,e,i){if(!n||n.trim()==="")return null;try{let s=aU(e);return new F1e(n,s,i)}catch(s){return console.error(`Failed to initialize MCP usage telemetry: ${s}`),null}}var h2e=Te(require("crypto"));var kr;(function(n){n.assertEqual=o=>{};function e(o){}n.assertIs=e;function i(o){throw new Error}n.assertNever=i,n.arrayToEnum=o=>{let c={};for(let r of o)c[r]=r;return c},n.getValidEnumValues=o=>{let c=n.objectKeys(o).filter(t=>typeof o[o[t]]!="number"),r={};for(let t of c)r[t]=o[t];return n.objectValues(r)},n.objectValues=o=>n.objectKeys(o).map(function(c){return o[c]}),n.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let c=[];for(let r in o)Object.prototype.hasOwnProperty.call(o,r)&&c.push(r);return c},n.find=(o,c)=>{for(let r of o)if(c(r))return r},n.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function s(o,c=" | "){return o.map(r=>typeof r=="string"?`'${r}'`:r).join(c)}n.joinValues=s,n.jsonStringifyReplacer=(o,c)=>typeof c=="bigint"?c.toString():c})(kr||(kr={}));var NFt;(function(n){n.mergeShapes=(e,i)=>({...e,...i})})(NFt||(NFt={}));var Xe=kr.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),qm=n=>{switch(typeof n){case"undefined":return Xe.undefined;case"string":return Xe.string;case"number":return Number.isNaN(n)?Xe.nan:Xe.number;case"boolean":return Xe.boolean;case"function":return Xe.function;case"bigint":return Xe.bigint;case"symbol":return Xe.symbol;case"object":return Array.isArray(n)?Xe.array:n===null?Xe.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?Xe.promise:typeof Map<"u"&&n instanceof Map?Xe.map:typeof Set<"u"&&n instanceof Set?Xe.set:typeof Date<"u"&&n instanceof Date?Xe.date:Xe.object;default:return Xe.unknown}};var Oe=kr.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);var fu=class n extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};let i=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,i):this.__proto__=i,this.name="ZodError",this.issues=e}format(e){let i=e||function(c){return c.message},s={_errors:[]},o=c=>{for(let r of c.issues)if(r.code==="invalid_union")r.unionErrors.map(o);else if(r.code==="invalid_return_type")o(r.returnTypeError);else if(r.code==="invalid_arguments")o(r.argumentsError);else if(r.path.length===0)s._errors.push(i(r));else{let t=s,a=0;for(;a<r.path.length;){let u=r.path[a];a===r.path.length-1?(t[u]=t[u]||{_errors:[]},t[u]._errors.push(i(r))):t[u]=t[u]||{_errors:[]},t=t[u],a++}}};return o(this),s}static assert(e){if(!(e instanceof n))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,kr.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=i=>i.message){let i=Object.create(null),s=[];for(let o of this.issues)if(o.path.length>0){let c=o.path[0];i[c]=i[c]||[],i[c].push(e(o))}else s.push(e(o));return{formErrors:s,fieldErrors:i}}get formErrors(){return this.flatten()}};fu.create=n=>new fu(n);var FRn=(n,e)=>{let i;switch(n.code){case Oe.invalid_type:n.received===Xe.undefined?i="Required":i=`Expected ${n.expected}, received ${n.received}`;break;case Oe.invalid_literal:i=`Invalid literal value, expected ${JSON.stringify(n.expected,kr.jsonStringifyReplacer)}`;break;case Oe.unrecognized_keys:i=`Unrecognized key(s) in object: ${kr.joinValues(n.keys,", ")}`;break;case Oe.invalid_union:i="Invalid input";break;case Oe.invalid_union_discriminator:i=`Invalid discriminator value. Expected ${kr.joinValues(n.options)}`;break;case Oe.invalid_enum_value:i=`Invalid enum value. Expected ${kr.joinValues(n.options)}, received '${n.received}'`;break;case Oe.invalid_arguments:i="Invalid function arguments";break;case Oe.invalid_return_type:i="Invalid function return type";break;case Oe.invalid_date:i="Invalid date";break;case Oe.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(i=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(i=`${i} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?i=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?i=`Invalid input: must end with "${n.validation.endsWith}"`:kr.assertNever(n.validation):n.validation!=="regex"?i=`Invalid ${n.validation}`:i="Invalid";break;case Oe.too_small:n.type==="array"?i=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?i=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?i=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="bigint"?i=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?i=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:i="Invalid input";break;case Oe.too_big:n.type==="array"?i=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?i=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?i=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?i=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?i=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:i="Invalid input";break;case Oe.custom:i="Invalid input";break;case Oe.invalid_intersection_types:i="Intersection results could not be merged";break;case Oe.not_multiple_of:i=`Number must be a multiple of ${n.multipleOf}`;break;case Oe.not_finite:i="Number must be finite";break;default:i=e.defaultError,kr.assertNever(n)}return{message:i}},mv=FRn;var $Rn=mv;function sU(){return $Rn}var Lte=n=>{let{data:e,path:i,errorMaps:s,issueData:o}=n,c=[...i,...o.path||[]],r={...o,path:c};if(o.message!==void 0)return{...o,path:c,message:o.message};let t="",a=s.filter(u=>!!u).slice().reverse();for(let u of a)t=u(r,{data:e,defaultError:t}).message;return{...o,path:c,message:t}};function Ve(n,e){let i=sU(),s=Lte({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,i,i===mv?void 0:mv].filter(o=>!!o)});n.common.issues.push(s)}var ls=class n{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,i){let s=[];for(let o of i){if(o.status==="aborted")return Ct;o.status==="dirty"&&e.dirty(),s.push(o.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,i){let s=[];for(let o of i){let c=await o.key,r=await o.value;s.push({key:c,value:r})}return n.mergeObjectSync(e,s)}static mergeObjectSync(e,i){let s={};for(let o of i){let{key:c,value:r}=o;if(c.status==="aborted"||r.status==="aborted")return Ct;c.status==="dirty"&&e.dirty(),r.status==="dirty"&&e.dirty(),c.value!=="__proto__"&&(typeof r.value<"u"||o.alwaysSet)&&(s[c.value]=r.value)}return{status:e.value,value:s}}},Ct=Object.freeze({status:"aborted"}),mR=n=>({status:"dirty",value:n}),Ds=n=>({status:"valid",value:n}),$1e=n=>n.status==="aborted",z1e=n=>n.status==="dirty",QT=n=>n.status==="valid",cU=n=>typeof Promise<"u"&&n instanceof Promise;var ot;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e?.message})(ot||(ot={}));var Xl=class{constructor(e,i,s,o){this._cachedPath=[],this.parent=e,this.data=i,this._path=s,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},IFt=(n,e)=>{if(QT(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let i=new fu(n.common.issues);return this._error=i,this._error}}};function er(n){if(!n)return{};let{errorMap:e,invalid_type_error:i,required_error:s,description:o}=n;if(e&&(i||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(r,t)=>{let{message:a}=n;return r.code==="invalid_enum_value"?{message:a??t.defaultError}:typeof t.data>"u"?{message:a??s??t.defaultError}:r.code!=="invalid_type"?{message:t.defaultError}:{message:a??i??t.defaultError}},description:o}}var mr=class{get description(){return this._def.description}_getType(e){return qm(e.data)}_getOrReturnCtx(e,i){return i||{common:e.parent.common,data:e.data,parsedType:qm(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ls,ctx:{common:e.parent.common,data:e.data,parsedType:qm(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let i=this._parse(e);if(cU(i))throw new Error("Synchronous parse encountered promise.");return i}_parseAsync(e){let i=this._parse(e);return Promise.resolve(i)}parse(e,i){let s=this.safeParse(e,i);if(s.success)return s.data;throw s.error}safeParse(e,i){let s={common:{issues:[],async:i?.async??!1,contextualErrorMap:i?.errorMap},path:i?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:qm(e)},o=this._parseSync({data:e,path:s.path,parent:s});return IFt(s,o)}"~validate"(e){let i={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:qm(e)};if(!this["~standard"].async)try{let s=this._parseSync({data:e,path:[],parent:i});return QT(s)?{value:s.value}:{issues:i.common.issues}}catch(s){s?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),i.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:i}).then(s=>QT(s)?{value:s.value}:{issues:i.common.issues})}async parseAsync(e,i){let s=await this.safeParseAsync(e,i);if(s.success)return s.data;throw s.error}async safeParseAsync(e,i){let s={common:{issues:[],contextualErrorMap:i?.errorMap,async:!0},path:i?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:qm(e)},o=this._parse({data:e,path:s.path,parent:s}),c=await(cU(o)?o:Promise.resolve(o));return IFt(s,c)}refine(e,i){let s=o=>typeof i=="string"||typeof i>"u"?{message:i}:typeof i=="function"?i(o):i;return this._refinement((o,c)=>{let r=e(o),t=()=>c.addIssue({code:Oe.custom,...s(o)});return typeof Promise<"u"&&r instanceof Promise?r.then(a=>a?!0:(t(),!1)):r?!0:(t(),!1)})}refinement(e,i){return this._refinement((s,o)=>e(s)?!0:(o.addIssue(typeof i=="function"?i(s,o):i),!1))}_refinement(e){return new od({schema:this,typeName:Re.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:i=>this["~validate"](i)}}optional(){return id.create(this,this._def)}nullable(){return Vm.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return gv.create(this)}promise(){return eS.create(this,this._def)}or(e){return bR.create([this,e],this._def)}and(e){return TR.create(this,e,this._def)}transform(e){return new od({...er(this._def),schema:this,typeName:Re.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let i=typeof e=="function"?e:()=>e;return new AR({...er(this._def),innerType:this,defaultValue:i,typeName:Re.ZodDefault})}brand(){return new kte({typeName:Re.ZodBranded,type:this,...er(this._def)})}catch(e){let i=typeof e=="function"?e:()=>e;return new PR({...er(this._def),innerType:this,catchValue:i,typeName:Re.ZodCatch})}describe(e){let i=this.constructor;return new i({...this._def,description:e})}pipe(e){return Dte.create(this,e)}readonly(){return RR.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},zRn=/^c[^\s-]{8,}$/i,HRn=/^[0-9a-z]+$/,GRn=/^[0-9A-HJKMNP-TV-Z]{26}$/i,KRn=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,YRn=/^[a-z0-9_-]{21}$/i,WRn=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,JRn=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,ZRn=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,XRn="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",H1e,QRn=/^(?:(?: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])$/,eNn=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,tNn=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,rNn=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,nNn=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,iNn=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,wFt="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",oNn=new RegExp(`^${wFt}$`);function CFt(n){let e="[0-5]\\d";n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`);let i=n.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${i}`}function aNn(n){return new RegExp(`^${CFt(n)}$`)}function sNn(n){let e=`${wFt}T${CFt(n)}`,i=[];return i.push(n.local?"Z?":"Z"),n.offset&&i.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${i.join("|")})`,new RegExp(`^${e}$`)}function cNn(n,e){return!!((e==="v4"||!e)&&QRn.test(n)||(e==="v6"||!e)&&tNn.test(n))}function uNn(n,e){if(!WRn.test(n))return!1;try{let[i]=n.split(".");if(!i)return!1;let s=i.replace(/-/g,"+").replace(/_/g,"/").padEnd(i.length+(4-i.length%4)%4,"="),o=JSON.parse(atob(s));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function lNn(n,e){return!!((e==="v4"||!e)&&eNn.test(n)||(e==="v6"||!e)&&rNn.test(n))}var gR=class n extends mr{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Xe.string){let c=this._getOrReturnCtx(e);return Ve(c,{code:Oe.invalid_type,expected:Xe.string,received:c.parsedType}),Ct}let s=new ls,o;for(let c of this._def.checks)if(c.kind==="min")e.data.length<c.value&&(o=this._getOrReturnCtx(e,o),Ve(o,{code:Oe.too_small,minimum:c.value,type:"string",inclusive:!0,exact:!1,message:c.message}),s.dirty());else if(c.kind==="max")e.data.length>c.value&&(o=this._getOrReturnCtx(e,o),Ve(o,{code:Oe.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!1,message:c.message}),s.dirty());else if(c.kind==="length"){let r=e.data.length>c.value,t=e.data.length<c.value;(r||t)&&(o=this._getOrReturnCtx(e,o),r?Ve(o,{code:Oe.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}):t&&Ve(o,{code:Oe.too_small,minimum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}),s.dirty())}else if(c.kind==="email")ZRn.test(e.data)||(o=this._getOrReturnCtx(e,o),Ve(o,{validation:"email",code:Oe.invalid_string,message:c.message}),s.dirty());else if(c.kind==="emoji")H1e||(H1e=new RegExp(XRn,"u")),H1e.test(e.data)||(o=this._getOrReturnCtx(e,o),Ve(o,{validation:"emoji",code:Oe.invalid_string,message:c.message}),s.dirty());else if(c.kind==="uuid")KRn.test(e.data)||(o=this._getOrReturnCtx(e,o),Ve(o,{validation:"uuid",code:Oe.invalid_string,message:c.message}),s.dirty());else if(c.kind==="nanoid")YRn.test(e.data)||(o=this._getOrReturnCtx(e,o),Ve(o,{validation:"nanoid",code:Oe.invalid_string,message:c.message}),s.dirty());else if(c.kind==="cuid")zRn.test(e.data)||(o=this._getOrReturnCtx(e,o),Ve(o,{validation:"cuid",code:Oe.invalid_string,message:c.message}),s.dirty());else if(c.kind==="cuid2")HRn.test(e.data)||(o=this._getOrReturnCtx(e,o),Ve(o,{validation:"cuid2",code:Oe.invalid_string,message:c.message}),s.dirty());else if(c.kind==="ulid")GRn.test(e.data)||(o=this._getOrReturnCtx(e,o),Ve(o,{validation:"ulid",code:Oe.invalid_string,message:c.message}),s.dirty());else if(c.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),Ve(o,{validation:"url",code:Oe.invalid_string,message:c.message}),s.dirty()}else c.kind==="regex"?(c.regex.lastIndex=0,c.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),Ve(o,{validation:"regex",code:Oe.invalid_string,message:c.message}),s.dirty())):c.kind==="trim"?e.data=e.data.trim():c.kind==="includes"?e.data.includes(c.value,c.position)||(o=this._getOrReturnCtx(e,o),Ve(o,{code:Oe.invalid_string,validation:{includes:c.value,position:c.position},message:c.message}),s.dirty()):c.kind==="toLowerCase"?e.data=e.data.toLowerCase():c.kind==="toUpperCase"?e.data=e.data.toUpperCase():c.kind==="startsWith"?e.data.startsWith(c.value)||(o=this._getOrReturnCtx(e,o),Ve(o,{code:Oe.invalid_string,validation:{startsWith:c.value},message:c.message}),s.dirty()):c.kind==="endsWith"?e.data.endsWith(c.value)||(o=this._getOrReturnCtx(e,o),Ve(o,{code:Oe.invalid_string,validation:{endsWith:c.value},message:c.message}),s.dirty()):c.kind==="datetime"?sNn(c).test(e.data)||(o=this._getOrReturnCtx(e,o),Ve(o,{code:Oe.invalid_string,validation:"datetime",message:c.message}),s.dirty()):c.kind==="date"?oNn.test(e.data)||(o=this._getOrReturnCtx(e,o),Ve(o,{code:Oe.invalid_string,validation:"date",message:c.message}),s.dirty()):c.kind==="time"?aNn(c).test(e.data)||(o=this._getOrReturnCtx(e,o),Ve(o,{code:Oe.invalid_string,validation:"time",message:c.message}),s.dirty()):c.kind==="duration"?JRn.test(e.data)||(o=this._getOrReturnCtx(e,o),Ve(o,{validation:"duration",code:Oe.invalid_string,message:c.message}),s.dirty()):c.kind==="ip"?cNn(e.data,c.version)||(o=this._getOrReturnCtx(e,o),Ve(o,{validation:"ip",code:Oe.invalid_string,message:c.message}),s.dirty()):c.kind==="jwt"?uNn(e.data,c.alg)||(o=this._getOrReturnCtx(e,o),Ve(o,{validation:"jwt",code:Oe.invalid_string,message:c.message}),s.dirty()):c.kind==="cidr"?lNn(e.data,c.version)||(o=this._getOrReturnCtx(e,o),Ve(o,{validation:"cidr",code:Oe.invalid_string,message:c.message}),s.dirty()):c.kind==="base64"?nNn.test(e.data)||(o=this._getOrReturnCtx(e,o),Ve(o,{validation:"base64",code:Oe.invalid_string,message:c.message}),s.dirty()):c.kind==="base64url"?iNn.test(e.data)||(o=this._getOrReturnCtx(e,o),Ve(o,{validation:"base64url",code:Oe.invalid_string,message:c.message}),s.dirty()):kr.assertNever(c);return{status:s.value,value:e.data}}_regex(e,i,s){return this.refinement(o=>e.test(o),{validation:i,code:Oe.invalid_string,...ot.errToObj(s)})}_addCheck(e){return new n({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ot.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ot.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ot.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ot.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ot.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ot.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ot.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ot.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ot.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...ot.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...ot.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ot.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...ot.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...ot.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...ot.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...ot.errToObj(e)})}regex(e,i){return this._addCheck({kind:"regex",regex:e,...ot.errToObj(i)})}includes(e,i){return this._addCheck({kind:"includes",value:e,position:i?.position,...ot.errToObj(i?.message)})}startsWith(e,i){return this._addCheck({kind:"startsWith",value:e,...ot.errToObj(i)})}endsWith(e,i){return this._addCheck({kind:"endsWith",value:e,...ot.errToObj(i)})}min(e,i){return this._addCheck({kind:"min",value:e,...ot.errToObj(i)})}max(e,i){return this._addCheck({kind:"max",value:e,...ot.errToObj(i)})}length(e,i){return this._addCheck({kind:"length",value:e,...ot.errToObj(i)})}nonempty(e){return this.min(1,ot.errToObj(e))}trim(){return new n({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new n({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new n({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let i of this._def.checks)i.kind==="min"&&(e===null||i.value>e)&&(e=i.value);return e}get maxLength(){let e=null;for(let i of this._def.checks)i.kind==="max"&&(e===null||i.value<e)&&(e=i.value);return e}};gR.create=n=>new gR({checks:[],typeName:Re.ZodString,coerce:n?.coerce??!1,...er(n)});function pNn(n,e){let i=(n.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,o=i>s?i:s,c=Number.parseInt(n.toFixed(o).replace(".","")),r=Number.parseInt(e.toFixed(o).replace(".",""));return c%r/10**o}var uU=class n extends mr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Xe.number){let c=this._getOrReturnCtx(e);return Ve(c,{code:Oe.invalid_type,expected:Xe.number,received:c.parsedType}),Ct}let s,o=new ls;for(let c of this._def.checks)c.kind==="int"?kr.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),Ve(s,{code:Oe.invalid_type,expected:"integer",received:"float",message:c.message}),o.dirty()):c.kind==="min"?(c.inclusive?e.data<c.value:e.data<=c.value)&&(s=this._getOrReturnCtx(e,s),Ve(s,{code:Oe.too_small,minimum:c.value,type:"number",inclusive:c.inclusive,exact:!1,message:c.message}),o.dirty()):c.kind==="max"?(c.inclusive?e.data>c.value:e.data>=c.value)&&(s=this._getOrReturnCtx(e,s),Ve(s,{code:Oe.too_big,maximum:c.value,type:"number",inclusive:c.inclusive,exact:!1,message:c.message}),o.dirty()):c.kind==="multipleOf"?pNn(e.data,c.value)!==0&&(s=this._getOrReturnCtx(e,s),Ve(s,{code:Oe.not_multiple_of,multipleOf:c.value,message:c.message}),o.dirty()):c.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),Ve(s,{code:Oe.not_finite,message:c.message}),o.dirty()):kr.assertNever(c);return{status:o.value,value:e.data}}gte(e,i){return this.setLimit("min",e,!0,ot.toString(i))}gt(e,i){return this.setLimit("min",e,!1,ot.toString(i))}lte(e,i){return this.setLimit("max",e,!0,ot.toString(i))}lt(e,i){return this.setLimit("max",e,!1,ot.toString(i))}setLimit(e,i,s,o){return new n({...this._def,checks:[...this._def.checks,{kind:e,value:i,inclusive:s,message:ot.toString(o)}]})}_addCheck(e){return new n({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ot.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ot.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ot.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ot.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ot.toString(e)})}multipleOf(e,i){return this._addCheck({kind:"multipleOf",value:e,message:ot.toString(i)})}finite(e){return this._addCheck({kind:"finite",message:ot.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ot.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ot.toString(e)})}get minValue(){let e=null;for(let i of this._def.checks)i.kind==="min"&&(e===null||i.value>e)&&(e=i.value);return e}get maxValue(){let e=null;for(let i of this._def.checks)i.kind==="max"&&(e===null||i.value<e)&&(e=i.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&kr.isInteger(e.value))}get isFinite(){let e=null,i=null;for(let s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(i===null||s.value>i)&&(i=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(i)&&Number.isFinite(e)}};uU.create=n=>new uU({checks:[],typeName:Re.ZodNumber,coerce:n?.coerce||!1,...er(n)});var lU=class n extends mr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Xe.bigint)return this._getInvalidInput(e);let s,o=new ls;for(let c of this._def.checks)c.kind==="min"?(c.inclusive?e.data<c.value:e.data<=c.value)&&(s=this._getOrReturnCtx(e,s),Ve(s,{code:Oe.too_small,type:"bigint",minimum:c.value,inclusive:c.inclusive,message:c.message}),o.dirty()):c.kind==="max"?(c.inclusive?e.data>c.value:e.data>=c.value)&&(s=this._getOrReturnCtx(e,s),Ve(s,{code:Oe.too_big,type:"bigint",maximum:c.value,inclusive:c.inclusive,message:c.message}),o.dirty()):c.kind==="multipleOf"?e.data%c.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),Ve(s,{code:Oe.not_multiple_of,multipleOf:c.value,message:c.message}),o.dirty()):kr.assertNever(c);return{status:o.value,value:e.data}}_getInvalidInput(e){let i=this._getOrReturnCtx(e);return Ve(i,{code:Oe.invalid_type,expected:Xe.bigint,received:i.parsedType}),Ct}gte(e,i){return this.setLimit("min",e,!0,ot.toString(i))}gt(e,i){return this.setLimit("min",e,!1,ot.toString(i))}lte(e,i){return this.setLimit("max",e,!0,ot.toString(i))}lt(e,i){return this.setLimit("max",e,!1,ot.toString(i))}setLimit(e,i,s,o){return new n({...this._def,checks:[...this._def.checks,{kind:e,value:i,inclusive:s,message:ot.toString(o)}]})}_addCheck(e){return new n({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ot.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ot.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ot.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ot.toString(e)})}multipleOf(e,i){return this._addCheck({kind:"multipleOf",value:e,message:ot.toString(i)})}get minValue(){let e=null;for(let i of this._def.checks)i.kind==="min"&&(e===null||i.value>e)&&(e=i.value);return e}get maxValue(){let e=null;for(let i of this._def.checks)i.kind==="max"&&(e===null||i.value<e)&&(e=i.value);return e}};lU.create=n=>new lU({checks:[],typeName:Re.ZodBigInt,coerce:n?.coerce??!1,...er(n)});var pU=class extends mr{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Xe.boolean){let s=this._getOrReturnCtx(e);return Ve(s,{code:Oe.invalid_type,expected:Xe.boolean,received:s.parsedType}),Ct}return Ds(e.data)}};pU.create=n=>new pU({typeName:Re.ZodBoolean,coerce:n?.coerce||!1,...er(n)});var dU=class n extends mr{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Xe.date){let c=this._getOrReturnCtx(e);return Ve(c,{code:Oe.invalid_type,expected:Xe.date,received:c.parsedType}),Ct}if(Number.isNaN(e.data.getTime())){let c=this._getOrReturnCtx(e);return Ve(c,{code:Oe.invalid_date}),Ct}let s=new ls,o;for(let c of this._def.checks)c.kind==="min"?e.data.getTime()<c.value&&(o=this._getOrReturnCtx(e,o),Ve(o,{code:Oe.too_small,message:c.message,inclusive:!0,exact:!1,minimum:c.value,type:"date"}),s.dirty()):c.kind==="max"?e.data.getTime()>c.value&&(o=this._getOrReturnCtx(e,o),Ve(o,{code:Oe.too_big,message:c.message,inclusive:!0,exact:!1,maximum:c.value,type:"date"}),s.dirty()):kr.assertNever(c);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new n({...this._def,checks:[...this._def.checks,e]})}min(e,i){return this._addCheck({kind:"min",value:e.getTime(),message:ot.toString(i)})}max(e,i){return this._addCheck({kind:"max",value:e.getTime(),message:ot.toString(i)})}get minDate(){let e=null;for(let i of this._def.checks)i.kind==="min"&&(e===null||i.value>e)&&(e=i.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let i of this._def.checks)i.kind==="max"&&(e===null||i.value<e)&&(e=i.value);return e!=null?new Date(e):null}};dU.create=n=>new dU({checks:[],coerce:n?.coerce||!1,typeName:Re.ZodDate,...er(n)});var fU=class extends mr{_parse(e){if(this._getType(e)!==Xe.symbol){let s=this._getOrReturnCtx(e);return Ve(s,{code:Oe.invalid_type,expected:Xe.symbol,received:s.parsedType}),Ct}return Ds(e.data)}};fU.create=n=>new fU({typeName:Re.ZodSymbol,...er(n)});var vR=class extends mr{_parse(e){if(this._getType(e)!==Xe.undefined){let s=this._getOrReturnCtx(e);return Ve(s,{code:Oe.invalid_type,expected:Xe.undefined,received:s.parsedType}),Ct}return Ds(e.data)}};vR.create=n=>new vR({typeName:Re.ZodUndefined,...er(n)});var _R=class extends mr{_parse(e){if(this._getType(e)!==Xe.null){let s=this._getOrReturnCtx(e);return Ve(s,{code:Oe.invalid_type,expected:Xe.null,received:s.parsedType}),Ct}return Ds(e.data)}};_R.create=n=>new _R({typeName:Re.ZodNull,...er(n)});var hU=class extends mr{constructor(){super(...arguments),this._any=!0}_parse(e){return Ds(e.data)}};hU.create=n=>new hU({typeName:Re.ZodAny,...er(n)});var yv=class extends mr{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ds(e.data)}};yv.create=n=>new yv({typeName:Re.ZodUnknown,...er(n)});var bh=class extends mr{_parse(e){let i=this._getOrReturnCtx(e);return Ve(i,{code:Oe.invalid_type,expected:Xe.never,received:i.parsedType}),Ct}};bh.create=n=>new bh({typeName:Re.ZodNever,...er(n)});var mU=class extends mr{_parse(e){if(this._getType(e)!==Xe.undefined){let s=this._getOrReturnCtx(e);return Ve(s,{code:Oe.invalid_type,expected:Xe.void,received:s.parsedType}),Ct}return Ds(e.data)}};mU.create=n=>new mU({typeName:Re.ZodVoid,...er(n)});var gv=class n extends mr{_parse(e){let{ctx:i,status:s}=this._processInputParams(e),o=this._def;if(i.parsedType!==Xe.array)return Ve(i,{code:Oe.invalid_type,expected:Xe.array,received:i.parsedType}),Ct;if(o.exactLength!==null){let r=i.data.length>o.exactLength.value,t=i.data.length<o.exactLength.value;(r||t)&&(Ve(i,{code:r?Oe.too_big:Oe.too_small,minimum:t?o.exactLength.value:void 0,maximum:r?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),s.dirty())}if(o.minLength!==null&&i.data.length<o.minLength.value&&(Ve(i,{code:Oe.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),s.dirty()),o.maxLength!==null&&i.data.length>o.maxLength.value&&(Ve(i,{code:Oe.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),s.dirty()),i.common.async)return Promise.all([...i.data].map((r,t)=>o.type._parseAsync(new Xl(i,r,i.path,t)))).then(r=>ls.mergeArray(s,r));let c=[...i.data].map((r,t)=>o.type._parseSync(new Xl(i,r,i.path,t)));return ls.mergeArray(s,c)}get element(){return this._def.type}min(e,i){return new n({...this._def,minLength:{value:e,message:ot.toString(i)}})}max(e,i){return new n({...this._def,maxLength:{value:e,message:ot.toString(i)}})}length(e,i){return new n({...this._def,exactLength:{value:e,message:ot.toString(i)}})}nonempty(e){return this.min(1,e)}};gv.create=(n,e)=>new gv({type:n,minLength:null,maxLength:null,exactLength:null,typeName:Re.ZodArray,...er(e)});function yR(n){if(n instanceof hu){let e={};for(let i in n.shape){let s=n.shape[i];e[i]=id.create(yR(s))}return new hu({...n._def,shape:()=>e})}else return n instanceof gv?new gv({...n._def,type:yR(n.element)}):n instanceof id?id.create(yR(n.unwrap())):n instanceof Vm?Vm.create(yR(n.unwrap())):n instanceof Bm?Bm.create(n.items.map(e=>yR(e))):n}var hu=class n extends mr{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),i=kr.objectKeys(e);return this._cached={shape:e,keys:i},this._cached}_parse(e){if(this._getType(e)!==Xe.object){let u=this._getOrReturnCtx(e);return Ve(u,{code:Oe.invalid_type,expected:Xe.object,received:u.parsedType}),Ct}let{status:s,ctx:o}=this._processInputParams(e),{shape:c,keys:r}=this._getCached(),t=[];if(!(this._def.catchall instanceof bh&&this._def.unknownKeys==="strip"))for(let u in o.data)r.includes(u)||t.push(u);let a=[];for(let u of r){let l=c[u],p=o.data[u];a.push({key:{status:"valid",value:u},value:l._parse(new Xl(o,p,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof bh){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of t)a.push({key:{status:"valid",value:l},value:{status:"valid",value:o.data[l]}});else if(u==="strict")t.length>0&&(Ve(o,{code:Oe.unrecognized_keys,keys:t}),s.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let l of t){let p=o.data[l];a.push({key:{status:"valid",value:l},value:u._parse(new Xl(o,p,o.path,l)),alwaysSet:l in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let u=[];for(let l of a){let p=await l.key,d=await l.value;u.push({key:p,value:d,alwaysSet:l.alwaysSet})}return u}).then(u=>ls.mergeObjectSync(s,u)):ls.mergeObjectSync(s,a)}get shape(){return this._def.shape()}strict(e){return ot.errToObj,new n({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(i,s)=>{let o=this._def.errorMap?.(i,s).message??s.defaultError;return i.code==="unrecognized_keys"?{message:ot.errToObj(e).message??o}:{message:o}}}:{}})}strip(){return new n({...this._def,unknownKeys:"strip"})}passthrough(){return new n({...this._def,unknownKeys:"passthrough"})}extend(e){return new n({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new n({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Re.ZodObject})}setKey(e,i){return this.augment({[e]:i})}catchall(e){return new n({...this._def,catchall:e})}pick(e){let i={};for(let s of kr.objectKeys(e))e[s]&&this.shape[s]&&(i[s]=this.shape[s]);return new n({...this._def,shape:()=>i})}omit(e){let i={};for(let s of kr.objectKeys(this.shape))e[s]||(i[s]=this.shape[s]);return new n({...this._def,shape:()=>i})}deepPartial(){return yR(this)}partial(e){let i={};for(let s of kr.objectKeys(this.shape)){let o=this.shape[s];e&&!e[s]?i[s]=o:i[s]=o.optional()}return new n({...this._def,shape:()=>i})}required(e){let i={};for(let s of kr.objectKeys(this.shape))if(e&&!e[s])i[s]=this.shape[s];else{let c=this.shape[s];for(;c instanceof id;)c=c._def.innerType;i[s]=c}return new n({...this._def,shape:()=>i})}keyof(){return MFt(kr.objectKeys(this.shape))}};hu.create=(n,e)=>new hu({shape:()=>n,unknownKeys:"strip",catchall:bh.create(),typeName:Re.ZodObject,...er(e)});hu.strictCreate=(n,e)=>new hu({shape:()=>n,unknownKeys:"strict",catchall:bh.create(),typeName:Re.ZodObject,...er(e)});hu.lazycreate=(n,e)=>new hu({shape:n,unknownKeys:"strip",catchall:bh.create(),typeName:Re.ZodObject,...er(e)});var bR=class extends mr{_parse(e){let{ctx:i}=this._processInputParams(e),s=this._def.options;function o(c){for(let t of c)if(t.result.status==="valid")return t.result;for(let t of c)if(t.result.status==="dirty")return i.common.issues.push(...t.ctx.common.issues),t.result;let r=c.map(t=>new fu(t.ctx.common.issues));return Ve(i,{code:Oe.invalid_union,unionErrors:r}),Ct}if(i.common.async)return Promise.all(s.map(async c=>{let r={...i,common:{...i.common,issues:[]},parent:null};return{result:await c._parseAsync({data:i.data,path:i.path,parent:r}),ctx:r}})).then(o);{let c,r=[];for(let a of s){let u={...i,common:{...i.common,issues:[]},parent:null},l=a._parseSync({data:i.data,path:i.path,parent:u});if(l.status==="valid")return l;l.status==="dirty"&&!c&&(c={result:l,ctx:u}),u.common.issues.length&&r.push(u.common.issues)}if(c)return i.common.issues.push(...c.ctx.common.issues),c.result;let t=r.map(a=>new fu(a));return Ve(i,{code:Oe.invalid_union,unionErrors:t}),Ct}}get options(){return this._def.options}};bR.create=(n,e)=>new bR({options:n,typeName:Re.ZodUnion,...er(e)});var jm=n=>n instanceof SR?jm(n.schema):n instanceof od?jm(n.innerType()):n instanceof ER?[n.value]:n instanceof OR?n.options:n instanceof xR?kr.objectValues(n.enum):n instanceof AR?jm(n._def.innerType):n instanceof vR?[void 0]:n instanceof _R?[null]:n instanceof id?[void 0,...jm(n.unwrap())]:n instanceof Vm?[null,...jm(n.unwrap())]:n instanceof kte||n instanceof RR?jm(n.unwrap()):n instanceof PR?jm(n._def.innerType):[],G1e=class n extends mr{_parse(e){let{ctx:i}=this._processInputParams(e);if(i.parsedType!==Xe.object)return Ve(i,{code:Oe.invalid_type,expected:Xe.object,received:i.parsedType}),Ct;let s=this.discriminator,o=i.data[s],c=this.optionsMap.get(o);return c?i.common.async?c._parseAsync({data:i.data,path:i.path,parent:i}):c._parseSync({data:i.data,path:i.path,parent:i}):(Ve(i,{code:Oe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),Ct)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,i,s){let o=new Map;for(let c of i){let r=jm(c.shape[e]);if(!r.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let t of r){if(o.has(t))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(t)}`);o.set(t,c)}}return new n({typeName:Re.ZodDiscriminatedUnion,discriminator:e,options:i,optionsMap:o,...er(s)})}};function K1e(n,e){let i=qm(n),s=qm(e);if(n===e)return{valid:!0,data:n};if(i===Xe.object&&s===Xe.object){let o=kr.objectKeys(e),c=kr.objectKeys(n).filter(t=>o.indexOf(t)!==-1),r={...n,...e};for(let t of c){let a=K1e(n[t],e[t]);if(!a.valid)return{valid:!1};r[t]=a.data}return{valid:!0,data:r}}else if(i===Xe.array&&s===Xe.array){if(n.length!==e.length)return{valid:!1};let o=[];for(let c=0;c<n.length;c++){let r=n[c],t=e[c],a=K1e(r,t);if(!a.valid)return{valid:!1};o.push(a.data)}return{valid:!0,data:o}}else return i===Xe.date&&s===Xe.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}var TR=class extends mr{_parse(e){let{status:i,ctx:s}=this._processInputParams(e),o=(c,r)=>{if($1e(c)||$1e(r))return Ct;let t=K1e(c.value,r.value);return t.valid?((z1e(c)||z1e(r))&&i.dirty(),{status:i.value,value:t.data}):(Ve(s,{code:Oe.invalid_intersection_types}),Ct)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([c,r])=>o(c,r)):o(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}};TR.create=(n,e,i)=>new TR({left:n,right:e,typeName:Re.ZodIntersection,...er(i)});var Bm=class n extends mr{_parse(e){let{status:i,ctx:s}=this._processInputParams(e);if(s.parsedType!==Xe.array)return Ve(s,{code:Oe.invalid_type,expected:Xe.array,received:s.parsedType}),Ct;if(s.data.length<this._def.items.length)return Ve(s,{code:Oe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ct;!this._def.rest&&s.data.length>this._def.items.length&&(Ve(s,{code:Oe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i.dirty());let c=[...s.data].map((r,t)=>{let a=this._def.items[t]||this._def.rest;return a?a._parse(new Xl(s,r,s.path,t)):null}).filter(r=>!!r);return s.common.async?Promise.all(c).then(r=>ls.mergeArray(i,r)):ls.mergeArray(i,c)}get items(){return this._def.items}rest(e){return new n({...this._def,rest:e})}};Bm.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Bm({items:n,typeName:Re.ZodTuple,rest:null,...er(e)})};var Y1e=class n extends mr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:i,ctx:s}=this._processInputParams(e);if(s.parsedType!==Xe.object)return Ve(s,{code:Oe.invalid_type,expected:Xe.object,received:s.parsedType}),Ct;let o=[],c=this._def.keyType,r=this._def.valueType;for(let t in s.data)o.push({key:c._parse(new Xl(s,t,s.path,t)),value:r._parse(new Xl(s,s.data[t],s.path,t)),alwaysSet:t in s.data});return s.common.async?ls.mergeObjectAsync(i,o):ls.mergeObjectSync(i,o)}get element(){return this._def.valueType}static create(e,i,s){return i instanceof mr?new n({keyType:e,valueType:i,typeName:Re.ZodRecord,...er(s)}):new n({keyType:gR.create(),valueType:e,typeName:Re.ZodRecord,...er(i)})}},yU=class extends mr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:i,ctx:s}=this._processInputParams(e);if(s.parsedType!==Xe.map)return Ve(s,{code:Oe.invalid_type,expected:Xe.map,received:s.parsedType}),Ct;let o=this._def.keyType,c=this._def.valueType,r=[...s.data.entries()].map(([t,a],u)=>({key:o._parse(new Xl(s,t,s.path,[u,"key"])),value:c._parse(new Xl(s,a,s.path,[u,"value"]))}));if(s.common.async){let t=new Map;return Promise.resolve().then(async()=>{for(let a of r){let u=await a.key,l=await a.value;if(u.status==="aborted"||l.status==="aborted")return Ct;(u.status==="dirty"||l.status==="dirty")&&i.dirty(),t.set(u.value,l.value)}return{status:i.value,value:t}})}else{let t=new Map;for(let a of r){let u=a.key,l=a.value;if(u.status==="aborted"||l.status==="aborted")return Ct;(u.status==="dirty"||l.status==="dirty")&&i.dirty(),t.set(u.value,l.value)}return{status:i.value,value:t}}}};yU.create=(n,e,i)=>new yU({valueType:e,keyType:n,typeName:Re.ZodMap,...er(i)});var gU=class n extends mr{_parse(e){let{status:i,ctx:s}=this._processInputParams(e);if(s.parsedType!==Xe.set)return Ve(s,{code:Oe.invalid_type,expected:Xe.set,received:s.parsedType}),Ct;let o=this._def;o.minSize!==null&&s.data.size<o.minSize.value&&(Ve(s,{code:Oe.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),i.dirty()),o.maxSize!==null&&s.data.size>o.maxSize.value&&(Ve(s,{code:Oe.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),i.dirty());let c=this._def.valueType;function r(a){let u=new Set;for(let l of a){if(l.status==="aborted")return Ct;l.status==="dirty"&&i.dirty(),u.add(l.value)}return{status:i.value,value:u}}let t=[...s.data.values()].map((a,u)=>c._parse(new Xl(s,a,s.path,u)));return s.common.async?Promise.all(t).then(a=>r(a)):r(t)}min(e,i){return new n({...this._def,minSize:{value:e,message:ot.toString(i)}})}max(e,i){return new n({...this._def,maxSize:{value:e,message:ot.toString(i)}})}size(e,i){return this.min(e,i).max(e,i)}nonempty(e){return this.min(1,e)}};gU.create=(n,e)=>new gU({valueType:n,minSize:null,maxSize:null,typeName:Re.ZodSet,...er(e)});var W1e=class n extends mr{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:i}=this._processInputParams(e);if(i.parsedType!==Xe.function)return Ve(i,{code:Oe.invalid_type,expected:Xe.function,received:i.parsedType}),Ct;function s(t,a){return Lte({data:t,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,sU(),mv].filter(u=>!!u),issueData:{code:Oe.invalid_arguments,argumentsError:a}})}function o(t,a){return Lte({data:t,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,sU(),mv].filter(u=>!!u),issueData:{code:Oe.invalid_return_type,returnTypeError:a}})}let c={errorMap:i.common.contextualErrorMap},r=i.data;if(this._def.returns instanceof eS){let t=this;return Ds(async function(...a){let u=new fu([]),l=await t._def.args.parseAsync(a,c).catch(h=>{throw u.addIssue(s(a,h)),u}),p=await Reflect.apply(r,this,l);return await t._def.returns._def.type.parseAsync(p,c).catch(h=>{throw u.addIssue(o(p,h)),u})})}else{let t=this;return Ds(function(...a){let u=t._def.args.safeParse(a,c);if(!u.success)throw new fu([s(a,u.error)]);let l=Reflect.apply(r,this,u.data),p=t._def.returns.safeParse(l,c);if(!p.success)throw new fu([o(l,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new n({...this._def,args:Bm.create(e).rest(yv.create())})}returns(e){return new n({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,i,s){return new n({args:e||Bm.create([]).rest(yv.create()),returns:i||yv.create(),typeName:Re.ZodFunction,...er(s)})}},SR=class extends mr{get schema(){return this._def.getter()}_parse(e){let{ctx:i}=this._processInputParams(e);return this._def.getter()._parse({data:i.data,path:i.path,parent:i})}};SR.create=(n,e)=>new SR({getter:n,typeName:Re.ZodLazy,...er(e)});var ER=class extends mr{_parse(e){if(e.data!==this._def.value){let i=this._getOrReturnCtx(e);return Ve(i,{received:i.data,code:Oe.invalid_literal,expected:this._def.value}),Ct}return{status:"valid",value:e.data}}get value(){return this._def.value}};ER.create=(n,e)=>new ER({value:n,typeName:Re.ZodLiteral,...er(e)});function MFt(n,e){return new OR({values:n,typeName:Re.ZodEnum,...er(e)})}var OR=class n extends mr{_parse(e){if(typeof e.data!="string"){let i=this._getOrReturnCtx(e),s=this._def.values;return Ve(i,{expected:kr.joinValues(s),received:i.parsedType,code:Oe.invalid_type}),Ct}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let i=this._getOrReturnCtx(e),s=this._def.values;return Ve(i,{received:i.data,code:Oe.invalid_enum_value,options:s}),Ct}return Ds(e.data)}get options(){return this._def.values}get enum(){let e={};for(let i of this._def.values)e[i]=i;return e}get Values(){let e={};for(let i of this._def.values)e[i]=i;return e}get Enum(){let e={};for(let i of this._def.values)e[i]=i;return e}extract(e,i=this._def){return n.create(e,{...this._def,...i})}exclude(e,i=this._def){return n.create(this.options.filter(s=>!e.includes(s)),{...this._def,...i})}};OR.create=MFt;var xR=class extends mr{_parse(e){let i=kr.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==Xe.string&&s.parsedType!==Xe.number){let o=kr.objectValues(i);return Ve(s,{expected:kr.joinValues(o),received:s.parsedType,code:Oe.invalid_type}),Ct}if(this._cache||(this._cache=new Set(kr.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=kr.objectValues(i);return Ve(s,{received:s.data,code:Oe.invalid_enum_value,options:o}),Ct}return Ds(e.data)}get enum(){return this._def.values}};xR.create=(n,e)=>new xR({values:n,typeName:Re.ZodNativeEnum,...er(e)});var eS=class extends mr{unwrap(){return this._def.type}_parse(e){let{ctx:i}=this._processInputParams(e);if(i.parsedType!==Xe.promise&&i.common.async===!1)return Ve(i,{code:Oe.invalid_type,expected:Xe.promise,received:i.parsedType}),Ct;let s=i.parsedType===Xe.promise?i.data:Promise.resolve(i.data);return Ds(s.then(o=>this._def.type.parseAsync(o,{path:i.path,errorMap:i.common.contextualErrorMap})))}};eS.create=(n,e)=>new eS({type:n,typeName:Re.ZodPromise,...er(e)});var od=class extends mr{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Re.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:i,ctx:s}=this._processInputParams(e),o=this._def.effect||null,c={addIssue:r=>{Ve(s,r),r.fatal?i.abort():i.dirty()},get path(){return s.path}};if(c.addIssue=c.addIssue.bind(c),o.type==="preprocess"){let r=o.transform(s.data,c);if(s.common.async)return Promise.resolve(r).then(async t=>{if(i.value==="aborted")return Ct;let a=await this._def.schema._parseAsync({data:t,path:s.path,parent:s});return a.status==="aborted"?Ct:a.status==="dirty"?mR(a.value):i.value==="dirty"?mR(a.value):a});{if(i.value==="aborted")return Ct;let t=this._def.schema._parseSync({data:r,path:s.path,parent:s});return t.status==="aborted"?Ct:t.status==="dirty"?mR(t.value):i.value==="dirty"?mR(t.value):t}}if(o.type==="refinement"){let r=t=>{let a=o.refinement(t,c);if(s.common.async)return Promise.resolve(a);if(a instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return t};if(s.common.async===!1){let t=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return t.status==="aborted"?Ct:(t.status==="dirty"&&i.dirty(),r(t.value),{status:i.value,value:t.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(t=>t.status==="aborted"?Ct:(t.status==="dirty"&&i.dirty(),r(t.value).then(()=>({status:i.value,value:t.value}))))}if(o.type==="transform")if(s.common.async===!1){let r=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!QT(r))return Ct;let t=o.transform(r.value,c);if(t instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:i.value,value:t}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(r=>QT(r)?Promise.resolve(o.transform(r.value,c)).then(t=>({status:i.value,value:t})):Ct);kr.assertNever(o)}};od.create=(n,e,i)=>new od({schema:n,typeName:Re.ZodEffects,effect:e,...er(i)});od.createWithPreprocess=(n,e,i)=>new od({schema:e,effect:{type:"preprocess",transform:n},typeName:Re.ZodEffects,...er(i)});var id=class extends mr{_parse(e){return this._getType(e)===Xe.undefined?Ds(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};id.create=(n,e)=>new id({innerType:n,typeName:Re.ZodOptional,...er(e)});var Vm=class extends mr{_parse(e){return this._getType(e)===Xe.null?Ds(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Vm.create=(n,e)=>new Vm({innerType:n,typeName:Re.ZodNullable,...er(e)});var AR=class extends mr{_parse(e){let{ctx:i}=this._processInputParams(e),s=i.data;return i.parsedType===Xe.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:i.path,parent:i})}removeDefault(){return this._def.innerType}};AR.create=(n,e)=>new AR({innerType:n,typeName:Re.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...er(e)});var PR=class extends mr{_parse(e){let{ctx:i}=this._processInputParams(e),s={...i,common:{...i.common,issues:[]}},o=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return cU(o)?o.then(c=>({status:"valid",value:c.status==="valid"?c.value:this._def.catchValue({get error(){return new fu(s.common.issues)},input:s.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new fu(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}};PR.create=(n,e)=>new PR({innerType:n,typeName:Re.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...er(e)});var vU=class extends mr{_parse(e){if(this._getType(e)!==Xe.nan){let s=this._getOrReturnCtx(e);return Ve(s,{code:Oe.invalid_type,expected:Xe.nan,received:s.parsedType}),Ct}return{status:"valid",value:e.data}}};vU.create=n=>new vU({typeName:Re.ZodNaN,...er(n)});var hyi=Symbol("zod_brand"),kte=class extends mr{_parse(e){let{ctx:i}=this._processInputParams(e),s=i.data;return this._def.type._parse({data:s,path:i.path,parent:i})}unwrap(){return this._def.type}},Dte=class n extends mr{_parse(e){let{status:i,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{let c=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return c.status==="aborted"?Ct:c.status==="dirty"?(i.dirty(),mR(c.value)):this._def.out._parseAsync({data:c.value,path:s.path,parent:s})})();{let o=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?Ct:o.status==="dirty"?(i.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:s.path,parent:s})}}static create(e,i){return new n({in:e,out:i,typeName:Re.ZodPipeline})}},RR=class extends mr{_parse(e){let i=this._def.innerType._parse(e),s=o=>(QT(o)&&(o.value=Object.freeze(o.value)),o);return cU(i)?i.then(o=>s(o)):s(i)}unwrap(){return this._def.innerType}};RR.create=(n,e)=>new RR({innerType:n,typeName:Re.ZodReadonly,...er(e)});var myi={object:hu.lazycreate},Re;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(Re||(Re={}));var yyi=gR.create,gyi=uU.create,vyi=vU.create,_yi=lU.create,byi=pU.create,Tyi=dU.create,Syi=fU.create,Eyi=vR.create,Oyi=_R.create,xyi=hU.create,Ayi=yv.create,Pyi=bh.create,Ryi=mU.create,Nyi=gv.create,LFt=hu.create,Iyi=hu.strictCreate,wyi=bR.create,Cyi=G1e.create,Myi=TR.create,Lyi=Bm.create,kyi=Y1e.create,Dyi=yU.create,Uyi=gU.create,qyi=W1e.create,jyi=SR.create,Byi=ER.create,Vyi=OR.create,Fyi=xR.create,$yi=eS.create,zyi=od.create,Hyi=id.create,Gyi=Vm.create,Kyi=od.createWithPreprocess,Yyi=Dte.create;var yu={};gn(yu,{$ZodAny:()=>Dre,$ZodArray:()=>Vre,$ZodAsyncError:()=>ad,$ZodBase64:()=>Are,$ZodBase64URL:()=>Pre,$ZodBigInt:()=>CU,$ZodBigIntFormat:()=>Cre,$ZodBoolean:()=>jR,$ZodCIDRv4:()=>Ore,$ZodCIDRv6:()=>xre,$ZodCUID:()=>dre,$ZodCUID2:()=>fre,$ZodCatch:()=>one,$ZodCheck:()=>xn,$ZodCheckBigIntFormat:()=>kMe,$ZodCheckEndsWith:()=>KMe,$ZodCheckGreaterThan:()=>ere,$ZodCheckIncludes:()=>HMe,$ZodCheckLengthEquals:()=>VMe,$ZodCheckLessThan:()=>Qte,$ZodCheckLowerCase:()=>$Me,$ZodCheckMaxLength:()=>jMe,$ZodCheckMaxSize:()=>DMe,$ZodCheckMimeType:()=>WMe,$ZodCheckMinLength:()=>BMe,$ZodCheckMinSize:()=>UMe,$ZodCheckMultipleOf:()=>MMe,$ZodCheckNumberFormat:()=>LMe,$ZodCheckOverwrite:()=>JMe,$ZodCheckProperty:()=>YMe,$ZodCheckRegex:()=>FMe,$ZodCheckSizeEquals:()=>qMe,$ZodCheckStartsWith:()=>GMe,$ZodCheckStringFormat:()=>qR,$ZodCheckUpperCase:()=>zMe,$ZodCodec:()=>VR,$ZodCustom:()=>fne,$ZodCustomStringFormat:()=>Ire,$ZodDate:()=>Bre,$ZodDefault:()=>tne,$ZodDiscriminatedUnion:()=>zre,$ZodE164:()=>Rre,$ZodEmail:()=>cre,$ZodEmoji:()=>lre,$ZodEncodeError:()=>vv,$ZodEnum:()=>Wre,$ZodError:()=>PU,$ZodExactOptional:()=>Qre,$ZodFile:()=>Zre,$ZodFunction:()=>lne,$ZodGUID:()=>are,$ZodIPv4:()=>Tre,$ZodIPv6:()=>Sre,$ZodISODate:()=>vre,$ZodISODateTime:()=>gre,$ZodISODuration:()=>bre,$ZodISOTime:()=>_re,$ZodIntersection:()=>Hre,$ZodJWT:()=>Nre,$ZodKSUID:()=>yre,$ZodLazy:()=>dne,$ZodLiteral:()=>Jre,$ZodMAC:()=>Ere,$ZodMap:()=>Kre,$ZodNaN:()=>ane,$ZodNanoID:()=>pre,$ZodNever:()=>qre,$ZodNonOptional:()=>nne,$ZodNull:()=>kre,$ZodNullable:()=>ene,$ZodNumber:()=>wU,$ZodNumberFormat:()=>wre,$ZodObject:()=>Fre,$ZodObjectJIT:()=>eLe,$ZodOptional:()=>LU,$ZodPipe:()=>sne,$ZodPrefault:()=>rne,$ZodPromise:()=>pne,$ZodReadonly:()=>cne,$ZodRealError:()=>kc,$ZodRecord:()=>Gre,$ZodRegistry:()=>gne,$ZodSet:()=>Yre,$ZodString:()=>xv,$ZodStringFormat:()=>mn,$ZodSuccess:()=>ine,$ZodSymbol:()=>Mre,$ZodTemplateLiteral:()=>une,$ZodTransform:()=>Xre,$ZodTuple:()=>MU,$ZodType:()=>Lt,$ZodULID:()=>hre,$ZodURL:()=>ure,$ZodUUID:()=>sre,$ZodUndefined:()=>Lre,$ZodUnion:()=>BR,$ZodUnknown:()=>Ure,$ZodVoid:()=>jre,$ZodXID:()=>mre,$ZodXor:()=>$re,$brand:()=>bU,$constructor:()=>z,$input:()=>_ne,$output:()=>vne,Doc:()=>IU,JSONSchema:()=>_$t,JSONSchemaGenerator:()=>sie,NEVER:()=>Ute,TimePrecision:()=>Ene,_any:()=>zne,_array:()=>tLe,_base64:()=>QU,_base64url:()=>e2,_bigint:()=>Une,_boolean:()=>kne,_catch:()=>_wn,_check:()=>v$t,_cidrv4:()=>ZU,_cidrv6:()=>XU,_coercedBigint:()=>qne,_coercedBoolean:()=>Dne,_coercedDate:()=>Wne,_coercedNumber:()=>Nne,_coercedString:()=>Tne,_cuid:()=>zU,_cuid2:()=>HU,_custom:()=>Xne,_date:()=>Yne,_decode:()=>zte,_decodeAsync:()=>Gte,_default:()=>ywn,_discriminatedUnion:()=>iwn,_e164:()=>t2,_email:()=>UU,_emoji:()=>FU,_encode:()=>$te,_encodeAsync:()=>Hte,_endsWith:()=>lS,_enum:()=>lwn,_file:()=>Zne,_float32:()=>wne,_float64:()=>Cne,_gt:()=>cd,_gte:()=>Sa,_guid:()=>zR,_includes:()=>cS,_int:()=>Ine,_int32:()=>Mne,_int64:()=>jne,_intersection:()=>own,_ipv4:()=>WU,_ipv6:()=>JU,_isoDate:()=>xne,_isoDateTime:()=>One,_isoDuration:()=>Pne,_isoTime:()=>Ane,_jwt:()=>r2,_ksuid:()=>YU,_lazy:()=>Ewn,_length:()=>Rv,_literal:()=>dwn,_lowercase:()=>aS,_lt:()=>sd,_lte:()=>Us,_mac:()=>Sne,_map:()=>cwn,_max:()=>Us,_maxLength:()=>Pv,_maxSize:()=>zm,_mime:()=>pS,_min:()=>Sa,_minLength:()=>Th,_minSize:()=>ud,_multipleOf:()=>$m,_nan:()=>Jne,_nanoid:()=>$U,_nativeEnum:()=>pwn,_negative:()=>i2,_never:()=>Gne,_nonnegative:()=>a2,_nonoptional:()=>gwn,_nonpositive:()=>o2,_normalize:()=>dS,_null:()=>$ne,_nullable:()=>mwn,_number:()=>Rne,_optional:()=>hwn,_overwrite:()=>ep,_parse:()=>LR,_parseAsync:()=>kR,_pipe:()=>bwn,_positive:()=>n2,_promise:()=>Own,_property:()=>s2,_readonly:()=>Twn,_record:()=>swn,_refine:()=>Qne,_regex:()=>oS,_safeDecode:()=>Yte,_safeDecodeAsync:()=>Jte,_safeEncode:()=>Kte,_safeEncodeAsync:()=>Wte,_safeParse:()=>DR,_safeParseAsync:()=>UR,_set:()=>uwn,_size:()=>Av,_slugify:()=>GR,_startsWith:()=>uS,_string:()=>bne,_stringFormat:()=>yS,_stringbool:()=>nie,_success:()=>vwn,_superRefine:()=>eie,_symbol:()=>Vne,_templateLiteral:()=>Swn,_toLowerCase:()=>hS,_toUpperCase:()=>mS,_transform:()=>fwn,_trim:()=>fS,_tuple:()=>awn,_uint32:()=>Lne,_uint64:()=>Bne,_ulid:()=>GU,_undefined:()=>Fne,_union:()=>rwn,_unknown:()=>Hne,_uppercase:()=>sS,_url:()=>HR,_uuid:()=>qU,_uuidv4:()=>jU,_uuidv6:()=>BU,_uuidv7:()=>VU,_void:()=>Kne,_xid:()=>KU,_xor:()=>nwn,clone:()=>ia,config:()=>Ri,createStandardJSONSchemaMethod:()=>KR,createToJSONSchemaMethod:()=>rLe,decode:()=>KFt,decodeAsync:()=>WFt,describe:()=>tie,encode:()=>GFt,encodeAsync:()=>YFt,extractDefs:()=>Iv,finalize:()=>wv,flattenError:()=>CR,formatError:()=>MR,globalConfig:()=>_U,globalRegistry:()=>oa,initializeContext:()=>Nv,isValidBase64:()=>QMe,isValidBase64URL:()=>g4t,isValidJWT:()=>v4t,locales:()=>$R,meta:()=>rie,parse:()=>rS,parseAsync:()=>nS,prettifyError:()=>Fte,process:()=>pn,regexes:()=>Dc,registry:()=>DU,safeDecode:()=>ZFt,safeDecodeAsync:()=>QFt,safeEncode:()=>JFt,safeEncodeAsync:()=>XFt,safeParse:()=>Ev,safeParseAsync:()=>Ov,toDotPath:()=>HFt,toJSONSchema:()=>gS,treeifyError:()=>Vte,util:()=>xe,version:()=>ZMe});var Ute=Object.freeze({status:"aborted"});function z(n,e,i){function s(t,a){if(t._zod||Object.defineProperty(t,"_zod",{value:{def:a,constr:r,traits:new Set},enumerable:!1}),t._zod.traits.has(n))return;t._zod.traits.add(n),e(t,a);let u=r.prototype,l=Object.keys(u);for(let p=0;p<l.length;p++){let d=l[p];d in t||(t[d]=u[d].bind(t))}}let o=i?.Parent??Object;class c extends o{}Object.defineProperty(c,"name",{value:n});function r(t){var a;let u=i?.Parent?new c:this;s(u,t),(a=u._zod).deferred??(a.deferred=[]);for(let l of u._zod.deferred)l();return u}return Object.defineProperty(r,"init",{value:s}),Object.defineProperty(r,Symbol.hasInstance,{value:t=>i?.Parent&&t instanceof i.Parent?!0:t?._zod?.traits?.has(n)}),Object.defineProperty(r,"name",{value:n}),r}var bU=Symbol("zod_brand"),ad=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},vv=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},_U={};function Ri(n){return n&&Object.assign(_U,n),_U}var xe={};gn(xe,{BIGINT_FORMAT_RANGES:()=>iMe,Class:()=>Z1e,NUMBER_FORMAT_RANGES:()=>nMe,aborted:()=>Sv,allowsEval:()=>eMe,assert:()=>vNn,assertEqual:()=>hNn,assertIs:()=>yNn,assertNever:()=>gNn,assertNotEqual:()=>mNn,assignProp:()=>bv,base64ToUint8Array:()=>FFt,base64urlToUint8Array:()=>NNn,cached:()=>IR,captureStackTrace:()=>jte,cleanEnum:()=>RNn,cleanRegex:()=>EU,clone:()=>ia,cloneDef:()=>bNn,createTransparentProxy:()=>ANn,defineLazy:()=>tr,esc:()=>qte,escapeRegex:()=>Ql,extend:()=>qFt,finalizeIssue:()=>Lc,floatSafeRemainder:()=>X1e,getElementAtPath:()=>TNn,getEnumValues:()=>SU,getLengthableOrigin:()=>AU,getParsedType:()=>xNn,getSizableOrigin:()=>xU,hexToUint8Array:()=>wNn,isObject:()=>tS,isPlainObject:()=>Tv,issue:()=>wR,joinValues:()=>re,jsonStringifyReplacer:()=>NR,merge:()=>PNn,mergeDefs:()=>Fm,normalizeParams:()=>Ne,nullish:()=>_v,numKeys:()=>ONn,objectClone:()=>_Nn,omit:()=>UFt,optionalKeys:()=>rMe,parsedType:()=>Ae,partial:()=>BFt,pick:()=>DFt,prefixIssues:()=>mu,primitiveTypes:()=>tMe,promiseAllObject:()=>SNn,propertyKeyTypes:()=>OU,randomString:()=>ENn,required:()=>VFt,safeExtend:()=>jFt,shallowClone:()=>Bte,slugify:()=>Q1e,stringifyPrimitive:()=>Se,uint8ArrayToBase64:()=>$Ft,uint8ArrayToBase64url:()=>INn,uint8ArrayToHex:()=>CNn,unwrapMessage:()=>TU});function hNn(n){return n}function mNn(n){return n}function yNn(n){}function gNn(n){throw new Error("Unexpected value in exhaustive check")}function vNn(n){}function SU(n){let e=Object.values(n).filter(s=>typeof s=="number");return Object.entries(n).filter(([s,o])=>e.indexOf(+s)===-1).map(([s,o])=>o)}function re(n,e="|"){return n.map(i=>Se(i)).join(e)}function NR(n,e){return typeof e=="bigint"?e.toString():e}function IR(n){return{get value(){{let i=n();return Object.defineProperty(this,"value",{value:i}),i}throw new Error("cached value already set")}}}function _v(n){return n==null}function EU(n){let e=n.startsWith("^")?1:0,i=n.endsWith("$")?n.length-1:n.length;return n.slice(e,i)}function X1e(n,e){let i=(n.toString().split(".")[1]||"").length,s=e.toString(),o=(s.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(s)){let a=s.match(/\d?e-(\d?)/);a?.[1]&&(o=Number.parseInt(a[1]))}let c=i>o?i:o,r=Number.parseInt(n.toFixed(c).replace(".","")),t=Number.parseInt(e.toFixed(c).replace(".",""));return r%t/10**c}var kFt=Symbol("evaluating");function tr(n,e,i){let s;Object.defineProperty(n,e,{get(){if(s!==kFt)return s===void 0&&(s=kFt,s=i()),s},set(o){Object.defineProperty(n,e,{value:o})},configurable:!0})}function _Nn(n){return Object.create(Object.getPrototypeOf(n),Object.getOwnPropertyDescriptors(n))}function bv(n,e,i){Object.defineProperty(n,e,{value:i,writable:!0,enumerable:!0,configurable:!0})}function Fm(...n){let e={};for(let i of n){let s=Object.getOwnPropertyDescriptors(i);Object.assign(e,s)}return Object.defineProperties({},e)}function bNn(n){return Fm(n._zod.def)}function TNn(n,e){return e?e.reduce((i,s)=>i?.[s],n):n}function SNn(n){let e=Object.keys(n),i=e.map(s=>n[s]);return Promise.all(i).then(s=>{let o={};for(let c=0;c<e.length;c++)o[e[c]]=s[c];return o})}function ENn(n=10){let e="abcdefghijklmnopqrstuvwxyz",i="";for(let s=0;s<n;s++)i+=e[Math.floor(Math.random()*e.length)];return i}function qte(n){return JSON.stringify(n)}function Q1e(n){return n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var jte="captureStackTrace"in Error?Error.captureStackTrace:(...n)=>{};function tS(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}var eMe=IR(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let n=Function;return new n(""),!0}catch{return!1}});function Tv(n){if(tS(n)===!1)return!1;let e=n.constructor;if(e===void 0||typeof e!="function")return!0;let i=e.prototype;return!(tS(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function Bte(n){return Tv(n)?{...n}:Array.isArray(n)?[...n]:n}function ONn(n){let e=0;for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&e++;return e}var xNn=n=>{let e=typeof n;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(n)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(n)?"array":n===null?"null":n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?"promise":typeof Map<"u"&&n instanceof Map?"map":typeof Set<"u"&&n instanceof Set?"set":typeof Date<"u"&&n instanceof Date?"date":typeof File<"u"&&n instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},OU=new Set(["string","number","symbol"]),tMe=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ql(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ia(n,e,i){let s=new n._zod.constr(e??n._zod.def);return(!e||i?.parent)&&(s._zod.parent=n),s}function Ne(n){let e=n;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function ANn(n){let e;return new Proxy({},{get(i,s,o){return e??(e=n()),Reflect.get(e,s,o)},set(i,s,o,c){return e??(e=n()),Reflect.set(e,s,o,c)},has(i,s){return e??(e=n()),Reflect.has(e,s)},deleteProperty(i,s){return e??(e=n()),Reflect.deleteProperty(e,s)},ownKeys(i){return e??(e=n()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(i,s){return e??(e=n()),Reflect.getOwnPropertyDescriptor(e,s)},defineProperty(i,s,o){return e??(e=n()),Reflect.defineProperty(e,s,o)}})}function Se(n){return typeof n=="bigint"?n.toString()+"n":typeof n=="string"?`"${n}"`:`${n}`}function rMe(n){return Object.keys(n).filter(e=>n[e]._zod.optin==="optional"&&n[e]._zod.optout==="optional")}var nMe={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},iMe={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function DFt(n,e){let i=n._zod.def,s=i.checks;if(s&&s.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let c=Fm(n._zod.def,{get shape(){let r={};for(let t in e){if(!(t in i.shape))throw new Error(`Unrecognized key: "${t}"`);e[t]&&(r[t]=i.shape[t])}return bv(this,"shape",r),r},checks:[]});return ia(n,c)}function UFt(n,e){let i=n._zod.def,s=i.checks;if(s&&s.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let c=Fm(n._zod.def,{get shape(){let r={...n._zod.def.shape};for(let t in e){if(!(t in i.shape))throw new Error(`Unrecognized key: "${t}"`);e[t]&&delete r[t]}return bv(this,"shape",r),r},checks:[]});return ia(n,c)}function qFt(n,e){if(!Tv(e))throw new Error("Invalid input to extend: expected a plain object");let i=n._zod.def.checks;if(i&&i.length>0){let c=n._zod.def.shape;for(let r in e)if(Object.getOwnPropertyDescriptor(c,r)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let o=Fm(n._zod.def,{get shape(){let c={...n._zod.def.shape,...e};return bv(this,"shape",c),c}});return ia(n,o)}function jFt(n,e){if(!Tv(e))throw new Error("Invalid input to safeExtend: expected a plain object");let i=Fm(n._zod.def,{get shape(){let s={...n._zod.def.shape,...e};return bv(this,"shape",s),s}});return ia(n,i)}function PNn(n,e){let i=Fm(n._zod.def,{get shape(){let s={...n._zod.def.shape,...e._zod.def.shape};return bv(this,"shape",s),s},get catchall(){return e._zod.def.catchall},checks:[]});return ia(n,i)}function BFt(n,e,i){let o=e._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let r=Fm(e._zod.def,{get shape(){let t=e._zod.def.shape,a={...t};if(i)for(let u in i){if(!(u in t))throw new Error(`Unrecognized key: "${u}"`);i[u]&&(a[u]=n?new n({type:"optional",innerType:t[u]}):t[u])}else for(let u in t)a[u]=n?new n({type:"optional",innerType:t[u]}):t[u];return bv(this,"shape",a),a},checks:[]});return ia(e,r)}function VFt(n,e,i){let s=Fm(e._zod.def,{get shape(){let o=e._zod.def.shape,c={...o};if(i)for(let r in i){if(!(r in c))throw new Error(`Unrecognized key: "${r}"`);i[r]&&(c[r]=new n({type:"nonoptional",innerType:o[r]}))}else for(let r in o)c[r]=new n({type:"nonoptional",innerType:o[r]});return bv(this,"shape",c),c}});return ia(e,s)}function Sv(n,e=0){if(n.aborted===!0)return!0;for(let i=e;i<n.issues.length;i++)if(n.issues[i]?.continue!==!0)return!0;return!1}function mu(n,e){return e.map(i=>{var s;return(s=i).path??(s.path=[]),i.path.unshift(n),i})}function TU(n){return typeof n=="string"?n:n?.message}function Lc(n,e,i){let s={...n,path:n.path??[]};if(!n.message){let o=TU(n.inst?._zod.def?.error?.(n))??TU(e?.error?.(n))??TU(i.customError?.(n))??TU(i.localeError?.(n))??"Invalid input";s.message=o}return delete s.inst,delete s.continue,e?.reportInput||delete s.input,s}function xU(n){return n instanceof Set?"set":n instanceof Map?"map":n instanceof File?"file":"unknown"}function AU(n){return Array.isArray(n)?"array":typeof n=="string"?"string":"unknown"}function Ae(n){let e=typeof n;switch(e){case"number":return Number.isNaN(n)?"nan":"number";case"object":{if(n===null)return"null";if(Array.isArray(n))return"array";let i=n;if(i&&Object.getPrototypeOf(i)!==Object.prototype&&"constructor"in i&&i.constructor)return i.constructor.name}}return e}function wR(...n){let[e,i,s]=n;return typeof e=="string"?{message:e,code:"custom",input:i,inst:s}:{...e}}function RNn(n){return Object.entries(n).filter(([e,i])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function FFt(n){let e=atob(n),i=new Uint8Array(e.length);for(let s=0;s<e.length;s++)i[s]=e.charCodeAt(s);return i}function $Ft(n){let e="";for(let i=0;i<n.length;i++)e+=String.fromCharCode(n[i]);return btoa(e)}function NNn(n){let e=n.replace(/-/g,"+").replace(/_/g,"/"),i="=".repeat((4-e.length%4)%4);return FFt(e+i)}function INn(n){return $Ft(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function wNn(n){let e=n.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let i=new Uint8Array(e.length/2);for(let s=0;s<e.length;s+=2)i[s/2]=Number.parseInt(e.slice(s,s+2),16);return i}function CNn(n){return Array.from(n).map(e=>e.toString(16).padStart(2,"0")).join("")}var Z1e=class{constructor(...e){}};var zFt=(n,e)=>{n.name="$ZodError",Object.defineProperty(n,"_zod",{value:n._zod,enumerable:!1}),Object.defineProperty(n,"issues",{value:e,enumerable:!1}),n.message=JSON.stringify(e,NR,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},PU=z("$ZodError",zFt),kc=z("$ZodError",zFt,{Parent:Error});function CR(n,e=i=>i.message){let i={},s=[];for(let o of n.issues)o.path.length>0?(i[o.path[0]]=i[o.path[0]]||[],i[o.path[0]].push(e(o))):s.push(e(o));return{formErrors:s,fieldErrors:i}}function MR(n,e=i=>i.message){let i={_errors:[]},s=o=>{for(let c of o.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(r=>s({issues:r}));else if(c.code==="invalid_key")s({issues:c.issues});else if(c.code==="invalid_element")s({issues:c.issues});else if(c.path.length===0)i._errors.push(e(c));else{let r=i,t=0;for(;t<c.path.length;){let a=c.path[t];t===c.path.length-1?(r[a]=r[a]||{_errors:[]},r[a]._errors.push(e(c))):r[a]=r[a]||{_errors:[]},r=r[a],t++}}};return s(n),i}function Vte(n,e=i=>i.message){let i={errors:[]},s=(o,c=[])=>{var r,t;for(let a of o.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(u=>s({issues:u},a.path));else if(a.code==="invalid_key")s({issues:a.issues},a.path);else if(a.code==="invalid_element")s({issues:a.issues},a.path);else{let u=[...c,...a.path];if(u.length===0){i.errors.push(e(a));continue}let l=i,p=0;for(;p<u.length;){let d=u[p],h=p===u.length-1;typeof d=="string"?(l.properties??(l.properties={}),(r=l.properties)[d]??(r[d]={errors:[]}),l=l.properties[d]):(l.items??(l.items=[]),(t=l.items)[d]??(t[d]={errors:[]}),l=l.items[d]),h&&l.errors.push(e(a)),p++}}};return s(n),i}function HFt(n){let e=[],i=n.map(s=>typeof s=="object"?s.key:s);for(let s of i)typeof s=="number"?e.push(`[${s}]`):typeof s=="symbol"?e.push(`[${JSON.stringify(String(s))}]`):/[^\w$]/.test(s)?e.push(`[${JSON.stringify(s)}]`):(e.length&&e.push("."),e.push(s));return e.join("")}function Fte(n){let e=[],i=[...n.issues].sort((s,o)=>(s.path??[]).length-(o.path??[]).length);for(let s of i)e.push(`\u2716 ${s.message}`),s.path?.length&&e.push(` \u2192 at ${HFt(s.path)}`);return e.join(`
273
273
  `)}var LR=n=>(e,i,s,o)=>{let c=s?Object.assign(s,{async:!1}):{async:!1},r=e._zod.run({value:i,issues:[]},c);if(r instanceof Promise)throw new ad;if(r.issues.length){let t=new(o?.Err??n)(r.issues.map(a=>Lc(a,c,Ri())));throw jte(t,o?.callee),t}return r.value},rS=LR(kc),kR=n=>async(e,i,s,o)=>{let c=s?Object.assign(s,{async:!0}):{async:!0},r=e._zod.run({value:i,issues:[]},c);if(r instanceof Promise&&(r=await r),r.issues.length){let t=new(o?.Err??n)(r.issues.map(a=>Lc(a,c,Ri())));throw jte(t,o?.callee),t}return r.value},nS=kR(kc),DR=n=>(e,i,s)=>{let o=s?{...s,async:!1}:{async:!1},c=e._zod.run({value:i,issues:[]},o);if(c instanceof Promise)throw new ad;return c.issues.length?{success:!1,error:new(n??PU)(c.issues.map(r=>Lc(r,o,Ri())))}:{success:!0,data:c.value}},Ev=DR(kc),UR=n=>async(e,i,s)=>{let o=s?Object.assign(s,{async:!0}):{async:!0},c=e._zod.run({value:i,issues:[]},o);return c instanceof Promise&&(c=await c),c.issues.length?{success:!1,error:new n(c.issues.map(r=>Lc(r,o,Ri())))}:{success:!0,data:c.value}},Ov=UR(kc),$te=n=>(e,i,s)=>{let o=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return LR(n)(e,i,o)},GFt=$te(kc),zte=n=>(e,i,s)=>LR(n)(e,i,s),KFt=zte(kc),Hte=n=>async(e,i,s)=>{let o=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return kR(n)(e,i,o)},YFt=Hte(kc),Gte=n=>async(e,i,s)=>kR(n)(e,i,s),WFt=Gte(kc),Kte=n=>(e,i,s)=>{let o=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return DR(n)(e,i,o)},JFt=Kte(kc),Yte=n=>(e,i,s)=>DR(n)(e,i,s),ZFt=Yte(kc),Wte=n=>async(e,i,s)=>{let o=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return UR(n)(e,i,o)},XFt=Wte(kc),Jte=n=>async(e,i,s)=>UR(n)(e,i,s),QFt=Jte(kc);var Dc={};gn(Dc,{base64:()=>bMe,base64url:()=>Zte,bigint:()=>AMe,boolean:()=>RMe,browserEmail:()=>VNn,cidrv4:()=>vMe,cidrv6:()=>_Me,cuid:()=>oMe,cuid2:()=>aMe,date:()=>SMe,datetime:()=>OMe,domain:()=>zNn,duration:()=>pMe,e164:()=>TMe,email:()=>fMe,emoji:()=>hMe,extendedDuration:()=>LNn,guid:()=>dMe,hex:()=>HNn,hostname:()=>$Nn,html5Email:()=>qNn,idnEmail:()=>BNn,integer:()=>PMe,ipv4:()=>mMe,ipv6:()=>yMe,ksuid:()=>uMe,lowercase:()=>wMe,mac:()=>gMe,md5_base64:()=>KNn,md5_base64url:()=>YNn,md5_hex:()=>GNn,nanoid:()=>lMe,null:()=>NMe,number:()=>Xte,rfc5322Email:()=>jNn,sha1_base64:()=>JNn,sha1_base64url:()=>ZNn,sha1_hex:()=>WNn,sha256_base64:()=>QNn,sha256_base64url:()=>eIn,sha256_hex:()=>XNn,sha384_base64:()=>rIn,sha384_base64url:()=>nIn,sha384_hex:()=>tIn,sha512_base64:()=>oIn,sha512_base64url:()=>aIn,sha512_hex:()=>iIn,string:()=>xMe,time:()=>EMe,ulid:()=>sMe,undefined:()=>IMe,unicodeEmail:()=>e4t,uppercase:()=>CMe,uuid:()=>iS,uuid4:()=>kNn,uuid6:()=>DNn,uuid7:()=>UNn,xid:()=>cMe});var oMe=/^[cC][^\s-]{8,}$/,aMe=/^[0-9a-z]+$/,sMe=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,cMe=/^[0-9a-vA-V]{20}$/,uMe=/^[A-Za-z0-9]{27}$/,lMe=/^[a-zA-Z0-9_-]{21}$/,pMe=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,LNn=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,dMe=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,iS=n=>n?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${n}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,kNn=iS(4),DNn=iS(6),UNn=iS(7),fMe=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,qNn=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,jNn=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,e4t=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,BNn=e4t,VNn=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,FNn="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function hMe(){return new RegExp(FNn,"u")}var mMe=/^(?:(?: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])$/,yMe=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,gMe=n=>{let e=Ql(n??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},vMe=/^((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])$/,_Me=/^(([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])$/,bMe=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Zte=/^[A-Za-z0-9_-]*$/,$Nn=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,zNn=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,TMe=/^\+[1-9]\d{6,14}$/,t4t="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",SMe=new RegExp(`^${t4t}$`);function r4t(n){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof n.precision=="number"?n.precision===-1?`${e}`:n.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${n.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function EMe(n){return new RegExp(`^${r4t(n)}$`)}function OMe(n){let e=r4t({precision:n.precision}),i=["Z"];n.local&&i.push(""),n.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let s=`${e}(?:${i.join("|")})`;return new RegExp(`^${t4t}T(?:${s})$`)}var xMe=n=>{let e=n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},AMe=/^-?\d+n?$/,PMe=/^-?\d+$/,Xte=/^-?\d+(?:\.\d+)?$/,RMe=/^(?:true|false)$/i,NMe=/^null$/i;var IMe=/^undefined$/i;var wMe=/^[^A-Z]*$/,CMe=/^[^a-z]*$/,HNn=/^[0-9a-fA-F]*$/;function RU(n,e){return new RegExp(`^[A-Za-z0-9+/]{${n}}${e}$`)}function NU(n){return new RegExp(`^[A-Za-z0-9_-]{${n}}$`)}var GNn=/^[0-9a-fA-F]{32}$/,KNn=RU(22,"=="),YNn=NU(22),WNn=/^[0-9a-fA-F]{40}$/,JNn=RU(27,"="),ZNn=NU(27),XNn=/^[0-9a-fA-F]{64}$/,QNn=RU(43,"="),eIn=NU(43),tIn=/^[0-9a-fA-F]{96}$/,rIn=RU(64,""),nIn=NU(64),iIn=/^[0-9a-fA-F]{128}$/,oIn=RU(86,"=="),aIn=NU(86);var xn=z("$ZodCheck",(n,e)=>{var i;n._zod??(n._zod={}),n._zod.def=e,(i=n._zod).onattach??(i.onattach=[])}),i4t={number:"number",bigint:"bigint",object:"date"},Qte=z("$ZodCheckLessThan",(n,e)=>{xn.init(n,e);let i=i4t[typeof e.value];n._zod.onattach.push(s=>{let o=s._zod.bag,c=(e.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<c&&(e.inclusive?o.maximum=e.value:o.exclusiveMaximum=e.value)}),n._zod.check=s=>{(e.inclusive?s.value<=e.value:s.value<e.value)||s.issues.push({origin:i,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:s.value,inclusive:e.inclusive,inst:n,continue:!e.abort})}}),ere=z("$ZodCheckGreaterThan",(n,e)=>{xn.init(n,e);let i=i4t[typeof e.value];n._zod.onattach.push(s=>{let o=s._zod.bag,c=(e.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>c&&(e.inclusive?o.minimum=e.value:o.exclusiveMinimum=e.value)}),n._zod.check=s=>{(e.inclusive?s.value>=e.value:s.value>e.value)||s.issues.push({origin:i,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:s.value,inclusive:e.inclusive,inst:n,continue:!e.abort})}}),MMe=z("$ZodCheckMultipleOf",(n,e)=>{xn.init(n,e),n._zod.onattach.push(i=>{var s;(s=i._zod.bag).multipleOf??(s.multipleOf=e.value)}),n._zod.check=i=>{if(typeof i.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof i.value=="bigint"?i.value%e.value===BigInt(0):X1e(i.value,e.value)===0)||i.issues.push({origin:typeof i.value,code:"not_multiple_of",divisor:e.value,input:i.value,inst:n,continue:!e.abort})}}),LMe=z("$ZodCheckNumberFormat",(n,e)=>{xn.init(n,e),e.format=e.format||"float64";let i=e.format?.includes("int"),s=i?"int":"number",[o,c]=nMe[e.format];n._zod.onattach.push(r=>{let t=r._zod.bag;t.format=e.format,t.minimum=o,t.maximum=c,i&&(t.pattern=PMe)}),n._zod.check=r=>{let t=r.value;if(i){if(!Number.isInteger(t)){r.issues.push({expected:s,format:e.format,code:"invalid_type",continue:!1,input:t,inst:n});return}if(!Number.isSafeInteger(t)){t>0?r.issues.push({input:t,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:s,inclusive:!0,continue:!e.abort}):r.issues.push({input:t,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:s,inclusive:!0,continue:!e.abort});return}}t<o&&r.issues.push({origin:"number",input:t,code:"too_small",minimum:o,inclusive:!0,inst:n,continue:!e.abort}),t>c&&r.issues.push({origin:"number",input:t,code:"too_big",maximum:c,inclusive:!0,inst:n,continue:!e.abort})}}),kMe=z("$ZodCheckBigIntFormat",(n,e)=>{xn.init(n,e);let[i,s]=iMe[e.format];n._zod.onattach.push(o=>{let c=o._zod.bag;c.format=e.format,c.minimum=i,c.maximum=s}),n._zod.check=o=>{let c=o.value;c<i&&o.issues.push({origin:"bigint",input:c,code:"too_small",minimum:i,inclusive:!0,inst:n,continue:!e.abort}),c>s&&o.issues.push({origin:"bigint",input:c,code:"too_big",maximum:s,inclusive:!0,inst:n,continue:!e.abort})}}),DMe=z("$ZodCheckMaxSize",(n,e)=>{var i;xn.init(n,e),(i=n._zod.def).when??(i.when=s=>{let o=s.value;return!_v(o)&&o.size!==void 0}),n._zod.onattach.push(s=>{let o=s._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<o&&(s._zod.bag.maximum=e.maximum)}),n._zod.check=s=>{let o=s.value;o.size<=e.maximum||s.issues.push({origin:xU(o),code:"too_big",maximum:e.maximum,inclusive:!0,input:o,inst:n,continue:!e.abort})}}),UMe=z("$ZodCheckMinSize",(n,e)=>{var i;xn.init(n,e),(i=n._zod.def).when??(i.when=s=>{let o=s.value;return!_v(o)&&o.size!==void 0}),n._zod.onattach.push(s=>{let o=s._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>o&&(s._zod.bag.minimum=e.minimum)}),n._zod.check=s=>{let o=s.value;o.size>=e.minimum||s.issues.push({origin:xU(o),code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:n,continue:!e.abort})}}),qMe=z("$ZodCheckSizeEquals",(n,e)=>{var i;xn.init(n,e),(i=n._zod.def).when??(i.when=s=>{let o=s.value;return!_v(o)&&o.size!==void 0}),n._zod.onattach.push(s=>{let o=s._zod.bag;o.minimum=e.size,o.maximum=e.size,o.size=e.size}),n._zod.check=s=>{let o=s.value,c=o.size;if(c===e.size)return;let r=c>e.size;s.issues.push({origin:xU(o),...r?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:s.value,inst:n,continue:!e.abort})}}),jMe=z("$ZodCheckMaxLength",(n,e)=>{var i;xn.init(n,e),(i=n._zod.def).when??(i.when=s=>{let o=s.value;return!_v(o)&&o.length!==void 0}),n._zod.onattach.push(s=>{let o=s._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<o&&(s._zod.bag.maximum=e.maximum)}),n._zod.check=s=>{let o=s.value;if(o.length<=e.maximum)return;let r=AU(o);s.issues.push({origin:r,code:"too_big",maximum:e.maximum,inclusive:!0,input:o,inst:n,continue:!e.abort})}}),BMe=z("$ZodCheckMinLength",(n,e)=>{var i;xn.init(n,e),(i=n._zod.def).when??(i.when=s=>{let o=s.value;return!_v(o)&&o.length!==void 0}),n._zod.onattach.push(s=>{let o=s._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>o&&(s._zod.bag.minimum=e.minimum)}),n._zod.check=s=>{let o=s.value;if(o.length>=e.minimum)return;let r=AU(o);s.issues.push({origin:r,code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:n,continue:!e.abort})}}),VMe=z("$ZodCheckLengthEquals",(n,e)=>{var i;xn.init(n,e),(i=n._zod.def).when??(i.when=s=>{let o=s.value;return!_v(o)&&o.length!==void 0}),n._zod.onattach.push(s=>{let o=s._zod.bag;o.minimum=e.length,o.maximum=e.length,o.length=e.length}),n._zod.check=s=>{let o=s.value,c=o.length;if(c===e.length)return;let r=AU(o),t=c>e.length;s.issues.push({origin:r,...t?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:s.value,inst:n,continue:!e.abort})}}),qR=z("$ZodCheckStringFormat",(n,e)=>{var i,s;xn.init(n,e),n._zod.onattach.push(o=>{let c=o._zod.bag;c.format=e.format,e.pattern&&(c.patterns??(c.patterns=new Set),c.patterns.add(e.pattern))}),e.pattern?(i=n._zod).check??(i.check=o=>{e.pattern.lastIndex=0,!e.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:e.format,input:o.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:n,continue:!e.abort})}):(s=n._zod).check??(s.check=()=>{})}),FMe=z("$ZodCheckRegex",(n,e)=>{qR.init(n,e),n._zod.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:"regex",input:i.value,pattern:e.pattern.toString(),inst:n,continue:!e.abort})}}),$Me=z("$ZodCheckLowerCase",(n,e)=>{e.pattern??(e.pattern=wMe),qR.init(n,e)}),zMe=z("$ZodCheckUpperCase",(n,e)=>{e.pattern??(e.pattern=CMe),qR.init(n,e)}),HMe=z("$ZodCheckIncludes",(n,e)=>{xn.init(n,e);let i=Ql(e.includes),s=new RegExp(typeof e.position=="number"?`^.{${e.position}}${i}`:i);e.pattern=s,n._zod.onattach.push(o=>{let c=o._zod.bag;c.patterns??(c.patterns=new Set),c.patterns.add(s)}),n._zod.check=o=>{o.value.includes(e.includes,e.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:o.value,inst:n,continue:!e.abort})}}),GMe=z("$ZodCheckStartsWith",(n,e)=>{xn.init(n,e);let i=new RegExp(`^${Ql(e.prefix)}.*`);e.pattern??(e.pattern=i),n._zod.onattach.push(s=>{let o=s._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),n._zod.check=s=>{s.value.startsWith(e.prefix)||s.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:s.value,inst:n,continue:!e.abort})}}),KMe=z("$ZodCheckEndsWith",(n,e)=>{xn.init(n,e);let i=new RegExp(`.*${Ql(e.suffix)}$`);e.pattern??(e.pattern=i),n._zod.onattach.push(s=>{let o=s._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),n._zod.check=s=>{s.value.endsWith(e.suffix)||s.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:s.value,inst:n,continue:!e.abort})}});function n4t(n,e,i){n.issues.length&&e.issues.push(...mu(i,n.issues))}var YMe=z("$ZodCheckProperty",(n,e)=>{xn.init(n,e),n._zod.check=i=>{let s=e.schema._zod.run({value:i.value[e.property],issues:[]},{});if(s instanceof Promise)return s.then(o=>n4t(o,i,e.property));n4t(s,i,e.property)}}),WMe=z("$ZodCheckMimeType",(n,e)=>{xn.init(n,e);let i=new Set(e.mime);n._zod.onattach.push(s=>{s._zod.bag.mime=e.mime}),n._zod.check=s=>{i.has(s.value.type)||s.issues.push({code:"invalid_value",values:e.mime,input:s.value.type,inst:n,continue:!e.abort})}}),JMe=z("$ZodCheckOverwrite",(n,e)=>{xn.init(n,e),n._zod.check=i=>{i.value=e.tx(i.value)}});var IU=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let s=e.split(`
274
274
  `).filter(r=>r),o=Math.min(...s.map(r=>r.length-r.trimStart().length)),c=s.map(r=>r.slice(o)).map(r=>" ".repeat(this.indent*2)+r);for(let r of c)this.content.push(r)}compile(){let e=Function,i=this?.args,o=[...(this?.content??[""]).map(c=>` ${c}`)];return new e(...i,o.join(`
275
275
  `))}};var ZMe={major:4,minor:3,patch:6};var Lt=z("$ZodType",(n,e)=>{var i;n??(n={}),n._zod.def=e,n._zod.bag=n._zod.bag||{},n._zod.version=ZMe;let s=[...n._zod.def.checks??[]];n._zod.traits.has("$ZodCheck")&&s.unshift(n);for(let o of s)for(let c of o._zod.onattach)c(n);if(s.length===0)(i=n._zod).deferred??(i.deferred=[]),n._zod.deferred?.push(()=>{n._zod.run=n._zod.parse});else{let o=(r,t,a)=>{let u=Sv(r),l;for(let p of t){if(p._zod.def.when){if(!p._zod.def.when(r))continue}else if(u)continue;let d=r.issues.length,h=p._zod.check(r);if(h instanceof Promise&&a?.async===!1)throw new ad;if(l||h instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await h,r.issues.length!==d&&(u||(u=Sv(r,d)))});else{if(r.issues.length===d)continue;u||(u=Sv(r,d))}}return l?l.then(()=>r):r},c=(r,t,a)=>{if(Sv(r))return r.aborted=!0,r;let u=o(t,s,a);if(u instanceof Promise){if(a.async===!1)throw new ad;return u.then(l=>n._zod.parse(l,a))}return n._zod.parse(u,a)};n._zod.run=(r,t)=>{if(t.skipChecks)return n._zod.parse(r,t);if(t.direction==="backward"){let u=n._zod.parse({value:r.value,issues:[]},{...t,skipChecks:!0});return u instanceof Promise?u.then(l=>c(l,r,t)):c(u,r,t)}let a=n._zod.parse(r,t);if(a instanceof Promise){if(t.async===!1)throw new ad;return a.then(u=>o(u,s,t))}return o(a,s,t)}}tr(n,"~standard",()=>({validate:o=>{try{let c=Ev(n,o);return c.success?{value:c.data}:{issues:c.error?.issues}}catch{return Ov(n,o).then(r=>r.success?{value:r.data}:{issues:r.error?.issues})}},vendor:"zod",version:1}))}),xv=z("$ZodString",(n,e)=>{Lt.init(n,e),n._zod.pattern=[...n?._zod.bag?.patterns??[]].pop()??xMe(n._zod.bag),n._zod.parse=(i,s)=>{if(e.coerce)try{i.value=String(i.value)}catch{}return typeof i.value=="string"||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:n}),i}}),mn=z("$ZodStringFormat",(n,e)=>{qR.init(n,e),xv.init(n,e)}),are=z("$ZodGUID",(n,e)=>{e.pattern??(e.pattern=dMe),mn.init(n,e)}),sre=z("$ZodUUID",(n,e)=>{if(e.version){let s={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(s===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=iS(s))}else e.pattern??(e.pattern=iS());mn.init(n,e)}),cre=z("$ZodEmail",(n,e)=>{e.pattern??(e.pattern=fMe),mn.init(n,e)}),ure=z("$ZodURL",(n,e)=>{mn.init(n,e),n._zod.check=i=>{try{let s=i.value.trim(),o=new URL(s);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(o.hostname)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:i.value,inst:n,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:i.value,inst:n,continue:!e.abort})),e.normalize?i.value=o.href:i.value=s;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:n,continue:!e.abort})}}}),lre=z("$ZodEmoji",(n,e)=>{e.pattern??(e.pattern=hMe()),mn.init(n,e)}),pre=z("$ZodNanoID",(n,e)=>{e.pattern??(e.pattern=lMe),mn.init(n,e)}),dre=z("$ZodCUID",(n,e)=>{e.pattern??(e.pattern=oMe),mn.init(n,e)}),fre=z("$ZodCUID2",(n,e)=>{e.pattern??(e.pattern=aMe),mn.init(n,e)}),hre=z("$ZodULID",(n,e)=>{e.pattern??(e.pattern=sMe),mn.init(n,e)}),mre=z("$ZodXID",(n,e)=>{e.pattern??(e.pattern=cMe),mn.init(n,e)}),yre=z("$ZodKSUID",(n,e)=>{e.pattern??(e.pattern=uMe),mn.init(n,e)}),gre=z("$ZodISODateTime",(n,e)=>{e.pattern??(e.pattern=OMe(e)),mn.init(n,e)}),vre=z("$ZodISODate",(n,e)=>{e.pattern??(e.pattern=SMe),mn.init(n,e)}),_re=z("$ZodISOTime",(n,e)=>{e.pattern??(e.pattern=EMe(e)),mn.init(n,e)}),bre=z("$ZodISODuration",(n,e)=>{e.pattern??(e.pattern=pMe),mn.init(n,e)}),Tre=z("$ZodIPv4",(n,e)=>{e.pattern??(e.pattern=mMe),mn.init(n,e),n._zod.bag.format="ipv4"}),Sre=z("$ZodIPv6",(n,e)=>{e.pattern??(e.pattern=yMe),mn.init(n,e),n._zod.bag.format="ipv6",n._zod.check=i=>{try{new URL(`http://[${i.value}]`)}catch{i.issues.push({code:"invalid_format",format:"ipv6",input:i.value,inst:n,continue:!e.abort})}}}),Ere=z("$ZodMAC",(n,e)=>{e.pattern??(e.pattern=gMe(e.delimiter)),mn.init(n,e),n._zod.bag.format="mac"}),Ore=z("$ZodCIDRv4",(n,e)=>{e.pattern??(e.pattern=vMe),mn.init(n,e)}),xre=z("$ZodCIDRv6",(n,e)=>{e.pattern??(e.pattern=_Me),mn.init(n,e),n._zod.check=i=>{let s=i.value.split("/");try{if(s.length!==2)throw new Error;let[o,c]=s;if(!c)throw new Error;let r=Number(c);if(`${r}`!==c)throw new Error;if(r<0||r>128)throw new Error;new URL(`http://[${o}]`)}catch{i.issues.push({code:"invalid_format",format:"cidrv6",input:i.value,inst:n,continue:!e.abort})}}});function QMe(n){if(n==="")return!0;if(n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}var Are=z("$ZodBase64",(n,e)=>{e.pattern??(e.pattern=bMe),mn.init(n,e),n._zod.bag.contentEncoding="base64",n._zod.check=i=>{QMe(i.value)||i.issues.push({code:"invalid_format",format:"base64",input:i.value,inst:n,continue:!e.abort})}});function g4t(n){if(!Zte.test(n))return!1;let e=n.replace(/[-_]/g,s=>s==="-"?"+":"/"),i=e.padEnd(Math.ceil(e.length/4)*4,"=");return QMe(i)}var Pre=z("$ZodBase64URL",(n,e)=>{e.pattern??(e.pattern=Zte),mn.init(n,e),n._zod.bag.contentEncoding="base64url",n._zod.check=i=>{g4t(i.value)||i.issues.push({code:"invalid_format",format:"base64url",input:i.value,inst:n,continue:!e.abort})}}),Rre=z("$ZodE164",(n,e)=>{e.pattern??(e.pattern=TMe),mn.init(n,e)});function v4t(n,e=null){try{let i=n.split(".");if(i.length!==3)return!1;let[s]=i;if(!s)return!1;let o=JSON.parse(atob(s));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||e&&(!("alg"in o)||o.alg!==e))}catch{return!1}}var Nre=z("$ZodJWT",(n,e)=>{mn.init(n,e),n._zod.check=i=>{v4t(i.value,e.alg)||i.issues.push({code:"invalid_format",format:"jwt",input:i.value,inst:n,continue:!e.abort})}}),Ire=z("$ZodCustomStringFormat",(n,e)=>{mn.init(n,e),n._zod.check=i=>{e.fn(i.value)||i.issues.push({code:"invalid_format",format:e.format,input:i.value,inst:n,continue:!e.abort})}}),wU=z("$ZodNumber",(n,e)=>{Lt.init(n,e),n._zod.pattern=n._zod.bag.pattern??Xte,n._zod.parse=(i,s)=>{if(e.coerce)try{i.value=Number(i.value)}catch{}let o=i.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return i;let c=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return i.issues.push({expected:"number",code:"invalid_type",input:o,inst:n,...c?{received:c}:{}}),i}}),wre=z("$ZodNumberFormat",(n,e)=>{LMe.init(n,e),wU.init(n,e)}),jR=z("$ZodBoolean",(n,e)=>{Lt.init(n,e),n._zod.pattern=RMe,n._zod.parse=(i,s)=>{if(e.coerce)try{i.value=!!i.value}catch{}let o=i.value;return typeof o=="boolean"||i.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:n}),i}}),CU=z("$ZodBigInt",(n,e)=>{Lt.init(n,e),n._zod.pattern=AMe,n._zod.parse=(i,s)=>{if(e.coerce)try{i.value=BigInt(i.value)}catch{}return typeof i.value=="bigint"||i.issues.push({expected:"bigint",code:"invalid_type",input:i.value,inst:n}),i}}),Cre=z("$ZodBigIntFormat",(n,e)=>{kMe.init(n,e),CU.init(n,e)}),Mre=z("$ZodSymbol",(n,e)=>{Lt.init(n,e),n._zod.parse=(i,s)=>{let o=i.value;return typeof o=="symbol"||i.issues.push({expected:"symbol",code:"invalid_type",input:o,inst:n}),i}}),Lre=z("$ZodUndefined",(n,e)=>{Lt.init(n,e),n._zod.pattern=IMe,n._zod.values=new Set([void 0]),n._zod.optin="optional",n._zod.optout="optional",n._zod.parse=(i,s)=>{let o=i.value;return typeof o>"u"||i.issues.push({expected:"undefined",code:"invalid_type",input:o,inst:n}),i}}),kre=z("$ZodNull",(n,e)=>{Lt.init(n,e),n._zod.pattern=NMe,n._zod.values=new Set([null]),n._zod.parse=(i,s)=>{let o=i.value;return o===null||i.issues.push({expected:"null",code:"invalid_type",input:o,inst:n}),i}}),Dre=z("$ZodAny",(n,e)=>{Lt.init(n,e),n._zod.parse=i=>i}),Ure=z("$ZodUnknown",(n,e)=>{Lt.init(n,e),n._zod.parse=i=>i}),qre=z("$ZodNever",(n,e)=>{Lt.init(n,e),n._zod.parse=(i,s)=>(i.issues.push({expected:"never",code:"invalid_type",input:i.value,inst:n}),i)}),jre=z("$ZodVoid",(n,e)=>{Lt.init(n,e),n._zod.parse=(i,s)=>{let o=i.value;return typeof o>"u"||i.issues.push({expected:"void",code:"invalid_type",input:o,inst:n}),i}}),Bre=z("$ZodDate",(n,e)=>{Lt.init(n,e),n._zod.parse=(i,s)=>{if(e.coerce)try{i.value=new Date(i.value)}catch{}let o=i.value,c=o instanceof Date;return c&&!Number.isNaN(o.getTime())||i.issues.push({expected:"date",code:"invalid_type",input:o,...c?{received:"Invalid Date"}:{},inst:n}),i}});function a4t(n,e,i){n.issues.length&&e.issues.push(...mu(i,n.issues)),e.value[i]=n.value}var Vre=z("$ZodArray",(n,e)=>{Lt.init(n,e),n._zod.parse=(i,s)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({expected:"array",code:"invalid_type",input:o,inst:n}),i;i.value=Array(o.length);let c=[];for(let r=0;r<o.length;r++){let t=o[r],a=e.element._zod.run({value:t,issues:[]},s);a instanceof Promise?c.push(a.then(u=>a4t(u,i,r))):a4t(a,i,r)}return c.length?Promise.all(c).then(()=>i):i}});function ore(n,e,i,s,o){if(n.issues.length){if(o&&!(i in s))return;e.issues.push(...mu(i,n.issues))}n.value===void 0?i in s&&(e.value[i]=void 0):e.value[i]=n.value}function _4t(n){let e=Object.keys(n.shape);for(let s of e)if(!n.shape?.[s]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${s}": expected a Zod schema`);let i=rMe(n.shape);return{...n,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(i)}}function b4t(n,e,i,s,o,c){let r=[],t=o.keySet,a=o.catchall._zod,u=a.def.type,l=a.optout==="optional";for(let p in e){if(t.has(p))continue;if(u==="never"){r.push(p);continue}let d=a.run({value:e[p],issues:[]},s);d instanceof Promise?n.push(d.then(h=>ore(h,i,p,e,l))):ore(d,i,p,e,l)}return r.length&&i.issues.push({code:"unrecognized_keys",keys:r,input:e,inst:c}),n.length?Promise.all(n).then(()=>i):i}var Fre=z("$ZodObject",(n,e)=>{if(Lt.init(n,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let t=e.shape;Object.defineProperty(e,"shape",{get:()=>{let a={...t};return Object.defineProperty(e,"shape",{value:a}),a}})}let s=IR(()=>_4t(e));tr(n._zod,"propValues",()=>{let t=e.shape,a={};for(let u in t){let l=t[u]._zod;if(l.values){a[u]??(a[u]=new Set);for(let p of l.values)a[u].add(p)}}return a});let o=tS,c=e.catchall,r;n._zod.parse=(t,a)=>{r??(r=s.value);let u=t.value;if(!o(u))return t.issues.push({expected:"object",code:"invalid_type",input:u,inst:n}),t;t.value={};let l=[],p=r.shape;for(let d of r.keys){let h=p[d],m=h._zod.optout==="optional",y=h._zod.run({value:u[d],issues:[]},a);y instanceof Promise?l.push(y.then(g=>ore(g,t,d,u,m))):ore(y,t,d,u,m)}return c?b4t(l,u,t,a,s.value,n):l.length?Promise.all(l).then(()=>t):t}}),eLe=z("$ZodObjectJIT",(n,e)=>{Fre.init(n,e);let i=n._zod.parse,s=IR(()=>_4t(e)),o=d=>{let h=new IU(["shape","payload","ctx"]),m=s.value,y=L=>{let D=qte(L);return`shape[${D}]._zod.run({ value: input[${D}], issues: [] }, ctx)`};h.write("const input = payload.value;");let g=Object.create(null),A=0;for(let L of m.keys)g[L]=`key_${A++}`;h.write("const newResult = {};");for(let L of m.keys){let D=g[L],j=qte(L),ie=d[L]?._zod?.optout==="optional";h.write(`const ${D} = ${y(L)};`),ie?h.write(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bc-telemetry-buddy-mcp",
3
- "version": "3.4.0",
3
+ "version": "3.4.1",
4
4
  "description": "Model Context Protocol server for Business Central telemetry",
5
5
  "funding": {
6
6
  "type": "github",