edgeone 1.2.20-beta.1 → 1.2.21
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/edgeone-dist/cli.js +332 -333
- package/edgeone-dist/pages/dev/runner-worker.js +1 -1
- package/package.json +2 -2
|
@@ -136,7 +136,7 @@ Arguments: `+Array.prototype.slice.call(H).join("")+`
|
|
|
136
136
|
`),n=n.replace(/\\r/g,"\r")),t[o]=n}return t}function JPe(e){let t=Bz(e),r=Jo.configDotenv({path:t});if(!r.parsed){let l=new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);throw l.code="MISSING_DATA",l}let a=Mz(e).split(","),o=a.length,n;for(let l=0;l<o;l++)try{let f=a[l].trim(),y=QPe(r,f);n=Jo.decrypt(y.ciphertext,y.key);break}catch(f){if(l+1>=o)throw f}return Jo.parse(n)}function XPe(e){console.log(`[dotenv@${d3}][INFO] ${e}`)}function ZPe(e){console.log(`[dotenv@${d3}][WARN] ${e}`)}function rC(e){console.log(`[dotenv@${d3}][DEBUG] ${e}`)}function Mz(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function QPe(e,t){let r;try{r=new URL(t)}catch(f){if(f.code==="ERR_INVALID_URL"){let y=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw y.code="INVALID_DOTENV_KEY",y}throw f}let a=r.password;if(!a){let f=new Error("INVALID_DOTENV_KEY: Missing key part");throw f.code="INVALID_DOTENV_KEY",f}let o=r.searchParams.get("environment");if(!o){let f=new Error("INVALID_DOTENV_KEY: Missing environment part");throw f.code="INVALID_DOTENV_KEY",f}let n=`DOTENV_VAULT_${o.toUpperCase()}`,l=e.parsed[n];if(!l){let f=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${n} in your .env.vault file.`);throw f.code="NOT_FOUND_DOTENV_ENVIRONMENT",f}return{ciphertext:l,key:a}}function Bz(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)p3.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=f3.resolve(process.cwd(),".env.vault");return p3.existsSync(t)?t:null}function Lz(e){return e[0]==="~"?f3.join($Pe.homedir(),e.slice(1)):e}function eAe(e){XPe("Loading env from encrypted .env.vault");let t=Jo._parseVault(e),r=process.env;return e&&e.processEnv!=null&&(r=e.processEnv),Jo.populate(r,t,e),{parsed:t}}function tAe(e){let t=f3.resolve(process.cwd(),".env"),r="utf8",a=!!(e&&e.debug);e&&e.encoding?r=e.encoding:a&&rC("No encoding is specified. UTF-8 is used by default");let o=[t];if(e&&e.path)if(!Array.isArray(e.path))o=[Lz(e.path)];else{o=[];for(let y of e.path)o.push(Lz(y))}let n,l={};for(let y of o)try{let m=Jo.parse(p3.readFileSync(y,{encoding:r}));Jo.populate(l,m,e)}catch(m){a&&rC(`Failed to load ${y} ${m.message}`),n=m}let f=process.env;return e&&e.processEnv!=null&&(f=e.processEnv),Jo.populate(f,l,e),n?{parsed:l,error:n}:{parsed:l}}function rAe(e){if(Mz(e).length===0)return Jo.configDotenv(e);let t=Bz(e);return t?Jo._configVault(e):(ZPe(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),Jo.configDotenv(e))}function nAe(e,t){let r=Buffer.from(t.slice(-64),"hex"),a=Buffer.from(e,"base64"),o=a.subarray(0,12),n=a.subarray(-16);a=a.subarray(12,-16);try{let l=HPe.createDecipheriv("aes-256-gcm",r,o);return l.setAuthTag(n),`${l.update(a)}${l.final()}`}catch(l){let f=l instanceof RangeError,y=l.message==="Invalid key length",m=l.message==="Unsupported state or unable to authenticate data";if(f||y){let b=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw b.code="INVALID_DOTENV_KEY",b}else if(m){let b=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw b.code="DECRYPTION_FAILED",b}else throw l}}function iAe(e,t,r={}){let a=!!(r&&r.debug),o=!!(r&&r.override);if(typeof t!="object"){let n=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw n.code="OBJECT_REQUIRED",n}for(let n of Object.keys(t))Object.prototype.hasOwnProperty.call(e,n)?(o===!0&&(e[n]=t[n]),a&&rC(o===!0?`"${n}" is already defined and WAS overwritten`:`"${n}" is already defined and was NOT overwritten`)):e[n]=t[n]}var Jo={configDotenv:tAe,_configVault:eAe,_parseVault:JPe,config:rAe,decrypt:nAe,parse:GPe,populate:iAe};km.exports.configDotenv=Jo.configDotenv;km.exports._configVault=Jo._configVault;km.exports._parseVault=Jo._parseVault;km.exports.config=Jo.config;km.exports.decrypt=Jo.decrypt;km.exports.parse=Jo.parse;km.exports.populate=Jo.populate;km.exports=Jo});function qz(e,t){return h3.default.join(e,t)}function Io(e){return qz(process.cwd(),e)}function Uz(e){return h3.default.dirname(e)}var h3,Im=Pt(()=>{h3=hr(require("path"))});var Wz=Y((B_t,Vz)=>{var m3=class{constructor(t){this.value=t,this.next=void 0}},y3=class{constructor(){this.clear()}enqueue(t){let r=new m3(t);this._head?(this._tail.next=r,this._tail=r):(this._head=r,this._tail=r),this._size++}dequeue(){let t=this._head;if(t)return this._head=this._head.next,this._size--,t.value}clear(){this._head=void 0,this._tail=void 0,this._size=0}get size(){return this._size}*[Symbol.iterator](){let t=this._head;for(;t;)yield t.value,t=t.next}};Vz.exports=y3});var $z=Y((j_t,zz)=>{"use strict";var sAe=Wz(),aAe=e=>{if(!((Number.isInteger(e)||e===1/0)&&e>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up");let t=new sAe,r=0,a=()=>{r--,t.size>0&&t.dequeue()()},o=async(f,y,...m)=>{r++;let b=(async()=>f(...m))();y(b);try{await b}catch{}a()},n=(f,y,...m)=>{t.enqueue(o.bind(null,f,y,...m)),(async()=>(await Promise.resolve(),r<e&&t.size>0&&t.dequeue()()))()},l=(f,...y)=>new Promise(m=>{n(f,m,...y)});return Object.defineProperties(l,{activeCount:{get:()=>r},pendingCount:{get:()=>t.size},clearQueue:{value:()=>{t.clear()}}}),l};zz.exports=aAe});var Hz=Y((q_t,oAe)=>{oAe.exports={name:"node-persist",version:"4.0.4",description:"Super-easy (and fast) persistent data structures in Node.js, modeled after HTML5 localStorage",main:"./src/node-persist.js",directories:{example:"examples"},scripts:{test:"./node_modules/.bin/mocha tests/"},repository:{type:"git",url:"https://github.com/simonlast/node-persist"},keywords:["node","persist","storage"],engines:{node:">=10.12.0"},contributors:[{name:"Simon Last",email:"hello@simonlast.org",url:"http://simonlast.org/"},{name:"Ben Monro",url:"https://github.com/benmonro"},{name:"Aziz Khoury",url:"https://github.com/akhoury"}],license:"MIT",readmeFilename:"README.md",dependencies:{"p-limit":"^3.1.0"},devDependencies:{chai:"^4.1.2",mocha:"^10.2.0",rimraf:"^2.4.3"}}});var Jz=Y((U_t,Gz)=>{var zh=require("fs"),zb=require("path"),uAe=require("crypto"),{nextTick:cAe}=require("process"),lAe=$z(),pAe=Hz(),g3={ttl:!1,logging:!1,encoding:"utf8",parse:JSON.parse,stringify:JSON.stringify,forgiveParseErrors:!1,expiredInterval:2*60*1e3,dir:"."+pAe.name+"/storage",writeQueue:!0,writeQueueIntervalMs:1e3,writeQueueWriteOnlyLast:!0,maxFileDescriptors:1/0},v3=24*60*60*1e3,fAe=function(e){return typeof e=="function"},Yz=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},Kz=function(e){return Object.prototype.toString.call(e)==="[object Date]"},dAe=function(e){return Kz(e)&&!isNaN(e)},hAe=function(e){return dAe(e)&&e.getTime()>+new Date},mAe=function(e){return uAe.createHash("sha256").update(e).digest("hex")},yAe=function(e){return e&&e.key},x3=function(e){return e&&e.ttl&&e.ttl<new Date().getTime()},gAe=function(e){return!x3(e)},vAe=function(e){return e=zb.normalize(e),zb.isAbsolute(e)?e:zb.join(process.cwd(),e)},nC=function(e){if(!(this instanceof nC))return new nC(e);this.setOptions(e)};nC.prototype={init:async function(e){return e&&this.setOptions(e),await this.ensureDirectory(this.options.dir),this.options.expiredInterval&&this.startExpiredKeysInterval(),this.q={},this.startWriteQueueInterval(),this.options},initSync:function(e){return e&&this.setOptions(e),this.ensureDirectorySync(this.options.dir),this.options.expiredInterval&&this.startExpiredKeysInterval(),this.q={},this.startWriteQueueInterval(),this.options},setOptions:function(e){var r;let t={};if(!e)t=g3;else{for(let a in g3)e.hasOwnProperty(a)?t[a]=e[a]:t[a]=this.options&&this.options[a]!=null?this.options[a]:g3[a];t.dir=vAe(t.dir),t.ttl=t.ttl?Yz(t.ttl)&&t.ttl>0?t.ttl:v3:!1}fAe(t.logging)&&(this.log=t.logging,t.logging=!0),(!this.limit||t.maxFileDescriptors!==((r=this.options)==null?void 0:r.maxFileDescriptors))&&(this.limit=lAe(t.maxFileDescriptors)),this.options=t},data:function(){return this.readDirectory(this.options.dir)},keys:async function(e){let t=await this.data();return e&&(t=t.filter(e)),t.map(r=>r.key)},values:async function(e){let t=await this.data();return e&&(t=t.filter(e)),t.map(r=>r.value)},length:async function(e){let t=await this.data();return e&&(t=t.filter(e)),t.length},forEach:async function(e){let t=await this.data();for(let r of t)await e(r)},valuesWithKeyMatch:function(e){e=e||/.*/;let t=e instanceof RegExp?r=>e.test(r.key):r=>r.key.indexOf(e)!==-1;return this.values(t)},set:function(e,t,r={}){return this.setItem(e,t,r)},setItem:function(e,t,r={}){let a=this.copy(t),o=this.calcTTL(r.ttl);this.log(`set ('${e}': '${this.stringify(a)}')`);let n={key:e,value:a,ttl:o};return this.queueWriteFile(this.getDatumPath(e),n)},update:function(e,t,r={}){return this.updateItem(e,t,r)},updateItem:async function(e,t,r={}){let a=await this.getDatum(e);if(a&&gAe(a)){let o=this.copy(t),n;r.ttl?n=this.calcTTL(r.ttl):n=a.ttl,this.log(`update ('${e}': '${this.stringify(o)}')`);let l={key:e,value:o,ttl:n};return this.queueWriteFile(this.getDatumPath(e),l)}else return this.setItem(e,t,r)},get:function(e){return this.getItem(e)},getItem:async function(e){let t=await this.getDatum(e);if(x3(t))this.log(`${e} has expired`),await this.removeItem(e);else return t.value},getDatum:function(e){return this.readFile(this.getDatumPath(e))},getRawDatum:function(e){return this.readFile(this.getDatumPath(e),{raw:!0})},getDatumValue:async function(e){let t=await this.getDatum(e);return t&&t.value},getDatumPath:function(e){return zb.join(this.options.dir,mAe(e))},del:function(e){return this.removeItem(e)},rm:function(e){return this.removeItem(e)},removeItem:function(e){return this.deleteFile(this.getDatumPath(e))},removeExpiredItems:async function(){let e=await this.keys(x3);for(let t of e)await this.removeItem(t)},clear:async function(){let e=await this.data();for(let t of e)await this.removeItem(t.key)},ensureDirectory:function(e){return new Promise((t,r)=>{let a={dir:e};zh.access(e,o=>{if(o)zh.mkdir(e,{recursive:!0},n=>{if(n)return r(n);this.log("created "+e),t(a)});else return t(a)})})},ensureDirectorySync:function(e){let t={dir:e};try{return zh.accessSync(e),t}catch{return zh.mkdirSync(e,{recursive:!0}),this.log("created "+e),t}},readDirectory:function(e){return new Promise((t,r)=>{zh.access(e,a=>{a?r(new Error(`[node-persist][readDirectory] ${e} does not exists!`)):zh.readdir(e,async(o,n)=>{if(o)return r(o);let l=[];try{for(let f of n)f[0]!=="."&&l.push(await this.limit(()=>this.readFile(zb.join(this.options.dir,f))))}catch(f){r(f)}t(l)})})})},readFile:function(e,t={}){return this.limit(()=>new Promise((r,a)=>{zh.readFile(e,this.options.encoding,(o,n)=>{if(o)if(o.code==="ENOENT")this.log(`${e} does not exist, returning undefined value`),r(t.raw?"{}":{});else return a(o);let l=t.raw?n:this.parse(n);if(!t.raw&&!yAe(l))return this.options.forgiveParseErrors?r(t.raw?"{}":{}):a(new Error(`[node-persist][readFile] ${e} does not look like a valid storage file!`));r(l)})}))},queueWriteFile:async function(e,t){return this.options.writeQueue===!1?this.writeFile(e,t):(this.q[e]=this.q[e]||[],cAe(()=>{this.startWriteQueueInterval()}),new Promise((r,a)=>{this.q[e].push({content:t,resolve:r,reject:a})}))},processWriteQueue:async function(){if(this.processingWriteQueue){this.log("Still processing write queue, waiting...");return}this.processingWriteQueue=!0;let e=Object.keys(this.q).map(async t=>{let r;this.options.writeQueueWriteOnlyLast?r=this.q[t].pop():r=this.q[t].shift();try{let a=await this.writeFile(t,r.content);if(this.options.writeQueueWriteOnlyLast)for(;this.q[t].length;)this.q[t].shift().resolve(a);r.resolve(a)}catch(a){for(;this.q[t].length;)this.q[t].shift().reject(a);r.reject(a)}(!this.q[t]||!this.q[t].length)&&delete this.q[t]});try{await Promise.all(e)}finally{this.processingWriteQueue=!1}},startWriteQueueInterval:function(){this.processWriteQueue(),this._writeQueueInterval||(this._writeQueueInterval=setInterval(()=>this.processWriteQueue(),this.options.writeQueueIntervalMs||1e3),this._writeQueueInterval.unref&&this._writeQueueInterval.unref())},stopWriteQueueInterval:function(){clearInterval(this._writeQueueInterval)},writeFile:async function(e,t){return this.limit(()=>new Promise((r,a)=>{zh.writeFile(e,this.stringify(t),this.options.encoding,o=>{if(o)return a(o);r({file:e,content:t}),this.log("wrote: "+e)})}))},deleteFile:function(e){return this.limit(()=>new Promise((t,r)=>{zh.access(e,a=>{a?(this.log(`Not removing file:${e} because it doesn't exist`),t({file:e,removed:!1,existed:!1})):(this.log(`Removing file:${e}`),zh.unlink(e,o=>{if(o&&o.code!=="ENOENT")return r(o);let n={file:e,removed:!o,existed:!a};o&&this.log(`Failed to remove file:${e} because it doesn't exist anymore.`),t(n)}))})}))},stringify:function(e){return this.options.stringify(e)},parse:function(e){if(e!=null)try{return this.options.parse(e)}catch(t){this.log("parse error: ",this.stringify(t),"for:",e);return}},copy:function(e){return typeof e!="object"?e:this.parse(this.stringify(e))},startExpiredKeysInterval:function(){this.stopExpiredKeysInterval(),this._expiredKeysInterval=setInterval(this.removeExpiredItems.bind(this),this.options.expiredInterval),this._expiredKeysInterval.unref&&this._expiredKeysInterval.unref()},stopExpiredKeysInterval:function(){clearInterval(this._expiredKeysInterval)},log:function(){this.options&&this.options.logging&&console.log.apply(console,arguments)},calcTTL:function(e){let r=new Date().getTime();if(typeof e>"u"&&(e=this.options.ttl),e)return Kz(e)?(hAe(e)||(e=v3),e=e.getTime?e.getTime():e):e=e?Yz(e)&&e>0?r+e:v3:void 0,e}};Gz.exports=nC});var Zz=Y((V_t,Xz)=>{var xAe=Jz();(function(e){e.create=function(r){return xAe(r)},e.init=async function(r){let a=e.defaultInstance=e.create(r),o=await a.init(r);return t(e,a,{skip:["init","initSync","create"]}),o},e.initSync=function(r){let a=e.defaultInstance=e.create(r),o=a.initSync(r);return t(e,a,{skip:["init","initSync","create"]}),o};function t(r,a,o){o=o||{},o.skip=o.skip||[];for(let n in a)typeof a[n]=="function"&&n.indexOf("_")!==0&&o.skip.indexOf(n)===-1&&(r[n]=a[n].bind(a))}})(Xz.exports)});function e$(){try{b3.initSync({dir:SAe()})}catch(e){console.error("[File] initStorage error",e)}}async function iC(e,t,r){e$(),await b3.setItem(e,t).catch(a=>{console.error("[File] setLocalData error",a)}),r==null||r()}async function sC(e){return e$(),await b3.getItem(e).catch(r=>{console.error("[File] getLocalData error",r)})}function SAe(){try{let e=S3.parse(process.cwd()).root,t=process.cwd(),a=S3.relative(e,t).split(S3.sep).length-2;return`${new Array(Math.max(0,a)).fill("../").join("")}.edgeone`}catch{return".edgeone"}}function t$(e){return Om.default.statSync(e)}function bAe(e){return Om.default.mkdirSync(e,{recursive:!0})}function EAe(e){return Om.default.existsSync(e)}function E3(e){return Om.default.existsSync(e)}function _3(e,t="utf-8"){return Om.default.readFileSync(e,t)}function r$(e){let t=_3(e);return Qz.default.parse(t)}function aC(e,t,r="utf-8"){let a=Uz(e);return EAe(a)||bAe(a),Om.default.writeFileSync(e,t,r)}function T3(e,t){return E3(e)?Om.default.appendFileSync(e,t):Om.default.writeFileSync(e,t)}var Qz,Om,b3,S3,r1=Pt(()=>{Qz=hr(jz()),Om=hr(require("fs"));Im();b3=Zz(),S3=require("path")});function w3(){return process.env.LANG==="zh_CN.UTF-8"}var _Ae,TAe,C3=Pt(()=>{_Ae=hr(require("crypto")),TAe=require("lodash")});function CAe(e){a$=e}function oC(){return a$}function xr(e,t){let r=oC(),a=uC({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===N2?void 0:N2].filter(o=>!!o)});e.common.issues.push(a)}function cC(e,t,r,a){if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?a:r==="a"?a.call(e):a?a.value:t.get(e)}function o$(e,t,r,a,o){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r}function ni(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:a,description:o}=e;if(t&&(r||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(l,f)=>{var y,m;let{message:b}=e;return l.code==="invalid_enum_value"?{message:b!=null?b:f.defaultError}:typeof f.data>"u"?{message:(y=b!=null?b:a)!==null&&y!==void 0?y:f.defaultError}:l.code!=="invalid_type"?{message:f.defaultError}:{message:(m=b!=null?b:r)!==null&&m!==void 0?m:f.defaultError}},description:o}}function c$(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function zAe(e){return new RegExp(`^${c$(e)}$`)}function l$(e){let t=`${u$}T${c$(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function $Ae(e,t){return!!((t==="v4"||!t)&&MAe.test(e)||(t==="v6"||!t)&&jAe.test(e))}function HAe(e,t){if(!NAe.test(e))return!1;try{let[r]=e.split("."),a=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(a));return!(typeof o!="object"||o===null||!o.typ||!o.alg||t&&o.alg!==t)}catch{return!1}}function YAe(e,t){return!!((t==="v4"||!t)&&BAe.test(e)||(t==="v6"||!t)&&qAe.test(e))}function KAe(e,t){let r=(e.toString().split(".")[1]||"").length,a=(t.toString().split(".")[1]||"").length,o=r>a?r:a,n=parseInt(e.toFixed(o).replace(".","")),l=parseInt(t.toFixed(o).replace(".",""));return n%l/Math.pow(10,o)}function I2(e){if(e instanceof Wl){let t={};for(let r in e.shape){let a=e.shape[r];t[r]=Lf.create(I2(a))}return new Wl({...e._def,shape:()=>t})}else return e instanceof Lm?new Lm({...e._def,type:I2(e.element)}):e instanceof Lf?Lf.create(I2(e.unwrap())):e instanceof Hh?Hh.create(I2(e.unwrap())):e instanceof $h?$h.create(e.items.map(t=>I2(t))):e}function I3(e,t){let r=Fm(e),a=Fm(t);if(e===t)return{valid:!0,data:e};if(r===Ir.object&&a===Ir.object){let o=Ji.objectKeys(t),n=Ji.objectKeys(e).filter(f=>o.indexOf(f)!==-1),l={...e,...t};for(let f of n){let y=I3(e[f],t[f]);if(!y.valid)return{valid:!1};l[f]=y.data}return{valid:!0,data:l}}else if(r===Ir.array&&a===Ir.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let n=0;n<e.length;n++){let l=e[n],f=t[n],y=I3(l,f);if(!y.valid)return{valid:!1};o.push(y.data)}return{valid:!0,data:o}}else return r===Ir.date&&a===Ir.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}function p$(e,t){return new Rg({values:e,typeName:On.ZodEnum,...ni(t)})}function i$(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function f$(e,t={},r){return e?i1.create().superRefine((a,o)=>{var n,l;let f=e(a);if(f instanceof Promise)return f.then(y=>{var m,b;if(!y){let w=i$(t,a),A=(b=(m=w.fatal)!==null&&m!==void 0?m:r)!==null&&b!==void 0?b:!0;o.addIssue({code:"custom",...w,fatal:A})}});if(!f){let y=i$(t,a),m=(l=(n=y.fatal)!==null&&n!==void 0?n:r)!==null&&l!==void 0?l:!0;o.addIssue({code:"custom",...y,fatal:m})}}):i1.create()}var Ji,P3,Ir,Fm,Kt,wAe,Up,N2,a$,uC,DAe,wc,Ln,O2,Gc,A3,k3,Tg,Yb,Zr,$b,Hb,Mf,n$,ii,PAe,AAe,kAe,IAe,OAe,NAe,FAe,RAe,LAe,D3,MAe,BAe,jAe,qAe,UAe,VAe,u$,WAe,n1,wg,Cg,Dg,Pg,F2,Ag,kg,i1,Rm,jd,R2,Lm,Wl,Ig,Nm,lC,Og,$h,pC,L2,M2,fC,Ng,Fg,Rg,Lg,s1,Vp,Lf,Hh,Mg,Bg,B2,GAe,Kb,Gb,jg,JAe,On,XAe,d$,h$,ZAe,QAe,m$,eke,tke,rke,nke,ike,ske,ake,oke,uke,cke,lke,pke,fke,dke,hke,mke,yke,gke,vke,xke,Ske,bke,Eke,_ke,s$,Tke,wke,Cke,Dke,Pke,Ake,kke,Ike,Oke,Bt,O3=Pt(()=>{(function(e){e.assertEqual=o=>o;function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{let n={};for(let l of o)n[l]=l;return n},e.getValidEnumValues=o=>{let n=e.objectKeys(o).filter(f=>typeof o[o[f]]!="number"),l={};for(let f of n)l[f]=o[f];return e.objectValues(l)},e.objectValues=o=>e.objectKeys(o).map(function(n){return o[n]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let n=[];for(let l in o)Object.prototype.hasOwnProperty.call(o,l)&&n.push(l);return n},e.find=(o,n)=>{for(let l of o)if(n(l))return l},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&isFinite(o)&&Math.floor(o)===o;function a(o,n=" | "){return o.map(l=>typeof l=="string"?`'${l}'`:l).join(n)}e.joinValues=a,e.jsonStringifyReplacer=(o,n)=>typeof n=="bigint"?n.toString():n})(Ji||(Ji={}));(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(P3||(P3={}));Ir=Ji.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Fm=e=>{switch(typeof e){case"undefined":return Ir.undefined;case"string":return Ir.string;case"number":return isNaN(e)?Ir.nan:Ir.number;case"boolean":return Ir.boolean;case"function":return Ir.function;case"bigint":return Ir.bigint;case"symbol":return Ir.symbol;case"object":return Array.isArray(e)?Ir.array:e===null?Ir.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Ir.promise:typeof Map<"u"&&e instanceof Map?Ir.map:typeof Set<"u"&&e instanceof Set?Ir.set:typeof Date<"u"&&e instanceof Date?Ir.date:Ir.object;default:return Ir.unknown}},Kt=Ji.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"]),wAe=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),Up=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(n){return n.message},a={_errors:[]},o=n=>{for(let l of n.issues)if(l.code==="invalid_union")l.unionErrors.map(o);else if(l.code==="invalid_return_type")o(l.returnTypeError);else if(l.code==="invalid_arguments")o(l.argumentsError);else if(l.path.length===0)a._errors.push(r(l));else{let f=a,y=0;for(;y<l.path.length;){let m=l.path[y];y===l.path.length-1?(f[m]=f[m]||{_errors:[]},f[m]._errors.push(r(l))):f[m]=f[m]||{_errors:[]},f=f[m],y++}}};return o(this),a}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ji.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},a=[];for(let o of this.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):a.push(t(o));return{formErrors:a,fieldErrors:r}}get formErrors(){return this.flatten()}};Up.create=e=>new Up(e);N2=(e,t)=>{let r;switch(e.code){case Kt.invalid_type:e.received===Ir.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case Kt.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Ji.jsonStringifyReplacer)}`;break;case Kt.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ji.joinValues(e.keys,", ")}`;break;case Kt.invalid_union:r="Invalid input";break;case Kt.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ji.joinValues(e.options)}`;break;case Kt.invalid_enum_value:r=`Invalid enum value. Expected ${Ji.joinValues(e.options)}, received '${e.received}'`;break;case Kt.invalid_arguments:r="Invalid function arguments";break;case Kt.invalid_return_type:r="Invalid function return type";break;case Kt.invalid_date:r="Invalid date";break;case Kt.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Ji.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case Kt.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case Kt.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case Kt.custom:r="Invalid input";break;case Kt.invalid_intersection_types:r="Intersection results could not be merged";break;case Kt.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case Kt.not_finite:r="Number must be finite";break;default:r=t.defaultError,Ji.assertNever(e)}return{message:r}},a$=N2;uC=e=>{let{data:t,path:r,errorMaps:a,issueData:o}=e,n=[...r,...o.path||[]],l={...o,path:n};if(o.message!==void 0)return{...o,path:n,message:o.message};let f="",y=a.filter(m=>!!m).slice().reverse();for(let m of y)f=m(l,{data:t,defaultError:f}).message;return{...o,path:n,message:f}},DAe=[];wc=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let a=[];for(let o of r){if(o.status==="aborted")return Ln;o.status==="dirty"&&t.dirty(),a.push(o.value)}return{status:t.value,value:a}}static async mergeObjectAsync(t,r){let a=[];for(let o of r){let n=await o.key,l=await o.value;a.push({key:n,value:l})}return e.mergeObjectSync(t,a)}static mergeObjectSync(t,r){let a={};for(let o of r){let{key:n,value:l}=o;if(n.status==="aborted"||l.status==="aborted")return Ln;n.status==="dirty"&&t.dirty(),l.status==="dirty"&&t.dirty(),n.value!=="__proto__"&&(typeof l.value<"u"||o.alwaysSet)&&(a[n.value]=l.value)}return{status:t.value,value:a}}},Ln=Object.freeze({status:"aborted"}),O2=e=>({status:"dirty",value:e}),Gc=e=>({status:"valid",value:e}),A3=e=>e.status==="aborted",k3=e=>e.status==="dirty",Tg=e=>e.status==="valid",Yb=e=>typeof Promise<"u"&&e instanceof Promise;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Zr||(Zr={}));Mf=class{constructor(t,r,a,o){this._cachedPath=[],this.parent=t,this.data=r,this._path=a,this._key=o}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},n$=(e,t)=>{if(Tg(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Up(e.common.issues);return this._error=r,this._error}}};ii=class{get description(){return this._def.description}_getType(t){return Fm(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Fm(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new wc,ctx:{common:t.parent.common,data:t.data,parsedType:Fm(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(Yb(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let a=this.safeParse(t,r);if(a.success)return a.data;throw a.error}safeParse(t,r){var a;let o={common:{issues:[],async:(a=r==null?void 0:r.async)!==null&&a!==void 0?a:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Fm(t)},n=this._parseSync({data:t,path:o.path,parent:o});return n$(o,n)}"~validate"(t){var r,a;let o={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Fm(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:o});return Tg(n)?{value:n.value}:{issues:o.common.issues}}catch(n){!((a=(r=n==null?void 0:n.message)===null||r===void 0?void 0:r.toLowerCase())===null||a===void 0)&&a.includes("encountered")&&(this["~standard"].async=!0),o.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:o}).then(n=>Tg(n)?{value:n.value}:{issues:o.common.issues})}async parseAsync(t,r){let a=await this.safeParseAsync(t,r);if(a.success)return a.data;throw a.error}async safeParseAsync(t,r){let a={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Fm(t)},o=this._parse({data:t,path:a.path,parent:a}),n=await(Yb(o)?o:Promise.resolve(o));return n$(a,n)}refine(t,r){let a=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,n)=>{let l=t(o),f=()=>n.addIssue({code:Kt.custom,...a(o)});return typeof Promise<"u"&&l instanceof Promise?l.then(y=>y?!0:(f(),!1)):l?!0:(f(),!1)})}refinement(t,r){return this._refinement((a,o)=>t(a)?!0:(o.addIssue(typeof r=="function"?r(a,o):r),!1))}_refinement(t){return new Vp({schema:this,typeName:On.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,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:r=>this["~validate"](r)}}optional(){return Lf.create(this,this._def)}nullable(){return Hh.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Lm.create(this)}promise(){return s1.create(this,this._def)}or(t){return Ig.create([this,t],this._def)}and(t){return Og.create(this,t,this._def)}transform(t){return new Vp({...ni(this._def),schema:this,typeName:On.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Mg({...ni(this._def),innerType:this,defaultValue:r,typeName:On.ZodDefault})}brand(){return new Kb({typeName:On.ZodBranded,type:this,...ni(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Bg({...ni(this._def),innerType:this,catchValue:r,typeName:On.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Gb.create(this,t)}readonly(){return jg.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},PAe=/^c[^\s-]{8,}$/i,AAe=/^[0-9a-z]+$/,kAe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,IAe=/^[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,OAe=/^[a-z0-9_-]{21}$/i,NAe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,FAe=/^[-+]?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)?)??$/,RAe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,LAe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",MAe=/^(?:(?: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])$/,BAe=/^(?:(?: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])$/,jAe=/^(([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]))$/,qAe=/^(([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])$/,UAe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,VAe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,u$="((\\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])))",WAe=new RegExp(`^${u$}$`);n1=class e extends ii{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Ir.string){let n=this._getOrReturnCtx(t);return xr(n,{code:Kt.invalid_type,expected:Ir.string,received:n.parsedType}),Ln}let a=new wc,o;for(let n of this._def.checks)if(n.kind==="min")t.data.length<n.value&&(o=this._getOrReturnCtx(t,o),xr(o,{code:Kt.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),a.dirty());else if(n.kind==="max")t.data.length>n.value&&(o=this._getOrReturnCtx(t,o),xr(o,{code:Kt.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),a.dirty());else if(n.kind==="length"){let l=t.data.length>n.value,f=t.data.length<n.value;(l||f)&&(o=this._getOrReturnCtx(t,o),l?xr(o,{code:Kt.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):f&&xr(o,{code:Kt.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),a.dirty())}else if(n.kind==="email")RAe.test(t.data)||(o=this._getOrReturnCtx(t,o),xr(o,{validation:"email",code:Kt.invalid_string,message:n.message}),a.dirty());else if(n.kind==="emoji")D3||(D3=new RegExp(LAe,"u")),D3.test(t.data)||(o=this._getOrReturnCtx(t,o),xr(o,{validation:"emoji",code:Kt.invalid_string,message:n.message}),a.dirty());else if(n.kind==="uuid")IAe.test(t.data)||(o=this._getOrReturnCtx(t,o),xr(o,{validation:"uuid",code:Kt.invalid_string,message:n.message}),a.dirty());else if(n.kind==="nanoid")OAe.test(t.data)||(o=this._getOrReturnCtx(t,o),xr(o,{validation:"nanoid",code:Kt.invalid_string,message:n.message}),a.dirty());else if(n.kind==="cuid")PAe.test(t.data)||(o=this._getOrReturnCtx(t,o),xr(o,{validation:"cuid",code:Kt.invalid_string,message:n.message}),a.dirty());else if(n.kind==="cuid2")AAe.test(t.data)||(o=this._getOrReturnCtx(t,o),xr(o,{validation:"cuid2",code:Kt.invalid_string,message:n.message}),a.dirty());else if(n.kind==="ulid")kAe.test(t.data)||(o=this._getOrReturnCtx(t,o),xr(o,{validation:"ulid",code:Kt.invalid_string,message:n.message}),a.dirty());else if(n.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),xr(o,{validation:"url",code:Kt.invalid_string,message:n.message}),a.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),xr(o,{validation:"regex",code:Kt.invalid_string,message:n.message}),a.dirty())):n.kind==="trim"?t.data=t.data.trim():n.kind==="includes"?t.data.includes(n.value,n.position)||(o=this._getOrReturnCtx(t,o),xr(o,{code:Kt.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),a.dirty()):n.kind==="toLowerCase"?t.data=t.data.toLowerCase():n.kind==="toUpperCase"?t.data=t.data.toUpperCase():n.kind==="startsWith"?t.data.startsWith(n.value)||(o=this._getOrReturnCtx(t,o),xr(o,{code:Kt.invalid_string,validation:{startsWith:n.value},message:n.message}),a.dirty()):n.kind==="endsWith"?t.data.endsWith(n.value)||(o=this._getOrReturnCtx(t,o),xr(o,{code:Kt.invalid_string,validation:{endsWith:n.value},message:n.message}),a.dirty()):n.kind==="datetime"?l$(n).test(t.data)||(o=this._getOrReturnCtx(t,o),xr(o,{code:Kt.invalid_string,validation:"datetime",message:n.message}),a.dirty()):n.kind==="date"?WAe.test(t.data)||(o=this._getOrReturnCtx(t,o),xr(o,{code:Kt.invalid_string,validation:"date",message:n.message}),a.dirty()):n.kind==="time"?zAe(n).test(t.data)||(o=this._getOrReturnCtx(t,o),xr(o,{code:Kt.invalid_string,validation:"time",message:n.message}),a.dirty()):n.kind==="duration"?FAe.test(t.data)||(o=this._getOrReturnCtx(t,o),xr(o,{validation:"duration",code:Kt.invalid_string,message:n.message}),a.dirty()):n.kind==="ip"?$Ae(t.data,n.version)||(o=this._getOrReturnCtx(t,o),xr(o,{validation:"ip",code:Kt.invalid_string,message:n.message}),a.dirty()):n.kind==="jwt"?HAe(t.data,n.alg)||(o=this._getOrReturnCtx(t,o),xr(o,{validation:"jwt",code:Kt.invalid_string,message:n.message}),a.dirty()):n.kind==="cidr"?YAe(t.data,n.version)||(o=this._getOrReturnCtx(t,o),xr(o,{validation:"cidr",code:Kt.invalid_string,message:n.message}),a.dirty()):n.kind==="base64"?UAe.test(t.data)||(o=this._getOrReturnCtx(t,o),xr(o,{validation:"base64",code:Kt.invalid_string,message:n.message}),a.dirty()):n.kind==="base64url"?VAe.test(t.data)||(o=this._getOrReturnCtx(t,o),xr(o,{validation:"base64url",code:Kt.invalid_string,message:n.message}),a.dirty()):Ji.assertNever(n);return{status:a.value,value:t.data}}_regex(t,r,a){return this.refinement(o=>t.test(o),{validation:r,code:Kt.invalid_string,...Zr.errToObj(a)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Zr.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Zr.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Zr.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Zr.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Zr.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Zr.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Zr.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Zr.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Zr.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Zr.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Zr.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Zr.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Zr.errToObj(t)})}datetime(t){var r,a;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!==null&&r!==void 0?r:!1,local:(a=t==null?void 0:t.local)!==null&&a!==void 0?a:!1,...Zr.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Zr.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Zr.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...Zr.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...Zr.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...Zr.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...Zr.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...Zr.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...Zr.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...Zr.errToObj(r)})}nonempty(t){return this.min(1,Zr.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};n1.create=e=>{var t;return new n1({checks:[],typeName:On.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...ni(e)})};wg=class e extends ii{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Ir.number){let n=this._getOrReturnCtx(t);return xr(n,{code:Kt.invalid_type,expected:Ir.number,received:n.parsedType}),Ln}let a,o=new wc;for(let n of this._def.checks)n.kind==="int"?Ji.isInteger(t.data)||(a=this._getOrReturnCtx(t,a),xr(a,{code:Kt.invalid_type,expected:"integer",received:"float",message:n.message}),o.dirty()):n.kind==="min"?(n.inclusive?t.data<n.value:t.data<=n.value)&&(a=this._getOrReturnCtx(t,a),xr(a,{code:Kt.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),o.dirty()):n.kind==="max"?(n.inclusive?t.data>n.value:t.data>=n.value)&&(a=this._getOrReturnCtx(t,a),xr(a,{code:Kt.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),o.dirty()):n.kind==="multipleOf"?KAe(t.data,n.value)!==0&&(a=this._getOrReturnCtx(t,a),xr(a,{code:Kt.not_multiple_of,multipleOf:n.value,message:n.message}),o.dirty()):n.kind==="finite"?Number.isFinite(t.data)||(a=this._getOrReturnCtx(t,a),xr(a,{code:Kt.not_finite,message:n.message}),o.dirty()):Ji.assertNever(n);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Zr.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Zr.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Zr.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Zr.toString(r))}setLimit(t,r,a,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:a,message:Zr.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Zr.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Zr.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Zr.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Zr.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Zr.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Zr.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:Zr.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Zr.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Zr.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ji.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(r===null||a.value>r)&&(r=a.value):a.kind==="max"&&(t===null||a.value<t)&&(t=a.value)}return Number.isFinite(r)&&Number.isFinite(t)}};wg.create=e=>new wg({checks:[],typeName:On.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...ni(e)});Cg=class e extends ii{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Ir.bigint)return this._getInvalidInput(t);let a,o=new wc;for(let n of this._def.checks)n.kind==="min"?(n.inclusive?t.data<n.value:t.data<=n.value)&&(a=this._getOrReturnCtx(t,a),xr(a,{code:Kt.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),o.dirty()):n.kind==="max"?(n.inclusive?t.data>n.value:t.data>=n.value)&&(a=this._getOrReturnCtx(t,a),xr(a,{code:Kt.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),o.dirty()):n.kind==="multipleOf"?t.data%n.value!==BigInt(0)&&(a=this._getOrReturnCtx(t,a),xr(a,{code:Kt.not_multiple_of,multipleOf:n.value,message:n.message}),o.dirty()):Ji.assertNever(n);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return xr(r,{code:Kt.invalid_type,expected:Ir.bigint,received:r.parsedType}),Ln}gte(t,r){return this.setLimit("min",t,!0,Zr.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Zr.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Zr.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Zr.toString(r))}setLimit(t,r,a,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:a,message:Zr.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Zr.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Zr.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Zr.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Zr.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Zr.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Cg.create=e=>{var t;return new Cg({checks:[],typeName:On.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...ni(e)})};Dg=class extends ii{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Ir.boolean){let a=this._getOrReturnCtx(t);return xr(a,{code:Kt.invalid_type,expected:Ir.boolean,received:a.parsedType}),Ln}return Gc(t.data)}};Dg.create=e=>new Dg({typeName:On.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...ni(e)});Pg=class e extends ii{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Ir.date){let n=this._getOrReturnCtx(t);return xr(n,{code:Kt.invalid_type,expected:Ir.date,received:n.parsedType}),Ln}if(isNaN(t.data.getTime())){let n=this._getOrReturnCtx(t);return xr(n,{code:Kt.invalid_date}),Ln}let a=new wc,o;for(let n of this._def.checks)n.kind==="min"?t.data.getTime()<n.value&&(o=this._getOrReturnCtx(t,o),xr(o,{code:Kt.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),a.dirty()):n.kind==="max"?t.data.getTime()>n.value&&(o=this._getOrReturnCtx(t,o),xr(o,{code:Kt.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),a.dirty()):Ji.assertNever(n);return{status:a.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:Zr.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:Zr.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};Pg.create=e=>new Pg({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:On.ZodDate,...ni(e)});F2=class extends ii{_parse(t){if(this._getType(t)!==Ir.symbol){let a=this._getOrReturnCtx(t);return xr(a,{code:Kt.invalid_type,expected:Ir.symbol,received:a.parsedType}),Ln}return Gc(t.data)}};F2.create=e=>new F2({typeName:On.ZodSymbol,...ni(e)});Ag=class extends ii{_parse(t){if(this._getType(t)!==Ir.undefined){let a=this._getOrReturnCtx(t);return xr(a,{code:Kt.invalid_type,expected:Ir.undefined,received:a.parsedType}),Ln}return Gc(t.data)}};Ag.create=e=>new Ag({typeName:On.ZodUndefined,...ni(e)});kg=class extends ii{_parse(t){if(this._getType(t)!==Ir.null){let a=this._getOrReturnCtx(t);return xr(a,{code:Kt.invalid_type,expected:Ir.null,received:a.parsedType}),Ln}return Gc(t.data)}};kg.create=e=>new kg({typeName:On.ZodNull,...ni(e)});i1=class extends ii{constructor(){super(...arguments),this._any=!0}_parse(t){return Gc(t.data)}};i1.create=e=>new i1({typeName:On.ZodAny,...ni(e)});Rm=class extends ii{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Gc(t.data)}};Rm.create=e=>new Rm({typeName:On.ZodUnknown,...ni(e)});jd=class extends ii{_parse(t){let r=this._getOrReturnCtx(t);return xr(r,{code:Kt.invalid_type,expected:Ir.never,received:r.parsedType}),Ln}};jd.create=e=>new jd({typeName:On.ZodNever,...ni(e)});R2=class extends ii{_parse(t){if(this._getType(t)!==Ir.undefined){let a=this._getOrReturnCtx(t);return xr(a,{code:Kt.invalid_type,expected:Ir.void,received:a.parsedType}),Ln}return Gc(t.data)}};R2.create=e=>new R2({typeName:On.ZodVoid,...ni(e)});Lm=class e extends ii{_parse(t){let{ctx:r,status:a}=this._processInputParams(t),o=this._def;if(r.parsedType!==Ir.array)return xr(r,{code:Kt.invalid_type,expected:Ir.array,received:r.parsedType}),Ln;if(o.exactLength!==null){let l=r.data.length>o.exactLength.value,f=r.data.length<o.exactLength.value;(l||f)&&(xr(r,{code:l?Kt.too_big:Kt.too_small,minimum:f?o.exactLength.value:void 0,maximum:l?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),a.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(xr(r,{code:Kt.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),a.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(xr(r,{code:Kt.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),a.dirty()),r.common.async)return Promise.all([...r.data].map((l,f)=>o.type._parseAsync(new Mf(r,l,r.path,f)))).then(l=>wc.mergeArray(a,l));let n=[...r.data].map((l,f)=>o.type._parseSync(new Mf(r,l,r.path,f)));return wc.mergeArray(a,n)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:Zr.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:Zr.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:Zr.toString(r)}})}nonempty(t){return this.min(1,t)}};Lm.create=(e,t)=>new Lm({type:e,minLength:null,maxLength:null,exactLength:null,typeName:On.ZodArray,...ni(t)});Wl=class e extends ii{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=Ji.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==Ir.object){let m=this._getOrReturnCtx(t);return xr(m,{code:Kt.invalid_type,expected:Ir.object,received:m.parsedType}),Ln}let{status:a,ctx:o}=this._processInputParams(t),{shape:n,keys:l}=this._getCached(),f=[];if(!(this._def.catchall instanceof jd&&this._def.unknownKeys==="strip"))for(let m in o.data)l.includes(m)||f.push(m);let y=[];for(let m of l){let b=n[m],w=o.data[m];y.push({key:{status:"valid",value:m},value:b._parse(new Mf(o,w,o.path,m)),alwaysSet:m in o.data})}if(this._def.catchall instanceof jd){let m=this._def.unknownKeys;if(m==="passthrough")for(let b of f)y.push({key:{status:"valid",value:b},value:{status:"valid",value:o.data[b]}});else if(m==="strict")f.length>0&&(xr(o,{code:Kt.unrecognized_keys,keys:f}),a.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let m=this._def.catchall;for(let b of f){let w=o.data[b];y.push({key:{status:"valid",value:b},value:m._parse(new Mf(o,w,o.path,b)),alwaysSet:b in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let m=[];for(let b of y){let w=await b.key,A=await b.value;m.push({key:w,value:A,alwaysSet:b.alwaysSet})}return m}).then(m=>wc.mergeObjectSync(a,m)):wc.mergeObjectSync(a,y)}get shape(){return this._def.shape()}strict(t){return Zr.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,a)=>{var o,n,l,f;let y=(l=(n=(o=this._def).errorMap)===null||n===void 0?void 0:n.call(o,r,a).message)!==null&&l!==void 0?l:a.defaultError;return r.code==="unrecognized_keys"?{message:(f=Zr.errToObj(t).message)!==null&&f!==void 0?f:y}:{message:y}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:On.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};return Ji.objectKeys(t).forEach(a=>{t[a]&&this.shape[a]&&(r[a]=this.shape[a])}),new e({...this._def,shape:()=>r})}omit(t){let r={};return Ji.objectKeys(this.shape).forEach(a=>{t[a]||(r[a]=this.shape[a])}),new e({...this._def,shape:()=>r})}deepPartial(){return I2(this)}partial(t){let r={};return Ji.objectKeys(this.shape).forEach(a=>{let o=this.shape[a];t&&!t[a]?r[a]=o:r[a]=o.optional()}),new e({...this._def,shape:()=>r})}required(t){let r={};return Ji.objectKeys(this.shape).forEach(a=>{if(t&&!t[a])r[a]=this.shape[a];else{let n=this.shape[a];for(;n instanceof Lf;)n=n._def.innerType;r[a]=n}}),new e({...this._def,shape:()=>r})}keyof(){return p$(Ji.objectKeys(this.shape))}};Wl.create=(e,t)=>new Wl({shape:()=>e,unknownKeys:"strip",catchall:jd.create(),typeName:On.ZodObject,...ni(t)});Wl.strictCreate=(e,t)=>new Wl({shape:()=>e,unknownKeys:"strict",catchall:jd.create(),typeName:On.ZodObject,...ni(t)});Wl.lazycreate=(e,t)=>new Wl({shape:e,unknownKeys:"strip",catchall:jd.create(),typeName:On.ZodObject,...ni(t)});Ig=class extends ii{_parse(t){let{ctx:r}=this._processInputParams(t),a=this._def.options;function o(n){for(let f of n)if(f.result.status==="valid")return f.result;for(let f of n)if(f.result.status==="dirty")return r.common.issues.push(...f.ctx.common.issues),f.result;let l=n.map(f=>new Up(f.ctx.common.issues));return xr(r,{code:Kt.invalid_union,unionErrors:l}),Ln}if(r.common.async)return Promise.all(a.map(async n=>{let l={...r,common:{...r.common,issues:[]},parent:null};return{result:await n._parseAsync({data:r.data,path:r.path,parent:l}),ctx:l}})).then(o);{let n,l=[];for(let y of a){let m={...r,common:{...r.common,issues:[]},parent:null},b=y._parseSync({data:r.data,path:r.path,parent:m});if(b.status==="valid")return b;b.status==="dirty"&&!n&&(n={result:b,ctx:m}),m.common.issues.length&&l.push(m.common.issues)}if(n)return r.common.issues.push(...n.ctx.common.issues),n.result;let f=l.map(y=>new Up(y));return xr(r,{code:Kt.invalid_union,unionErrors:f}),Ln}}get options(){return this._def.options}};Ig.create=(e,t)=>new Ig({options:e,typeName:On.ZodUnion,...ni(t)});Nm=e=>e instanceof Ng?Nm(e.schema):e instanceof Vp?Nm(e.innerType()):e instanceof Fg?[e.value]:e instanceof Rg?e.options:e instanceof Lg?Ji.objectValues(e.enum):e instanceof Mg?Nm(e._def.innerType):e instanceof Ag?[void 0]:e instanceof kg?[null]:e instanceof Lf?[void 0,...Nm(e.unwrap())]:e instanceof Hh?[null,...Nm(e.unwrap())]:e instanceof Kb||e instanceof jg?Nm(e.unwrap()):e instanceof Bg?Nm(e._def.innerType):[],lC=class e extends ii{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Ir.object)return xr(r,{code:Kt.invalid_type,expected:Ir.object,received:r.parsedType}),Ln;let a=this.discriminator,o=r.data[a],n=this.optionsMap.get(o);return n?r.common.async?n._parseAsync({data:r.data,path:r.path,parent:r}):n._parseSync({data:r.data,path:r.path,parent:r}):(xr(r,{code:Kt.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),Ln)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,a){let o=new Map;for(let n of r){let l=Nm(n.shape[t]);if(!l.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let f of l){if(o.has(f))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(f)}`);o.set(f,n)}}return new e({typeName:On.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...ni(a)})}};Og=class extends ii{_parse(t){let{status:r,ctx:a}=this._processInputParams(t),o=(n,l)=>{if(A3(n)||A3(l))return Ln;let f=I3(n.value,l.value);return f.valid?((k3(n)||k3(l))&&r.dirty(),{status:r.value,value:f.data}):(xr(a,{code:Kt.invalid_intersection_types}),Ln)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([n,l])=>o(n,l)):o(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}};Og.create=(e,t,r)=>new Og({left:e,right:t,typeName:On.ZodIntersection,...ni(r)});$h=class e extends ii{_parse(t){let{status:r,ctx:a}=this._processInputParams(t);if(a.parsedType!==Ir.array)return xr(a,{code:Kt.invalid_type,expected:Ir.array,received:a.parsedType}),Ln;if(a.data.length<this._def.items.length)return xr(a,{code:Kt.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ln;!this._def.rest&&a.data.length>this._def.items.length&&(xr(a,{code:Kt.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let n=[...a.data].map((l,f)=>{let y=this._def.items[f]||this._def.rest;return y?y._parse(new Mf(a,l,a.path,f)):null}).filter(l=>!!l);return a.common.async?Promise.all(n).then(l=>wc.mergeArray(r,l)):wc.mergeArray(r,n)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};$h.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new $h({items:e,typeName:On.ZodTuple,rest:null,...ni(t)})};pC=class e extends ii{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:a}=this._processInputParams(t);if(a.parsedType!==Ir.object)return xr(a,{code:Kt.invalid_type,expected:Ir.object,received:a.parsedType}),Ln;let o=[],n=this._def.keyType,l=this._def.valueType;for(let f in a.data)o.push({key:n._parse(new Mf(a,f,a.path,f)),value:l._parse(new Mf(a,a.data[f],a.path,f)),alwaysSet:f in a.data});return a.common.async?wc.mergeObjectAsync(r,o):wc.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,a){return r instanceof ii?new e({keyType:t,valueType:r,typeName:On.ZodRecord,...ni(a)}):new e({keyType:n1.create(),valueType:t,typeName:On.ZodRecord,...ni(r)})}},L2=class extends ii{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:a}=this._processInputParams(t);if(a.parsedType!==Ir.map)return xr(a,{code:Kt.invalid_type,expected:Ir.map,received:a.parsedType}),Ln;let o=this._def.keyType,n=this._def.valueType,l=[...a.data.entries()].map(([f,y],m)=>({key:o._parse(new Mf(a,f,a.path,[m,"key"])),value:n._parse(new Mf(a,y,a.path,[m,"value"]))}));if(a.common.async){let f=new Map;return Promise.resolve().then(async()=>{for(let y of l){let m=await y.key,b=await y.value;if(m.status==="aborted"||b.status==="aborted")return Ln;(m.status==="dirty"||b.status==="dirty")&&r.dirty(),f.set(m.value,b.value)}return{status:r.value,value:f}})}else{let f=new Map;for(let y of l){let m=y.key,b=y.value;if(m.status==="aborted"||b.status==="aborted")return Ln;(m.status==="dirty"||b.status==="dirty")&&r.dirty(),f.set(m.value,b.value)}return{status:r.value,value:f}}}};L2.create=(e,t,r)=>new L2({valueType:t,keyType:e,typeName:On.ZodMap,...ni(r)});M2=class e extends ii{_parse(t){let{status:r,ctx:a}=this._processInputParams(t);if(a.parsedType!==Ir.set)return xr(a,{code:Kt.invalid_type,expected:Ir.set,received:a.parsedType}),Ln;let o=this._def;o.minSize!==null&&a.data.size<o.minSize.value&&(xr(a,{code:Kt.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&a.data.size>o.maxSize.value&&(xr(a,{code:Kt.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let n=this._def.valueType;function l(y){let m=new Set;for(let b of y){if(b.status==="aborted")return Ln;b.status==="dirty"&&r.dirty(),m.add(b.value)}return{status:r.value,value:m}}let f=[...a.data.values()].map((y,m)=>n._parse(new Mf(a,y,a.path,m)));return a.common.async?Promise.all(f).then(y=>l(y)):l(f)}min(t,r){return new e({...this._def,minSize:{value:t,message:Zr.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:Zr.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};M2.create=(e,t)=>new M2({valueType:e,minSize:null,maxSize:null,typeName:On.ZodSet,...ni(t)});fC=class e extends ii{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Ir.function)return xr(r,{code:Kt.invalid_type,expected:Ir.function,received:r.parsedType}),Ln;function a(f,y){return uC({data:f,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,oC(),N2].filter(m=>!!m),issueData:{code:Kt.invalid_arguments,argumentsError:y}})}function o(f,y){return uC({data:f,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,oC(),N2].filter(m=>!!m),issueData:{code:Kt.invalid_return_type,returnTypeError:y}})}let n={errorMap:r.common.contextualErrorMap},l=r.data;if(this._def.returns instanceof s1){let f=this;return Gc(async function(...y){let m=new Up([]),b=await f._def.args.parseAsync(y,n).catch(R=>{throw m.addIssue(a(y,R)),m}),w=await Reflect.apply(l,this,b);return await f._def.returns._def.type.parseAsync(w,n).catch(R=>{throw m.addIssue(o(w,R)),m})})}else{let f=this;return Gc(function(...y){let m=f._def.args.safeParse(y,n);if(!m.success)throw new Up([a(y,m.error)]);let b=Reflect.apply(l,this,m.data),w=f._def.returns.safeParse(b,n);if(!w.success)throw new Up([o(b,w.error)]);return w.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:$h.create(t).rest(Rm.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,a){return new e({args:t||$h.create([]).rest(Rm.create()),returns:r||Rm.create(),typeName:On.ZodFunction,...ni(a)})}},Ng=class extends ii{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Ng.create=(e,t)=>new Ng({getter:e,typeName:On.ZodLazy,...ni(t)});Fg=class extends ii{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return xr(r,{received:r.data,code:Kt.invalid_literal,expected:this._def.value}),Ln}return{status:"valid",value:t.data}}get value(){return this._def.value}};Fg.create=(e,t)=>new Fg({value:e,typeName:On.ZodLiteral,...ni(t)});Rg=class e extends ii{constructor(){super(...arguments),$b.set(this,void 0)}_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),a=this._def.values;return xr(r,{expected:Ji.joinValues(a),received:r.parsedType,code:Kt.invalid_type}),Ln}if(cC(this,$b,"f")||o$(this,$b,new Set(this._def.values),"f"),!cC(this,$b,"f").has(t.data)){let r=this._getOrReturnCtx(t),a=this._def.values;return xr(r,{received:r.data,code:Kt.invalid_enum_value,options:a}),Ln}return Gc(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(a=>!t.includes(a)),{...this._def,...r})}};$b=new WeakMap;Rg.create=p$;Lg=class extends ii{constructor(){super(...arguments),Hb.set(this,void 0)}_parse(t){let r=Ji.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(t);if(a.parsedType!==Ir.string&&a.parsedType!==Ir.number){let o=Ji.objectValues(r);return xr(a,{expected:Ji.joinValues(o),received:a.parsedType,code:Kt.invalid_type}),Ln}if(cC(this,Hb,"f")||o$(this,Hb,new Set(Ji.getValidEnumValues(this._def.values)),"f"),!cC(this,Hb,"f").has(t.data)){let o=Ji.objectValues(r);return xr(a,{received:a.data,code:Kt.invalid_enum_value,options:o}),Ln}return Gc(t.data)}get enum(){return this._def.values}};Hb=new WeakMap;Lg.create=(e,t)=>new Lg({values:e,typeName:On.ZodNativeEnum,...ni(t)});s1=class extends ii{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Ir.promise&&r.common.async===!1)return xr(r,{code:Kt.invalid_type,expected:Ir.promise,received:r.parsedType}),Ln;let a=r.parsedType===Ir.promise?r.data:Promise.resolve(r.data);return Gc(a.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};s1.create=(e,t)=>new s1({type:e,typeName:On.ZodPromise,...ni(t)});Vp=class extends ii{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===On.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:a}=this._processInputParams(t),o=this._def.effect||null,n={addIssue:l=>{xr(a,l),l.fatal?r.abort():r.dirty()},get path(){return a.path}};if(n.addIssue=n.addIssue.bind(n),o.type==="preprocess"){let l=o.transform(a.data,n);if(a.common.async)return Promise.resolve(l).then(async f=>{if(r.value==="aborted")return Ln;let y=await this._def.schema._parseAsync({data:f,path:a.path,parent:a});return y.status==="aborted"?Ln:y.status==="dirty"||r.value==="dirty"?O2(y.value):y});{if(r.value==="aborted")return Ln;let f=this._def.schema._parseSync({data:l,path:a.path,parent:a});return f.status==="aborted"?Ln:f.status==="dirty"||r.value==="dirty"?O2(f.value):f}}if(o.type==="refinement"){let l=f=>{let y=o.refinement(f,n);if(a.common.async)return Promise.resolve(y);if(y instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return f};if(a.common.async===!1){let f=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return f.status==="aborted"?Ln:(f.status==="dirty"&&r.dirty(),l(f.value),{status:r.value,value:f.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(f=>f.status==="aborted"?Ln:(f.status==="dirty"&&r.dirty(),l(f.value).then(()=>({status:r.value,value:f.value}))))}if(o.type==="transform")if(a.common.async===!1){let l=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!Tg(l))return l;let f=o.transform(l.value,n);if(f instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:f}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(l=>Tg(l)?Promise.resolve(o.transform(l.value,n)).then(f=>({status:r.value,value:f})):l);Ji.assertNever(o)}};Vp.create=(e,t,r)=>new Vp({schema:e,typeName:On.ZodEffects,effect:t,...ni(r)});Vp.createWithPreprocess=(e,t,r)=>new Vp({schema:t,effect:{type:"preprocess",transform:e},typeName:On.ZodEffects,...ni(r)});Lf=class extends ii{_parse(t){return this._getType(t)===Ir.undefined?Gc(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Lf.create=(e,t)=>new Lf({innerType:e,typeName:On.ZodOptional,...ni(t)});Hh=class extends ii{_parse(t){return this._getType(t)===Ir.null?Gc(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Hh.create=(e,t)=>new Hh({innerType:e,typeName:On.ZodNullable,...ni(t)});Mg=class extends ii{_parse(t){let{ctx:r}=this._processInputParams(t),a=r.data;return r.parsedType===Ir.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Mg.create=(e,t)=>new Mg({innerType:e,typeName:On.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ni(t)});Bg=class extends ii{_parse(t){let{ctx:r}=this._processInputParams(t),a={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return Yb(o)?o.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Up(a.common.issues)},input:a.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Up(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}};Bg.create=(e,t)=>new Bg({innerType:e,typeName:On.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ni(t)});B2=class extends ii{_parse(t){if(this._getType(t)!==Ir.nan){let a=this._getOrReturnCtx(t);return xr(a,{code:Kt.invalid_type,expected:Ir.nan,received:a.parsedType}),Ln}return{status:"valid",value:t.data}}};B2.create=e=>new B2({typeName:On.ZodNaN,...ni(e)});GAe=Symbol("zod_brand"),Kb=class extends ii{_parse(t){let{ctx:r}=this._processInputParams(t),a=r.data;return this._def.type._parse({data:a,path:r.path,parent:r})}unwrap(){return this._def.type}},Gb=class e extends ii{_parse(t){let{status:r,ctx:a}=this._processInputParams(t);if(a.common.async)return(async()=>{let n=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return n.status==="aborted"?Ln:n.status==="dirty"?(r.dirty(),O2(n.value)):this._def.out._parseAsync({data:n.value,path:a.path,parent:a})})();{let o=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return o.status==="aborted"?Ln:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:a.path,parent:a})}}static create(t,r){return new e({in:t,out:r,typeName:On.ZodPipeline})}},jg=class extends ii{_parse(t){let r=this._def.innerType._parse(t),a=o=>(Tg(o)&&(o.value=Object.freeze(o.value)),o);return Yb(r)?r.then(o=>a(o)):a(r)}unwrap(){return this._def.innerType}};jg.create=(e,t)=>new jg({innerType:e,typeName:On.ZodReadonly,...ni(t)});JAe={object:Wl.lazycreate};(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(On||(On={}));XAe=(e,t={message:`Input not instance of ${e.name}`})=>f$(r=>r instanceof e,t),d$=n1.create,h$=wg.create,ZAe=B2.create,QAe=Cg.create,m$=Dg.create,eke=Pg.create,tke=F2.create,rke=Ag.create,nke=kg.create,ike=i1.create,ske=Rm.create,ake=jd.create,oke=R2.create,uke=Lm.create,cke=Wl.create,lke=Wl.strictCreate,pke=Ig.create,fke=lC.create,dke=Og.create,hke=$h.create,mke=pC.create,yke=L2.create,gke=M2.create,vke=fC.create,xke=Ng.create,Ske=Fg.create,bke=Rg.create,Eke=Lg.create,_ke=s1.create,s$=Vp.create,Tke=Lf.create,wke=Hh.create,Cke=Vp.createWithPreprocess,Dke=Gb.create,Pke=()=>d$().optional(),Ake=()=>h$().optional(),kke=()=>m$().optional(),Ike={string:e=>n1.create({...e,coerce:!0}),number:e=>wg.create({...e,coerce:!0}),boolean:e=>Dg.create({...e,coerce:!0}),bigint:e=>Cg.create({...e,coerce:!0}),date:e=>Pg.create({...e,coerce:!0})},Oke=Ln,Bt=Object.freeze({__proto__:null,defaultErrorMap:N2,setErrorMap:CAe,getErrorMap:oC,makeIssue:uC,EMPTY_PATH:DAe,addIssueToContext:xr,ParseStatus:wc,INVALID:Ln,DIRTY:O2,OK:Gc,isAborted:A3,isDirty:k3,isValid:Tg,isAsync:Yb,get util(){return Ji},get objectUtil(){return P3},ZodParsedType:Ir,getParsedType:Fm,ZodType:ii,datetimeRegex:l$,ZodString:n1,ZodNumber:wg,ZodBigInt:Cg,ZodBoolean:Dg,ZodDate:Pg,ZodSymbol:F2,ZodUndefined:Ag,ZodNull:kg,ZodAny:i1,ZodUnknown:Rm,ZodNever:jd,ZodVoid:R2,ZodArray:Lm,ZodObject:Wl,ZodUnion:Ig,ZodDiscriminatedUnion:lC,ZodIntersection:Og,ZodTuple:$h,ZodRecord:pC,ZodMap:L2,ZodSet:M2,ZodFunction:fC,ZodLazy:Ng,ZodLiteral:Fg,ZodEnum:Rg,ZodNativeEnum:Lg,ZodPromise:s1,ZodEffects:Vp,ZodTransformer:Vp,ZodOptional:Lf,ZodNullable:Hh,ZodDefault:Mg,ZodCatch:Bg,ZodNaN:B2,BRAND:GAe,ZodBranded:Kb,ZodPipeline:Gb,ZodReadonly:jg,custom:f$,Schema:ii,ZodSchema:ii,late:JAe,get ZodFirstPartyTypeKind(){return On},coerce:Ike,any:ike,array:uke,bigint:QAe,boolean:m$,date:eke,discriminatedUnion:fke,effect:s$,enum:bke,function:vke,instanceof:XAe,intersection:dke,lazy:xke,literal:Ske,map:yke,nan:ZAe,nativeEnum:Eke,never:ake,null:nke,nullable:wke,number:h$,object:cke,oboolean:kke,onumber:Ake,optional:Tke,ostring:Pke,pipeline:Dke,preprocess:Cke,promise:_ke,record:mke,set:gke,strictObject:lke,string:d$,symbol:tke,transformer:s$,tuple:hke,undefined:rke,union:pke,unknown:ske,void:oke,NEVER:Oke,ZodIssueCode:Kt,quotelessJson:wAe,ZodError:Up})});function Mke(e){let t=e.split(",").map(r=>r.trim()).filter(Boolean);for(let r of t){let a=r.indexOf("="),o=a===-1?r.trim().toLowerCase():r.slice(0,a).trim().toLowerCase();if(o==="stale-while-revalidate"||o==="stale-if-error"){let n=`${o}=86400`;if(a===-1)return`value match error: Cache-Control directive "${o}" must be in k=v form (e.g. ${n})`;if(!r.slice(a+1).trim())return`value match error: Cache-Control directive "${r}" must have a value (e.g. ${n})`}}}function $ke(e){return e.errors.map(t=>`${t.message}`).join(`
|
|
137
137
|
`)}function Bf(){return!0}function F3(e,t=["root"]){if(e[N3])return e;let r=e;if((e instanceof Bt.ZodOptional||e instanceof Bt.ZodNullable||e instanceof Bt.ZodReadonly||e instanceof Bt.ZodPromise||e instanceof Bt.ZodBranded)&&(r=e.unwrap()),r[N3])return r;let a=null;try{if(r instanceof Bt.ZodArray){let o=F3(r.element,[...t,"[]"]);return a=Bt.array(Bt.any()).optional().transform(n=>{if(t.length===4&&t.includes("headers")&&(n?n!=null&&n.length||console.warn('"error in root.headers.[].headers": length is invalid, min 1 length error'):console.warn('"error in root.headers.[].headers": undefined is invalid, Required')),!n)return;if(!n.length)return[];let l=[];for(let y=0;y<n.length;y++){let m=n[y];if(m===dC)continue;let b=o.safeParse(m,{path:[...t,`[${y}]`]});if(!b.success){Bf();continue}!b.data||b.data===dC||l.push(b.data)}let f=30;return t.length===4&&t[3]==="headers"&&l.length>3?(console.warn(`"error in root.headers.[].headers": length is invalid, max ${f} length error`),l.slice(0,f)):l}),a}return r instanceof Bt.ZodObject?(a=Bt.object(Object.fromEntries(Object.entries(r.shape).map(([o,n])=>[o,F3(n,[...t,o])]))).transform(o=>{let n=e.safeParse(o,{path:t});return n.success?n.data:(Bf(),dC)}),a):(a=Bt.any().transform(o=>{if(o===dC)return;let n=e.safeParse(o,{path:t});if(!n.success){Bf()&&console.warn(`"error in ${t.join(".")}": ${JSON.stringify(o)} is invalid, ${$ke(n.error)}`);return}return n.data}),a)}catch(o){Bf()&&console.error("%c [ e ]-220","font-size:13px; background:pink; color:#bf2c9f;",o)}finally{a&&(a[N3]=!0)}}var K_t,Nke,G_t,Fke,Rke,J_t,Lke,X_t,R3,hC,Bke,jke,qke,Uke,Vke,Wke,zke,y$,g$,N3,dC,v$,Hke,x$,mC=Pt(()=>{O3();K_t=Bt.object({monitor:Bt.array(Bt.string()).optional(),command:Bt.string().optional(),cwd:Bt.string().optional(),target_file:Bt.string()}),Nke=Bt.object({assets_dir:Bt.string().optional(),proxy_path:Bt.string().optional()}),G_t=Bt.object({port:Bt.union([Bt.number(),Bt.string()]).optional(),origin:Bt.string().optional(),timeout:Bt.union([Bt.number(),Bt.string()]).optional(),sandbox:Bt.boolean().optional(),favicon:Bt.boolean().optional(),minify:Bt.boolean().optional(),site:Nke.optional()}),Fke=Bt.object({target:Bt.string(),operator:Bt.union([Bt.literal("equal"),Bt.literal("notequal")]),values:Bt.array(Bt.string())}),Rke=Bt.object({condition:Bt.array(Fke)}),J_t=Bt.object({minify:Bt.boolean().optional(),rule:Bt.array(Rke).optional()}),Lke=Bt.object({maxDuration:Bt.number().optional()}),X_t=Bt.object({type:Bt.enum(["header","cookie","host","query"]),key:Bt.string(),value:Bt.string().optional()}),R3=(e,t)=>{var o;let r=e.replace(/\\([?*])/g,"$1");return r.length===0?t.addIssue({code:Bt.ZodIssueCode.custom,message:"length match error"}):/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]/.test(r)?t.addIssue({code:Bt.ZodIssueCode.custom,message:"char match error"}):((o=r.match(/\*/g))==null?void 0:o.length)>1?t.addIssue({code:Bt.ZodIssueCode.custom,message:"* match error"}):/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]:/.test(r)||/:(?![a-zA-Z0-9]+)/.test(r)?t.addIssue({code:Bt.ZodIssueCode.custom,message:": match error"}):!0},hC=Bt.object({source:Bt.string().superRefine(R3)});Bke=Bt.object({key:Bt.string().min(1).max(100).superRefine((e,t)=>/[^a-zA-Z0-9-]/.test(e)?t.addIssue({code:Bt.ZodIssueCode.custom,message:"char match error"}):!0),value:Bt.string().min(1).max(1e3).superRefine((e,t)=>/[\u4e00-\u9fa5]/.test(e)?t.addIssue({code:Bt.ZodIssueCode.custom,message:"char match error"}):!0)}).superRefine((e,t)=>{if(e.key.toLowerCase()==="cache-control"){let r=Mke(e.value);r&&t.addIssue({code:Bt.ZodIssueCode.custom,path:["value"],message:r})}}),jke=Bke.array().min(1),qke=hC.merge(Bt.object({headers:jke})).array(),Uke=Bt.union([Bt.literal(307),Bt.literal(301),Bt.literal(302),Bt.literal(308),Bt.literal(303),Bt.literal(304)]),Vke=hC.merge(Bt.object({destination:Bt.string().superRefine(R3),permanent:Bt.boolean().optional(),statusCode:Uke.optional()})).array(),Wke=hC.merge(Bt.object({destination:Bt.string().superRefine(R3)})).array(),zke=hC.merge(Bt.object({cacheTtl:Bt.number()})).array(),y$=Bt.object({included_files:Bt.array(Bt.string()).optional().describe("Glob patterns for files to include in the function bundle"),included_files_base_path:Bt.string().optional().describe("Base path for included_files patterns, defaults to project root"),external_node_modules:Bt.array(Bt.string()).optional().describe("Node modules to be treated as external dependencies")}),g$=Bt.object({$schema:Bt.string().transform(e=>"").optional(),outputDirectory:Bt.string().optional().describe("the output directory relative to project root directory after run build command."),installCommand:Bt.string().optional().describe("the install command to run."),buildCommand:Bt.string().optional().describe("the build command to run."),nodeVersion:Bt.string().optional().describe("the node version to use."),nodeFunctionsConfig:Lke.optional(),headers:qke.optional(),redirects:Vke.optional(),rewrites:Wke.optional(),caches:zke.optional(),"node-functions":y$.optional().describe("Node function specific configuration"),"edge-functions":y$.optional().describe("Edge function specific configuration")}),N3=Symbol("filteredSchema"),dC=Symbol("symFilteredValue"),v$=F3(g$);Hke=Bt.object({TENCENT_SECRET_KEY:Bt.string(),TENCENT_SECRET_ID:Bt.string(),DEV_SERVER_ENDPOINT:Bt.string().optional(),DEV_SERVER_PORT:Bt.union([Bt.number(),Bt.string()]).optional()}),x$={tefConfigSchema:g$,envConfigSchema:Hke}});function Yke(e){return e.length===1?e[0].toString():e.reduce((t,r)=>{if(typeof r=="number")return`${t}[${r.toString()}]`;if(r.includes('"'))return`${t}["${r.replace(/"/g,'\\"')}"]`;if(!/[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u.test(r))return`${t}["${r}"]`;let a=t.length===0?"":".";return t+a+r},"")}function S$(e,t,r){var a;if(e.code==="invalid_union")return e.unionErrors.reduce((o,n)=>{let l=n.issues.map(f=>S$(f,t,r)).join(t);return o.includes(l)||o.push(l),o},[]).join(r);if(((a=e.path)==null?void 0:a.length)!==0){if(e.path.length===1){let o=e.path[0];if(typeof o=="number")return`${e.message} at index ${o}`}return`${e.message} at "${Yke(e.path)}"`}return e.message}function Kke(e,t,r){return e.length>0?[t,e].join(r):t}function Gke(e,t){let{issueSeparator:r=`
|
|
138
138
|
`,unionSeparator:a=", or ",prefixSeparator:o=`
|
|
139
|
-
`,prefix:n}=t,l=e.errors.map(f=>S$(f,r,a)).join(r);return Kke(l,n,o)}var yC,gC,vC,L3=Pt(()=>{yC=class extends Error{handled;constructor(t){super(t),this.handled=!0,this.name=this.constructor.name}},gC=class extends yC{constructor(t){super(`[ConfigLoadError] ${t}`)}};vC=class extends yC{details;constructor(t,r){let a=Gke(r,{prefix:`${t}:`});super(`[ValidationError] ${a}`),this.details=r.errors}}});var M3,eTt,b$=Pt(()=>{M3=class{log(t,r){try{let a=this.format(r),o=JSON.stringify({key:t,value:a});process.send(o)}catch{}}format(t){return typeof t=="object"?JSON.stringify(t):typeof t=="number"?String(t):t}},eTt=new M3});function j2(e){return Object.prototype.toString.call(e)==="[object Object]"}function Jb(e){return Object.prototype.toString.call(e)==="[object Array]"}function a1(e){return Object.prototype.toString.call(e)==="[object String]"}function E$(e){return Object.prototype.toString.call(e)==="[object Number]"}function xC(e){var a;let t=e.replace(/\\([?*])/g,"$1");if(e.length===0)return wn.min_string;if(t.length>500)return wn.max_string;if(/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]/.test(t)||((a=t.match(/\*/g))==null?void 0:a.length)>1||/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]:/.test(t)||/:(?![a-zA-Z0-9]+)/.test(t))return wn.char_match;if(t.length){let o=t.split("/");if(o.some(f=>f.includes(":")&&(f.includes("*")||f.includes(".")))||o.some(f=>f.split(":").length>2))return wn.char_match}}function _$(e){var r;if(e=e.replace(/^https?:\/\//,""),e.length===0)return wn.min_string;if(e.length>500)return wn.max_string;if(/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]/.test(e)||((r=e.match(/\*/g))==null?void 0:r.length)>=1||/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]:/.test(e)||/:(?![a-zA-Z0-9]+)/.test(e))return wn.char_match}function Jke(e){if(e.length===0)return wn.min_string;if(e.length>100)return wn.max_string;if(/[^a-zA-Z0-9-]/.test(e))return wn.char_match}function Xke(e){if(e.length===0)return wn.min_string;if(e.length>1e3)return wn.max_string;if(/[\u4e00-\u9fa5]/.test(e))return wn.char_match}function Zke(e){let t=e.split(",").map(r=>r.trim()).filter(Boolean);for(let r of t){let a=r.indexOf("="),o=a===-1?r.trim().toLowerCase():r.slice(0,a).trim().toLowerCase();if(o==="stale-while-revalidate"||o==="stale-if-error"){let n=`${o}=86400`;if(a===-1)return`${wn.value_match}: Cache-Control directive "${o}" must be in k=v form (e.g. ${n})`;if(!r.slice(a+1).trim())return`${wn.value_match}: Cache-Control directive "${r}" must have a value (e.g. ${n})`}}}function Qke(e){if(![301,302,303,304,307,308].includes(e))return wn.value_match}function e4e(e){if(typeof e!="number"||!Number.isInteger(e)||e<0)return wn.value_match}function t4e(e,t){let r=[],a=[];if(!Jb(e))return a.push({path:[...t],message:wn.invalid_type}),[r,a];for(let o in e){let n=e[o];if(!j2(n)){a.push({path:[...t,`[${o}]`],message:wn.invalid_type});continue}let{key:l,value:f}=n;if(!a1(l)){a.push({path:[...t,`[${o}]`,"key"],message:wn.invalid_type});continue}let y=Jke(l);if(y){a.push({path:[...t,`[${o}]`,"key"],message:y});continue}if(!a1(f)){a.push({path:[...t,`[${o}]`,"value"],message:wn.invalid_type});continue}let m=Xke(f);if(m){a.push({path:[...t,`[${o}]`,"value"],message:m});continue}if(l.toLowerCase()==="cache-control"){let b=Zke(f);if(b){a.push({path:[...t,`[${o}]`,"value"],message:b});continue}}r.push({key:l,value:f})}return[r,a]}function r4e(e,t){let r=[],a=[];if(!Jb(e))return a.push({path:[...t],message:wn.invalid_type}),[r,a];for(let o in e){let n=e[o];if(!j2(n)){a.push({path:[...t,`[${o}]`],message:wn.invalid_type});continue}let{source:l,headers:f}=n;if(!a1(l)){a.push({path:[...t,`[${o}]`,"source"],message:wn.invalid_type});continue}let y=xC(l);if(y){a.push({path:[...t,`[${o}]`,"source"],message:y});continue}let[m,b]=t4e(f,[...t,`[${o}]`,"headers"]);m.length>
|
|
139
|
+
`,prefix:n}=t,l=e.errors.map(f=>S$(f,r,a)).join(r);return Kke(l,n,o)}var yC,gC,vC,L3=Pt(()=>{yC=class extends Error{handled;constructor(t){super(t),this.handled=!0,this.name=this.constructor.name}},gC=class extends yC{constructor(t){super(`[ConfigLoadError] ${t}`)}};vC=class extends yC{details;constructor(t,r){let a=Gke(r,{prefix:`${t}:`});super(`[ValidationError] ${a}`),this.details=r.errors}}});var M3,eTt,b$=Pt(()=>{M3=class{log(t,r){try{let a=this.format(r),o=JSON.stringify({key:t,value:a});process.send(o)}catch{}}format(t){return typeof t=="object"?JSON.stringify(t):typeof t=="number"?String(t):t}},eTt=new M3});function j2(e){return Object.prototype.toString.call(e)==="[object Object]"}function Jb(e){return Object.prototype.toString.call(e)==="[object Array]"}function a1(e){return Object.prototype.toString.call(e)==="[object String]"}function E$(e){return Object.prototype.toString.call(e)==="[object Number]"}function xC(e){var a;let t=e.replace(/\\([?*])/g,"$1");if(e.length===0)return wn.min_string;if(t.length>500)return wn.max_string;if(/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]/.test(t)||((a=t.match(/\*/g))==null?void 0:a.length)>1||/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]:/.test(t)||/:(?![a-zA-Z0-9]+)/.test(t))return wn.char_match;if(t.length){let o=t.split("/");if(o.some(f=>f.includes(":")&&(f.includes("*")||f.includes(".")))||o.some(f=>f.split(":").length>2))return wn.char_match}}function _$(e){var r;if(e=e.replace(/^https?:\/\//,""),e.length===0)return wn.min_string;if(e.length>500)return wn.max_string;if(/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]/.test(e)||((r=e.match(/\*/g))==null?void 0:r.length)>=1||/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]:/.test(e)||/:(?![a-zA-Z0-9]+)/.test(e))return wn.char_match}function Jke(e){if(e.length===0)return wn.min_string;if(e.length>100)return wn.max_string;if(/[^a-zA-Z0-9-]/.test(e))return wn.char_match}function Xke(e){if(e.length===0)return wn.min_string;if(e.length>1e3)return wn.max_string;if(/[\u4e00-\u9fa5]/.test(e))return wn.char_match}function Zke(e){let t=e.split(",").map(r=>r.trim()).filter(Boolean);for(let r of t){let a=r.indexOf("="),o=a===-1?r.trim().toLowerCase():r.slice(0,a).trim().toLowerCase();if(o==="stale-while-revalidate"||o==="stale-if-error"){let n=`${o}=86400`;if(a===-1)return`${wn.value_match}: Cache-Control directive "${o}" must be in k=v form (e.g. ${n})`;if(!r.slice(a+1).trim())return`${wn.value_match}: Cache-Control directive "${r}" must have a value (e.g. ${n})`}}}function Qke(e){if(![301,302,303,304,307,308].includes(e))return wn.value_match}function e4e(e){if(typeof e!="number"||!Number.isInteger(e)||e<0)return wn.value_match}function t4e(e,t){let r=[],a=[];if(!Jb(e))return a.push({path:[...t],message:wn.invalid_type}),[r,a];for(let o in e){let n=e[o];if(!j2(n)){a.push({path:[...t,`[${o}]`],message:wn.invalid_type});continue}let{key:l,value:f}=n;if(!a1(l)){a.push({path:[...t,`[${o}]`,"key"],message:wn.invalid_type});continue}let y=Jke(l);if(y){a.push({path:[...t,`[${o}]`,"key"],message:y});continue}if(!a1(f)){a.push({path:[...t,`[${o}]`,"value"],message:wn.invalid_type});continue}let m=Xke(f);if(m){a.push({path:[...t,`[${o}]`,"value"],message:m});continue}if(l.toLowerCase()==="cache-control"){let b=Zke(f);if(b){a.push({path:[...t,`[${o}]`,"value"],message:b});continue}}r.push({key:l,value:f})}return[r,a]}function r4e(e,t){let r=[],a=[];if(!Jb(e))return a.push({path:[...t],message:wn.invalid_type}),[r,a];for(let o in e){let n=e[o];if(!j2(n)){a.push({path:[...t,`[${o}]`],message:wn.invalid_type});continue}let{source:l,headers:f}=n;if(!a1(l)){a.push({path:[...t,`[${o}]`,"source"],message:wn.invalid_type});continue}let y=xC(l);if(y){a.push({path:[...t,`[${o}]`,"source"],message:y});continue}let[m,b]=t4e(f,[...t,`[${o}]`,"headers"]);m.length>100&&(b.push({path:[...t,`[${o}]`,"headers"],message:wn.max_length}),m=m.slice(0,100)),(f==null?void 0:f.length)<1&&m.length<1&&b.push({path:[...t,`[${o}]`,"headers"],message:wn.min_length}),m.length&&r.push({source:l,headers:m}),a.push(...b)}return r.length>100&&(a.push({path:[...t],message:wn.max_length}),r=r.slice(0,100)),[r,a]}function n4e(e,t){let r=[],a=[];if(!Jb(e))return a.push({path:[...t],message:wn.invalid_type}),[r,a];for(let o in e){let n=e[o];if(!j2(n)){a.push({path:[...t,`[${o}]`],message:wn.invalid_type});continue}let{source:l,destination:f,statusCode:y}=n;if(!a1(l)){a.push({path:[...t,`[${o}]`,"source"],message:wn.invalid_type});continue}let m=xC(l);if(m){a.push({path:[...t,`[${o}]`,"source"],message:m});continue}if(!a1(f)){a.push({path:[...t,`[${o}]`,"destination"],message:wn.invalid_type});continue}let b=_$(f);if(b){a.push({path:[...t,`[${o}]`,"destination"],message:b});continue}if(!E$(y)){a.push({path:[...t,`[${o}]`,"statusCode"],message:wn.invalid_type});continue}let w=Qke(y);if(w){a.push({path:[...t,`[${o}]`,"statusCode"],message:w});continue}r.push({source:l,destination:f,statusCode:y})}return r.length>100&&(a.push({path:[...t],message:wn.max_length}),r=r.slice(0,100)),[r,a]}function i4e(e,t){let r=[],a=[];if(!Jb(e))return a.push({path:[...t],message:wn.invalid_type}),[r,a];for(let o in e){let n=e[o];if(!j2(n)){a.push({path:[...t,`[${o}]`],message:wn.invalid_type});continue}let{source:l,destination:f}=n;if(!a1(l)){a.push({path:[...t,`[${o}]`,"source"],message:wn.invalid_type});continue}let y=xC(l);if(y){a.push({path:[...t,`[${o}]`,"source"],message:y});continue}if(!a1(f)){a.push({path:[...t,`[${o}]`,"destination"],message:wn.invalid_type});continue}let m=_$(f);if(m){a.push({path:[...t,`[${o}]`,"destination"],message:m});continue}r.push({source:l,destination:f})}return r.length>100&&(a.push({path:[...t],message:wn.max_length}),r=r.slice(0,100)),[r,a]}function s4e(e,t){let r=[],a=[];if(!Jb(e))return a.push({path:[...t],message:wn.invalid_type}),[r,a];for(let o in e){let n=e[o];if(!j2(n)){a.push({path:[...t,`[${o}]`],message:wn.invalid_type});continue}let{source:l,cacheTtl:f}=n;if(!a1(l)){a.push({path:[...t,`[${o}]`,"source"],message:wn.invalid_type});continue}let y=xC(l);if(y){a.push({path:[...t,`[${o}]`,"source"],message:y});continue}if(!E$(f)){a.push({path:[...t,`[${o}]`,"cacheTtl"],message:wn.invalid_type});continue}let m=e4e(f);if(m){a.push({path:[...t,`[${o}]`,"cacheTtl"],message:m});continue}r.push({source:l,cacheTtl:f})}return r.length>100&&(a.push({path:[...t],message:wn.max_length}),r=r.slice(0,100)),[r,a]}function T$(e,t){let r={headers:[],redirects:[],rewrites:[],caches:[]},a=[];if(!j2(e))return a.push({path:[...t],message:wn.invalid_type}),[r,a];let{headers:o=[],redirects:n=[],rewrites:l=[],caches:f=[]}=e,[y,m]=r4e(o,[...t,"headers"]),[b,w]=n4e(n,[...t,"redirects"]),[A,R]=i4e(l,[...t,"rewrites"]),[g,z]=s4e(f,[...t,"caches"]);r.headers=y,r.redirects=b,r.rewrites=A,r.caches=g,r["node-functions"]=e["node-functions"],r["edge-functions"]=e["edge-functions"];let q=["outputDirectory","installCommand","buildCommand","nodeVersion","nodeFunctionsConfig"];for(let V in e)q.includes(V)&&e[V]&&(r[V]=e[V]);return a.push(...m,...w,...R,...z),[r,a]}var wn,w$=Pt(()=>{wn={invalid_type:"invalid type error",max_length:"max length error",min_length:"min length error",min_string:"string min error",max_string:"string max error",char_match:"char match error",value_match:"value match error"}});var a4e,C$,o4e,u4e,c4e,l4e,p4e,f4e,d4e,D$,P$=Pt(()=>{O3();a4e=/^(?=.{2,30}$)[a-z0-9]+(-[a-z0-9]+)*-?[a-z0-9]+$/,C$=Bt.string().refine(e=>a4e.test(e)),o4e=Bt.enum(["vps-react-ts","vps-react","vps-vue-ts","vps-vue","manaia-demo","manaia-demo-ts"]),u4e=Bt.object({name:C$}),c4e=Bt.object({name:C$,template:o4e}),l4e=Bt.object({script:Bt.string().optional()}),p4e=Bt.object({script:Bt.string().optional()}),f4e=Bt.object({}),d4e=Bt.object({}),D$={initArgsSchema:u4e,generateArgsSchema:c4e,devArgsSchema:l4e,publishArgsSchema:p4e,deleteArgsSchema:f4e,testArgsSchema:d4e}});function h4e(e,t){return r=>{try{e.parse(r)}catch(a){throw new vC(`Failed to validate ${t}`,a)}}}function m4e(){let e={};return Object.entries({...D$,...x$}).forEach(([t,r])=>{let a=t.replace("Schema","");e[a]=h4e(r,a)}),e}var uTt,A$=Pt(()=>{P$();mC();L3();uTt=m4e()});function y4e(e="",t={confPath:""}){try{e=e||process.cwd();let[r,a]=g4e(e);if(t.exists=a,!a)return t.showError||Bf(),{headers:[],redirects:[],rewrites:[]};t.confPath=r;let o=_3(r);return O$.default.parse(o)}catch{t.showError||Bf()}}async function N$(e=!1){var n,l,f,y,m,b,w,A,R;!e&&console.log(`
|
|
140
140
|
> Start validating the configuration file:`);let t={confPath:"",exists:!1},r=await y4e("",t);try{let[g,z]=T$(r,["root"]);return z!=null&&z.length&&!e?z.map(q=>{console.log(`error in ${q.path.join(".")}: ${q.message}`)}):!e&&console.log("none error in configuration file"),!e&&console.log(`End validating!
|
|
141
141
|
`),g}catch{!e&&console.log(`Failure validating!
|
|
142
142
|
`)}return{headers:[],redirects:[],rewrites:[],caches:[]}}function g4e(e){let t="",r=t$(e),a=!1;if(r.isDirectory()){let o=[];for(let n of[`${k$}.json`,`${k$}.json5`]){let l=SC.default.normalize(SC.default.resolve(e,n));if(o.push(l),a=E3(l),a){t=l;break}}a||(t=o[0])}else r.isFile()&&(t=SC.default.normalize(e),a=!0);return[t,a]}function bC(e){try{if(!e.endsWith(".env")&&!e.endsWith(".local"))throw new Error(`Invalid .env path: ${e}`);let t=r$(e);for(let[r,a]of Object.entries(t))r in process.env||(process.env[r]=a);return t}catch(t){throw new gC(`Failed to load .env:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "edgeone",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.21",
|
|
4
4
|
"description": "Command-line interface for TencentCloud Pages Functions",
|
|
5
5
|
"bin": {
|
|
6
6
|
"edgeone": "./edgeone-bin/edgeone.js"
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@edgeone/framework-detect": "^0.0.2",
|
|
36
36
|
"@edgeone/nuxt-pages": "^1.0.13",
|
|
37
|
-
"@edgeone/opennextjs-pages": "0.0.
|
|
37
|
+
"@edgeone/opennextjs-pages": "0.0.5",
|
|
38
38
|
"archiver": "^7.0.1",
|
|
39
39
|
"chokidar": "^4.0.1",
|
|
40
40
|
"common-path-prefix": "^1.0.0",
|