ai-speedometer 1.2.4 → 1.2.5
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/dist/ai-speedometer +20 -20
- package/package.json +1 -1
package/dist/ai-speedometer
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var ib=Object.create;var Ja=Object.defineProperty;var ab=Object.getOwnPropertyDescriptor;var sb=Object.getOwnPropertyNames;var ub=Object.getPrototypeOf,lb=Object.prototype.hasOwnProperty;var cp=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var cb=(e,t)=>()=>(e&&(t=e(e=0)),t);var ue=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Bt=(e,t)=>{for(var n in t)Ja(e,n,{get:t[n],enumerable:!0})},db=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of sb(t))!lb.call(e,r)&&r!==n&&Ja(e,r,{get:()=>t[r],enumerable:!(o=ab(t,r))||o.enumerable});return e};var pb=(e,t,n)=>(n=e!=null?ib(ub(e)):{},db(t||!e||!e.__esModule?Ja(n,"default",{value:e,enumerable:!0}):n,e));var un={};Bt(un,{addCustomProvider:()=>jd,addModelToCustomProvider:()=>Ea,addToRecentModels:()=>Ta,addVerifiedProvider:()=>wE,cleanupRecentModelsFromConfig:()=>Ca,clearRecentModels:()=>IE,getAIConfigDebugPaths:()=>EE,getCustomProvidersFromConfig:()=>Nd,getRecentModels:()=>zd,getVerifiedProvidersFromConfig:()=>kE,readAIConfig:()=>Zt,removeCustomProvider:()=>$E,removeVerifiedProvider:()=>SE,writeAIConfig:()=>hr});import Le from"fs";import Ia from"path";import{homedir as DE}from"os";var ir,Od,Zt,hr,wE,jd,Ea,Nd,kE,$E,SE,Ta,zd,IE,Ca,EE,vr=cb(()=>{ir=()=>{let e=process.env.XDG_CONFIG_HOME||Ia.join(DE(),".config"),t=Ia.join(e,"ai-speedometer");return{configDir:t,configJson:Ia.join(t,"ai-benchmark-config.json"),recentModelsCache:Ia.join(t,"recent-models.json")}},Od=()=>{let{configDir:e}=ir();Le.existsSync(e)||Le.mkdirSync(e,{recursive:!0})},Zt=async()=>{let{configJson:e}=ir();try{if(!Le.existsSync(e))return{verifiedProviders:{},customProviders:[]};let t=Le.readFileSync(e,"utf8");return JSON.parse(t)}catch(t){return console.warn("Warning: Could not read ai-benchmark-config.json:",t.message),{verifiedProviders:{},customProviders:[]}}},hr=async e=>{let{configJson:t}=ir();try{Od();let n=JSON.stringify(e,null,2);return Le.writeFileSync(t,n),!0}catch(n){return console.error("Error writing ai-benchmark-config.json:",n.message),!1}},wE=async(e,t)=>{let n=await Zt();return n.verifiedProviders=n.verifiedProviders||{},n.verifiedProviders[e]=t,await hr(n)},jd=async e=>{let t=await Zt();t.customProviders=t.customProviders||[];let n=t.customProviders.findIndex(o=>o.id===e.id);return n>=0?t.customProviders[n]=e:t.customProviders.push(e),await hr(t)},Ea=async(e,t)=>{let n=await Zt();if(!n.customProviders)return console.error("No custom providers found"),!1;let o=n.customProviders.find(i=>i.id===e);if(!o)return console.error(`Custom provider ${e} not found`),!1;o.models=o.models||[];let r=o.models.findIndex(i=>i.id===t.id);return r>=0?o.models[r]=t:o.models.push(t),await hr(n)},Nd=async()=>(await Zt()).customProviders||[],kE=async()=>(await Zt()).verifiedProviders||{},$E=async e=>{let t=await Zt();return t.customProviders?(t.customProviders=t.customProviders.filter(n=>n.id!==e),await hr(t)):!0},SE=async e=>{let t=await Zt();return t.verifiedProviders&&t.verifiedProviders[e]?(delete t.verifiedProviders[e],await hr(t)):!0},Ta=async e=>{let{recentModelsCache:t}=ir();Od();let n=[];try{if(Le.existsSync(t)){let o=Le.readFileSync(t,"utf8");n=JSON.parse(o)}}catch{n=[]}return e.forEach(o=>{n=n.filter(r=>r.modelId!==o.modelId),n.unshift({modelId:o.modelId,modelName:o.modelName,providerName:o.providerName,timestamp:Date.now()})}),n=n.slice(0,5),Le.writeFileSync(t,JSON.stringify(n,null,2)),n},zd=async()=>{let{recentModelsCache:e}=ir();try{if(Le.existsSync(e)){let t=Le.readFileSync(e,"utf8");return JSON.parse(t)}}catch{}return[]},IE=async()=>{let{recentModelsCache:e}=ir();try{Le.existsSync(e)&&Le.unlinkSync(e)}catch{}return[]},Ca=async()=>{let e=await Zt();if(e.recentModels&&e.recentModels.length>0){let{recentModelsCache:t}=ir();Od();try{Le.writeFileSync(t,JSON.stringify(e.recentModels,null,2))}catch(n){console.warn("Warning: Could not migrate recent models to cache:",n.message)}delete e.recentModels,await hr(e)}return e},EE=()=>{let e=ir(),t=Le.existsSync(e.configJson);return{...e,configExists:t}}});var Aa=ue((i2,qv)=>{var Zd=[],Vv=0,Ee=(e,t)=>{Vv>=t&&Zd.push(e)};Ee.WARN=1;Ee.INFO=2;Ee.DEBUG=3;Ee.reset=()=>{Zd=[]};Ee.setDebugLevel=e=>{Vv=e};Ee.warn=e=>Ee(e,Ee.WARN);Ee.info=e=>Ee(e,Ee.INFO);Ee.debug=e=>Ee(e,Ee.DEBUG);Ee.debugMessages=()=>Zd;qv.exports=Ee});var Gv=ue((a2,Jv)=>{"use strict";Jv.exports=({onlyFirst:e=!1}={})=>{let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}});var Kv=ue((s2,Wv)=>{"use strict";var jE=Gv();Wv.exports=e=>typeof e=="string"?e.replace(jE(),""):e});var Yv=ue((u2,Ld)=>{"use strict";var Hv=e=>Number.isNaN(e)?!1:e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141);Ld.exports=Hv;Ld.exports.default=Hv});var Qv=ue((l2,Xv)=>{"use strict";Xv.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var ty=ue((c2,Bd)=>{"use strict";var NE=Kv(),zE=Yv(),RE=Qv(),ey=e=>{if(typeof e!="string"||e.length===0||(e=NE(e),e.length===0))return 0;e=e.replace(RE()," ");let t=0;for(let n=0;n<e.length;n++){let o=e.codePointAt(n);o<=31||o>=127&&o<=159||o>=768&&o<=879||(o>65535&&n++,t+=zE(o)?2:1)}return t};Bd.exports=ey;Bd.exports.default=ey});var Vd=ue((d2,iy)=>{var ry=ty();function Pa(e){return e?/\u001b\[((?:\d*;){0,5}\d*)m/g:/\u001b\[(?:\d*;){0,5}\d*m/g}function _t(e){let t=Pa();return(""+e).replace(t,"").split(`
|
|
3
|
-
`).reduce(function(r,i){return ry(i)>r?ry(i):r},0)}function Mo(e,t){return Array(t+1).join(e)}function FE(e,t,n,o){let r=_t(e);if(t+1>=r){let i=t-r;switch(o){case"right":{e=Mo(n,i)+e;break}case"center":{let a=Math.ceil(i/2),u=i-a;e=Mo(n,u)+e+Mo(n,a);break}default:{e=e+Mo(n,i);break}}}return e}var cn={};function Uo(e,t,n){t="\x1B["+t+"m",n="\x1B["+n+"m",cn[t]={set:e,to:!0},cn[n]={set:e,to:!1},cn[e]={on:t,off:n}}Uo("bold",1,22);Uo("italics",3,23);Uo("underline",4,24);Uo("inverse",7,27);Uo("strikethrough",9,29);function ny(e,t){let n=t[1]?parseInt(t[1].split(";")[0]):0;if(n>=30&&n<=39||n>=90&&n<=97){e.lastForegroundAdded=t[0];return}if(n>=40&&n<=49||n>=100&&n<=107){e.lastBackgroundAdded=t[0];return}if(n===0){for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&delete e[r];return}let o=cn[t[0]];o&&(e[o.set]=o.to)}function ME(e){let t=Pa(!0),n=t.exec(e),o={};for(;n!==null;)ny(o,n),n=t.exec(e);return o}function oy(e,t){let n=e.lastBackgroundAdded,o=e.lastForegroundAdded;return delete e.lastBackgroundAdded,delete e.lastForegroundAdded,Object.keys(e).forEach(function(r){e[r]&&(t+=cn[r].off)}),n&&n!="\x1B[49m"&&(t+="\x1B[49m"),o&&o!="\x1B[39m"&&(t+="\x1B[39m"),t}function UE(e,t){let n=e.lastBackgroundAdded,o=e.lastForegroundAdded;return delete e.lastBackgroundAdded,delete e.lastForegroundAdded,Object.keys(e).forEach(function(r){e[r]&&(t=cn[r].on+t)}),n&&n!="\x1B[49m"&&(t=n+t),o&&o!="\x1B[39m"&&(t=o+t),t}function ZE(e,t){if(e.length===_t(e))return e.substr(0,t);for(;_t(e)>t;)e=e.slice(0,-1);return e}function LE(e,t){let n=Pa(!0),o=e.split(Pa()),r=0,i=0,a="",u,l={};for(;i<t;){u=n.exec(e);let c=o[r];if(r++,i+_t(c)>t&&(c=ZE(c,t-i)),a+=c,i+=_t(c),i<t){if(!u)break;a+=u[0],ny(l,u)}}return oy(l,a)}function BE(e,t,n){if(n=n||"\u2026",_t(e)<=t)return e;t-=_t(n);let r=LE(e,t);r+=n;let i="\x1B]8;;\x07";return e.includes(i)&&!r.includes(i)&&(r+=i),r}function
|
|
4
|
-
`);let r=n?JE:GE;for(let i=0;i<t.length;i++)o.push.apply(o,r(e,t[i]));return o}function KE(e){let t={},n=[];for(let o=0;o<e.length;o++){let r=UE(t,e[o]);t=ME(r);let i=Object.assign({},t);n.push(oy(i,r))}return n}function HE(e,t){return["\x1B]","8",";",";",e||t,"\x07",t,"\x1B]","8",";",";","\x07"].join("")}iy.exports={strlen:_t,repeat:Mo,pad:FE,truncate:BE,mergeOptions:
|
|
5
|
-
`)!=-1,o=this._styles,r=o.length;r--;){var i=yr[o[r]];t=i.open+t.replace(i.closeRe,i.open)+i.close,n&&(t=t.replace(tT,function(a){return i.close+a+i.open}))}return t}K.setTheme=function(e){if(typeof e=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var t in e)(function(n){K[n]=function(o){if(typeof e[n]=="object"){var r=o;for(var i in e[n])r=K[e[n][i]](r);return r}return K[e[n]](o)}})(t)};function aT(){var e={};return Object.keys(Ty).forEach(function(t){e[t]={get:function(){return Ey([t])}}}),e}var sT=function(t,n){var o=n.split("");return o=o.map(t),o.join("")};K.trap=gy();K.zalgo=vy();K.maps={};K.maps.america=by()(K);K.maps.zebra=xy()(K);K.maps.rainbow=wy()(K);K.maps.random=$y()(K);for(Sy in K.maps)(function(e){K[e]=function(t){return sT(K.maps[e],t)}})(Sy);var Sy;Iy(K,aT())});var Oy=ue((w2,Py)=>{var uT=Ay();Py.exports=uT});var Ry=ue((k2,Oa)=>{var{info:lT,debug:zy}=Aa(),Ke=
|
|
6
|
-
`))}wrapLines(t){let n=Ke.colorizeLines(t);return this.href?n.map(o=>Ke.hyperlink(this.href,o)):n}init(t){let n=this.x,o=this.y;this.widths=t.colWidths.slice(n,n+this.colSpan),this.heights=t.rowHeights.slice(o,o+this.rowSpan),this.width=this.widths.reduce(Ny,-1),this.height=this.heights.reduce(Ny,-1),this.hAlign=this.options.hAlign||t.colAligns[n],this.vAlign=this.options.vAlign||t.rowAligns[o],this.drawRight=n+this.colSpan==t.colWidths.length}draw(t,n){if(t=="top")return this.drawTop(this.drawRight);if(t=="bottom")return this.drawBottom(this.drawRight);let o=Ke.truncate(this.content,10,this.truncate);t||lT(`${this.y}-${this.x}: ${this.rowSpan-t}x${this.colSpan} Cell ${o}`);let r=Math.max(this.height-this.lines.length,0),i;switch(this.vAlign){case"center":i=Math.ceil(r/2);break;case"bottom":i=r;break;default:i=0}if(t<i||t>=i+this.lines.length)return this.drawEmpty(this.drawRight,n);let a=this.lines.length>this.height&&t+1>=this.height;return this.drawLine(t-i,this.drawRight,a,n)}drawTop(t){let n=[];return this.cells?this.widths.forEach(function(o,r){n.push(this._topLeftChar(r)),n.push(Ke.repeat(this.chars[this.y==0?"top":"mid"],o))},this):(n.push(this._topLeftChar(0)),n.push(Ke.repeat(this.chars[this.y==0?"top":"mid"],this.width))),t&&n.push(this.chars[this.y==0?"topRight":"rightMid"]),this.wrapWithStyleColors("border",n.join(""))}_topLeftChar(t){let n=this.x+t,o;if(this.y==0)o=n==0?"topLeft":t==0?"topMid":"top";else if(n==0)o="leftMid";else if(o=t==0?"midMid":"bottomMid",this.cells&&(this.cells[this.y-1][n]instanceof e.ColSpanCell&&(o=t==0?"topMid":"mid"),t==0)){let i=1;for(;this.cells[this.y][n-i]instanceof e.ColSpanCell;)i++;this.cells[this.y][n-i]instanceof e.RowSpanCell&&(o="leftMid")}return this.chars[o]}wrapWithStyleColors(t,n){if(this[t]&&this[t].length)try{let o=Oy();for(let r=this[t].length-1;r>=0;r--)o=o[this[t][r]];return o(n)}catch{return n}else return n}drawLine(t,n,o,r){let i=this.chars[this.x==0?"left":"middle"];if(this.x&&r&&this.cells){let y=this.cells[this.y+r][this.x-1];for(;y instanceof Zo;)y=this.cells[y.y][y.x-1];y instanceof Lo||(i=this.chars.rightMid)}let a=Ke.repeat(" ",this.paddingLeft),u=n?this.chars.right:"",l=Ke.repeat(" ",this.paddingRight),c=this.lines[t],m=this.width-(this.paddingLeft+this.paddingRight);o&&(c+=this.truncate||"\u2026");let h=Ke.truncate(c,m,this.truncate);return h=Ke.pad(h,m," ",this.hAlign),h=a+h+l,this.stylizeLine(i,h,u)}stylizeLine(t,n,o){return t=this.wrapWithStyleColors("border",t),o=this.wrapWithStyleColors("border",o),this.y===0&&(n=this.wrapWithStyleColors("head",n)),t+n+o}drawBottom(t){let n=this.chars[this.x==0?"bottomLeft":"bottomMid"],o=Ke.repeat(this.chars.bottom,this.width),r=t?this.chars.bottomRight:"";return this.wrapWithStyleColors("border",n+o+r)}drawEmpty(t,n){let o=this.chars[this.x==0?"left":"middle"];if(this.x&&n&&this.cells){let a=this.cells[this.y+n][this.x-1];for(;a instanceof Zo;)a=this.cells[a.y][a.x-1];a instanceof Lo||(o=this.chars.rightMid)}let r=t?this.chars.right:"",i=Ke.repeat(" ",this.width);return this.stylizeLine(o,i,r)}},Zo=class{constructor(){}draw(t){return typeof t=="number"&&zy(`${this.y}-${this.x}: 1x1 ColSpanCell`),""}init(){}mergeTableOptions(){}},Lo=class{constructor(t){this.originalCell=t}init(t){let n=this.y,o=this.originalCell.y;this.cellOffset=n-o,this.offset=cT(t.rowHeights,o,this.cellOffset)}draw(t){return t=="top"?this.originalCell.draw(this.offset,this.cellOffset):t=="bottom"?this.originalCell.draw("bottom"):(zy(`${this.y}-${this.x}: 1x${this.colSpan} RowSpanCell for ${this.originalCell.content}`),this.originalCell.draw(this.offset+1+t))}mergeTableOptions(){}};function jy(...e){return e.filter(t=>t!=null).shift()}function Jd(e,t,n,o){let r=n.split("-");r.length>1?(r[1]=r[1].charAt(0).toUpperCase()+r[1].substr(1),r=r.join(""),o[r]=jy(e[r],e[n],t[r],t[n])):o[n]=jy(e[n],t[n])}function cT(e,t,n){let o=e[t];for(let r=1;r<n;r++)o+=1+e[t+r];return o}function Ny(e,t){return e+t+1}var dT=["top","top-mid","top-left","top-right","bottom","bottom-mid","bottom-left","bottom-right","left","left-mid","mid","mid-mid","right","right-mid","middle"];Oa.exports=Gd;Oa.exports.ColSpanCell=Zo;Oa.exports.RowSpanCell=Lo});var Uy=ue(($2,My)=>{var{warn:pT,debug:mT}=Aa(),Wd=Ry(),{ColSpanCell:fT,RowSpanCell:gT}=Wd;(function(){function e(p,d){return p[d]>0?e(p,d+1):d}function t(p){let d={};p.forEach(function(f,v){let x=0;f.forEach(function(b){b.y=v,b.x=v?e(d,x):x;let S=b.rowSpan||1,_=b.colSpan||1;if(S>1)for(let O=0;O<_;O++)d[b.x+O]=S;x=b.x+_}),Object.keys(d).forEach(b=>{d[b]--,d[b]<1&&delete d[b]})})}function n(p){let d=0;return p.forEach(function(f){f.forEach(function(v){d=Math.max(d,v.x+(v.colSpan||1))})}),d}function o(p){return p.length}function r(p,d){let f=p.y,v=p.y-1+(p.rowSpan||1),x=d.y,b=d.y-1+(d.rowSpan||1),S=!(f>b||x>v),_=p.x,O=p.x-1+(p.colSpan||1),T=d.x,$=d.x-1+(d.colSpan||1),k=!(_>$||T>O);return S&&k}function i(p,d,f){let v=Math.min(p.length-1,f),x={x:d,y:f};for(let b=0;b<=v;b++){let S=p[b];for(let _=0;_<S.length;_++)if(r(x,S[_]))return!0}return!1}function a(p,d,f,v){for(let x=f;x<v;x++)if(i(p,x,d))return!1;return!0}function u(p){p.forEach(function(d,f){d.forEach(function(v){for(let x=1;x<v.rowSpan;x++){let b=new gT(v);b.x=v.x,b.y=v.y+x,b.colSpan=v.colSpan,c(b,p[f+x])}})})}function l(p){for(let d=p.length-1;d>=0;d--){let f=p[d];for(let v=0;v<f.length;v++){let x=f[v];for(let b=1;b<x.colSpan;b++){let S=new fT;S.x=x.x+b,S.y=x.y,f.splice(v+1,0,S)}}}}function c(p,d){let f=0;for(;f<d.length&&d[f].x<p.x;)f++;d.splice(f,0,p)}function m(p){let d=o(p),f=n(p);mT(`Max rows: ${d}; Max cols: ${f}`);for(let v=0;v<d;v++)for(let x=0;x<f;x++)if(!i(p,x,v)){let b={x,y:v,colSpan:1,rowSpan:1};for(x++;x<f&&!i(p,x,v);)b.colSpan++,x++;let S=v+1;for(;S<d&&a(p,S,b.x,b.x+b.colSpan);)b.rowSpan++,S++;let _=new Wd(b);_.x=b.x,_.y=b.y,pT(`Missing cell at ${_.y}-${_.x}.`),c(_,p[v])}}function h(p){return p.map(function(d){if(!Array.isArray(d)){let f=Object.keys(d)[0];d=d[f],Array.isArray(d)?(d=d.slice(),d.unshift(f)):d=[f,d]}return d.map(function(f){return new Wd(f)})})}function y(p){let d=h(p);return t(d),m(d),u(d),l(d),d}My.exports={makeTableLayout:y,layoutTable:t,addRowSpanCells:u,maxWidth:n,fillInTable:m,computeWidths:Fy("colSpan","desiredWidth","x",1),computeHeights:Fy("rowSpan","desiredHeight","y",1)}})();function Fy(e,t,n,o){return function(r,i){let a=[],u=[],l={};i.forEach(function(c){c.forEach(function(m){(m[e]||1)>1?u.push(m):a[m[n]]=Math.max(a[m[n]]||0,m[t]||0,o)})}),r.forEach(function(c,m){typeof c=="number"&&(a[m]=c)});for(let c=u.length-1;c>=0;c--){let m=u[c],h=m[e],y=m[n],p=a[y],d=typeof r[y]=="number"?0:1;if(typeof p=="number")for(let f=1;f<h;f++)p+=1+a[y+f],typeof r[y+f]!="number"&&d++;else p=t==="desiredWidth"?m.desiredWidth-1:1,(!l[y]||l[y]<p)&&(l[y]=p);if(m[t]>p){let f=0;for(;d>0&&m[t]>p;){if(typeof r[y+f]!="number"){let v=Math.round((m[t]-p)/d);p+=v,a[y+f]+=v,d--}f++}}}Object.assign(r,a,l);for(let c=0;c<r.length;c++)r[c]=Math.max(o,r[c]||0)}}});var Ly=ue((S2,Zy)=>{var Lt=Aa(),hT=
|
|
2
|
+
var ib=Object.create;var Ja=Object.defineProperty;var ab=Object.getOwnPropertyDescriptor;var sb=Object.getOwnPropertyNames;var ub=Object.getPrototypeOf,lb=Object.prototype.hasOwnProperty;var cp=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var cb=(e,t)=>()=>(e&&(t=e(e=0)),t);var ue=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Bt=(e,t)=>{for(var n in t)Ja(e,n,{get:t[n],enumerable:!0})},db=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of sb(t))!lb.call(e,r)&&r!==n&&Ja(e,r,{get:()=>t[r],enumerable:!(o=ab(t,r))||o.enumerable});return e};var pb=(e,t,n)=>(n=e!=null?ib(ub(e)):{},db(t||!e||!e.__esModule?Ja(n,"default",{value:e,enumerable:!0}):n,e));var un={};Bt(un,{addCustomProvider:()=>jd,addModelToCustomProvider:()=>Ea,addToRecentModels:()=>Ta,addVerifiedProvider:()=>wE,cleanupRecentModelsFromConfig:()=>Ca,clearRecentModels:()=>IE,getAIConfigDebugPaths:()=>EE,getCustomProvidersFromConfig:()=>Nd,getRecentModels:()=>zd,getVerifiedProvidersFromConfig:()=>kE,readAIConfig:()=>Zt,removeCustomProvider:()=>$E,removeVerifiedProvider:()=>SE,writeAIConfig:()=>hr});import Le from"fs";import Ia from"path";import{homedir as DE}from"os";var ir,Od,Zt,hr,wE,jd,Ea,Nd,kE,$E,SE,Ta,zd,IE,Ca,EE,vr=cb(()=>{ir=()=>{let e=process.env.XDG_CONFIG_HOME||Ia.join(DE(),".config"),t=Ia.join(e,"ai-speedometer");return{configDir:t,configJson:Ia.join(t,"ai-benchmark-config.json"),recentModelsCache:Ia.join(t,"recent-models.json")}},Od=()=>{let{configDir:e}=ir();Le.existsSync(e)||Le.mkdirSync(e,{recursive:!0})},Zt=async()=>{let{configJson:e}=ir();try{if(!Le.existsSync(e))return{verifiedProviders:{},customProviders:[]};let t=Le.readFileSync(e,"utf8");return JSON.parse(t)}catch(t){return console.warn("Warning: Could not read ai-benchmark-config.json:",t.message),{verifiedProviders:{},customProviders:[]}}},hr=async e=>{let{configJson:t}=ir();try{Od();let n=JSON.stringify(e,null,2);return Le.writeFileSync(t,n),!0}catch(n){return console.error("Error writing ai-benchmark-config.json:",n.message),!1}},wE=async(e,t)=>{let n=await Zt();return n.verifiedProviders=n.verifiedProviders||{},n.verifiedProviders[e]=t,await hr(n)},jd=async e=>{let t=await Zt();t.customProviders=t.customProviders||[];let n=t.customProviders.findIndex(o=>o.id===e.id);return n>=0?t.customProviders[n]=e:t.customProviders.push(e),await hr(t)},Ea=async(e,t)=>{let n=await Zt();if(!n.customProviders)return console.error("No custom providers found"),!1;let o=n.customProviders.find(i=>i.id===e);if(!o)return console.error(`Custom provider ${e} not found`),!1;o.models=o.models||[];let r=o.models.findIndex(i=>i.id===t.id);return r>=0?o.models[r]=t:o.models.push(t),await hr(n)},Nd=async()=>(await Zt()).customProviders||[],kE=async()=>(await Zt()).verifiedProviders||{},$E=async e=>{let t=await Zt();return t.customProviders?(t.customProviders=t.customProviders.filter(n=>n.id!==e),await hr(t)):!0},SE=async e=>{let t=await Zt();return t.verifiedProviders&&t.verifiedProviders[e]?(delete t.verifiedProviders[e],await hr(t)):!0},Ta=async e=>{let{recentModelsCache:t}=ir();Od();let n=[];try{if(Le.existsSync(t)){let o=Le.readFileSync(t,"utf8");n=JSON.parse(o)}}catch{n=[]}return e.forEach(o=>{n=n.filter(r=>r.modelId!==o.modelId),n.unshift({modelId:o.modelId,modelName:o.modelName,providerName:o.providerName,timestamp:Date.now()})}),n=n.slice(0,5),Le.writeFileSync(t,JSON.stringify(n,null,2)),n},zd=async()=>{let{recentModelsCache:e}=ir();try{if(Le.existsSync(e)){let t=Le.readFileSync(e,"utf8");return JSON.parse(t)}}catch{}return[]},IE=async()=>{let{recentModelsCache:e}=ir();try{Le.existsSync(e)&&Le.unlinkSync(e)}catch{}return[]},Ca=async()=>{let e=await Zt();if(e.recentModels&&e.recentModels.length>0){let{recentModelsCache:t}=ir();Od();try{Le.writeFileSync(t,JSON.stringify(e.recentModels,null,2))}catch(n){console.warn("Warning: Could not migrate recent models to cache:",n.message)}delete e.recentModels,await hr(e)}return e},EE=()=>{let e=ir(),t=Le.existsSync(e.configJson);return{...e,configExists:t}}});var Aa=ue((i2,Vv)=>{var Zd=[],qv=0,Ee=(e,t)=>{qv>=t&&Zd.push(e)};Ee.WARN=1;Ee.INFO=2;Ee.DEBUG=3;Ee.reset=()=>{Zd=[]};Ee.setDebugLevel=e=>{qv=e};Ee.warn=e=>Ee(e,Ee.WARN);Ee.info=e=>Ee(e,Ee.INFO);Ee.debug=e=>Ee(e,Ee.DEBUG);Ee.debugMessages=()=>Zd;Vv.exports=Ee});var Gv=ue((a2,Jv)=>{"use strict";Jv.exports=({onlyFirst:e=!1}={})=>{let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}});var Kv=ue((s2,Wv)=>{"use strict";var jE=Gv();Wv.exports=e=>typeof e=="string"?e.replace(jE(),""):e});var Yv=ue((u2,Ld)=>{"use strict";var Hv=e=>Number.isNaN(e)?!1:e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141);Ld.exports=Hv;Ld.exports.default=Hv});var Qv=ue((l2,Xv)=>{"use strict";Xv.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var ty=ue((c2,Bd)=>{"use strict";var NE=Kv(),zE=Yv(),RE=Qv(),ey=e=>{if(typeof e!="string"||e.length===0||(e=NE(e),e.length===0))return 0;e=e.replace(RE()," ");let t=0;for(let n=0;n<e.length;n++){let o=e.codePointAt(n);o<=31||o>=127&&o<=159||o>=768&&o<=879||(o>65535&&n++,t+=zE(o)?2:1)}return t};Bd.exports=ey;Bd.exports.default=ey});var qd=ue((d2,iy)=>{var ry=ty();function Pa(e){return e?/\u001b\[((?:\d*;){0,5}\d*)m/g:/\u001b\[(?:\d*;){0,5}\d*m/g}function _t(e){let t=Pa();return(""+e).replace(t,"").split(`
|
|
3
|
+
`).reduce(function(r,i){return ry(i)>r?ry(i):r},0)}function Mo(e,t){return Array(t+1).join(e)}function FE(e,t,n,o){let r=_t(e);if(t+1>=r){let i=t-r;switch(o){case"right":{e=Mo(n,i)+e;break}case"center":{let a=Math.ceil(i/2),u=i-a;e=Mo(n,u)+e+Mo(n,a);break}default:{e=e+Mo(n,i);break}}}return e}var cn={};function Uo(e,t,n){t="\x1B["+t+"m",n="\x1B["+n+"m",cn[t]={set:e,to:!0},cn[n]={set:e,to:!1},cn[e]={on:t,off:n}}Uo("bold",1,22);Uo("italics",3,23);Uo("underline",4,24);Uo("inverse",7,27);Uo("strikethrough",9,29);function ny(e,t){let n=t[1]?parseInt(t[1].split(";")[0]):0;if(n>=30&&n<=39||n>=90&&n<=97){e.lastForegroundAdded=t[0];return}if(n>=40&&n<=49||n>=100&&n<=107){e.lastBackgroundAdded=t[0];return}if(n===0){for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&delete e[r];return}let o=cn[t[0]];o&&(e[o.set]=o.to)}function ME(e){let t=Pa(!0),n=t.exec(e),o={};for(;n!==null;)ny(o,n),n=t.exec(e);return o}function oy(e,t){let n=e.lastBackgroundAdded,o=e.lastForegroundAdded;return delete e.lastBackgroundAdded,delete e.lastForegroundAdded,Object.keys(e).forEach(function(r){e[r]&&(t+=cn[r].off)}),n&&n!="\x1B[49m"&&(t+="\x1B[49m"),o&&o!="\x1B[39m"&&(t+="\x1B[39m"),t}function UE(e,t){let n=e.lastBackgroundAdded,o=e.lastForegroundAdded;return delete e.lastBackgroundAdded,delete e.lastForegroundAdded,Object.keys(e).forEach(function(r){e[r]&&(t=cn[r].on+t)}),n&&n!="\x1B[49m"&&(t=n+t),o&&o!="\x1B[39m"&&(t=o+t),t}function ZE(e,t){if(e.length===_t(e))return e.substr(0,t);for(;_t(e)>t;)e=e.slice(0,-1);return e}function LE(e,t){let n=Pa(!0),o=e.split(Pa()),r=0,i=0,a="",u,l={};for(;i<t;){u=n.exec(e);let c=o[r];if(r++,i+_t(c)>t&&(c=ZE(c,t-i)),a+=c,i+=_t(c),i<t){if(!u)break;a+=u[0],ny(l,u)}}return oy(l,a)}function BE(e,t,n){if(n=n||"\u2026",_t(e)<=t)return e;t-=_t(n);let r=LE(e,t);r+=n;let i="\x1B]8;;\x07";return e.includes(i)&&!r.includes(i)&&(r+=i),r}function qE(){return{chars:{top:"\u2500","top-mid":"\u252C","top-left":"\u250C","top-right":"\u2510",bottom:"\u2500","bottom-mid":"\u2534","bottom-left":"\u2514","bottom-right":"\u2518",left:"\u2502","left-mid":"\u251C",mid:"\u2500","mid-mid":"\u253C",right:"\u2502","right-mid":"\u2524",middle:"\u2502"},truncate:"\u2026",colWidths:[],rowHeights:[],colAligns:[],rowAligns:[],style:{"padding-left":1,"padding-right":1,head:["red"],border:["grey"],compact:!1},head:[]}}function VE(e,t){e=e||{},t=t||qE();let n=Object.assign({},t,e);return n.chars=Object.assign({},t.chars,e.chars),n.style=Object.assign({},t.style,e.style),n}function JE(e,t){let n=[],o=t.split(/(\s+)/g),r=[],i=0,a;for(let u=0;u<o.length;u+=2){let l=o[u],c=i+_t(l);i>0&&a&&(c+=a.length),c>e?(i!==0&&n.push(r.join("")),r=[l],i=_t(l)):(r.push(a||"",l),i=c),a=o[u+1]}return i&&n.push(r.join("")),n}function GE(e,t){let n=[],o="";function r(a,u){for(o.length&&u&&(o+=u),o+=a;o.length>e;)n.push(o.slice(0,e)),o=o.slice(e)}let i=t.split(/(\s+)/g);for(let a=0;a<i.length;a+=2)r(i[a],a&&i[a-1]);return o.length&&n.push(o),n}function WE(e,t,n=!0){let o=[];t=t.split(`
|
|
4
|
+
`);let r=n?JE:GE;for(let i=0;i<t.length;i++)o.push.apply(o,r(e,t[i]));return o}function KE(e){let t={},n=[];for(let o=0;o<e.length;o++){let r=UE(t,e[o]);t=ME(r);let i=Object.assign({},t);n.push(oy(i,r))}return n}function HE(e,t){return["\x1B]","8",";",";",e||t,"\x07",t,"\x1B]","8",";",";","\x07"].join("")}iy.exports={strlen:_t,repeat:Mo,pad:FE,truncate:BE,mergeOptions:VE,wordWrap:WE,colorizeLines:KE,hyperlink:HE}});var ly=ue((p2,uy)=>{var sy={};uy.exports=sy;var ay={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(ay).forEach(function(e){var t=ay[e],n=sy[e]=[];n.open="\x1B["+t[0]+"m",n.close="\x1B["+t[1]+"m"})});var dy=ue((m2,cy)=>{"use strict";cy.exports=function(e,t){t=t||process.argv;var n=t.indexOf("--"),o=/^-{1,2}/.test(e)?"":"--",r=t.indexOf(o+e);return r!==-1&&(n===-1?!0:r<n)}});var my=ue((f2,py)=>{"use strict";var YE=cp("os"),ct=dy(),Ne=process.env,dn=void 0;ct("no-color")||ct("no-colors")||ct("color=false")?dn=!1:(ct("color")||ct("colors")||ct("color=true")||ct("color=always"))&&(dn=!0);"FORCE_COLOR"in Ne&&(dn=Ne.FORCE_COLOR.length===0||parseInt(Ne.FORCE_COLOR,10)!==0);function XE(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function QE(e){if(dn===!1)return 0;if(ct("color=16m")||ct("color=full")||ct("color=truecolor"))return 3;if(ct("color=256"))return 2;if(e&&!e.isTTY&&dn!==!0)return 0;var t=dn?1:0;if(process.platform==="win32"){var n=YE.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in Ne)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(r){return r in Ne})||Ne.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in Ne)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ne.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in Ne){var o=parseInt((Ne.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ne.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ne.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(Ne.TERM)||"COLORTERM"in Ne?1:(Ne.TERM==="dumb",t)}function Vd(e){var t=QE(e);return XE(t)}py.exports={supportsColor:Vd,stdout:Vd(process.stdout),stderr:Vd(process.stderr)}});var gy=ue((g2,fy)=>{fy.exports=function(t,n){var o="";t=t||"Run the trap, drop the bass",t=t.split("");var r={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return t.forEach(function(i){i=i.toLowerCase();var a=r[i]||[" "],u=Math.floor(Math.random()*a.length);typeof r[i]<"u"?o+=r[i][u]:o+=i}),o}});var vy=ue((h2,hy)=>{hy.exports=function(t,n){t=t||" he is here ";var o={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},r=[].concat(o.up,o.down,o.mid);function i(l){var c=Math.floor(Math.random()*l);return c}function a(l){var c=!1;return r.filter(function(m){c=m===l}),c}function u(l,c){var m="",h,y;c=c||{},c.up=typeof c.up<"u"?c.up:!0,c.mid=typeof c.mid<"u"?c.mid:!0,c.down=typeof c.down<"u"?c.down:!0,c.size=typeof c.size<"u"?c.size:"maxi",l=l.split("");for(y in l)if(!a(y)){switch(m=m+l[y],h={up:0,down:0,mid:0},c.size){case"mini":h.up=i(8),h.mid=i(2),h.down=i(8);break;case"maxi":h.up=i(16)+3,h.mid=i(4)+1,h.down=i(64)+3;break;default:h.up=i(8)+1,h.mid=i(6)/2,h.down=i(8)+1;break}var p=["up","mid","down"];for(var d in p)for(var f=p[d],v=0;v<=h[f];v++)c[f]&&(m=m+o[f][i(o[f].length)])}return m}return u(t,n)}});var by=ue((v2,yy)=>{yy.exports=function(e){return function(t,n,o){if(t===" ")return t;switch(n%3){case 0:return e.red(t);case 1:return e.white(t);case 2:return e.blue(t)}}}});var xy=ue((y2,_y)=>{_y.exports=function(e){return function(t,n,o){return n%2===0?t:e.inverse(t)}}});var wy=ue((b2,Dy)=>{Dy.exports=function(e){var t=["red","yellow","green","blue","magenta"];return function(n,o,r){return n===" "?n:e[t[o++%t.length]](n)}}});var $y=ue((_2,ky)=>{ky.exports=function(e){var t=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(n,o,r){return n===" "?n:e[t[Math.round(Math.random()*(t.length-2))]](n)}}});var Ay=ue((D2,Cy)=>{var K={};Cy.exports=K;K.themes={};var eT=cp("util"),yr=K.styles=ly(),Iy=Object.defineProperties,tT=new RegExp(/[\r\n]+/g);K.supportsColor=my().supportsColor;typeof K.enabled>"u"&&(K.enabled=K.supportsColor()!==!1);K.enable=function(){K.enabled=!0};K.disable=function(){K.enabled=!1};K.stripColors=K.strip=function(e){return(""+e).replace(/\x1B\[\d+m/g,"")};var x2=K.stylize=function(t,n){if(!K.enabled)return t+"";var o=yr[n];return!o&&n in K?K[n](t):o.open+t+o.close},rT=/[|\\{}()[\]^$+*?.]/g,nT=function(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(rT,"\\$&")};function Ey(e){var t=function n(){return iT.apply(n,arguments)};return t._styles=e,t.__proto__=oT,t}var Ty=(function(){var e={};return yr.grey=yr.gray,Object.keys(yr).forEach(function(t){yr[t].closeRe=new RegExp(nT(yr[t].close),"g"),e[t]={get:function(){return Ey(this._styles.concat(t))}}}),e})(),oT=Iy(function(){},Ty);function iT(){var e=Array.prototype.slice.call(arguments),t=e.map(function(a){return a!=null&&a.constructor===String?a:eT.inspect(a)}).join(" ");if(!K.enabled||!t)return t;for(var n=t.indexOf(`
|
|
5
|
+
`)!=-1,o=this._styles,r=o.length;r--;){var i=yr[o[r]];t=i.open+t.replace(i.closeRe,i.open)+i.close,n&&(t=t.replace(tT,function(a){return i.close+a+i.open}))}return t}K.setTheme=function(e){if(typeof e=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var t in e)(function(n){K[n]=function(o){if(typeof e[n]=="object"){var r=o;for(var i in e[n])r=K[e[n][i]](r);return r}return K[e[n]](o)}})(t)};function aT(){var e={};return Object.keys(Ty).forEach(function(t){e[t]={get:function(){return Ey([t])}}}),e}var sT=function(t,n){var o=n.split("");return o=o.map(t),o.join("")};K.trap=gy();K.zalgo=vy();K.maps={};K.maps.america=by()(K);K.maps.zebra=xy()(K);K.maps.rainbow=wy()(K);K.maps.random=$y()(K);for(Sy in K.maps)(function(e){K[e]=function(t){return sT(K.maps[e],t)}})(Sy);var Sy;Iy(K,aT())});var Oy=ue((w2,Py)=>{var uT=Ay();Py.exports=uT});var Ry=ue((k2,Oa)=>{var{info:lT,debug:zy}=Aa(),Ke=qd(),Gd=class e{constructor(t){this.setOptions(t),this.x=null,this.y=null}setOptions(t){["boolean","number","bigint","string"].indexOf(typeof t)!==-1&&(t={content:""+t}),t=t||{},this.options=t;let n=t.content;if(["boolean","number","bigint","string"].indexOf(typeof n)!==-1)this.content=String(n);else if(!n)this.content=this.options.href||"";else throw new Error("Content needs to be a primitive, got: "+typeof n);this.colSpan=t.colSpan||1,this.rowSpan=t.rowSpan||1,this.options.href&&Object.defineProperty(this,"href",{get(){return this.options.href}})}mergeTableOptions(t,n){this.cells=n;let o=this.options.chars||{},r=t.chars,i=this.chars={};dT.forEach(function(l){Jd(o,r,l,i)}),this.truncate=this.options.truncate||t.truncate;let a=this.options.style=this.options.style||{},u=t.style;Jd(a,u,"padding-left",this),Jd(a,u,"padding-right",this),this.head=a.head||u.head,this.border=a.border||u.border,this.fixedWidth=t.colWidths[this.x],this.lines=this.computeLines(t),this.desiredWidth=Ke.strlen(this.content)+this.paddingLeft+this.paddingRight,this.desiredHeight=this.lines.length}computeLines(t){let n=t.wordWrap||t.textWrap,{wordWrap:o=n}=this.options;if(this.fixedWidth&&o){if(this.fixedWidth-=this.paddingLeft+this.paddingRight,this.colSpan){let a=1;for(;a<this.colSpan;)this.fixedWidth+=t.colWidths[this.x+a],a++}let{wrapOnWordBoundary:r=!0}=t,{wrapOnWordBoundary:i=r}=this.options;return this.wrapLines(Ke.wordWrap(this.fixedWidth,this.content,i))}return this.wrapLines(this.content.split(`
|
|
6
|
+
`))}wrapLines(t){let n=Ke.colorizeLines(t);return this.href?n.map(o=>Ke.hyperlink(this.href,o)):n}init(t){let n=this.x,o=this.y;this.widths=t.colWidths.slice(n,n+this.colSpan),this.heights=t.rowHeights.slice(o,o+this.rowSpan),this.width=this.widths.reduce(Ny,-1),this.height=this.heights.reduce(Ny,-1),this.hAlign=this.options.hAlign||t.colAligns[n],this.vAlign=this.options.vAlign||t.rowAligns[o],this.drawRight=n+this.colSpan==t.colWidths.length}draw(t,n){if(t=="top")return this.drawTop(this.drawRight);if(t=="bottom")return this.drawBottom(this.drawRight);let o=Ke.truncate(this.content,10,this.truncate);t||lT(`${this.y}-${this.x}: ${this.rowSpan-t}x${this.colSpan} Cell ${o}`);let r=Math.max(this.height-this.lines.length,0),i;switch(this.vAlign){case"center":i=Math.ceil(r/2);break;case"bottom":i=r;break;default:i=0}if(t<i||t>=i+this.lines.length)return this.drawEmpty(this.drawRight,n);let a=this.lines.length>this.height&&t+1>=this.height;return this.drawLine(t-i,this.drawRight,a,n)}drawTop(t){let n=[];return this.cells?this.widths.forEach(function(o,r){n.push(this._topLeftChar(r)),n.push(Ke.repeat(this.chars[this.y==0?"top":"mid"],o))},this):(n.push(this._topLeftChar(0)),n.push(Ke.repeat(this.chars[this.y==0?"top":"mid"],this.width))),t&&n.push(this.chars[this.y==0?"topRight":"rightMid"]),this.wrapWithStyleColors("border",n.join(""))}_topLeftChar(t){let n=this.x+t,o;if(this.y==0)o=n==0?"topLeft":t==0?"topMid":"top";else if(n==0)o="leftMid";else if(o=t==0?"midMid":"bottomMid",this.cells&&(this.cells[this.y-1][n]instanceof e.ColSpanCell&&(o=t==0?"topMid":"mid"),t==0)){let i=1;for(;this.cells[this.y][n-i]instanceof e.ColSpanCell;)i++;this.cells[this.y][n-i]instanceof e.RowSpanCell&&(o="leftMid")}return this.chars[o]}wrapWithStyleColors(t,n){if(this[t]&&this[t].length)try{let o=Oy();for(let r=this[t].length-1;r>=0;r--)o=o[this[t][r]];return o(n)}catch{return n}else return n}drawLine(t,n,o,r){let i=this.chars[this.x==0?"left":"middle"];if(this.x&&r&&this.cells){let y=this.cells[this.y+r][this.x-1];for(;y instanceof Zo;)y=this.cells[y.y][y.x-1];y instanceof Lo||(i=this.chars.rightMid)}let a=Ke.repeat(" ",this.paddingLeft),u=n?this.chars.right:"",l=Ke.repeat(" ",this.paddingRight),c=this.lines[t],m=this.width-(this.paddingLeft+this.paddingRight);o&&(c+=this.truncate||"\u2026");let h=Ke.truncate(c,m,this.truncate);return h=Ke.pad(h,m," ",this.hAlign),h=a+h+l,this.stylizeLine(i,h,u)}stylizeLine(t,n,o){return t=this.wrapWithStyleColors("border",t),o=this.wrapWithStyleColors("border",o),this.y===0&&(n=this.wrapWithStyleColors("head",n)),t+n+o}drawBottom(t){let n=this.chars[this.x==0?"bottomLeft":"bottomMid"],o=Ke.repeat(this.chars.bottom,this.width),r=t?this.chars.bottomRight:"";return this.wrapWithStyleColors("border",n+o+r)}drawEmpty(t,n){let o=this.chars[this.x==0?"left":"middle"];if(this.x&&n&&this.cells){let a=this.cells[this.y+n][this.x-1];for(;a instanceof Zo;)a=this.cells[a.y][a.x-1];a instanceof Lo||(o=this.chars.rightMid)}let r=t?this.chars.right:"",i=Ke.repeat(" ",this.width);return this.stylizeLine(o,i,r)}},Zo=class{constructor(){}draw(t){return typeof t=="number"&&zy(`${this.y}-${this.x}: 1x1 ColSpanCell`),""}init(){}mergeTableOptions(){}},Lo=class{constructor(t){this.originalCell=t}init(t){let n=this.y,o=this.originalCell.y;this.cellOffset=n-o,this.offset=cT(t.rowHeights,o,this.cellOffset)}draw(t){return t=="top"?this.originalCell.draw(this.offset,this.cellOffset):t=="bottom"?this.originalCell.draw("bottom"):(zy(`${this.y}-${this.x}: 1x${this.colSpan} RowSpanCell for ${this.originalCell.content}`),this.originalCell.draw(this.offset+1+t))}mergeTableOptions(){}};function jy(...e){return e.filter(t=>t!=null).shift()}function Jd(e,t,n,o){let r=n.split("-");r.length>1?(r[1]=r[1].charAt(0).toUpperCase()+r[1].substr(1),r=r.join(""),o[r]=jy(e[r],e[n],t[r],t[n])):o[n]=jy(e[n],t[n])}function cT(e,t,n){let o=e[t];for(let r=1;r<n;r++)o+=1+e[t+r];return o}function Ny(e,t){return e+t+1}var dT=["top","top-mid","top-left","top-right","bottom","bottom-mid","bottom-left","bottom-right","left","left-mid","mid","mid-mid","right","right-mid","middle"];Oa.exports=Gd;Oa.exports.ColSpanCell=Zo;Oa.exports.RowSpanCell=Lo});var Uy=ue(($2,My)=>{var{warn:pT,debug:mT}=Aa(),Wd=Ry(),{ColSpanCell:fT,RowSpanCell:gT}=Wd;(function(){function e(p,d){return p[d]>0?e(p,d+1):d}function t(p){let d={};p.forEach(function(f,v){let x=0;f.forEach(function(b){b.y=v,b.x=v?e(d,x):x;let S=b.rowSpan||1,_=b.colSpan||1;if(S>1)for(let O=0;O<_;O++)d[b.x+O]=S;x=b.x+_}),Object.keys(d).forEach(b=>{d[b]--,d[b]<1&&delete d[b]})})}function n(p){let d=0;return p.forEach(function(f){f.forEach(function(v){d=Math.max(d,v.x+(v.colSpan||1))})}),d}function o(p){return p.length}function r(p,d){let f=p.y,v=p.y-1+(p.rowSpan||1),x=d.y,b=d.y-1+(d.rowSpan||1),S=!(f>b||x>v),_=p.x,O=p.x-1+(p.colSpan||1),T=d.x,$=d.x-1+(d.colSpan||1),k=!(_>$||T>O);return S&&k}function i(p,d,f){let v=Math.min(p.length-1,f),x={x:d,y:f};for(let b=0;b<=v;b++){let S=p[b];for(let _=0;_<S.length;_++)if(r(x,S[_]))return!0}return!1}function a(p,d,f,v){for(let x=f;x<v;x++)if(i(p,x,d))return!1;return!0}function u(p){p.forEach(function(d,f){d.forEach(function(v){for(let x=1;x<v.rowSpan;x++){let b=new gT(v);b.x=v.x,b.y=v.y+x,b.colSpan=v.colSpan,c(b,p[f+x])}})})}function l(p){for(let d=p.length-1;d>=0;d--){let f=p[d];for(let v=0;v<f.length;v++){let x=f[v];for(let b=1;b<x.colSpan;b++){let S=new fT;S.x=x.x+b,S.y=x.y,f.splice(v+1,0,S)}}}}function c(p,d){let f=0;for(;f<d.length&&d[f].x<p.x;)f++;d.splice(f,0,p)}function m(p){let d=o(p),f=n(p);mT(`Max rows: ${d}; Max cols: ${f}`);for(let v=0;v<d;v++)for(let x=0;x<f;x++)if(!i(p,x,v)){let b={x,y:v,colSpan:1,rowSpan:1};for(x++;x<f&&!i(p,x,v);)b.colSpan++,x++;let S=v+1;for(;S<d&&a(p,S,b.x,b.x+b.colSpan);)b.rowSpan++,S++;let _=new Wd(b);_.x=b.x,_.y=b.y,pT(`Missing cell at ${_.y}-${_.x}.`),c(_,p[v])}}function h(p){return p.map(function(d){if(!Array.isArray(d)){let f=Object.keys(d)[0];d=d[f],Array.isArray(d)?(d=d.slice(),d.unshift(f)):d=[f,d]}return d.map(function(f){return new Wd(f)})})}function y(p){let d=h(p);return t(d),m(d),u(d),l(d),d}My.exports={makeTableLayout:y,layoutTable:t,addRowSpanCells:u,maxWidth:n,fillInTable:m,computeWidths:Fy("colSpan","desiredWidth","x",1),computeHeights:Fy("rowSpan","desiredHeight","y",1)}})();function Fy(e,t,n,o){return function(r,i){let a=[],u=[],l={};i.forEach(function(c){c.forEach(function(m){(m[e]||1)>1?u.push(m):a[m[n]]=Math.max(a[m[n]]||0,m[t]||0,o)})}),r.forEach(function(c,m){typeof c=="number"&&(a[m]=c)});for(let c=u.length-1;c>=0;c--){let m=u[c],h=m[e],y=m[n],p=a[y],d=typeof r[y]=="number"?0:1;if(typeof p=="number")for(let f=1;f<h;f++)p+=1+a[y+f],typeof r[y+f]!="number"&&d++;else p=t==="desiredWidth"?m.desiredWidth-1:1,(!l[y]||l[y]<p)&&(l[y]=p);if(m[t]>p){let f=0;for(;d>0&&m[t]>p;){if(typeof r[y+f]!="number"){let v=Math.round((m[t]-p)/d);p+=v,a[y+f]+=v,d--}f++}}}Object.assign(r,a,l);for(let c=0;c<r.length;c++)r[c]=Math.max(o,r[c]||0)}}});var Ly=ue((S2,Zy)=>{var Lt=Aa(),hT=qd(),Kd=Uy(),ja=class extends Array{constructor(t){super();let n=hT.mergeOptions(t);if(Object.defineProperty(this,"options",{value:n,enumerable:n.debug}),n.debug){switch(typeof n.debug){case"boolean":Lt.setDebugLevel(Lt.WARN);break;case"number":Lt.setDebugLevel(n.debug);break;case"string":Lt.setDebugLevel(parseInt(n.debug,10));break;default:Lt.setDebugLevel(Lt.WARN),Lt.warn(`Debug option is expected to be boolean, number, or string. Received a ${typeof n.debug}`)}Object.defineProperty(this,"messages",{get(){return Lt.debugMessages()}})}}toString(){let t=this,n=this.options.head&&this.options.head.length;n?(t=[this.options.head],this.length&&t.push.apply(t,this)):this.options.style.head=[];let o=Kd.makeTableLayout(t);o.forEach(function(i){i.forEach(function(a){a.mergeTableOptions(this.options,o)},this)},this),Kd.computeWidths(this.options.colWidths,o),Kd.computeHeights(this.options.rowHeights,o),o.forEach(function(i){i.forEach(function(a){a.init(this.options)},this)},this);let r=[];for(let i=0;i<o.length;i++){let a=o[i],u=this.options.rowHeights[i];(i===0||!this.options.style.compact||i==1&&n)&&Hd(a,"top",r);for(let l=0;l<u;l++)Hd(a,l,r);i+1==o.length&&Hd(a,"bottom",r)}return r.join(`
|
|
7
7
|
`)}get width(){return this.toString().split(`
|
|
8
|
-
`)[0].length}};ja.reset=()=>Lt.reset();function Hd(e,t,n){let o=[];e.forEach(function(i){o.push(i.draw(t))});let r=o.join("");r.length&&n.push(r)}Zy.exports=ja});var
|
|
9
|
-
Error message: ${ft(t)}`,cause:t}),this[Pp]=!0,this.text=e}static isInstance(e){return Z.hasMarker(e,Ap)}};Pp=_b;var Op="AI_LoadAPIKeyError",jp=`vercel.ai.error.${Op}`,xb=Symbol.for(jp),Np,bn=class extends Z{constructor({message:e}){super({name:Op,message:e}),this[Np]=!0}static isInstance(e){return Z.hasMarker(e,jp)}};Np=xb;var Db="AI_LoadSettingError",wb=`vercel.ai.error.${Db}`,kb=Symbol.for(wb),$b;$b=kb;var Sb="AI_NoContentGeneratedError",Ib=`vercel.ai.error.${Sb}`,Eb=Symbol.for(Ib),Tb;Tb=Eb;var zp="AI_NoSuchModelError",Rp=`vercel.ai.error.${zp}`,Cb=Symbol.for(Rp),Fp,_n=class extends Z{constructor({errorName:e=zp,modelId:t,modelType:n,message:o=`No such ${n}: ${t}`}){super({name:e,message:o}),this[Fp]=!0,this.modelId=t,this.modelType=n}static isInstance(e){return Z.hasMarker(e,Rp)}};Fp=Cb;var Mp="AI_TooManyEmbeddingValuesForCallError",Up=`vercel.ai.error.${Mp}`,Ab=Symbol.for(Up),Zp,Lp=class extends Z{constructor(e){super({name:Mp,message:`Too many values for a single embedding call. The ${e.provider} model "${e.modelId}" can only embed up to ${e.maxEmbeddingsPerCall} values per call, but ${e.values.length} values were provided.`}),this[Zp]=!0,this.provider=e.provider,this.modelId=e.modelId,this.maxEmbeddingsPerCall=e.maxEmbeddingsPerCall,this.values=e.values}static isInstance(e){return Z.hasMarker(e,Up)}};Zp=Ab;var Bp="AI_TypeValidationError",
|
|
10
|
-
Error message: ${ft(n)}`,cause:n}),this[
|
|
8
|
+
`)[0].length}};ja.reset=()=>Lt.reset();function Hd(e,t,n){let o=[];e.forEach(function(i){o.push(i.draw(t))});let r=o.join("");r.length&&n.push(r)}Zy.exports=ja});var qy=ue((I2,By)=>{By.exports=Ly()});import vT from"readline";import Na from"fs";var dp="vercel.ai.error",mb=Symbol.for(dp),pp,fb=class mp extends Error{constructor({name:t,message:n,cause:o}){super(n),this[pp]=!0,this.name=t,this.cause=o}static isInstance(t){return mp.hasMarker(t,dp)}static hasMarker(t,n){let o=Symbol.for(n);return t!=null&&typeof t=="object"&&o in t&&typeof t[o]=="boolean"&&t[o]===!0}};pp=mb;var Z=fb,fp="AI_APICallError",gp=`vercel.ai.error.${fp}`,gb=Symbol.for(gp),hp,le=class extends Z{constructor({message:e,url:t,requestBodyValues:n,statusCode:o,responseHeaders:r,responseBody:i,cause:a,isRetryable:u=o!=null&&(o===408||o===409||o===429||o>=500),data:l}){super({name:fp,message:e,cause:a}),this[hp]=!0,this.url=t,this.requestBodyValues=n,this.statusCode=o,this.responseHeaders=r,this.responseBody=i,this.isRetryable=u,this.data=l}static isInstance(e){return Z.hasMarker(e,gp)}};hp=gb;var vp="AI_EmptyResponseBodyError",yp=`vercel.ai.error.${vp}`,hb=Symbol.for(yp),bp,_p=class extends Z{constructor({message:e="Empty response body"}={}){super({name:vp,message:e}),this[bp]=!0}static isInstance(e){return Z.hasMarker(e,yp)}};bp=hb;function ft(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var xp="AI_InvalidArgumentError",Dp=`vercel.ai.error.${xp}`,vb=Symbol.for(Dp),wp,Jo=class extends Z{constructor({message:e,cause:t,argument:n}){super({name:xp,message:e,cause:t}),this[wp]=!0,this.argument=n}static isInstance(e){return Z.hasMarker(e,Dp)}};wp=vb;var kp="AI_InvalidPromptError",$p=`vercel.ai.error.${kp}`,yb=Symbol.for($p),Sp,$t=class extends Z{constructor({prompt:e,message:t,cause:n}){super({name:kp,message:`Invalid prompt: ${t}`,cause:n}),this[Sp]=!0,this.prompt=e}static isInstance(e){return Z.hasMarker(e,$p)}};Sp=yb;var Ip="AI_InvalidResponseDataError",Ep=`vercel.ai.error.${Ip}`,bb=Symbol.for(Ep),Tp,Wa=class extends Z{constructor({data:e,message:t=`Invalid response data: ${JSON.stringify(e)}.`}){super({name:Ip,message:t}),this[Tp]=!0,this.data=e}static isInstance(e){return Z.hasMarker(e,Ep)}};Tp=bb;var Cp="AI_JSONParseError",Ap=`vercel.ai.error.${Cp}`,_b=Symbol.for(Ap),Pp,yn=class extends Z{constructor({text:e,cause:t}){super({name:Cp,message:`JSON parsing failed: Text: ${e}.
|
|
9
|
+
Error message: ${ft(t)}`,cause:t}),this[Pp]=!0,this.text=e}static isInstance(e){return Z.hasMarker(e,Ap)}};Pp=_b;var Op="AI_LoadAPIKeyError",jp=`vercel.ai.error.${Op}`,xb=Symbol.for(jp),Np,bn=class extends Z{constructor({message:e}){super({name:Op,message:e}),this[Np]=!0}static isInstance(e){return Z.hasMarker(e,jp)}};Np=xb;var Db="AI_LoadSettingError",wb=`vercel.ai.error.${Db}`,kb=Symbol.for(wb),$b;$b=kb;var Sb="AI_NoContentGeneratedError",Ib=`vercel.ai.error.${Sb}`,Eb=Symbol.for(Ib),Tb;Tb=Eb;var zp="AI_NoSuchModelError",Rp=`vercel.ai.error.${zp}`,Cb=Symbol.for(Rp),Fp,_n=class extends Z{constructor({errorName:e=zp,modelId:t,modelType:n,message:o=`No such ${n}: ${t}`}){super({name:e,message:o}),this[Fp]=!0,this.modelId=t,this.modelType=n}static isInstance(e){return Z.hasMarker(e,Rp)}};Fp=Cb;var Mp="AI_TooManyEmbeddingValuesForCallError",Up=`vercel.ai.error.${Mp}`,Ab=Symbol.for(Up),Zp,Lp=class extends Z{constructor(e){super({name:Mp,message:`Too many values for a single embedding call. The ${e.provider} model "${e.modelId}" can only embed up to ${e.maxEmbeddingsPerCall} values per call, but ${e.values.length} values were provided.`}),this[Zp]=!0,this.provider=e.provider,this.modelId=e.modelId,this.maxEmbeddingsPerCall=e.maxEmbeddingsPerCall,this.values=e.values}static isInstance(e){return Z.hasMarker(e,Up)}};Zp=Ab;var Bp="AI_TypeValidationError",qp=`vercel.ai.error.${Bp}`,Pb=Symbol.for(qp),Vp,Ob=class Ga extends Z{constructor({value:t,cause:n}){super({name:Bp,message:`Type validation failed: Value: ${JSON.stringify(t)}.
|
|
10
|
+
Error message: ${ft(n)}`,cause:n}),this[Vp]=!0,this.value=t}static isInstance(t){return Z.hasMarker(t,qp)}static wrap({value:t,cause:n}){return Ga.isInstance(n)&&n.value===t?n:new Ga({value:t,cause:n})}};Vp=Pb;var qt=Ob,Jp="AI_UnsupportedFunctionalityError",Gp=`vercel.ai.error.${Jp}`,jb=Symbol.for(Gp),Wp,De=class extends Z{constructor({functionality:e,message:t=`'${e}' functionality not supported.`}){super({name:Jp,message:t}),this[Wp]=!0,this.functionality=e}static isInstance(e){return Z.hasMarker(e,Gp)}};Wp=jb;var Go=class extends Error{constructor(t,n){super(t),this.name="ParseError",this.type=n.type,this.field=n.field,this.value=n.value,this.line=n.line}};function Ka(e){}function Kp(e){if(typeof e=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:t=Ka,onError:n=Ka,onRetry:o=Ka,onComment:r}=e,i="",a=!0,u,l="",c="";function m(f){let v=a?f.replace(/^\xEF\xBB\xBF/,""):f,[x,b]=Nb(`${i}${v}`);for(let S of x)h(S);i=b,a=!1}function h(f){if(f===""){p();return}if(f.startsWith(":")){r&&r(f.slice(f.startsWith(": ")?2:1));return}let v=f.indexOf(":");if(v!==-1){let x=f.slice(0,v),b=f[v+1]===" "?2:1,S=f.slice(v+b);y(x,S,f);return}y(f,"",f)}function y(f,v,x){switch(f){case"event":c=v;break;case"data":l=`${l}${v}
|
|
11
11
|
`;break;case"id":u=v.includes("\0")?void 0:v;break;case"retry":/^\d+$/.test(v)?o(parseInt(v,10)):n(new Go(`Invalid \`retry\` value: "${v}"`,{type:"invalid-retry",value:v,line:x}));break;default:n(new Go(`Unknown field "${f.length>20?`${f.slice(0,20)}\u2026`:f}"`,{type:"unknown-field",field:f,value:v,line:x}));break}}function p(){l.length>0&&t({id:u,event:c||void 0,data:l.endsWith(`
|
|
12
12
|
`)?l.slice(0,-1):l}),u=void 0,l="",c=""}function d(f={}){i&&f.consume&&h(i),a=!0,u=void 0,l="",c="",i=""}return{feed:m,reset:d}}function Nb(e){let t=[],n="",o=0;for(;o<e.length;){let r=e.indexOf("\r",o),i=e.indexOf(`
|
|
13
13
|
`,o),a=-1;if(r!==-1&&i!==-1?a=Math.min(r,i):r!==-1?r===e.length-1?a=-1:a=r:i!==-1&&(a=i),a===-1){n=e.slice(o);break}else{let u=e.slice(o,a);t.push(u),o=a+1,e[o-1]==="\r"&&e[o]===`
|
|
14
|
-
`&&o++}}return[t,n]}var Wo=class extends TransformStream{constructor({onError:t,onRetry:n,onComment:o}={}){let r;super({start(i){r=Kp({onEvent:a=>{i.enqueue(a)},onError(a){t==="terminate"?i.error(a):typeof t=="function"&&t(a)},onRetry:n,onComment:o})},transform(i){r.feed(i)}})}};var s={};Bt(s,{$brand:()=>Ko,$input:()=>ml,$output:()=>pl,NEVER:()=>Ha,TimePrecision:()=>hl,ZodAny:()=>$f,ZodArray:()=>Tf,ZodBase64:()=>Ac,ZodBase64URL:()=>Pc,ZodBigInt:()=>so,ZodBigIntFormat:()=>Nc,ZodBoolean:()=>ao,ZodCIDRv4:()=>Tc,ZodCIDRv6:()=>Cc,ZodCUID:()=>Dc,ZodCUID2:()=>wc,ZodCatch:()=>Wf,ZodCodec:()=>qc,ZodCustom:()=>na,ZodCustomStringFormat:()=>oo,ZodDate:()=>ea,ZodDefault:()=>Lf,ZodDiscriminatedUnion:()=>Cf,ZodE164:()=>Oc,ZodEmail:()=>bc,ZodEmoji:()=>_c,ZodEnum:()=>ro,ZodError:()=>uD,ZodFile:()=>Mf,ZodFirstPartyTypeKind:()=>Jc,ZodFunction:()=>ng,ZodGUID:()=>Ki,ZodIPv4:()=>Ic,ZodIPv6:()=>Ec,ZodISODate:()=>qi,ZodISODateTime:()=>Vi,ZodISODuration:()=>Gi,ZodISOTime:()=>Ji,ZodIntersection:()=>Af,ZodIssueCode:()=>bw,ZodJWT:()=>jc,ZodKSUID:()=>Sc,ZodLazy:()=>eg,ZodLiteral:()=>Ff,ZodMap:()=>zf,ZodNaN:()=>Hf,ZodNanoID:()=>xc,ZodNever:()=>If,ZodNonOptional:()=>Bc,ZodNull:()=>wf,ZodNullable:()=>Zf,ZodNumber:()=>io,ZodNumberFormat:()=>Fr,ZodObject:()=>ra,ZodOptional:()=>Lc,ZodPipe:()=>Vc,ZodPrefault:()=>Vf,ZodPromise:()=>rg,ZodReadonly:()=>Yf,ZodRealError:()=>Fe,ZodRecord:()=>Mc,ZodSet:()=>Rf,ZodString:()=>no,ZodStringFormat:()=>ae,ZodSuccess:()=>Gf,ZodSymbol:()=>xf,ZodTemplateLiteral:()=>Qf,ZodTransform:()=>Uf,ZodTuple:()=>Of,ZodType:()=>J,ZodULID:()=>kc,ZodURL:()=>Qi,ZodUUID:()=>Ct,ZodUndefined:()=>Df,ZodUnion:()=>Rc,ZodUnknown:()=>Sf,ZodVoid:()=>Ef,ZodXID:()=>$c,_ZodString:()=>yc,_default:()=>Bf,_function:()=>pw,any:()=>JD,array:()=>ta,base64:()=>TD,base64url:()=>CD,bigint:()=>ZD,boolean:()=>_f,catch:()=>Kf,check:()=>mw,cidrv4:()=>ID,cidrv6:()=>ED,clone:()=>Ce,codec:()=>lw,coerce:()=>Gc,config:()=>ce,core:()=>Tt,cuid:()=>_D,cuid2:()=>xD,custom:()=>fw,date:()=>WD,decode:()=>lc,decodeAsync:()=>dc,discriminatedUnion:()=>QD,e164:()=>AD,email:()=>cD,emoji:()=>yD,encode:()=>uc,encodeAsync:()=>cc,endsWith:()=>Gn,enum:()=>Uc,file:()=>iw,flattenError:()=>Tn,float32:()=>RD,float64:()=>FD,formatError:()=>Cn,function:()=>pw,getErrorMap:()=>xw,globalRegistry:()=>ht,gt:()=>It,gte:()=>Re,guid:()=>dD,hash:()=>zD,hex:()=>ND,hostname:()=>jD,httpUrl:()=>vD,includes:()=>qn,instanceof:()=>gw,int:()=>vc,int32:()=>MD,int64:()=>LD,intersection:()=>Pf,ipv4:()=>$D,ipv6:()=>SD,iso:()=>Wi,json:()=>vw,jwt:()=>PD,keyof:()=>KD,ksuid:()=>kD,lazy:()=>tg,length:()=>Nr,literal:()=>ow,locales:()=>Fn,looseObject:()=>XD,lowercase:()=>Bn,lt:()=>St,lte:()=>Xe,map:()=>tw,maxLength:()=>jr,maxSize:()=>Or,mime:()=>Wn,minLength:()=>Yt,minSize:()=>dr,multipleOf:()=>cr,nan:()=>uw,nanoid:()=>bD,nativeEnum:()=>nw,negative:()=>ql,never:()=>zc,nonnegative:()=>Gl,nonoptional:()=>Jf,nonpositive:()=>Jl,normalize:()=>Kn,null:()=>kf,nullable:()=>Yi,nullish:()=>aw,number:()=>bf,object:()=>HD,optional:()=>Hi,overwrite:()=>Et,parse:()=>ic,parseAsync:()=>ac,partialRecord:()=>ew,pipe:()=>Xi,positive:()=>Vl,prefault:()=>qf,preprocess:()=>yw,prettifyError:()=>ss,promise:()=>dw,property:()=>Wl,readonly:()=>Xf,record:()=>Nf,refine:()=>og,regex:()=>Ln,regexes:()=>Ye,registry:()=>wi,safeDecode:()=>mc,safeDecodeAsync:()=>gc,safeEncode:()=>pc,safeEncodeAsync:()=>fc,safeParse:()=>sc,safeParseAsync:()=>to,set:()=>rw,setErrorMap:()=>_w,size:()=>Zn,startsWith:()=>Jn,strictObject:()=>YD,string:()=>hc,stringFormat:()=>OD,stringbool:()=>hw,success:()=>sw,superRefine:()=>ig,symbol:()=>VD,templateLiteral:()=>cw,toJSONSchema:()=>eo,toLowerCase:()=>Yn,toUpperCase:()=>Xn,transform:()=>Zc,treeifyError:()=>as,trim:()=>Hn,tuple:()=>jf,uint32:()=>UD,uint64:()=>BD,ulid:()=>DD,undefined:()=>qD,union:()=>Fc,unknown:()=>Rr,uppercase:()=>Vn,url:()=>hD,util:()=>E,uuid:()=>pD,uuidv4:()=>mD,uuidv6:()=>fD,uuidv7:()=>gD,void:()=>GD,xid:()=>wD});var Tt={};Bt(Tt,{$ZodAny:()=>Nu,$ZodArray:()=>Uu,$ZodAsyncError:()=>ot,$ZodBase64:()=>$u,$ZodBase64URL:()=>Su,$ZodBigInt:()=>vi,$ZodBigIntFormat:()=>Au,$ZodBoolean:()=>jn,$ZodCIDRv4:()=>Du,$ZodCIDRv6:()=>wu,$ZodCUID:()=>du,$ZodCUID2:()=>pu,$ZodCatch:()=>nl,$ZodCheck:()=>se,$ZodCheckBigIntFormat:()=>Zs,$ZodCheckEndsWith:()=>Qs,$ZodCheckGreaterThan:()=>ci,$ZodCheckIncludes:()=>Ys,$ZodCheckLengthEquals:()=>Gs,$ZodCheckLessThan:()=>li,$ZodCheckLowerCase:()=>Ks,$ZodCheckMaxLength:()=>qs,$ZodCheckMaxSize:()=>Ls,$ZodCheckMimeType:()=>tu,$ZodCheckMinLength:()=>Js,$ZodCheckMinSize:()=>Bs,$ZodCheckMultipleOf:()=>Ms,$ZodCheckNumberFormat:()=>Us,$ZodCheckOverwrite:()=>ru,$ZodCheckProperty:()=>eu,$ZodCheckRegex:()=>Ws,$ZodCheckSizeEquals:()=>Vs,$ZodCheckStartsWith:()=>Xs,$ZodCheckStringFormat:()=>Ar,$ZodCheckUpperCase:()=>Hs,$ZodCodec:()=>Nn,$ZodCustom:()=>dl,$ZodCustomStringFormat:()=>Tu,$ZodDate:()=>Mu,$ZodDefault:()=>Qu,$ZodDiscriminatedUnion:()=>Lu,$ZodE164:()=>Iu,$ZodEmail:()=>su,$ZodEmoji:()=>lu,$ZodEncodeError:()=>qt,$ZodEnum:()=>Gu,$ZodError:()=>En,$ZodFile:()=>Ku,$ZodFunction:()=>ul,$ZodGUID:()=>iu,$ZodIPv4:()=>_u,$ZodIPv6:()=>xu,$ZodISODate:()=>vu,$ZodISODateTime:()=>hu,$ZodISODuration:()=>bu,$ZodISOTime:()=>yu,$ZodIntersection:()=>Bu,$ZodJWT:()=>Eu,$ZodKSUID:()=>gu,$ZodLazy:()=>cl,$ZodLiteral:()=>Wu,$ZodMap:()=>qu,$ZodNaN:()=>ol,$ZodNanoID:()=>cu,$ZodNever:()=>Ru,$ZodNonOptional:()=>tl,$ZodNull:()=>ju,$ZodNullable:()=>Xu,$ZodNumber:()=>hi,$ZodNumberFormat:()=>Cu,$ZodObject:()=>xm,$ZodObjectJIT:()=>Zu,$ZodOptional:()=>Yu,$ZodPipe:()=>il,$ZodPrefault:()=>el,$ZodPromise:()=>ll,$ZodReadonly:()=>al,$ZodRealError:()=>ze,$ZodRecord:()=>Vu,$ZodRegistry:()=>Pr,$ZodSet:()=>Ju,$ZodString:()=>lr,$ZodStringFormat:()=>oe,$ZodSuccess:()=>rl,$ZodSymbol:()=>Pu,$ZodTemplateLiteral:()=>sl,$ZodTransform:()=>Hu,$ZodTuple:()=>bi,$ZodType:()=>V,$ZodULID:()=>mu,$ZodURL:()=>uu,$ZodUUID:()=>au,$ZodUndefined:()=>Ou,$ZodUnion:()=>yi,$ZodUnknown:()=>zu,$ZodVoid:()=>Fu,$ZodXID:()=>fu,$brand:()=>Ko,$constructor:()=>D,$input:()=>ml,$output:()=>pl,Doc:()=>On,JSONSchema:()=>hf,JSONSchemaGenerator:()=>Qn,NEVER:()=>Ha,TimePrecision:()=>hl,_any:()=>Rl,_array:()=>Kl,_base64:()=>Ui,_base64url:()=>Zi,_bigint:()=>Cl,_boolean:()=>El,_catch:()=>tD,_check:()=>gf,_cidrv4:()=>Fi,_cidrv6:()=>Mi,_coercedBigint:()=>Al,_coercedBoolean:()=>Tl,_coercedDate:()=>Ll,_coercedNumber:()=>Dl,_coercedString:()=>gl,_cuid:()=>Ai,_cuid2:()=>Pi,_custom:()=>Yl,_date:()=>Zl,_decode:()=>ti,_decodeAsync:()=>ni,_default:()=>Xx,_discriminatedUnion:()=>Ux,_e164:()=>Li,_email:()=>ki,_emoji:()=>Ti,_encode:()=>ei,_encodeAsync:()=>ri,_endsWith:()=>Gn,_enum:()=>Jx,_file:()=>Hl,_float32:()=>kl,_float64:()=>$l,_gt:()=>It,_gte:()=>Re,_guid:()=>Mn,_includes:()=>qn,_int:()=>wl,_int32:()=>Sl,_int64:()=>Pl,_intersection:()=>Zx,_ipv4:()=>zi,_ipv6:()=>Ri,_isoDate:()=>yl,_isoDateTime:()=>vl,_isoDuration:()=>_l,_isoTime:()=>bl,_jwt:()=>Bi,_ksuid:()=>Ni,_lazy:()=>iD,_length:()=>Nr,_literal:()=>Wx,_lowercase:()=>Bn,_lt:()=>St,_lte:()=>Xe,_map:()=>Vx,_max:()=>Xe,_maxLength:()=>jr,_maxSize:()=>Or,_mime:()=>Wn,_min:()=>Re,_minLength:()=>Yt,_minSize:()=>dr,_multipleOf:()=>cr,_nan:()=>Bl,_nanoid:()=>Ci,_nativeEnum:()=>Gx,_negative:()=>ql,_never:()=>Ml,_nonnegative:()=>Gl,_nonoptional:()=>Qx,_nonpositive:()=>Jl,_normalize:()=>Kn,_null:()=>zl,_nullable:()=>Yx,_number:()=>xl,_optional:()=>Hx,_overwrite:()=>Et,_parse:()=>Ir,_parseAsync:()=>Er,_pipe:()=>rD,_positive:()=>Vl,_promise:()=>aD,_property:()=>Wl,_readonly:()=>nD,_record:()=>Bx,_refine:()=>Xl,_regex:()=>Ln,_safeDecode:()=>ii,_safeDecodeAsync:()=>si,_safeEncode:()=>oi,_safeEncodeAsync:()=>ai,_safeParse:()=>Tr,_safeParseAsync:()=>Cr,_set:()=>qx,_size:()=>Zn,_startsWith:()=>Jn,_string:()=>fl,_stringFormat:()=>zr,_stringbool:()=>ec,_success:()=>eD,_superRefine:()=>Ql,_symbol:()=>jl,_templateLiteral:()=>oD,_toLowerCase:()=>Yn,_toUpperCase:()=>Xn,_transform:()=>Kx,_trim:()=>Hn,_tuple:()=>Lx,_uint32:()=>Il,_uint64:()=>Ol,_ulid:()=>Oi,_undefined:()=>Nl,_union:()=>Mx,_unknown:()=>Fl,_uppercase:()=>Vn,_url:()=>Un,_uuid:()=>$i,_uuidv4:()=>Si,_uuidv6:()=>Ii,_uuidv7:()=>Ei,_void:()=>Ul,_xid:()=>ji,clone:()=>Ce,config:()=>ce,decode:()=>l_,decodeAsync:()=>d_,encode:()=>u_,encodeAsync:()=>c_,flattenError:()=>Tn,formatError:()=>Cn,globalConfig:()=>xn,globalRegistry:()=>ht,isValidBase64:()=>ku,isValidBase64URL:()=>vm,isValidJWT:()=>ym,locales:()=>Fn,parse:()=>Xo,parseAsync:()=>Qo,prettifyError:()=>ss,regexes:()=>Ye,registry:()=>wi,safeDecode:()=>m_,safeDecodeAsync:()=>g_,safeEncode:()=>p_,safeEncodeAsync:()=>f_,safeParse:()=>us,safeParseAsync:()=>ls,toDotPath:()=>em,toJSONSchema:()=>eo,treeifyError:()=>as,util:()=>E,version:()=>nu});var Ha=Object.freeze({status:"aborted"});function D(e,t,n){function o(u,l){var c;Object.defineProperty(u,"_zod",{value:u._zod??{},enumerable:!1}),(c=u._zod).traits??(c.traits=new Set),u._zod.traits.add(e),t(u,l);for(let m in a.prototype)m in u||Object.defineProperty(u,m,{value:a.prototype[m].bind(u)});u._zod.constr=a,u._zod.def=l}let r=n?.Parent??Object;class i extends r{}Object.defineProperty(i,"name",{value:e});function a(u){var l;let c=n?.Parent?new i:this;o(c,u),(l=c._zod).deferred??(l.deferred=[]);for(let m of c._zod.deferred)m();return c}return Object.defineProperty(a,"init",{value:o}),Object.defineProperty(a,Symbol.hasInstance,{value:u=>n?.Parent&&u instanceof n.Parent?!0:u?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}var Ko=Symbol("zod_brand"),ot=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},qt=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},xn={};function ce(e){return e&&Object.assign(xn,e),xn}var E={};Bt(E,{BIGINT_FORMAT_RANGES:()=>is,Class:()=>Xa,NUMBER_FORMAT_RANGES:()=>os,aborted:()=>Ht,allowsEval:()=>es,assert:()=>Ub,assertEqual:()=>zb,assertIs:()=>Fb,assertNever:()=>Mb,assertNotEqual:()=>Rb,assignProp:()=>Gt,base64ToUint8Array:()=>Yp,base64urlToUint8Array:()=>n_,cached:()=>$r,captureStackTrace:()=>Yo,cleanEnum:()=>r_,cleanRegex:()=>kn,clone:()=>Ce,cloneDef:()=>Lb,createTransparentProxy:()=>Wb,defineLazy:()=>W,esc:()=>Ho,escapeRegex:()=>gt,extend:()=>Yb,finalizeIssue:()=>Ve,floatSafeRemainder:()=>Qa,getElementAtPath:()=>Bb,getEnumValues:()=>wn,getLengthableOrigin:()=>In,getParsedType:()=>Gb,getSizableOrigin:()=>Sn,hexToUint8Array:()=>i_,isObject:()=>sr,isPlainObject:()=>Kt,issue:()=>Sr,joinValues:()=>w,jsonStringifyReplacer:()=>kr,merge:()=>Qb,mergeDefs:()=>Wt,normalizeParams:()=>P,nullish:()=>Jt,numKeys:()=>Jb,objectClone:()=>Zb,omit:()=>Hb,optionalKeys:()=>ns,partial:()=>e_,pick:()=>Kb,prefixIssues:()=>Be,primitiveTypes:()=>rs,promiseAllObject:()=>Vb,propertyKeyTypes:()=>$n,randomString:()=>qb,required:()=>t_,safeExtend:()=>Xb,shallowClone:()=>ts,stringifyPrimitive:()=>A,uint8ArrayToBase64:()=>Xp,uint8ArrayToBase64url:()=>o_,uint8ArrayToHex:()=>a_,unwrapMessage:()=>Dn});function zb(e){return e}function Rb(e){return e}function Fb(e){}function Mb(e){throw new Error}function Ub(e){}function wn(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,r])=>t.indexOf(+o)===-1).map(([o,r])=>r)}function w(e,t="|"){return e.map(n=>A(n)).join(t)}function kr(e,t){return typeof t=="bigint"?t.toString():t}function $r(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function Jt(e){return e==null}function kn(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Qa(e,t){let n=(e.toString().split(".")[1]||"").length,o=t.toString(),r=(o.split(".")[1]||"").length;if(r===0&&/\d?e-\d?/.test(o)){let l=o.match(/\d?e-(\d?)/);l?.[1]&&(r=Number.parseInt(l[1]))}let i=n>r?n:r,a=Number.parseInt(e.toFixed(i).replace(".","")),u=Number.parseInt(t.toFixed(i).replace(".",""));return a%u/10**i}var Hp=Symbol("evaluating");function W(e,t,n){let o;Object.defineProperty(e,t,{get(){if(o!==Hp)return o===void 0&&(o=Hp,o=n()),o},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function Zb(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Gt(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Wt(...e){let t={};for(let n of e){let o=Object.getOwnPropertyDescriptors(n);Object.assign(t,o)}return Object.defineProperties({},t)}function Lb(e){return Wt(e._zod.def)}function Bb(e,t){return t?t.reduce((n,o)=>n?.[o],e):e}function Vb(e){let t=Object.keys(e),n=t.map(o=>e[o]);return Promise.all(n).then(o=>{let r={};for(let i=0;i<t.length;i++)r[t[i]]=o[i];return r})}function qb(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let o=0;o<e;o++)n+=t[Math.floor(Math.random()*t.length)];return n}function Ho(e){return JSON.stringify(e)}var Yo="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function sr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var es=$r(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Kt(e){if(sr(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(sr(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function ts(e){return Kt(e)?{...e}:Array.isArray(e)?[...e]:e}function Jb(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var Gb=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},$n=new Set(["string","number","symbol"]),rs=new Set(["string","number","bigint","boolean","symbol","undefined"]);function gt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ce(e,t,n){let o=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(o._zod.parent=e),o}function P(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Wb(e){let t;return new Proxy({},{get(n,o,r){return t??(t=e()),Reflect.get(t,o,r)},set(n,o,r,i){return t??(t=e()),Reflect.set(t,o,r,i)},has(n,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(n,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(n,o,r){return t??(t=e()),Reflect.defineProperty(t,o,r)}})}function A(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function ns(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var os={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},is={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Kb(e,t){let n=e._zod.def,o=Wt(e._zod.def,{get shape(){let r={};for(let i in t){if(!(i in n.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(r[i]=n.shape[i])}return Gt(this,"shape",r),r},checks:[]});return Ce(e,o)}function Hb(e,t){let n=e._zod.def,o=Wt(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let i in t){if(!(i in n.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&delete r[i]}return Gt(this,"shape",r),r},checks:[]});return Ce(e,o)}function Yb(e,t){if(!Kt(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let r=Wt(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return Gt(this,"shape",i),i},checks:[]});return Ce(e,r)}function Xb(e,t){if(!Kt(t))throw new Error("Invalid input to safeExtend: expected a plain object");let n={...e._zod.def,get shape(){let o={...e._zod.def.shape,...t};return Gt(this,"shape",o),o},checks:e._zod.def.checks};return Ce(e,n)}function Qb(e,t){let n=Wt(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return Gt(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:[]});return Ce(e,n)}function e_(e,t,n){let o=Wt(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let a in n){if(!(a in r))throw new Error(`Unrecognized key: "${a}"`);n[a]&&(i[a]=e?new e({type:"optional",innerType:r[a]}):r[a])}else for(let a in r)i[a]=e?new e({type:"optional",innerType:r[a]}):r[a];return Gt(this,"shape",i),i},checks:[]});return Ce(t,o)}function t_(e,t,n){let o=Wt(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let a in n){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);n[a]&&(i[a]=new e({type:"nonoptional",innerType:r[a]}))}else for(let a in r)i[a]=new e({type:"nonoptional",innerType:r[a]});return Gt(this,"shape",i),i},checks:[]});return Ce(t,o)}function Ht(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Be(e,t){return t.map(n=>{var o;return(o=n).path??(o.path=[]),n.path.unshift(e),n})}function Dn(e){return typeof e=="string"?e:e?.message}function Ve(e,t,n){let o={...e,path:e.path??[]};if(!e.message){let r=Dn(e.inst?._zod.def?.error?.(e))??Dn(t?.error?.(e))??Dn(n.customError?.(e))??Dn(n.localeError?.(e))??"Invalid input";o.message=r}return delete o.inst,delete o.continue,t?.reportInput||delete o.input,o}function Sn(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function In(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Sr(...e){let[t,n,o]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:o}:{...t}}function r_(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Yp(e){let t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}function Xp(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function n_(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return Yp(t+n)}function o_(e){return Xp(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function i_(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)n[o/2]=Number.parseInt(t.slice(o,o+2),16);return n}function a_(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Xa=class{constructor(...t){}};var Qp=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,kr,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},En=D("$ZodError",Qp),ze=D("$ZodError",Qp,{Parent:Error});function Tn(e,t=n=>n.message){let n={},o=[];for(let r of e.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(t(r))):o.push(t(r));return{formErrors:o,fieldErrors:n}}function Cn(e,t){let n=t||function(i){return i.message},o={_errors:[]},r=i=>{for(let a of i.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(u=>r({issues:u}));else if(a.code==="invalid_key")r({issues:a.issues});else if(a.code==="invalid_element")r({issues:a.issues});else if(a.path.length===0)o._errors.push(n(a));else{let u=o,l=0;for(;l<a.path.length;){let c=a.path[l];l===a.path.length-1?(u[c]=u[c]||{_errors:[]},u[c]._errors.push(n(a))):u[c]=u[c]||{_errors:[]},u=u[c],l++}}};return r(e),o}function as(e,t){let n=t||function(i){return i.message},o={errors:[]},r=(i,a=[])=>{var u,l;for(let c of i.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(m=>r({issues:m},c.path));else if(c.code==="invalid_key")r({issues:c.issues},c.path);else if(c.code==="invalid_element")r({issues:c.issues},c.path);else{let m=[...a,...c.path];if(m.length===0){o.errors.push(n(c));continue}let h=o,y=0;for(;y<m.length;){let p=m[y],d=y===m.length-1;typeof p=="string"?(h.properties??(h.properties={}),(u=h.properties)[p]??(u[p]={errors:[]}),h=h.properties[p]):(h.items??(h.items=[]),(l=h.items)[p]??(l[p]={errors:[]}),h=h.items[p]),d&&h.errors.push(n(c)),y++}}};return r(e),o}function em(e){let t=[],n=e.map(o=>typeof o=="object"?o.key:o);for(let o of n)typeof o=="number"?t.push(`[${o}]`):typeof o=="symbol"?t.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push("."),t.push(o));return t.join("")}function ss(e){let t=[],n=[...e.issues].sort((o,r)=>(o.path??[]).length-(r.path??[]).length);for(let o of n)t.push(`\u2716 ${o.message}`),o.path?.length&&t.push(` \u2192 at ${em(o.path)}`);return t.join(`
|
|
15
|
-
`)}var Ir=e=>(t,n,o,r)=>{let i=o?Object.assign(o,{async:!1}):{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new ot;if(a.issues.length){let u=new(r?.Err??e)(a.issues.map(l=>Ve(l,i,ce())));throw Yo(u,r?.callee),u}return a.value},Xo=Ir(ze),Er=e=>async(t,n,o,r)=>{let i=o?Object.assign(o,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){let u=new(r?.Err??e)(a.issues.map(l=>Ve(l,i,ce())));throw Yo(u,r?.callee),u}return a.value},Qo=Er(ze),Tr=e=>(t,n,o)=>{let r=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},r);if(i instanceof Promise)throw new ot;return i.issues.length?{success:!1,error:new(e??En)(i.issues.map(a=>Ve(a,r,ce())))}:{success:!0,data:i.value}},us=Tr(ze),Cr=e=>async(t,n,o)=>{let r=o?Object.assign(o,{async:!0}):{async:!0},i=t._zod.run({value:n,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(a=>Ve(a,r,ce())))}:{success:!0,data:i.value}},ls=Cr(ze),ei=e=>(t,n,o)=>{let r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Ir(e)(t,n,r)},u_=ei(ze),ti=e=>(t,n,o)=>Ir(e)(t,n,o),l_=ti(ze),ri=e=>async(t,n,o)=>{let r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Er(e)(t,n,r)},c_=ri(ze),ni=e=>async(t,n,o)=>Er(e)(t,n,o),d_=ni(ze),oi=e=>(t,n,o)=>{let r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Tr(e)(t,n,r)},p_=oi(ze),ii=e=>(t,n,o)=>Tr(e)(t,n,o),m_=ii(ze),ai=e=>async(t,n,o)=>{let r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Cr(e)(t,n,r)},f_=ai(ze),si=e=>async(t,n,o)=>Cr(e)(t,n,o),g_=si(ze);var Ye={};Bt(Ye,{base64:()=>ks,base64url:()=>ui,bigint:()=>As,boolean:()=>js,browserEmail:()=>w_,cidrv4:()=>Ds,cidrv6:()=>ws,cuid:()=>cs,cuid2:()=>ds,date:()=>Is,datetime:()=>Ts,domain:()=>$_,duration:()=>hs,e164:()=>Ss,email:()=>ys,emoji:()=>bs,extendedDuration:()=>h_,guid:()=>vs,hex:()=>S_,hostname:()=>$s,html5Email:()=>__,idnEmail:()=>D_,integer:()=>Ps,ipv4:()=>_s,ipv6:()=>xs,ksuid:()=>fs,lowercase:()=>Rs,md5_base64:()=>E_,md5_base64url:()=>T_,md5_hex:()=>I_,nanoid:()=>gs,null:()=>Ns,number:()=>Os,rfc5322Email:()=>x_,sha1_base64:()=>A_,sha1_base64url:()=>P_,sha1_hex:()=>C_,sha256_base64:()=>j_,sha256_base64url:()=>N_,sha256_hex:()=>O_,sha384_base64:()=>R_,sha384_base64url:()=>F_,sha384_hex:()=>z_,sha512_base64:()=>U_,sha512_base64url:()=>Z_,sha512_hex:()=>M_,string:()=>Cs,time:()=>Es,ulid:()=>ps,undefined:()=>zs,unicodeEmail:()=>tm,uppercase:()=>Fs,uuid:()=>ur,uuid4:()=>v_,uuid6:()=>y_,uuid7:()=>b_,xid:()=>ms});var cs=/^[cC][^\s-]{8,}$/,ds=/^[0-9a-z]+$/,ps=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ms=/^[0-9a-vA-V]{20}$/,fs=/^[A-Za-z0-9]{27}$/,gs=/^[a-zA-Z0-9_-]{21}$/,hs=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,h_=/^[-+]?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)?)??$/,vs=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ur=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,v_=ur(4),y_=ur(6),b_=ur(7),ys=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,__=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,x_=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,tm=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,D_=tm,w_=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,k_="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function bs(){return new RegExp(k_,"u")}var _s=/^(?:(?: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])$/,xs=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Ds=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,ws=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ks=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ui=/^[A-Za-z0-9_-]*$/,$s=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,$_=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Ss=/^\+(?:[0-9]){6,14}[0-9]$/,rm="(?:(?:\\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])))",Is=new RegExp(`^${rm}$`);function nm(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Es(e){return new RegExp(`^${nm(e)}$`)}function Ts(e){let t=nm({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${n.join("|")})`;return new RegExp(`^${rm}T(?:${o})$`)}var Cs=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},As=/^-?\d+n?$/,Ps=/^-?\d+$/,Os=/^-?\d+(?:\.\d+)?/,js=/^(?:true|false)$/i,Ns=/^null$/i;var zs=/^undefined$/i;var Rs=/^[^A-Z]*$/,Fs=/^[^a-z]*$/,S_=/^[0-9a-fA-F]*$/;function An(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Pn(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var I_=/^[0-9a-fA-F]{32}$/,E_=An(22,"=="),T_=Pn(22),C_=/^[0-9a-fA-F]{40}$/,A_=An(27,"="),P_=Pn(27),O_=/^[0-9a-fA-F]{64}$/,j_=An(43,"="),N_=Pn(43),z_=/^[0-9a-fA-F]{96}$/,R_=An(64,""),F_=Pn(64),M_=/^[0-9a-fA-F]{128}$/,U_=An(86,"=="),Z_=Pn(86);var se=D("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),im={number:"number",bigint:"bigint",object:"date"},li=D("$ZodCheckLessThan",(e,t)=>{se.init(e,t);let n=im[typeof t.value];e._zod.onattach.push(o=>{let r=o._zod.bag,i=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:n,code:"too_big",maximum:t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ci=D("$ZodCheckGreaterThan",(e,t)=>{se.init(e,t);let n=im[typeof t.value];e._zod.onattach.push(o=>{let r=o._zod.bag,i=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:n,code:"too_small",minimum:t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ms=D("$ZodCheckMultipleOf",(e,t)=>{se.init(e,t),e._zod.onattach.push(n=>{var o;(o=n._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):Qa(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Us=D("$ZodCheckNumberFormat",(e,t)=>{se.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),o=n?"int":"number",[r,i]=os[t.format];e._zod.onattach.push(a=>{let u=a._zod.bag;u.format=t.format,u.minimum=r,u.maximum=i,n&&(u.pattern=Ps)}),e._zod.check=a=>{let u=a.value;if(n){if(!Number.isInteger(u)){a.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:u,inst:e});return}if(!Number.isSafeInteger(u)){u>0?a.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort}):a.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort});return}}u<r&&a.issues.push({origin:"number",input:u,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),u>i&&a.issues.push({origin:"number",input:u,code:"too_big",maximum:i,inst:e})}}),Zs=D("$ZodCheckBigIntFormat",(e,t)=>{se.init(e,t);let[n,o]=is[t.format];e._zod.onattach.push(r=>{let i=r._zod.bag;i.format=t.format,i.minimum=n,i.maximum=o}),e._zod.check=r=>{let i=r.value;i<n&&r.issues.push({origin:"bigint",input:i,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),i>o&&r.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inst:e})}}),Ls=D("$ZodCheckMaxSize",(e,t)=>{var n;se.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!Jt(r)&&r.size!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let r=o.value;r.size<=t.maximum||o.issues.push({origin:Sn(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Bs=D("$ZodCheckMinSize",(e,t)=>{var n;se.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!Jt(r)&&r.size!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let r=o.value;r.size>=t.minimum||o.issues.push({origin:Sn(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Vs=D("$ZodCheckSizeEquals",(e,t)=>{var n;se.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!Jt(r)&&r.size!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag;r.minimum=t.size,r.maximum=t.size,r.size=t.size}),e._zod.check=o=>{let r=o.value,i=r.size;if(i===t.size)return;let a=i>t.size;o.issues.push({origin:Sn(r),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),qs=D("$ZodCheckMaxLength",(e,t)=>{var n;se.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!Jt(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let r=o.value;if(r.length<=t.maximum)return;let a=In(r);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Js=D("$ZodCheckMinLength",(e,t)=>{var n;se.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!Jt(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let r=o.value;if(r.length>=t.minimum)return;let a=In(r);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Gs=D("$ZodCheckLengthEquals",(e,t)=>{var n;se.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!Jt(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=o=>{let r=o.value,i=r.length;if(i===t.length)return;let a=In(r),u=i>t.length;o.issues.push({origin:a,...u?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Ar=D("$ZodCheckStringFormat",(e,t)=>{var n,o;se.init(e,t),e._zod.onattach.push(r=>{let i=r._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),Ws=D("$ZodCheckRegex",(e,t)=>{Ar.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ks=D("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Rs),Ar.init(e,t)}),Hs=D("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Fs),Ar.init(e,t)}),Ys=D("$ZodCheckIncludes",(e,t)=>{se.init(e,t);let n=gt(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=o,e._zod.onattach.push(r=>{let i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),Xs=D("$ZodCheckStartsWith",(e,t)=>{se.init(e,t);let n=new RegExp(`^${gt(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(o=>{let r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Qs=D("$ZodCheckEndsWith",(e,t)=>{se.init(e,t);let n=new RegExp(`.*${gt(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(o=>{let r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});function om(e,t,n){e.issues.length&&t.issues.push(...Be(n,e.issues))}var eu=D("$ZodCheckProperty",(e,t)=>{se.init(e,t),e._zod.check=n=>{let o=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then(r=>om(r,n,t.property));om(o,n,t.property)}}),tu=D("$ZodCheckMimeType",(e,t)=>{se.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=t.mime}),e._zod.check=o=>{n.has(o.value.type)||o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),ru=D("$ZodCheckOverwrite",(e,t)=>{se.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});var On=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
|
|
14
|
+
`&&o++}}return[t,n]}var Wo=class extends TransformStream{constructor({onError:t,onRetry:n,onComment:o}={}){let r;super({start(i){r=Kp({onEvent:a=>{i.enqueue(a)},onError(a){t==="terminate"?i.error(a):typeof t=="function"&&t(a)},onRetry:n,onComment:o})},transform(i){r.feed(i)}})}};var s={};Bt(s,{$brand:()=>Ko,$input:()=>ml,$output:()=>pl,NEVER:()=>Ha,TimePrecision:()=>hl,ZodAny:()=>$f,ZodArray:()=>Tf,ZodBase64:()=>Ac,ZodBase64URL:()=>Pc,ZodBigInt:()=>so,ZodBigIntFormat:()=>Nc,ZodBoolean:()=>ao,ZodCIDRv4:()=>Tc,ZodCIDRv6:()=>Cc,ZodCUID:()=>Dc,ZodCUID2:()=>wc,ZodCatch:()=>Wf,ZodCodec:()=>Vc,ZodCustom:()=>na,ZodCustomStringFormat:()=>oo,ZodDate:()=>ea,ZodDefault:()=>Lf,ZodDiscriminatedUnion:()=>Cf,ZodE164:()=>Oc,ZodEmail:()=>bc,ZodEmoji:()=>_c,ZodEnum:()=>ro,ZodError:()=>uD,ZodFile:()=>Mf,ZodFirstPartyTypeKind:()=>Jc,ZodFunction:()=>ng,ZodGUID:()=>Ki,ZodIPv4:()=>Ic,ZodIPv6:()=>Ec,ZodISODate:()=>Vi,ZodISODateTime:()=>qi,ZodISODuration:()=>Gi,ZodISOTime:()=>Ji,ZodIntersection:()=>Af,ZodIssueCode:()=>bw,ZodJWT:()=>jc,ZodKSUID:()=>Sc,ZodLazy:()=>eg,ZodLiteral:()=>Ff,ZodMap:()=>zf,ZodNaN:()=>Hf,ZodNanoID:()=>xc,ZodNever:()=>If,ZodNonOptional:()=>Bc,ZodNull:()=>wf,ZodNullable:()=>Zf,ZodNumber:()=>io,ZodNumberFormat:()=>Fr,ZodObject:()=>ra,ZodOptional:()=>Lc,ZodPipe:()=>qc,ZodPrefault:()=>qf,ZodPromise:()=>rg,ZodReadonly:()=>Yf,ZodRealError:()=>Fe,ZodRecord:()=>Mc,ZodSet:()=>Rf,ZodString:()=>no,ZodStringFormat:()=>ae,ZodSuccess:()=>Gf,ZodSymbol:()=>xf,ZodTemplateLiteral:()=>Qf,ZodTransform:()=>Uf,ZodTuple:()=>Of,ZodType:()=>J,ZodULID:()=>kc,ZodURL:()=>Qi,ZodUUID:()=>Ct,ZodUndefined:()=>Df,ZodUnion:()=>Rc,ZodUnknown:()=>Sf,ZodVoid:()=>Ef,ZodXID:()=>$c,_ZodString:()=>yc,_default:()=>Bf,_function:()=>pw,any:()=>JD,array:()=>ta,base64:()=>TD,base64url:()=>CD,bigint:()=>ZD,boolean:()=>_f,catch:()=>Kf,check:()=>mw,cidrv4:()=>ID,cidrv6:()=>ED,clone:()=>Ce,codec:()=>lw,coerce:()=>Gc,config:()=>ce,core:()=>Tt,cuid:()=>_D,cuid2:()=>xD,custom:()=>fw,date:()=>WD,decode:()=>lc,decodeAsync:()=>dc,discriminatedUnion:()=>QD,e164:()=>AD,email:()=>cD,emoji:()=>yD,encode:()=>uc,encodeAsync:()=>cc,endsWith:()=>Gn,enum:()=>Uc,file:()=>iw,flattenError:()=>Tn,float32:()=>RD,float64:()=>FD,formatError:()=>Cn,function:()=>pw,getErrorMap:()=>xw,globalRegistry:()=>ht,gt:()=>It,gte:()=>Re,guid:()=>dD,hash:()=>zD,hex:()=>ND,hostname:()=>jD,httpUrl:()=>vD,includes:()=>Vn,instanceof:()=>gw,int:()=>vc,int32:()=>MD,int64:()=>LD,intersection:()=>Pf,ipv4:()=>$D,ipv6:()=>SD,iso:()=>Wi,json:()=>vw,jwt:()=>PD,keyof:()=>KD,ksuid:()=>kD,lazy:()=>tg,length:()=>Nr,literal:()=>ow,locales:()=>Fn,looseObject:()=>XD,lowercase:()=>Bn,lt:()=>St,lte:()=>Xe,map:()=>tw,maxLength:()=>jr,maxSize:()=>Or,mime:()=>Wn,minLength:()=>Yt,minSize:()=>dr,multipleOf:()=>cr,nan:()=>uw,nanoid:()=>bD,nativeEnum:()=>nw,negative:()=>Vl,never:()=>zc,nonnegative:()=>Gl,nonoptional:()=>Jf,nonpositive:()=>Jl,normalize:()=>Kn,null:()=>kf,nullable:()=>Yi,nullish:()=>aw,number:()=>bf,object:()=>HD,optional:()=>Hi,overwrite:()=>Et,parse:()=>ic,parseAsync:()=>ac,partialRecord:()=>ew,pipe:()=>Xi,positive:()=>ql,prefault:()=>Vf,preprocess:()=>yw,prettifyError:()=>ss,promise:()=>dw,property:()=>Wl,readonly:()=>Xf,record:()=>Nf,refine:()=>og,regex:()=>Ln,regexes:()=>Ye,registry:()=>wi,safeDecode:()=>mc,safeDecodeAsync:()=>gc,safeEncode:()=>pc,safeEncodeAsync:()=>fc,safeParse:()=>sc,safeParseAsync:()=>to,set:()=>rw,setErrorMap:()=>_w,size:()=>Zn,startsWith:()=>Jn,strictObject:()=>YD,string:()=>hc,stringFormat:()=>OD,stringbool:()=>hw,success:()=>sw,superRefine:()=>ig,symbol:()=>qD,templateLiteral:()=>cw,toJSONSchema:()=>eo,toLowerCase:()=>Yn,toUpperCase:()=>Xn,transform:()=>Zc,treeifyError:()=>as,trim:()=>Hn,tuple:()=>jf,uint32:()=>UD,uint64:()=>BD,ulid:()=>DD,undefined:()=>VD,union:()=>Fc,unknown:()=>Rr,uppercase:()=>qn,url:()=>hD,util:()=>E,uuid:()=>pD,uuidv4:()=>mD,uuidv6:()=>fD,uuidv7:()=>gD,void:()=>GD,xid:()=>wD});var Tt={};Bt(Tt,{$ZodAny:()=>Nu,$ZodArray:()=>Uu,$ZodAsyncError:()=>ot,$ZodBase64:()=>$u,$ZodBase64URL:()=>Su,$ZodBigInt:()=>vi,$ZodBigIntFormat:()=>Au,$ZodBoolean:()=>jn,$ZodCIDRv4:()=>Du,$ZodCIDRv6:()=>wu,$ZodCUID:()=>du,$ZodCUID2:()=>pu,$ZodCatch:()=>nl,$ZodCheck:()=>se,$ZodCheckBigIntFormat:()=>Zs,$ZodCheckEndsWith:()=>Qs,$ZodCheckGreaterThan:()=>ci,$ZodCheckIncludes:()=>Ys,$ZodCheckLengthEquals:()=>Gs,$ZodCheckLessThan:()=>li,$ZodCheckLowerCase:()=>Ks,$ZodCheckMaxLength:()=>Vs,$ZodCheckMaxSize:()=>Ls,$ZodCheckMimeType:()=>tu,$ZodCheckMinLength:()=>Js,$ZodCheckMinSize:()=>Bs,$ZodCheckMultipleOf:()=>Ms,$ZodCheckNumberFormat:()=>Us,$ZodCheckOverwrite:()=>ru,$ZodCheckProperty:()=>eu,$ZodCheckRegex:()=>Ws,$ZodCheckSizeEquals:()=>qs,$ZodCheckStartsWith:()=>Xs,$ZodCheckStringFormat:()=>Ar,$ZodCheckUpperCase:()=>Hs,$ZodCodec:()=>Nn,$ZodCustom:()=>dl,$ZodCustomStringFormat:()=>Tu,$ZodDate:()=>Mu,$ZodDefault:()=>Qu,$ZodDiscriminatedUnion:()=>Lu,$ZodE164:()=>Iu,$ZodEmail:()=>su,$ZodEmoji:()=>lu,$ZodEncodeError:()=>Vt,$ZodEnum:()=>Gu,$ZodError:()=>En,$ZodFile:()=>Ku,$ZodFunction:()=>ul,$ZodGUID:()=>iu,$ZodIPv4:()=>_u,$ZodIPv6:()=>xu,$ZodISODate:()=>vu,$ZodISODateTime:()=>hu,$ZodISODuration:()=>bu,$ZodISOTime:()=>yu,$ZodIntersection:()=>Bu,$ZodJWT:()=>Eu,$ZodKSUID:()=>gu,$ZodLazy:()=>cl,$ZodLiteral:()=>Wu,$ZodMap:()=>Vu,$ZodNaN:()=>ol,$ZodNanoID:()=>cu,$ZodNever:()=>Ru,$ZodNonOptional:()=>tl,$ZodNull:()=>ju,$ZodNullable:()=>Xu,$ZodNumber:()=>hi,$ZodNumberFormat:()=>Cu,$ZodObject:()=>xm,$ZodObjectJIT:()=>Zu,$ZodOptional:()=>Yu,$ZodPipe:()=>il,$ZodPrefault:()=>el,$ZodPromise:()=>ll,$ZodReadonly:()=>al,$ZodRealError:()=>ze,$ZodRecord:()=>qu,$ZodRegistry:()=>Pr,$ZodSet:()=>Ju,$ZodString:()=>lr,$ZodStringFormat:()=>oe,$ZodSuccess:()=>rl,$ZodSymbol:()=>Pu,$ZodTemplateLiteral:()=>sl,$ZodTransform:()=>Hu,$ZodTuple:()=>bi,$ZodType:()=>q,$ZodULID:()=>mu,$ZodURL:()=>uu,$ZodUUID:()=>au,$ZodUndefined:()=>Ou,$ZodUnion:()=>yi,$ZodUnknown:()=>zu,$ZodVoid:()=>Fu,$ZodXID:()=>fu,$brand:()=>Ko,$constructor:()=>D,$input:()=>ml,$output:()=>pl,Doc:()=>On,JSONSchema:()=>hf,JSONSchemaGenerator:()=>Qn,NEVER:()=>Ha,TimePrecision:()=>hl,_any:()=>Rl,_array:()=>Kl,_base64:()=>Ui,_base64url:()=>Zi,_bigint:()=>Cl,_boolean:()=>El,_catch:()=>tD,_check:()=>gf,_cidrv4:()=>Fi,_cidrv6:()=>Mi,_coercedBigint:()=>Al,_coercedBoolean:()=>Tl,_coercedDate:()=>Ll,_coercedNumber:()=>Dl,_coercedString:()=>gl,_cuid:()=>Ai,_cuid2:()=>Pi,_custom:()=>Yl,_date:()=>Zl,_decode:()=>ti,_decodeAsync:()=>ni,_default:()=>Xx,_discriminatedUnion:()=>Ux,_e164:()=>Li,_email:()=>ki,_emoji:()=>Ti,_encode:()=>ei,_encodeAsync:()=>ri,_endsWith:()=>Gn,_enum:()=>Jx,_file:()=>Hl,_float32:()=>kl,_float64:()=>$l,_gt:()=>It,_gte:()=>Re,_guid:()=>Mn,_includes:()=>Vn,_int:()=>wl,_int32:()=>Sl,_int64:()=>Pl,_intersection:()=>Zx,_ipv4:()=>zi,_ipv6:()=>Ri,_isoDate:()=>yl,_isoDateTime:()=>vl,_isoDuration:()=>_l,_isoTime:()=>bl,_jwt:()=>Bi,_ksuid:()=>Ni,_lazy:()=>iD,_length:()=>Nr,_literal:()=>Wx,_lowercase:()=>Bn,_lt:()=>St,_lte:()=>Xe,_map:()=>qx,_max:()=>Xe,_maxLength:()=>jr,_maxSize:()=>Or,_mime:()=>Wn,_min:()=>Re,_minLength:()=>Yt,_minSize:()=>dr,_multipleOf:()=>cr,_nan:()=>Bl,_nanoid:()=>Ci,_nativeEnum:()=>Gx,_negative:()=>Vl,_never:()=>Ml,_nonnegative:()=>Gl,_nonoptional:()=>Qx,_nonpositive:()=>Jl,_normalize:()=>Kn,_null:()=>zl,_nullable:()=>Yx,_number:()=>xl,_optional:()=>Hx,_overwrite:()=>Et,_parse:()=>Ir,_parseAsync:()=>Er,_pipe:()=>rD,_positive:()=>ql,_promise:()=>aD,_property:()=>Wl,_readonly:()=>nD,_record:()=>Bx,_refine:()=>Xl,_regex:()=>Ln,_safeDecode:()=>ii,_safeDecodeAsync:()=>si,_safeEncode:()=>oi,_safeEncodeAsync:()=>ai,_safeParse:()=>Tr,_safeParseAsync:()=>Cr,_set:()=>Vx,_size:()=>Zn,_startsWith:()=>Jn,_string:()=>fl,_stringFormat:()=>zr,_stringbool:()=>ec,_success:()=>eD,_superRefine:()=>Ql,_symbol:()=>jl,_templateLiteral:()=>oD,_toLowerCase:()=>Yn,_toUpperCase:()=>Xn,_transform:()=>Kx,_trim:()=>Hn,_tuple:()=>Lx,_uint32:()=>Il,_uint64:()=>Ol,_ulid:()=>Oi,_undefined:()=>Nl,_union:()=>Mx,_unknown:()=>Fl,_uppercase:()=>qn,_url:()=>Un,_uuid:()=>$i,_uuidv4:()=>Si,_uuidv6:()=>Ii,_uuidv7:()=>Ei,_void:()=>Ul,_xid:()=>ji,clone:()=>Ce,config:()=>ce,decode:()=>l_,decodeAsync:()=>d_,encode:()=>u_,encodeAsync:()=>c_,flattenError:()=>Tn,formatError:()=>Cn,globalConfig:()=>xn,globalRegistry:()=>ht,isValidBase64:()=>ku,isValidBase64URL:()=>vm,isValidJWT:()=>ym,locales:()=>Fn,parse:()=>Xo,parseAsync:()=>Qo,prettifyError:()=>ss,regexes:()=>Ye,registry:()=>wi,safeDecode:()=>m_,safeDecodeAsync:()=>g_,safeEncode:()=>p_,safeEncodeAsync:()=>f_,safeParse:()=>us,safeParseAsync:()=>ls,toDotPath:()=>em,toJSONSchema:()=>eo,treeifyError:()=>as,util:()=>E,version:()=>nu});var Ha=Object.freeze({status:"aborted"});function D(e,t,n){function o(u,l){var c;Object.defineProperty(u,"_zod",{value:u._zod??{},enumerable:!1}),(c=u._zod).traits??(c.traits=new Set),u._zod.traits.add(e),t(u,l);for(let m in a.prototype)m in u||Object.defineProperty(u,m,{value:a.prototype[m].bind(u)});u._zod.constr=a,u._zod.def=l}let r=n?.Parent??Object;class i extends r{}Object.defineProperty(i,"name",{value:e});function a(u){var l;let c=n?.Parent?new i:this;o(c,u),(l=c._zod).deferred??(l.deferred=[]);for(let m of c._zod.deferred)m();return c}return Object.defineProperty(a,"init",{value:o}),Object.defineProperty(a,Symbol.hasInstance,{value:u=>n?.Parent&&u instanceof n.Parent?!0:u?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}var Ko=Symbol("zod_brand"),ot=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Vt=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},xn={};function ce(e){return e&&Object.assign(xn,e),xn}var E={};Bt(E,{BIGINT_FORMAT_RANGES:()=>is,Class:()=>Xa,NUMBER_FORMAT_RANGES:()=>os,aborted:()=>Ht,allowsEval:()=>es,assert:()=>Ub,assertEqual:()=>zb,assertIs:()=>Fb,assertNever:()=>Mb,assertNotEqual:()=>Rb,assignProp:()=>Gt,base64ToUint8Array:()=>Yp,base64urlToUint8Array:()=>n_,cached:()=>$r,captureStackTrace:()=>Yo,cleanEnum:()=>r_,cleanRegex:()=>kn,clone:()=>Ce,cloneDef:()=>Lb,createTransparentProxy:()=>Wb,defineLazy:()=>W,esc:()=>Ho,escapeRegex:()=>gt,extend:()=>Yb,finalizeIssue:()=>qe,floatSafeRemainder:()=>Qa,getElementAtPath:()=>Bb,getEnumValues:()=>wn,getLengthableOrigin:()=>In,getParsedType:()=>Gb,getSizableOrigin:()=>Sn,hexToUint8Array:()=>i_,isObject:()=>sr,isPlainObject:()=>Kt,issue:()=>Sr,joinValues:()=>w,jsonStringifyReplacer:()=>kr,merge:()=>Qb,mergeDefs:()=>Wt,normalizeParams:()=>P,nullish:()=>Jt,numKeys:()=>Jb,objectClone:()=>Zb,omit:()=>Hb,optionalKeys:()=>ns,partial:()=>e_,pick:()=>Kb,prefixIssues:()=>Be,primitiveTypes:()=>rs,promiseAllObject:()=>qb,propertyKeyTypes:()=>$n,randomString:()=>Vb,required:()=>t_,safeExtend:()=>Xb,shallowClone:()=>ts,stringifyPrimitive:()=>A,uint8ArrayToBase64:()=>Xp,uint8ArrayToBase64url:()=>o_,uint8ArrayToHex:()=>a_,unwrapMessage:()=>Dn});function zb(e){return e}function Rb(e){return e}function Fb(e){}function Mb(e){throw new Error}function Ub(e){}function wn(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,r])=>t.indexOf(+o)===-1).map(([o,r])=>r)}function w(e,t="|"){return e.map(n=>A(n)).join(t)}function kr(e,t){return typeof t=="bigint"?t.toString():t}function $r(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function Jt(e){return e==null}function kn(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Qa(e,t){let n=(e.toString().split(".")[1]||"").length,o=t.toString(),r=(o.split(".")[1]||"").length;if(r===0&&/\d?e-\d?/.test(o)){let l=o.match(/\d?e-(\d?)/);l?.[1]&&(r=Number.parseInt(l[1]))}let i=n>r?n:r,a=Number.parseInt(e.toFixed(i).replace(".","")),u=Number.parseInt(t.toFixed(i).replace(".",""));return a%u/10**i}var Hp=Symbol("evaluating");function W(e,t,n){let o;Object.defineProperty(e,t,{get(){if(o!==Hp)return o===void 0&&(o=Hp,o=n()),o},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function Zb(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Gt(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Wt(...e){let t={};for(let n of e){let o=Object.getOwnPropertyDescriptors(n);Object.assign(t,o)}return Object.defineProperties({},t)}function Lb(e){return Wt(e._zod.def)}function Bb(e,t){return t?t.reduce((n,o)=>n?.[o],e):e}function qb(e){let t=Object.keys(e),n=t.map(o=>e[o]);return Promise.all(n).then(o=>{let r={};for(let i=0;i<t.length;i++)r[t[i]]=o[i];return r})}function Vb(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let o=0;o<e;o++)n+=t[Math.floor(Math.random()*t.length)];return n}function Ho(e){return JSON.stringify(e)}var Yo="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function sr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var es=$r(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Kt(e){if(sr(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(sr(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function ts(e){return Kt(e)?{...e}:Array.isArray(e)?[...e]:e}function Jb(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var Gb=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},$n=new Set(["string","number","symbol"]),rs=new Set(["string","number","bigint","boolean","symbol","undefined"]);function gt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ce(e,t,n){let o=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(o._zod.parent=e),o}function P(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Wb(e){let t;return new Proxy({},{get(n,o,r){return t??(t=e()),Reflect.get(t,o,r)},set(n,o,r,i){return t??(t=e()),Reflect.set(t,o,r,i)},has(n,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(n,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(n,o,r){return t??(t=e()),Reflect.defineProperty(t,o,r)}})}function A(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function ns(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var os={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},is={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Kb(e,t){let n=e._zod.def,o=Wt(e._zod.def,{get shape(){let r={};for(let i in t){if(!(i in n.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(r[i]=n.shape[i])}return Gt(this,"shape",r),r},checks:[]});return Ce(e,o)}function Hb(e,t){let n=e._zod.def,o=Wt(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let i in t){if(!(i in n.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&delete r[i]}return Gt(this,"shape",r),r},checks:[]});return Ce(e,o)}function Yb(e,t){if(!Kt(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let r=Wt(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return Gt(this,"shape",i),i},checks:[]});return Ce(e,r)}function Xb(e,t){if(!Kt(t))throw new Error("Invalid input to safeExtend: expected a plain object");let n={...e._zod.def,get shape(){let o={...e._zod.def.shape,...t};return Gt(this,"shape",o),o},checks:e._zod.def.checks};return Ce(e,n)}function Qb(e,t){let n=Wt(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return Gt(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:[]});return Ce(e,n)}function e_(e,t,n){let o=Wt(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let a in n){if(!(a in r))throw new Error(`Unrecognized key: "${a}"`);n[a]&&(i[a]=e?new e({type:"optional",innerType:r[a]}):r[a])}else for(let a in r)i[a]=e?new e({type:"optional",innerType:r[a]}):r[a];return Gt(this,"shape",i),i},checks:[]});return Ce(t,o)}function t_(e,t,n){let o=Wt(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let a in n){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);n[a]&&(i[a]=new e({type:"nonoptional",innerType:r[a]}))}else for(let a in r)i[a]=new e({type:"nonoptional",innerType:r[a]});return Gt(this,"shape",i),i},checks:[]});return Ce(t,o)}function Ht(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Be(e,t){return t.map(n=>{var o;return(o=n).path??(o.path=[]),n.path.unshift(e),n})}function Dn(e){return typeof e=="string"?e:e?.message}function qe(e,t,n){let o={...e,path:e.path??[]};if(!e.message){let r=Dn(e.inst?._zod.def?.error?.(e))??Dn(t?.error?.(e))??Dn(n.customError?.(e))??Dn(n.localeError?.(e))??"Invalid input";o.message=r}return delete o.inst,delete o.continue,t?.reportInput||delete o.input,o}function Sn(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function In(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Sr(...e){let[t,n,o]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:o}:{...t}}function r_(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Yp(e){let t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}function Xp(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function n_(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return Yp(t+n)}function o_(e){return Xp(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function i_(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)n[o/2]=Number.parseInt(t.slice(o,o+2),16);return n}function a_(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Xa=class{constructor(...t){}};var Qp=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,kr,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},En=D("$ZodError",Qp),ze=D("$ZodError",Qp,{Parent:Error});function Tn(e,t=n=>n.message){let n={},o=[];for(let r of e.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(t(r))):o.push(t(r));return{formErrors:o,fieldErrors:n}}function Cn(e,t){let n=t||function(i){return i.message},o={_errors:[]},r=i=>{for(let a of i.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(u=>r({issues:u}));else if(a.code==="invalid_key")r({issues:a.issues});else if(a.code==="invalid_element")r({issues:a.issues});else if(a.path.length===0)o._errors.push(n(a));else{let u=o,l=0;for(;l<a.path.length;){let c=a.path[l];l===a.path.length-1?(u[c]=u[c]||{_errors:[]},u[c]._errors.push(n(a))):u[c]=u[c]||{_errors:[]},u=u[c],l++}}};return r(e),o}function as(e,t){let n=t||function(i){return i.message},o={errors:[]},r=(i,a=[])=>{var u,l;for(let c of i.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(m=>r({issues:m},c.path));else if(c.code==="invalid_key")r({issues:c.issues},c.path);else if(c.code==="invalid_element")r({issues:c.issues},c.path);else{let m=[...a,...c.path];if(m.length===0){o.errors.push(n(c));continue}let h=o,y=0;for(;y<m.length;){let p=m[y],d=y===m.length-1;typeof p=="string"?(h.properties??(h.properties={}),(u=h.properties)[p]??(u[p]={errors:[]}),h=h.properties[p]):(h.items??(h.items=[]),(l=h.items)[p]??(l[p]={errors:[]}),h=h.items[p]),d&&h.errors.push(n(c)),y++}}};return r(e),o}function em(e){let t=[],n=e.map(o=>typeof o=="object"?o.key:o);for(let o of n)typeof o=="number"?t.push(`[${o}]`):typeof o=="symbol"?t.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push("."),t.push(o));return t.join("")}function ss(e){let t=[],n=[...e.issues].sort((o,r)=>(o.path??[]).length-(r.path??[]).length);for(let o of n)t.push(`\u2716 ${o.message}`),o.path?.length&&t.push(` \u2192 at ${em(o.path)}`);return t.join(`
|
|
15
|
+
`)}var Ir=e=>(t,n,o,r)=>{let i=o?Object.assign(o,{async:!1}):{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new ot;if(a.issues.length){let u=new(r?.Err??e)(a.issues.map(l=>qe(l,i,ce())));throw Yo(u,r?.callee),u}return a.value},Xo=Ir(ze),Er=e=>async(t,n,o,r)=>{let i=o?Object.assign(o,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){let u=new(r?.Err??e)(a.issues.map(l=>qe(l,i,ce())));throw Yo(u,r?.callee),u}return a.value},Qo=Er(ze),Tr=e=>(t,n,o)=>{let r=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},r);if(i instanceof Promise)throw new ot;return i.issues.length?{success:!1,error:new(e??En)(i.issues.map(a=>qe(a,r,ce())))}:{success:!0,data:i.value}},us=Tr(ze),Cr=e=>async(t,n,o)=>{let r=o?Object.assign(o,{async:!0}):{async:!0},i=t._zod.run({value:n,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(a=>qe(a,r,ce())))}:{success:!0,data:i.value}},ls=Cr(ze),ei=e=>(t,n,o)=>{let r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Ir(e)(t,n,r)},u_=ei(ze),ti=e=>(t,n,o)=>Ir(e)(t,n,o),l_=ti(ze),ri=e=>async(t,n,o)=>{let r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Er(e)(t,n,r)},c_=ri(ze),ni=e=>async(t,n,o)=>Er(e)(t,n,o),d_=ni(ze),oi=e=>(t,n,o)=>{let r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Tr(e)(t,n,r)},p_=oi(ze),ii=e=>(t,n,o)=>Tr(e)(t,n,o),m_=ii(ze),ai=e=>async(t,n,o)=>{let r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Cr(e)(t,n,r)},f_=ai(ze),si=e=>async(t,n,o)=>Cr(e)(t,n,o),g_=si(ze);var Ye={};Bt(Ye,{base64:()=>ks,base64url:()=>ui,bigint:()=>As,boolean:()=>js,browserEmail:()=>w_,cidrv4:()=>Ds,cidrv6:()=>ws,cuid:()=>cs,cuid2:()=>ds,date:()=>Is,datetime:()=>Ts,domain:()=>$_,duration:()=>hs,e164:()=>Ss,email:()=>ys,emoji:()=>bs,extendedDuration:()=>h_,guid:()=>vs,hex:()=>S_,hostname:()=>$s,html5Email:()=>__,idnEmail:()=>D_,integer:()=>Ps,ipv4:()=>_s,ipv6:()=>xs,ksuid:()=>fs,lowercase:()=>Rs,md5_base64:()=>E_,md5_base64url:()=>T_,md5_hex:()=>I_,nanoid:()=>gs,null:()=>Ns,number:()=>Os,rfc5322Email:()=>x_,sha1_base64:()=>A_,sha1_base64url:()=>P_,sha1_hex:()=>C_,sha256_base64:()=>j_,sha256_base64url:()=>N_,sha256_hex:()=>O_,sha384_base64:()=>R_,sha384_base64url:()=>F_,sha384_hex:()=>z_,sha512_base64:()=>U_,sha512_base64url:()=>Z_,sha512_hex:()=>M_,string:()=>Cs,time:()=>Es,ulid:()=>ps,undefined:()=>zs,unicodeEmail:()=>tm,uppercase:()=>Fs,uuid:()=>ur,uuid4:()=>v_,uuid6:()=>y_,uuid7:()=>b_,xid:()=>ms});var cs=/^[cC][^\s-]{8,}$/,ds=/^[0-9a-z]+$/,ps=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ms=/^[0-9a-vA-V]{20}$/,fs=/^[A-Za-z0-9]{27}$/,gs=/^[a-zA-Z0-9_-]{21}$/,hs=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,h_=/^[-+]?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)?)??$/,vs=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ur=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,v_=ur(4),y_=ur(6),b_=ur(7),ys=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,__=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,x_=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,tm=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,D_=tm,w_=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,k_="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function bs(){return new RegExp(k_,"u")}var _s=/^(?:(?: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])$/,xs=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Ds=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,ws=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ks=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ui=/^[A-Za-z0-9_-]*$/,$s=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,$_=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Ss=/^\+(?:[0-9]){6,14}[0-9]$/,rm="(?:(?:\\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])))",Is=new RegExp(`^${rm}$`);function nm(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Es(e){return new RegExp(`^${nm(e)}$`)}function Ts(e){let t=nm({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${n.join("|")})`;return new RegExp(`^${rm}T(?:${o})$`)}var Cs=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},As=/^-?\d+n?$/,Ps=/^-?\d+$/,Os=/^-?\d+(?:\.\d+)?/,js=/^(?:true|false)$/i,Ns=/^null$/i;var zs=/^undefined$/i;var Rs=/^[^A-Z]*$/,Fs=/^[^a-z]*$/,S_=/^[0-9a-fA-F]*$/;function An(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Pn(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var I_=/^[0-9a-fA-F]{32}$/,E_=An(22,"=="),T_=Pn(22),C_=/^[0-9a-fA-F]{40}$/,A_=An(27,"="),P_=Pn(27),O_=/^[0-9a-fA-F]{64}$/,j_=An(43,"="),N_=Pn(43),z_=/^[0-9a-fA-F]{96}$/,R_=An(64,""),F_=Pn(64),M_=/^[0-9a-fA-F]{128}$/,U_=An(86,"=="),Z_=Pn(86);var se=D("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),im={number:"number",bigint:"bigint",object:"date"},li=D("$ZodCheckLessThan",(e,t)=>{se.init(e,t);let n=im[typeof t.value];e._zod.onattach.push(o=>{let r=o._zod.bag,i=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:n,code:"too_big",maximum:t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ci=D("$ZodCheckGreaterThan",(e,t)=>{se.init(e,t);let n=im[typeof t.value];e._zod.onattach.push(o=>{let r=o._zod.bag,i=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:n,code:"too_small",minimum:t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ms=D("$ZodCheckMultipleOf",(e,t)=>{se.init(e,t),e._zod.onattach.push(n=>{var o;(o=n._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):Qa(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Us=D("$ZodCheckNumberFormat",(e,t)=>{se.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),o=n?"int":"number",[r,i]=os[t.format];e._zod.onattach.push(a=>{let u=a._zod.bag;u.format=t.format,u.minimum=r,u.maximum=i,n&&(u.pattern=Ps)}),e._zod.check=a=>{let u=a.value;if(n){if(!Number.isInteger(u)){a.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:u,inst:e});return}if(!Number.isSafeInteger(u)){u>0?a.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort}):a.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort});return}}u<r&&a.issues.push({origin:"number",input:u,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),u>i&&a.issues.push({origin:"number",input:u,code:"too_big",maximum:i,inst:e})}}),Zs=D("$ZodCheckBigIntFormat",(e,t)=>{se.init(e,t);let[n,o]=is[t.format];e._zod.onattach.push(r=>{let i=r._zod.bag;i.format=t.format,i.minimum=n,i.maximum=o}),e._zod.check=r=>{let i=r.value;i<n&&r.issues.push({origin:"bigint",input:i,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),i>o&&r.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inst:e})}}),Ls=D("$ZodCheckMaxSize",(e,t)=>{var n;se.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!Jt(r)&&r.size!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let r=o.value;r.size<=t.maximum||o.issues.push({origin:Sn(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Bs=D("$ZodCheckMinSize",(e,t)=>{var n;se.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!Jt(r)&&r.size!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let r=o.value;r.size>=t.minimum||o.issues.push({origin:Sn(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),qs=D("$ZodCheckSizeEquals",(e,t)=>{var n;se.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!Jt(r)&&r.size!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag;r.minimum=t.size,r.maximum=t.size,r.size=t.size}),e._zod.check=o=>{let r=o.value,i=r.size;if(i===t.size)return;let a=i>t.size;o.issues.push({origin:Sn(r),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Vs=D("$ZodCheckMaxLength",(e,t)=>{var n;se.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!Jt(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let r=o.value;if(r.length<=t.maximum)return;let a=In(r);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Js=D("$ZodCheckMinLength",(e,t)=>{var n;se.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!Jt(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let r=o.value;if(r.length>=t.minimum)return;let a=In(r);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Gs=D("$ZodCheckLengthEquals",(e,t)=>{var n;se.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!Jt(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=o=>{let r=o.value,i=r.length;if(i===t.length)return;let a=In(r),u=i>t.length;o.issues.push({origin:a,...u?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Ar=D("$ZodCheckStringFormat",(e,t)=>{var n,o;se.init(e,t),e._zod.onattach.push(r=>{let i=r._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),Ws=D("$ZodCheckRegex",(e,t)=>{Ar.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ks=D("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Rs),Ar.init(e,t)}),Hs=D("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Fs),Ar.init(e,t)}),Ys=D("$ZodCheckIncludes",(e,t)=>{se.init(e,t);let n=gt(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=o,e._zod.onattach.push(r=>{let i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),Xs=D("$ZodCheckStartsWith",(e,t)=>{se.init(e,t);let n=new RegExp(`^${gt(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(o=>{let r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Qs=D("$ZodCheckEndsWith",(e,t)=>{se.init(e,t);let n=new RegExp(`.*${gt(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(o=>{let r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});function om(e,t,n){e.issues.length&&t.issues.push(...Be(n,e.issues))}var eu=D("$ZodCheckProperty",(e,t)=>{se.init(e,t),e._zod.check=n=>{let o=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then(r=>om(r,n,t.property));om(o,n,t.property)}}),tu=D("$ZodCheckMimeType",(e,t)=>{se.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=t.mime}),e._zod.check=o=>{n.has(o.value.type)||o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),ru=D("$ZodCheckOverwrite",(e,t)=>{se.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});var On=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
|
|
16
16
|
`).filter(a=>a),r=Math.min(...o.map(a=>a.length-a.trimStart().length)),i=o.map(a=>a.slice(r)).map(a=>" ".repeat(this.indent*2)+a);for(let a of i)this.content.push(a)}compile(){let t=Function,n=this?.args,r=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...n,r.join(`
|
|
17
|
-
`))}};var nu={major:4,minor:1,patch:8};var V=D("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=nu;let o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let r of o)for(let i of r._zod.onattach)i(e);if(o.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let r=(a,u,l)=>{let c=Ht(a),m;for(let h of u){if(h._zod.def.when){if(!h._zod.def.when(a))continue}else if(c)continue;let y=a.issues.length,p=h._zod.check(a);if(p instanceof Promise&&l?.async===!1)throw new ot;if(m||p instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await p,a.issues.length!==y&&(c||(c=Ht(a,y)))});else{if(a.issues.length===y)continue;c||(c=Ht(a,y))}}return m?m.then(()=>a):a},i=(a,u,l)=>{if(Ht(a))return a.aborted=!0,a;let c=r(u,o,l);if(c instanceof Promise){if(l.async===!1)throw new ot;return c.then(m=>e._zod.parse(m,l))}return e._zod.parse(c,l)};e._zod.run=(a,u)=>{if(u.skipChecks)return e._zod.parse(a,u);if(u.direction==="backward"){let c=e._zod.parse({value:a.value,issues:[]},{...u,skipChecks:!0});return c instanceof Promise?c.then(m=>i(m,a,u)):i(c,a,u)}let l=e._zod.parse(a,u);if(l instanceof Promise){if(u.async===!1)throw new ot;return l.then(c=>r(c,o,u))}return r(l,o,u)}}e["~standard"]={validate:r=>{try{let i=us(e,r);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return ls(e,r).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}}),lr=D("$ZodString",(e,t)=>{V.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Cs(e._zod.bag),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),oe=D("$ZodStringFormat",(e,t)=>{Ar.init(e,t),lr.init(e,t)}),iu=D("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=vs),oe.init(e,t)}),au=D("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ur(o))}else t.pattern??(t.pattern=ur());oe.init(e,t)}),su=D("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=ys),oe.init(e,t)}),uu=D("$ZodURL",(e,t)=>{oe.init(e,t),e._zod.check=n=>{try{let o=n.value.trim(),r=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:$s.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=r.href:n.value=o;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),lu=D("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=bs()),oe.init(e,t)}),cu=D("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=gs),oe.init(e,t)}),du=D("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=cs),oe.init(e,t)}),pu=D("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=ds),oe.init(e,t)}),mu=D("$ZodULID",(e,t)=>{t.pattern??(t.pattern=ps),oe.init(e,t)}),fu=D("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ms),oe.init(e,t)}),gu=D("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=fs),oe.init(e,t)}),hu=D("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Ts(t)),oe.init(e,t)}),vu=D("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Is),oe.init(e,t)}),yu=D("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Es(t)),oe.init(e,t)}),bu=D("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=hs),oe.init(e,t)}),_u=D("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=_s),oe.init(e,t),e._zod.onattach.push(n=>{let o=n._zod.bag;o.format="ipv4"})}),xu=D("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=xs),oe.init(e,t),e._zod.onattach.push(n=>{let o=n._zod.bag;o.format="ipv6"}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),Du=D("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Ds),oe.init(e,t)}),wu=D("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=ws),oe.init(e,t),e._zod.check=n=>{let o=n.value.split("/");try{if(o.length!==2)throw new Error;let[r,i]=o;if(!i)throw new Error;let a=Number(i);if(`${a}`!==i)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function ku(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var $u=D("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ks),oe.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{ku(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function vm(e){if(!ui.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return ku(n)}var Su=D("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ui),oe.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{vm(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Iu=D("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Ss),oe.init(e,t)});function ym(e,t=null){try{let n=e.split(".");if(n.length!==3)return!1;let[o]=n;if(!o)return!1;let r=JSON.parse(atob(o));return!("typ"in r&&r?.typ!=="JWT"||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch{return!1}}var Eu=D("$ZodJWT",(e,t)=>{oe.init(e,t),e._zod.check=n=>{ym(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Tu=D("$ZodCustomStringFormat",(e,t)=>{oe.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),hi=D("$ZodNumber",(e,t)=>{V.init(e,t),e._zod.pattern=e._zod.bag.pattern??Os,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let r=n.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return n;let i=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...i?{received:i}:{}}),n}}),Cu=D("$ZodNumber",(e,t)=>{Us.init(e,t),hi.init(e,t)}),jn=D("$ZodBoolean",(e,t)=>{V.init(e,t),e._zod.pattern=js,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=!!n.value}catch{}let r=n.value;return typeof r=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),n}}),vi=D("$ZodBigInt",(e,t)=>{V.init(e,t),e._zod.pattern=As,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),Au=D("$ZodBigInt",(e,t)=>{Zs.init(e,t),vi.init(e,t)}),Pu=D("$ZodSymbol",(e,t)=>{V.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;return typeof r=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:e}),n}}),Ou=D("$ZodUndefined",(e,t)=>{V.init(e,t),e._zod.pattern=zs,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(n,o)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),n}}),ju=D("$ZodNull",(e,t)=>{V.init(e,t),e._zod.pattern=Ns,e._zod.values=new Set([null]),e._zod.parse=(n,o)=>{let r=n.value;return r===null||n.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),n}}),Nu=D("$ZodAny",(e,t)=>{V.init(e,t),e._zod.parse=n=>n}),zu=D("$ZodUnknown",(e,t)=>{V.init(e,t),e._zod.parse=n=>n}),Ru=D("$ZodNever",(e,t)=>{V.init(e,t),e._zod.parse=(n,o)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),Fu=D("$ZodVoid",(e,t)=>{V.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),n}}),Mu=D("$ZodDate",(e,t)=>{V.init(e,t),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let r=n.value,i=r instanceof Date;return i&&!Number.isNaN(r.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:r,...i?{received:"Invalid Date"}:{},inst:e}),n}});function sm(e,t,n){e.issues.length&&t.issues.push(...Be(n,e.issues)),t.value[n]=e.value}var Uu=D("$ZodArray",(e,t)=>{V.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),n;n.value=Array(r.length);let i=[];for(let a=0;a<r.length;a++){let u=r[a],l=t.element._zod.run({value:u,issues:[]},o);l instanceof Promise?i.push(l.then(c=>sm(c,n,a))):sm(l,n,a)}return i.length?Promise.all(i).then(()=>n):n}});function gi(e,t,n,o){e.issues.length&&t.issues.push(...Be(n,e.issues)),e.value===void 0?n in o&&(t.value[n]=void 0):t.value[n]=e.value}function bm(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let n=ns(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function _m(e,t,n,o,r,i){let a=[],u=r.keySet,l=r.catchall._zod,c=l.def.type;for(let m of Object.keys(t)){if(u.has(m))continue;if(c==="never"){a.push(m);continue}let h=l.run({value:t[m],issues:[]},o);h instanceof Promise?e.push(h.then(y=>gi(y,n,m,t))):gi(h,n,m,t)}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}var xm=D("$ZodObject",(e,t)=>{V.init(e,t);let n=$r(()=>bm(t));W(e._zod,"propValues",()=>{let a=t.shape,u={};for(let l in a){let c=a[l]._zod;if(c.values){u[l]??(u[l]=new Set);for(let m of c.values)u[l].add(m)}}return u});let o=sr,r=t.catchall,i;e._zod.parse=(a,u)=>{i??(i=n.value);let l=a.value;if(!o(l))return a.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),a;a.value={};let c=[],m=i.shape;for(let h of i.keys){let p=m[h]._zod.run({value:l[h],issues:[]},u);p instanceof Promise?c.push(p.then(d=>gi(d,a,h,l))):gi(p,a,h,l)}return r?_m(c,l,a,u,n.value,e):c.length?Promise.all(c).then(()=>a):a}}),Zu=D("$ZodObjectJIT",(e,t)=>{xm.init(e,t);let n=e._zod.parse,o=$r(()=>bm(t)),r=y=>{let p=new On(["shape","payload","ctx"]),d=o.value,f=S=>{let _=Ho(S);return`shape[${_}]._zod.run({ value: input[${_}], issues: [] }, ctx)`};p.write("const input = payload.value;");let v=Object.create(null),x=0;for(let S of d.keys)v[S]=`key_${x++}`;p.write("const newResult = {};");for(let S of d.keys){let _=v[S],O=Ho(S);p.write(`const ${_} = ${f(S)};`),p.write(`
|
|
17
|
+
`))}};var nu={major:4,minor:1,patch:8};var q=D("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=nu;let o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let r of o)for(let i of r._zod.onattach)i(e);if(o.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let r=(a,u,l)=>{let c=Ht(a),m;for(let h of u){if(h._zod.def.when){if(!h._zod.def.when(a))continue}else if(c)continue;let y=a.issues.length,p=h._zod.check(a);if(p instanceof Promise&&l?.async===!1)throw new ot;if(m||p instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await p,a.issues.length!==y&&(c||(c=Ht(a,y)))});else{if(a.issues.length===y)continue;c||(c=Ht(a,y))}}return m?m.then(()=>a):a},i=(a,u,l)=>{if(Ht(a))return a.aborted=!0,a;let c=r(u,o,l);if(c instanceof Promise){if(l.async===!1)throw new ot;return c.then(m=>e._zod.parse(m,l))}return e._zod.parse(c,l)};e._zod.run=(a,u)=>{if(u.skipChecks)return e._zod.parse(a,u);if(u.direction==="backward"){let c=e._zod.parse({value:a.value,issues:[]},{...u,skipChecks:!0});return c instanceof Promise?c.then(m=>i(m,a,u)):i(c,a,u)}let l=e._zod.parse(a,u);if(l instanceof Promise){if(u.async===!1)throw new ot;return l.then(c=>r(c,o,u))}return r(l,o,u)}}e["~standard"]={validate:r=>{try{let i=us(e,r);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return ls(e,r).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}}),lr=D("$ZodString",(e,t)=>{q.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Cs(e._zod.bag),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),oe=D("$ZodStringFormat",(e,t)=>{Ar.init(e,t),lr.init(e,t)}),iu=D("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=vs),oe.init(e,t)}),au=D("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ur(o))}else t.pattern??(t.pattern=ur());oe.init(e,t)}),su=D("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=ys),oe.init(e,t)}),uu=D("$ZodURL",(e,t)=>{oe.init(e,t),e._zod.check=n=>{try{let o=n.value.trim(),r=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:$s.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=r.href:n.value=o;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),lu=D("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=bs()),oe.init(e,t)}),cu=D("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=gs),oe.init(e,t)}),du=D("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=cs),oe.init(e,t)}),pu=D("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=ds),oe.init(e,t)}),mu=D("$ZodULID",(e,t)=>{t.pattern??(t.pattern=ps),oe.init(e,t)}),fu=D("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ms),oe.init(e,t)}),gu=D("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=fs),oe.init(e,t)}),hu=D("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Ts(t)),oe.init(e,t)}),vu=D("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Is),oe.init(e,t)}),yu=D("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Es(t)),oe.init(e,t)}),bu=D("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=hs),oe.init(e,t)}),_u=D("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=_s),oe.init(e,t),e._zod.onattach.push(n=>{let o=n._zod.bag;o.format="ipv4"})}),xu=D("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=xs),oe.init(e,t),e._zod.onattach.push(n=>{let o=n._zod.bag;o.format="ipv6"}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),Du=D("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Ds),oe.init(e,t)}),wu=D("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=ws),oe.init(e,t),e._zod.check=n=>{let o=n.value.split("/");try{if(o.length!==2)throw new Error;let[r,i]=o;if(!i)throw new Error;let a=Number(i);if(`${a}`!==i)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function ku(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var $u=D("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ks),oe.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{ku(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function vm(e){if(!ui.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return ku(n)}var Su=D("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ui),oe.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{vm(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Iu=D("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Ss),oe.init(e,t)});function ym(e,t=null){try{let n=e.split(".");if(n.length!==3)return!1;let[o]=n;if(!o)return!1;let r=JSON.parse(atob(o));return!("typ"in r&&r?.typ!=="JWT"||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch{return!1}}var Eu=D("$ZodJWT",(e,t)=>{oe.init(e,t),e._zod.check=n=>{ym(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Tu=D("$ZodCustomStringFormat",(e,t)=>{oe.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),hi=D("$ZodNumber",(e,t)=>{q.init(e,t),e._zod.pattern=e._zod.bag.pattern??Os,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let r=n.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return n;let i=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...i?{received:i}:{}}),n}}),Cu=D("$ZodNumber",(e,t)=>{Us.init(e,t),hi.init(e,t)}),jn=D("$ZodBoolean",(e,t)=>{q.init(e,t),e._zod.pattern=js,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=!!n.value}catch{}let r=n.value;return typeof r=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),n}}),vi=D("$ZodBigInt",(e,t)=>{q.init(e,t),e._zod.pattern=As,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),Au=D("$ZodBigInt",(e,t)=>{Zs.init(e,t),vi.init(e,t)}),Pu=D("$ZodSymbol",(e,t)=>{q.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;return typeof r=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:e}),n}}),Ou=D("$ZodUndefined",(e,t)=>{q.init(e,t),e._zod.pattern=zs,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(n,o)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),n}}),ju=D("$ZodNull",(e,t)=>{q.init(e,t),e._zod.pattern=Ns,e._zod.values=new Set([null]),e._zod.parse=(n,o)=>{let r=n.value;return r===null||n.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),n}}),Nu=D("$ZodAny",(e,t)=>{q.init(e,t),e._zod.parse=n=>n}),zu=D("$ZodUnknown",(e,t)=>{q.init(e,t),e._zod.parse=n=>n}),Ru=D("$ZodNever",(e,t)=>{q.init(e,t),e._zod.parse=(n,o)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),Fu=D("$ZodVoid",(e,t)=>{q.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),n}}),Mu=D("$ZodDate",(e,t)=>{q.init(e,t),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let r=n.value,i=r instanceof Date;return i&&!Number.isNaN(r.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:r,...i?{received:"Invalid Date"}:{},inst:e}),n}});function sm(e,t,n){e.issues.length&&t.issues.push(...Be(n,e.issues)),t.value[n]=e.value}var Uu=D("$ZodArray",(e,t)=>{q.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),n;n.value=Array(r.length);let i=[];for(let a=0;a<r.length;a++){let u=r[a],l=t.element._zod.run({value:u,issues:[]},o);l instanceof Promise?i.push(l.then(c=>sm(c,n,a))):sm(l,n,a)}return i.length?Promise.all(i).then(()=>n):n}});function gi(e,t,n,o){e.issues.length&&t.issues.push(...Be(n,e.issues)),e.value===void 0?n in o&&(t.value[n]=void 0):t.value[n]=e.value}function bm(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let n=ns(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function _m(e,t,n,o,r,i){let a=[],u=r.keySet,l=r.catchall._zod,c=l.def.type;for(let m of Object.keys(t)){if(u.has(m))continue;if(c==="never"){a.push(m);continue}let h=l.run({value:t[m],issues:[]},o);h instanceof Promise?e.push(h.then(y=>gi(y,n,m,t))):gi(h,n,m,t)}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}var xm=D("$ZodObject",(e,t)=>{q.init(e,t);let n=$r(()=>bm(t));W(e._zod,"propValues",()=>{let a=t.shape,u={};for(let l in a){let c=a[l]._zod;if(c.values){u[l]??(u[l]=new Set);for(let m of c.values)u[l].add(m)}}return u});let o=sr,r=t.catchall,i;e._zod.parse=(a,u)=>{i??(i=n.value);let l=a.value;if(!o(l))return a.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),a;a.value={};let c=[],m=i.shape;for(let h of i.keys){let p=m[h]._zod.run({value:l[h],issues:[]},u);p instanceof Promise?c.push(p.then(d=>gi(d,a,h,l))):gi(p,a,h,l)}return r?_m(c,l,a,u,n.value,e):c.length?Promise.all(c).then(()=>a):a}}),Zu=D("$ZodObjectJIT",(e,t)=>{xm.init(e,t);let n=e._zod.parse,o=$r(()=>bm(t)),r=y=>{let p=new On(["shape","payload","ctx"]),d=o.value,f=S=>{let _=Ho(S);return`shape[${_}]._zod.run({ value: input[${_}], issues: [] }, ctx)`};p.write("const input = payload.value;");let v=Object.create(null),x=0;for(let S of d.keys)v[S]=`key_${x++}`;p.write("const newResult = {};");for(let S of d.keys){let _=v[S],O=Ho(S);p.write(`const ${_} = ${f(S)};`),p.write(`
|
|
18
18
|
if (${_}.issues.length) {
|
|
19
19
|
payload.issues = payload.issues.concat(${_}.issues.map(iss => ({
|
|
20
20
|
...iss,
|
|
@@ -31,13 +31,13 @@ Error message: ${ft(n)}`,cause:n}),this[qp]=!0,this.value=t}static isInstance(t)
|
|
|
31
31
|
newResult[${O}] = ${_}.value;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
`)}p.write("payload.value = newResult;"),p.write("return payload;");let b=p.compile();return(S,_)=>b(y,S,_)},i,a=sr,u=!xn.jitless,c=u&&es.value,m=t.catchall,h;e._zod.parse=(y,p)=>{h??(h=o.value);let d=y.value;return a(d)?u&&c&&p?.async===!1&&p.jitless!==!0?(i||(i=r(t.shape)),y=i(y,p),m?_m([],d,y,p,h,e):y):n(y,p):(y.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),y)}});function um(e,t,n,o){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let r=e.filter(i=>!Ht(i));return r.length===1?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(a=>Ve(a,o,ce())))}),t)}var yi=D("$ZodUnion",(e,t)=>{V.init(e,t),W(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),W(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),W(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),W(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){let r=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${r.map(i=>kn(i.source)).join("|")})$`)}});let n=t.options.length===1,o=t.options[0]._zod.run;e._zod.parse=(r,i)=>{if(n)return o(r,i);let a=!1,u=[];for(let l of t.options){let c=l._zod.run({value:r.value,issues:[]},i);if(c instanceof Promise)u.push(c),a=!0;else{if(c.issues.length===0)return c;u.push(c)}}return a?Promise.all(u).then(l=>um(l,r,e,i)):um(u,r,e,i)}}),Lu=D("$ZodDiscriminatedUnion",(e,t)=>{yi.init(e,t);let n=e._zod.parse;W(e._zod,"propValues",()=>{let r={};for(let i of t.options){let a=i._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[u,l]of Object.entries(a)){r[u]||(r[u]=new Set);for(let c of l)r[u].add(c)}}return r});let o=$r(()=>{let r=t.options,i=new Map;for(let a of r){let u=a._zod.propValues?.[t.discriminator];if(!u||u.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let l of u){if(i.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);i.set(l,a)}}return i});e._zod.parse=(r,i)=>{let a=r.value;if(!sr(a))return r.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),r;let u=o.value.get(a?.[t.discriminator]);return u?u._zod.run(r,i):t.unionFallback?n(r,i):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:a,path:[t.discriminator],inst:e}),r)}}),Bu=D("$ZodIntersection",(e,t)=>{V.init(e,t),e._zod.parse=(n,o)=>{let r=n.value,i=t.left._zod.run({value:r,issues:[]},o),a=t.right._zod.run({value:r,issues:[]},o);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([l,c])=>lm(n,l,c)):lm(n,i,a)}});function ou(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Kt(e)&&Kt(t)){let n=Object.keys(t),o=Object.keys(e).filter(i=>n.indexOf(i)!==-1),r={...e,...t};for(let i of o){let a=ou(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};r[i]=a.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let o=0;o<e.length;o++){let r=e[o],i=t[o],a=ou(r,i);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function lm(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Ht(e))return e;let o=ou(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var bi=D("$ZodTuple",(e,t)=>{V.init(e,t);let n=t.items,o=n.length-[...n].reverse().findIndex(r=>r._zod.optin!=="optional");e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({input:a,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];let u=[];if(!t.rest){let c=a.length>n.length,m=a.length<o-1;if(c||m)return r.issues.push({...c?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},input:a,inst:e,origin:"array"}),r}let l=-1;for(let c of n){if(l++,l>=a.length&&l>=o)continue;let m=c._zod.run({value:a[l],issues:[]},i);m instanceof Promise?u.push(m.then(h=>di(h,r,l))):di(m,r,l)}if(t.rest){let c=a.slice(n.length);for(let m of c){l++;let h=t.rest._zod.run({value:m,issues:[]},i);h instanceof Promise?u.push(h.then(y=>di(y,r,l))):di(h,r,l)}}return u.length?Promise.all(u).then(()=>r):r}});function di(e,t,n){e.issues.length&&t.issues.push(...Be(n,e.issues)),t.value[n]=e.value}var Vu=D("$ZodRecord",(e,t)=>{V.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!Kt(r))return n.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),n;let i=[];if(t.keyType._zod.values){let a=t.keyType._zod.values;n.value={};for(let l of a)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){let c=t.valueType._zod.run({value:r[l],issues:[]},o);c instanceof Promise?i.push(c.then(m=>{m.issues.length&&n.issues.push(...Be(l,m.issues)),n.value[l]=m.value})):(c.issues.length&&n.issues.push(...Be(l,c.issues)),n.value[l]=c.value)}let u;for(let l in r)a.has(l)||(u=u??[],u.push(l));u&&u.length>0&&n.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:u})}else{n.value={};for(let a of Reflect.ownKeys(r)){if(a==="__proto__")continue;let u=t.keyType._zod.run({value:a,issues:[]},o);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(u.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(c=>Ve(c,o,ce())),input:a,path:[a],inst:e}),n.value[u.value]=u.value;continue}let l=t.valueType._zod.run({value:r[a],issues:[]},o);l instanceof Promise?i.push(l.then(c=>{c.issues.length&&n.issues.push(...Be(a,c.issues)),n.value[u.value]=c.value})):(l.issues.length&&n.issues.push(...Be(a,l.issues)),n.value[u.value]=l.value)}}return i.length?Promise.all(i).then(()=>n):n}}),qu=D("$ZodMap",(e,t)=>{V.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!(r instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:r,inst:e}),n;let i=[];n.value=new Map;for(let[a,u]of r){let l=t.keyType._zod.run({value:a,issues:[]},o),c=t.valueType._zod.run({value:u,issues:[]},o);l instanceof Promise||c instanceof Promise?i.push(Promise.all([l,c]).then(([m,h])=>{cm(m,h,n,a,r,e,o)})):cm(l,c,n,a,r,e,o)}return i.length?Promise.all(i).then(()=>n):n}});function cm(e,t,n,o,r,i,a){e.issues.length&&($n.has(typeof o)?n.issues.push(...Be(o,e.issues)):n.issues.push({code:"invalid_key",origin:"map",input:r,inst:i,issues:e.issues.map(u=>Ve(u,a,ce()))})),t.issues.length&&($n.has(typeof o)?n.issues.push(...Be(o,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:r,inst:i,key:o,issues:t.issues.map(u=>Ve(u,a,ce()))})),n.value.set(e.value,t.value)}var Ju=D("$ZodSet",(e,t)=>{V.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!(r instanceof Set))return n.issues.push({input:r,inst:e,expected:"set",code:"invalid_type"}),n;let i=[];n.value=new Set;for(let a of r){let u=t.valueType._zod.run({value:a,issues:[]},o);u instanceof Promise?i.push(u.then(l=>dm(l,n))):dm(u,n)}return i.length?Promise.all(i).then(()=>n):n}});function dm(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var Gu=D("$ZodEnum",(e,t)=>{V.init(e,t);let n=wn(t.entries),o=new Set(n);e._zod.values=o,e._zod.pattern=new RegExp(`^(${n.filter(r=>$n.has(typeof r)).map(r=>typeof r=="string"?gt(r):r.toString()).join("|")})$`),e._zod.parse=(r,i)=>{let a=r.value;return o.has(a)||r.issues.push({code:"invalid_value",values:n,input:a,inst:e}),r}}),Wu=D("$ZodLiteral",(e,t)=>{if(V.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?gt(n):n?gt(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,o)=>{let r=n.value;return e._zod.values.has(r)||n.issues.push({code:"invalid_value",values:t.values,input:r,inst:e}),n}}),Ku=D("$ZodFile",(e,t)=>{V.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;return r instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:r,inst:e}),n}}),Hu=D("$ZodTransform",(e,t)=>{V.init(e,t),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new qt(e.constructor.name);let r=t.transform(n.value,n);if(o.async)return(r instanceof Promise?r:Promise.resolve(r)).then(a=>(n.value=a,n));if(r instanceof Promise)throw new ot;return n.value=r,n}});function pm(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var Yu=D("$ZodOptional",(e,t)=>{V.init(e,t),e._zod.optin="optional",e._zod.optout="optional",W(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),W(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${kn(n.source)})?$`):void 0}),e._zod.parse=(n,o)=>{if(t.innerType._zod.optin==="optional"){let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>pm(i,n.value)):pm(r,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,o)}}),Xu=D("$ZodNullable",(e,t)=>{V.init(e,t),W(e._zod,"optin",()=>t.innerType._zod.optin),W(e._zod,"optout",()=>t.innerType._zod.optout),W(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${kn(n.source)}|null)$`):void 0}),W(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,o)=>n.value===null?n:t.innerType._zod.run(n,o)}),Qu=D("$ZodDefault",(e,t)=>{V.init(e,t),e._zod.optin="optional",W(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);if(n.value===void 0)return n.value=t.defaultValue,n;let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>mm(i,t)):mm(r,t)}});function mm(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var el=D("$ZodPrefault",(e,t)=>{V.init(e,t),e._zod.optin="optional",W(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>(o.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,o))}),tl=D("$ZodNonOptional",(e,t)=>{V.init(e,t),W(e._zod,"values",()=>{let n=t.innerType._zod.values;return n?new Set([...n].filter(o=>o!==void 0)):void 0}),e._zod.parse=(n,o)=>{let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>fm(i,e)):fm(r,e)}});function fm(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var rl=D("$ZodSuccess",(e,t)=>{V.init(e,t),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new qt("ZodSuccess");let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>(n.value=i.issues.length===0,n)):(n.value=r.issues.length===0,n)}}),nl=D("$ZodCatch",(e,t)=>{V.init(e,t),W(e._zod,"optin",()=>t.innerType._zod.optin),W(e._zod,"optout",()=>t.innerType._zod.optout),W(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(a=>Ve(a,o,ce()))},input:n.value}),n.issues=[]),n)):(n.value=r.value,r.issues.length&&(n.value=t.catchValue({...n,error:{issues:r.issues.map(i=>Ve(i,o,ce()))},input:n.value}),n.issues=[]),n)}}),ol=D("$ZodNaN",(e,t)=>{V.init(e,t),e._zod.parse=(n,o)=>((typeof n.value!="number"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:e,expected:"nan",code:"invalid_type"}),n)}),il=D("$ZodPipe",(e,t)=>{V.init(e,t),W(e._zod,"values",()=>t.in._zod.values),W(e._zod,"optin",()=>t.in._zod.optin),W(e._zod,"optout",()=>t.out._zod.optout),W(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,o)=>{if(o.direction==="backward"){let i=t.out._zod.run(n,o);return i instanceof Promise?i.then(a=>pi(a,t.in,o)):pi(i,t.in,o)}let r=t.in._zod.run(n,o);return r instanceof Promise?r.then(i=>pi(i,t.out,o)):pi(r,t.out,o)}});function pi(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Nn=D("$ZodCodec",(e,t)=>{V.init(e,t),W(e._zod,"values",()=>t.in._zod.values),W(e._zod,"optin",()=>t.in._zod.optin),W(e._zod,"optout",()=>t.out._zod.optout),W(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,o)=>{if((o.direction||"forward")==="forward"){let i=t.in._zod.run(n,o);return i instanceof Promise?i.then(a=>mi(a,t,o)):mi(i,t,o)}else{let i=t.out._zod.run(n,o);return i instanceof Promise?i.then(a=>mi(a,t,o)):mi(i,t,o)}}});function mi(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||"forward")==="forward"){let r=t.transform(e.value,e);return r instanceof Promise?r.then(i=>fi(e,i,t.out,n)):fi(e,r,t.out,n)}else{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(i=>fi(e,i,t.in,n)):fi(e,r,t.in,n)}}function fi(e,t,n,o){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},o)}var al=D("$ZodReadonly",(e,t)=>{V.init(e,t),W(e._zod,"propValues",()=>t.innerType._zod.propValues),W(e._zod,"values",()=>t.innerType._zod.values),W(e._zod,"optin",()=>t.innerType._zod.optin),W(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(gm):gm(r)}});function gm(e){return e.value=Object.freeze(e.value),e}var sl=D("$ZodTemplateLiteral",(e,t)=>{V.init(e,t);let n=[];for(let o of t.parts)if(typeof o=="object"&&o!==null){if(!o._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let r=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!r)throw new Error(`Invalid template literal part: ${o._zod.traits}`);let i=r.startsWith("^")?1:0,a=r.endsWith("$")?r.length-1:r.length;n.push(r.slice(i,a))}else if(o===null||rs.has(typeof o))n.push(gt(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(o,r)=>typeof o.value!="string"?(o.issues.push({input:o.value,inst:e,expected:"template_literal",code:"invalid_type"}),o):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),o)}),ul=D("$ZodFunction",(e,t)=>(V.init(e,t),e._def=t,e._zod.def=t,e.implement=n=>{if(typeof n!="function")throw new Error("implement() must be called with a function");return function(...o){let r=e._def.input?Xo(e._def.input,o):o,i=Reflect.apply(n,this,r);return e._def.output?Xo(e._def.output,i):i}},e.implementAsync=n=>{if(typeof n!="function")throw new Error("implementAsync() must be called with a function");return async function(...o){let r=e._def.input?await Qo(e._def.input,o):o,i=await Reflect.apply(n,this,r);return e._def.output?await Qo(e._def.output,i):i}},e._zod.parse=(n,o)=>typeof n.value!="function"?(n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:e}),n):(e._def.output&&e._def.output._zod.def.type==="promise"?n.value=e.implementAsync(n.value):n.value=e.implement(n.value),n),e.input=(...n)=>{let o=e.constructor;return Array.isArray(n[0])?new o({type:"function",input:new bi({type:"tuple",items:n[0],rest:n[1]}),output:e._def.output}):new o({type:"function",input:n[0],output:e._def.output})},e.output=n=>{let o=e.constructor;return new o({type:"function",input:e._def.input,output:n})},e)),ll=D("$ZodPromise",(e,t)=>{V.init(e,t),e._zod.parse=(n,o)=>Promise.resolve(n.value).then(r=>t.innerType._zod.run({value:r,issues:[]},o))}),cl=D("$ZodLazy",(e,t)=>{V.init(e,t),W(e._zod,"innerType",()=>t.getter()),W(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),W(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),W(e._zod,"optin",()=>e._zod.innerType._zod.optin??void 0),W(e._zod,"optout",()=>e._zod.innerType._zod.optout??void 0),e._zod.parse=(n,o)=>e._zod.innerType._zod.run(n,o)}),dl=D("$ZodCustom",(e,t)=>{se.init(e,t),V.init(e,t),e._zod.parse=(n,o)=>n,e._zod.check=n=>{let o=n.value,r=t.fn(o);if(r instanceof Promise)return r.then(i=>hm(i,n,o,e));hm(r,n,o,e)}});function hm(e,t,n,o){if(!e){let r={code:"custom",input:n,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(r.params=o._zod.def.params),t.issues.push(Sr(r))}}var Fn={};Bt(Fn,{ar:()=>Dm,az:()=>wm,be:()=>$m,ca:()=>Sm,cs:()=>Im,da:()=>Em,de:()=>Tm,en:()=>_i,eo:()=>Cm,es:()=>Am,fa:()=>Pm,fi:()=>Om,fr:()=>jm,frCA:()=>Nm,he:()=>zm,hu:()=>Rm,id:()=>Fm,is:()=>Mm,it:()=>Um,ja:()=>Zm,ka:()=>Lm,kh:()=>Bm,km:()=>xi,ko:()=>Vm,lt:()=>Jm,mk:()=>Gm,ms:()=>Wm,nl:()=>Km,no:()=>Hm,ota:()=>Ym,pl:()=>Qm,ps:()=>Xm,pt:()=>ef,ru:()=>rf,sl:()=>nf,sv:()=>of,ta:()=>af,th:()=>sf,tr:()=>uf,ua:()=>lf,uk:()=>Di,ur:()=>cf,vi:()=>df,yo:()=>ff,zhCN:()=>pf,zhTW:()=>mf});var B_=()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"};return r=>{switch(r.code){case"invalid_type":return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${r.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${A(r.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${r.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${r.minimum.toString()} ${a.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${r.prefix}"`:i.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${i.suffix}"`:i.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${i.includes}"`:i.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${i.pattern}`:`${o[i.format]??r.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${r.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${r.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${r.keys.length>1?"\u0629":""}: ${w(r.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function Dm(){return{localeError:B_()}}var V_=()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${r.expected}, daxil olan ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${A(r.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${i}${r.maximum.toString()} ${a.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${i}${r.minimum.toString()} ${a.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${i.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:i.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${i.suffix}" il\u0259 bitm\u0259lidir`:i.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${i.includes}" daxil olmal\u0131d\u0131r`:i.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${i.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${o[i.format]??r.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${r.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${r.keys.length>1?"lar":""}: ${w(r.keys,", ")}`;case"invalid_key":return`${r.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${r.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function wm(){return{localeError:V_()}}function km(e,t,n,o){let r=Math.abs(e),i=r%10,a=r%100;return a>=11&&a<=19?o:i===1?t:i>=2&&i<=4?n:o}var q_=()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u043B\u0456\u043A";case"object":{if(Array.isArray(r))return"\u043C\u0430\u0441\u0456\u045E";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"};return r=>{switch(r.code){case"invalid_type":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${r.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${A(r.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a){let u=Number(r.maximum),l=km(u,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${r.maximum.toString()} ${l}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a){let u=Number(r.minimum),l=km(u,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${r.minimum.toString()} ${l}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${o[i.format]??r.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${r.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${w(r.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${r.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${r.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function $m(){return{localeError:q_()}}var J_=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return r=>{switch(r.code){case"invalid_type":return`Tipus inv\xE0lid: s'esperava ${r.expected}, s'ha rebut ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Valor inv\xE0lid: s'esperava ${A(r.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${w(r.values," o ")}`;case"too_big":{let i=r.inclusive?"com a m\xE0xim":"menys de",a=t(r.origin);return a?`Massa gran: s'esperava que ${r.origin??"el valor"} contingu\xE9s ${i} ${r.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${r.origin??"el valor"} fos ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"com a m\xEDnim":"m\xE9s de",a=t(r.origin);return a?`Massa petit: s'esperava que ${r.origin} contingu\xE9s ${i} ${r.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${r.origin} fos ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${i.prefix}"`:i.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${i.suffix}"`:i.format==="includes"?`Format inv\xE0lid: ha d'incloure "${i.includes}"`:i.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${i.pattern}`:`Format inv\xE0lid per a ${o[i.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${r.divisor}`;case"unrecognized_keys":return`Clau${r.keys.length>1?"s":""} no reconeguda${r.keys.length>1?"s":""}: ${w(r.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${r.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${r.origin}`;default:return"Entrada inv\xE0lida"}}};function Sm(){return{localeError:J_()}}var G_=()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u010D\xEDslo";case"string":return"\u0159et\u011Bzec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(r))return"pole";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"};return r=>{switch(r.code){case"invalid_type":return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${r.expected}, obdr\u017Eeno ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${A(r.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${i}${r.maximum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${i}${r.minimum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${i.prefix}"`:i.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${i.suffix}"`:i.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${i.includes}"`:i.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${i.pattern}`:`Neplatn\xFD form\xE1t ${o[i.format]??r.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${r.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${w(r.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${r.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${r.origin}`;default:return"Neplatn\xFD vstup"}}};function Im(){return{localeError:G_()}}var W_=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}},t={string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};function n(a){return e[a]??null}function o(a){return t[a]??a}let r=a=>{let u=typeof a;switch(u){case"number":return Number.isNaN(a)?"NaN":"tal";case"object":return Array.isArray(a)?"liste":a===null?"null":Object.getPrototypeOf(a)!==Object.prototype&&a.constructor?a.constructor.name:"objekt"}return u},i={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return a=>{switch(a.code){case"invalid_type":return`Ugyldigt input: forventede ${o(a.expected)}, fik ${o(r(a.input))}`;case"invalid_value":return a.values.length===1?`Ugyldig v\xE6rdi: forventede ${A(a.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${w(a.values,"|")}`;case"too_big":{let u=a.inclusive?"<=":"<",l=n(a.origin),c=o(a.origin);return l?`For stor: forventede ${c??"value"} ${l.verb} ${u} ${a.maximum.toString()} ${l.unit??"elementer"}`:`For stor: forventede ${c??"value"} havde ${u} ${a.maximum.toString()}`}case"too_small":{let u=a.inclusive?">=":">",l=n(a.origin),c=o(a.origin);return l?`For lille: forventede ${c} ${l.verb} ${u} ${a.minimum.toString()} ${l.unit}`:`For lille: forventede ${c} havde ${u} ${a.minimum.toString()}`}case"invalid_format":{let u=a;return u.format==="starts_with"?`Ugyldig streng: skal starte med "${u.prefix}"`:u.format==="ends_with"?`Ugyldig streng: skal ende med "${u.suffix}"`:u.format==="includes"?`Ugyldig streng: skal indeholde "${u.includes}"`:u.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${u.pattern}`:`Ugyldig ${i[u.format]??a.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${a.divisor}`;case"unrecognized_keys":return`${a.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${w(a.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${a.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${a.origin}`;default:return"Ugyldigt input"}}};function Em(){return{localeError:W_()}}var K_=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"Zahl";case"object":{if(Array.isArray(r))return"Array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return r=>{switch(r.code){case"invalid_type":return`Ung\xFCltige Eingabe: erwartet ${r.expected}, erhalten ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Ung\xFCltige Eingabe: erwartet ${A(r.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${i}${r.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${i}${r.maximum.toString()} ist`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Zu klein: erwartet, dass ${r.origin} ${i}${r.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${r.origin} ${i}${r.minimum.toString()} ist`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ung\xFCltiger String: muss mit "${i.prefix}" beginnen`:i.format==="ends_with"?`Ung\xFCltiger String: muss mit "${i.suffix}" enden`:i.format==="includes"?`Ung\xFCltiger String: muss "${i.includes}" enthalten`:i.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${i.pattern} entsprechen`:`Ung\xFCltig: ${o[i.format]??r.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${r.divisor} sein`;case"unrecognized_keys":return`${r.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${w(r.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${r.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${r.origin}`;default:return"Ung\xFCltige Eingabe"}}};function Tm(){return{localeError:K_()}}var H_=e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},Y_=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function t(o){return e[o]??null}let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Invalid input: expected ${o.expected}, received ${H_(o.input)}`;case"invalid_value":return o.values.length===1?`Invalid input: expected ${A(o.values[0])}`:`Invalid option: expected one of ${w(o.values,"|")}`;case"too_big":{let r=o.inclusive?"<=":"<",i=t(o.origin);return i?`Too big: expected ${o.origin??"value"} to have ${r}${o.maximum.toString()} ${i.unit??"elements"}`:`Too big: expected ${o.origin??"value"} to be ${r}${o.maximum.toString()}`}case"too_small":{let r=o.inclusive?">=":">",i=t(o.origin);return i?`Too small: expected ${o.origin} to have ${r}${o.minimum.toString()} ${i.unit}`:`Too small: expected ${o.origin} to be ${r}${o.minimum.toString()}`}case"invalid_format":{let r=o;return r.format==="starts_with"?`Invalid string: must start with "${r.prefix}"`:r.format==="ends_with"?`Invalid string: must end with "${r.suffix}"`:r.format==="includes"?`Invalid string: must include "${r.includes}"`:r.format==="regex"?`Invalid string: must match pattern ${r.pattern}`:`Invalid ${n[r.format]??o.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${o.divisor}`;case"unrecognized_keys":return`Unrecognized key${o.keys.length>1?"s":""}: ${w(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}};function _i(){return{localeError:Y_()}}var X_=e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"nombro";case"object":{if(Array.isArray(e))return"tabelo";if(e===null)return"senvalora";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},Q_=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(o){return e[o]??null}let n={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return o=>{switch(o.code){case"invalid_type":return`Nevalida enigo: atendi\u011Dis ${o.expected}, ricevi\u011Dis ${X_(o.input)}`;case"invalid_value":return o.values.length===1?`Nevalida enigo: atendi\u011Dis ${A(o.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${w(o.values,"|")}`;case"too_big":{let r=o.inclusive?"<=":"<",i=t(o.origin);return i?`Tro granda: atendi\u011Dis ke ${o.origin??"valoro"} havu ${r}${o.maximum.toString()} ${i.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${o.origin??"valoro"} havu ${r}${o.maximum.toString()}`}case"too_small":{let r=o.inclusive?">=":">",i=t(o.origin);return i?`Tro malgranda: atendi\u011Dis ke ${o.origin} havu ${r}${o.minimum.toString()} ${i.unit}`:`Tro malgranda: atendi\u011Dis ke ${o.origin} estu ${r}${o.minimum.toString()}`}case"invalid_format":{let r=o;return r.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${r.prefix}"`:r.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${r.suffix}"`:r.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${r.includes}"`:r.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${r.pattern}`:`Nevalida ${n[r.format]??o.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${o.divisor}`;case"unrecognized_keys":return`Nekonata${o.keys.length>1?"j":""} \u015Dlosilo${o.keys.length>1?"j":""}: ${w(o.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${o.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${o.origin}`;default:return"Nevalida enigo"}}};function Cm(){return{localeError:Q_()}}var ex=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}},t={string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};function n(a){return e[a]??null}function o(a){return t[a]??a}let r=a=>{let u=typeof a;switch(u){case"number":return Number.isNaN(a)?"NaN":"number";case"object":return Array.isArray(a)?"array":a===null?"null":Object.getPrototypeOf(a)!==Object.prototype?a.constructor.name:"object"}return u},i={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return a=>{switch(a.code){case"invalid_type":return`Entrada inv\xE1lida: se esperaba ${o(a.expected)}, recibido ${o(r(a.input))}`;case"invalid_value":return a.values.length===1?`Entrada inv\xE1lida: se esperaba ${A(a.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${w(a.values,"|")}`;case"too_big":{let u=a.inclusive?"<=":"<",l=n(a.origin),c=o(a.origin);return l?`Demasiado grande: se esperaba que ${c??"valor"} tuviera ${u}${a.maximum.toString()} ${l.unit??"elementos"}`:`Demasiado grande: se esperaba que ${c??"valor"} fuera ${u}${a.maximum.toString()}`}case"too_small":{let u=a.inclusive?">=":">",l=n(a.origin),c=o(a.origin);return l?`Demasiado peque\xF1o: se esperaba que ${c} tuviera ${u}${a.minimum.toString()} ${l.unit}`:`Demasiado peque\xF1o: se esperaba que ${c} fuera ${u}${a.minimum.toString()}`}case"invalid_format":{let u=a;return u.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${u.prefix}"`:u.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${u.suffix}"`:u.format==="includes"?`Cadena inv\xE1lida: debe incluir "${u.includes}"`:u.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${u.pattern}`:`Inv\xE1lido ${i[u.format]??a.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${a.divisor}`;case"unrecognized_keys":return`Llave${a.keys.length>1?"s":""} desconocida${a.keys.length>1?"s":""}: ${w(a.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o(a.origin)}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o(a.origin)}`;default:return"Entrada inv\xE1lida"}}};function Am(){return{localeError:ex()}}var tx=()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(r))return"\u0622\u0631\u0627\u06CC\u0647";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"};return r=>{switch(r.code){case"invalid_type":return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${r.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${n(r.input)} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;case"invalid_value":return r.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${A(r.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${w(r.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${r.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${r.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${i}${r.minimum.toString()} ${a.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${i}${r.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:i.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:i.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${i.includes}" \u0628\u0627\u0634\u062F`:i.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${i.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${o[i.format]??r.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${r.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${r.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${w(r.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${r.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${r.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function Pm(){return{localeError:tx()}}var rx=()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return r=>{switch(r.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${r.expected}, oli ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${A(r.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Liian suuri: ${a.subject} t\xE4ytyy olla ${i}${r.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Liian pieni: ${a.subject} t\xE4ytyy olla ${i}${r.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${i.prefix}"`:i.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${i.suffix}"`:i.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${i.includes}"`:i.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${i.pattern}`:`Virheellinen ${o[i.format]??r.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${r.divisor} monikerta`;case"unrecognized_keys":return`${r.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${w(r.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}};function Om(){return{localeError:rx()}}var nx=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"nombre";case"object":{if(Array.isArray(r))return"tableau";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return r=>{switch(r.code){case"invalid_type":return`Entr\xE9e invalide : ${r.expected} attendu, ${n(r.input)} re\xE7u`;case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : ${A(r.values[0])} attendu`:`Option invalide : une valeur parmi ${w(r.values,"|")} attendue`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Trop grand : ${r.origin??"valeur"} doit ${a.verb} ${i}${r.maximum.toString()} ${a.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${r.origin??"valeur"} doit \xEAtre ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Trop petit : ${r.origin} doit ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`:`Trop petit : ${r.origin} doit \xEAtre ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${i.pattern}`:`${o[i.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${w(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}};function jm(){return{localeError:nx()}}var ox=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return r=>{switch(r.code){case"invalid_type":return`Entr\xE9e invalide : attendu ${r.expected}, re\xE7u ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : attendu ${A(r.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"\u2264":"<",a=t(r.origin);return a?`Trop grand : attendu que ${r.origin??"la valeur"} ait ${i}${r.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${r.origin??"la valeur"} soit ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"\u2265":">",a=t(r.origin);return a?`Trop petit : attendu que ${r.origin} ait ${i}${r.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${r.origin} soit ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${i.pattern}`:`${o[i.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${w(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}};function Nm(){return{localeError:ox()}}var ix=()=>{let e={string:{unit:"\u05D0\u05D5\u05EA\u05D9\u05D5\u05EA",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u05E7\u05DC\u05D8",email:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",url:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",emoji:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",date:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",time:"\u05D6\u05DE\u05DF ISO",duration:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",ipv4:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",ipv6:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",cidrv4:"\u05D8\u05D5\u05D5\u05D7 IPv4",cidrv6:"\u05D8\u05D5\u05D5\u05D7 IPv6",base64:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",base64url:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",json_string:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",e164:"\u05DE\u05E1\u05E4\u05E8 E.164",jwt:"JWT",template_literal:"\u05E7\u05DC\u05D8"};return r=>{switch(r.code){case"invalid_type":return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${r.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${A(r.values[0])}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05D0\u05D7\u05EA \u05DE\u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${r.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${i}${r.maximum.toString()} ${a.unit??"elements"}`:`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${r.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${r.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${i}${r.minimum.toString()} ${a.unit}`:`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${r.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1"${i.prefix}"`:i.format==="ends_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${i.suffix}"`:i.format==="includes"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${i.includes}"`:i.format==="regex"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${i.pattern}`:`${o[i.format]??r.format} \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${r.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${r.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${r.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${w(r.keys,", ")}`;case"invalid_key":return`\u05DE\u05E4\u05EA\u05D7 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${r.origin}`;case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${r.origin}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function zm(){return{localeError:ix()}}var ax=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"sz\xE1m";case"object":{if(Array.isArray(r))return"t\xF6mb";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"};return r=>{switch(r.code){case"invalid_type":return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${r.expected}, a kapott \xE9rt\xE9k ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${A(r.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`T\xFAl nagy: ${r.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${i}${r.maximum.toString()} ${a.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${r.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} m\xE9rete t\xFAl kicsi ${i}${r.minimum.toString()} ${a.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} t\xFAl kicsi ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\xC9rv\xE9nytelen string: "${i.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:i.format==="ends_with"?`\xC9rv\xE9nytelen string: "${i.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:i.format==="includes"?`\xC9rv\xE9nytelen string: "${i.includes}" \xE9rt\xE9ket kell tartalmaznia`:i.format==="regex"?`\xC9rv\xE9nytelen string: ${i.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${o[i.format]??r.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${r.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${r.keys.length>1?"s":""}: ${w(r.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${r.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${r.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function Rm(){return{localeError:ax()}}var sx=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Input tidak valid: diharapkan ${r.expected}, diterima ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Input tidak valid: diharapkan ${A(r.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Terlalu besar: diharapkan ${r.origin??"value"} memiliki ${i}${r.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${r.origin??"value"} menjadi ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Terlalu kecil: diharapkan ${r.origin} memiliki ${i}${r.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${r.origin} menjadi ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`String tidak valid: harus dimulai dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak valid: harus berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak valid: harus menyertakan "${i.includes}"`:i.format==="regex"?`String tidak valid: harus sesuai pola ${i.pattern}`:`${o[i.format]??r.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${r.keys.length>1?"s":""}: ${w(r.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${r.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${r.origin}`;default:return"Input tidak valid"}}};function Fm(){return{localeError:sx()}}var ux=e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"n\xFAmer";case"object":{if(Array.isArray(e))return"fylki";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},lx=()=>{let e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function t(o){return e[o]??null}let n={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"};return o=>{switch(o.code){case"invalid_type":return`Rangt gildi: \xDE\xFA sl\xF3st inn ${ux(o.input)} \xFEar sem \xE1 a\xF0 vera ${o.expected}`;case"invalid_value":return o.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${A(o.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${w(o.values,"|")}`;case"too_big":{let r=o.inclusive?"<=":"<",i=t(o.origin);return i?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${o.origin??"gildi"} hafi ${r}${o.maximum.toString()} ${i.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${o.origin??"gildi"} s\xE9 ${r}${o.maximum.toString()}`}case"too_small":{let r=o.inclusive?">=":">",i=t(o.origin);return i?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${o.origin} hafi ${r}${o.minimum.toString()} ${i.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${o.origin} s\xE9 ${r}${o.minimum.toString()}`}case"invalid_format":{let r=o;return r.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${r.prefix}"`:r.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${r.suffix}"`:r.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${r.includes}"`:r.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${r.pattern}`:`Rangt ${n[r.format]??o.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${o.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${o.keys.length>1?"ir lyklar":"ur lykill"}: ${w(o.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${o.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${o.origin}`;default:return"Rangt gildi"}}};function Mm(){return{localeError:lx()}}var cx=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"numero";case"object":{if(Array.isArray(r))return"vettore";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Input non valido: atteso ${r.expected}, ricevuto ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Input non valido: atteso ${A(r.values[0])}`:`Opzione non valida: atteso uno tra ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Troppo grande: ${r.origin??"valore"} deve avere ${i}${r.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${r.origin??"valore"} deve essere ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Troppo piccolo: ${r.origin} deve avere ${i}${r.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${r.origin} deve essere ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Stringa non valida: deve iniziare con "${i.prefix}"`:i.format==="ends_with"?`Stringa non valida: deve terminare con "${i.suffix}"`:i.format==="includes"?`Stringa non valida: deve includere "${i.includes}"`:i.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${i.pattern}`:`Invalid ${o[i.format]??r.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${r.divisor}`;case"unrecognized_keys":return`Chiav${r.keys.length>1?"i":"e"} non riconosciut${r.keys.length>1?"e":"a"}: ${w(r.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${r.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${r.origin}`;default:return"Input non valido"}}};function Um(){return{localeError:cx()}}var dx=()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u6570\u5024";case"object":{if(Array.isArray(r))return"\u914D\u5217";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"};return r=>{switch(r.code){case"invalid_type":return`\u7121\u52B9\u306A\u5165\u529B: ${r.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${n(r.input)}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;case"invalid_value":return r.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${A(r.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${w(r.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let i=r.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",a=t(r.origin);return a?`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${a.unit??"\u8981\u7D20"}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let i=r.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",a=t(r.origin);return a?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${a.unit}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${i.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${o[i.format]??r.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${r.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${r.keys.length>1?"\u7FA4":""}: ${w(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function Zm(){return{localeError:dx()}}var px=e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8";case"object":{if(Array.isArray(e))return"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return{string:"\u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",undefined:"undefined",bigint:"bigint",symbol:"symbol",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0"}[t]??t},mx=()=>{let e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(o){return e[o]??null}let n={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",json_string:"JSON \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"};return o=>{switch(o.code){case"invalid_type":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${px(o.input)}`;case"invalid_value":return o.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${A(o.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${w(o.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let r=o.inclusive?"<=":"<",i=t(o.origin);return i?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${i.verb} ${r}${o.maximum.toString()} ${i.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${r}${o.maximum.toString()}`}case"too_small":{let r=o.inclusive?">=":">",i=t(o.origin);return i?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o.origin} ${i.verb} ${r}${o.minimum.toString()} ${i.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o.origin} \u10D8\u10E7\u10DD\u10E1 ${r}${o.minimum.toString()}`}case"invalid_format":{let r=o;return r.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${r.prefix}"-\u10D8\u10D7`:r.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${r.suffix}"-\u10D8\u10D7`:r.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${r.includes}"-\u10E1`:r.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${r.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${n[r.format]??o.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${o.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${o.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${w(o.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${o.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${o.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function Lm(){return{localeError:mx()}}var fx=()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"\u1798\u17B7\u1793\u1798\u17C2\u1793\u1787\u17B6\u179B\u17C1\u1781 (NaN)":"\u179B\u17C1\u1781";case"object":{if(Array.isArray(r))return"\u17A2\u17B6\u179A\u17C1 (Array)";if(r===null)return"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"};return r=>{switch(r.code){case"invalid_type":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${A(r.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${r.maximum.toString()} ${a.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${i} ${r.minimum.toString()} ${a.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${i.prefix}"`:i.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${i.suffix}"`:i.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${i.includes}"`:i.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${i.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${o[i.format]??r.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${r.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${w(r.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${r.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${r.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function xi(){return{localeError:fx()}}function Bm(){return xi()}var gx=()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"};return r=>{switch(r.code){case"invalid_type":return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${r.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${n(r.input)}\uC785\uB2C8\uB2E4`;case"invalid_value":return r.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${A(r.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${w(r.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let i=r.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",a=i==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",u=t(r.origin),l=u?.unit??"\uC694\uC18C";return u?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()}${l} ${i}${a}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()} ${i}${a}`}case"too_small":{let i=r.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",a=i==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",u=t(r.origin),l=u?.unit??"\uC694\uC18C";return u?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()}${l} ${i}${a}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()} ${i}${a}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:i.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${i.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${o[i.format]??r.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${r.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${w(r.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${r.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${r.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function Vm(){return{localeError:gx()}}var hx=e=>Rn(typeof e,e),Rn=(e,t=void 0)=>{switch(e){case"number":return Number.isNaN(t)?"NaN":"skai\u010Dius";case"bigint":return"sveikasis skai\u010Dius";case"string":return"eilut\u0117";case"boolean":return"login\u0117 reik\u0161m\u0117";case"undefined":case"void":return"neapibr\u0117\u017Eta reik\u0161m\u0117";case"function":return"funkcija";case"symbol":return"simbolis";case"object":return t===void 0?"ne\u017Einomas objektas":t===null?"nulin\u0117 reik\u0161m\u0117":Array.isArray(t)?"masyvas":Object.getPrototypeOf(t)!==Object.prototype&&t.constructor?t.constructor.name:"objektas";case"null":return"nulin\u0117 reik\u0161m\u0117"}return e},zn=e=>e.charAt(0).toUpperCase()+e.slice(1);function qm(e){let t=Math.abs(e),n=t%10,o=t%100;return o>=11&&o<=19||n===0?"many":n===1?"one":"few"}var vx=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(o,r,i,a){let u=e[o]??null;return u===null?u:{unit:u.unit[r],verb:u.verb[a][i?"inclusive":"notInclusive"]}}let n={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"};return o=>{switch(o.code){case"invalid_type":return`Gautas tipas ${hx(o.input)}, o tik\u0117tasi - ${Rn(o.expected)}`;case"invalid_value":return o.values.length===1?`Privalo b\u016Bti ${A(o.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${w(o.values,"|")} pasirinkim\u0173`;case"too_big":{let r=Rn(o.origin),i=t(o.origin,qm(Number(o.maximum)),o.inclusive??!1,"smaller");if(i?.verb)return`${zn(r??o.origin??"reik\u0161m\u0117")} ${i.verb} ${o.maximum.toString()} ${i.unit??"element\u0173"}`;let a=o.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${zn(r??o.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${o.maximum.toString()} ${i?.unit}`}case"too_small":{let r=Rn(o.origin),i=t(o.origin,qm(Number(o.minimum)),o.inclusive??!1,"bigger");if(i?.verb)return`${zn(r??o.origin??"reik\u0161m\u0117")} ${i.verb} ${o.minimum.toString()} ${i.unit??"element\u0173"}`;let a=o.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${zn(r??o.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${o.minimum.toString()} ${i?.unit}`}case"invalid_format":{let r=o;return r.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${r.prefix}"`:r.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${r.suffix}"`:r.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${r.includes}"`:r.format==="regex"?`Eilut\u0117 privalo atitikti ${r.pattern}`:`Neteisingas ${n[r.format]??o.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${o.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${o.keys.length>1?"i":"as"} rakt${o.keys.length>1?"ai":"as"}: ${w(o.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let r=Rn(o.origin);return`${zn(r??o.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function Jm(){return{localeError:vx()}}var yx=()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0431\u0440\u043E\u0458";case"object":{if(Array.isArray(r))return"\u043D\u0438\u0437\u0430";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"};return r=>{switch(r.code){case"invalid_type":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Invalid input: expected ${A(r.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${i}${r.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0438\u043C\u0430 ${i}${r.minimum.toString()} ${a.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${i.pattern}`:`Invalid ${o[i.format]??r.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${w(r.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${r.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${r.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function Gm(){return{localeError:yx()}}var bx=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"nombor";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Input tidak sah: dijangka ${r.expected}, diterima ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Input tidak sah: dijangka ${A(r.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Terlalu besar: dijangka ${r.origin??"nilai"} ${a.verb} ${i}${r.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${r.origin??"nilai"} adalah ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Terlalu kecil: dijangka ${r.origin} ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${r.origin} adalah ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`String tidak sah: mesti bermula dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak sah: mesti mengandungi "${i.includes}"`:i.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${i.pattern}`:`${o[i.format]??r.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${w(r.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${r.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${r.origin}`;default:return"Input tidak sah"}}};function Wm(){return{localeError:bx()}}var _x=()=>{let e={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"getal";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return r=>{switch(r.code){case"invalid_type":return`Ongeldige invoer: verwacht ${r.expected}, ontving ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Ongeldige invoer: verwacht ${A(r.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Te lang: verwacht dat ${r.origin??"waarde"} ${i}${r.maximum.toString()} ${a.unit??"elementen"} bevat`:`Te lang: verwacht dat ${r.origin??"waarde"} ${i}${r.maximum.toString()} is`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Te kort: verwacht dat ${r.origin} ${i}${r.minimum.toString()} ${a.unit} bevat`:`Te kort: verwacht dat ${r.origin} ${i}${r.minimum.toString()} is`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ongeldige tekst: moet met "${i.prefix}" beginnen`:i.format==="ends_with"?`Ongeldige tekst: moet op "${i.suffix}" eindigen`:i.format==="includes"?`Ongeldige tekst: moet "${i.includes}" bevatten`:i.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`:`Ongeldig: ${o[i.format]??r.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${r.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${r.keys.length>1?"s":""}: ${w(r.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${r.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${r.origin}`;default:return"Ongeldige invoer"}}};function Km(){return{localeError:_x()}}var xx=()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"tall";case"object":{if(Array.isArray(r))return"liste";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Ugyldig input: forventet ${r.expected}, fikk ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Ugyldig verdi: forventet ${A(r.values[0])}`:`Ugyldig valg: forventet en av ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${i}${r.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`For lite(n): forventet ${r.origin} til \xE5 ha ${i}${r.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${r.origin} til \xE5 ha ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${o[i.format]??r.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${w(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${r.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${r.origin}`;default:return"Ugyldig input"}}};function Hm(){return{localeError:xx()}}var Dx=()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"numara";case"object":{if(Array.isArray(r))return"saf";if(r===null)return"gayb";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"};return r=>{switch(r.code){case"invalid_type":return`F\xE2sit giren: umulan ${r.expected}, al\u0131nan ${n(r.input)}`;case"invalid_value":return r.values.length===1?`F\xE2sit giren: umulan ${A(r.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${i}${r.maximum.toString()} ${a.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${i}${r.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${i}${r.minimum.toString()} ${a.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${i}${r.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let i=r;return i.format==="starts_with"?`F\xE2sit metin: "${i.prefix}" ile ba\u015Flamal\u0131.`:i.format==="ends_with"?`F\xE2sit metin: "${i.suffix}" ile bitmeli.`:i.format==="includes"?`F\xE2sit metin: "${i.includes}" ihtiv\xE2 etmeli.`:i.format==="regex"?`F\xE2sit metin: ${i.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${o[i.format]??r.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${r.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${r.keys.length>1?"s":""}: ${w(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${r.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function Ym(){return{localeError:Dx()}}var wx=()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(r))return"\u0627\u0631\u06D0";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"};return r=>{switch(r.code){case"invalid_type":return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${r.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${n(r.input)} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`;case"invalid_value":return r.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${A(r.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${w(r.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${r.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${r.maximum.toString()} \u0648\u064A`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${i}${r.minimum.toString()} ${a.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${i}${r.minimum.toString()} \u0648\u064A`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:i.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:i.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${i.includes}" \u0648\u0644\u0631\u064A`:i.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${i.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${o[i.format]??r.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${r.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${r.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${w(r.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${r.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${r.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function Xm(){return{localeError:wx()}}var kx=()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"liczba";case"object":{if(Array.isArray(r))return"tablica";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"};return r=>{switch(r.code){case"invalid_type":return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${r.expected}, otrzymano ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${A(r.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${r.maximum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${r.minimum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${i.prefix}"`:i.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${i.suffix}"`:i.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${i.includes}"`:i.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${i.pattern}`:`Nieprawid\u0142ow(y/a/e) ${o[i.format]??r.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${r.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${r.keys.length>1?"s":""}: ${w(r.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${r.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${r.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function Qm(){return{localeError:kx()}}var $x=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(r))return"array";if(r===null)return"nulo";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return r=>{switch(r.code){case"invalid_type":return`Tipo inv\xE1lido: esperado ${r.expected}, recebido ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Entrada inv\xE1lida: esperado ${A(r.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Muito grande: esperado que ${r.origin??"valor"} tivesse ${i}${r.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${r.origin??"valor"} fosse ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Muito pequeno: esperado que ${r.origin} tivesse ${i}${r.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${r.origin} fosse ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${i.prefix}"`:i.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${i.suffix}"`:i.format==="includes"?`Texto inv\xE1lido: deve incluir "${i.includes}"`:i.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${i.pattern}`:`${o[i.format]??r.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${r.divisor}`;case"unrecognized_keys":return`Chave${r.keys.length>1?"s":""} desconhecida${r.keys.length>1?"s":""}: ${w(r.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${r.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${r.origin}`;default:return"Campo inv\xE1lido"}}};function ef(){return{localeError:$x()}}function tf(e,t,n,o){let r=Math.abs(e),i=r%10,a=r%100;return a>=11&&a<=19?o:i===1?t:i>=2&&i<=4?n:o}var Sx=()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(r))return"\u043C\u0430\u0441\u0441\u0438\u0432";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"};return r=>{switch(r.code){case"invalid_type":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${r.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${A(r.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a){let u=Number(r.maximum),l=tf(u,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${r.maximum.toString()} ${l}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a){let u=Number(r.minimum),l=tf(u,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${r.minimum.toString()} ${l}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin} \u0431\u0443\u0434\u0435\u0442 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${o[i.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${r.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0438":""}: ${w(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${r.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function rf(){return{localeError:Sx()}}var Ix=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0161tevilo";case"object":{if(Array.isArray(r))return"tabela";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"};return r=>{switch(r.code){case"invalid_type":return`Neveljaven vnos: pri\u010Dakovano ${r.expected}, prejeto ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${A(r.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} imelo ${i}${r.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Premajhno: pri\u010Dakovano, da bo ${r.origin} imelo ${i}${r.minimum.toString()} ${a.unit}`:`Premajhno: pri\u010Dakovano, da bo ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${i.prefix}"`:i.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${i.suffix}"`:i.format==="includes"?`Neveljaven niz: mora vsebovati "${i.includes}"`:i.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`:`Neveljaven ${o[i.format]??r.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${r.divisor}`;case"unrecognized_keys":return`Neprepoznan${r.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${w(r.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${r.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${r.origin}`;default:return"Neveljaven vnos"}}};function nf(){return{localeError:Ix()}}var Ex=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"antal";case"object":{if(Array.isArray(r))return"lista";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return r=>{switch(r.code){case"invalid_type":return`Ogiltig inmatning: f\xF6rv\xE4ntat ${r.expected}, fick ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${A(r.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`F\xF6r stor(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${i}${r.maximum.toString()} ${a.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${r.origin??"v\xE4rdet"} att ha ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${i}${r.minimum.toString()} ${a.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${i.prefix}"`:i.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${i.suffix}"`:i.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${i.includes}"`:i.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${i.pattern}"`:`Ogiltig(t) ${o[i.format]??r.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${w(r.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${r.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${r.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function of(){return{localeError:Ex()}}var Tx=()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"\u0B8E\u0BA3\u0BCD \u0B85\u0BB2\u0BCD\u0BB2\u0BBE\u0BA4\u0BA4\u0BC1":"\u0B8E\u0BA3\u0BCD";case"object":{if(Array.isArray(r))return"\u0B85\u0BA3\u0BBF";if(r===null)return"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${A(r.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${w(r.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${r.maximum.toString()} ${a.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${r.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin} ${i}${r.minimum.toString()} ${a.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin} ${i}${r.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${i.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${o[i.format]??r.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${r.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${r.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${w(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${r.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function af(){return{localeError:Tx()}}var Cx=()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02 (NaN)":"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02";case"object":{if(Array.isArray(r))return"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)";if(r===null)return"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"};return r=>{switch(r.code){case"invalid_type":return`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${r.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${A(r.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",a=t(r.origin);return a?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${r.maximum.toString()} ${a.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",a=t(r.origin);return a?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${r.minimum.toString()} ${a.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${i.prefix}"`:i.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${i.suffix}"`:i.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${i.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:i.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${i.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${o[i.format]??r.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${r.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${w(r.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function sf(){return{localeError:Cx()}}var Ax=e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},Px=()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(o){return e[o]??null}let n={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"};return o=>{switch(o.code){case"invalid_type":return`Ge\xE7ersiz de\u011Fer: beklenen ${o.expected}, al\u0131nan ${Ax(o.input)}`;case"invalid_value":return o.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${A(o.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${w(o.values,"|")}`;case"too_big":{let r=o.inclusive?"<=":"<",i=t(o.origin);return i?`\xC7ok b\xFCy\xFCk: beklenen ${o.origin??"de\u011Fer"} ${r}${o.maximum.toString()} ${i.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${o.origin??"de\u011Fer"} ${r}${o.maximum.toString()}`}case"too_small":{let r=o.inclusive?">=":">",i=t(o.origin);return i?`\xC7ok k\xFC\xE7\xFCk: beklenen ${o.origin} ${r}${o.minimum.toString()} ${i.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${o.origin} ${r}${o.minimum.toString()}`}case"invalid_format":{let r=o;return r.format==="starts_with"?`Ge\xE7ersiz metin: "${r.prefix}" ile ba\u015Flamal\u0131`:r.format==="ends_with"?`Ge\xE7ersiz metin: "${r.suffix}" ile bitmeli`:r.format==="includes"?`Ge\xE7ersiz metin: "${r.includes}" i\xE7ermeli`:r.format==="regex"?`Ge\xE7ersiz metin: ${r.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${n[r.format]??o.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${o.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${o.keys.length>1?"lar":""}: ${w(o.keys,", ")}`;case"invalid_key":return`${o.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${o.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function uf(){return{localeError:Px()}}var Ox=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(r))return"\u043C\u0430\u0441\u0438\u0432";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"};return r=>{switch(r.code){case"invalid_type":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${r.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${A(r.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${a.verb} ${i}${r.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} \u0431\u0443\u0434\u0435 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${o[i.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0456":""}: ${w(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${r.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function Di(){return{localeError:Ox()}}function lf(){return Di()}var jx=()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0646\u0645\u0628\u0631";case"object":{if(Array.isArray(r))return"\u0622\u0631\u06D2";if(r===null)return"\u0646\u0644";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"};return r=>{switch(r.code){case"invalid_type":return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${r.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${n(r.input)} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;case"invalid_value":return r.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${A(r.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${w(r.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${i}${r.maximum.toString()} ${a.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${i}${r.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u06D2 ${i}${r.minimum.toString()} ${a.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u0627 ${i}${r.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${i.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${o[i.format]??r.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${r.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${r.keys.length>1?"\u0632":""}: ${w(r.keys,"\u060C ")}`;case"invalid_key":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function cf(){return{localeError:jx()}}var Nx=()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"s\u1ED1";case"object":{if(Array.isArray(r))return"m\u1EA3ng";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"};return r=>{switch(r.code){case"invalid_type":return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${r.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${A(r.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${a.verb} ${i}${r.maximum.toString()} ${a.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${i.prefix}"`:i.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${i.suffix}"`:i.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${i.includes}"`:i.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${i.pattern}`:`${o[i.format]??r.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${r.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${w(r.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function df(){return{localeError:Nx()}}var zx=()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"\u975E\u6570\u5B57(NaN)":"\u6570\u5B57";case"object":{if(Array.isArray(r))return"\u6570\u7EC4";if(r===null)return"\u7A7A\u503C(null)";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"};return r=>{switch(r.code){case"invalid_type":return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${r.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${A(r.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${i}${r.maximum.toString()} ${a.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${i}${r.minimum.toString()} ${a.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.prefix}" \u5F00\u5934`:i.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.suffix}" \u7ED3\u5C3E`:i.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${i.pattern}`:`\u65E0\u6548${o[i.format]??r.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${r.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${w(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${r.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function pf(){return{localeError:zx()}}var Rx=()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"};return r=>{switch(r.code){case"invalid_type":return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${r.expected}\uFF0C\u4F46\u6536\u5230 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${A(r.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${i}${r.maximum.toString()} ${a.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${i}${r.minimum.toString()} ${a.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.prefix}" \u958B\u982D`:i.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.suffix}" \u7D50\u5C3E`:i.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${i.pattern}`:`\u7121\u6548\u7684 ${o[i.format]??r.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${r.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${r.keys.length>1?"\u5011":""}\uFF1A${w(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function mf(){return{localeError:Rx()}}var Fx=()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"n\u1ECD\u0301mb\xE0";case"object":{if(Array.isArray(r))return"akop\u1ECD";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"};return r=>{switch(r.code){case"invalid_type":return`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${r.expected}, \xE0m\u1ECD\u0300 a r\xED ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${A(r.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin??"iye"} ${a.verb} ${i}${r.maximum} ${a.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${r.maximum}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin} ${a.verb} ${i}${r.minimum} ${a.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${r.minimum}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${i.prefix}"`:i.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${i.suffix}"`:i.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${i.includes}"`:i.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${i.pattern}`:`A\u1E63\xEC\u1E63e: ${o[i.format]??r.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${r.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${w(r.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${r.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${r.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function ff(){return{localeError:Fx()}}var pl=Symbol("ZodOutput"),ml=Symbol("ZodInput"),Pr=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){let o=n[0];if(this._map.set(t,o),o&&typeof o=="object"&&"id"in o){if(this._idmap.has(o.id))throw new Error(`ID ${o.id} already exists in the registry`);this._idmap.set(o.id,t)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){let n=t._zod.parent;if(n){let o={...this.get(n)??{}};delete o.id;let r={...o,...this._map.get(t)};return Object.keys(r).length?r:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function wi(){return new Pr}var ht=wi();function fl(e,t){return new e({type:"string",...P(t)})}function gl(e,t){return new e({type:"string",coerce:!0,...P(t)})}function ki(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...P(t)})}function Mn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...P(t)})}function $i(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...P(t)})}function Si(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...P(t)})}function Ii(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...P(t)})}function Ei(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...P(t)})}function Un(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...P(t)})}function Ti(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...P(t)})}function Ci(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...P(t)})}function Ai(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...P(t)})}function Pi(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...P(t)})}function Oi(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...P(t)})}function ji(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...P(t)})}function Ni(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...P(t)})}function zi(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...P(t)})}function Ri(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...P(t)})}function Fi(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...P(t)})}function Mi(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...P(t)})}function Ui(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...P(t)})}function Zi(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...P(t)})}function Li(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...P(t)})}function Bi(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...P(t)})}var hl={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function vl(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...P(t)})}function yl(e,t){return new e({type:"string",format:"date",check:"string_format",...P(t)})}function bl(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...P(t)})}function _l(e,t){return new e({type:"string",format:"duration",check:"string_format",...P(t)})}function xl(e,t){return new e({type:"number",checks:[],...P(t)})}function Dl(e,t){return new e({type:"number",coerce:!0,checks:[],...P(t)})}function wl(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...P(t)})}function kl(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...P(t)})}function $l(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...P(t)})}function Sl(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...P(t)})}function Il(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...P(t)})}function El(e,t){return new e({type:"boolean",...P(t)})}function Tl(e,t){return new e({type:"boolean",coerce:!0,...P(t)})}function Cl(e,t){return new e({type:"bigint",...P(t)})}function Al(e,t){return new e({type:"bigint",coerce:!0,...P(t)})}function Pl(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...P(t)})}function Ol(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...P(t)})}function jl(e,t){return new e({type:"symbol",...P(t)})}function Nl(e,t){return new e({type:"undefined",...P(t)})}function zl(e,t){return new e({type:"null",...P(t)})}function Rl(e){return new e({type:"any"})}function Fl(e){return new e({type:"unknown"})}function Ml(e,t){return new e({type:"never",...P(t)})}function Ul(e,t){return new e({type:"void",...P(t)})}function Zl(e,t){return new e({type:"date",...P(t)})}function Ll(e,t){return new e({type:"date",coerce:!0,...P(t)})}function Bl(e,t){return new e({type:"nan",...P(t)})}function St(e,t){return new li({check:"less_than",...P(t),value:e,inclusive:!1})}function Xe(e,t){return new li({check:"less_than",...P(t),value:e,inclusive:!0})}function It(e,t){return new ci({check:"greater_than",...P(t),value:e,inclusive:!1})}function Re(e,t){return new ci({check:"greater_than",...P(t),value:e,inclusive:!0})}function Vl(e){return It(0,e)}function ql(e){return St(0,e)}function Jl(e){return Xe(0,e)}function Gl(e){return Re(0,e)}function cr(e,t){return new Ms({check:"multiple_of",...P(t),value:e})}function Or(e,t){return new Ls({check:"max_size",...P(t),maximum:e})}function dr(e,t){return new Bs({check:"min_size",...P(t),minimum:e})}function Zn(e,t){return new Vs({check:"size_equals",...P(t),size:e})}function jr(e,t){return new qs({check:"max_length",...P(t),maximum:e})}function Yt(e,t){return new Js({check:"min_length",...P(t),minimum:e})}function Nr(e,t){return new Gs({check:"length_equals",...P(t),length:e})}function Ln(e,t){return new Ws({check:"string_format",format:"regex",...P(t),pattern:e})}function Bn(e){return new Ks({check:"string_format",format:"lowercase",...P(e)})}function Vn(e){return new Hs({check:"string_format",format:"uppercase",...P(e)})}function qn(e,t){return new Ys({check:"string_format",format:"includes",...P(t),includes:e})}function Jn(e,t){return new Xs({check:"string_format",format:"starts_with",...P(t),prefix:e})}function Gn(e,t){return new Qs({check:"string_format",format:"ends_with",...P(t),suffix:e})}function Wl(e,t,n){return new eu({check:"property",property:e,schema:t,...P(n)})}function Wn(e,t){return new tu({check:"mime_type",mime:e,...P(t)})}function Et(e){return new ru({check:"overwrite",tx:e})}function Kn(e){return Et(t=>t.normalize(e))}function Hn(){return Et(e=>e.trim())}function Yn(){return Et(e=>e.toLowerCase())}function Xn(){return Et(e=>e.toUpperCase())}function Kl(e,t,n){return new e({type:"array",element:t,...P(n)})}function Mx(e,t,n){return new e({type:"union",options:t,...P(n)})}function Ux(e,t,n,o){return new e({type:"union",options:n,discriminator:t,...P(o)})}function Zx(e,t,n){return new e({type:"intersection",left:t,right:n})}function Lx(e,t,n,o){let r=n instanceof V,i=r?o:n,a=r?n:null;return new e({type:"tuple",items:t,rest:a,...P(i)})}function Bx(e,t,n,o){return new e({type:"record",keyType:t,valueType:n,...P(o)})}function Vx(e,t,n,o){return new e({type:"map",keyType:t,valueType:n,...P(o)})}function qx(e,t,n){return new e({type:"set",valueType:t,...P(n)})}function Jx(e,t,n){let o=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new e({type:"enum",entries:o,...P(n)})}function Gx(e,t,n){return new e({type:"enum",entries:t,...P(n)})}function Wx(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],...P(n)})}function Hl(e,t){return new e({type:"file",...P(t)})}function Kx(e,t){return new e({type:"transform",transform:t})}function Hx(e,t){return new e({type:"optional",innerType:t})}function Yx(e,t){return new e({type:"nullable",innerType:t})}function Xx(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return typeof n=="function"?n():ts(n)}})}function Qx(e,t,n){return new e({type:"nonoptional",innerType:t,...P(n)})}function eD(e,t){return new e({type:"success",innerType:t})}function tD(e,t,n){return new e({type:"catch",innerType:t,catchValue:typeof n=="function"?n:()=>n})}function rD(e,t,n){return new e({type:"pipe",in:t,out:n})}function nD(e,t){return new e({type:"readonly",innerType:t})}function oD(e,t,n){return new e({type:"template_literal",parts:t,...P(n)})}function iD(e,t){return new e({type:"lazy",getter:t})}function aD(e,t){return new e({type:"promise",innerType:t})}function Yl(e,t,n){let o=P(n);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}function Xl(e,t,n){return new e({type:"custom",check:"custom",fn:t,...P(n)})}function Ql(e){let t=gf(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(Sr(o,n.value,t._zod.def));else{let r=o;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),n.issues.push(Sr(r))}},e(n.value,n)));return t}function gf(e,t){let n=new se({check:"custom",...P(t)});return n._zod.check=e,n}function ec(e,t){let n=P(t),o=n.truthy??["true","1","yes","on","y","enabled"],r=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(o=o.map(p=>typeof p=="string"?p.toLowerCase():p),r=r.map(p=>typeof p=="string"?p.toLowerCase():p));let i=new Set(o),a=new Set(r),u=e.Codec??Nn,l=e.Boolean??jn,c=e.String??lr,m=new c({type:"string",error:n.error}),h=new l({type:"boolean",error:n.error}),y=new u({type:"pipe",in:m,out:h,transform:((p,d)=>{let f=p;return n.case!=="sensitive"&&(f=f.toLowerCase()),i.has(f)?!0:a.has(f)?!1:(d.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...a],input:d.value,inst:y,continue:!1}),{})}),reverseTransform:((p,d)=>p===!0?o[0]||"true":r[0]||"false"),error:n.error});return y}function zr(e,t,n,o={}){let r=P(o),i={...P(o),check:"string_format",type:"string",format:t,fn:typeof n=="function"?n:u=>n.test(u),...r};return n instanceof RegExp&&(i.pattern=n),new e(i)}var Qn=class{constructor(t){this.counter=0,this.metadataRegistry=t?.metadata??ht,this.target=t?.target??"draft-2020-12",this.unrepresentable=t?.unrepresentable??"throw",this.override=t?.override??(()=>{}),this.io=t?.io??"output",this.seen=new Map}process(t,n={path:[],schemaPath:[]}){var o;let r=t._zod.def,i={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},a=this.seen.get(t);if(a)return a.count++,n.schemaPath.includes(t)&&(a.cycle=n.path),a.schema;let u={schema:{},count:1,cycle:void 0,path:n.path};this.seen.set(t,u);let l=t._zod.toJSONSchema?.();if(l)u.schema=l;else{let h={...n,schemaPath:[...n.schemaPath,t],path:n.path},y=t._zod.parent;if(y)u.ref=y,this.process(y,h),this.seen.get(y).isParent=!0;else{let p=u.schema;switch(r.type){case"string":{let d=p;d.type="string";let{minimum:f,maximum:v,format:x,patterns:b,contentEncoding:S}=t._zod.bag;if(typeof f=="number"&&(d.minLength=f),typeof v=="number"&&(d.maxLength=v),x&&(d.format=i[x]??x,d.format===""&&delete d.format),S&&(d.contentEncoding=S),b&&b.size>0){let _=[...b];_.length===1?d.pattern=_[0].source:_.length>1&&(u.schema.allOf=[..._.map(O=>({...this.target==="draft-7"||this.target==="draft-4"||this.target==="openapi-3.0"?{type:"string"}:{},pattern:O.source}))])}break}case"number":{let d=p,{minimum:f,maximum:v,format:x,multipleOf:b,exclusiveMaximum:S,exclusiveMinimum:_}=t._zod.bag;typeof x=="string"&&x.includes("int")?d.type="integer":d.type="number",typeof _=="number"&&(this.target==="draft-4"||this.target==="openapi-3.0"?(d.minimum=_,d.exclusiveMinimum=!0):d.exclusiveMinimum=_),typeof f=="number"&&(d.minimum=f,typeof _=="number"&&this.target!=="draft-4"&&(_>=f?delete d.minimum:delete d.exclusiveMinimum)),typeof S=="number"&&(this.target==="draft-4"||this.target==="openapi-3.0"?(d.maximum=S,d.exclusiveMaximum=!0):d.exclusiveMaximum=S),typeof v=="number"&&(d.maximum=v,typeof S=="number"&&this.target!=="draft-4"&&(S<=v?delete d.maximum:delete d.exclusiveMaximum)),typeof b=="number"&&(d.multipleOf=b);break}case"boolean":{let d=p;d.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{this.target==="openapi-3.0"?(p.type="string",p.nullable=!0,p.enum=[null]):p.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{p.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let d=p,{minimum:f,maximum:v}=t._zod.bag;typeof f=="number"&&(d.minItems=f),typeof v=="number"&&(d.maxItems=v),d.type="array",d.items=this.process(r.element,{...h,path:[...h.path,"items"]});break}case"object":{let d=p;d.type="object",d.properties={};let f=r.shape;for(let b in f)d.properties[b]=this.process(f[b],{...h,path:[...h.path,"properties",b]});let v=new Set(Object.keys(f)),x=new Set([...v].filter(b=>{let S=r.shape[b]._zod;return this.io==="input"?S.optin===void 0:S.optout===void 0}));x.size>0&&(d.required=Array.from(x)),r.catchall?._zod.def.type==="never"?d.additionalProperties=!1:r.catchall?r.catchall&&(d.additionalProperties=this.process(r.catchall,{...h,path:[...h.path,"additionalProperties"]})):this.io==="output"&&(d.additionalProperties=!1);break}case"union":{let d=p,f=r.options.map((v,x)=>this.process(v,{...h,path:[...h.path,"anyOf",x]}));d.anyOf=f;break}case"intersection":{let d=p,f=this.process(r.left,{...h,path:[...h.path,"allOf",0]}),v=this.process(r.right,{...h,path:[...h.path,"allOf",1]}),x=S=>"allOf"in S&&Object.keys(S).length===1,b=[...x(f)?f.allOf:[f],...x(v)?v.allOf:[v]];d.allOf=b;break}case"tuple":{let d=p;d.type="array";let f=this.target==="draft-2020-12"?"prefixItems":"items",v=this.target==="draft-2020-12"||this.target==="openapi-3.0"?"items":"additionalItems",x=r.items.map((O,T)=>this.process(O,{...h,path:[...h.path,f,T]})),b=r.rest?this.process(r.rest,{...h,path:[...h.path,v,...this.target==="openapi-3.0"?[r.items.length]:[]]}):null;this.target==="draft-2020-12"?(d.prefixItems=x,b&&(d.items=b)):this.target==="openapi-3.0"?(d.items={anyOf:x},b&&d.items.anyOf.push(b),d.minItems=x.length,b||(d.maxItems=x.length)):(d.items=x,b&&(d.additionalItems=b));let{minimum:S,maximum:_}=t._zod.bag;typeof S=="number"&&(d.minItems=S),typeof _=="number"&&(d.maxItems=_);break}case"record":{let d=p;d.type="object",(this.target==="draft-7"||this.target==="draft-2020-12")&&(d.propertyNames=this.process(r.keyType,{...h,path:[...h.path,"propertyNames"]})),d.additionalProperties=this.process(r.valueType,{...h,path:[...h.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let d=p,f=wn(r.entries);f.every(v=>typeof v=="number")&&(d.type="number"),f.every(v=>typeof v=="string")&&(d.type="string"),d.enum=f;break}case"literal":{let d=p,f=[];for(let v of r.values)if(v===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof v=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");f.push(Number(v))}else f.push(v);if(f.length!==0)if(f.length===1){let v=f[0];d.type=v===null?"null":typeof v,this.target==="draft-4"||this.target==="openapi-3.0"?d.enum=[v]:d.const=v}else f.every(v=>typeof v=="number")&&(d.type="number"),f.every(v=>typeof v=="string")&&(d.type="string"),f.every(v=>typeof v=="boolean")&&(d.type="string"),f.every(v=>v===null)&&(d.type="null"),d.enum=f;break}case"file":{let d=p,f={type:"string",format:"binary",contentEncoding:"binary"},{minimum:v,maximum:x,mime:b}=t._zod.bag;v!==void 0&&(f.minLength=v),x!==void 0&&(f.maxLength=x),b?b.length===1?(f.contentMediaType=b[0],Object.assign(d,f)):d.anyOf=b.map(S=>({...f,contentMediaType:S})):Object.assign(d,f);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let d=this.process(r.innerType,h);this.target==="openapi-3.0"?(u.ref=r.innerType,p.nullable=!0):p.anyOf=[d,{type:"null"}];break}case"nonoptional":{this.process(r.innerType,h),u.ref=r.innerType;break}case"success":{let d=p;d.type="boolean";break}case"default":{this.process(r.innerType,h),u.ref=r.innerType,p.default=JSON.parse(JSON.stringify(r.defaultValue));break}case"prefault":{this.process(r.innerType,h),u.ref=r.innerType,this.io==="input"&&(p._prefault=JSON.parse(JSON.stringify(r.defaultValue)));break}case"catch":{this.process(r.innerType,h),u.ref=r.innerType;let d;try{d=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}p.default=d;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let d=p,f=t._zod.pattern;if(!f)throw new Error("Pattern not found in template literal");d.type="string",d.pattern=f.source;break}case"pipe":{let d=this.io==="input"?r.in._zod.def.type==="transform"?r.out:r.in:r.out;this.process(d,h),u.ref=d;break}case"readonly":{this.process(r.innerType,h),u.ref=r.innerType,p.readOnly=!0;break}case"promise":{this.process(r.innerType,h),u.ref=r.innerType;break}case"optional":{this.process(r.innerType,h),u.ref=r.innerType;break}case"lazy":{let d=t._zod.innerType;this.process(d,h),u.ref=d;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}case"function":{if(this.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema");break}default:}}}let c=this.metadataRegistry.get(t);return c&&Object.assign(u.schema,c),this.io==="input"&&he(t)&&(delete u.schema.examples,delete u.schema.default),this.io==="input"&&u.schema._prefault&&((o=u.schema).default??(o.default=u.schema._prefault)),delete u.schema._prefault,this.seen.get(t).schema}emit(t,n){let o={cycles:n?.cycles??"ref",reused:n?.reused??"inline",external:n?.external??void 0},r=this.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=m=>{let h=this.target==="draft-2020-12"?"$defs":"definitions";if(o.external){let f=o.external.registry.get(m[0])?.id,v=o.external.uri??(b=>b);if(f)return{ref:v(f)};let x=m[1].defId??m[1].schema.id??`schema${this.counter++}`;return m[1].defId=x,{defId:x,ref:`${v("__shared")}#/${h}/${x}`}}if(m[1]===r)return{ref:"#"};let p=`#/${h}/`,d=m[1].schema.id??`__schema${this.counter++}`;return{defId:d,ref:p+d}},a=m=>{if(m[1].schema.$ref)return;let h=m[1],{ref:y,defId:p}=i(m);h.def={...h.schema},p&&(h.defId=p);let d=h.schema;for(let f in d)delete d[f];d.$ref=y};if(o.cycles==="throw")for(let m of this.seen.entries()){let h=m[1];if(h.cycle)throw new Error(`Cycle detected: #/${h.cycle?.join("/")}/<root>
|
|
34
|
+
`)}p.write("payload.value = newResult;"),p.write("return payload;");let b=p.compile();return(S,_)=>b(y,S,_)},i,a=sr,u=!xn.jitless,c=u&&es.value,m=t.catchall,h;e._zod.parse=(y,p)=>{h??(h=o.value);let d=y.value;return a(d)?u&&c&&p?.async===!1&&p.jitless!==!0?(i||(i=r(t.shape)),y=i(y,p),m?_m([],d,y,p,h,e):y):n(y,p):(y.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),y)}});function um(e,t,n,o){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let r=e.filter(i=>!Ht(i));return r.length===1?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(a=>qe(a,o,ce())))}),t)}var yi=D("$ZodUnion",(e,t)=>{q.init(e,t),W(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),W(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),W(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),W(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){let r=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${r.map(i=>kn(i.source)).join("|")})$`)}});let n=t.options.length===1,o=t.options[0]._zod.run;e._zod.parse=(r,i)=>{if(n)return o(r,i);let a=!1,u=[];for(let l of t.options){let c=l._zod.run({value:r.value,issues:[]},i);if(c instanceof Promise)u.push(c),a=!0;else{if(c.issues.length===0)return c;u.push(c)}}return a?Promise.all(u).then(l=>um(l,r,e,i)):um(u,r,e,i)}}),Lu=D("$ZodDiscriminatedUnion",(e,t)=>{yi.init(e,t);let n=e._zod.parse;W(e._zod,"propValues",()=>{let r={};for(let i of t.options){let a=i._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[u,l]of Object.entries(a)){r[u]||(r[u]=new Set);for(let c of l)r[u].add(c)}}return r});let o=$r(()=>{let r=t.options,i=new Map;for(let a of r){let u=a._zod.propValues?.[t.discriminator];if(!u||u.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let l of u){if(i.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);i.set(l,a)}}return i});e._zod.parse=(r,i)=>{let a=r.value;if(!sr(a))return r.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),r;let u=o.value.get(a?.[t.discriminator]);return u?u._zod.run(r,i):t.unionFallback?n(r,i):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:a,path:[t.discriminator],inst:e}),r)}}),Bu=D("$ZodIntersection",(e,t)=>{q.init(e,t),e._zod.parse=(n,o)=>{let r=n.value,i=t.left._zod.run({value:r,issues:[]},o),a=t.right._zod.run({value:r,issues:[]},o);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([l,c])=>lm(n,l,c)):lm(n,i,a)}});function ou(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Kt(e)&&Kt(t)){let n=Object.keys(t),o=Object.keys(e).filter(i=>n.indexOf(i)!==-1),r={...e,...t};for(let i of o){let a=ou(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};r[i]=a.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let o=0;o<e.length;o++){let r=e[o],i=t[o],a=ou(r,i);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function lm(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Ht(e))return e;let o=ou(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var bi=D("$ZodTuple",(e,t)=>{q.init(e,t);let n=t.items,o=n.length-[...n].reverse().findIndex(r=>r._zod.optin!=="optional");e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({input:a,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];let u=[];if(!t.rest){let c=a.length>n.length,m=a.length<o-1;if(c||m)return r.issues.push({...c?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},input:a,inst:e,origin:"array"}),r}let l=-1;for(let c of n){if(l++,l>=a.length&&l>=o)continue;let m=c._zod.run({value:a[l],issues:[]},i);m instanceof Promise?u.push(m.then(h=>di(h,r,l))):di(m,r,l)}if(t.rest){let c=a.slice(n.length);for(let m of c){l++;let h=t.rest._zod.run({value:m,issues:[]},i);h instanceof Promise?u.push(h.then(y=>di(y,r,l))):di(h,r,l)}}return u.length?Promise.all(u).then(()=>r):r}});function di(e,t,n){e.issues.length&&t.issues.push(...Be(n,e.issues)),t.value[n]=e.value}var qu=D("$ZodRecord",(e,t)=>{q.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!Kt(r))return n.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),n;let i=[];if(t.keyType._zod.values){let a=t.keyType._zod.values;n.value={};for(let l of a)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){let c=t.valueType._zod.run({value:r[l],issues:[]},o);c instanceof Promise?i.push(c.then(m=>{m.issues.length&&n.issues.push(...Be(l,m.issues)),n.value[l]=m.value})):(c.issues.length&&n.issues.push(...Be(l,c.issues)),n.value[l]=c.value)}let u;for(let l in r)a.has(l)||(u=u??[],u.push(l));u&&u.length>0&&n.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:u})}else{n.value={};for(let a of Reflect.ownKeys(r)){if(a==="__proto__")continue;let u=t.keyType._zod.run({value:a,issues:[]},o);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(u.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(c=>qe(c,o,ce())),input:a,path:[a],inst:e}),n.value[u.value]=u.value;continue}let l=t.valueType._zod.run({value:r[a],issues:[]},o);l instanceof Promise?i.push(l.then(c=>{c.issues.length&&n.issues.push(...Be(a,c.issues)),n.value[u.value]=c.value})):(l.issues.length&&n.issues.push(...Be(a,l.issues)),n.value[u.value]=l.value)}}return i.length?Promise.all(i).then(()=>n):n}}),Vu=D("$ZodMap",(e,t)=>{q.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!(r instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:r,inst:e}),n;let i=[];n.value=new Map;for(let[a,u]of r){let l=t.keyType._zod.run({value:a,issues:[]},o),c=t.valueType._zod.run({value:u,issues:[]},o);l instanceof Promise||c instanceof Promise?i.push(Promise.all([l,c]).then(([m,h])=>{cm(m,h,n,a,r,e,o)})):cm(l,c,n,a,r,e,o)}return i.length?Promise.all(i).then(()=>n):n}});function cm(e,t,n,o,r,i,a){e.issues.length&&($n.has(typeof o)?n.issues.push(...Be(o,e.issues)):n.issues.push({code:"invalid_key",origin:"map",input:r,inst:i,issues:e.issues.map(u=>qe(u,a,ce()))})),t.issues.length&&($n.has(typeof o)?n.issues.push(...Be(o,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:r,inst:i,key:o,issues:t.issues.map(u=>qe(u,a,ce()))})),n.value.set(e.value,t.value)}var Ju=D("$ZodSet",(e,t)=>{q.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!(r instanceof Set))return n.issues.push({input:r,inst:e,expected:"set",code:"invalid_type"}),n;let i=[];n.value=new Set;for(let a of r){let u=t.valueType._zod.run({value:a,issues:[]},o);u instanceof Promise?i.push(u.then(l=>dm(l,n))):dm(u,n)}return i.length?Promise.all(i).then(()=>n):n}});function dm(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var Gu=D("$ZodEnum",(e,t)=>{q.init(e,t);let n=wn(t.entries),o=new Set(n);e._zod.values=o,e._zod.pattern=new RegExp(`^(${n.filter(r=>$n.has(typeof r)).map(r=>typeof r=="string"?gt(r):r.toString()).join("|")})$`),e._zod.parse=(r,i)=>{let a=r.value;return o.has(a)||r.issues.push({code:"invalid_value",values:n,input:a,inst:e}),r}}),Wu=D("$ZodLiteral",(e,t)=>{if(q.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?gt(n):n?gt(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,o)=>{let r=n.value;return e._zod.values.has(r)||n.issues.push({code:"invalid_value",values:t.values,input:r,inst:e}),n}}),Ku=D("$ZodFile",(e,t)=>{q.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;return r instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:r,inst:e}),n}}),Hu=D("$ZodTransform",(e,t)=>{q.init(e,t),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new Vt(e.constructor.name);let r=t.transform(n.value,n);if(o.async)return(r instanceof Promise?r:Promise.resolve(r)).then(a=>(n.value=a,n));if(r instanceof Promise)throw new ot;return n.value=r,n}});function pm(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var Yu=D("$ZodOptional",(e,t)=>{q.init(e,t),e._zod.optin="optional",e._zod.optout="optional",W(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),W(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${kn(n.source)})?$`):void 0}),e._zod.parse=(n,o)=>{if(t.innerType._zod.optin==="optional"){let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>pm(i,n.value)):pm(r,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,o)}}),Xu=D("$ZodNullable",(e,t)=>{q.init(e,t),W(e._zod,"optin",()=>t.innerType._zod.optin),W(e._zod,"optout",()=>t.innerType._zod.optout),W(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${kn(n.source)}|null)$`):void 0}),W(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,o)=>n.value===null?n:t.innerType._zod.run(n,o)}),Qu=D("$ZodDefault",(e,t)=>{q.init(e,t),e._zod.optin="optional",W(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);if(n.value===void 0)return n.value=t.defaultValue,n;let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>mm(i,t)):mm(r,t)}});function mm(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var el=D("$ZodPrefault",(e,t)=>{q.init(e,t),e._zod.optin="optional",W(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>(o.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,o))}),tl=D("$ZodNonOptional",(e,t)=>{q.init(e,t),W(e._zod,"values",()=>{let n=t.innerType._zod.values;return n?new Set([...n].filter(o=>o!==void 0)):void 0}),e._zod.parse=(n,o)=>{let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>fm(i,e)):fm(r,e)}});function fm(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var rl=D("$ZodSuccess",(e,t)=>{q.init(e,t),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new Vt("ZodSuccess");let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>(n.value=i.issues.length===0,n)):(n.value=r.issues.length===0,n)}}),nl=D("$ZodCatch",(e,t)=>{q.init(e,t),W(e._zod,"optin",()=>t.innerType._zod.optin),W(e._zod,"optout",()=>t.innerType._zod.optout),W(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(a=>qe(a,o,ce()))},input:n.value}),n.issues=[]),n)):(n.value=r.value,r.issues.length&&(n.value=t.catchValue({...n,error:{issues:r.issues.map(i=>qe(i,o,ce()))},input:n.value}),n.issues=[]),n)}}),ol=D("$ZodNaN",(e,t)=>{q.init(e,t),e._zod.parse=(n,o)=>((typeof n.value!="number"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:e,expected:"nan",code:"invalid_type"}),n)}),il=D("$ZodPipe",(e,t)=>{q.init(e,t),W(e._zod,"values",()=>t.in._zod.values),W(e._zod,"optin",()=>t.in._zod.optin),W(e._zod,"optout",()=>t.out._zod.optout),W(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,o)=>{if(o.direction==="backward"){let i=t.out._zod.run(n,o);return i instanceof Promise?i.then(a=>pi(a,t.in,o)):pi(i,t.in,o)}let r=t.in._zod.run(n,o);return r instanceof Promise?r.then(i=>pi(i,t.out,o)):pi(r,t.out,o)}});function pi(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Nn=D("$ZodCodec",(e,t)=>{q.init(e,t),W(e._zod,"values",()=>t.in._zod.values),W(e._zod,"optin",()=>t.in._zod.optin),W(e._zod,"optout",()=>t.out._zod.optout),W(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,o)=>{if((o.direction||"forward")==="forward"){let i=t.in._zod.run(n,o);return i instanceof Promise?i.then(a=>mi(a,t,o)):mi(i,t,o)}else{let i=t.out._zod.run(n,o);return i instanceof Promise?i.then(a=>mi(a,t,o)):mi(i,t,o)}}});function mi(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||"forward")==="forward"){let r=t.transform(e.value,e);return r instanceof Promise?r.then(i=>fi(e,i,t.out,n)):fi(e,r,t.out,n)}else{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(i=>fi(e,i,t.in,n)):fi(e,r,t.in,n)}}function fi(e,t,n,o){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},o)}var al=D("$ZodReadonly",(e,t)=>{q.init(e,t),W(e._zod,"propValues",()=>t.innerType._zod.propValues),W(e._zod,"values",()=>t.innerType._zod.values),W(e._zod,"optin",()=>t.innerType._zod.optin),W(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(gm):gm(r)}});function gm(e){return e.value=Object.freeze(e.value),e}var sl=D("$ZodTemplateLiteral",(e,t)=>{q.init(e,t);let n=[];for(let o of t.parts)if(typeof o=="object"&&o!==null){if(!o._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let r=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!r)throw new Error(`Invalid template literal part: ${o._zod.traits}`);let i=r.startsWith("^")?1:0,a=r.endsWith("$")?r.length-1:r.length;n.push(r.slice(i,a))}else if(o===null||rs.has(typeof o))n.push(gt(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(o,r)=>typeof o.value!="string"?(o.issues.push({input:o.value,inst:e,expected:"template_literal",code:"invalid_type"}),o):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),o)}),ul=D("$ZodFunction",(e,t)=>(q.init(e,t),e._def=t,e._zod.def=t,e.implement=n=>{if(typeof n!="function")throw new Error("implement() must be called with a function");return function(...o){let r=e._def.input?Xo(e._def.input,o):o,i=Reflect.apply(n,this,r);return e._def.output?Xo(e._def.output,i):i}},e.implementAsync=n=>{if(typeof n!="function")throw new Error("implementAsync() must be called with a function");return async function(...o){let r=e._def.input?await Qo(e._def.input,o):o,i=await Reflect.apply(n,this,r);return e._def.output?await Qo(e._def.output,i):i}},e._zod.parse=(n,o)=>typeof n.value!="function"?(n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:e}),n):(e._def.output&&e._def.output._zod.def.type==="promise"?n.value=e.implementAsync(n.value):n.value=e.implement(n.value),n),e.input=(...n)=>{let o=e.constructor;return Array.isArray(n[0])?new o({type:"function",input:new bi({type:"tuple",items:n[0],rest:n[1]}),output:e._def.output}):new o({type:"function",input:n[0],output:e._def.output})},e.output=n=>{let o=e.constructor;return new o({type:"function",input:e._def.input,output:n})},e)),ll=D("$ZodPromise",(e,t)=>{q.init(e,t),e._zod.parse=(n,o)=>Promise.resolve(n.value).then(r=>t.innerType._zod.run({value:r,issues:[]},o))}),cl=D("$ZodLazy",(e,t)=>{q.init(e,t),W(e._zod,"innerType",()=>t.getter()),W(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),W(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),W(e._zod,"optin",()=>e._zod.innerType._zod.optin??void 0),W(e._zod,"optout",()=>e._zod.innerType._zod.optout??void 0),e._zod.parse=(n,o)=>e._zod.innerType._zod.run(n,o)}),dl=D("$ZodCustom",(e,t)=>{se.init(e,t),q.init(e,t),e._zod.parse=(n,o)=>n,e._zod.check=n=>{let o=n.value,r=t.fn(o);if(r instanceof Promise)return r.then(i=>hm(i,n,o,e));hm(r,n,o,e)}});function hm(e,t,n,o){if(!e){let r={code:"custom",input:n,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(r.params=o._zod.def.params),t.issues.push(Sr(r))}}var Fn={};Bt(Fn,{ar:()=>Dm,az:()=>wm,be:()=>$m,ca:()=>Sm,cs:()=>Im,da:()=>Em,de:()=>Tm,en:()=>_i,eo:()=>Cm,es:()=>Am,fa:()=>Pm,fi:()=>Om,fr:()=>jm,frCA:()=>Nm,he:()=>zm,hu:()=>Rm,id:()=>Fm,is:()=>Mm,it:()=>Um,ja:()=>Zm,ka:()=>Lm,kh:()=>Bm,km:()=>xi,ko:()=>qm,lt:()=>Jm,mk:()=>Gm,ms:()=>Wm,nl:()=>Km,no:()=>Hm,ota:()=>Ym,pl:()=>Qm,ps:()=>Xm,pt:()=>ef,ru:()=>rf,sl:()=>nf,sv:()=>of,ta:()=>af,th:()=>sf,tr:()=>uf,ua:()=>lf,uk:()=>Di,ur:()=>cf,vi:()=>df,yo:()=>ff,zhCN:()=>pf,zhTW:()=>mf});var B_=()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"};return r=>{switch(r.code){case"invalid_type":return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${r.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${A(r.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${r.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${r.minimum.toString()} ${a.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${r.prefix}"`:i.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${i.suffix}"`:i.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${i.includes}"`:i.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${i.pattern}`:`${o[i.format]??r.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${r.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${r.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${r.keys.length>1?"\u0629":""}: ${w(r.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function Dm(){return{localeError:B_()}}var q_=()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${r.expected}, daxil olan ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${A(r.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${i}${r.maximum.toString()} ${a.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${i}${r.minimum.toString()} ${a.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${i.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:i.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${i.suffix}" il\u0259 bitm\u0259lidir`:i.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${i.includes}" daxil olmal\u0131d\u0131r`:i.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${i.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${o[i.format]??r.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${r.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${r.keys.length>1?"lar":""}: ${w(r.keys,", ")}`;case"invalid_key":return`${r.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${r.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function wm(){return{localeError:q_()}}function km(e,t,n,o){let r=Math.abs(e),i=r%10,a=r%100;return a>=11&&a<=19?o:i===1?t:i>=2&&i<=4?n:o}var V_=()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u043B\u0456\u043A";case"object":{if(Array.isArray(r))return"\u043C\u0430\u0441\u0456\u045E";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"};return r=>{switch(r.code){case"invalid_type":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${r.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${A(r.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a){let u=Number(r.maximum),l=km(u,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${r.maximum.toString()} ${l}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a){let u=Number(r.minimum),l=km(u,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${r.minimum.toString()} ${l}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${o[i.format]??r.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${r.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${w(r.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${r.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${r.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function $m(){return{localeError:V_()}}var J_=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return r=>{switch(r.code){case"invalid_type":return`Tipus inv\xE0lid: s'esperava ${r.expected}, s'ha rebut ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Valor inv\xE0lid: s'esperava ${A(r.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${w(r.values," o ")}`;case"too_big":{let i=r.inclusive?"com a m\xE0xim":"menys de",a=t(r.origin);return a?`Massa gran: s'esperava que ${r.origin??"el valor"} contingu\xE9s ${i} ${r.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${r.origin??"el valor"} fos ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"com a m\xEDnim":"m\xE9s de",a=t(r.origin);return a?`Massa petit: s'esperava que ${r.origin} contingu\xE9s ${i} ${r.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${r.origin} fos ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${i.prefix}"`:i.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${i.suffix}"`:i.format==="includes"?`Format inv\xE0lid: ha d'incloure "${i.includes}"`:i.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${i.pattern}`:`Format inv\xE0lid per a ${o[i.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${r.divisor}`;case"unrecognized_keys":return`Clau${r.keys.length>1?"s":""} no reconeguda${r.keys.length>1?"s":""}: ${w(r.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${r.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${r.origin}`;default:return"Entrada inv\xE0lida"}}};function Sm(){return{localeError:J_()}}var G_=()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u010D\xEDslo";case"string":return"\u0159et\u011Bzec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(r))return"pole";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"};return r=>{switch(r.code){case"invalid_type":return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${r.expected}, obdr\u017Eeno ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${A(r.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${i}${r.maximum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${i}${r.minimum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${i.prefix}"`:i.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${i.suffix}"`:i.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${i.includes}"`:i.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${i.pattern}`:`Neplatn\xFD form\xE1t ${o[i.format]??r.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${r.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${w(r.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${r.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${r.origin}`;default:return"Neplatn\xFD vstup"}}};function Im(){return{localeError:G_()}}var W_=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}},t={string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};function n(a){return e[a]??null}function o(a){return t[a]??a}let r=a=>{let u=typeof a;switch(u){case"number":return Number.isNaN(a)?"NaN":"tal";case"object":return Array.isArray(a)?"liste":a===null?"null":Object.getPrototypeOf(a)!==Object.prototype&&a.constructor?a.constructor.name:"objekt"}return u},i={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return a=>{switch(a.code){case"invalid_type":return`Ugyldigt input: forventede ${o(a.expected)}, fik ${o(r(a.input))}`;case"invalid_value":return a.values.length===1?`Ugyldig v\xE6rdi: forventede ${A(a.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${w(a.values,"|")}`;case"too_big":{let u=a.inclusive?"<=":"<",l=n(a.origin),c=o(a.origin);return l?`For stor: forventede ${c??"value"} ${l.verb} ${u} ${a.maximum.toString()} ${l.unit??"elementer"}`:`For stor: forventede ${c??"value"} havde ${u} ${a.maximum.toString()}`}case"too_small":{let u=a.inclusive?">=":">",l=n(a.origin),c=o(a.origin);return l?`For lille: forventede ${c} ${l.verb} ${u} ${a.minimum.toString()} ${l.unit}`:`For lille: forventede ${c} havde ${u} ${a.minimum.toString()}`}case"invalid_format":{let u=a;return u.format==="starts_with"?`Ugyldig streng: skal starte med "${u.prefix}"`:u.format==="ends_with"?`Ugyldig streng: skal ende med "${u.suffix}"`:u.format==="includes"?`Ugyldig streng: skal indeholde "${u.includes}"`:u.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${u.pattern}`:`Ugyldig ${i[u.format]??a.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${a.divisor}`;case"unrecognized_keys":return`${a.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${w(a.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${a.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${a.origin}`;default:return"Ugyldigt input"}}};function Em(){return{localeError:W_()}}var K_=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"Zahl";case"object":{if(Array.isArray(r))return"Array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return r=>{switch(r.code){case"invalid_type":return`Ung\xFCltige Eingabe: erwartet ${r.expected}, erhalten ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Ung\xFCltige Eingabe: erwartet ${A(r.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${i}${r.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${i}${r.maximum.toString()} ist`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Zu klein: erwartet, dass ${r.origin} ${i}${r.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${r.origin} ${i}${r.minimum.toString()} ist`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ung\xFCltiger String: muss mit "${i.prefix}" beginnen`:i.format==="ends_with"?`Ung\xFCltiger String: muss mit "${i.suffix}" enden`:i.format==="includes"?`Ung\xFCltiger String: muss "${i.includes}" enthalten`:i.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${i.pattern} entsprechen`:`Ung\xFCltig: ${o[i.format]??r.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${r.divisor} sein`;case"unrecognized_keys":return`${r.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${w(r.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${r.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${r.origin}`;default:return"Ung\xFCltige Eingabe"}}};function Tm(){return{localeError:K_()}}var H_=e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},Y_=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function t(o){return e[o]??null}let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Invalid input: expected ${o.expected}, received ${H_(o.input)}`;case"invalid_value":return o.values.length===1?`Invalid input: expected ${A(o.values[0])}`:`Invalid option: expected one of ${w(o.values,"|")}`;case"too_big":{let r=o.inclusive?"<=":"<",i=t(o.origin);return i?`Too big: expected ${o.origin??"value"} to have ${r}${o.maximum.toString()} ${i.unit??"elements"}`:`Too big: expected ${o.origin??"value"} to be ${r}${o.maximum.toString()}`}case"too_small":{let r=o.inclusive?">=":">",i=t(o.origin);return i?`Too small: expected ${o.origin} to have ${r}${o.minimum.toString()} ${i.unit}`:`Too small: expected ${o.origin} to be ${r}${o.minimum.toString()}`}case"invalid_format":{let r=o;return r.format==="starts_with"?`Invalid string: must start with "${r.prefix}"`:r.format==="ends_with"?`Invalid string: must end with "${r.suffix}"`:r.format==="includes"?`Invalid string: must include "${r.includes}"`:r.format==="regex"?`Invalid string: must match pattern ${r.pattern}`:`Invalid ${n[r.format]??o.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${o.divisor}`;case"unrecognized_keys":return`Unrecognized key${o.keys.length>1?"s":""}: ${w(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}};function _i(){return{localeError:Y_()}}var X_=e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"nombro";case"object":{if(Array.isArray(e))return"tabelo";if(e===null)return"senvalora";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},Q_=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(o){return e[o]??null}let n={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return o=>{switch(o.code){case"invalid_type":return`Nevalida enigo: atendi\u011Dis ${o.expected}, ricevi\u011Dis ${X_(o.input)}`;case"invalid_value":return o.values.length===1?`Nevalida enigo: atendi\u011Dis ${A(o.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${w(o.values,"|")}`;case"too_big":{let r=o.inclusive?"<=":"<",i=t(o.origin);return i?`Tro granda: atendi\u011Dis ke ${o.origin??"valoro"} havu ${r}${o.maximum.toString()} ${i.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${o.origin??"valoro"} havu ${r}${o.maximum.toString()}`}case"too_small":{let r=o.inclusive?">=":">",i=t(o.origin);return i?`Tro malgranda: atendi\u011Dis ke ${o.origin} havu ${r}${o.minimum.toString()} ${i.unit}`:`Tro malgranda: atendi\u011Dis ke ${o.origin} estu ${r}${o.minimum.toString()}`}case"invalid_format":{let r=o;return r.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${r.prefix}"`:r.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${r.suffix}"`:r.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${r.includes}"`:r.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${r.pattern}`:`Nevalida ${n[r.format]??o.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${o.divisor}`;case"unrecognized_keys":return`Nekonata${o.keys.length>1?"j":""} \u015Dlosilo${o.keys.length>1?"j":""}: ${w(o.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${o.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${o.origin}`;default:return"Nevalida enigo"}}};function Cm(){return{localeError:Q_()}}var ex=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}},t={string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};function n(a){return e[a]??null}function o(a){return t[a]??a}let r=a=>{let u=typeof a;switch(u){case"number":return Number.isNaN(a)?"NaN":"number";case"object":return Array.isArray(a)?"array":a===null?"null":Object.getPrototypeOf(a)!==Object.prototype?a.constructor.name:"object"}return u},i={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return a=>{switch(a.code){case"invalid_type":return`Entrada inv\xE1lida: se esperaba ${o(a.expected)}, recibido ${o(r(a.input))}`;case"invalid_value":return a.values.length===1?`Entrada inv\xE1lida: se esperaba ${A(a.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${w(a.values,"|")}`;case"too_big":{let u=a.inclusive?"<=":"<",l=n(a.origin),c=o(a.origin);return l?`Demasiado grande: se esperaba que ${c??"valor"} tuviera ${u}${a.maximum.toString()} ${l.unit??"elementos"}`:`Demasiado grande: se esperaba que ${c??"valor"} fuera ${u}${a.maximum.toString()}`}case"too_small":{let u=a.inclusive?">=":">",l=n(a.origin),c=o(a.origin);return l?`Demasiado peque\xF1o: se esperaba que ${c} tuviera ${u}${a.minimum.toString()} ${l.unit}`:`Demasiado peque\xF1o: se esperaba que ${c} fuera ${u}${a.minimum.toString()}`}case"invalid_format":{let u=a;return u.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${u.prefix}"`:u.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${u.suffix}"`:u.format==="includes"?`Cadena inv\xE1lida: debe incluir "${u.includes}"`:u.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${u.pattern}`:`Inv\xE1lido ${i[u.format]??a.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${a.divisor}`;case"unrecognized_keys":return`Llave${a.keys.length>1?"s":""} desconocida${a.keys.length>1?"s":""}: ${w(a.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o(a.origin)}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o(a.origin)}`;default:return"Entrada inv\xE1lida"}}};function Am(){return{localeError:ex()}}var tx=()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(r))return"\u0622\u0631\u0627\u06CC\u0647";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"};return r=>{switch(r.code){case"invalid_type":return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${r.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${n(r.input)} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;case"invalid_value":return r.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${A(r.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${w(r.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${r.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${r.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${i}${r.minimum.toString()} ${a.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${i}${r.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:i.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:i.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${i.includes}" \u0628\u0627\u0634\u062F`:i.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${i.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${o[i.format]??r.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${r.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${r.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${w(r.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${r.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${r.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function Pm(){return{localeError:tx()}}var rx=()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return r=>{switch(r.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${r.expected}, oli ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${A(r.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Liian suuri: ${a.subject} t\xE4ytyy olla ${i}${r.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Liian pieni: ${a.subject} t\xE4ytyy olla ${i}${r.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${i.prefix}"`:i.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${i.suffix}"`:i.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${i.includes}"`:i.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${i.pattern}`:`Virheellinen ${o[i.format]??r.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${r.divisor} monikerta`;case"unrecognized_keys":return`${r.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${w(r.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}};function Om(){return{localeError:rx()}}var nx=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"nombre";case"object":{if(Array.isArray(r))return"tableau";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return r=>{switch(r.code){case"invalid_type":return`Entr\xE9e invalide : ${r.expected} attendu, ${n(r.input)} re\xE7u`;case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : ${A(r.values[0])} attendu`:`Option invalide : une valeur parmi ${w(r.values,"|")} attendue`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Trop grand : ${r.origin??"valeur"} doit ${a.verb} ${i}${r.maximum.toString()} ${a.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${r.origin??"valeur"} doit \xEAtre ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Trop petit : ${r.origin} doit ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`:`Trop petit : ${r.origin} doit \xEAtre ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${i.pattern}`:`${o[i.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${w(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}};function jm(){return{localeError:nx()}}var ox=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return r=>{switch(r.code){case"invalid_type":return`Entr\xE9e invalide : attendu ${r.expected}, re\xE7u ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : attendu ${A(r.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"\u2264":"<",a=t(r.origin);return a?`Trop grand : attendu que ${r.origin??"la valeur"} ait ${i}${r.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${r.origin??"la valeur"} soit ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"\u2265":">",a=t(r.origin);return a?`Trop petit : attendu que ${r.origin} ait ${i}${r.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${r.origin} soit ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${i.pattern}`:`${o[i.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${w(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}};function Nm(){return{localeError:ox()}}var ix=()=>{let e={string:{unit:"\u05D0\u05D5\u05EA\u05D9\u05D5\u05EA",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u05E7\u05DC\u05D8",email:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",url:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",emoji:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",date:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",time:"\u05D6\u05DE\u05DF ISO",duration:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",ipv4:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",ipv6:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",cidrv4:"\u05D8\u05D5\u05D5\u05D7 IPv4",cidrv6:"\u05D8\u05D5\u05D5\u05D7 IPv6",base64:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",base64url:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",json_string:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",e164:"\u05DE\u05E1\u05E4\u05E8 E.164",jwt:"JWT",template_literal:"\u05E7\u05DC\u05D8"};return r=>{switch(r.code){case"invalid_type":return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${r.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${A(r.values[0])}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05D0\u05D7\u05EA \u05DE\u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${r.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${i}${r.maximum.toString()} ${a.unit??"elements"}`:`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${r.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${r.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${i}${r.minimum.toString()} ${a.unit}`:`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${r.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1"${i.prefix}"`:i.format==="ends_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${i.suffix}"`:i.format==="includes"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${i.includes}"`:i.format==="regex"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${i.pattern}`:`${o[i.format]??r.format} \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${r.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${r.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${r.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${w(r.keys,", ")}`;case"invalid_key":return`\u05DE\u05E4\u05EA\u05D7 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${r.origin}`;case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${r.origin}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function zm(){return{localeError:ix()}}var ax=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"sz\xE1m";case"object":{if(Array.isArray(r))return"t\xF6mb";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"};return r=>{switch(r.code){case"invalid_type":return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${r.expected}, a kapott \xE9rt\xE9k ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${A(r.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`T\xFAl nagy: ${r.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${i}${r.maximum.toString()} ${a.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${r.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} m\xE9rete t\xFAl kicsi ${i}${r.minimum.toString()} ${a.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} t\xFAl kicsi ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\xC9rv\xE9nytelen string: "${i.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:i.format==="ends_with"?`\xC9rv\xE9nytelen string: "${i.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:i.format==="includes"?`\xC9rv\xE9nytelen string: "${i.includes}" \xE9rt\xE9ket kell tartalmaznia`:i.format==="regex"?`\xC9rv\xE9nytelen string: ${i.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${o[i.format]??r.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${r.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${r.keys.length>1?"s":""}: ${w(r.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${r.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${r.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function Rm(){return{localeError:ax()}}var sx=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Input tidak valid: diharapkan ${r.expected}, diterima ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Input tidak valid: diharapkan ${A(r.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Terlalu besar: diharapkan ${r.origin??"value"} memiliki ${i}${r.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${r.origin??"value"} menjadi ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Terlalu kecil: diharapkan ${r.origin} memiliki ${i}${r.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${r.origin} menjadi ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`String tidak valid: harus dimulai dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak valid: harus berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak valid: harus menyertakan "${i.includes}"`:i.format==="regex"?`String tidak valid: harus sesuai pola ${i.pattern}`:`${o[i.format]??r.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${r.keys.length>1?"s":""}: ${w(r.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${r.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${r.origin}`;default:return"Input tidak valid"}}};function Fm(){return{localeError:sx()}}var ux=e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"n\xFAmer";case"object":{if(Array.isArray(e))return"fylki";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},lx=()=>{let e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function t(o){return e[o]??null}let n={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"};return o=>{switch(o.code){case"invalid_type":return`Rangt gildi: \xDE\xFA sl\xF3st inn ${ux(o.input)} \xFEar sem \xE1 a\xF0 vera ${o.expected}`;case"invalid_value":return o.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${A(o.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${w(o.values,"|")}`;case"too_big":{let r=o.inclusive?"<=":"<",i=t(o.origin);return i?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${o.origin??"gildi"} hafi ${r}${o.maximum.toString()} ${i.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${o.origin??"gildi"} s\xE9 ${r}${o.maximum.toString()}`}case"too_small":{let r=o.inclusive?">=":">",i=t(o.origin);return i?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${o.origin} hafi ${r}${o.minimum.toString()} ${i.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${o.origin} s\xE9 ${r}${o.minimum.toString()}`}case"invalid_format":{let r=o;return r.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${r.prefix}"`:r.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${r.suffix}"`:r.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${r.includes}"`:r.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${r.pattern}`:`Rangt ${n[r.format]??o.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${o.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${o.keys.length>1?"ir lyklar":"ur lykill"}: ${w(o.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${o.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${o.origin}`;default:return"Rangt gildi"}}};function Mm(){return{localeError:lx()}}var cx=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"numero";case"object":{if(Array.isArray(r))return"vettore";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Input non valido: atteso ${r.expected}, ricevuto ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Input non valido: atteso ${A(r.values[0])}`:`Opzione non valida: atteso uno tra ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Troppo grande: ${r.origin??"valore"} deve avere ${i}${r.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${r.origin??"valore"} deve essere ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Troppo piccolo: ${r.origin} deve avere ${i}${r.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${r.origin} deve essere ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Stringa non valida: deve iniziare con "${i.prefix}"`:i.format==="ends_with"?`Stringa non valida: deve terminare con "${i.suffix}"`:i.format==="includes"?`Stringa non valida: deve includere "${i.includes}"`:i.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${i.pattern}`:`Invalid ${o[i.format]??r.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${r.divisor}`;case"unrecognized_keys":return`Chiav${r.keys.length>1?"i":"e"} non riconosciut${r.keys.length>1?"e":"a"}: ${w(r.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${r.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${r.origin}`;default:return"Input non valido"}}};function Um(){return{localeError:cx()}}var dx=()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u6570\u5024";case"object":{if(Array.isArray(r))return"\u914D\u5217";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"};return r=>{switch(r.code){case"invalid_type":return`\u7121\u52B9\u306A\u5165\u529B: ${r.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${n(r.input)}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;case"invalid_value":return r.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${A(r.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${w(r.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let i=r.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",a=t(r.origin);return a?`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${a.unit??"\u8981\u7D20"}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let i=r.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",a=t(r.origin);return a?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${a.unit}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${i.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${o[i.format]??r.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${r.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${r.keys.length>1?"\u7FA4":""}: ${w(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function Zm(){return{localeError:dx()}}var px=e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8";case"object":{if(Array.isArray(e))return"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return{string:"\u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",undefined:"undefined",bigint:"bigint",symbol:"symbol",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0"}[t]??t},mx=()=>{let e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(o){return e[o]??null}let n={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",json_string:"JSON \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"};return o=>{switch(o.code){case"invalid_type":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${px(o.input)}`;case"invalid_value":return o.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${A(o.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${w(o.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let r=o.inclusive?"<=":"<",i=t(o.origin);return i?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${i.verb} ${r}${o.maximum.toString()} ${i.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${r}${o.maximum.toString()}`}case"too_small":{let r=o.inclusive?">=":">",i=t(o.origin);return i?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o.origin} ${i.verb} ${r}${o.minimum.toString()} ${i.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o.origin} \u10D8\u10E7\u10DD\u10E1 ${r}${o.minimum.toString()}`}case"invalid_format":{let r=o;return r.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${r.prefix}"-\u10D8\u10D7`:r.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${r.suffix}"-\u10D8\u10D7`:r.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${r.includes}"-\u10E1`:r.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${r.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${n[r.format]??o.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${o.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${o.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${w(o.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${o.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${o.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function Lm(){return{localeError:mx()}}var fx=()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"\u1798\u17B7\u1793\u1798\u17C2\u1793\u1787\u17B6\u179B\u17C1\u1781 (NaN)":"\u179B\u17C1\u1781";case"object":{if(Array.isArray(r))return"\u17A2\u17B6\u179A\u17C1 (Array)";if(r===null)return"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"};return r=>{switch(r.code){case"invalid_type":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${A(r.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${r.maximum.toString()} ${a.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${i} ${r.minimum.toString()} ${a.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${i.prefix}"`:i.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${i.suffix}"`:i.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${i.includes}"`:i.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${i.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${o[i.format]??r.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${r.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${w(r.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${r.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${r.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function xi(){return{localeError:fx()}}function Bm(){return xi()}var gx=()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"};return r=>{switch(r.code){case"invalid_type":return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${r.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${n(r.input)}\uC785\uB2C8\uB2E4`;case"invalid_value":return r.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${A(r.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${w(r.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let i=r.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",a=i==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",u=t(r.origin),l=u?.unit??"\uC694\uC18C";return u?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()}${l} ${i}${a}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()} ${i}${a}`}case"too_small":{let i=r.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",a=i==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",u=t(r.origin),l=u?.unit??"\uC694\uC18C";return u?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()}${l} ${i}${a}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()} ${i}${a}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:i.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${i.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${o[i.format]??r.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${r.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${w(r.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${r.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${r.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function qm(){return{localeError:gx()}}var hx=e=>Rn(typeof e,e),Rn=(e,t=void 0)=>{switch(e){case"number":return Number.isNaN(t)?"NaN":"skai\u010Dius";case"bigint":return"sveikasis skai\u010Dius";case"string":return"eilut\u0117";case"boolean":return"login\u0117 reik\u0161m\u0117";case"undefined":case"void":return"neapibr\u0117\u017Eta reik\u0161m\u0117";case"function":return"funkcija";case"symbol":return"simbolis";case"object":return t===void 0?"ne\u017Einomas objektas":t===null?"nulin\u0117 reik\u0161m\u0117":Array.isArray(t)?"masyvas":Object.getPrototypeOf(t)!==Object.prototype&&t.constructor?t.constructor.name:"objektas";case"null":return"nulin\u0117 reik\u0161m\u0117"}return e},zn=e=>e.charAt(0).toUpperCase()+e.slice(1);function Vm(e){let t=Math.abs(e),n=t%10,o=t%100;return o>=11&&o<=19||n===0?"many":n===1?"one":"few"}var vx=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(o,r,i,a){let u=e[o]??null;return u===null?u:{unit:u.unit[r],verb:u.verb[a][i?"inclusive":"notInclusive"]}}let n={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"};return o=>{switch(o.code){case"invalid_type":return`Gautas tipas ${hx(o.input)}, o tik\u0117tasi - ${Rn(o.expected)}`;case"invalid_value":return o.values.length===1?`Privalo b\u016Bti ${A(o.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${w(o.values,"|")} pasirinkim\u0173`;case"too_big":{let r=Rn(o.origin),i=t(o.origin,Vm(Number(o.maximum)),o.inclusive??!1,"smaller");if(i?.verb)return`${zn(r??o.origin??"reik\u0161m\u0117")} ${i.verb} ${o.maximum.toString()} ${i.unit??"element\u0173"}`;let a=o.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${zn(r??o.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${o.maximum.toString()} ${i?.unit}`}case"too_small":{let r=Rn(o.origin),i=t(o.origin,Vm(Number(o.minimum)),o.inclusive??!1,"bigger");if(i?.verb)return`${zn(r??o.origin??"reik\u0161m\u0117")} ${i.verb} ${o.minimum.toString()} ${i.unit??"element\u0173"}`;let a=o.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${zn(r??o.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${o.minimum.toString()} ${i?.unit}`}case"invalid_format":{let r=o;return r.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${r.prefix}"`:r.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${r.suffix}"`:r.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${r.includes}"`:r.format==="regex"?`Eilut\u0117 privalo atitikti ${r.pattern}`:`Neteisingas ${n[r.format]??o.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${o.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${o.keys.length>1?"i":"as"} rakt${o.keys.length>1?"ai":"as"}: ${w(o.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let r=Rn(o.origin);return`${zn(r??o.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function Jm(){return{localeError:vx()}}var yx=()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0431\u0440\u043E\u0458";case"object":{if(Array.isArray(r))return"\u043D\u0438\u0437\u0430";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"};return r=>{switch(r.code){case"invalid_type":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Invalid input: expected ${A(r.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${i}${r.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0438\u043C\u0430 ${i}${r.minimum.toString()} ${a.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${i.pattern}`:`Invalid ${o[i.format]??r.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${w(r.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${r.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${r.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function Gm(){return{localeError:yx()}}var bx=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"nombor";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Input tidak sah: dijangka ${r.expected}, diterima ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Input tidak sah: dijangka ${A(r.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Terlalu besar: dijangka ${r.origin??"nilai"} ${a.verb} ${i}${r.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${r.origin??"nilai"} adalah ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Terlalu kecil: dijangka ${r.origin} ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${r.origin} adalah ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`String tidak sah: mesti bermula dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak sah: mesti mengandungi "${i.includes}"`:i.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${i.pattern}`:`${o[i.format]??r.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${w(r.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${r.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${r.origin}`;default:return"Input tidak sah"}}};function Wm(){return{localeError:bx()}}var _x=()=>{let e={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"getal";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return r=>{switch(r.code){case"invalid_type":return`Ongeldige invoer: verwacht ${r.expected}, ontving ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Ongeldige invoer: verwacht ${A(r.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Te lang: verwacht dat ${r.origin??"waarde"} ${i}${r.maximum.toString()} ${a.unit??"elementen"} bevat`:`Te lang: verwacht dat ${r.origin??"waarde"} ${i}${r.maximum.toString()} is`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Te kort: verwacht dat ${r.origin} ${i}${r.minimum.toString()} ${a.unit} bevat`:`Te kort: verwacht dat ${r.origin} ${i}${r.minimum.toString()} is`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ongeldige tekst: moet met "${i.prefix}" beginnen`:i.format==="ends_with"?`Ongeldige tekst: moet op "${i.suffix}" eindigen`:i.format==="includes"?`Ongeldige tekst: moet "${i.includes}" bevatten`:i.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`:`Ongeldig: ${o[i.format]??r.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${r.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${r.keys.length>1?"s":""}: ${w(r.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${r.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${r.origin}`;default:return"Ongeldige invoer"}}};function Km(){return{localeError:_x()}}var xx=()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"tall";case"object":{if(Array.isArray(r))return"liste";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Ugyldig input: forventet ${r.expected}, fikk ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Ugyldig verdi: forventet ${A(r.values[0])}`:`Ugyldig valg: forventet en av ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${i}${r.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`For lite(n): forventet ${r.origin} til \xE5 ha ${i}${r.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${r.origin} til \xE5 ha ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${o[i.format]??r.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${w(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${r.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${r.origin}`;default:return"Ugyldig input"}}};function Hm(){return{localeError:xx()}}var Dx=()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"numara";case"object":{if(Array.isArray(r))return"saf";if(r===null)return"gayb";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"};return r=>{switch(r.code){case"invalid_type":return`F\xE2sit giren: umulan ${r.expected}, al\u0131nan ${n(r.input)}`;case"invalid_value":return r.values.length===1?`F\xE2sit giren: umulan ${A(r.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${i}${r.maximum.toString()} ${a.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${i}${r.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${i}${r.minimum.toString()} ${a.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${i}${r.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let i=r;return i.format==="starts_with"?`F\xE2sit metin: "${i.prefix}" ile ba\u015Flamal\u0131.`:i.format==="ends_with"?`F\xE2sit metin: "${i.suffix}" ile bitmeli.`:i.format==="includes"?`F\xE2sit metin: "${i.includes}" ihtiv\xE2 etmeli.`:i.format==="regex"?`F\xE2sit metin: ${i.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${o[i.format]??r.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${r.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${r.keys.length>1?"s":""}: ${w(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${r.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function Ym(){return{localeError:Dx()}}var wx=()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(r))return"\u0627\u0631\u06D0";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"};return r=>{switch(r.code){case"invalid_type":return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${r.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${n(r.input)} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`;case"invalid_value":return r.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${A(r.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${w(r.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${r.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${r.maximum.toString()} \u0648\u064A`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${i}${r.minimum.toString()} ${a.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${i}${r.minimum.toString()} \u0648\u064A`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:i.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:i.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${i.includes}" \u0648\u0644\u0631\u064A`:i.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${i.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${o[i.format]??r.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${r.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${r.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${w(r.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${r.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${r.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function Xm(){return{localeError:wx()}}var kx=()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"liczba";case"object":{if(Array.isArray(r))return"tablica";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"};return r=>{switch(r.code){case"invalid_type":return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${r.expected}, otrzymano ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${A(r.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${r.maximum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${r.minimum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${i.prefix}"`:i.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${i.suffix}"`:i.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${i.includes}"`:i.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${i.pattern}`:`Nieprawid\u0142ow(y/a/e) ${o[i.format]??r.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${r.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${r.keys.length>1?"s":""}: ${w(r.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${r.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${r.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function Qm(){return{localeError:kx()}}var $x=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(r))return"array";if(r===null)return"nulo";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return r=>{switch(r.code){case"invalid_type":return`Tipo inv\xE1lido: esperado ${r.expected}, recebido ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Entrada inv\xE1lida: esperado ${A(r.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Muito grande: esperado que ${r.origin??"valor"} tivesse ${i}${r.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${r.origin??"valor"} fosse ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Muito pequeno: esperado que ${r.origin} tivesse ${i}${r.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${r.origin} fosse ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${i.prefix}"`:i.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${i.suffix}"`:i.format==="includes"?`Texto inv\xE1lido: deve incluir "${i.includes}"`:i.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${i.pattern}`:`${o[i.format]??r.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${r.divisor}`;case"unrecognized_keys":return`Chave${r.keys.length>1?"s":""} desconhecida${r.keys.length>1?"s":""}: ${w(r.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${r.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${r.origin}`;default:return"Campo inv\xE1lido"}}};function ef(){return{localeError:$x()}}function tf(e,t,n,o){let r=Math.abs(e),i=r%10,a=r%100;return a>=11&&a<=19?o:i===1?t:i>=2&&i<=4?n:o}var Sx=()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(r))return"\u043C\u0430\u0441\u0441\u0438\u0432";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"};return r=>{switch(r.code){case"invalid_type":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${r.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${A(r.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a){let u=Number(r.maximum),l=tf(u,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${r.maximum.toString()} ${l}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a){let u=Number(r.minimum),l=tf(u,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${r.minimum.toString()} ${l}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin} \u0431\u0443\u0434\u0435\u0442 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${o[i.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${r.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0438":""}: ${w(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${r.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function rf(){return{localeError:Sx()}}var Ix=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0161tevilo";case"object":{if(Array.isArray(r))return"tabela";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"};return r=>{switch(r.code){case"invalid_type":return`Neveljaven vnos: pri\u010Dakovano ${r.expected}, prejeto ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${A(r.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} imelo ${i}${r.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Premajhno: pri\u010Dakovano, da bo ${r.origin} imelo ${i}${r.minimum.toString()} ${a.unit}`:`Premajhno: pri\u010Dakovano, da bo ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${i.prefix}"`:i.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${i.suffix}"`:i.format==="includes"?`Neveljaven niz: mora vsebovati "${i.includes}"`:i.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`:`Neveljaven ${o[i.format]??r.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${r.divisor}`;case"unrecognized_keys":return`Neprepoznan${r.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${w(r.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${r.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${r.origin}`;default:return"Neveljaven vnos"}}};function nf(){return{localeError:Ix()}}var Ex=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"antal";case"object":{if(Array.isArray(r))return"lista";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return r=>{switch(r.code){case"invalid_type":return`Ogiltig inmatning: f\xF6rv\xE4ntat ${r.expected}, fick ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${A(r.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`F\xF6r stor(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${i}${r.maximum.toString()} ${a.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${r.origin??"v\xE4rdet"} att ha ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${i}${r.minimum.toString()} ${a.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${i.prefix}"`:i.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${i.suffix}"`:i.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${i.includes}"`:i.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${i.pattern}"`:`Ogiltig(t) ${o[i.format]??r.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${w(r.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${r.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${r.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function of(){return{localeError:Ex()}}var Tx=()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"\u0B8E\u0BA3\u0BCD \u0B85\u0BB2\u0BCD\u0BB2\u0BBE\u0BA4\u0BA4\u0BC1":"\u0B8E\u0BA3\u0BCD";case"object":{if(Array.isArray(r))return"\u0B85\u0BA3\u0BBF";if(r===null)return"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${A(r.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${w(r.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${r.maximum.toString()} ${a.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${r.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin} ${i}${r.minimum.toString()} ${a.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin} ${i}${r.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${i.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${o[i.format]??r.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${r.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${r.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${w(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${r.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function af(){return{localeError:Tx()}}var Cx=()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02 (NaN)":"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02";case"object":{if(Array.isArray(r))return"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)";if(r===null)return"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"};return r=>{switch(r.code){case"invalid_type":return`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${r.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${A(r.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",a=t(r.origin);return a?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${r.maximum.toString()} ${a.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",a=t(r.origin);return a?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${r.minimum.toString()} ${a.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${i.prefix}"`:i.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${i.suffix}"`:i.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${i.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:i.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${i.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${o[i.format]??r.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${r.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${w(r.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function sf(){return{localeError:Cx()}}var Ax=e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},Px=()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(o){return e[o]??null}let n={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"};return o=>{switch(o.code){case"invalid_type":return`Ge\xE7ersiz de\u011Fer: beklenen ${o.expected}, al\u0131nan ${Ax(o.input)}`;case"invalid_value":return o.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${A(o.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${w(o.values,"|")}`;case"too_big":{let r=o.inclusive?"<=":"<",i=t(o.origin);return i?`\xC7ok b\xFCy\xFCk: beklenen ${o.origin??"de\u011Fer"} ${r}${o.maximum.toString()} ${i.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${o.origin??"de\u011Fer"} ${r}${o.maximum.toString()}`}case"too_small":{let r=o.inclusive?">=":">",i=t(o.origin);return i?`\xC7ok k\xFC\xE7\xFCk: beklenen ${o.origin} ${r}${o.minimum.toString()} ${i.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${o.origin} ${r}${o.minimum.toString()}`}case"invalid_format":{let r=o;return r.format==="starts_with"?`Ge\xE7ersiz metin: "${r.prefix}" ile ba\u015Flamal\u0131`:r.format==="ends_with"?`Ge\xE7ersiz metin: "${r.suffix}" ile bitmeli`:r.format==="includes"?`Ge\xE7ersiz metin: "${r.includes}" i\xE7ermeli`:r.format==="regex"?`Ge\xE7ersiz metin: ${r.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${n[r.format]??o.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${o.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${o.keys.length>1?"lar":""}: ${w(o.keys,", ")}`;case"invalid_key":return`${o.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${o.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function uf(){return{localeError:Px()}}var Ox=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(r))return"\u043C\u0430\u0441\u0438\u0432";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"};return r=>{switch(r.code){case"invalid_type":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${r.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${A(r.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${a.verb} ${i}${r.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} \u0431\u0443\u0434\u0435 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${o[i.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0456":""}: ${w(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${r.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function Di(){return{localeError:Ox()}}function lf(){return Di()}var jx=()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0646\u0645\u0628\u0631";case"object":{if(Array.isArray(r))return"\u0622\u0631\u06D2";if(r===null)return"\u0646\u0644";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"};return r=>{switch(r.code){case"invalid_type":return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${r.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${n(r.input)} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;case"invalid_value":return r.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${A(r.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${w(r.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${i}${r.maximum.toString()} ${a.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${i}${r.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u06D2 ${i}${r.minimum.toString()} ${a.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u0627 ${i}${r.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${i.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${o[i.format]??r.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${r.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${r.keys.length>1?"\u0632":""}: ${w(r.keys,"\u060C ")}`;case"invalid_key":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function cf(){return{localeError:jx()}}var Nx=()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"s\u1ED1";case"object":{if(Array.isArray(r))return"m\u1EA3ng";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"};return r=>{switch(r.code){case"invalid_type":return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${r.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${A(r.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${a.verb} ${i}${r.maximum.toString()} ${a.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${i.prefix}"`:i.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${i.suffix}"`:i.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${i.includes}"`:i.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${i.pattern}`:`${o[i.format]??r.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${r.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${w(r.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function df(){return{localeError:Nx()}}var zx=()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"\u975E\u6570\u5B57(NaN)":"\u6570\u5B57";case"object":{if(Array.isArray(r))return"\u6570\u7EC4";if(r===null)return"\u7A7A\u503C(null)";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"};return r=>{switch(r.code){case"invalid_type":return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${r.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${A(r.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${i}${r.maximum.toString()} ${a.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${i}${r.minimum.toString()} ${a.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.prefix}" \u5F00\u5934`:i.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.suffix}" \u7ED3\u5C3E`:i.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${i.pattern}`:`\u65E0\u6548${o[i.format]??r.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${r.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${w(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${r.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function pf(){return{localeError:zx()}}var Rx=()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"};return r=>{switch(r.code){case"invalid_type":return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${r.expected}\uFF0C\u4F46\u6536\u5230 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${A(r.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${i}${r.maximum.toString()} ${a.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${i}${r.minimum.toString()} ${a.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.prefix}" \u958B\u982D`:i.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.suffix}" \u7D50\u5C3E`:i.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${i.pattern}`:`\u7121\u6548\u7684 ${o[i.format]??r.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${r.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${r.keys.length>1?"\u5011":""}\uFF1A${w(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function mf(){return{localeError:Rx()}}var Fx=()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"n\u1ECD\u0301mb\xE0";case"object":{if(Array.isArray(r))return"akop\u1ECD";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"};return r=>{switch(r.code){case"invalid_type":return`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${r.expected}, \xE0m\u1ECD\u0300 a r\xED ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${A(r.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin??"iye"} ${a.verb} ${i}${r.maximum} ${a.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${r.maximum}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin} ${a.verb} ${i}${r.minimum} ${a.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${r.minimum}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${i.prefix}"`:i.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${i.suffix}"`:i.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${i.includes}"`:i.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${i.pattern}`:`A\u1E63\xEC\u1E63e: ${o[i.format]??r.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${r.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${w(r.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${r.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${r.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function ff(){return{localeError:Fx()}}var pl=Symbol("ZodOutput"),ml=Symbol("ZodInput"),Pr=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){let o=n[0];if(this._map.set(t,o),o&&typeof o=="object"&&"id"in o){if(this._idmap.has(o.id))throw new Error(`ID ${o.id} already exists in the registry`);this._idmap.set(o.id,t)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){let n=t._zod.parent;if(n){let o={...this.get(n)??{}};delete o.id;let r={...o,...this._map.get(t)};return Object.keys(r).length?r:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function wi(){return new Pr}var ht=wi();function fl(e,t){return new e({type:"string",...P(t)})}function gl(e,t){return new e({type:"string",coerce:!0,...P(t)})}function ki(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...P(t)})}function Mn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...P(t)})}function $i(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...P(t)})}function Si(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...P(t)})}function Ii(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...P(t)})}function Ei(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...P(t)})}function Un(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...P(t)})}function Ti(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...P(t)})}function Ci(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...P(t)})}function Ai(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...P(t)})}function Pi(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...P(t)})}function Oi(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...P(t)})}function ji(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...P(t)})}function Ni(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...P(t)})}function zi(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...P(t)})}function Ri(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...P(t)})}function Fi(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...P(t)})}function Mi(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...P(t)})}function Ui(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...P(t)})}function Zi(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...P(t)})}function Li(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...P(t)})}function Bi(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...P(t)})}var hl={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function vl(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...P(t)})}function yl(e,t){return new e({type:"string",format:"date",check:"string_format",...P(t)})}function bl(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...P(t)})}function _l(e,t){return new e({type:"string",format:"duration",check:"string_format",...P(t)})}function xl(e,t){return new e({type:"number",checks:[],...P(t)})}function Dl(e,t){return new e({type:"number",coerce:!0,checks:[],...P(t)})}function wl(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...P(t)})}function kl(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...P(t)})}function $l(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...P(t)})}function Sl(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...P(t)})}function Il(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...P(t)})}function El(e,t){return new e({type:"boolean",...P(t)})}function Tl(e,t){return new e({type:"boolean",coerce:!0,...P(t)})}function Cl(e,t){return new e({type:"bigint",...P(t)})}function Al(e,t){return new e({type:"bigint",coerce:!0,...P(t)})}function Pl(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...P(t)})}function Ol(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...P(t)})}function jl(e,t){return new e({type:"symbol",...P(t)})}function Nl(e,t){return new e({type:"undefined",...P(t)})}function zl(e,t){return new e({type:"null",...P(t)})}function Rl(e){return new e({type:"any"})}function Fl(e){return new e({type:"unknown"})}function Ml(e,t){return new e({type:"never",...P(t)})}function Ul(e,t){return new e({type:"void",...P(t)})}function Zl(e,t){return new e({type:"date",...P(t)})}function Ll(e,t){return new e({type:"date",coerce:!0,...P(t)})}function Bl(e,t){return new e({type:"nan",...P(t)})}function St(e,t){return new li({check:"less_than",...P(t),value:e,inclusive:!1})}function Xe(e,t){return new li({check:"less_than",...P(t),value:e,inclusive:!0})}function It(e,t){return new ci({check:"greater_than",...P(t),value:e,inclusive:!1})}function Re(e,t){return new ci({check:"greater_than",...P(t),value:e,inclusive:!0})}function ql(e){return It(0,e)}function Vl(e){return St(0,e)}function Jl(e){return Xe(0,e)}function Gl(e){return Re(0,e)}function cr(e,t){return new Ms({check:"multiple_of",...P(t),value:e})}function Or(e,t){return new Ls({check:"max_size",...P(t),maximum:e})}function dr(e,t){return new Bs({check:"min_size",...P(t),minimum:e})}function Zn(e,t){return new qs({check:"size_equals",...P(t),size:e})}function jr(e,t){return new Vs({check:"max_length",...P(t),maximum:e})}function Yt(e,t){return new Js({check:"min_length",...P(t),minimum:e})}function Nr(e,t){return new Gs({check:"length_equals",...P(t),length:e})}function Ln(e,t){return new Ws({check:"string_format",format:"regex",...P(t),pattern:e})}function Bn(e){return new Ks({check:"string_format",format:"lowercase",...P(e)})}function qn(e){return new Hs({check:"string_format",format:"uppercase",...P(e)})}function Vn(e,t){return new Ys({check:"string_format",format:"includes",...P(t),includes:e})}function Jn(e,t){return new Xs({check:"string_format",format:"starts_with",...P(t),prefix:e})}function Gn(e,t){return new Qs({check:"string_format",format:"ends_with",...P(t),suffix:e})}function Wl(e,t,n){return new eu({check:"property",property:e,schema:t,...P(n)})}function Wn(e,t){return new tu({check:"mime_type",mime:e,...P(t)})}function Et(e){return new ru({check:"overwrite",tx:e})}function Kn(e){return Et(t=>t.normalize(e))}function Hn(){return Et(e=>e.trim())}function Yn(){return Et(e=>e.toLowerCase())}function Xn(){return Et(e=>e.toUpperCase())}function Kl(e,t,n){return new e({type:"array",element:t,...P(n)})}function Mx(e,t,n){return new e({type:"union",options:t,...P(n)})}function Ux(e,t,n,o){return new e({type:"union",options:n,discriminator:t,...P(o)})}function Zx(e,t,n){return new e({type:"intersection",left:t,right:n})}function Lx(e,t,n,o){let r=n instanceof q,i=r?o:n,a=r?n:null;return new e({type:"tuple",items:t,rest:a,...P(i)})}function Bx(e,t,n,o){return new e({type:"record",keyType:t,valueType:n,...P(o)})}function qx(e,t,n,o){return new e({type:"map",keyType:t,valueType:n,...P(o)})}function Vx(e,t,n){return new e({type:"set",valueType:t,...P(n)})}function Jx(e,t,n){let o=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new e({type:"enum",entries:o,...P(n)})}function Gx(e,t,n){return new e({type:"enum",entries:t,...P(n)})}function Wx(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],...P(n)})}function Hl(e,t){return new e({type:"file",...P(t)})}function Kx(e,t){return new e({type:"transform",transform:t})}function Hx(e,t){return new e({type:"optional",innerType:t})}function Yx(e,t){return new e({type:"nullable",innerType:t})}function Xx(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return typeof n=="function"?n():ts(n)}})}function Qx(e,t,n){return new e({type:"nonoptional",innerType:t,...P(n)})}function eD(e,t){return new e({type:"success",innerType:t})}function tD(e,t,n){return new e({type:"catch",innerType:t,catchValue:typeof n=="function"?n:()=>n})}function rD(e,t,n){return new e({type:"pipe",in:t,out:n})}function nD(e,t){return new e({type:"readonly",innerType:t})}function oD(e,t,n){return new e({type:"template_literal",parts:t,...P(n)})}function iD(e,t){return new e({type:"lazy",getter:t})}function aD(e,t){return new e({type:"promise",innerType:t})}function Yl(e,t,n){let o=P(n);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}function Xl(e,t,n){return new e({type:"custom",check:"custom",fn:t,...P(n)})}function Ql(e){let t=gf(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(Sr(o,n.value,t._zod.def));else{let r=o;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),n.issues.push(Sr(r))}},e(n.value,n)));return t}function gf(e,t){let n=new se({check:"custom",...P(t)});return n._zod.check=e,n}function ec(e,t){let n=P(t),o=n.truthy??["true","1","yes","on","y","enabled"],r=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(o=o.map(p=>typeof p=="string"?p.toLowerCase():p),r=r.map(p=>typeof p=="string"?p.toLowerCase():p));let i=new Set(o),a=new Set(r),u=e.Codec??Nn,l=e.Boolean??jn,c=e.String??lr,m=new c({type:"string",error:n.error}),h=new l({type:"boolean",error:n.error}),y=new u({type:"pipe",in:m,out:h,transform:((p,d)=>{let f=p;return n.case!=="sensitive"&&(f=f.toLowerCase()),i.has(f)?!0:a.has(f)?!1:(d.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...a],input:d.value,inst:y,continue:!1}),{})}),reverseTransform:((p,d)=>p===!0?o[0]||"true":r[0]||"false"),error:n.error});return y}function zr(e,t,n,o={}){let r=P(o),i={...P(o),check:"string_format",type:"string",format:t,fn:typeof n=="function"?n:u=>n.test(u),...r};return n instanceof RegExp&&(i.pattern=n),new e(i)}var Qn=class{constructor(t){this.counter=0,this.metadataRegistry=t?.metadata??ht,this.target=t?.target??"draft-2020-12",this.unrepresentable=t?.unrepresentable??"throw",this.override=t?.override??(()=>{}),this.io=t?.io??"output",this.seen=new Map}process(t,n={path:[],schemaPath:[]}){var o;let r=t._zod.def,i={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},a=this.seen.get(t);if(a)return a.count++,n.schemaPath.includes(t)&&(a.cycle=n.path),a.schema;let u={schema:{},count:1,cycle:void 0,path:n.path};this.seen.set(t,u);let l=t._zod.toJSONSchema?.();if(l)u.schema=l;else{let h={...n,schemaPath:[...n.schemaPath,t],path:n.path},y=t._zod.parent;if(y)u.ref=y,this.process(y,h),this.seen.get(y).isParent=!0;else{let p=u.schema;switch(r.type){case"string":{let d=p;d.type="string";let{minimum:f,maximum:v,format:x,patterns:b,contentEncoding:S}=t._zod.bag;if(typeof f=="number"&&(d.minLength=f),typeof v=="number"&&(d.maxLength=v),x&&(d.format=i[x]??x,d.format===""&&delete d.format),S&&(d.contentEncoding=S),b&&b.size>0){let _=[...b];_.length===1?d.pattern=_[0].source:_.length>1&&(u.schema.allOf=[..._.map(O=>({...this.target==="draft-7"||this.target==="draft-4"||this.target==="openapi-3.0"?{type:"string"}:{},pattern:O.source}))])}break}case"number":{let d=p,{minimum:f,maximum:v,format:x,multipleOf:b,exclusiveMaximum:S,exclusiveMinimum:_}=t._zod.bag;typeof x=="string"&&x.includes("int")?d.type="integer":d.type="number",typeof _=="number"&&(this.target==="draft-4"||this.target==="openapi-3.0"?(d.minimum=_,d.exclusiveMinimum=!0):d.exclusiveMinimum=_),typeof f=="number"&&(d.minimum=f,typeof _=="number"&&this.target!=="draft-4"&&(_>=f?delete d.minimum:delete d.exclusiveMinimum)),typeof S=="number"&&(this.target==="draft-4"||this.target==="openapi-3.0"?(d.maximum=S,d.exclusiveMaximum=!0):d.exclusiveMaximum=S),typeof v=="number"&&(d.maximum=v,typeof S=="number"&&this.target!=="draft-4"&&(S<=v?delete d.maximum:delete d.exclusiveMaximum)),typeof b=="number"&&(d.multipleOf=b);break}case"boolean":{let d=p;d.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{this.target==="openapi-3.0"?(p.type="string",p.nullable=!0,p.enum=[null]):p.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{p.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let d=p,{minimum:f,maximum:v}=t._zod.bag;typeof f=="number"&&(d.minItems=f),typeof v=="number"&&(d.maxItems=v),d.type="array",d.items=this.process(r.element,{...h,path:[...h.path,"items"]});break}case"object":{let d=p;d.type="object",d.properties={};let f=r.shape;for(let b in f)d.properties[b]=this.process(f[b],{...h,path:[...h.path,"properties",b]});let v=new Set(Object.keys(f)),x=new Set([...v].filter(b=>{let S=r.shape[b]._zod;return this.io==="input"?S.optin===void 0:S.optout===void 0}));x.size>0&&(d.required=Array.from(x)),r.catchall?._zod.def.type==="never"?d.additionalProperties=!1:r.catchall?r.catchall&&(d.additionalProperties=this.process(r.catchall,{...h,path:[...h.path,"additionalProperties"]})):this.io==="output"&&(d.additionalProperties=!1);break}case"union":{let d=p,f=r.options.map((v,x)=>this.process(v,{...h,path:[...h.path,"anyOf",x]}));d.anyOf=f;break}case"intersection":{let d=p,f=this.process(r.left,{...h,path:[...h.path,"allOf",0]}),v=this.process(r.right,{...h,path:[...h.path,"allOf",1]}),x=S=>"allOf"in S&&Object.keys(S).length===1,b=[...x(f)?f.allOf:[f],...x(v)?v.allOf:[v]];d.allOf=b;break}case"tuple":{let d=p;d.type="array";let f=this.target==="draft-2020-12"?"prefixItems":"items",v=this.target==="draft-2020-12"||this.target==="openapi-3.0"?"items":"additionalItems",x=r.items.map((O,T)=>this.process(O,{...h,path:[...h.path,f,T]})),b=r.rest?this.process(r.rest,{...h,path:[...h.path,v,...this.target==="openapi-3.0"?[r.items.length]:[]]}):null;this.target==="draft-2020-12"?(d.prefixItems=x,b&&(d.items=b)):this.target==="openapi-3.0"?(d.items={anyOf:x},b&&d.items.anyOf.push(b),d.minItems=x.length,b||(d.maxItems=x.length)):(d.items=x,b&&(d.additionalItems=b));let{minimum:S,maximum:_}=t._zod.bag;typeof S=="number"&&(d.minItems=S),typeof _=="number"&&(d.maxItems=_);break}case"record":{let d=p;d.type="object",(this.target==="draft-7"||this.target==="draft-2020-12")&&(d.propertyNames=this.process(r.keyType,{...h,path:[...h.path,"propertyNames"]})),d.additionalProperties=this.process(r.valueType,{...h,path:[...h.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let d=p,f=wn(r.entries);f.every(v=>typeof v=="number")&&(d.type="number"),f.every(v=>typeof v=="string")&&(d.type="string"),d.enum=f;break}case"literal":{let d=p,f=[];for(let v of r.values)if(v===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof v=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");f.push(Number(v))}else f.push(v);if(f.length!==0)if(f.length===1){let v=f[0];d.type=v===null?"null":typeof v,this.target==="draft-4"||this.target==="openapi-3.0"?d.enum=[v]:d.const=v}else f.every(v=>typeof v=="number")&&(d.type="number"),f.every(v=>typeof v=="string")&&(d.type="string"),f.every(v=>typeof v=="boolean")&&(d.type="string"),f.every(v=>v===null)&&(d.type="null"),d.enum=f;break}case"file":{let d=p,f={type:"string",format:"binary",contentEncoding:"binary"},{minimum:v,maximum:x,mime:b}=t._zod.bag;v!==void 0&&(f.minLength=v),x!==void 0&&(f.maxLength=x),b?b.length===1?(f.contentMediaType=b[0],Object.assign(d,f)):d.anyOf=b.map(S=>({...f,contentMediaType:S})):Object.assign(d,f);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let d=this.process(r.innerType,h);this.target==="openapi-3.0"?(u.ref=r.innerType,p.nullable=!0):p.anyOf=[d,{type:"null"}];break}case"nonoptional":{this.process(r.innerType,h),u.ref=r.innerType;break}case"success":{let d=p;d.type="boolean";break}case"default":{this.process(r.innerType,h),u.ref=r.innerType,p.default=JSON.parse(JSON.stringify(r.defaultValue));break}case"prefault":{this.process(r.innerType,h),u.ref=r.innerType,this.io==="input"&&(p._prefault=JSON.parse(JSON.stringify(r.defaultValue)));break}case"catch":{this.process(r.innerType,h),u.ref=r.innerType;let d;try{d=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}p.default=d;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let d=p,f=t._zod.pattern;if(!f)throw new Error("Pattern not found in template literal");d.type="string",d.pattern=f.source;break}case"pipe":{let d=this.io==="input"?r.in._zod.def.type==="transform"?r.out:r.in:r.out;this.process(d,h),u.ref=d;break}case"readonly":{this.process(r.innerType,h),u.ref=r.innerType,p.readOnly=!0;break}case"promise":{this.process(r.innerType,h),u.ref=r.innerType;break}case"optional":{this.process(r.innerType,h),u.ref=r.innerType;break}case"lazy":{let d=t._zod.innerType;this.process(d,h),u.ref=d;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}case"function":{if(this.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema");break}default:}}}let c=this.metadataRegistry.get(t);return c&&Object.assign(u.schema,c),this.io==="input"&&he(t)&&(delete u.schema.examples,delete u.schema.default),this.io==="input"&&u.schema._prefault&&((o=u.schema).default??(o.default=u.schema._prefault)),delete u.schema._prefault,this.seen.get(t).schema}emit(t,n){let o={cycles:n?.cycles??"ref",reused:n?.reused??"inline",external:n?.external??void 0},r=this.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=m=>{let h=this.target==="draft-2020-12"?"$defs":"definitions";if(o.external){let f=o.external.registry.get(m[0])?.id,v=o.external.uri??(b=>b);if(f)return{ref:v(f)};let x=m[1].defId??m[1].schema.id??`schema${this.counter++}`;return m[1].defId=x,{defId:x,ref:`${v("__shared")}#/${h}/${x}`}}if(m[1]===r)return{ref:"#"};let p=`#/${h}/`,d=m[1].schema.id??`__schema${this.counter++}`;return{defId:d,ref:p+d}},a=m=>{if(m[1].schema.$ref)return;let h=m[1],{ref:y,defId:p}=i(m);h.def={...h.schema},p&&(h.defId=p);let d=h.schema;for(let f in d)delete d[f];d.$ref=y};if(o.cycles==="throw")for(let m of this.seen.entries()){let h=m[1];if(h.cycle)throw new Error(`Cycle detected: #/${h.cycle?.join("/")}/<root>
|
|
35
35
|
|
|
36
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let m of this.seen.entries()){let h=m[1];if(t===m[0]){a(m);continue}if(o.external){let p=o.external.registry.get(m[0])?.id;if(t!==m[0]&&p){a(m);continue}}if(this.metadataRegistry.get(m[0])?.id){a(m);continue}if(h.cycle){a(m);continue}if(h.count>1&&o.reused==="ref"){a(m);continue}}let u=(m,h)=>{let y=this.seen.get(m),p=y.def??y.schema,d={...p};if(y.ref===null)return;let f=y.ref;if(y.ref=null,f){u(f,h);let v=this.seen.get(f).schema;v.$ref&&(h.target==="draft-7"||h.target==="draft-4"||h.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(v)):(Object.assign(p,v),Object.assign(p,d))}y.isParent||this.override({zodSchema:m,jsonSchema:p,path:y.path??[]})};for(let m of[...this.seen.entries()].reverse())u(m[0],{target:this.target});let l={};if(this.target==="draft-2020-12"?l.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?l.$schema="http://json-schema.org/draft-07/schema#":this.target==="draft-4"?l.$schema="http://json-schema.org/draft-04/schema#":this.target==="openapi-3.0"||console.warn(`Invalid target: ${this.target}`),o.external?.uri){let m=o.external.registry.get(t)?.id;if(!m)throw new Error("Schema is missing an `id` property");l.$id=o.external.uri(m)}Object.assign(l,r.def);let c=o.external?.defs??{};for(let m of this.seen.entries()){let h=m[1];h.def&&h.defId&&(c[h.defId]=h.def)}o.external||Object.keys(c).length>0&&(this.target==="draft-2020-12"?l.$defs=c:l.definitions=c);try{return JSON.parse(JSON.stringify(l))}catch{throw new Error("Error converting schema to JSON.")}}};function eo(e,t){if(e instanceof Pr){let o=new Qn(t),r={};for(let u of e._idmap.entries()){let[l,c]=u;o.process(c)}let i={},a={registry:e,uri:t?.uri,defs:r};for(let u of e._idmap.entries()){let[l,c]=u;i[l]=o.emit(c,{...t,external:a})}if(Object.keys(r).length>0){let u=o.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[u]:r}}return{schemas:i}}let n=new Qn(t);return n.process(e),n.emit(e,t)}function he(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;switch(r.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return he(r.element,n);case"object":{for(let i in r.shape)if(he(r.shape[i],n))return!0;return!1}case"union":{for(let i of r.options)if(he(i,n))return!0;return!1}case"intersection":return he(r.left,n)||he(r.right,n);case"tuple":{for(let i of r.items)if(he(i,n))return!0;return!!(r.rest&&he(r.rest,n))}case"record":return he(r.keyType,n)||he(r.valueType,n);case"map":return he(r.keyType,n)||he(r.valueType,n);case"set":return he(r.valueType,n);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return he(r.innerType,n);case"lazy":return he(r.getter(),n);case"default":return he(r.innerType,n);case"prefault":return he(r.innerType,n);case"custom":return!1;case"transform":return!0;case"pipe":return he(r.in,n)||he(r.out,n);case"success":return!1;case"catch":return!1;case"function":return!1;default:}throw new Error(`Unknown schema type: ${r.type}`)}var hf={};var Wi={};Bt(Wi,{ZodISODate:()=>qi,ZodISODateTime:()=>Vi,ZodISODuration:()=>Gi,ZodISOTime:()=>Ji,date:()=>rc,datetime:()=>tc,duration:()=>oc,time:()=>nc});var Vi=D("ZodISODateTime",(e,t)=>{hu.init(e,t),ae.init(e,t)});function tc(e){return vl(Vi,e)}var qi=D("ZodISODate",(e,t)=>{vu.init(e,t),ae.init(e,t)});function rc(e){return yl(qi,e)}var Ji=D("ZodISOTime",(e,t)=>{yu.init(e,t),ae.init(e,t)});function nc(e){return bl(Ji,e)}var Gi=D("ZodISODuration",(e,t)=>{bu.init(e,t),ae.init(e,t)});function oc(e){return _l(Gi,e)}var yf=(e,t)=>{En.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>Cn(e,n)},flatten:{value:n=>Tn(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,kr,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,kr,2)}},isEmpty:{get(){return e.issues.length===0}}})},uD=D("ZodError",yf),Fe=D("ZodError",yf,{Parent:Error});var ic=Ir(Fe),ac=Er(Fe),sc=Tr(Fe),to=Cr(Fe),uc=ei(Fe),lc=ti(Fe),cc=ri(Fe),dc=ni(Fe),pc=oi(Fe),mc=ii(Fe),fc=ai(Fe),gc=si(Fe);var J=D("ZodType",(e,t)=>(V.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),e.clone=(n,o)=>Ce(e,n,o),e.brand=()=>e,e.register=((n,o)=>(n.add(e,o),e)),e.parse=(n,o)=>ic(e,n,o,{callee:e.parse}),e.safeParse=(n,o)=>sc(e,n,o),e.parseAsync=async(n,o)=>ac(e,n,o,{callee:e.parseAsync}),e.safeParseAsync=async(n,o)=>to(e,n,o),e.spa=e.safeParseAsync,e.encode=(n,o)=>uc(e,n,o),e.decode=(n,o)=>lc(e,n,o),e.encodeAsync=async(n,o)=>cc(e,n,o),e.decodeAsync=async(n,o)=>dc(e,n,o),e.safeEncode=(n,o)=>pc(e,n,o),e.safeDecode=(n,o)=>mc(e,n,o),e.safeEncodeAsync=async(n,o)=>fc(e,n,o),e.safeDecodeAsync=async(n,o)=>gc(e,n,o),e.refine=(n,o)=>e.check(og(n,o)),e.superRefine=n=>e.check(ig(n)),e.overwrite=n=>e.check(Et(n)),e.optional=()=>Hi(e),e.nullable=()=>Yi(e),e.nullish=()=>Hi(Yi(e)),e.nonoptional=n=>Jf(e,n),e.array=()=>ta(e),e.or=n=>Fc([e,n]),e.and=n=>Pf(e,n),e.transform=n=>Xi(e,Zc(n)),e.default=n=>Bf(e,n),e.prefault=n=>qf(e,n),e.catch=n=>Kf(e,n),e.pipe=n=>Xi(e,n),e.readonly=()=>Xf(e),e.describe=n=>{let o=e.clone();return ht.add(o,{description:n}),o},Object.defineProperty(e,"description",{get(){return ht.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return ht.get(e);let o=e.clone();return ht.add(o,n[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),yc=D("_ZodString",(e,t)=>{lr.init(e,t),J.init(e,t);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...o)=>e.check(Ln(...o)),e.includes=(...o)=>e.check(qn(...o)),e.startsWith=(...o)=>e.check(Jn(...o)),e.endsWith=(...o)=>e.check(Gn(...o)),e.min=(...o)=>e.check(Yt(...o)),e.max=(...o)=>e.check(jr(...o)),e.length=(...o)=>e.check(Nr(...o)),e.nonempty=(...o)=>e.check(Yt(1,...o)),e.lowercase=o=>e.check(Bn(o)),e.uppercase=o=>e.check(Vn(o)),e.trim=()=>e.check(Hn()),e.normalize=(...o)=>e.check(Kn(...o)),e.toLowerCase=()=>e.check(Yn()),e.toUpperCase=()=>e.check(Xn())}),no=D("ZodString",(e,t)=>{lr.init(e,t),yc.init(e,t),e.email=n=>e.check(ki(bc,n)),e.url=n=>e.check(Un(Qi,n)),e.jwt=n=>e.check(Bi(jc,n)),e.emoji=n=>e.check(Ti(_c,n)),e.guid=n=>e.check(Mn(Ki,n)),e.uuid=n=>e.check($i(Ct,n)),e.uuidv4=n=>e.check(Si(Ct,n)),e.uuidv6=n=>e.check(Ii(Ct,n)),e.uuidv7=n=>e.check(Ei(Ct,n)),e.nanoid=n=>e.check(Ci(xc,n)),e.guid=n=>e.check(Mn(Ki,n)),e.cuid=n=>e.check(Ai(Dc,n)),e.cuid2=n=>e.check(Pi(wc,n)),e.ulid=n=>e.check(Oi(kc,n)),e.base64=n=>e.check(Ui(Ac,n)),e.base64url=n=>e.check(Zi(Pc,n)),e.xid=n=>e.check(ji($c,n)),e.ksuid=n=>e.check(Ni(Sc,n)),e.ipv4=n=>e.check(zi(Ic,n)),e.ipv6=n=>e.check(Ri(Ec,n)),e.cidrv4=n=>e.check(Fi(Tc,n)),e.cidrv6=n=>e.check(Mi(Cc,n)),e.e164=n=>e.check(Li(Oc,n)),e.datetime=n=>e.check(tc(n)),e.date=n=>e.check(rc(n)),e.time=n=>e.check(nc(n)),e.duration=n=>e.check(oc(n))});function hc(e){return fl(no,e)}var ae=D("ZodStringFormat",(e,t)=>{oe.init(e,t),yc.init(e,t)}),bc=D("ZodEmail",(e,t)=>{su.init(e,t),ae.init(e,t)});function cD(e){return ki(bc,e)}var Ki=D("ZodGUID",(e,t)=>{iu.init(e,t),ae.init(e,t)});function dD(e){return Mn(Ki,e)}var Ct=D("ZodUUID",(e,t)=>{au.init(e,t),ae.init(e,t)});function pD(e){return $i(Ct,e)}function mD(e){return Si(Ct,e)}function fD(e){return Ii(Ct,e)}function gD(e){return Ei(Ct,e)}var Qi=D("ZodURL",(e,t)=>{uu.init(e,t),ae.init(e,t)});function hD(e){return Un(Qi,e)}function vD(e){return Un(Qi,{protocol:/^https?$/,hostname:Ye.domain,...E.normalizeParams(e)})}var _c=D("ZodEmoji",(e,t)=>{lu.init(e,t),ae.init(e,t)});function yD(e){return Ti(_c,e)}var xc=D("ZodNanoID",(e,t)=>{cu.init(e,t),ae.init(e,t)});function bD(e){return Ci(xc,e)}var Dc=D("ZodCUID",(e,t)=>{du.init(e,t),ae.init(e,t)});function _D(e){return Ai(Dc,e)}var wc=D("ZodCUID2",(e,t)=>{pu.init(e,t),ae.init(e,t)});function xD(e){return Pi(wc,e)}var kc=D("ZodULID",(e,t)=>{mu.init(e,t),ae.init(e,t)});function DD(e){return Oi(kc,e)}var $c=D("ZodXID",(e,t)=>{fu.init(e,t),ae.init(e,t)});function wD(e){return ji($c,e)}var Sc=D("ZodKSUID",(e,t)=>{gu.init(e,t),ae.init(e,t)});function kD(e){return Ni(Sc,e)}var Ic=D("ZodIPv4",(e,t)=>{_u.init(e,t),ae.init(e,t)});function $D(e){return zi(Ic,e)}var Ec=D("ZodIPv6",(e,t)=>{xu.init(e,t),ae.init(e,t)});function SD(e){return Ri(Ec,e)}var Tc=D("ZodCIDRv4",(e,t)=>{Du.init(e,t),ae.init(e,t)});function ID(e){return Fi(Tc,e)}var Cc=D("ZodCIDRv6",(e,t)=>{wu.init(e,t),ae.init(e,t)});function ED(e){return Mi(Cc,e)}var Ac=D("ZodBase64",(e,t)=>{$u.init(e,t),ae.init(e,t)});function TD(e){return Ui(Ac,e)}var Pc=D("ZodBase64URL",(e,t)=>{Su.init(e,t),ae.init(e,t)});function CD(e){return Zi(Pc,e)}var Oc=D("ZodE164",(e,t)=>{Iu.init(e,t),ae.init(e,t)});function AD(e){return Li(Oc,e)}var jc=D("ZodJWT",(e,t)=>{Eu.init(e,t),ae.init(e,t)});function PD(e){return Bi(jc,e)}var oo=D("ZodCustomStringFormat",(e,t)=>{Tu.init(e,t),ae.init(e,t)});function OD(e,t,n={}){return zr(oo,e,t,n)}function jD(e){return zr(oo,"hostname",Ye.hostname,e)}function ND(e){return zr(oo,"hex",Ye.hex,e)}function zD(e,t){let n=t?.enc??"hex",o=`${e}_${n}`,r=Ye[o];if(!r)throw new Error(`Unrecognized hash format: ${o}`);return zr(oo,o,r,t)}var io=D("ZodNumber",(e,t)=>{hi.init(e,t),J.init(e,t),e.gt=(o,r)=>e.check(It(o,r)),e.gte=(o,r)=>e.check(Re(o,r)),e.min=(o,r)=>e.check(Re(o,r)),e.lt=(o,r)=>e.check(St(o,r)),e.lte=(o,r)=>e.check(Xe(o,r)),e.max=(o,r)=>e.check(Xe(o,r)),e.int=o=>e.check(vc(o)),e.safe=o=>e.check(vc(o)),e.positive=o=>e.check(It(0,o)),e.nonnegative=o=>e.check(Re(0,o)),e.negative=o=>e.check(St(0,o)),e.nonpositive=o=>e.check(Xe(0,o)),e.multipleOf=(o,r)=>e.check(cr(o,r)),e.step=(o,r)=>e.check(cr(o,r)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function bf(e){return xl(io,e)}var Fr=D("ZodNumberFormat",(e,t)=>{Cu.init(e,t),io.init(e,t)});function vc(e){return wl(Fr,e)}function RD(e){return kl(Fr,e)}function FD(e){return $l(Fr,e)}function MD(e){return Sl(Fr,e)}function UD(e){return Il(Fr,e)}var ao=D("ZodBoolean",(e,t)=>{jn.init(e,t),J.init(e,t)});function _f(e){return El(ao,e)}var so=D("ZodBigInt",(e,t)=>{vi.init(e,t),J.init(e,t),e.gte=(o,r)=>e.check(Re(o,r)),e.min=(o,r)=>e.check(Re(o,r)),e.gt=(o,r)=>e.check(It(o,r)),e.gte=(o,r)=>e.check(Re(o,r)),e.min=(o,r)=>e.check(Re(o,r)),e.lt=(o,r)=>e.check(St(o,r)),e.lte=(o,r)=>e.check(Xe(o,r)),e.max=(o,r)=>e.check(Xe(o,r)),e.positive=o=>e.check(It(BigInt(0),o)),e.negative=o=>e.check(St(BigInt(0),o)),e.nonpositive=o=>e.check(Xe(BigInt(0),o)),e.nonnegative=o=>e.check(Re(BigInt(0),o)),e.multipleOf=(o,r)=>e.check(cr(o,r));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function ZD(e){return Cl(so,e)}var Nc=D("ZodBigIntFormat",(e,t)=>{Au.init(e,t),so.init(e,t)});function LD(e){return Pl(Nc,e)}function BD(e){return Ol(Nc,e)}var xf=D("ZodSymbol",(e,t)=>{Pu.init(e,t),J.init(e,t)});function VD(e){return jl(xf,e)}var Df=D("ZodUndefined",(e,t)=>{Ou.init(e,t),J.init(e,t)});function qD(e){return Nl(Df,e)}var wf=D("ZodNull",(e,t)=>{ju.init(e,t),J.init(e,t)});function kf(e){return zl(wf,e)}var $f=D("ZodAny",(e,t)=>{Nu.init(e,t),J.init(e,t)});function JD(){return Rl($f)}var Sf=D("ZodUnknown",(e,t)=>{zu.init(e,t),J.init(e,t)});function Rr(){return Fl(Sf)}var If=D("ZodNever",(e,t)=>{Ru.init(e,t),J.init(e,t)});function zc(e){return Ml(If,e)}var Ef=D("ZodVoid",(e,t)=>{Fu.init(e,t),J.init(e,t)});function GD(e){return Ul(Ef,e)}var ea=D("ZodDate",(e,t)=>{Mu.init(e,t),J.init(e,t),e.min=(o,r)=>e.check(Re(o,r)),e.max=(o,r)=>e.check(Xe(o,r));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function WD(e){return Zl(ea,e)}var Tf=D("ZodArray",(e,t)=>{Uu.init(e,t),J.init(e,t),e.element=t.element,e.min=(n,o)=>e.check(Yt(n,o)),e.nonempty=n=>e.check(Yt(1,n)),e.max=(n,o)=>e.check(jr(n,o)),e.length=(n,o)=>e.check(Nr(n,o)),e.unwrap=()=>e.element});function ta(e,t){return Kl(Tf,e,t)}function KD(e){let t=e._zod.def.shape;return Uc(Object.keys(t))}var ra=D("ZodObject",(e,t)=>{Zu.init(e,t),J.init(e,t),E.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>Uc(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Rr()}),e.loose=()=>e.clone({...e._zod.def,catchall:Rr()}),e.strict=()=>e.clone({...e._zod.def,catchall:zc()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>E.extend(e,n),e.safeExtend=n=>E.safeExtend(e,n),e.merge=n=>E.merge(e,n),e.pick=n=>E.pick(e,n),e.omit=n=>E.omit(e,n),e.partial=(...n)=>E.partial(Lc,e,n[0]),e.required=(...n)=>E.required(Bc,e,n[0])});function HD(e,t){let n={type:"object",get shape(){return E.assignProp(this,"shape",e?E.objectClone(e):{}),this.shape},...E.normalizeParams(t)};return new ra(n)}function YD(e,t){return new ra({type:"object",get shape(){return E.assignProp(this,"shape",E.objectClone(e)),this.shape},catchall:zc(),...E.normalizeParams(t)})}function XD(e,t){return new ra({type:"object",get shape(){return E.assignProp(this,"shape",E.objectClone(e)),this.shape},catchall:Rr(),...E.normalizeParams(t)})}var Rc=D("ZodUnion",(e,t)=>{yi.init(e,t),J.init(e,t),e.options=t.options});function Fc(e,t){return new Rc({type:"union",options:e,...E.normalizeParams(t)})}var Cf=D("ZodDiscriminatedUnion",(e,t)=>{Rc.init(e,t),Lu.init(e,t)});function QD(e,t,n){return new Cf({type:"union",options:t,discriminator:e,...E.normalizeParams(n)})}var Af=D("ZodIntersection",(e,t)=>{Bu.init(e,t),J.init(e,t)});function Pf(e,t){return new Af({type:"intersection",left:e,right:t})}var Of=D("ZodTuple",(e,t)=>{bi.init(e,t),J.init(e,t),e.rest=n=>e.clone({...e._zod.def,rest:n})});function jf(e,t,n){let o=t instanceof V,r=o?n:t,i=o?t:null;return new Of({type:"tuple",items:e,rest:i,...E.normalizeParams(r)})}var Mc=D("ZodRecord",(e,t)=>{Vu.init(e,t),J.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Nf(e,t,n){return new Mc({type:"record",keyType:e,valueType:t,...E.normalizeParams(n)})}function ew(e,t,n){let o=Ce(e);return o._zod.values=void 0,new Mc({type:"record",keyType:o,valueType:t,...E.normalizeParams(n)})}var zf=D("ZodMap",(e,t)=>{qu.init(e,t),J.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function tw(e,t,n){return new zf({type:"map",keyType:e,valueType:t,...E.normalizeParams(n)})}var Rf=D("ZodSet",(e,t)=>{Ju.init(e,t),J.init(e,t),e.min=(...n)=>e.check(dr(...n)),e.nonempty=n=>e.check(dr(1,n)),e.max=(...n)=>e.check(Or(...n)),e.size=(...n)=>e.check(Zn(...n))});function rw(e,t){return new Rf({type:"set",valueType:e,...E.normalizeParams(t)})}var ro=D("ZodEnum",(e,t)=>{Gu.init(e,t),J.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(o,r)=>{let i={};for(let a of o)if(n.has(a))i[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new ro({...t,checks:[],...E.normalizeParams(r),entries:i})},e.exclude=(o,r)=>{let i={...t.entries};for(let a of o)if(n.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new ro({...t,checks:[],...E.normalizeParams(r),entries:i})}});function Uc(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new ro({type:"enum",entries:n,...E.normalizeParams(t)})}function nw(e,t){return new ro({type:"enum",entries:e,...E.normalizeParams(t)})}var Ff=D("ZodLiteral",(e,t)=>{Wu.init(e,t),J.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function ow(e,t){return new Ff({type:"literal",values:Array.isArray(e)?e:[e],...E.normalizeParams(t)})}var Mf=D("ZodFile",(e,t)=>{Ku.init(e,t),J.init(e,t),e.min=(n,o)=>e.check(dr(n,o)),e.max=(n,o)=>e.check(Or(n,o)),e.mime=(n,o)=>e.check(Wn(Array.isArray(n)?n:[n],o))});function iw(e){return Hl(Mf,e)}var Uf=D("ZodTransform",(e,t)=>{Hu.init(e,t),J.init(e,t),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new qt(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(E.issue(i,n.value,t));else{let a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=e),n.issues.push(E.issue(a))}};let r=t.transform(n.value,n);return r instanceof Promise?r.then(i=>(n.value=i,n)):(n.value=r,n)}});function Zc(e){return new Uf({type:"transform",transform:e})}var Lc=D("ZodOptional",(e,t)=>{Yu.init(e,t),J.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Hi(e){return new Lc({type:"optional",innerType:e})}var Zf=D("ZodNullable",(e,t)=>{Xu.init(e,t),J.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Yi(e){return new Zf({type:"nullable",innerType:e})}function aw(e){return Hi(Yi(e))}var Lf=D("ZodDefault",(e,t)=>{Qu.init(e,t),J.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Bf(e,t){return new Lf({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():E.shallowClone(t)}})}var Vf=D("ZodPrefault",(e,t)=>{el.init(e,t),J.init(e,t),e.unwrap=()=>e._zod.def.innerType});function qf(e,t){return new Vf({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():E.shallowClone(t)}})}var Bc=D("ZodNonOptional",(e,t)=>{tl.init(e,t),J.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Jf(e,t){return new Bc({type:"nonoptional",innerType:e,...E.normalizeParams(t)})}var Gf=D("ZodSuccess",(e,t)=>{rl.init(e,t),J.init(e,t),e.unwrap=()=>e._zod.def.innerType});function sw(e){return new Gf({type:"success",innerType:e})}var Wf=D("ZodCatch",(e,t)=>{nl.init(e,t),J.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Kf(e,t){return new Wf({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var Hf=D("ZodNaN",(e,t)=>{ol.init(e,t),J.init(e,t)});function uw(e){return Bl(Hf,e)}var Vc=D("ZodPipe",(e,t)=>{il.init(e,t),J.init(e,t),e.in=t.in,e.out=t.out});function Xi(e,t){return new Vc({type:"pipe",in:e,out:t})}var qc=D("ZodCodec",(e,t)=>{Vc.init(e,t),Nn.init(e,t)});function lw(e,t,n){return new qc({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}var Yf=D("ZodReadonly",(e,t)=>{al.init(e,t),J.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Xf(e){return new Yf({type:"readonly",innerType:e})}var Qf=D("ZodTemplateLiteral",(e,t)=>{sl.init(e,t),J.init(e,t)});function cw(e,t){return new Qf({type:"template_literal",parts:e,...E.normalizeParams(t)})}var eg=D("ZodLazy",(e,t)=>{cl.init(e,t),J.init(e,t),e.unwrap=()=>e._zod.def.getter()});function tg(e){return new eg({type:"lazy",getter:e})}var rg=D("ZodPromise",(e,t)=>{ll.init(e,t),J.init(e,t),e.unwrap=()=>e._zod.def.innerType});function dw(e){return new rg({type:"promise",innerType:e})}var ng=D("ZodFunction",(e,t)=>{ul.init(e,t),J.init(e,t)});function pw(e){return new ng({type:"function",input:Array.isArray(e?.input)?jf(e?.input):e?.input??ta(Rr()),output:e?.output??Rr()})}var na=D("ZodCustom",(e,t)=>{dl.init(e,t),J.init(e,t)});function mw(e){let t=new se({check:"custom"});return t._zod.check=e,t}function fw(e,t){return Yl(na,e??(()=>!0),t)}function og(e,t={}){return Xl(na,e,t)}function ig(e){return Ql(e)}function gw(e,t={error:`Input not instance of ${e.name}`}){let n=new na({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...E.normalizeParams(t)});return n._zod.bag.Class=e,n}var hw=(...e)=>ec({Codec:qc,Boolean:ao,String:no},...e);function vw(e){let t=tg(()=>Fc([hc(e),bf(),_f(),kf(),ta(t),Nf(hc(),t)]));return t}function yw(e,t){return Xi(Zc(e),t)}var bw={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function _w(e){ce({customError:e})}function xw(){return ce().customError}var Jc;Jc||(Jc={});var Gc={};Bt(Gc,{bigint:()=>$w,boolean:()=>kw,date:()=>Sw,number:()=>ww,string:()=>Dw});function Dw(e){return gl(no,e)}function ww(e){return Dl(io,e)}function kw(e){return Tl(ao,e)}function $w(e){return Al(so,e)}function Sw(e){return Ll(ea,e)}ce(_i());var ag=s;var Xt=ag;var H;(function(e){e.assertEqual=r=>{};function t(r){}e.assertIs=t;function n(r){throw new Error}e.assertNever=n,e.arrayToEnum=r=>{let i={};for(let a of r)i[a]=a;return i},e.getValidEnumValues=r=>{let i=e.objectKeys(r).filter(u=>typeof r[r[u]]!="number"),a={};for(let u of i)a[u]=r[u];return e.objectValues(a)},e.objectValues=r=>e.objectKeys(r).map(function(i){return r[i]}),e.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let i=[];for(let a in r)Object.prototype.hasOwnProperty.call(r,a)&&i.push(a);return i},e.find=(r,i)=>{for(let a of r)if(i(a))return a},e.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function o(r,i=" | "){return r.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}e.joinValues=o,e.jsonStringifyReplacer=(r,i)=>typeof i=="bigint"?i.toString():i})(H||(H={}));var sg;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(sg||(sg={}));var z=H.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),At=e=>{switch(typeof e){case"undefined":return z.undefined;case"string":return z.string;case"number":return Number.isNaN(e)?z.nan:z.number;case"boolean":return z.boolean;case"function":return z.function;case"bigint":return z.bigint;case"symbol":return z.symbol;case"object":return Array.isArray(e)?z.array:e===null?z.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?z.promise:typeof Map<"u"&&e instanceof Map?z.map:typeof Set<"u"&&e instanceof Set?z.set:typeof Date<"u"&&e instanceof Date?z.date:z.object;default:return z.unknown}};var I=H.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);var qe=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){let n=t||function(i){return i.message},o={_errors:[]},r=i=>{for(let a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(r);else if(a.code==="invalid_return_type")r(a.returnTypeError);else if(a.code==="invalid_arguments")r(a.argumentsError);else if(a.path.length===0)o._errors.push(n(a));else{let u=o,l=0;for(;l<a.path.length;){let c=a.path[l];l===a.path.length-1?(u[c]=u[c]||{_errors:[]},u[c]._errors.push(n(a))):u[c]=u[c]||{_errors:[]},u=u[c],l++}}};return r(this),o}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,H.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){let n={},o=[];for(let r of this.issues)if(r.path.length>0){let i=r.path[0];n[i]=n[i]||[],n[i].push(t(r))}else o.push(t(r));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}};qe.create=e=>new qe(e);var Ew=(e,t)=>{let n;switch(e.code){case I.invalid_type:e.received===z.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case I.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,H.jsonStringifyReplacer)}`;break;case I.unrecognized_keys:n=`Unrecognized key(s) in object: ${H.joinValues(e.keys,", ")}`;break;case I.invalid_union:n="Invalid input";break;case I.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${H.joinValues(e.options)}`;break;case I.invalid_enum_value:n=`Invalid enum value. Expected ${H.joinValues(e.options)}, received '${e.received}'`;break;case I.invalid_arguments:n="Invalid function arguments";break;case I.invalid_return_type:n="Invalid function return type";break;case I.invalid_date:n="Invalid date";break;case I.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:H.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case I.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case I.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case I.custom:n="Invalid input";break;case I.invalid_intersection_types:n="Intersection results could not be merged";break;case I.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case I.not_finite:n="Number must be finite";break;default:n=t.defaultError,H.assertNever(e)}return{message:n}},Qt=Ew;var Tw=Qt;function uo(){return Tw}var oa=e=>{let{data:t,path:n,errorMaps:o,issueData:r}=e,i=[...n,...r.path||[]],a={...r,path:i};if(r.message!==void 0)return{...r,path:i,message:r.message};let u="",l=o.filter(c=>!!c).slice().reverse();for(let c of l)u=c(a,{data:t,defaultError:u}).message;return{...r,path:i,message:u}};function j(e,t){let n=uo(),o=oa({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Qt?void 0:Qt].filter(r=>!!r)});e.common.issues.push(o)}var Se=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){let o=[];for(let r of n){if(r.status==="aborted")return B;r.status==="dirty"&&t.dirty(),o.push(r.value)}return{status:t.value,value:o}}static async mergeObjectAsync(t,n){let o=[];for(let r of n){let i=await r.key,a=await r.value;o.push({key:i,value:a})}return e.mergeObjectSync(t,o)}static mergeObjectSync(t,n){let o={};for(let r of n){let{key:i,value:a}=r;if(i.status==="aborted"||a.status==="aborted")return B;i.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof a.value<"u"||r.alwaysSet)&&(o[i.value]=a.value)}return{status:t.value,value:o}}},B=Object.freeze({status:"aborted"}),Mr=e=>({status:"dirty",value:e}),Ae=e=>({status:"valid",value:e}),Wc=e=>e.status==="aborted",Kc=e=>e.status==="dirty",pr=e=>e.status==="valid",lo=e=>typeof Promise<"u"&&e instanceof Promise;var F;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(F||(F={}));var Qe=class{constructor(t,n,o,r){this._cachedPath=[],this.parent=t,this.data=n,this._path=o,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},ug=(e,t)=>{if(pr(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 n=new qe(e.common.issues);return this._error=n,this._error}}};function q(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:o,description:r}=e;if(t&&(n||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:r}:{errorMap:(a,u)=>{let{message:l}=e;return a.code==="invalid_enum_value"?{message:l??u.defaultError}:typeof u.data>"u"?{message:l??o??u.defaultError}:a.code!=="invalid_type"?{message:u.defaultError}:{message:l??n??u.defaultError}},description:r}}var G=class{get description(){return this._def.description}_getType(t){return At(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:At(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Se,ctx:{common:t.parent.common,data:t.data,parsedType:At(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(lo(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let o=this.safeParse(t,n);if(o.success)return o.data;throw o.error}safeParse(t,n){let o={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:At(t)},r=this._parseSync({data:t,path:o.path,parent:o});return ug(o,r)}"~validate"(t){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:At(t)};if(!this["~standard"].async)try{let o=this._parseSync({data:t,path:[],parent:n});return pr(o)?{value:o.value}:{issues:n.common.issues}}catch(o){o?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(o=>pr(o)?{value:o.value}:{issues:n.common.issues})}async parseAsync(t,n){let o=await this.safeParseAsync(t,n);if(o.success)return o.data;throw o.error}async safeParseAsync(t,n){let o={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:At(t)},r=this._parse({data:t,path:o.path,parent:o}),i=await(lo(r)?r:Promise.resolve(r));return ug(o,i)}refine(t,n){let o=r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n;return this._refinement((r,i)=>{let a=t(r),u=()=>i.addIssue({code:I.custom,...o(r)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(u(),!1)):a?!0:(u(),!1)})}refinement(t,n){return this._refinement((o,r)=>t(o)?!0:(r.addIssue(typeof n=="function"?n(o,r):n),!1))}_refinement(t){return new at({schema:this,typeName:C.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:n=>this["~validate"](n)}}optional(){return it.create(this,this._def)}nullable(){return jt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return tr.create(this)}promise(){return mr.create(this,this._def)}or(t){return Vr.create([this,t],this._def)}and(t){return qr.create(this,t,this._def)}transform(t){return new at({...q(this._def),schema:this,typeName:C.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t=="function"?t:()=>t;return new Hr({...q(this._def),innerType:this,defaultValue:n,typeName:C.ZodDefault})}brand(){return new ia({typeName:C.ZodBranded,type:this,...q(this._def)})}catch(t){let n=typeof t=="function"?t:()=>t;return new Yr({...q(this._def),innerType:this,catchValue:n,typeName:C.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return aa.create(this,t)}readonly(){return Xr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Cw=/^c[^\s-]{8,}$/i,Aw=/^[0-9a-z]+$/,Pw=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ow=/^[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,jw=/^[a-z0-9_-]{21}$/i,Nw=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,zw=/^[-+]?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)?)??$/,Rw=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Fw="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Hc,Mw=/^(?:(?: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])$/,Uw=/^(?:(?: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])$/,Zw=/^(([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]))$/,Lw=/^(([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])$/,Bw=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Vw=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,lg="((\\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])))",qw=new RegExp(`^${lg}$`);function cg(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Jw(e){return new RegExp(`^${cg(e)}$`)}function Gw(e){let t=`${lg}T${cg(e)}`,n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function Ww(e,t){return!!((t==="v4"||!t)&&Mw.test(e)||(t==="v6"||!t)&&Zw.test(e))}function Kw(e,t){if(!Nw.test(e))return!1;try{let[n]=e.split(".");if(!n)return!1;let o=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(o));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||t&&r.alg!==t)}catch{return!1}}function Hw(e,t){return!!((t==="v4"||!t)&&Uw.test(e)||(t==="v6"||!t)&&Lw.test(e))}var Zr=class e extends G{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==z.string){let i=this._getOrReturnCtx(t);return j(i,{code:I.invalid_type,expected:z.string,received:i.parsedType}),B}let o=new Se,r;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(r=this._getOrReturnCtx(t,r),j(r,{code:I.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),o.dirty());else if(i.kind==="max")t.data.length>i.value&&(r=this._getOrReturnCtx(t,r),j(r,{code:I.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),o.dirty());else if(i.kind==="length"){let a=t.data.length>i.value,u=t.data.length<i.value;(a||u)&&(r=this._getOrReturnCtx(t,r),a?j(r,{code:I.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):u&&j(r,{code:I.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),o.dirty())}else if(i.kind==="email")Rw.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"email",code:I.invalid_string,message:i.message}),o.dirty());else if(i.kind==="emoji")Hc||(Hc=new RegExp(Fw,"u")),Hc.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"emoji",code:I.invalid_string,message:i.message}),o.dirty());else if(i.kind==="uuid")Ow.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"uuid",code:I.invalid_string,message:i.message}),o.dirty());else if(i.kind==="nanoid")jw.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"nanoid",code:I.invalid_string,message:i.message}),o.dirty());else if(i.kind==="cuid")Cw.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"cuid",code:I.invalid_string,message:i.message}),o.dirty());else if(i.kind==="cuid2")Aw.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"cuid2",code:I.invalid_string,message:i.message}),o.dirty());else if(i.kind==="ulid")Pw.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"ulid",code:I.invalid_string,message:i.message}),o.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),j(r,{validation:"url",code:I.invalid_string,message:i.message}),o.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"regex",code:I.invalid_string,message:i.message}),o.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(r=this._getOrReturnCtx(t,r),j(r,{code:I.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),o.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(r=this._getOrReturnCtx(t,r),j(r,{code:I.invalid_string,validation:{startsWith:i.value},message:i.message}),o.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(r=this._getOrReturnCtx(t,r),j(r,{code:I.invalid_string,validation:{endsWith:i.value},message:i.message}),o.dirty()):i.kind==="datetime"?Gw(i).test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{code:I.invalid_string,validation:"datetime",message:i.message}),o.dirty()):i.kind==="date"?qw.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{code:I.invalid_string,validation:"date",message:i.message}),o.dirty()):i.kind==="time"?Jw(i).test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{code:I.invalid_string,validation:"time",message:i.message}),o.dirty()):i.kind==="duration"?zw.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"duration",code:I.invalid_string,message:i.message}),o.dirty()):i.kind==="ip"?Ww(t.data,i.version)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"ip",code:I.invalid_string,message:i.message}),o.dirty()):i.kind==="jwt"?Kw(t.data,i.alg)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"jwt",code:I.invalid_string,message:i.message}),o.dirty()):i.kind==="cidr"?Hw(t.data,i.version)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"cidr",code:I.invalid_string,message:i.message}),o.dirty()):i.kind==="base64"?Bw.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"base64",code:I.invalid_string,message:i.message}),o.dirty()):i.kind==="base64url"?Vw.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"base64url",code:I.invalid_string,message:i.message}),o.dirty()):H.assertNever(i);return{status:o.value,value:t.data}}_regex(t,n,o){return this.refinement(r=>t.test(r),{validation:n,code:I.invalid_string,...F.errToObj(o)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...F.errToObj(t)})}url(t){return this._addCheck({kind:"url",...F.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...F.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...F.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...F.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...F.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...F.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...F.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...F.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...F.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...F.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...F.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...F.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...F.errToObj(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?.precision>"u"?null:t?.precision,...F.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...F.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...F.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...F.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...F.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...F.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...F.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...F.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...F.errToObj(n)})}nonempty(t){return this.min(1,F.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 n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};Zr.create=e=>new Zr({checks:[],typeName:C.ZodString,coerce:e?.coerce??!1,...q(e)});function Yw(e,t){let n=(e.toString().split(".")[1]||"").length,o=(t.toString().split(".")[1]||"").length,r=n>o?n:o,i=Number.parseInt(e.toFixed(r).replace(".","")),a=Number.parseInt(t.toFixed(r).replace(".",""));return i%a/10**r}var co=class e extends G{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)!==z.number){let i=this._getOrReturnCtx(t);return j(i,{code:I.invalid_type,expected:z.number,received:i.parsedType}),B}let o,r=new Se;for(let i of this._def.checks)i.kind==="int"?H.isInteger(t.data)||(o=this._getOrReturnCtx(t,o),j(o,{code:I.invalid_type,expected:"integer",received:"float",message:i.message}),r.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(o=this._getOrReturnCtx(t,o),j(o,{code:I.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(o=this._getOrReturnCtx(t,o),j(o,{code:I.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="multipleOf"?Yw(t.data,i.value)!==0&&(o=this._getOrReturnCtx(t,o),j(o,{code:I.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(o=this._getOrReturnCtx(t,o),j(o,{code:I.not_finite,message:i.message}),r.dirty()):H.assertNever(i);return{status:r.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,F.toString(n))}gt(t,n){return this.setLimit("min",t,!1,F.toString(n))}lte(t,n){return this.setLimit("max",t,!0,F.toString(n))}lt(t,n){return this.setLimit("max",t,!1,F.toString(n))}setLimit(t,n,o,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:o,message:F.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:F.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:F.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:F.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:F.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:F.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:F.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:F.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:F.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:F.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&H.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(n===null||o.value>n)&&(n=o.value):o.kind==="max"&&(t===null||o.value<t)&&(t=o.value)}return Number.isFinite(n)&&Number.isFinite(t)}};co.create=e=>new co({checks:[],typeName:C.ZodNumber,coerce:e?.coerce||!1,...q(e)});var po=class e extends G{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)!==z.bigint)return this._getInvalidInput(t);let o,r=new Se;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(o=this._getOrReturnCtx(t,o),j(o,{code:I.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(o=this._getOrReturnCtx(t,o),j(o,{code:I.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(o=this._getOrReturnCtx(t,o),j(o,{code:I.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):H.assertNever(i);return{status:r.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return j(n,{code:I.invalid_type,expected:z.bigint,received:n.parsedType}),B}gte(t,n){return this.setLimit("min",t,!0,F.toString(n))}gt(t,n){return this.setLimit("min",t,!1,F.toString(n))}lte(t,n){return this.setLimit("max",t,!0,F.toString(n))}lt(t,n){return this.setLimit("max",t,!1,F.toString(n))}setLimit(t,n,o,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:o,message:F.toString(r)}]})}_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:F.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:F.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:F.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:F.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:F.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};po.create=e=>new po({checks:[],typeName:C.ZodBigInt,coerce:e?.coerce??!1,...q(e)});var mo=class extends G{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==z.boolean){let o=this._getOrReturnCtx(t);return j(o,{code:I.invalid_type,expected:z.boolean,received:o.parsedType}),B}return Ae(t.data)}};mo.create=e=>new mo({typeName:C.ZodBoolean,coerce:e?.coerce||!1,...q(e)});var fo=class e extends G{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==z.date){let i=this._getOrReturnCtx(t);return j(i,{code:I.invalid_type,expected:z.date,received:i.parsedType}),B}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return j(i,{code:I.invalid_date}),B}let o=new Se,r;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(r=this._getOrReturnCtx(t,r),j(r,{code:I.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),o.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(r=this._getOrReturnCtx(t,r),j(r,{code:I.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),o.dirty()):H.assertNever(i);return{status:o.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:F.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:F.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}};fo.create=e=>new fo({checks:[],coerce:e?.coerce||!1,typeName:C.ZodDate,...q(e)});var go=class extends G{_parse(t){if(this._getType(t)!==z.symbol){let o=this._getOrReturnCtx(t);return j(o,{code:I.invalid_type,expected:z.symbol,received:o.parsedType}),B}return Ae(t.data)}};go.create=e=>new go({typeName:C.ZodSymbol,...q(e)});var Lr=class extends G{_parse(t){if(this._getType(t)!==z.undefined){let o=this._getOrReturnCtx(t);return j(o,{code:I.invalid_type,expected:z.undefined,received:o.parsedType}),B}return Ae(t.data)}};Lr.create=e=>new Lr({typeName:C.ZodUndefined,...q(e)});var Br=class extends G{_parse(t){if(this._getType(t)!==z.null){let o=this._getOrReturnCtx(t);return j(o,{code:I.invalid_type,expected:z.null,received:o.parsedType}),B}return Ae(t.data)}};Br.create=e=>new Br({typeName:C.ZodNull,...q(e)});var ho=class extends G{constructor(){super(...arguments),this._any=!0}_parse(t){return Ae(t.data)}};ho.create=e=>new ho({typeName:C.ZodAny,...q(e)});var er=class extends G{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ae(t.data)}};er.create=e=>new er({typeName:C.ZodUnknown,...q(e)});var vt=class extends G{_parse(t){let n=this._getOrReturnCtx(t);return j(n,{code:I.invalid_type,expected:z.never,received:n.parsedType}),B}};vt.create=e=>new vt({typeName:C.ZodNever,...q(e)});var vo=class extends G{_parse(t){if(this._getType(t)!==z.undefined){let o=this._getOrReturnCtx(t);return j(o,{code:I.invalid_type,expected:z.void,received:o.parsedType}),B}return Ae(t.data)}};vo.create=e=>new vo({typeName:C.ZodVoid,...q(e)});var tr=class e extends G{_parse(t){let{ctx:n,status:o}=this._processInputParams(t),r=this._def;if(n.parsedType!==z.array)return j(n,{code:I.invalid_type,expected:z.array,received:n.parsedType}),B;if(r.exactLength!==null){let a=n.data.length>r.exactLength.value,u=n.data.length<r.exactLength.value;(a||u)&&(j(n,{code:a?I.too_big:I.too_small,minimum:u?r.exactLength.value:void 0,maximum:a?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),o.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(j(n,{code:I.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),o.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(j(n,{code:I.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((a,u)=>r.type._parseAsync(new Qe(n,a,n.path,u)))).then(a=>Se.mergeArray(o,a));let i=[...n.data].map((a,u)=>r.type._parseSync(new Qe(n,a,n.path,u)));return Se.mergeArray(o,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:F.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:F.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:F.toString(n)}})}nonempty(t){return this.min(1,t)}};tr.create=(e,t)=>new tr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:C.ZodArray,...q(t)});function Ur(e){if(e instanceof Je){let t={};for(let n in e.shape){let o=e.shape[n];t[n]=it.create(Ur(o))}return new Je({...e._def,shape:()=>t})}else return e instanceof tr?new tr({...e._def,type:Ur(e.element)}):e instanceof it?it.create(Ur(e.unwrap())):e instanceof jt?jt.create(Ur(e.unwrap())):e instanceof Ot?Ot.create(e.items.map(t=>Ur(t))):e}var Je=class e extends G{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(),n=H.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==z.object){let c=this._getOrReturnCtx(t);return j(c,{code:I.invalid_type,expected:z.object,received:c.parsedType}),B}let{status:o,ctx:r}=this._processInputParams(t),{shape:i,keys:a}=this._getCached(),u=[];if(!(this._def.catchall instanceof vt&&this._def.unknownKeys==="strip"))for(let c in r.data)a.includes(c)||u.push(c);let l=[];for(let c of a){let m=i[c],h=r.data[c];l.push({key:{status:"valid",value:c},value:m._parse(new Qe(r,h,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof vt){let c=this._def.unknownKeys;if(c==="passthrough")for(let m of u)l.push({key:{status:"valid",value:m},value:{status:"valid",value:r.data[m]}});else if(c==="strict")u.length>0&&(j(r,{code:I.unrecognized_keys,keys:u}),o.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let m of u){let h=r.data[m];l.push({key:{status:"valid",value:m},value:c._parse(new Qe(r,h,r.path,m)),alwaysSet:m in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let c=[];for(let m of l){let h=await m.key,y=await m.value;c.push({key:h,value:y,alwaysSet:m.alwaysSet})}return c}).then(c=>Se.mergeObjectSync(o,c)):Se.mergeObjectSync(o,l)}get shape(){return this._def.shape()}strict(t){return F.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,o)=>{let r=this._def.errorMap?.(n,o).message??o.defaultError;return n.code==="unrecognized_keys"?{message:F.errToObj(t).message??r}:{message:r}}}:{}})}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:C.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let o of H.objectKeys(t))t[o]&&this.shape[o]&&(n[o]=this.shape[o]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let o of H.objectKeys(this.shape))t[o]||(n[o]=this.shape[o]);return new e({...this._def,shape:()=>n})}deepPartial(){return Ur(this)}partial(t){let n={};for(let o of H.objectKeys(this.shape)){let r=this.shape[o];t&&!t[o]?n[o]=r:n[o]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let o of H.objectKeys(this.shape))if(t&&!t[o])n[o]=this.shape[o];else{let i=this.shape[o];for(;i instanceof it;)i=i._def.innerType;n[o]=i}return new e({...this._def,shape:()=>n})}keyof(){return dg(H.objectKeys(this.shape))}};Je.create=(e,t)=>new Je({shape:()=>e,unknownKeys:"strip",catchall:vt.create(),typeName:C.ZodObject,...q(t)});Je.strictCreate=(e,t)=>new Je({shape:()=>e,unknownKeys:"strict",catchall:vt.create(),typeName:C.ZodObject,...q(t)});Je.lazycreate=(e,t)=>new Je({shape:e,unknownKeys:"strip",catchall:vt.create(),typeName:C.ZodObject,...q(t)});var Vr=class extends G{_parse(t){let{ctx:n}=this._processInputParams(t),o=this._def.options;function r(i){for(let u of i)if(u.result.status==="valid")return u.result;for(let u of i)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;let a=i.map(u=>new qe(u.ctx.common.issues));return j(n,{code:I.invalid_union,unionErrors:a}),B}if(n.common.async)return Promise.all(o.map(async i=>{let a={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(r);{let i,a=[];for(let l of o){let c={...n,common:{...n.common,issues:[]},parent:null},m=l._parseSync({data:n.data,path:n.path,parent:c});if(m.status==="valid")return m;m.status==="dirty"&&!i&&(i={result:m,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;let u=a.map(l=>new qe(l));return j(n,{code:I.invalid_union,unionErrors:u}),B}}get options(){return this._def.options}};Vr.create=(e,t)=>new Vr({options:e,typeName:C.ZodUnion,...q(t)});var Pt=e=>e instanceof Jr?Pt(e.schema):e instanceof at?Pt(e.innerType()):e instanceof Gr?[e.value]:e instanceof Wr?e.options:e instanceof Kr?H.objectValues(e.enum):e instanceof Hr?Pt(e._def.innerType):e instanceof Lr?[void 0]:e instanceof Br?[null]:e instanceof it?[void 0,...Pt(e.unwrap())]:e instanceof jt?[null,...Pt(e.unwrap())]:e instanceof ia||e instanceof Xr?Pt(e.unwrap()):e instanceof Yr?Pt(e._def.innerType):[],Yc=class e extends G{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==z.object)return j(n,{code:I.invalid_type,expected:z.object,received:n.parsedType}),B;let o=this.discriminator,r=n.data[o],i=this.optionsMap.get(r);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(j(n,{code:I.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),B)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,o){let r=new Map;for(let i of n){let a=Pt(i.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let u of a){if(r.has(u))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(u)}`);r.set(u,i)}}return new e({typeName:C.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:r,...q(o)})}};function Xc(e,t){let n=At(e),o=At(t);if(e===t)return{valid:!0,data:e};if(n===z.object&&o===z.object){let r=H.objectKeys(t),i=H.objectKeys(e).filter(u=>r.indexOf(u)!==-1),a={...e,...t};for(let u of i){let l=Xc(e[u],t[u]);if(!l.valid)return{valid:!1};a[u]=l.data}return{valid:!0,data:a}}else if(n===z.array&&o===z.array){if(e.length!==t.length)return{valid:!1};let r=[];for(let i=0;i<e.length;i++){let a=e[i],u=t[i],l=Xc(a,u);if(!l.valid)return{valid:!1};r.push(l.data)}return{valid:!0,data:r}}else return n===z.date&&o===z.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var qr=class extends G{_parse(t){let{status:n,ctx:o}=this._processInputParams(t),r=(i,a)=>{if(Wc(i)||Wc(a))return B;let u=Xc(i.value,a.value);return u.valid?((Kc(i)||Kc(a))&&n.dirty(),{status:n.value,value:u.data}):(j(o,{code:I.invalid_intersection_types}),B)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([i,a])=>r(i,a)):r(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}};qr.create=(e,t,n)=>new qr({left:e,right:t,typeName:C.ZodIntersection,...q(n)});var Ot=class e extends G{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==z.array)return j(o,{code:I.invalid_type,expected:z.array,received:o.parsedType}),B;if(o.data.length<this._def.items.length)return j(o,{code:I.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),B;!this._def.rest&&o.data.length>this._def.items.length&&(j(o,{code:I.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let i=[...o.data].map((a,u)=>{let l=this._def.items[u]||this._def.rest;return l?l._parse(new Qe(o,a,o.path,u)):null}).filter(a=>!!a);return o.common.async?Promise.all(i).then(a=>Se.mergeArray(n,a)):Se.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Ot.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ot({items:e,typeName:C.ZodTuple,rest:null,...q(t)})};var Qc=class e extends G{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==z.object)return j(o,{code:I.invalid_type,expected:z.object,received:o.parsedType}),B;let r=[],i=this._def.keyType,a=this._def.valueType;for(let u in o.data)r.push({key:i._parse(new Qe(o,u,o.path,u)),value:a._parse(new Qe(o,o.data[u],o.path,u)),alwaysSet:u in o.data});return o.common.async?Se.mergeObjectAsync(n,r):Se.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(t,n,o){return n instanceof G?new e({keyType:t,valueType:n,typeName:C.ZodRecord,...q(o)}):new e({keyType:Zr.create(),valueType:t,typeName:C.ZodRecord,...q(n)})}},yo=class extends G{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==z.map)return j(o,{code:I.invalid_type,expected:z.map,received:o.parsedType}),B;let r=this._def.keyType,i=this._def.valueType,a=[...o.data.entries()].map(([u,l],c)=>({key:r._parse(new Qe(o,u,o.path,[c,"key"])),value:i._parse(new Qe(o,l,o.path,[c,"value"]))}));if(o.common.async){let u=new Map;return Promise.resolve().then(async()=>{for(let l of a){let c=await l.key,m=await l.value;if(c.status==="aborted"||m.status==="aborted")return B;(c.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(c.value,m.value)}return{status:n.value,value:u}})}else{let u=new Map;for(let l of a){let c=l.key,m=l.value;if(c.status==="aborted"||m.status==="aborted")return B;(c.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(c.value,m.value)}return{status:n.value,value:u}}}};yo.create=(e,t,n)=>new yo({valueType:t,keyType:e,typeName:C.ZodMap,...q(n)});var bo=class e extends G{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==z.set)return j(o,{code:I.invalid_type,expected:z.set,received:o.parsedType}),B;let r=this._def;r.minSize!==null&&o.data.size<r.minSize.value&&(j(o,{code:I.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&o.data.size>r.maxSize.value&&(j(o,{code:I.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let i=this._def.valueType;function a(l){let c=new Set;for(let m of l){if(m.status==="aborted")return B;m.status==="dirty"&&n.dirty(),c.add(m.value)}return{status:n.value,value:c}}let u=[...o.data.values()].map((l,c)=>i._parse(new Qe(o,l,o.path,c)));return o.common.async?Promise.all(u).then(l=>a(l)):a(u)}min(t,n){return new e({...this._def,minSize:{value:t,message:F.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:F.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};bo.create=(e,t)=>new bo({valueType:e,minSize:null,maxSize:null,typeName:C.ZodSet,...q(t)});var ed=class e extends G{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==z.function)return j(n,{code:I.invalid_type,expected:z.function,received:n.parsedType}),B;function o(u,l){return oa({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,uo(),Qt].filter(c=>!!c),issueData:{code:I.invalid_arguments,argumentsError:l}})}function r(u,l){return oa({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,uo(),Qt].filter(c=>!!c),issueData:{code:I.invalid_return_type,returnTypeError:l}})}let i={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof mr){let u=this;return Ae(async function(...l){let c=new qe([]),m=await u._def.args.parseAsync(l,i).catch(p=>{throw c.addIssue(o(l,p)),c}),h=await Reflect.apply(a,this,m);return await u._def.returns._def.type.parseAsync(h,i).catch(p=>{throw c.addIssue(r(h,p)),c})})}else{let u=this;return Ae(function(...l){let c=u._def.args.safeParse(l,i);if(!c.success)throw new qe([o(l,c.error)]);let m=Reflect.apply(a,this,c.data),h=u._def.returns.safeParse(m,i);if(!h.success)throw new qe([r(m,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Ot.create(t).rest(er.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,n,o){return new e({args:t||Ot.create([]).rest(er.create()),returns:n||er.create(),typeName:C.ZodFunction,...q(o)})}},Jr=class extends G{get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};Jr.create=(e,t)=>new Jr({getter:e,typeName:C.ZodLazy,...q(t)});var Gr=class extends G{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return j(n,{received:n.data,code:I.invalid_literal,expected:this._def.value}),B}return{status:"valid",value:t.data}}get value(){return this._def.value}};Gr.create=(e,t)=>new Gr({value:e,typeName:C.ZodLiteral,...q(t)});function dg(e,t){return new Wr({values:e,typeName:C.ZodEnum,...q(t)})}var Wr=class e extends G{_parse(t){if(typeof t.data!="string"){let n=this._getOrReturnCtx(t),o=this._def.values;return j(n,{expected:H.joinValues(o),received:n.parsedType,code:I.invalid_type}),B}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let n=this._getOrReturnCtx(t),o=this._def.values;return j(n,{received:n.data,code:I.invalid_enum_value,options:o}),B}return Ae(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(o=>!t.includes(o)),{...this._def,...n})}};Wr.create=dg;var Kr=class extends G{_parse(t){let n=H.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(t);if(o.parsedType!==z.string&&o.parsedType!==z.number){let r=H.objectValues(n);return j(o,{expected:H.joinValues(r),received:o.parsedType,code:I.invalid_type}),B}if(this._cache||(this._cache=new Set(H.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let r=H.objectValues(n);return j(o,{received:o.data,code:I.invalid_enum_value,options:r}),B}return Ae(t.data)}get enum(){return this._def.values}};Kr.create=(e,t)=>new Kr({values:e,typeName:C.ZodNativeEnum,...q(t)});var mr=class extends G{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==z.promise&&n.common.async===!1)return j(n,{code:I.invalid_type,expected:z.promise,received:n.parsedType}),B;let o=n.parsedType===z.promise?n.data:Promise.resolve(n.data);return Ae(o.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}};mr.create=(e,t)=>new mr({type:e,typeName:C.ZodPromise,...q(t)});var at=class extends G{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===C.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:o}=this._processInputParams(t),r=this._def.effect||null,i={addIssue:a=>{j(o,a),a.fatal?n.abort():n.dirty()},get path(){return o.path}};if(i.addIssue=i.addIssue.bind(i),r.type==="preprocess"){let a=r.transform(o.data,i);if(o.common.async)return Promise.resolve(a).then(async u=>{if(n.value==="aborted")return B;let l=await this._def.schema._parseAsync({data:u,path:o.path,parent:o});return l.status==="aborted"?B:l.status==="dirty"?Mr(l.value):n.value==="dirty"?Mr(l.value):l});{if(n.value==="aborted")return B;let u=this._def.schema._parseSync({data:a,path:o.path,parent:o});return u.status==="aborted"?B:u.status==="dirty"?Mr(u.value):n.value==="dirty"?Mr(u.value):u}}if(r.type==="refinement"){let a=u=>{let l=r.refinement(u,i);if(o.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(o.common.async===!1){let u=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return u.status==="aborted"?B:(u.status==="dirty"&&n.dirty(),a(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(u=>u.status==="aborted"?B:(u.status==="dirty"&&n.dirty(),a(u.value).then(()=>({status:n.value,value:u.value}))))}if(r.type==="transform")if(o.common.async===!1){let a=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!pr(a))return B;let u=r.transform(a.value,i);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(a=>pr(a)?Promise.resolve(r.transform(a.value,i)).then(u=>({status:n.value,value:u})):B);H.assertNever(r)}};at.create=(e,t,n)=>new at({schema:e,typeName:C.ZodEffects,effect:t,...q(n)});at.createWithPreprocess=(e,t,n)=>new at({schema:t,effect:{type:"preprocess",transform:e},typeName:C.ZodEffects,...q(n)});var it=class extends G{_parse(t){return this._getType(t)===z.undefined?Ae(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};it.create=(e,t)=>new it({innerType:e,typeName:C.ZodOptional,...q(t)});var jt=class extends G{_parse(t){return this._getType(t)===z.null?Ae(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};jt.create=(e,t)=>new jt({innerType:e,typeName:C.ZodNullable,...q(t)});var Hr=class extends G{_parse(t){let{ctx:n}=this._processInputParams(t),o=n.data;return n.parsedType===z.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Hr.create=(e,t)=>new Hr({innerType:e,typeName:C.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...q(t)});var Yr=class extends G{_parse(t){let{ctx:n}=this._processInputParams(t),o={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return lo(r)?r.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new qe(o.common.issues)},input:o.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new qe(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}};Yr.create=(e,t)=>new Yr({innerType:e,typeName:C.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...q(t)});var _o=class extends G{_parse(t){if(this._getType(t)!==z.nan){let o=this._getOrReturnCtx(t);return j(o,{code:I.invalid_type,expected:z.nan,received:o.parsedType}),B}return{status:"valid",value:t.data}}};_o.create=e=>new _o({typeName:C.ZodNaN,...q(e)});var zP=Symbol("zod_brand"),ia=class extends G{_parse(t){let{ctx:n}=this._processInputParams(t),o=n.data;return this._def.type._parse({data:o,path:n.path,parent:n})}unwrap(){return this._def.type}},aa=class e extends G{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?B:i.status==="dirty"?(n.dirty(),Mr(i.value)):this._def.out._parseAsync({data:i.value,path:o.path,parent:o})})();{let r=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return r.status==="aborted"?B:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:o.path,parent:o})}}static create(t,n){return new e({in:t,out:n,typeName:C.ZodPipeline})}},Xr=class extends G{_parse(t){let n=this._def.innerType._parse(t),o=r=>(pr(r)&&(r.value=Object.freeze(r.value)),r);return lo(n)?n.then(r=>o(r)):o(n)}unwrap(){return this._def.innerType}};Xr.create=(e,t)=>new Xr({innerType:e,typeName:C.ZodReadonly,...q(t)});var RP={object:Je.lazycreate},C;(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"})(C||(C={}));var FP=Zr.create,MP=co.create,UP=_o.create,ZP=po.create,LP=mo.create,BP=fo.create,VP=go.create,qP=Lr.create,JP=Br.create,GP=ho.create,WP=er.create,KP=vt.create,HP=vo.create,YP=tr.create,XP=Je.create,QP=Je.strictCreate,eO=Vr.create,tO=Yc.create,rO=qr.create,nO=Ot.create,oO=Qc.create,iO=yo.create,aO=bo.create,sO=ed.create,uO=Jr.create,lO=Gr.create,cO=Wr.create,dO=Kr.create,pO=mr.create,mO=at.create,fO=it.create,gO=jt.create,hO=at.createWithPreprocess,vO=aa.create;function we(...e){return e.reduce((t,n)=>({...t,...n??{}}),{})}async function gg(e,t){if(e==null)return Promise.resolve();let n=t?.abortSignal;return new Promise((o,r)=>{if(n?.aborted){r(pg());return}let i=setTimeout(()=>{a(),o()},e),a=()=>{clearTimeout(i),n?.removeEventListener("abort",u)},u=()=>{a(),r(pg())};n?.addEventListener("abort",u)})}function pg(){return new DOMException("Delay was aborted","AbortError")}function xo(e){return Object.fromEntries([...e.headers])}function hg(e=globalThis){var t,n,o;return e.window?"runtime/browser":(t=e.navigator)!=null&&t.userAgent?`runtime/${e.navigator.userAgent.toLowerCase()}`:(o=(n=e.process)==null?void 0:n.versions)!=null&&o.node?`runtime/node.js/${e.process.version.substring(0)}`:e.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function Qw(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>n!=null))}function Qr(e,...t){let n=Qw(e??{}),o=new Headers(n),r=o.get("user-agent")||"";return o.set("user-agent",[r,...t].filter(Boolean).join(" ")),Object.fromEntries(o)}var zt=({prefix:e,size:t=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:o="-"}={})=>{let r=()=>{let i=n.length,a=new Array(t);for(let u=0;u<t;u++)a[u]=n[Math.random()*i|0];return a.join("")};if(e==null)return r;if(n.includes(o))throw new Jo({argument:"separator",message:`The separator "${o}" must not be part of the alphabet "${n}".`});return()=>`${e}${o}${r()}`},lt=zt();function Do(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}function Nt(e){return(e instanceof Error||e instanceof DOMException)&&(e.name==="AbortError"||e.name==="ResponseAborted"||e.name==="TimeoutError")}var e0=["fetch failed","failed to fetch"];function vg({error:e,url:t,requestBodyValues:n}){if(Nt(e))return e;if(e instanceof TypeError&&e0.includes(e.message.toLowerCase())){let o=e.cause;if(o!=null)return new le({message:`Cannot connect to API: ${o.message}`,cause:o,url:t,requestBodyValues:n,isRetryable:!0})}return e}var yg="3.0.9",t0=()=>globalThis.fetch,bg=async({url:e,headers:t={},successfulResponseHandler:n,failedResponseHandler:o,abortSignal:r,fetch:i=t0()})=>{try{let a=await i(e,{method:"GET",headers:Qr(t,`ai-sdk/provider-utils/${yg}`,hg()),signal:r}),u=xo(a);if(!a.ok){let l;try{l=await o({response:a,url:e,requestBodyValues:{}})}catch(c){throw Nt(c)||le.isInstance(c)?c:new le({message:"Failed to process error response",cause:c,statusCode:a.status,url:e,responseHeaders:u,requestBodyValues:{}})}throw l.value}try{return await n({response:a,url:e,requestBodyValues:{}})}catch(l){throw l instanceof Error&&(Nt(l)||le.isInstance(l))?l:new le({message:"Failed to process successful response",cause:l,statusCode:a.status,url:e,responseHeaders:u,requestBodyValues:{}})}}catch(a){throw vg({error:a,url:e,requestBodyValues:{}})}};function _g({mediaType:e,url:t,supportedUrls:n}){return t=t.toLowerCase(),e=e.toLowerCase(),Object.entries(n).map(([o,r])=>{let i=o.toLowerCase();return i==="*"||i==="*/*"?{mediaTypePrefix:"",regexes:r}:{mediaTypePrefix:i.replace(/\*/,""),regexes:r}}).filter(({mediaTypePrefix:o})=>e.startsWith(o)).flatMap(({regexes:o})=>o).some(o=>o.test(t))}function xg({apiKey:e,environmentVariableName:t,apiKeyParameterName:n="apiKey",description:o}){if(typeof e=="string")return e;if(e!=null)throw new bn({message:`${o} API key must be a string.`});if(typeof process>"u")throw new bn({message:`${o} API key is missing. Pass it using the '${n}' parameter. Environment variables is not supported in this environment.`});if(e=process.env[t],e==null)throw new bn({message:`${o} API key is missing. Pass it using the '${n}' parameter or the ${t} environment variable.`});if(typeof e!="string")throw new bn({message:`${o} API key must be a string. The value of the ${t} environment variable is not a string.`});return e}function wo({settingValue:e,environmentVariableName:t}){if(typeof e=="string")return e;if(!(e!=null||typeof process>"u")&&(e=process.env[t],!(e==null||typeof e!="string")))return e}var r0=/"__proto__"\s*:/,n0=/"constructor"\s*:/;function o0(e){let t=JSON.parse(e);return t===null||typeof t!="object"||r0.test(e)===!1&&n0.test(e)===!1?t:i0(t)}function i0(e){let t=[e];for(;t.length;){let n=t;t=[];for(let o of n){if(Object.prototype.hasOwnProperty.call(o,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(o,"constructor")&&Object.prototype.hasOwnProperty.call(o.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(let r in o){let i=o[r];i&&typeof i=="object"&&t.push(i)}}}return e}function id(e){let{stackTraceLimit:t}=Error;Error.stackTraceLimit=0;try{return o0(e)}finally{Error.stackTraceLimit=t}}var sa=Symbol.for("vercel.ai.validator");function a0(e){return{[sa]:!0,validate:e}}function s0(e){return typeof e=="object"&&e!==null&&sa in e&&e[sa]===!0&&"validate"in e}function u0(e){return s0(e)?e:l0(e)}function l0(e){return a0(async t=>{let n=await e["~standard"].validate(t);return n.issues==null?{success:!0,value:n.value}:{success:!1,error:new Vt({value:t,cause:n.issues})}})}async function ua({value:e,schema:t}){let n=await Rt({value:e,schema:t});if(!n.success)throw Vt.wrap({value:e,cause:n.error});return n.value}async function Rt({value:e,schema:t}){let n=u0(t);try{if(n.validate==null)return{success:!0,value:e,rawValue:e};let o=await n.validate(e);return o.success?{success:!0,value:o.value,rawValue:e}:{success:!1,error:Vt.wrap({value:e,cause:o.error}),rawValue:e}}catch(o){return{success:!1,error:Vt.wrap({value:e,cause:o}),rawValue:e}}}async function c0({text:e,schema:t}){try{let n=id(e);return t==null?n:ua({value:n,schema:t})}catch(n){throw yn.isInstance(n)||Vt.isInstance(n)?n:new yn({text:e,cause:n})}}async function yt({text:e,schema:t}){try{let n=id(e);return t==null?{success:!0,value:n,rawValue:n}:await Rt({value:n,schema:t})}catch(n){return{success:!1,error:yn.isInstance(n)?n:new yn({text:e,cause:n}),rawValue:void 0}}}function ad(e){try{return id(e),!0}catch{return!1}}function d0({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new Wo).pipeThrough(new TransformStream({async transform({data:n},o){n!=="[DONE]"&&o.enqueue(await yt({text:n,schema:t}))}}))}async function Me({provider:e,providerOptions:t,schema:n}){if(t?.[e]==null)return;let o=await Rt({value:t[e],schema:n});if(!o.success)throw new Jo({argument:"providerOptions",message:`invalid ${e} provider options`,cause:o.error});return o.value}var p0=()=>globalThis.fetch,be=async({url:e,headers:t,body:n,failedResponseHandler:o,successfulResponseHandler:r,abortSignal:i,fetch:a})=>m0({url:e,headers:{"Content-Type":"application/json",...t},body:{content:JSON.stringify(n),values:n},failedResponseHandler:o,successfulResponseHandler:r,abortSignal:i,fetch:a});var m0=async({url:e,headers:t={},body:n,successfulResponseHandler:o,failedResponseHandler:r,abortSignal:i,fetch:a=p0()})=>{try{let u=await a(e,{method:"POST",headers:Qr(t,`ai-sdk/provider-utils/${yg}`,hg()),body:n.content,signal:i}),l=xo(u);if(!u.ok){let c;try{c=await r({response:u,url:e,requestBodyValues:n.values})}catch(m){throw Nt(m)||le.isInstance(m)?m:new le({message:"Failed to process error response",cause:m,statusCode:u.status,url:e,responseHeaders:l,requestBodyValues:n.values})}throw c.value}try{return await o({response:u,url:e,requestBodyValues:n.values})}catch(c){throw c instanceof Error&&(Nt(c)||le.isInstance(c))?c:new le({message:"Failed to process successful response",cause:c,statusCode:u.status,url:e,responseHeaders:l,requestBodyValues:n.values})}}catch(u){throw vg({error:u,url:e,requestBodyValues:n.values})}};function Ue({id:e,name:t,inputSchema:n}){return({execute:o,outputSchema:r,toModelOutput:i,onInputStart:a,onInputDelta:u,onInputAvailable:l,...c})=>({type:"provider-defined",id:e,name:t,args:c,inputSchema:n,outputSchema:r,execute:o,toModelOutput:i,onInputStart:a,onInputDelta:u,onInputAvailable:l})}function la({id:e,name:t,inputSchema:n,outputSchema:o}){return({execute:r,toModelOutput:i,onInputStart:a,onInputDelta:u,onInputAvailable:l,...c})=>({type:"provider-defined",id:e,name:t,args:c,inputSchema:n,outputSchema:o,execute:r,toModelOutput:i,onInputStart:a,onInputDelta:u,onInputAvailable:l})}async function et(e){return typeof e=="function"&&(e=e()),Promise.resolve(e)}var ke=({errorSchema:e,errorToMessage:t,isRetryable:n})=>async({response:o,url:r,requestBodyValues:i})=>{let a=await o.text(),u=xo(o);if(a.trim()==="")return{responseHeaders:u,value:new le({message:o.statusText,url:r,requestBodyValues:i,statusCode:o.status,responseHeaders:u,responseBody:a,isRetryable:n?.(o)})};try{let l=await c0({text:a,schema:e});return{responseHeaders:u,value:new le({message:t(l),url:r,requestBodyValues:i,statusCode:o.status,responseHeaders:u,responseBody:a,data:l,isRetryable:n?.(o,l)})}}catch{return{responseHeaders:u,value:new le({message:o.statusText,url:r,requestBodyValues:i,statusCode:o.status,responseHeaders:u,responseBody:a,isRetryable:n?.(o)})}}},rr=e=>async({response:t})=>{let n=xo(t);if(t.body==null)throw new _p({});return{responseHeaders:n,value:d0({stream:t.body,schema:e})}};var Ie=e=>async({response:t,url:n,requestBodyValues:o})=>{let r=await t.text(),i=await yt({text:r,schema:e}),a=xo(t);if(!i.success)throw new le({message:"Invalid JSON response",cause:i.error,statusCode:t.status,responseHeaders:a,responseBody:r,url:n,requestBodyValues:o});return{responseHeaders:a,value:i.value,rawValue:i.rawValue}};var f0=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join("/")},g0=Symbol("Let zodToJsonSchema decide on which parser to use"),mg={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},h0=e=>typeof e=="string"?{...mg,name:e}:{...mg,...e};function Ge(){return{}}function v0(e,t){var n,o,r;let i={type:"array"};return(n=e.type)!=null&&n._def&&((r=(o=e.type)==null?void 0:o._def)==null?void 0:r.typeName)!==C.ZodAny&&(i.items=ee(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&(i.minItems=e.minLength.value),e.maxLength&&(i.maxItems=e.maxLength.value),e.exactLength&&(i.minItems=e.exactLength.value,i.maxItems=e.exactLength.value),i}function y0(e){let t={type:"integer",format:"int64"};if(!e.checks)return t;for(let n of e.checks)switch(n.kind){case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value;break}return t}function b0(){return{type:"boolean"}}function Dg(e,t){return ee(e.type._def,t)}var _0=(e,t)=>ee(e.innerType._def,t);function wg(e,t,n){let o=n??t.dateStrategy;if(Array.isArray(o))return{anyOf:o.map((r,i)=>wg(e,t,r))};switch(o){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return x0(e)}}var x0=e=>{let t={type:"integer",format:"unix-time"};for(let n of e.checks)switch(n.kind){case"min":t.minimum=n.value;break;case"max":t.maximum=n.value;break}return t};function D0(e,t){return{...ee(e.innerType._def,t),default:e.defaultValue()}}function w0(e,t){return t.effectStrategy==="input"?ee(e.schema._def,t):Ge()}function k0(e){return{type:"string",enum:Array.from(e.values)}}var $0=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function S0(e,t){let n=[ee(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),ee(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(r=>!!r),o=[];return n.forEach(r=>{if($0(r))o.push(...r.allOf);else{let i=r;if("additionalProperties"in r&&r.additionalProperties===!1){let{additionalProperties:a,...u}=r;i=u}o.push(i)}}),o.length?{allOf:o}:void 0}function I0(e){let t=typeof e.value;return t!=="bigint"&&t!=="number"&&t!=="boolean"&&t!=="string"?{type:Array.isArray(e.value)?"array":"object"}:{type:t==="bigint"?"integer":t,const:e.value}}var td=void 0,st={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(td===void 0&&(td=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),td),uuid:/^[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}$/,ipv4:/^(?:(?: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])$/,ipv4Cidr:/^(?:(?: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])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([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])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function kg(e,t){let n={type:"string"};if(e.checks)for(let o of e.checks)switch(o.kind){case"min":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,o.value):o.value;break;case"max":n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,o.value):o.value;break;case"email":switch(t.emailStrategy){case"format:email":ut(n,"email",o.message,t);break;case"format:idn-email":ut(n,"idn-email",o.message,t);break;case"pattern:zod":Pe(n,st.email,o.message,t);break}break;case"url":ut(n,"uri",o.message,t);break;case"uuid":ut(n,"uuid",o.message,t);break;case"regex":Pe(n,o.regex,o.message,t);break;case"cuid":Pe(n,st.cuid,o.message,t);break;case"cuid2":Pe(n,st.cuid2,o.message,t);break;case"startsWith":Pe(n,RegExp(`^${rd(o.value,t)}`),o.message,t);break;case"endsWith":Pe(n,RegExp(`${rd(o.value,t)}$`),o.message,t);break;case"datetime":ut(n,"date-time",o.message,t);break;case"date":ut(n,"date",o.message,t);break;case"time":ut(n,"time",o.message,t);break;case"duration":ut(n,"duration",o.message,t);break;case"length":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,o.value):o.value,n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,o.value):o.value;break;case"includes":{Pe(n,RegExp(rd(o.value,t)),o.message,t);break}case"ip":{o.version!=="v6"&&ut(n,"ipv4",o.message,t),o.version!=="v4"&&ut(n,"ipv6",o.message,t);break}case"base64url":Pe(n,st.base64url,o.message,t);break;case"jwt":Pe(n,st.jwt,o.message,t);break;case"cidr":{o.version!=="v6"&&Pe(n,st.ipv4Cidr,o.message,t),o.version!=="v4"&&Pe(n,st.ipv6Cidr,o.message,t);break}case"emoji":Pe(n,st.emoji(),o.message,t);break;case"ulid":{Pe(n,st.ulid,o.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{ut(n,"binary",o.message,t);break}case"contentEncoding:base64":{n.contentEncoding="base64";break}case"pattern:zod":{Pe(n,st.base64,o.message,t);break}}break}case"nanoid":Pe(n,st.nanoid,o.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return n}function rd(e,t){return t.patternStrategy==="escape"?T0(e):e}var E0=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function T0(e){let t="";for(let n=0;n<e.length;n++)E0.has(e[n])||(t+="\\"),t+=e[n];return t}function ut(e,t,n,o){var r;e.format||(r=e.anyOf)!=null&&r.some(i=>i.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...n&&o.errorMessages&&{errorMessage:{format:n}}})):e.format=t}function Pe(e,t,n,o){var r;e.pattern||(r=e.allOf)!=null&&r.some(i=>i.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:fg(t,o),...n&&o.errorMessages&&{errorMessage:{pattern:n}}})):e.pattern=fg(t,o)}function fg(e,t){var n;if(!t.applyRegexFlags||!e.flags)return e.source;let o={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},r=o.i?e.source.toLowerCase():e.source,i="",a=!1,u=!1,l=!1;for(let c=0;c<r.length;c++){if(a){i+=r[c],a=!1;continue}if(o.i){if(u){if(r[c].match(/[a-z]/)){l?(i+=r[c],i+=`${r[c-2]}-${r[c]}`.toUpperCase(),l=!1):r[c+1]==="-"&&((n=r[c+2])!=null&&n.match(/[a-z]/))?(i+=r[c],l=!0):i+=`${r[c]}${r[c].toUpperCase()}`;continue}}else if(r[c].match(/[a-z]/)){i+=`[${r[c]}${r[c].toUpperCase()}]`;continue}}if(o.m){if(r[c]==="^"){i+=`(^|(?<=[\r
|
|
36
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let m of this.seen.entries()){let h=m[1];if(t===m[0]){a(m);continue}if(o.external){let p=o.external.registry.get(m[0])?.id;if(t!==m[0]&&p){a(m);continue}}if(this.metadataRegistry.get(m[0])?.id){a(m);continue}if(h.cycle){a(m);continue}if(h.count>1&&o.reused==="ref"){a(m);continue}}let u=(m,h)=>{let y=this.seen.get(m),p=y.def??y.schema,d={...p};if(y.ref===null)return;let f=y.ref;if(y.ref=null,f){u(f,h);let v=this.seen.get(f).schema;v.$ref&&(h.target==="draft-7"||h.target==="draft-4"||h.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(v)):(Object.assign(p,v),Object.assign(p,d))}y.isParent||this.override({zodSchema:m,jsonSchema:p,path:y.path??[]})};for(let m of[...this.seen.entries()].reverse())u(m[0],{target:this.target});let l={};if(this.target==="draft-2020-12"?l.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?l.$schema="http://json-schema.org/draft-07/schema#":this.target==="draft-4"?l.$schema="http://json-schema.org/draft-04/schema#":this.target==="openapi-3.0"||console.warn(`Invalid target: ${this.target}`),o.external?.uri){let m=o.external.registry.get(t)?.id;if(!m)throw new Error("Schema is missing an `id` property");l.$id=o.external.uri(m)}Object.assign(l,r.def);let c=o.external?.defs??{};for(let m of this.seen.entries()){let h=m[1];h.def&&h.defId&&(c[h.defId]=h.def)}o.external||Object.keys(c).length>0&&(this.target==="draft-2020-12"?l.$defs=c:l.definitions=c);try{return JSON.parse(JSON.stringify(l))}catch{throw new Error("Error converting schema to JSON.")}}};function eo(e,t){if(e instanceof Pr){let o=new Qn(t),r={};for(let u of e._idmap.entries()){let[l,c]=u;o.process(c)}let i={},a={registry:e,uri:t?.uri,defs:r};for(let u of e._idmap.entries()){let[l,c]=u;i[l]=o.emit(c,{...t,external:a})}if(Object.keys(r).length>0){let u=o.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[u]:r}}return{schemas:i}}let n=new Qn(t);return n.process(e),n.emit(e,t)}function he(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;switch(r.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return he(r.element,n);case"object":{for(let i in r.shape)if(he(r.shape[i],n))return!0;return!1}case"union":{for(let i of r.options)if(he(i,n))return!0;return!1}case"intersection":return he(r.left,n)||he(r.right,n);case"tuple":{for(let i of r.items)if(he(i,n))return!0;return!!(r.rest&&he(r.rest,n))}case"record":return he(r.keyType,n)||he(r.valueType,n);case"map":return he(r.keyType,n)||he(r.valueType,n);case"set":return he(r.valueType,n);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return he(r.innerType,n);case"lazy":return he(r.getter(),n);case"default":return he(r.innerType,n);case"prefault":return he(r.innerType,n);case"custom":return!1;case"transform":return!0;case"pipe":return he(r.in,n)||he(r.out,n);case"success":return!1;case"catch":return!1;case"function":return!1;default:}throw new Error(`Unknown schema type: ${r.type}`)}var hf={};var Wi={};Bt(Wi,{ZodISODate:()=>Vi,ZodISODateTime:()=>qi,ZodISODuration:()=>Gi,ZodISOTime:()=>Ji,date:()=>rc,datetime:()=>tc,duration:()=>oc,time:()=>nc});var qi=D("ZodISODateTime",(e,t)=>{hu.init(e,t),ae.init(e,t)});function tc(e){return vl(qi,e)}var Vi=D("ZodISODate",(e,t)=>{vu.init(e,t),ae.init(e,t)});function rc(e){return yl(Vi,e)}var Ji=D("ZodISOTime",(e,t)=>{yu.init(e,t),ae.init(e,t)});function nc(e){return bl(Ji,e)}var Gi=D("ZodISODuration",(e,t)=>{bu.init(e,t),ae.init(e,t)});function oc(e){return _l(Gi,e)}var yf=(e,t)=>{En.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>Cn(e,n)},flatten:{value:n=>Tn(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,kr,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,kr,2)}},isEmpty:{get(){return e.issues.length===0}}})},uD=D("ZodError",yf),Fe=D("ZodError",yf,{Parent:Error});var ic=Ir(Fe),ac=Er(Fe),sc=Tr(Fe),to=Cr(Fe),uc=ei(Fe),lc=ti(Fe),cc=ri(Fe),dc=ni(Fe),pc=oi(Fe),mc=ii(Fe),fc=ai(Fe),gc=si(Fe);var J=D("ZodType",(e,t)=>(q.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),e.clone=(n,o)=>Ce(e,n,o),e.brand=()=>e,e.register=((n,o)=>(n.add(e,o),e)),e.parse=(n,o)=>ic(e,n,o,{callee:e.parse}),e.safeParse=(n,o)=>sc(e,n,o),e.parseAsync=async(n,o)=>ac(e,n,o,{callee:e.parseAsync}),e.safeParseAsync=async(n,o)=>to(e,n,o),e.spa=e.safeParseAsync,e.encode=(n,o)=>uc(e,n,o),e.decode=(n,o)=>lc(e,n,o),e.encodeAsync=async(n,o)=>cc(e,n,o),e.decodeAsync=async(n,o)=>dc(e,n,o),e.safeEncode=(n,o)=>pc(e,n,o),e.safeDecode=(n,o)=>mc(e,n,o),e.safeEncodeAsync=async(n,o)=>fc(e,n,o),e.safeDecodeAsync=async(n,o)=>gc(e,n,o),e.refine=(n,o)=>e.check(og(n,o)),e.superRefine=n=>e.check(ig(n)),e.overwrite=n=>e.check(Et(n)),e.optional=()=>Hi(e),e.nullable=()=>Yi(e),e.nullish=()=>Hi(Yi(e)),e.nonoptional=n=>Jf(e,n),e.array=()=>ta(e),e.or=n=>Fc([e,n]),e.and=n=>Pf(e,n),e.transform=n=>Xi(e,Zc(n)),e.default=n=>Bf(e,n),e.prefault=n=>Vf(e,n),e.catch=n=>Kf(e,n),e.pipe=n=>Xi(e,n),e.readonly=()=>Xf(e),e.describe=n=>{let o=e.clone();return ht.add(o,{description:n}),o},Object.defineProperty(e,"description",{get(){return ht.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return ht.get(e);let o=e.clone();return ht.add(o,n[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),yc=D("_ZodString",(e,t)=>{lr.init(e,t),J.init(e,t);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...o)=>e.check(Ln(...o)),e.includes=(...o)=>e.check(Vn(...o)),e.startsWith=(...o)=>e.check(Jn(...o)),e.endsWith=(...o)=>e.check(Gn(...o)),e.min=(...o)=>e.check(Yt(...o)),e.max=(...o)=>e.check(jr(...o)),e.length=(...o)=>e.check(Nr(...o)),e.nonempty=(...o)=>e.check(Yt(1,...o)),e.lowercase=o=>e.check(Bn(o)),e.uppercase=o=>e.check(qn(o)),e.trim=()=>e.check(Hn()),e.normalize=(...o)=>e.check(Kn(...o)),e.toLowerCase=()=>e.check(Yn()),e.toUpperCase=()=>e.check(Xn())}),no=D("ZodString",(e,t)=>{lr.init(e,t),yc.init(e,t),e.email=n=>e.check(ki(bc,n)),e.url=n=>e.check(Un(Qi,n)),e.jwt=n=>e.check(Bi(jc,n)),e.emoji=n=>e.check(Ti(_c,n)),e.guid=n=>e.check(Mn(Ki,n)),e.uuid=n=>e.check($i(Ct,n)),e.uuidv4=n=>e.check(Si(Ct,n)),e.uuidv6=n=>e.check(Ii(Ct,n)),e.uuidv7=n=>e.check(Ei(Ct,n)),e.nanoid=n=>e.check(Ci(xc,n)),e.guid=n=>e.check(Mn(Ki,n)),e.cuid=n=>e.check(Ai(Dc,n)),e.cuid2=n=>e.check(Pi(wc,n)),e.ulid=n=>e.check(Oi(kc,n)),e.base64=n=>e.check(Ui(Ac,n)),e.base64url=n=>e.check(Zi(Pc,n)),e.xid=n=>e.check(ji($c,n)),e.ksuid=n=>e.check(Ni(Sc,n)),e.ipv4=n=>e.check(zi(Ic,n)),e.ipv6=n=>e.check(Ri(Ec,n)),e.cidrv4=n=>e.check(Fi(Tc,n)),e.cidrv6=n=>e.check(Mi(Cc,n)),e.e164=n=>e.check(Li(Oc,n)),e.datetime=n=>e.check(tc(n)),e.date=n=>e.check(rc(n)),e.time=n=>e.check(nc(n)),e.duration=n=>e.check(oc(n))});function hc(e){return fl(no,e)}var ae=D("ZodStringFormat",(e,t)=>{oe.init(e,t),yc.init(e,t)}),bc=D("ZodEmail",(e,t)=>{su.init(e,t),ae.init(e,t)});function cD(e){return ki(bc,e)}var Ki=D("ZodGUID",(e,t)=>{iu.init(e,t),ae.init(e,t)});function dD(e){return Mn(Ki,e)}var Ct=D("ZodUUID",(e,t)=>{au.init(e,t),ae.init(e,t)});function pD(e){return $i(Ct,e)}function mD(e){return Si(Ct,e)}function fD(e){return Ii(Ct,e)}function gD(e){return Ei(Ct,e)}var Qi=D("ZodURL",(e,t)=>{uu.init(e,t),ae.init(e,t)});function hD(e){return Un(Qi,e)}function vD(e){return Un(Qi,{protocol:/^https?$/,hostname:Ye.domain,...E.normalizeParams(e)})}var _c=D("ZodEmoji",(e,t)=>{lu.init(e,t),ae.init(e,t)});function yD(e){return Ti(_c,e)}var xc=D("ZodNanoID",(e,t)=>{cu.init(e,t),ae.init(e,t)});function bD(e){return Ci(xc,e)}var Dc=D("ZodCUID",(e,t)=>{du.init(e,t),ae.init(e,t)});function _D(e){return Ai(Dc,e)}var wc=D("ZodCUID2",(e,t)=>{pu.init(e,t),ae.init(e,t)});function xD(e){return Pi(wc,e)}var kc=D("ZodULID",(e,t)=>{mu.init(e,t),ae.init(e,t)});function DD(e){return Oi(kc,e)}var $c=D("ZodXID",(e,t)=>{fu.init(e,t),ae.init(e,t)});function wD(e){return ji($c,e)}var Sc=D("ZodKSUID",(e,t)=>{gu.init(e,t),ae.init(e,t)});function kD(e){return Ni(Sc,e)}var Ic=D("ZodIPv4",(e,t)=>{_u.init(e,t),ae.init(e,t)});function $D(e){return zi(Ic,e)}var Ec=D("ZodIPv6",(e,t)=>{xu.init(e,t),ae.init(e,t)});function SD(e){return Ri(Ec,e)}var Tc=D("ZodCIDRv4",(e,t)=>{Du.init(e,t),ae.init(e,t)});function ID(e){return Fi(Tc,e)}var Cc=D("ZodCIDRv6",(e,t)=>{wu.init(e,t),ae.init(e,t)});function ED(e){return Mi(Cc,e)}var Ac=D("ZodBase64",(e,t)=>{$u.init(e,t),ae.init(e,t)});function TD(e){return Ui(Ac,e)}var Pc=D("ZodBase64URL",(e,t)=>{Su.init(e,t),ae.init(e,t)});function CD(e){return Zi(Pc,e)}var Oc=D("ZodE164",(e,t)=>{Iu.init(e,t),ae.init(e,t)});function AD(e){return Li(Oc,e)}var jc=D("ZodJWT",(e,t)=>{Eu.init(e,t),ae.init(e,t)});function PD(e){return Bi(jc,e)}var oo=D("ZodCustomStringFormat",(e,t)=>{Tu.init(e,t),ae.init(e,t)});function OD(e,t,n={}){return zr(oo,e,t,n)}function jD(e){return zr(oo,"hostname",Ye.hostname,e)}function ND(e){return zr(oo,"hex",Ye.hex,e)}function zD(e,t){let n=t?.enc??"hex",o=`${e}_${n}`,r=Ye[o];if(!r)throw new Error(`Unrecognized hash format: ${o}`);return zr(oo,o,r,t)}var io=D("ZodNumber",(e,t)=>{hi.init(e,t),J.init(e,t),e.gt=(o,r)=>e.check(It(o,r)),e.gte=(o,r)=>e.check(Re(o,r)),e.min=(o,r)=>e.check(Re(o,r)),e.lt=(o,r)=>e.check(St(o,r)),e.lte=(o,r)=>e.check(Xe(o,r)),e.max=(o,r)=>e.check(Xe(o,r)),e.int=o=>e.check(vc(o)),e.safe=o=>e.check(vc(o)),e.positive=o=>e.check(It(0,o)),e.nonnegative=o=>e.check(Re(0,o)),e.negative=o=>e.check(St(0,o)),e.nonpositive=o=>e.check(Xe(0,o)),e.multipleOf=(o,r)=>e.check(cr(o,r)),e.step=(o,r)=>e.check(cr(o,r)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function bf(e){return xl(io,e)}var Fr=D("ZodNumberFormat",(e,t)=>{Cu.init(e,t),io.init(e,t)});function vc(e){return wl(Fr,e)}function RD(e){return kl(Fr,e)}function FD(e){return $l(Fr,e)}function MD(e){return Sl(Fr,e)}function UD(e){return Il(Fr,e)}var ao=D("ZodBoolean",(e,t)=>{jn.init(e,t),J.init(e,t)});function _f(e){return El(ao,e)}var so=D("ZodBigInt",(e,t)=>{vi.init(e,t),J.init(e,t),e.gte=(o,r)=>e.check(Re(o,r)),e.min=(o,r)=>e.check(Re(o,r)),e.gt=(o,r)=>e.check(It(o,r)),e.gte=(o,r)=>e.check(Re(o,r)),e.min=(o,r)=>e.check(Re(o,r)),e.lt=(o,r)=>e.check(St(o,r)),e.lte=(o,r)=>e.check(Xe(o,r)),e.max=(o,r)=>e.check(Xe(o,r)),e.positive=o=>e.check(It(BigInt(0),o)),e.negative=o=>e.check(St(BigInt(0),o)),e.nonpositive=o=>e.check(Xe(BigInt(0),o)),e.nonnegative=o=>e.check(Re(BigInt(0),o)),e.multipleOf=(o,r)=>e.check(cr(o,r));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function ZD(e){return Cl(so,e)}var Nc=D("ZodBigIntFormat",(e,t)=>{Au.init(e,t),so.init(e,t)});function LD(e){return Pl(Nc,e)}function BD(e){return Ol(Nc,e)}var xf=D("ZodSymbol",(e,t)=>{Pu.init(e,t),J.init(e,t)});function qD(e){return jl(xf,e)}var Df=D("ZodUndefined",(e,t)=>{Ou.init(e,t),J.init(e,t)});function VD(e){return Nl(Df,e)}var wf=D("ZodNull",(e,t)=>{ju.init(e,t),J.init(e,t)});function kf(e){return zl(wf,e)}var $f=D("ZodAny",(e,t)=>{Nu.init(e,t),J.init(e,t)});function JD(){return Rl($f)}var Sf=D("ZodUnknown",(e,t)=>{zu.init(e,t),J.init(e,t)});function Rr(){return Fl(Sf)}var If=D("ZodNever",(e,t)=>{Ru.init(e,t),J.init(e,t)});function zc(e){return Ml(If,e)}var Ef=D("ZodVoid",(e,t)=>{Fu.init(e,t),J.init(e,t)});function GD(e){return Ul(Ef,e)}var ea=D("ZodDate",(e,t)=>{Mu.init(e,t),J.init(e,t),e.min=(o,r)=>e.check(Re(o,r)),e.max=(o,r)=>e.check(Xe(o,r));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function WD(e){return Zl(ea,e)}var Tf=D("ZodArray",(e,t)=>{Uu.init(e,t),J.init(e,t),e.element=t.element,e.min=(n,o)=>e.check(Yt(n,o)),e.nonempty=n=>e.check(Yt(1,n)),e.max=(n,o)=>e.check(jr(n,o)),e.length=(n,o)=>e.check(Nr(n,o)),e.unwrap=()=>e.element});function ta(e,t){return Kl(Tf,e,t)}function KD(e){let t=e._zod.def.shape;return Uc(Object.keys(t))}var ra=D("ZodObject",(e,t)=>{Zu.init(e,t),J.init(e,t),E.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>Uc(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Rr()}),e.loose=()=>e.clone({...e._zod.def,catchall:Rr()}),e.strict=()=>e.clone({...e._zod.def,catchall:zc()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>E.extend(e,n),e.safeExtend=n=>E.safeExtend(e,n),e.merge=n=>E.merge(e,n),e.pick=n=>E.pick(e,n),e.omit=n=>E.omit(e,n),e.partial=(...n)=>E.partial(Lc,e,n[0]),e.required=(...n)=>E.required(Bc,e,n[0])});function HD(e,t){let n={type:"object",get shape(){return E.assignProp(this,"shape",e?E.objectClone(e):{}),this.shape},...E.normalizeParams(t)};return new ra(n)}function YD(e,t){return new ra({type:"object",get shape(){return E.assignProp(this,"shape",E.objectClone(e)),this.shape},catchall:zc(),...E.normalizeParams(t)})}function XD(e,t){return new ra({type:"object",get shape(){return E.assignProp(this,"shape",E.objectClone(e)),this.shape},catchall:Rr(),...E.normalizeParams(t)})}var Rc=D("ZodUnion",(e,t)=>{yi.init(e,t),J.init(e,t),e.options=t.options});function Fc(e,t){return new Rc({type:"union",options:e,...E.normalizeParams(t)})}var Cf=D("ZodDiscriminatedUnion",(e,t)=>{Rc.init(e,t),Lu.init(e,t)});function QD(e,t,n){return new Cf({type:"union",options:t,discriminator:e,...E.normalizeParams(n)})}var Af=D("ZodIntersection",(e,t)=>{Bu.init(e,t),J.init(e,t)});function Pf(e,t){return new Af({type:"intersection",left:e,right:t})}var Of=D("ZodTuple",(e,t)=>{bi.init(e,t),J.init(e,t),e.rest=n=>e.clone({...e._zod.def,rest:n})});function jf(e,t,n){let o=t instanceof q,r=o?n:t,i=o?t:null;return new Of({type:"tuple",items:e,rest:i,...E.normalizeParams(r)})}var Mc=D("ZodRecord",(e,t)=>{qu.init(e,t),J.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Nf(e,t,n){return new Mc({type:"record",keyType:e,valueType:t,...E.normalizeParams(n)})}function ew(e,t,n){let o=Ce(e);return o._zod.values=void 0,new Mc({type:"record",keyType:o,valueType:t,...E.normalizeParams(n)})}var zf=D("ZodMap",(e,t)=>{Vu.init(e,t),J.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function tw(e,t,n){return new zf({type:"map",keyType:e,valueType:t,...E.normalizeParams(n)})}var Rf=D("ZodSet",(e,t)=>{Ju.init(e,t),J.init(e,t),e.min=(...n)=>e.check(dr(...n)),e.nonempty=n=>e.check(dr(1,n)),e.max=(...n)=>e.check(Or(...n)),e.size=(...n)=>e.check(Zn(...n))});function rw(e,t){return new Rf({type:"set",valueType:e,...E.normalizeParams(t)})}var ro=D("ZodEnum",(e,t)=>{Gu.init(e,t),J.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(o,r)=>{let i={};for(let a of o)if(n.has(a))i[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new ro({...t,checks:[],...E.normalizeParams(r),entries:i})},e.exclude=(o,r)=>{let i={...t.entries};for(let a of o)if(n.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new ro({...t,checks:[],...E.normalizeParams(r),entries:i})}});function Uc(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new ro({type:"enum",entries:n,...E.normalizeParams(t)})}function nw(e,t){return new ro({type:"enum",entries:e,...E.normalizeParams(t)})}var Ff=D("ZodLiteral",(e,t)=>{Wu.init(e,t),J.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function ow(e,t){return new Ff({type:"literal",values:Array.isArray(e)?e:[e],...E.normalizeParams(t)})}var Mf=D("ZodFile",(e,t)=>{Ku.init(e,t),J.init(e,t),e.min=(n,o)=>e.check(dr(n,o)),e.max=(n,o)=>e.check(Or(n,o)),e.mime=(n,o)=>e.check(Wn(Array.isArray(n)?n:[n],o))});function iw(e){return Hl(Mf,e)}var Uf=D("ZodTransform",(e,t)=>{Hu.init(e,t),J.init(e,t),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new Vt(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(E.issue(i,n.value,t));else{let a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=e),n.issues.push(E.issue(a))}};let r=t.transform(n.value,n);return r instanceof Promise?r.then(i=>(n.value=i,n)):(n.value=r,n)}});function Zc(e){return new Uf({type:"transform",transform:e})}var Lc=D("ZodOptional",(e,t)=>{Yu.init(e,t),J.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Hi(e){return new Lc({type:"optional",innerType:e})}var Zf=D("ZodNullable",(e,t)=>{Xu.init(e,t),J.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Yi(e){return new Zf({type:"nullable",innerType:e})}function aw(e){return Hi(Yi(e))}var Lf=D("ZodDefault",(e,t)=>{Qu.init(e,t),J.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Bf(e,t){return new Lf({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():E.shallowClone(t)}})}var qf=D("ZodPrefault",(e,t)=>{el.init(e,t),J.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Vf(e,t){return new qf({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():E.shallowClone(t)}})}var Bc=D("ZodNonOptional",(e,t)=>{tl.init(e,t),J.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Jf(e,t){return new Bc({type:"nonoptional",innerType:e,...E.normalizeParams(t)})}var Gf=D("ZodSuccess",(e,t)=>{rl.init(e,t),J.init(e,t),e.unwrap=()=>e._zod.def.innerType});function sw(e){return new Gf({type:"success",innerType:e})}var Wf=D("ZodCatch",(e,t)=>{nl.init(e,t),J.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Kf(e,t){return new Wf({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var Hf=D("ZodNaN",(e,t)=>{ol.init(e,t),J.init(e,t)});function uw(e){return Bl(Hf,e)}var qc=D("ZodPipe",(e,t)=>{il.init(e,t),J.init(e,t),e.in=t.in,e.out=t.out});function Xi(e,t){return new qc({type:"pipe",in:e,out:t})}var Vc=D("ZodCodec",(e,t)=>{qc.init(e,t),Nn.init(e,t)});function lw(e,t,n){return new Vc({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}var Yf=D("ZodReadonly",(e,t)=>{al.init(e,t),J.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Xf(e){return new Yf({type:"readonly",innerType:e})}var Qf=D("ZodTemplateLiteral",(e,t)=>{sl.init(e,t),J.init(e,t)});function cw(e,t){return new Qf({type:"template_literal",parts:e,...E.normalizeParams(t)})}var eg=D("ZodLazy",(e,t)=>{cl.init(e,t),J.init(e,t),e.unwrap=()=>e._zod.def.getter()});function tg(e){return new eg({type:"lazy",getter:e})}var rg=D("ZodPromise",(e,t)=>{ll.init(e,t),J.init(e,t),e.unwrap=()=>e._zod.def.innerType});function dw(e){return new rg({type:"promise",innerType:e})}var ng=D("ZodFunction",(e,t)=>{ul.init(e,t),J.init(e,t)});function pw(e){return new ng({type:"function",input:Array.isArray(e?.input)?jf(e?.input):e?.input??ta(Rr()),output:e?.output??Rr()})}var na=D("ZodCustom",(e,t)=>{dl.init(e,t),J.init(e,t)});function mw(e){let t=new se({check:"custom"});return t._zod.check=e,t}function fw(e,t){return Yl(na,e??(()=>!0),t)}function og(e,t={}){return Xl(na,e,t)}function ig(e){return Ql(e)}function gw(e,t={error:`Input not instance of ${e.name}`}){let n=new na({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...E.normalizeParams(t)});return n._zod.bag.Class=e,n}var hw=(...e)=>ec({Codec:Vc,Boolean:ao,String:no},...e);function vw(e){let t=tg(()=>Fc([hc(e),bf(),_f(),kf(),ta(t),Nf(hc(),t)]));return t}function yw(e,t){return Xi(Zc(e),t)}var bw={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function _w(e){ce({customError:e})}function xw(){return ce().customError}var Jc;Jc||(Jc={});var Gc={};Bt(Gc,{bigint:()=>$w,boolean:()=>kw,date:()=>Sw,number:()=>ww,string:()=>Dw});function Dw(e){return gl(no,e)}function ww(e){return Dl(io,e)}function kw(e){return Tl(ao,e)}function $w(e){return Al(so,e)}function Sw(e){return Ll(ea,e)}ce(_i());var ag=s;var Xt=ag;var H;(function(e){e.assertEqual=r=>{};function t(r){}e.assertIs=t;function n(r){throw new Error}e.assertNever=n,e.arrayToEnum=r=>{let i={};for(let a of r)i[a]=a;return i},e.getValidEnumValues=r=>{let i=e.objectKeys(r).filter(u=>typeof r[r[u]]!="number"),a={};for(let u of i)a[u]=r[u];return e.objectValues(a)},e.objectValues=r=>e.objectKeys(r).map(function(i){return r[i]}),e.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let i=[];for(let a in r)Object.prototype.hasOwnProperty.call(r,a)&&i.push(a);return i},e.find=(r,i)=>{for(let a of r)if(i(a))return a},e.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function o(r,i=" | "){return r.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}e.joinValues=o,e.jsonStringifyReplacer=(r,i)=>typeof i=="bigint"?i.toString():i})(H||(H={}));var sg;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(sg||(sg={}));var z=H.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),At=e=>{switch(typeof e){case"undefined":return z.undefined;case"string":return z.string;case"number":return Number.isNaN(e)?z.nan:z.number;case"boolean":return z.boolean;case"function":return z.function;case"bigint":return z.bigint;case"symbol":return z.symbol;case"object":return Array.isArray(e)?z.array:e===null?z.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?z.promise:typeof Map<"u"&&e instanceof Map?z.map:typeof Set<"u"&&e instanceof Set?z.set:typeof Date<"u"&&e instanceof Date?z.date:z.object;default:return z.unknown}};var I=H.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);var Ve=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){let n=t||function(i){return i.message},o={_errors:[]},r=i=>{for(let a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(r);else if(a.code==="invalid_return_type")r(a.returnTypeError);else if(a.code==="invalid_arguments")r(a.argumentsError);else if(a.path.length===0)o._errors.push(n(a));else{let u=o,l=0;for(;l<a.path.length;){let c=a.path[l];l===a.path.length-1?(u[c]=u[c]||{_errors:[]},u[c]._errors.push(n(a))):u[c]=u[c]||{_errors:[]},u=u[c],l++}}};return r(this),o}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,H.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){let n={},o=[];for(let r of this.issues)if(r.path.length>0){let i=r.path[0];n[i]=n[i]||[],n[i].push(t(r))}else o.push(t(r));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}};Ve.create=e=>new Ve(e);var Ew=(e,t)=>{let n;switch(e.code){case I.invalid_type:e.received===z.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case I.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,H.jsonStringifyReplacer)}`;break;case I.unrecognized_keys:n=`Unrecognized key(s) in object: ${H.joinValues(e.keys,", ")}`;break;case I.invalid_union:n="Invalid input";break;case I.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${H.joinValues(e.options)}`;break;case I.invalid_enum_value:n=`Invalid enum value. Expected ${H.joinValues(e.options)}, received '${e.received}'`;break;case I.invalid_arguments:n="Invalid function arguments";break;case I.invalid_return_type:n="Invalid function return type";break;case I.invalid_date:n="Invalid date";break;case I.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:H.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case I.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case I.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case I.custom:n="Invalid input";break;case I.invalid_intersection_types:n="Intersection results could not be merged";break;case I.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case I.not_finite:n="Number must be finite";break;default:n=t.defaultError,H.assertNever(e)}return{message:n}},Qt=Ew;var Tw=Qt;function uo(){return Tw}var oa=e=>{let{data:t,path:n,errorMaps:o,issueData:r}=e,i=[...n,...r.path||[]],a={...r,path:i};if(r.message!==void 0)return{...r,path:i,message:r.message};let u="",l=o.filter(c=>!!c).slice().reverse();for(let c of l)u=c(a,{data:t,defaultError:u}).message;return{...r,path:i,message:u}};function j(e,t){let n=uo(),o=oa({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Qt?void 0:Qt].filter(r=>!!r)});e.common.issues.push(o)}var Se=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){let o=[];for(let r of n){if(r.status==="aborted")return B;r.status==="dirty"&&t.dirty(),o.push(r.value)}return{status:t.value,value:o}}static async mergeObjectAsync(t,n){let o=[];for(let r of n){let i=await r.key,a=await r.value;o.push({key:i,value:a})}return e.mergeObjectSync(t,o)}static mergeObjectSync(t,n){let o={};for(let r of n){let{key:i,value:a}=r;if(i.status==="aborted"||a.status==="aborted")return B;i.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof a.value<"u"||r.alwaysSet)&&(o[i.value]=a.value)}return{status:t.value,value:o}}},B=Object.freeze({status:"aborted"}),Mr=e=>({status:"dirty",value:e}),Ae=e=>({status:"valid",value:e}),Wc=e=>e.status==="aborted",Kc=e=>e.status==="dirty",pr=e=>e.status==="valid",lo=e=>typeof Promise<"u"&&e instanceof Promise;var F;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(F||(F={}));var Qe=class{constructor(t,n,o,r){this._cachedPath=[],this.parent=t,this.data=n,this._path=o,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},ug=(e,t)=>{if(pr(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 n=new Ve(e.common.issues);return this._error=n,this._error}}};function V(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:o,description:r}=e;if(t&&(n||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:r}:{errorMap:(a,u)=>{let{message:l}=e;return a.code==="invalid_enum_value"?{message:l??u.defaultError}:typeof u.data>"u"?{message:l??o??u.defaultError}:a.code!=="invalid_type"?{message:u.defaultError}:{message:l??n??u.defaultError}},description:r}}var G=class{get description(){return this._def.description}_getType(t){return At(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:At(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Se,ctx:{common:t.parent.common,data:t.data,parsedType:At(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(lo(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let o=this.safeParse(t,n);if(o.success)return o.data;throw o.error}safeParse(t,n){let o={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:At(t)},r=this._parseSync({data:t,path:o.path,parent:o});return ug(o,r)}"~validate"(t){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:At(t)};if(!this["~standard"].async)try{let o=this._parseSync({data:t,path:[],parent:n});return pr(o)?{value:o.value}:{issues:n.common.issues}}catch(o){o?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(o=>pr(o)?{value:o.value}:{issues:n.common.issues})}async parseAsync(t,n){let o=await this.safeParseAsync(t,n);if(o.success)return o.data;throw o.error}async safeParseAsync(t,n){let o={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:At(t)},r=this._parse({data:t,path:o.path,parent:o}),i=await(lo(r)?r:Promise.resolve(r));return ug(o,i)}refine(t,n){let o=r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n;return this._refinement((r,i)=>{let a=t(r),u=()=>i.addIssue({code:I.custom,...o(r)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(u(),!1)):a?!0:(u(),!1)})}refinement(t,n){return this._refinement((o,r)=>t(o)?!0:(r.addIssue(typeof n=="function"?n(o,r):n),!1))}_refinement(t){return new at({schema:this,typeName:C.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:n=>this["~validate"](n)}}optional(){return it.create(this,this._def)}nullable(){return jt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return tr.create(this)}promise(){return mr.create(this,this._def)}or(t){return qr.create([this,t],this._def)}and(t){return Vr.create(this,t,this._def)}transform(t){return new at({...V(this._def),schema:this,typeName:C.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t=="function"?t:()=>t;return new Hr({...V(this._def),innerType:this,defaultValue:n,typeName:C.ZodDefault})}brand(){return new ia({typeName:C.ZodBranded,type:this,...V(this._def)})}catch(t){let n=typeof t=="function"?t:()=>t;return new Yr({...V(this._def),innerType:this,catchValue:n,typeName:C.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return aa.create(this,t)}readonly(){return Xr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Cw=/^c[^\s-]{8,}$/i,Aw=/^[0-9a-z]+$/,Pw=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ow=/^[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,jw=/^[a-z0-9_-]{21}$/i,Nw=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,zw=/^[-+]?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)?)??$/,Rw=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Fw="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Hc,Mw=/^(?:(?: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])$/,Uw=/^(?:(?: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])$/,Zw=/^(([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]))$/,Lw=/^(([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])$/,Bw=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,qw=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,lg="((\\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])))",Vw=new RegExp(`^${lg}$`);function cg(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Jw(e){return new RegExp(`^${cg(e)}$`)}function Gw(e){let t=`${lg}T${cg(e)}`,n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function Ww(e,t){return!!((t==="v4"||!t)&&Mw.test(e)||(t==="v6"||!t)&&Zw.test(e))}function Kw(e,t){if(!Nw.test(e))return!1;try{let[n]=e.split(".");if(!n)return!1;let o=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(o));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||t&&r.alg!==t)}catch{return!1}}function Hw(e,t){return!!((t==="v4"||!t)&&Uw.test(e)||(t==="v6"||!t)&&Lw.test(e))}var Zr=class e extends G{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==z.string){let i=this._getOrReturnCtx(t);return j(i,{code:I.invalid_type,expected:z.string,received:i.parsedType}),B}let o=new Se,r;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(r=this._getOrReturnCtx(t,r),j(r,{code:I.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),o.dirty());else if(i.kind==="max")t.data.length>i.value&&(r=this._getOrReturnCtx(t,r),j(r,{code:I.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),o.dirty());else if(i.kind==="length"){let a=t.data.length>i.value,u=t.data.length<i.value;(a||u)&&(r=this._getOrReturnCtx(t,r),a?j(r,{code:I.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):u&&j(r,{code:I.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),o.dirty())}else if(i.kind==="email")Rw.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"email",code:I.invalid_string,message:i.message}),o.dirty());else if(i.kind==="emoji")Hc||(Hc=new RegExp(Fw,"u")),Hc.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"emoji",code:I.invalid_string,message:i.message}),o.dirty());else if(i.kind==="uuid")Ow.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"uuid",code:I.invalid_string,message:i.message}),o.dirty());else if(i.kind==="nanoid")jw.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"nanoid",code:I.invalid_string,message:i.message}),o.dirty());else if(i.kind==="cuid")Cw.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"cuid",code:I.invalid_string,message:i.message}),o.dirty());else if(i.kind==="cuid2")Aw.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"cuid2",code:I.invalid_string,message:i.message}),o.dirty());else if(i.kind==="ulid")Pw.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"ulid",code:I.invalid_string,message:i.message}),o.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),j(r,{validation:"url",code:I.invalid_string,message:i.message}),o.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"regex",code:I.invalid_string,message:i.message}),o.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(r=this._getOrReturnCtx(t,r),j(r,{code:I.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),o.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(r=this._getOrReturnCtx(t,r),j(r,{code:I.invalid_string,validation:{startsWith:i.value},message:i.message}),o.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(r=this._getOrReturnCtx(t,r),j(r,{code:I.invalid_string,validation:{endsWith:i.value},message:i.message}),o.dirty()):i.kind==="datetime"?Gw(i).test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{code:I.invalid_string,validation:"datetime",message:i.message}),o.dirty()):i.kind==="date"?Vw.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{code:I.invalid_string,validation:"date",message:i.message}),o.dirty()):i.kind==="time"?Jw(i).test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{code:I.invalid_string,validation:"time",message:i.message}),o.dirty()):i.kind==="duration"?zw.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"duration",code:I.invalid_string,message:i.message}),o.dirty()):i.kind==="ip"?Ww(t.data,i.version)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"ip",code:I.invalid_string,message:i.message}),o.dirty()):i.kind==="jwt"?Kw(t.data,i.alg)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"jwt",code:I.invalid_string,message:i.message}),o.dirty()):i.kind==="cidr"?Hw(t.data,i.version)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"cidr",code:I.invalid_string,message:i.message}),o.dirty()):i.kind==="base64"?Bw.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"base64",code:I.invalid_string,message:i.message}),o.dirty()):i.kind==="base64url"?qw.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"base64url",code:I.invalid_string,message:i.message}),o.dirty()):H.assertNever(i);return{status:o.value,value:t.data}}_regex(t,n,o){return this.refinement(r=>t.test(r),{validation:n,code:I.invalid_string,...F.errToObj(o)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...F.errToObj(t)})}url(t){return this._addCheck({kind:"url",...F.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...F.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...F.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...F.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...F.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...F.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...F.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...F.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...F.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...F.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...F.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...F.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...F.errToObj(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?.precision>"u"?null:t?.precision,...F.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...F.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...F.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...F.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...F.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...F.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...F.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...F.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...F.errToObj(n)})}nonempty(t){return this.min(1,F.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 n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};Zr.create=e=>new Zr({checks:[],typeName:C.ZodString,coerce:e?.coerce??!1,...V(e)});function Yw(e,t){let n=(e.toString().split(".")[1]||"").length,o=(t.toString().split(".")[1]||"").length,r=n>o?n:o,i=Number.parseInt(e.toFixed(r).replace(".","")),a=Number.parseInt(t.toFixed(r).replace(".",""));return i%a/10**r}var co=class e extends G{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)!==z.number){let i=this._getOrReturnCtx(t);return j(i,{code:I.invalid_type,expected:z.number,received:i.parsedType}),B}let o,r=new Se;for(let i of this._def.checks)i.kind==="int"?H.isInteger(t.data)||(o=this._getOrReturnCtx(t,o),j(o,{code:I.invalid_type,expected:"integer",received:"float",message:i.message}),r.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(o=this._getOrReturnCtx(t,o),j(o,{code:I.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(o=this._getOrReturnCtx(t,o),j(o,{code:I.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="multipleOf"?Yw(t.data,i.value)!==0&&(o=this._getOrReturnCtx(t,o),j(o,{code:I.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(o=this._getOrReturnCtx(t,o),j(o,{code:I.not_finite,message:i.message}),r.dirty()):H.assertNever(i);return{status:r.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,F.toString(n))}gt(t,n){return this.setLimit("min",t,!1,F.toString(n))}lte(t,n){return this.setLimit("max",t,!0,F.toString(n))}lt(t,n){return this.setLimit("max",t,!1,F.toString(n))}setLimit(t,n,o,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:o,message:F.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:F.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:F.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:F.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:F.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:F.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:F.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:F.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:F.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:F.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&H.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(n===null||o.value>n)&&(n=o.value):o.kind==="max"&&(t===null||o.value<t)&&(t=o.value)}return Number.isFinite(n)&&Number.isFinite(t)}};co.create=e=>new co({checks:[],typeName:C.ZodNumber,coerce:e?.coerce||!1,...V(e)});var po=class e extends G{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)!==z.bigint)return this._getInvalidInput(t);let o,r=new Se;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(o=this._getOrReturnCtx(t,o),j(o,{code:I.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(o=this._getOrReturnCtx(t,o),j(o,{code:I.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(o=this._getOrReturnCtx(t,o),j(o,{code:I.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):H.assertNever(i);return{status:r.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return j(n,{code:I.invalid_type,expected:z.bigint,received:n.parsedType}),B}gte(t,n){return this.setLimit("min",t,!0,F.toString(n))}gt(t,n){return this.setLimit("min",t,!1,F.toString(n))}lte(t,n){return this.setLimit("max",t,!0,F.toString(n))}lt(t,n){return this.setLimit("max",t,!1,F.toString(n))}setLimit(t,n,o,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:o,message:F.toString(r)}]})}_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:F.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:F.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:F.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:F.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:F.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};po.create=e=>new po({checks:[],typeName:C.ZodBigInt,coerce:e?.coerce??!1,...V(e)});var mo=class extends G{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==z.boolean){let o=this._getOrReturnCtx(t);return j(o,{code:I.invalid_type,expected:z.boolean,received:o.parsedType}),B}return Ae(t.data)}};mo.create=e=>new mo({typeName:C.ZodBoolean,coerce:e?.coerce||!1,...V(e)});var fo=class e extends G{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==z.date){let i=this._getOrReturnCtx(t);return j(i,{code:I.invalid_type,expected:z.date,received:i.parsedType}),B}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return j(i,{code:I.invalid_date}),B}let o=new Se,r;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(r=this._getOrReturnCtx(t,r),j(r,{code:I.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),o.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(r=this._getOrReturnCtx(t,r),j(r,{code:I.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),o.dirty()):H.assertNever(i);return{status:o.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:F.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:F.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}};fo.create=e=>new fo({checks:[],coerce:e?.coerce||!1,typeName:C.ZodDate,...V(e)});var go=class extends G{_parse(t){if(this._getType(t)!==z.symbol){let o=this._getOrReturnCtx(t);return j(o,{code:I.invalid_type,expected:z.symbol,received:o.parsedType}),B}return Ae(t.data)}};go.create=e=>new go({typeName:C.ZodSymbol,...V(e)});var Lr=class extends G{_parse(t){if(this._getType(t)!==z.undefined){let o=this._getOrReturnCtx(t);return j(o,{code:I.invalid_type,expected:z.undefined,received:o.parsedType}),B}return Ae(t.data)}};Lr.create=e=>new Lr({typeName:C.ZodUndefined,...V(e)});var Br=class extends G{_parse(t){if(this._getType(t)!==z.null){let o=this._getOrReturnCtx(t);return j(o,{code:I.invalid_type,expected:z.null,received:o.parsedType}),B}return Ae(t.data)}};Br.create=e=>new Br({typeName:C.ZodNull,...V(e)});var ho=class extends G{constructor(){super(...arguments),this._any=!0}_parse(t){return Ae(t.data)}};ho.create=e=>new ho({typeName:C.ZodAny,...V(e)});var er=class extends G{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ae(t.data)}};er.create=e=>new er({typeName:C.ZodUnknown,...V(e)});var vt=class extends G{_parse(t){let n=this._getOrReturnCtx(t);return j(n,{code:I.invalid_type,expected:z.never,received:n.parsedType}),B}};vt.create=e=>new vt({typeName:C.ZodNever,...V(e)});var vo=class extends G{_parse(t){if(this._getType(t)!==z.undefined){let o=this._getOrReturnCtx(t);return j(o,{code:I.invalid_type,expected:z.void,received:o.parsedType}),B}return Ae(t.data)}};vo.create=e=>new vo({typeName:C.ZodVoid,...V(e)});var tr=class e extends G{_parse(t){let{ctx:n,status:o}=this._processInputParams(t),r=this._def;if(n.parsedType!==z.array)return j(n,{code:I.invalid_type,expected:z.array,received:n.parsedType}),B;if(r.exactLength!==null){let a=n.data.length>r.exactLength.value,u=n.data.length<r.exactLength.value;(a||u)&&(j(n,{code:a?I.too_big:I.too_small,minimum:u?r.exactLength.value:void 0,maximum:a?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),o.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(j(n,{code:I.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),o.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(j(n,{code:I.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((a,u)=>r.type._parseAsync(new Qe(n,a,n.path,u)))).then(a=>Se.mergeArray(o,a));let i=[...n.data].map((a,u)=>r.type._parseSync(new Qe(n,a,n.path,u)));return Se.mergeArray(o,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:F.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:F.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:F.toString(n)}})}nonempty(t){return this.min(1,t)}};tr.create=(e,t)=>new tr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:C.ZodArray,...V(t)});function Ur(e){if(e instanceof Je){let t={};for(let n in e.shape){let o=e.shape[n];t[n]=it.create(Ur(o))}return new Je({...e._def,shape:()=>t})}else return e instanceof tr?new tr({...e._def,type:Ur(e.element)}):e instanceof it?it.create(Ur(e.unwrap())):e instanceof jt?jt.create(Ur(e.unwrap())):e instanceof Ot?Ot.create(e.items.map(t=>Ur(t))):e}var Je=class e extends G{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(),n=H.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==z.object){let c=this._getOrReturnCtx(t);return j(c,{code:I.invalid_type,expected:z.object,received:c.parsedType}),B}let{status:o,ctx:r}=this._processInputParams(t),{shape:i,keys:a}=this._getCached(),u=[];if(!(this._def.catchall instanceof vt&&this._def.unknownKeys==="strip"))for(let c in r.data)a.includes(c)||u.push(c);let l=[];for(let c of a){let m=i[c],h=r.data[c];l.push({key:{status:"valid",value:c},value:m._parse(new Qe(r,h,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof vt){let c=this._def.unknownKeys;if(c==="passthrough")for(let m of u)l.push({key:{status:"valid",value:m},value:{status:"valid",value:r.data[m]}});else if(c==="strict")u.length>0&&(j(r,{code:I.unrecognized_keys,keys:u}),o.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let m of u){let h=r.data[m];l.push({key:{status:"valid",value:m},value:c._parse(new Qe(r,h,r.path,m)),alwaysSet:m in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let c=[];for(let m of l){let h=await m.key,y=await m.value;c.push({key:h,value:y,alwaysSet:m.alwaysSet})}return c}).then(c=>Se.mergeObjectSync(o,c)):Se.mergeObjectSync(o,l)}get shape(){return this._def.shape()}strict(t){return F.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,o)=>{let r=this._def.errorMap?.(n,o).message??o.defaultError;return n.code==="unrecognized_keys"?{message:F.errToObj(t).message??r}:{message:r}}}:{}})}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:C.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let o of H.objectKeys(t))t[o]&&this.shape[o]&&(n[o]=this.shape[o]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let o of H.objectKeys(this.shape))t[o]||(n[o]=this.shape[o]);return new e({...this._def,shape:()=>n})}deepPartial(){return Ur(this)}partial(t){let n={};for(let o of H.objectKeys(this.shape)){let r=this.shape[o];t&&!t[o]?n[o]=r:n[o]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let o of H.objectKeys(this.shape))if(t&&!t[o])n[o]=this.shape[o];else{let i=this.shape[o];for(;i instanceof it;)i=i._def.innerType;n[o]=i}return new e({...this._def,shape:()=>n})}keyof(){return dg(H.objectKeys(this.shape))}};Je.create=(e,t)=>new Je({shape:()=>e,unknownKeys:"strip",catchall:vt.create(),typeName:C.ZodObject,...V(t)});Je.strictCreate=(e,t)=>new Je({shape:()=>e,unknownKeys:"strict",catchall:vt.create(),typeName:C.ZodObject,...V(t)});Je.lazycreate=(e,t)=>new Je({shape:e,unknownKeys:"strip",catchall:vt.create(),typeName:C.ZodObject,...V(t)});var qr=class extends G{_parse(t){let{ctx:n}=this._processInputParams(t),o=this._def.options;function r(i){for(let u of i)if(u.result.status==="valid")return u.result;for(let u of i)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;let a=i.map(u=>new Ve(u.ctx.common.issues));return j(n,{code:I.invalid_union,unionErrors:a}),B}if(n.common.async)return Promise.all(o.map(async i=>{let a={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(r);{let i,a=[];for(let l of o){let c={...n,common:{...n.common,issues:[]},parent:null},m=l._parseSync({data:n.data,path:n.path,parent:c});if(m.status==="valid")return m;m.status==="dirty"&&!i&&(i={result:m,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;let u=a.map(l=>new Ve(l));return j(n,{code:I.invalid_union,unionErrors:u}),B}}get options(){return this._def.options}};qr.create=(e,t)=>new qr({options:e,typeName:C.ZodUnion,...V(t)});var Pt=e=>e instanceof Jr?Pt(e.schema):e instanceof at?Pt(e.innerType()):e instanceof Gr?[e.value]:e instanceof Wr?e.options:e instanceof Kr?H.objectValues(e.enum):e instanceof Hr?Pt(e._def.innerType):e instanceof Lr?[void 0]:e instanceof Br?[null]:e instanceof it?[void 0,...Pt(e.unwrap())]:e instanceof jt?[null,...Pt(e.unwrap())]:e instanceof ia||e instanceof Xr?Pt(e.unwrap()):e instanceof Yr?Pt(e._def.innerType):[],Yc=class e extends G{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==z.object)return j(n,{code:I.invalid_type,expected:z.object,received:n.parsedType}),B;let o=this.discriminator,r=n.data[o],i=this.optionsMap.get(r);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(j(n,{code:I.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),B)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,o){let r=new Map;for(let i of n){let a=Pt(i.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let u of a){if(r.has(u))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(u)}`);r.set(u,i)}}return new e({typeName:C.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:r,...V(o)})}};function Xc(e,t){let n=At(e),o=At(t);if(e===t)return{valid:!0,data:e};if(n===z.object&&o===z.object){let r=H.objectKeys(t),i=H.objectKeys(e).filter(u=>r.indexOf(u)!==-1),a={...e,...t};for(let u of i){let l=Xc(e[u],t[u]);if(!l.valid)return{valid:!1};a[u]=l.data}return{valid:!0,data:a}}else if(n===z.array&&o===z.array){if(e.length!==t.length)return{valid:!1};let r=[];for(let i=0;i<e.length;i++){let a=e[i],u=t[i],l=Xc(a,u);if(!l.valid)return{valid:!1};r.push(l.data)}return{valid:!0,data:r}}else return n===z.date&&o===z.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var Vr=class extends G{_parse(t){let{status:n,ctx:o}=this._processInputParams(t),r=(i,a)=>{if(Wc(i)||Wc(a))return B;let u=Xc(i.value,a.value);return u.valid?((Kc(i)||Kc(a))&&n.dirty(),{status:n.value,value:u.data}):(j(o,{code:I.invalid_intersection_types}),B)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([i,a])=>r(i,a)):r(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}};Vr.create=(e,t,n)=>new Vr({left:e,right:t,typeName:C.ZodIntersection,...V(n)});var Ot=class e extends G{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==z.array)return j(o,{code:I.invalid_type,expected:z.array,received:o.parsedType}),B;if(o.data.length<this._def.items.length)return j(o,{code:I.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),B;!this._def.rest&&o.data.length>this._def.items.length&&(j(o,{code:I.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let i=[...o.data].map((a,u)=>{let l=this._def.items[u]||this._def.rest;return l?l._parse(new Qe(o,a,o.path,u)):null}).filter(a=>!!a);return o.common.async?Promise.all(i).then(a=>Se.mergeArray(n,a)):Se.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Ot.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ot({items:e,typeName:C.ZodTuple,rest:null,...V(t)})};var Qc=class e extends G{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==z.object)return j(o,{code:I.invalid_type,expected:z.object,received:o.parsedType}),B;let r=[],i=this._def.keyType,a=this._def.valueType;for(let u in o.data)r.push({key:i._parse(new Qe(o,u,o.path,u)),value:a._parse(new Qe(o,o.data[u],o.path,u)),alwaysSet:u in o.data});return o.common.async?Se.mergeObjectAsync(n,r):Se.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(t,n,o){return n instanceof G?new e({keyType:t,valueType:n,typeName:C.ZodRecord,...V(o)}):new e({keyType:Zr.create(),valueType:t,typeName:C.ZodRecord,...V(n)})}},yo=class extends G{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==z.map)return j(o,{code:I.invalid_type,expected:z.map,received:o.parsedType}),B;let r=this._def.keyType,i=this._def.valueType,a=[...o.data.entries()].map(([u,l],c)=>({key:r._parse(new Qe(o,u,o.path,[c,"key"])),value:i._parse(new Qe(o,l,o.path,[c,"value"]))}));if(o.common.async){let u=new Map;return Promise.resolve().then(async()=>{for(let l of a){let c=await l.key,m=await l.value;if(c.status==="aborted"||m.status==="aborted")return B;(c.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(c.value,m.value)}return{status:n.value,value:u}})}else{let u=new Map;for(let l of a){let c=l.key,m=l.value;if(c.status==="aborted"||m.status==="aborted")return B;(c.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(c.value,m.value)}return{status:n.value,value:u}}}};yo.create=(e,t,n)=>new yo({valueType:t,keyType:e,typeName:C.ZodMap,...V(n)});var bo=class e extends G{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==z.set)return j(o,{code:I.invalid_type,expected:z.set,received:o.parsedType}),B;let r=this._def;r.minSize!==null&&o.data.size<r.minSize.value&&(j(o,{code:I.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&o.data.size>r.maxSize.value&&(j(o,{code:I.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let i=this._def.valueType;function a(l){let c=new Set;for(let m of l){if(m.status==="aborted")return B;m.status==="dirty"&&n.dirty(),c.add(m.value)}return{status:n.value,value:c}}let u=[...o.data.values()].map((l,c)=>i._parse(new Qe(o,l,o.path,c)));return o.common.async?Promise.all(u).then(l=>a(l)):a(u)}min(t,n){return new e({...this._def,minSize:{value:t,message:F.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:F.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};bo.create=(e,t)=>new bo({valueType:e,minSize:null,maxSize:null,typeName:C.ZodSet,...V(t)});var ed=class e extends G{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==z.function)return j(n,{code:I.invalid_type,expected:z.function,received:n.parsedType}),B;function o(u,l){return oa({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,uo(),Qt].filter(c=>!!c),issueData:{code:I.invalid_arguments,argumentsError:l}})}function r(u,l){return oa({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,uo(),Qt].filter(c=>!!c),issueData:{code:I.invalid_return_type,returnTypeError:l}})}let i={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof mr){let u=this;return Ae(async function(...l){let c=new Ve([]),m=await u._def.args.parseAsync(l,i).catch(p=>{throw c.addIssue(o(l,p)),c}),h=await Reflect.apply(a,this,m);return await u._def.returns._def.type.parseAsync(h,i).catch(p=>{throw c.addIssue(r(h,p)),c})})}else{let u=this;return Ae(function(...l){let c=u._def.args.safeParse(l,i);if(!c.success)throw new Ve([o(l,c.error)]);let m=Reflect.apply(a,this,c.data),h=u._def.returns.safeParse(m,i);if(!h.success)throw new Ve([r(m,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Ot.create(t).rest(er.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,n,o){return new e({args:t||Ot.create([]).rest(er.create()),returns:n||er.create(),typeName:C.ZodFunction,...V(o)})}},Jr=class extends G{get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};Jr.create=(e,t)=>new Jr({getter:e,typeName:C.ZodLazy,...V(t)});var Gr=class extends G{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return j(n,{received:n.data,code:I.invalid_literal,expected:this._def.value}),B}return{status:"valid",value:t.data}}get value(){return this._def.value}};Gr.create=(e,t)=>new Gr({value:e,typeName:C.ZodLiteral,...V(t)});function dg(e,t){return new Wr({values:e,typeName:C.ZodEnum,...V(t)})}var Wr=class e extends G{_parse(t){if(typeof t.data!="string"){let n=this._getOrReturnCtx(t),o=this._def.values;return j(n,{expected:H.joinValues(o),received:n.parsedType,code:I.invalid_type}),B}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let n=this._getOrReturnCtx(t),o=this._def.values;return j(n,{received:n.data,code:I.invalid_enum_value,options:o}),B}return Ae(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(o=>!t.includes(o)),{...this._def,...n})}};Wr.create=dg;var Kr=class extends G{_parse(t){let n=H.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(t);if(o.parsedType!==z.string&&o.parsedType!==z.number){let r=H.objectValues(n);return j(o,{expected:H.joinValues(r),received:o.parsedType,code:I.invalid_type}),B}if(this._cache||(this._cache=new Set(H.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let r=H.objectValues(n);return j(o,{received:o.data,code:I.invalid_enum_value,options:r}),B}return Ae(t.data)}get enum(){return this._def.values}};Kr.create=(e,t)=>new Kr({values:e,typeName:C.ZodNativeEnum,...V(t)});var mr=class extends G{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==z.promise&&n.common.async===!1)return j(n,{code:I.invalid_type,expected:z.promise,received:n.parsedType}),B;let o=n.parsedType===z.promise?n.data:Promise.resolve(n.data);return Ae(o.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}};mr.create=(e,t)=>new mr({type:e,typeName:C.ZodPromise,...V(t)});var at=class extends G{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===C.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:o}=this._processInputParams(t),r=this._def.effect||null,i={addIssue:a=>{j(o,a),a.fatal?n.abort():n.dirty()},get path(){return o.path}};if(i.addIssue=i.addIssue.bind(i),r.type==="preprocess"){let a=r.transform(o.data,i);if(o.common.async)return Promise.resolve(a).then(async u=>{if(n.value==="aborted")return B;let l=await this._def.schema._parseAsync({data:u,path:o.path,parent:o});return l.status==="aborted"?B:l.status==="dirty"?Mr(l.value):n.value==="dirty"?Mr(l.value):l});{if(n.value==="aborted")return B;let u=this._def.schema._parseSync({data:a,path:o.path,parent:o});return u.status==="aborted"?B:u.status==="dirty"?Mr(u.value):n.value==="dirty"?Mr(u.value):u}}if(r.type==="refinement"){let a=u=>{let l=r.refinement(u,i);if(o.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(o.common.async===!1){let u=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return u.status==="aborted"?B:(u.status==="dirty"&&n.dirty(),a(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(u=>u.status==="aborted"?B:(u.status==="dirty"&&n.dirty(),a(u.value).then(()=>({status:n.value,value:u.value}))))}if(r.type==="transform")if(o.common.async===!1){let a=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!pr(a))return B;let u=r.transform(a.value,i);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(a=>pr(a)?Promise.resolve(r.transform(a.value,i)).then(u=>({status:n.value,value:u})):B);H.assertNever(r)}};at.create=(e,t,n)=>new at({schema:e,typeName:C.ZodEffects,effect:t,...V(n)});at.createWithPreprocess=(e,t,n)=>new at({schema:t,effect:{type:"preprocess",transform:e},typeName:C.ZodEffects,...V(n)});var it=class extends G{_parse(t){return this._getType(t)===z.undefined?Ae(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};it.create=(e,t)=>new it({innerType:e,typeName:C.ZodOptional,...V(t)});var jt=class extends G{_parse(t){return this._getType(t)===z.null?Ae(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};jt.create=(e,t)=>new jt({innerType:e,typeName:C.ZodNullable,...V(t)});var Hr=class extends G{_parse(t){let{ctx:n}=this._processInputParams(t),o=n.data;return n.parsedType===z.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Hr.create=(e,t)=>new Hr({innerType:e,typeName:C.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...V(t)});var Yr=class extends G{_parse(t){let{ctx:n}=this._processInputParams(t),o={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return lo(r)?r.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ve(o.common.issues)},input:o.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Ve(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}};Yr.create=(e,t)=>new Yr({innerType:e,typeName:C.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...V(t)});var _o=class extends G{_parse(t){if(this._getType(t)!==z.nan){let o=this._getOrReturnCtx(t);return j(o,{code:I.invalid_type,expected:z.nan,received:o.parsedType}),B}return{status:"valid",value:t.data}}};_o.create=e=>new _o({typeName:C.ZodNaN,...V(e)});var zP=Symbol("zod_brand"),ia=class extends G{_parse(t){let{ctx:n}=this._processInputParams(t),o=n.data;return this._def.type._parse({data:o,path:n.path,parent:n})}unwrap(){return this._def.type}},aa=class e extends G{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?B:i.status==="dirty"?(n.dirty(),Mr(i.value)):this._def.out._parseAsync({data:i.value,path:o.path,parent:o})})();{let r=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return r.status==="aborted"?B:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:o.path,parent:o})}}static create(t,n){return new e({in:t,out:n,typeName:C.ZodPipeline})}},Xr=class extends G{_parse(t){let n=this._def.innerType._parse(t),o=r=>(pr(r)&&(r.value=Object.freeze(r.value)),r);return lo(n)?n.then(r=>o(r)):o(n)}unwrap(){return this._def.innerType}};Xr.create=(e,t)=>new Xr({innerType:e,typeName:C.ZodReadonly,...V(t)});var RP={object:Je.lazycreate},C;(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"})(C||(C={}));var FP=Zr.create,MP=co.create,UP=_o.create,ZP=po.create,LP=mo.create,BP=fo.create,qP=go.create,VP=Lr.create,JP=Br.create,GP=ho.create,WP=er.create,KP=vt.create,HP=vo.create,YP=tr.create,XP=Je.create,QP=Je.strictCreate,eO=qr.create,tO=Yc.create,rO=Vr.create,nO=Ot.create,oO=Qc.create,iO=yo.create,aO=bo.create,sO=ed.create,uO=Jr.create,lO=Gr.create,cO=Wr.create,dO=Kr.create,pO=mr.create,mO=at.create,fO=it.create,gO=jt.create,hO=at.createWithPreprocess,vO=aa.create;function we(...e){return e.reduce((t,n)=>({...t,...n??{}}),{})}async function gg(e,t){if(e==null)return Promise.resolve();let n=t?.abortSignal;return new Promise((o,r)=>{if(n?.aborted){r(pg());return}let i=setTimeout(()=>{a(),o()},e),a=()=>{clearTimeout(i),n?.removeEventListener("abort",u)},u=()=>{a(),r(pg())};n?.addEventListener("abort",u)})}function pg(){return new DOMException("Delay was aborted","AbortError")}function xo(e){return Object.fromEntries([...e.headers])}function hg(e=globalThis){var t,n,o;return e.window?"runtime/browser":(t=e.navigator)!=null&&t.userAgent?`runtime/${e.navigator.userAgent.toLowerCase()}`:(o=(n=e.process)==null?void 0:n.versions)!=null&&o.node?`runtime/node.js/${e.process.version.substring(0)}`:e.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function Qw(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>n!=null))}function Qr(e,...t){let n=Qw(e??{}),o=new Headers(n),r=o.get("user-agent")||"";return o.set("user-agent",[r,...t].filter(Boolean).join(" ")),Object.fromEntries(o)}var zt=({prefix:e,size:t=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:o="-"}={})=>{let r=()=>{let i=n.length,a=new Array(t);for(let u=0;u<t;u++)a[u]=n[Math.random()*i|0];return a.join("")};if(e==null)return r;if(n.includes(o))throw new Jo({argument:"separator",message:`The separator "${o}" must not be part of the alphabet "${n}".`});return()=>`${e}${o}${r()}`},lt=zt();function Do(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}function Nt(e){return(e instanceof Error||e instanceof DOMException)&&(e.name==="AbortError"||e.name==="ResponseAborted"||e.name==="TimeoutError")}var e0=["fetch failed","failed to fetch"];function vg({error:e,url:t,requestBodyValues:n}){if(Nt(e))return e;if(e instanceof TypeError&&e0.includes(e.message.toLowerCase())){let o=e.cause;if(o!=null)return new le({message:`Cannot connect to API: ${o.message}`,cause:o,url:t,requestBodyValues:n,isRetryable:!0})}return e}var yg="3.0.9",t0=()=>globalThis.fetch,bg=async({url:e,headers:t={},successfulResponseHandler:n,failedResponseHandler:o,abortSignal:r,fetch:i=t0()})=>{try{let a=await i(e,{method:"GET",headers:Qr(t,`ai-sdk/provider-utils/${yg}`,hg()),signal:r}),u=xo(a);if(!a.ok){let l;try{l=await o({response:a,url:e,requestBodyValues:{}})}catch(c){throw Nt(c)||le.isInstance(c)?c:new le({message:"Failed to process error response",cause:c,statusCode:a.status,url:e,responseHeaders:u,requestBodyValues:{}})}throw l.value}try{return await n({response:a,url:e,requestBodyValues:{}})}catch(l){throw l instanceof Error&&(Nt(l)||le.isInstance(l))?l:new le({message:"Failed to process successful response",cause:l,statusCode:a.status,url:e,responseHeaders:u,requestBodyValues:{}})}}catch(a){throw vg({error:a,url:e,requestBodyValues:{}})}};function _g({mediaType:e,url:t,supportedUrls:n}){return t=t.toLowerCase(),e=e.toLowerCase(),Object.entries(n).map(([o,r])=>{let i=o.toLowerCase();return i==="*"||i==="*/*"?{mediaTypePrefix:"",regexes:r}:{mediaTypePrefix:i.replace(/\*/,""),regexes:r}}).filter(({mediaTypePrefix:o})=>e.startsWith(o)).flatMap(({regexes:o})=>o).some(o=>o.test(t))}function xg({apiKey:e,environmentVariableName:t,apiKeyParameterName:n="apiKey",description:o}){if(typeof e=="string")return e;if(e!=null)throw new bn({message:`${o} API key must be a string.`});if(typeof process>"u")throw new bn({message:`${o} API key is missing. Pass it using the '${n}' parameter. Environment variables is not supported in this environment.`});if(e=process.env[t],e==null)throw new bn({message:`${o} API key is missing. Pass it using the '${n}' parameter or the ${t} environment variable.`});if(typeof e!="string")throw new bn({message:`${o} API key must be a string. The value of the ${t} environment variable is not a string.`});return e}function wo({settingValue:e,environmentVariableName:t}){if(typeof e=="string")return e;if(!(e!=null||typeof process>"u")&&(e=process.env[t],!(e==null||typeof e!="string")))return e}var r0=/"__proto__"\s*:/,n0=/"constructor"\s*:/;function o0(e){let t=JSON.parse(e);return t===null||typeof t!="object"||r0.test(e)===!1&&n0.test(e)===!1?t:i0(t)}function i0(e){let t=[e];for(;t.length;){let n=t;t=[];for(let o of n){if(Object.prototype.hasOwnProperty.call(o,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(o,"constructor")&&Object.prototype.hasOwnProperty.call(o.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(let r in o){let i=o[r];i&&typeof i=="object"&&t.push(i)}}}return e}function id(e){let{stackTraceLimit:t}=Error;Error.stackTraceLimit=0;try{return o0(e)}finally{Error.stackTraceLimit=t}}var sa=Symbol.for("vercel.ai.validator");function a0(e){return{[sa]:!0,validate:e}}function s0(e){return typeof e=="object"&&e!==null&&sa in e&&e[sa]===!0&&"validate"in e}function u0(e){return s0(e)?e:l0(e)}function l0(e){return a0(async t=>{let n=await e["~standard"].validate(t);return n.issues==null?{success:!0,value:n.value}:{success:!1,error:new qt({value:t,cause:n.issues})}})}async function ua({value:e,schema:t}){let n=await Rt({value:e,schema:t});if(!n.success)throw qt.wrap({value:e,cause:n.error});return n.value}async function Rt({value:e,schema:t}){let n=u0(t);try{if(n.validate==null)return{success:!0,value:e,rawValue:e};let o=await n.validate(e);return o.success?{success:!0,value:o.value,rawValue:e}:{success:!1,error:qt.wrap({value:e,cause:o.error}),rawValue:e}}catch(o){return{success:!1,error:qt.wrap({value:e,cause:o}),rawValue:e}}}async function c0({text:e,schema:t}){try{let n=id(e);return t==null?n:ua({value:n,schema:t})}catch(n){throw yn.isInstance(n)||qt.isInstance(n)?n:new yn({text:e,cause:n})}}async function yt({text:e,schema:t}){try{let n=id(e);return t==null?{success:!0,value:n,rawValue:n}:await Rt({value:n,schema:t})}catch(n){return{success:!1,error:yn.isInstance(n)?n:new yn({text:e,cause:n}),rawValue:void 0}}}function ad(e){try{return id(e),!0}catch{return!1}}function d0({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new Wo).pipeThrough(new TransformStream({async transform({data:n},o){n!=="[DONE]"&&o.enqueue(await yt({text:n,schema:t}))}}))}async function Me({provider:e,providerOptions:t,schema:n}){if(t?.[e]==null)return;let o=await Rt({value:t[e],schema:n});if(!o.success)throw new Jo({argument:"providerOptions",message:`invalid ${e} provider options`,cause:o.error});return o.value}var p0=()=>globalThis.fetch,be=async({url:e,headers:t,body:n,failedResponseHandler:o,successfulResponseHandler:r,abortSignal:i,fetch:a})=>m0({url:e,headers:{"Content-Type":"application/json",...t},body:{content:JSON.stringify(n),values:n},failedResponseHandler:o,successfulResponseHandler:r,abortSignal:i,fetch:a});var m0=async({url:e,headers:t={},body:n,successfulResponseHandler:o,failedResponseHandler:r,abortSignal:i,fetch:a=p0()})=>{try{let u=await a(e,{method:"POST",headers:Qr(t,`ai-sdk/provider-utils/${yg}`,hg()),body:n.content,signal:i}),l=xo(u);if(!u.ok){let c;try{c=await r({response:u,url:e,requestBodyValues:n.values})}catch(m){throw Nt(m)||le.isInstance(m)?m:new le({message:"Failed to process error response",cause:m,statusCode:u.status,url:e,responseHeaders:l,requestBodyValues:n.values})}throw c.value}try{return await o({response:u,url:e,requestBodyValues:n.values})}catch(c){throw c instanceof Error&&(Nt(c)||le.isInstance(c))?c:new le({message:"Failed to process successful response",cause:c,statusCode:u.status,url:e,responseHeaders:l,requestBodyValues:n.values})}}catch(u){throw vg({error:u,url:e,requestBodyValues:n.values})}};function Ue({id:e,name:t,inputSchema:n}){return({execute:o,outputSchema:r,toModelOutput:i,onInputStart:a,onInputDelta:u,onInputAvailable:l,...c})=>({type:"provider-defined",id:e,name:t,args:c,inputSchema:n,outputSchema:r,execute:o,toModelOutput:i,onInputStart:a,onInputDelta:u,onInputAvailable:l})}function la({id:e,name:t,inputSchema:n,outputSchema:o}){return({execute:r,toModelOutput:i,onInputStart:a,onInputDelta:u,onInputAvailable:l,...c})=>({type:"provider-defined",id:e,name:t,args:c,inputSchema:n,outputSchema:o,execute:r,toModelOutput:i,onInputStart:a,onInputDelta:u,onInputAvailable:l})}async function et(e){return typeof e=="function"&&(e=e()),Promise.resolve(e)}var ke=({errorSchema:e,errorToMessage:t,isRetryable:n})=>async({response:o,url:r,requestBodyValues:i})=>{let a=await o.text(),u=xo(o);if(a.trim()==="")return{responseHeaders:u,value:new le({message:o.statusText,url:r,requestBodyValues:i,statusCode:o.status,responseHeaders:u,responseBody:a,isRetryable:n?.(o)})};try{let l=await c0({text:a,schema:e});return{responseHeaders:u,value:new le({message:t(l),url:r,requestBodyValues:i,statusCode:o.status,responseHeaders:u,responseBody:a,data:l,isRetryable:n?.(o,l)})}}catch{return{responseHeaders:u,value:new le({message:o.statusText,url:r,requestBodyValues:i,statusCode:o.status,responseHeaders:u,responseBody:a,isRetryable:n?.(o)})}}},rr=e=>async({response:t})=>{let n=xo(t);if(t.body==null)throw new _p({});return{responseHeaders:n,value:d0({stream:t.body,schema:e})}};var Ie=e=>async({response:t,url:n,requestBodyValues:o})=>{let r=await t.text(),i=await yt({text:r,schema:e}),a=xo(t);if(!i.success)throw new le({message:"Invalid JSON response",cause:i.error,statusCode:t.status,responseHeaders:a,responseBody:r,url:n,requestBodyValues:o});return{responseHeaders:a,value:i.value,rawValue:i.rawValue}};var f0=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join("/")},g0=Symbol("Let zodToJsonSchema decide on which parser to use"),mg={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},h0=e=>typeof e=="string"?{...mg,name:e}:{...mg,...e};function Ge(){return{}}function v0(e,t){var n,o,r;let i={type:"array"};return(n=e.type)!=null&&n._def&&((r=(o=e.type)==null?void 0:o._def)==null?void 0:r.typeName)!==C.ZodAny&&(i.items=ee(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&(i.minItems=e.minLength.value),e.maxLength&&(i.maxItems=e.maxLength.value),e.exactLength&&(i.minItems=e.exactLength.value,i.maxItems=e.exactLength.value),i}function y0(e){let t={type:"integer",format:"int64"};if(!e.checks)return t;for(let n of e.checks)switch(n.kind){case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value;break}return t}function b0(){return{type:"boolean"}}function Dg(e,t){return ee(e.type._def,t)}var _0=(e,t)=>ee(e.innerType._def,t);function wg(e,t,n){let o=n??t.dateStrategy;if(Array.isArray(o))return{anyOf:o.map((r,i)=>wg(e,t,r))};switch(o){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return x0(e)}}var x0=e=>{let t={type:"integer",format:"unix-time"};for(let n of e.checks)switch(n.kind){case"min":t.minimum=n.value;break;case"max":t.maximum=n.value;break}return t};function D0(e,t){return{...ee(e.innerType._def,t),default:e.defaultValue()}}function w0(e,t){return t.effectStrategy==="input"?ee(e.schema._def,t):Ge()}function k0(e){return{type:"string",enum:Array.from(e.values)}}var $0=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function S0(e,t){let n=[ee(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),ee(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(r=>!!r),o=[];return n.forEach(r=>{if($0(r))o.push(...r.allOf);else{let i=r;if("additionalProperties"in r&&r.additionalProperties===!1){let{additionalProperties:a,...u}=r;i=u}o.push(i)}}),o.length?{allOf:o}:void 0}function I0(e){let t=typeof e.value;return t!=="bigint"&&t!=="number"&&t!=="boolean"&&t!=="string"?{type:Array.isArray(e.value)?"array":"object"}:{type:t==="bigint"?"integer":t,const:e.value}}var td=void 0,st={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(td===void 0&&(td=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),td),uuid:/^[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}$/,ipv4:/^(?:(?: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])$/,ipv4Cidr:/^(?:(?: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])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([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])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function kg(e,t){let n={type:"string"};if(e.checks)for(let o of e.checks)switch(o.kind){case"min":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,o.value):o.value;break;case"max":n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,o.value):o.value;break;case"email":switch(t.emailStrategy){case"format:email":ut(n,"email",o.message,t);break;case"format:idn-email":ut(n,"idn-email",o.message,t);break;case"pattern:zod":Pe(n,st.email,o.message,t);break}break;case"url":ut(n,"uri",o.message,t);break;case"uuid":ut(n,"uuid",o.message,t);break;case"regex":Pe(n,o.regex,o.message,t);break;case"cuid":Pe(n,st.cuid,o.message,t);break;case"cuid2":Pe(n,st.cuid2,o.message,t);break;case"startsWith":Pe(n,RegExp(`^${rd(o.value,t)}`),o.message,t);break;case"endsWith":Pe(n,RegExp(`${rd(o.value,t)}$`),o.message,t);break;case"datetime":ut(n,"date-time",o.message,t);break;case"date":ut(n,"date",o.message,t);break;case"time":ut(n,"time",o.message,t);break;case"duration":ut(n,"duration",o.message,t);break;case"length":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,o.value):o.value,n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,o.value):o.value;break;case"includes":{Pe(n,RegExp(rd(o.value,t)),o.message,t);break}case"ip":{o.version!=="v6"&&ut(n,"ipv4",o.message,t),o.version!=="v4"&&ut(n,"ipv6",o.message,t);break}case"base64url":Pe(n,st.base64url,o.message,t);break;case"jwt":Pe(n,st.jwt,o.message,t);break;case"cidr":{o.version!=="v6"&&Pe(n,st.ipv4Cidr,o.message,t),o.version!=="v4"&&Pe(n,st.ipv6Cidr,o.message,t);break}case"emoji":Pe(n,st.emoji(),o.message,t);break;case"ulid":{Pe(n,st.ulid,o.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{ut(n,"binary",o.message,t);break}case"contentEncoding:base64":{n.contentEncoding="base64";break}case"pattern:zod":{Pe(n,st.base64,o.message,t);break}}break}case"nanoid":Pe(n,st.nanoid,o.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return n}function rd(e,t){return t.patternStrategy==="escape"?T0(e):e}var E0=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function T0(e){let t="";for(let n=0;n<e.length;n++)E0.has(e[n])||(t+="\\"),t+=e[n];return t}function ut(e,t,n,o){var r;e.format||(r=e.anyOf)!=null&&r.some(i=>i.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...n&&o.errorMessages&&{errorMessage:{format:n}}})):e.format=t}function Pe(e,t,n,o){var r;e.pattern||(r=e.allOf)!=null&&r.some(i=>i.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:fg(t,o),...n&&o.errorMessages&&{errorMessage:{pattern:n}}})):e.pattern=fg(t,o)}function fg(e,t){var n;if(!t.applyRegexFlags||!e.flags)return e.source;let o={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},r=o.i?e.source.toLowerCase():e.source,i="",a=!1,u=!1,l=!1;for(let c=0;c<r.length;c++){if(a){i+=r[c],a=!1;continue}if(o.i){if(u){if(r[c].match(/[a-z]/)){l?(i+=r[c],i+=`${r[c-2]}-${r[c]}`.toUpperCase(),l=!1):r[c+1]==="-"&&((n=r[c+2])!=null&&n.match(/[a-z]/))?(i+=r[c],l=!0):i+=`${r[c]}${r[c].toUpperCase()}`;continue}}else if(r[c].match(/[a-z]/)){i+=`[${r[c]}${r[c].toUpperCase()}]`;continue}}if(o.m){if(r[c]==="^"){i+=`(^|(?<=[\r
|
|
37
37
|
]))`;continue}else if(r[c]==="$"){i+=`($|(?=[\r
|
|
38
38
|
]))`;continue}}if(o.s&&r[c]==="."){i+=u?`${r[c]}\r
|
|
39
39
|
`:`[${r[c]}\r
|
|
40
|
-
]`;continue}i+=r[c],r[c]==="\\"?a=!0:u&&r[c]==="]"?u=!1:!u&&r[c]==="["&&(u=!0)}try{new RegExp(i)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return i}function $g(e,t){var n,o,r,i,a,u;let l={type:"object",additionalProperties:(n=ee(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?n:t.allowedAdditionalProperties};if(((o=e.keyType)==null?void 0:o._def.typeName)===C.ZodString&&((r=e.keyType._def.checks)!=null&&r.length)){let{type:c,...m}=kg(e.keyType._def,t);return{...l,propertyNames:m}}else{if(((i=e.keyType)==null?void 0:i._def.typeName)===C.ZodEnum)return{...l,propertyNames:{enum:e.keyType._def.values}};if(((a=e.keyType)==null?void 0:a._def.typeName)===C.ZodBranded&&e.keyType._def.type._def.typeName===C.ZodString&&((u=e.keyType._def.type._def.checks)!=null&&u.length)){let{type:c,...m}=Dg(e.keyType._def,t);return{...l,propertyNames:m}}}return l}function C0(e,t){if(t.mapStrategy==="record")return $g(e,t);let n=ee(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Ge(),o=ee(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Ge();return{type:"array",maxItems:125,items:{type:"array",items:[n,o],minItems:2,maxItems:2}}}function A0(e){let t=e.values,o=Object.keys(e.values).filter(i=>typeof t[t[i]]!="number").map(i=>t[i]),r=Array.from(new Set(o.map(i=>typeof i)));return{type:r.length===1?r[0]==="string"?"string":"number":["string","number"],enum:o}}function P0(){return{not:Ge()}}function O0(){return{type:"null"}}var nd={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function j0(e,t){let n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(o=>o._def.typeName in nd&&(!o._def.checks||!o._def.checks.length))){let o=n.reduce((r,i)=>{let a=nd[i._def.typeName];return a&&!r.includes(a)?[...r,a]:r},[]);return{type:o.length>1?o:o[0]}}else if(n.every(o=>o._def.typeName==="ZodLiteral"&&!o.description)){let o=n.reduce((r,i)=>{let a=typeof i._def.value;switch(a){case"string":case"number":case"boolean":return[...r,a];case"bigint":return[...r,"integer"];case"object":if(i._def.value===null)return[...r,"null"];case"symbol":case"undefined":case"function":default:return r}},[]);if(o.length===n.length){let r=o.filter((i,a,u)=>u.indexOf(i)===a);return{type:r.length>1?r:r[0],enum:n.reduce((i,a)=>i.includes(a._def.value)?i:[...i,a._def.value],[])}}}else if(n.every(o=>o._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((o,r)=>[...o,...r._def.values.filter(i=>!o.includes(i))],[])};return N0(e,t)}var N0=(e,t)=>{let n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((o,r)=>ee(o._def,{...t,currentPath:[...t.currentPath,"anyOf",`${r}`]})).filter(o=>!!o&&(!t.strictUnions||typeof o=="object"&&Object.keys(o).length>0));return n.length?{anyOf:n}:void 0};function z0(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[nd[e.innerType._def.typeName],"null"]};let n=ee(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function R0(e){let t={type:"number"};if(!e.checks)return t;for(let n of e.checks)switch(n.kind){case"int":t.type="integer";break;case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value;break}return t}function F0(e,t){let n={type:"object",properties:{}},o=[],r=e.shape();for(let a in r){let u=r[a];if(u===void 0||u._def===void 0)continue;let l=U0(u),c=ee(u._def,{...t,currentPath:[...t.currentPath,"properties",a],propertyPath:[...t.currentPath,"properties",a]});c!==void 0&&(n.properties[a]=c,l||o.push(a))}o.length&&(n.required=o);let i=M0(e,t);return i!==void 0&&(n.additionalProperties=i),n}function M0(e,t){if(e.catchall._def.typeName!=="ZodNever")return ee(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function U0(e){try{return e.isOptional()}catch{return!0}}var Z0=(e,t)=>{var n;if(t.currentPath.toString()===((n=t.propertyPath)==null?void 0:n.toString()))return ee(e.innerType._def,t);let o=ee(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return o?{anyOf:[{not:Ge()},o]}:Ge()},L0=(e,t)=>{if(t.pipeStrategy==="input")return ee(e.in._def,t);if(t.pipeStrategy==="output")return ee(e.out._def,t);let n=ee(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),o=ee(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,o].filter(r=>r!==void 0)}};function B0(e,t){return ee(e.type._def,t)}function V0(e,t){let o={type:"array",uniqueItems:!0,items:ee(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&(o.minItems=e.minSize.value),e.maxSize&&(o.maxItems=e.maxSize.value),o}function q0(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((n,o)=>ee(n._def,{...t,currentPath:[...t.currentPath,"items",`${o}`]})).reduce((n,o)=>o===void 0?n:[...n,o],[]),additionalItems:ee(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((n,o)=>ee(n._def,{...t,currentPath:[...t.currentPath,"items",`${o}`]})).reduce((n,o)=>o===void 0?n:[...n,o],[])}}function J0(){return{not:Ge()}}function G0(){return Ge()}var W0=(e,t)=>ee(e.innerType._def,t),K0=(e,t,n)=>{switch(t){case C.ZodString:return kg(e,n);case C.ZodNumber:return R0(e);case C.ZodObject:return F0(e,n);case C.ZodBigInt:return y0(e);case C.ZodBoolean:return b0();case C.ZodDate:return wg(e,n);case C.ZodUndefined:return J0();case C.ZodNull:return O0();case C.ZodArray:return v0(e,n);case C.ZodUnion:case C.ZodDiscriminatedUnion:return j0(e,n);case C.ZodIntersection:return S0(e,n);case C.ZodTuple:return q0(e,n);case C.ZodRecord:return $g(e,n);case C.ZodLiteral:return I0(e);case C.ZodEnum:return k0(e);case C.ZodNativeEnum:return A0(e);case C.ZodNullable:return z0(e,n);case C.ZodOptional:return Z0(e,n);case C.ZodMap:return C0(e,n);case C.ZodSet:return V0(e,n);case C.ZodLazy:return()=>e.getter()._def;case C.ZodPromise:return B0(e,n);case C.ZodNaN:case C.ZodNever:return P0();case C.ZodEffects:return w0(e,n);case C.ZodAny:return Ge();case C.ZodUnknown:return G0();case C.ZodDefault:return D0(e,n);case C.ZodBranded:return Dg(e,n);case C.ZodReadonly:return W0(e,n);case C.ZodCatch:return _0(e,n);case C.ZodPipeline:return L0(e,n);case C.ZodFunction:case C.ZodVoid:case C.ZodSymbol:return;default:return(o=>{})(t)}};function ee(e,t,n=!1){var o;let r=t.seen.get(e);if(t.override){let l=(o=t.override)==null?void 0:o.call(t,e,t,r,n);if(l!==g0)return l}if(r&&!n){let l=H0(r,t);if(l!==void 0)return l}let i={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,i);let a=K0(e,e.typeName,t),u=typeof a=="function"?ee(a(),t):a;if(u&&Y0(e,t,u),t.postProcess){let l=t.postProcess(u,e,t);return i.jsonSchema=u,l}return i.jsonSchema=u,u}var H0=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:f0(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((n,o)=>t.currentPath[o]===n)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),Ge()):t.$refStrategy==="seen"?Ge():void 0}},Y0=(e,t,n)=>(e.description&&(n.description=e.description),n),X0=e=>{let t=h0(e),n=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([o,r])=>[r._def,{def:r._def,path:[...t.basePath,t.definitionPath,o],jsonSchema:void 0}]))}},Q0=(e,t)=>{var n;let o=X0(t),r=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((c,[m,h])=>{var y;return{...c,[m]:(y=ee(h._def,{...o,currentPath:[...o.basePath,o.definitionPath,m]},!0))!=null?y:Ge()}},{}):void 0,i=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,a=(n=ee(e._def,i===void 0?o:{...o,currentPath:[...o.basePath,o.definitionPath,i]},!1))!=null?n:Ge(),u=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;u!==void 0&&(a.title=u);let l=i===void 0?r?{...a,[o.definitionPath]:r}:a:{$ref:[...o.$refStrategy==="relative"?[]:o.basePath,o.definitionPath,i].join("/"),[o.definitionPath]:{...r,[i]:a}};return l.$schema="http://json-schema.org/draft-07/schema#",l},ek=Q0;function tk(e,t){var n;let o=(n=t?.useReferences)!=null?n:!1;return sd(ek(e,{$refStrategy:o?"root":"none"}),{validate:async r=>{let i=await e.safeParseAsync(r);return i.success?{success:!0,value:i.data}:{success:!1,error:i.error}}})}function rk(e,t){var n;let o=(n=t?.useReferences)!=null?n:!1,r=eo(e,{target:"draft-7",io:"output",reused:o?"ref":"inline"});return sd(r,{validate:async i=>{let a=await to(e,i);return a.success?{success:!0,value:a.data}:{success:!1,error:a.error}}})}function nk(e){return"_zod"in e}function ok(e,t){return nk(e)?rk(e,t):tk(e,t)}var od=Symbol.for("vercel.ai.schema");function sd(e,{validate:t}={}){return{[od]:!0,_type:void 0,[sa]:!0,jsonSchema:e,validate:t}}function ik(e){return typeof e=="object"&&e!==null&&od in e&&e[od]===!0&&"jsonSchema"in e&&"validate"in e}function fr(e){return e==null?sd({properties:{},additionalProperties:!1}):ik(e)?e:ok(e)}var{btoa:ak,atob:sk}=globalThis;function ko(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n=sk(t);return Uint8Array.from(n,o=>o.codePointAt(0))}function en(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCodePoint(e[n]);return ak(t)}function $o(e){return e instanceof Uint8Array?en(e):e}function tn(e){return e?.replace(/\/$/,"")}function uk(e){return e!=null&&typeof e[Symbol.asyncIterator]=="function"}async function*ud({execute:e,input:t,options:n}){let o=e(t,n);if(uk(o)){let r;for await(let i of o)r=i,yield{type:"preliminary",output:i};yield{type:"final",output:r}}else yield{type:"final",output:await o}}function So(e){var t,n;return(n=(t=e?.providerOptions)==null?void 0:t.openaiCompatible)!=null?n:{}}function lk(e){let t=[];for(let{role:n,content:o,...r}of e){let i=So({...r});switch(n){case"system":{t.push({role:"system",content:o,...i});break}case"user":{if(o.length===1&&o[0].type==="text"){t.push({role:"user",content:o[0].text,...So(o[0])});break}t.push({role:"user",content:o.map(a=>{let u=So(a);switch(a.type){case"text":return{type:"text",text:a.text,...u};case"file":if(a.mediaType.startsWith("image/")){let l=a.mediaType==="image/*"?"image/jpeg":a.mediaType;return{type:"image_url",image_url:{url:a.data instanceof URL?a.data.toString():`data:${l};base64,${$o(a.data)}`},...u}}else throw new De({functionality:`file part media type ${a.mediaType}`})}}),...i});break}case"assistant":{let a="",u=[];for(let l of o){let c=So(l);switch(l.type){case"text":{a+=l.text;break}case"tool-call":{u.push({id:l.toolCallId,type:"function",function:{name:l.toolName,arguments:JSON.stringify(l.input)},...c});break}}}t.push({role:"assistant",content:a,tool_calls:u.length>0?u:void 0,...i});break}case"tool":{for(let a of o){let u=a.output,l;switch(u.type){case"text":case"error-text":l=u.value;break;case"content":case"json":case"error-json":l=JSON.stringify(u.value);break}let c=So(a);t.push({role:"tool",tool_call_id:a.toolCallId,content:l,...c})}break}default:{let a=n;throw new Error(`Unsupported role: ${a}`)}}}return t}function Sg({id:e,model:t,created:n}){return{id:e??void 0,modelId:t??void 0,timestamp:n!=null?new Date(n*1e3):void 0}}function Ig(e){switch(e){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"unknown"}}var ld=s.object({user:s.string().optional(),reasoningEffort:s.string().optional()}),ck=s.object({error:s.object({message:s.string(),type:s.string().nullish(),param:s.any().nullish(),code:s.union([s.string(),s.number()]).nullish()})}),ca={errorSchema:ck,errorToMessage:e=>e.error.message};function dk({tools:e,toolChoice:t}){e=e?.length?e:void 0;let n=[];if(e==null)return{tools:void 0,toolChoice:void 0,toolWarnings:n};let o=[];for(let i of e)i.type==="provider-defined"?n.push({type:"unsupported-tool",tool:i}):o.push({type:"function",function:{name:i.name,description:i.description,parameters:i.inputSchema}});if(t==null)return{tools:o,toolChoice:void 0,toolWarnings:n};let r=t.type;switch(r){case"auto":case"none":case"required":return{tools:o,toolChoice:r,toolWarnings:n};case"tool":return{tools:o,toolChoice:{type:"function",function:{name:t.toolName}},toolWarnings:n};default:{let i=r;throw new De({functionality:`tool choice type: ${i}`})}}}var pk=class{constructor(e,t){this.specificationVersion="v2";var n,o;this.modelId=e,this.config=t;let r=(n=t.errorStructure)!=null?n:ca;this.chunkSchema=fk(r.errorSchema),this.failedResponseHandler=ke(r),this.supportsStructuredOutputs=(o=t.supportsStructuredOutputs)!=null?o:!1}get provider(){return this.config.provider}get providerOptionsName(){return this.config.provider.split(".")[0].trim()}get supportedUrls(){var e,t,n;return(n=(t=(e=this.config).supportedUrls)==null?void 0:t.call(e))!=null?n:{}}async getArgs({prompt:e,maxOutputTokens:t,temperature:n,topP:o,topK:r,frequencyPenalty:i,presencePenalty:a,providerOptions:u,stopSequences:l,responseFormat:c,seed:m,toolChoice:h,tools:y}){var p,d,f,v;let x=[],b=Object.assign((p=await Me({provider:"openai-compatible",providerOptions:u,schema:ld}))!=null?p:{},(d=await Me({provider:this.providerOptionsName,providerOptions:u,schema:ld}))!=null?d:{});r!=null&&x.push({type:"unsupported-setting",setting:"topK"}),c?.type==="json"&&c.schema!=null&&!this.supportsStructuredOutputs&&x.push({type:"unsupported-setting",setting:"responseFormat",details:"JSON response format schema is only supported with structuredOutputs"});let{tools:S,toolChoice:_,toolWarnings:O}=dk({tools:y,toolChoice:h});return{args:{model:this.modelId,user:b.user,max_tokens:t,temperature:n,top_p:o,frequency_penalty:i,presence_penalty:a,response_format:c?.type==="json"?this.supportsStructuredOutputs===!0&&c.schema!=null?{type:"json_schema",json_schema:{schema:c.schema,name:(f=c.name)!=null?f:"response",description:c.description}}:{type:"json_object"}:void 0,stop:l,seed:m,...Object.fromEntries(Object.entries((v=u?.[this.providerOptionsName])!=null?v:{}).filter(([T])=>!Object.keys(ld.shape).includes(T))),reasoning_effort:b.reasoningEffort,messages:lk(e),tools:S,tool_choice:_},warnings:[...x,...O]}}async doGenerate(e){var t,n,o,r,i,a,u,l,c,m,h,y,p,d,f,v,x;let{args:b,warnings:S}=await this.getArgs({...e}),_=JSON.stringify(b),{responseHeaders:O,value:T,rawValue:$}=await be({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:we(this.config.headers(),e.headers),body:b,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:Ie(mk),abortSignal:e.abortSignal,fetch:this.config.fetch}),k=T.choices[0],M=[],N=k.message.content;N!=null&&N.length>0&&M.push({type:"text",text:N});let U=(t=k.message.reasoning_content)!=null?t:k.message.reasoning;if(U!=null&&U.length>0&&M.push({type:"reasoning",text:U}),k.message.tool_calls!=null)for(let re of k.message.tool_calls)M.push({type:"tool-call",toolCallId:(n=re.id)!=null?n:lt(),toolName:re.function.name,input:re.function.arguments});let Q={[this.providerOptionsName]:{},...await((r=(o=this.config.metadataExtractor)==null?void 0:o.extractMetadata)==null?void 0:r.call(o,{parsedBody:$}))},ie=(i=T.usage)==null?void 0:i.completion_tokens_details;return ie?.accepted_prediction_tokens!=null&&(Q[this.providerOptionsName].acceptedPredictionTokens=ie?.accepted_prediction_tokens),ie?.rejected_prediction_tokens!=null&&(Q[this.providerOptionsName].rejectedPredictionTokens=ie?.rejected_prediction_tokens),{content:M,finishReason:Ig(k.finish_reason),usage:{inputTokens:(u=(a=T.usage)==null?void 0:a.prompt_tokens)!=null?u:void 0,outputTokens:(c=(l=T.usage)==null?void 0:l.completion_tokens)!=null?c:void 0,totalTokens:(h=(m=T.usage)==null?void 0:m.total_tokens)!=null?h:void 0,reasoningTokens:(d=(p=(y=T.usage)==null?void 0:y.completion_tokens_details)==null?void 0:p.reasoning_tokens)!=null?d:void 0,cachedInputTokens:(x=(v=(f=T.usage)==null?void 0:f.prompt_tokens_details)==null?void 0:v.cached_tokens)!=null?x:void 0},providerMetadata:Q,request:{body:_},response:{...Sg(T),headers:O,body:$},warnings:S}}async doStream(e){var t;let{args:n,warnings:o}=await this.getArgs({...e}),r={...n,stream:!0,stream_options:this.config.includeUsage?{include_usage:!0}:void 0},i=(t=this.config.metadataExtractor)==null?void 0:t.createStreamExtractor(),{responseHeaders:a,value:u}=await be({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:we(this.config.headers(),e.headers),body:r,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:rr(this.chunkSchema),abortSignal:e.abortSignal,fetch:this.config.fetch}),l=[],c="unknown",m={completionTokens:void 0,completionTokensDetails:{reasoningTokens:void 0,acceptedPredictionTokens:void 0,rejectedPredictionTokens:void 0},promptTokens:void 0,promptTokensDetails:{cachedTokens:void 0},totalTokens:void 0},h=!0,y=this.providerOptionsName,p=!1,d=!1;return{stream:u.pipeThrough(new TransformStream({start(f){f.enqueue({type:"stream-start",warnings:o})},transform(f,v){var x,b,S,_,O,T,$,k,M,N,U,Q,ie;if(e.includeRawChunks&&v.enqueue({type:"raw",rawValue:f.rawValue}),!f.success){c="error",v.enqueue({type:"error",error:f.error});return}let re=f.value;if(i?.processChunk(f.rawValue),"error"in re){c="error",v.enqueue({type:"error",error:re.error.message});return}if(h&&(h=!1,v.enqueue({type:"response-metadata",...Sg(re)})),re.usage!=null){let{prompt_tokens:me,completion_tokens:tt,total_tokens:ne,prompt_tokens_details:de,completion_tokens_details:ye}=re.usage;m.promptTokens=me??void 0,m.completionTokens=tt??void 0,m.totalTokens=ne??void 0,ye?.reasoning_tokens!=null&&(m.completionTokensDetails.reasoningTokens=ye?.reasoning_tokens),ye?.accepted_prediction_tokens!=null&&(m.completionTokensDetails.acceptedPredictionTokens=ye?.accepted_prediction_tokens),ye?.rejected_prediction_tokens!=null&&(m.completionTokensDetails.rejectedPredictionTokens=ye?.rejected_prediction_tokens),de?.cached_tokens!=null&&(m.promptTokensDetails.cachedTokens=de?.cached_tokens)}let Dt=re.choices[0];if(Dt?.finish_reason!=null&&(c=Ig(Dt.finish_reason)),Dt?.delta==null)return;let dt=Dt.delta,_r=(x=dt.reasoning_content)!=null?x:dt.reasoning;if(_r&&(p||(v.enqueue({type:"reasoning-start",id:"reasoning-0"}),p=!0),v.enqueue({type:"reasoning-delta",id:"reasoning-0",delta:_r})),dt.content&&(d||(v.enqueue({type:"text-start",id:"txt-0"}),d=!0),v.enqueue({type:"text-delta",id:"txt-0",delta:dt.content})),dt.tool_calls!=null)for(let me of dt.tool_calls){let tt=me.index;if(l[tt]==null){if(me.id==null)throw new Wa({data:me,message:"Expected 'id' to be a string."});if(((b=me.function)==null?void 0:b.name)==null)throw new Wa({data:me,message:"Expected 'function.name' to be a string."});v.enqueue({type:"tool-input-start",id:me.id,toolName:me.function.name}),l[tt]={id:me.id,type:"function",function:{name:me.function.name,arguments:(S=me.function.arguments)!=null?S:""},hasFinished:!1};let de=l[tt];((_=de.function)==null?void 0:_.name)!=null&&((O=de.function)==null?void 0:O.arguments)!=null&&(de.function.arguments.length>0&&v.enqueue({type:"tool-input-delta",id:de.id,delta:de.function.arguments}),ad(de.function.arguments)&&(v.enqueue({type:"tool-input-end",id:de.id}),v.enqueue({type:"tool-call",toolCallId:(T=de.id)!=null?T:lt(),toolName:de.function.name,input:de.function.arguments}),de.hasFinished=!0));continue}let ne=l[tt];ne.hasFinished||((($=me.function)==null?void 0:$.arguments)!=null&&(ne.function.arguments+=(M=(k=me.function)==null?void 0:k.arguments)!=null?M:""),v.enqueue({type:"tool-input-delta",id:ne.id,delta:(N=me.function.arguments)!=null?N:""}),((U=ne.function)==null?void 0:U.name)!=null&&((Q=ne.function)==null?void 0:Q.arguments)!=null&&ad(ne.function.arguments)&&(v.enqueue({type:"tool-input-end",id:ne.id}),v.enqueue({type:"tool-call",toolCallId:(ie=ne.id)!=null?ie:lt(),toolName:ne.function.name,input:ne.function.arguments}),ne.hasFinished=!0))}},flush(f){var v,x,b,S,_,O;p&&f.enqueue({type:"reasoning-end",id:"reasoning-0"}),d&&f.enqueue({type:"text-end",id:"txt-0"});for(let $ of l.filter(k=>!k.hasFinished))f.enqueue({type:"tool-input-end",id:$.id}),f.enqueue({type:"tool-call",toolCallId:(v=$.id)!=null?v:lt(),toolName:$.function.name,input:$.function.arguments});let T={[y]:{},...i?.buildMetadata()};m.completionTokensDetails.acceptedPredictionTokens!=null&&(T[y].acceptedPredictionTokens=m.completionTokensDetails.acceptedPredictionTokens),m.completionTokensDetails.rejectedPredictionTokens!=null&&(T[y].rejectedPredictionTokens=m.completionTokensDetails.rejectedPredictionTokens),f.enqueue({type:"finish",finishReason:c,usage:{inputTokens:(x=m.promptTokens)!=null?x:void 0,outputTokens:(b=m.completionTokens)!=null?b:void 0,totalTokens:(S=m.totalTokens)!=null?S:void 0,reasoningTokens:(_=m.completionTokensDetails.reasoningTokens)!=null?_:void 0,cachedInputTokens:(O=m.promptTokensDetails.cachedTokens)!=null?O:void 0},providerMetadata:T})}})),request:{body:r},response:{headers:a}}}},Ag=s.object({prompt_tokens:s.number().nullish(),completion_tokens:s.number().nullish(),total_tokens:s.number().nullish(),prompt_tokens_details:s.object({cached_tokens:s.number().nullish()}).nullish(),completion_tokens_details:s.object({reasoning_tokens:s.number().nullish(),accepted_prediction_tokens:s.number().nullish(),rejected_prediction_tokens:s.number().nullish()}).nullish()}).nullish(),mk=s.object({id:s.string().nullish(),created:s.number().nullish(),model:s.string().nullish(),choices:s.array(s.object({message:s.object({role:s.literal("assistant").nullish(),content:s.string().nullish(),reasoning_content:s.string().nullish(),reasoning:s.string().nullish(),tool_calls:s.array(s.object({id:s.string().nullish(),function:s.object({name:s.string(),arguments:s.string()})})).nullish()}),finish_reason:s.string().nullish()})),usage:Ag}),fk=e=>s.union([s.object({id:s.string().nullish(),created:s.number().nullish(),model:s.string().nullish(),choices:s.array(s.object({delta:s.object({role:s.enum(["assistant"]).nullish(),content:s.string().nullish(),reasoning_content:s.string().nullish(),reasoning:s.string().nullish(),tool_calls:s.array(s.object({index:s.number(),id:s.string().nullish(),function:s.object({name:s.string().nullish(),arguments:s.string().nullish()})})).nullish()}).nullish(),finish_reason:s.string().nullish()})),usage:Ag}),e]);function gk({prompt:e,user:t="user",assistant:n="assistant"}){let o="";e[0].role==="system"&&(o+=`${e[0].content}
|
|
40
|
+
]`;continue}i+=r[c],r[c]==="\\"?a=!0:u&&r[c]==="]"?u=!1:!u&&r[c]==="["&&(u=!0)}try{new RegExp(i)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return i}function $g(e,t){var n,o,r,i,a,u;let l={type:"object",additionalProperties:(n=ee(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?n:t.allowedAdditionalProperties};if(((o=e.keyType)==null?void 0:o._def.typeName)===C.ZodString&&((r=e.keyType._def.checks)!=null&&r.length)){let{type:c,...m}=kg(e.keyType._def,t);return{...l,propertyNames:m}}else{if(((i=e.keyType)==null?void 0:i._def.typeName)===C.ZodEnum)return{...l,propertyNames:{enum:e.keyType._def.values}};if(((a=e.keyType)==null?void 0:a._def.typeName)===C.ZodBranded&&e.keyType._def.type._def.typeName===C.ZodString&&((u=e.keyType._def.type._def.checks)!=null&&u.length)){let{type:c,...m}=Dg(e.keyType._def,t);return{...l,propertyNames:m}}}return l}function C0(e,t){if(t.mapStrategy==="record")return $g(e,t);let n=ee(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Ge(),o=ee(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Ge();return{type:"array",maxItems:125,items:{type:"array",items:[n,o],minItems:2,maxItems:2}}}function A0(e){let t=e.values,o=Object.keys(e.values).filter(i=>typeof t[t[i]]!="number").map(i=>t[i]),r=Array.from(new Set(o.map(i=>typeof i)));return{type:r.length===1?r[0]==="string"?"string":"number":["string","number"],enum:o}}function P0(){return{not:Ge()}}function O0(){return{type:"null"}}var nd={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function j0(e,t){let n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(o=>o._def.typeName in nd&&(!o._def.checks||!o._def.checks.length))){let o=n.reduce((r,i)=>{let a=nd[i._def.typeName];return a&&!r.includes(a)?[...r,a]:r},[]);return{type:o.length>1?o:o[0]}}else if(n.every(o=>o._def.typeName==="ZodLiteral"&&!o.description)){let o=n.reduce((r,i)=>{let a=typeof i._def.value;switch(a){case"string":case"number":case"boolean":return[...r,a];case"bigint":return[...r,"integer"];case"object":if(i._def.value===null)return[...r,"null"];case"symbol":case"undefined":case"function":default:return r}},[]);if(o.length===n.length){let r=o.filter((i,a,u)=>u.indexOf(i)===a);return{type:r.length>1?r:r[0],enum:n.reduce((i,a)=>i.includes(a._def.value)?i:[...i,a._def.value],[])}}}else if(n.every(o=>o._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((o,r)=>[...o,...r._def.values.filter(i=>!o.includes(i))],[])};return N0(e,t)}var N0=(e,t)=>{let n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((o,r)=>ee(o._def,{...t,currentPath:[...t.currentPath,"anyOf",`${r}`]})).filter(o=>!!o&&(!t.strictUnions||typeof o=="object"&&Object.keys(o).length>0));return n.length?{anyOf:n}:void 0};function z0(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[nd[e.innerType._def.typeName],"null"]};let n=ee(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function R0(e){let t={type:"number"};if(!e.checks)return t;for(let n of e.checks)switch(n.kind){case"int":t.type="integer";break;case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value;break}return t}function F0(e,t){let n={type:"object",properties:{}},o=[],r=e.shape();for(let a in r){let u=r[a];if(u===void 0||u._def===void 0)continue;let l=U0(u),c=ee(u._def,{...t,currentPath:[...t.currentPath,"properties",a],propertyPath:[...t.currentPath,"properties",a]});c!==void 0&&(n.properties[a]=c,l||o.push(a))}o.length&&(n.required=o);let i=M0(e,t);return i!==void 0&&(n.additionalProperties=i),n}function M0(e,t){if(e.catchall._def.typeName!=="ZodNever")return ee(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function U0(e){try{return e.isOptional()}catch{return!0}}var Z0=(e,t)=>{var n;if(t.currentPath.toString()===((n=t.propertyPath)==null?void 0:n.toString()))return ee(e.innerType._def,t);let o=ee(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return o?{anyOf:[{not:Ge()},o]}:Ge()},L0=(e,t)=>{if(t.pipeStrategy==="input")return ee(e.in._def,t);if(t.pipeStrategy==="output")return ee(e.out._def,t);let n=ee(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),o=ee(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,o].filter(r=>r!==void 0)}};function B0(e,t){return ee(e.type._def,t)}function q0(e,t){let o={type:"array",uniqueItems:!0,items:ee(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&(o.minItems=e.minSize.value),e.maxSize&&(o.maxItems=e.maxSize.value),o}function V0(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((n,o)=>ee(n._def,{...t,currentPath:[...t.currentPath,"items",`${o}`]})).reduce((n,o)=>o===void 0?n:[...n,o],[]),additionalItems:ee(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((n,o)=>ee(n._def,{...t,currentPath:[...t.currentPath,"items",`${o}`]})).reduce((n,o)=>o===void 0?n:[...n,o],[])}}function J0(){return{not:Ge()}}function G0(){return Ge()}var W0=(e,t)=>ee(e.innerType._def,t),K0=(e,t,n)=>{switch(t){case C.ZodString:return kg(e,n);case C.ZodNumber:return R0(e);case C.ZodObject:return F0(e,n);case C.ZodBigInt:return y0(e);case C.ZodBoolean:return b0();case C.ZodDate:return wg(e,n);case C.ZodUndefined:return J0();case C.ZodNull:return O0();case C.ZodArray:return v0(e,n);case C.ZodUnion:case C.ZodDiscriminatedUnion:return j0(e,n);case C.ZodIntersection:return S0(e,n);case C.ZodTuple:return V0(e,n);case C.ZodRecord:return $g(e,n);case C.ZodLiteral:return I0(e);case C.ZodEnum:return k0(e);case C.ZodNativeEnum:return A0(e);case C.ZodNullable:return z0(e,n);case C.ZodOptional:return Z0(e,n);case C.ZodMap:return C0(e,n);case C.ZodSet:return q0(e,n);case C.ZodLazy:return()=>e.getter()._def;case C.ZodPromise:return B0(e,n);case C.ZodNaN:case C.ZodNever:return P0();case C.ZodEffects:return w0(e,n);case C.ZodAny:return Ge();case C.ZodUnknown:return G0();case C.ZodDefault:return D0(e,n);case C.ZodBranded:return Dg(e,n);case C.ZodReadonly:return W0(e,n);case C.ZodCatch:return _0(e,n);case C.ZodPipeline:return L0(e,n);case C.ZodFunction:case C.ZodVoid:case C.ZodSymbol:return;default:return(o=>{})(t)}};function ee(e,t,n=!1){var o;let r=t.seen.get(e);if(t.override){let l=(o=t.override)==null?void 0:o.call(t,e,t,r,n);if(l!==g0)return l}if(r&&!n){let l=H0(r,t);if(l!==void 0)return l}let i={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,i);let a=K0(e,e.typeName,t),u=typeof a=="function"?ee(a(),t):a;if(u&&Y0(e,t,u),t.postProcess){let l=t.postProcess(u,e,t);return i.jsonSchema=u,l}return i.jsonSchema=u,u}var H0=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:f0(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((n,o)=>t.currentPath[o]===n)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),Ge()):t.$refStrategy==="seen"?Ge():void 0}},Y0=(e,t,n)=>(e.description&&(n.description=e.description),n),X0=e=>{let t=h0(e),n=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([o,r])=>[r._def,{def:r._def,path:[...t.basePath,t.definitionPath,o],jsonSchema:void 0}]))}},Q0=(e,t)=>{var n;let o=X0(t),r=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((c,[m,h])=>{var y;return{...c,[m]:(y=ee(h._def,{...o,currentPath:[...o.basePath,o.definitionPath,m]},!0))!=null?y:Ge()}},{}):void 0,i=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,a=(n=ee(e._def,i===void 0?o:{...o,currentPath:[...o.basePath,o.definitionPath,i]},!1))!=null?n:Ge(),u=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;u!==void 0&&(a.title=u);let l=i===void 0?r?{...a,[o.definitionPath]:r}:a:{$ref:[...o.$refStrategy==="relative"?[]:o.basePath,o.definitionPath,i].join("/"),[o.definitionPath]:{...r,[i]:a}};return l.$schema="http://json-schema.org/draft-07/schema#",l},ek=Q0;function tk(e,t){var n;let o=(n=t?.useReferences)!=null?n:!1;return sd(ek(e,{$refStrategy:o?"root":"none"}),{validate:async r=>{let i=await e.safeParseAsync(r);return i.success?{success:!0,value:i.data}:{success:!1,error:i.error}}})}function rk(e,t){var n;let o=(n=t?.useReferences)!=null?n:!1,r=eo(e,{target:"draft-7",io:"output",reused:o?"ref":"inline"});return sd(r,{validate:async i=>{let a=await to(e,i);return a.success?{success:!0,value:a.data}:{success:!1,error:a.error}}})}function nk(e){return"_zod"in e}function ok(e,t){return nk(e)?rk(e,t):tk(e,t)}var od=Symbol.for("vercel.ai.schema");function sd(e,{validate:t}={}){return{[od]:!0,_type:void 0,[sa]:!0,jsonSchema:e,validate:t}}function ik(e){return typeof e=="object"&&e!==null&&od in e&&e[od]===!0&&"jsonSchema"in e&&"validate"in e}function fr(e){return e==null?sd({properties:{},additionalProperties:!1}):ik(e)?e:ok(e)}var{btoa:ak,atob:sk}=globalThis;function ko(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n=sk(t);return Uint8Array.from(n,o=>o.codePointAt(0))}function en(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCodePoint(e[n]);return ak(t)}function $o(e){return e instanceof Uint8Array?en(e):e}function tn(e){return e?.replace(/\/$/,"")}function uk(e){return e!=null&&typeof e[Symbol.asyncIterator]=="function"}async function*ud({execute:e,input:t,options:n}){let o=e(t,n);if(uk(o)){let r;for await(let i of o)r=i,yield{type:"preliminary",output:i};yield{type:"final",output:r}}else yield{type:"final",output:await o}}function So(e){var t,n;return(n=(t=e?.providerOptions)==null?void 0:t.openaiCompatible)!=null?n:{}}function lk(e){let t=[];for(let{role:n,content:o,...r}of e){let i=So({...r});switch(n){case"system":{t.push({role:"system",content:o,...i});break}case"user":{if(o.length===1&&o[0].type==="text"){t.push({role:"user",content:o[0].text,...So(o[0])});break}t.push({role:"user",content:o.map(a=>{let u=So(a);switch(a.type){case"text":return{type:"text",text:a.text,...u};case"file":if(a.mediaType.startsWith("image/")){let l=a.mediaType==="image/*"?"image/jpeg":a.mediaType;return{type:"image_url",image_url:{url:a.data instanceof URL?a.data.toString():`data:${l};base64,${$o(a.data)}`},...u}}else throw new De({functionality:`file part media type ${a.mediaType}`})}}),...i});break}case"assistant":{let a="",u=[];for(let l of o){let c=So(l);switch(l.type){case"text":{a+=l.text;break}case"tool-call":{u.push({id:l.toolCallId,type:"function",function:{name:l.toolName,arguments:JSON.stringify(l.input)},...c});break}}}t.push({role:"assistant",content:a,tool_calls:u.length>0?u:void 0,...i});break}case"tool":{for(let a of o){let u=a.output,l;switch(u.type){case"text":case"error-text":l=u.value;break;case"content":case"json":case"error-json":l=JSON.stringify(u.value);break}let c=So(a);t.push({role:"tool",tool_call_id:a.toolCallId,content:l,...c})}break}default:{let a=n;throw new Error(`Unsupported role: ${a}`)}}}return t}function Sg({id:e,model:t,created:n}){return{id:e??void 0,modelId:t??void 0,timestamp:n!=null?new Date(n*1e3):void 0}}function Ig(e){switch(e){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"unknown"}}var ld=s.object({user:s.string().optional(),reasoningEffort:s.string().optional()}),ck=s.object({error:s.object({message:s.string(),type:s.string().nullish(),param:s.any().nullish(),code:s.union([s.string(),s.number()]).nullish()})}),ca={errorSchema:ck,errorToMessage:e=>e.error.message};function dk({tools:e,toolChoice:t}){e=e?.length?e:void 0;let n=[];if(e==null)return{tools:void 0,toolChoice:void 0,toolWarnings:n};let o=[];for(let i of e)i.type==="provider-defined"?n.push({type:"unsupported-tool",tool:i}):o.push({type:"function",function:{name:i.name,description:i.description,parameters:i.inputSchema}});if(t==null)return{tools:o,toolChoice:void 0,toolWarnings:n};let r=t.type;switch(r){case"auto":case"none":case"required":return{tools:o,toolChoice:r,toolWarnings:n};case"tool":return{tools:o,toolChoice:{type:"function",function:{name:t.toolName}},toolWarnings:n};default:{let i=r;throw new De({functionality:`tool choice type: ${i}`})}}}var pk=class{constructor(e,t){this.specificationVersion="v2";var n,o;this.modelId=e,this.config=t;let r=(n=t.errorStructure)!=null?n:ca;this.chunkSchema=fk(r.errorSchema),this.failedResponseHandler=ke(r),this.supportsStructuredOutputs=(o=t.supportsStructuredOutputs)!=null?o:!1}get provider(){return this.config.provider}get providerOptionsName(){return this.config.provider.split(".")[0].trim()}get supportedUrls(){var e,t,n;return(n=(t=(e=this.config).supportedUrls)==null?void 0:t.call(e))!=null?n:{}}async getArgs({prompt:e,maxOutputTokens:t,temperature:n,topP:o,topK:r,frequencyPenalty:i,presencePenalty:a,providerOptions:u,stopSequences:l,responseFormat:c,seed:m,toolChoice:h,tools:y}){var p,d,f,v;let x=[],b=Object.assign((p=await Me({provider:"openai-compatible",providerOptions:u,schema:ld}))!=null?p:{},(d=await Me({provider:this.providerOptionsName,providerOptions:u,schema:ld}))!=null?d:{});r!=null&&x.push({type:"unsupported-setting",setting:"topK"}),c?.type==="json"&&c.schema!=null&&!this.supportsStructuredOutputs&&x.push({type:"unsupported-setting",setting:"responseFormat",details:"JSON response format schema is only supported with structuredOutputs"});let{tools:S,toolChoice:_,toolWarnings:O}=dk({tools:y,toolChoice:h});return{args:{model:this.modelId,user:b.user,max_tokens:t,temperature:n,top_p:o,frequency_penalty:i,presence_penalty:a,response_format:c?.type==="json"?this.supportsStructuredOutputs===!0&&c.schema!=null?{type:"json_schema",json_schema:{schema:c.schema,name:(f=c.name)!=null?f:"response",description:c.description}}:{type:"json_object"}:void 0,stop:l,seed:m,...Object.fromEntries(Object.entries((v=u?.[this.providerOptionsName])!=null?v:{}).filter(([T])=>!Object.keys(ld.shape).includes(T))),reasoning_effort:b.reasoningEffort,messages:lk(e),tools:S,tool_choice:_},warnings:[...x,...O]}}async doGenerate(e){var t,n,o,r,i,a,u,l,c,m,h,y,p,d,f,v,x;let{args:b,warnings:S}=await this.getArgs({...e}),_=JSON.stringify(b),{responseHeaders:O,value:T,rawValue:$}=await be({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:we(this.config.headers(),e.headers),body:b,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:Ie(mk),abortSignal:e.abortSignal,fetch:this.config.fetch}),k=T.choices[0],M=[],N=k.message.content;N!=null&&N.length>0&&M.push({type:"text",text:N});let U=(t=k.message.reasoning_content)!=null?t:k.message.reasoning;if(U!=null&&U.length>0&&M.push({type:"reasoning",text:U}),k.message.tool_calls!=null)for(let re of k.message.tool_calls)M.push({type:"tool-call",toolCallId:(n=re.id)!=null?n:lt(),toolName:re.function.name,input:re.function.arguments});let Q={[this.providerOptionsName]:{},...await((r=(o=this.config.metadataExtractor)==null?void 0:o.extractMetadata)==null?void 0:r.call(o,{parsedBody:$}))},ie=(i=T.usage)==null?void 0:i.completion_tokens_details;return ie?.accepted_prediction_tokens!=null&&(Q[this.providerOptionsName].acceptedPredictionTokens=ie?.accepted_prediction_tokens),ie?.rejected_prediction_tokens!=null&&(Q[this.providerOptionsName].rejectedPredictionTokens=ie?.rejected_prediction_tokens),{content:M,finishReason:Ig(k.finish_reason),usage:{inputTokens:(u=(a=T.usage)==null?void 0:a.prompt_tokens)!=null?u:void 0,outputTokens:(c=(l=T.usage)==null?void 0:l.completion_tokens)!=null?c:void 0,totalTokens:(h=(m=T.usage)==null?void 0:m.total_tokens)!=null?h:void 0,reasoningTokens:(d=(p=(y=T.usage)==null?void 0:y.completion_tokens_details)==null?void 0:p.reasoning_tokens)!=null?d:void 0,cachedInputTokens:(x=(v=(f=T.usage)==null?void 0:f.prompt_tokens_details)==null?void 0:v.cached_tokens)!=null?x:void 0},providerMetadata:Q,request:{body:_},response:{...Sg(T),headers:O,body:$},warnings:S}}async doStream(e){var t;let{args:n,warnings:o}=await this.getArgs({...e}),r={...n,stream:!0,stream_options:this.config.includeUsage?{include_usage:!0}:void 0},i=(t=this.config.metadataExtractor)==null?void 0:t.createStreamExtractor(),{responseHeaders:a,value:u}=await be({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:we(this.config.headers(),e.headers),body:r,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:rr(this.chunkSchema),abortSignal:e.abortSignal,fetch:this.config.fetch}),l=[],c="unknown",m={completionTokens:void 0,completionTokensDetails:{reasoningTokens:void 0,acceptedPredictionTokens:void 0,rejectedPredictionTokens:void 0},promptTokens:void 0,promptTokensDetails:{cachedTokens:void 0},totalTokens:void 0},h=!0,y=this.providerOptionsName,p=!1,d=!1;return{stream:u.pipeThrough(new TransformStream({start(f){f.enqueue({type:"stream-start",warnings:o})},transform(f,v){var x,b,S,_,O,T,$,k,M,N,U,Q,ie;if(e.includeRawChunks&&v.enqueue({type:"raw",rawValue:f.rawValue}),!f.success){c="error",v.enqueue({type:"error",error:f.error});return}let re=f.value;if(i?.processChunk(f.rawValue),"error"in re){c="error",v.enqueue({type:"error",error:re.error.message});return}if(h&&(h=!1,v.enqueue({type:"response-metadata",...Sg(re)})),re.usage!=null){let{prompt_tokens:me,completion_tokens:tt,total_tokens:ne,prompt_tokens_details:de,completion_tokens_details:ye}=re.usage;m.promptTokens=me??void 0,m.completionTokens=tt??void 0,m.totalTokens=ne??void 0,ye?.reasoning_tokens!=null&&(m.completionTokensDetails.reasoningTokens=ye?.reasoning_tokens),ye?.accepted_prediction_tokens!=null&&(m.completionTokensDetails.acceptedPredictionTokens=ye?.accepted_prediction_tokens),ye?.rejected_prediction_tokens!=null&&(m.completionTokensDetails.rejectedPredictionTokens=ye?.rejected_prediction_tokens),de?.cached_tokens!=null&&(m.promptTokensDetails.cachedTokens=de?.cached_tokens)}let Dt=re.choices[0];if(Dt?.finish_reason!=null&&(c=Ig(Dt.finish_reason)),Dt?.delta==null)return;let dt=Dt.delta,_r=(x=dt.reasoning_content)!=null?x:dt.reasoning;if(_r&&(p||(v.enqueue({type:"reasoning-start",id:"reasoning-0"}),p=!0),v.enqueue({type:"reasoning-delta",id:"reasoning-0",delta:_r})),dt.content&&(d||(v.enqueue({type:"text-start",id:"txt-0"}),d=!0),v.enqueue({type:"text-delta",id:"txt-0",delta:dt.content})),dt.tool_calls!=null)for(let me of dt.tool_calls){let tt=me.index;if(l[tt]==null){if(me.id==null)throw new Wa({data:me,message:"Expected 'id' to be a string."});if(((b=me.function)==null?void 0:b.name)==null)throw new Wa({data:me,message:"Expected 'function.name' to be a string."});v.enqueue({type:"tool-input-start",id:me.id,toolName:me.function.name}),l[tt]={id:me.id,type:"function",function:{name:me.function.name,arguments:(S=me.function.arguments)!=null?S:""},hasFinished:!1};let de=l[tt];((_=de.function)==null?void 0:_.name)!=null&&((O=de.function)==null?void 0:O.arguments)!=null&&(de.function.arguments.length>0&&v.enqueue({type:"tool-input-delta",id:de.id,delta:de.function.arguments}),ad(de.function.arguments)&&(v.enqueue({type:"tool-input-end",id:de.id}),v.enqueue({type:"tool-call",toolCallId:(T=de.id)!=null?T:lt(),toolName:de.function.name,input:de.function.arguments}),de.hasFinished=!0));continue}let ne=l[tt];ne.hasFinished||((($=me.function)==null?void 0:$.arguments)!=null&&(ne.function.arguments+=(M=(k=me.function)==null?void 0:k.arguments)!=null?M:""),v.enqueue({type:"tool-input-delta",id:ne.id,delta:(N=me.function.arguments)!=null?N:""}),((U=ne.function)==null?void 0:U.name)!=null&&((Q=ne.function)==null?void 0:Q.arguments)!=null&&ad(ne.function.arguments)&&(v.enqueue({type:"tool-input-end",id:ne.id}),v.enqueue({type:"tool-call",toolCallId:(ie=ne.id)!=null?ie:lt(),toolName:ne.function.name,input:ne.function.arguments}),ne.hasFinished=!0))}},flush(f){var v,x,b,S,_,O;p&&f.enqueue({type:"reasoning-end",id:"reasoning-0"}),d&&f.enqueue({type:"text-end",id:"txt-0"});for(let $ of l.filter(k=>!k.hasFinished))f.enqueue({type:"tool-input-end",id:$.id}),f.enqueue({type:"tool-call",toolCallId:(v=$.id)!=null?v:lt(),toolName:$.function.name,input:$.function.arguments});let T={[y]:{},...i?.buildMetadata()};m.completionTokensDetails.acceptedPredictionTokens!=null&&(T[y].acceptedPredictionTokens=m.completionTokensDetails.acceptedPredictionTokens),m.completionTokensDetails.rejectedPredictionTokens!=null&&(T[y].rejectedPredictionTokens=m.completionTokensDetails.rejectedPredictionTokens),f.enqueue({type:"finish",finishReason:c,usage:{inputTokens:(x=m.promptTokens)!=null?x:void 0,outputTokens:(b=m.completionTokens)!=null?b:void 0,totalTokens:(S=m.totalTokens)!=null?S:void 0,reasoningTokens:(_=m.completionTokensDetails.reasoningTokens)!=null?_:void 0,cachedInputTokens:(O=m.promptTokensDetails.cachedTokens)!=null?O:void 0},providerMetadata:T})}})),request:{body:r},response:{headers:a}}}},Ag=s.object({prompt_tokens:s.number().nullish(),completion_tokens:s.number().nullish(),total_tokens:s.number().nullish(),prompt_tokens_details:s.object({cached_tokens:s.number().nullish()}).nullish(),completion_tokens_details:s.object({reasoning_tokens:s.number().nullish(),accepted_prediction_tokens:s.number().nullish(),rejected_prediction_tokens:s.number().nullish()}).nullish()}).nullish(),mk=s.object({id:s.string().nullish(),created:s.number().nullish(),model:s.string().nullish(),choices:s.array(s.object({message:s.object({role:s.literal("assistant").nullish(),content:s.string().nullish(),reasoning_content:s.string().nullish(),reasoning:s.string().nullish(),tool_calls:s.array(s.object({id:s.string().nullish(),function:s.object({name:s.string(),arguments:s.string()})})).nullish()}),finish_reason:s.string().nullish()})),usage:Ag}),fk=e=>s.union([s.object({id:s.string().nullish(),created:s.number().nullish(),model:s.string().nullish(),choices:s.array(s.object({delta:s.object({role:s.enum(["assistant"]).nullish(),content:s.string().nullish(),reasoning_content:s.string().nullish(),reasoning:s.string().nullish(),tool_calls:s.array(s.object({index:s.number(),id:s.string().nullish(),function:s.object({name:s.string().nullish(),arguments:s.string().nullish()})})).nullish()}).nullish(),finish_reason:s.string().nullish()})),usage:Ag}),e]);function gk({prompt:e,user:t="user",assistant:n="assistant"}){let o="";e[0].role==="system"&&(o+=`${e[0].content}
|
|
41
41
|
|
|
42
42
|
`,e=e.slice(1));for(let{role:r,content:i}of e)switch(r){case"system":throw new $t({message:"Unexpected system message in prompt: ${content}",prompt:e});case"user":{let a=i.map(u=>{switch(u.type){case"text":return u.text}}).filter(Boolean).join("");o+=`${t}:
|
|
43
43
|
${a}
|
|
@@ -47,7 +47,7 @@ ${a}
|
|
|
47
47
|
|
|
48
48
|
`;break}case"tool":throw new De({functionality:"tool messages"});default:{let a=r;throw new Error(`Unsupported role: ${a}`)}}return o+=`${n}:
|
|
49
49
|
`,{prompt:o,stopSequences:[`
|
|
50
|
-
${t}:`]}}function Eg({id:e,model:t,created:n}){return{id:e??void 0,modelId:t??void 0,timestamp:n!=null?new Date(n*1e3):void 0}}function Tg(e){switch(e){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"unknown"}}var hk=s.object({echo:s.boolean().optional(),logitBias:s.record(s.string(),s.number()).optional(),suffix:s.string().optional(),user:s.string().optional()}),vk=class{constructor(e,t){this.specificationVersion="v2";var n;this.modelId=e,this.config=t;let o=(n=t.errorStructure)!=null?n:ca;this.chunkSchema=bk(o.errorSchema),this.failedResponseHandler=ke(o)}get provider(){return this.config.provider}get providerOptionsName(){return this.config.provider.split(".")[0].trim()}get supportedUrls(){var e,t,n;return(n=(t=(e=this.config).supportedUrls)==null?void 0:t.call(e))!=null?n:{}}async getArgs({prompt:e,maxOutputTokens:t,temperature:n,topP:o,topK:r,frequencyPenalty:i,presencePenalty:a,stopSequences:u,responseFormat:l,seed:c,providerOptions:m,tools:h,toolChoice:y}){var p;let d=[],f=(p=await Me({provider:this.providerOptionsName,providerOptions:m,schema:hk}))!=null?p:{};r!=null&&d.push({type:"unsupported-setting",setting:"topK"}),h?.length&&d.push({type:"unsupported-setting",setting:"tools"}),y!=null&&d.push({type:"unsupported-setting",setting:"toolChoice"}),l!=null&&l.type!=="text"&&d.push({type:"unsupported-setting",setting:"responseFormat",details:"JSON response format is not supported."});let{prompt:v,stopSequences:x}=gk({prompt:e}),b=[...x??[],...u??[]];return{args:{model:this.modelId,echo:f.echo,logit_bias:f.logitBias,suffix:f.suffix,user:f.user,max_tokens:t,temperature:n,top_p:o,frequency_penalty:i,presence_penalty:a,seed:c,...m?.[this.providerOptionsName],prompt:v,stop:b.length>0?b:void 0},warnings:d}}async doGenerate(e){var t,n,o,r,i,a;let{args:u,warnings:l}=await this.getArgs(e),{responseHeaders:c,value:m,rawValue:h}=await be({url:this.config.url({path:"/completions",modelId:this.modelId}),headers:we(this.config.headers(),e.headers),body:u,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:Ie(yk),abortSignal:e.abortSignal,fetch:this.config.fetch}),y=m.choices[0],p=[];return y.text!=null&&y.text.length>0&&p.push({type:"text",text:y.text}),{content:p,usage:{inputTokens:(n=(t=m.usage)==null?void 0:t.prompt_tokens)!=null?n:void 0,outputTokens:(r=(o=m.usage)==null?void 0:o.completion_tokens)!=null?r:void 0,totalTokens:(a=(i=m.usage)==null?void 0:i.total_tokens)!=null?a:void 0},finishReason:Tg(y.finish_reason),request:{body:u},response:{...Eg(m),headers:c,body:h},warnings:l}}async doStream(e){let{args:t,warnings:n}=await this.getArgs(e),o={...t,stream:!0,stream_options:this.config.includeUsage?{include_usage:!0}:void 0},{responseHeaders:r,value:i}=await be({url:this.config.url({path:"/completions",modelId:this.modelId}),headers:we(this.config.headers(),e.headers),body:o,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:rr(this.chunkSchema),abortSignal:e.abortSignal,fetch:this.config.fetch}),a="unknown",u={inputTokens:void 0,outputTokens:void 0,totalTokens:void 0},l=!0;return{stream:i.pipeThrough(new TransformStream({start(c){c.enqueue({type:"stream-start",warnings:n})},transform(c,m){var h,y,p;if(e.includeRawChunks&&m.enqueue({type:"raw",rawValue:c.rawValue}),!c.success){a="error",m.enqueue({type:"error",error:c.error});return}let d=c.value;if("error"in d){a="error",m.enqueue({type:"error",error:d.error});return}l&&(l=!1,m.enqueue({type:"response-metadata",...Eg(d)}),m.enqueue({type:"text-start",id:"0"})),d.usage!=null&&(u.inputTokens=(h=d.usage.prompt_tokens)!=null?h:void 0,u.outputTokens=(y=d.usage.completion_tokens)!=null?y:void 0,u.totalTokens=(p=d.usage.total_tokens)!=null?p:void 0);let f=d.choices[0];f?.finish_reason!=null&&(a=Tg(f.finish_reason)),f?.text!=null&&m.enqueue({type:"text-delta",id:"0",delta:f.text})},flush(c){l||c.enqueue({type:"text-end",id:"0"}),c.enqueue({type:"finish",finishReason:a,usage:u})}})),request:{body:o},response:{headers:r}}}},Pg=s.object({prompt_tokens:s.number(),completion_tokens:s.number(),total_tokens:s.number()}),yk=s.object({id:s.string().nullish(),created:s.number().nullish(),model:s.string().nullish(),choices:s.array(s.object({text:s.string(),finish_reason:s.string()})),usage:Pg.nullish()}),bk=e=>s.union([s.object({id:s.string().nullish(),created:s.number().nullish(),model:s.string().nullish(),choices:s.array(s.object({text:s.string(),finish_reason:s.string().nullish(),index:s.number()})),usage:Pg.nullish()}),e]),Cg=s.object({dimensions:s.number().optional(),user:s.string().optional()}),_k=class{constructor(e,t){this.specificationVersion="v2",this.modelId=e,this.config=t}get provider(){return this.config.provider}get maxEmbeddingsPerCall(){var e;return(e=this.config.maxEmbeddingsPerCall)!=null?e:2048}get supportsParallelCalls(){var e;return(e=this.config.supportsParallelCalls)!=null?e:!0}get providerOptionsName(){return this.config.provider.split(".")[0].trim()}async doEmbed({values:e,headers:t,abortSignal:n,providerOptions:o}){var r,i,a;let u=Object.assign((r=await Me({provider:"openai-compatible",providerOptions:o,schema:Cg}))!=null?r:{},(i=await Me({provider:this.providerOptionsName,providerOptions:o,schema:Cg}))!=null?i:{});if(e.length>this.maxEmbeddingsPerCall)throw new Lp({provider:this.provider,modelId:this.modelId,maxEmbeddingsPerCall:this.maxEmbeddingsPerCall,values:e});let{responseHeaders:l,value:c,rawValue:m}=await be({url:this.config.url({path:"/embeddings",modelId:this.modelId}),headers:we(this.config.headers(),t),body:{model:this.modelId,input:e,encoding_format:"float",dimensions:u.dimensions,user:u.user},failedResponseHandler:ke((a=this.config.errorStructure)!=null?a:ca),successfulResponseHandler:Ie(xk),abortSignal:n,fetch:this.config.fetch});return{embeddings:c.data.map(h=>h.embedding),usage:c.usage?{tokens:c.usage.prompt_tokens}:void 0,providerMetadata:c.providerMetadata,response:{headers:l,body:m}}}},xk=s.object({data:s.array(s.object({embedding:s.array(s.number())})),usage:s.object({prompt_tokens:s.number()}).nullish(),providerMetadata:s.record(s.string(),s.record(s.string(),s.any())).optional()}),Dk=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v2",this.maxImagesPerCall=10}get provider(){return this.config.provider}async doGenerate({prompt:e,n:t,size:n,aspectRatio:o,seed:r,providerOptions:i,headers:a,abortSignal:u}){var l,c,m,h,y;let p=[];o!=null&&p.push({type:"unsupported-setting",setting:"aspectRatio",details:"This model does not support aspect ratio. Use `size` instead."}),r!=null&&p.push({type:"unsupported-setting",setting:"seed"});let d=(m=(c=(l=this.config._internal)==null?void 0:l.currentDate)==null?void 0:c.call(l))!=null?m:new Date,{value:f,responseHeaders:v}=await be({url:this.config.url({path:"/images/generations",modelId:this.modelId}),headers:we(this.config.headers(),a),body:{model:this.modelId,prompt:e,n:t,size:n,...(h=i.openai)!=null?h:{},response_format:"b64_json"},failedResponseHandler:ke((y=this.config.errorStructure)!=null?y:ca),successfulResponseHandler:Ie(wk),abortSignal:u,fetch:this.config.fetch});return{images:f.data.map(x=>x.b64_json),warnings:p,response:{timestamp:d,modelId:this.modelId,headers:v}}}},wk=s.object({data:s.array(s.object({b64_json:s.string()}))}),kk="1.0.17";function Og(e){let t=tn(e.baseURL),n=e.name,o={...e.apiKey&&{Authorization:`Bearer ${e.apiKey}`},...e.headers},r=()=>Qr(o,`ai-sdk/openai-compatible/${kk}`),i=y=>({provider:`${n}.${y}`,url:({path:p})=>{let d=new URL(`${t}${p}`);return e.queryParams&&(d.search=new URLSearchParams(e.queryParams).toString()),d.toString()},headers:r,fetch:e.fetch}),a=y=>u(y),u=y=>new pk(y,{...i("chat"),includeUsage:e.includeUsage}),l=y=>new vk(y,{...i("completion"),includeUsage:e.includeUsage}),c=y=>new _k(y,{...i("embedding")}),m=y=>new Dk(y,i("image")),h=y=>a(y);return h.languageModel=a,h.chatModel=u,h.completionModel=l,h.textEmbeddingModel=c,h.imageModel=m,h}var $k=s.object({type:s.literal("error"),error:s.object({type:s.string(),message:s.string()})}),jg=ke({errorSchema:$k,errorToMessage:e=>e.error.message}),Ng=s.object({citations:s.object({enabled:s.boolean()}).optional(),title:s.string().optional(),context:s.string().optional()}),Sk=s.object({sendReasoning:s.boolean().optional(),thinking:s.object({type:s.union([s.literal("enabled"),s.literal("disabled")]),budgetTokens:s.number().optional()}).optional(),disableParallelToolUse:s.boolean().optional(),cacheControl:s.object({type:s.literal("ephemeral"),ttl:s.union([s.literal("5m"),s.literal("1h")]).optional()}).optional()});function nr(e){var t;let n=e?.anthropic;return(t=n?.cacheControl)!=null?t:n?.cache_control}var Ik=s.object({maxUses:s.number().optional(),allowedDomains:s.array(s.string()).optional(),blockedDomains:s.array(s.string()).optional(),userLocation:s.object({type:s.literal("approximate"),city:s.string().optional(),region:s.string().optional(),country:s.string().optional(),timezone:s.string().optional()}).optional()}),Fg=s.array(s.object({url:s.string(),title:s.string(),pageAge:s.string().nullable(),encryptedContent:s.string(),type:s.string()})),Ek=la({id:"anthropic.web_search_20250305",name:"web_search",inputSchema:s.object({query:s.string()}),outputSchema:Fg}),Tk=(e={})=>Ek(e);function Ck(e){return typeof e=="object"&&e!==null&&"type"in e&&e.type==="web_search_20250305"}function Ak({tools:e,toolChoice:t,disableParallelToolUse:n}){e=e?.length?e:void 0;let o=[],r=new Set;if(e==null)return{tools:void 0,toolChoice:void 0,toolWarnings:o,betas:r};let i=[];for(let u of e){if(Ck(u)){i.push(u);continue}switch(u.type){case"function":let l=nr(u.providerOptions);i.push({name:u.name,description:u.description,input_schema:u.inputSchema,cache_control:l});break;case"provider-defined":switch(u.id){case"anthropic.computer_20250124":r.add("computer-use-2025-01-24"),i.push({name:"computer",type:"computer_20250124",display_width_px:u.args.displayWidthPx,display_height_px:u.args.displayHeightPx,display_number:u.args.displayNumber});break;case"anthropic.computer_20241022":r.add("computer-use-2024-10-22"),i.push({name:"computer",type:"computer_20241022",display_width_px:u.args.displayWidthPx,display_height_px:u.args.displayHeightPx,display_number:u.args.displayNumber});break;case"anthropic.text_editor_20250124":r.add("computer-use-2025-01-24"),i.push({name:"str_replace_editor",type:"text_editor_20250124"});break;case"anthropic.text_editor_20241022":r.add("computer-use-2024-10-22"),i.push({name:"str_replace_editor",type:"text_editor_20241022"});break;case"anthropic.text_editor_20250429":r.add("computer-use-2025-01-24"),i.push({name:"str_replace_based_edit_tool",type:"text_editor_20250429"});break;case"anthropic.bash_20250124":r.add("computer-use-2025-01-24"),i.push({name:"bash",type:"bash_20250124"});break;case"anthropic.bash_20241022":r.add("computer-use-2024-10-22"),i.push({name:"bash",type:"bash_20241022"});break;case"anthropic.web_search_20250305":{let c=Ik.parse(u.args);i.push({type:"web_search_20250305",name:"web_search",max_uses:c.maxUses,allowed_domains:c.allowedDomains,blocked_domains:c.blockedDomains,user_location:c.userLocation});break}case"anthropic.code_execution_20250522":{r.add("code-execution-2025-05-22"),i.push({type:"code_execution_20250522",name:"code_execution"});break}default:o.push({type:"unsupported-tool",tool:u});break}break;default:o.push({type:"unsupported-tool",tool:u});break}}if(t==null)return{tools:i,toolChoice:n?{type:"auto",disable_parallel_tool_use:n}:void 0,toolWarnings:o,betas:r};let a=t.type;switch(a){case"auto":return{tools:i,toolChoice:{type:"auto",disable_parallel_tool_use:n},toolWarnings:o,betas:r};case"required":return{tools:i,toolChoice:{type:"any",disable_parallel_tool_use:n},toolWarnings:o,betas:r};case"none":return{tools:void 0,toolChoice:void 0,toolWarnings:o,betas:r};case"tool":return{tools:i,toolChoice:{type:"tool",name:t.toolName,disable_parallel_tool_use:n},toolWarnings:o,betas:r};default:{let u=a;throw new De({functionality:`tool choice type: ${u}`})}}}var Mg=s.object({type:s.literal("code_execution_result"),stdout:s.string(),stderr:s.string(),return_code:s.number()}),Pk=la({id:"anthropic.code_execution_20250522",name:"code_execution",inputSchema:s.object({code:s.string()}),outputSchema:Mg}),Ok=(e={})=>Pk(e);function jk(e){if(typeof e=="string")return Buffer.from(e,"base64").toString("utf-8");if(e instanceof Uint8Array)return new TextDecoder().decode(e);throw e instanceof URL?new De({functionality:"URL-based text documents are not supported for citations"}):new De({functionality:`unsupported data type for text documents: ${typeof e}`})}async function Nk({prompt:e,sendReasoning:t,warnings:n}){var o,r,i,a,u;let l=new Set,c=zk(e),m,h=[];async function y(d){var f,v;let x=await Me({provider:"anthropic",providerOptions:d,schema:Ng});return(v=(f=x?.citations)==null?void 0:f.enabled)!=null?v:!1}async function p(d){let f=await Me({provider:"anthropic",providerOptions:d,schema:Ng});return{title:f?.title,context:f?.context}}for(let d=0;d<c.length;d++){let f=c[d],v=d===c.length-1,x=f.type;switch(x){case"system":{if(m!=null)throw new De({functionality:"Multiple system messages that are separated by user/assistant messages"});m=f.messages.map(({content:b,providerOptions:S})=>({type:"text",text:b,cache_control:nr(S)}));break}case"user":{let b=[];for(let S of f.messages){let{role:_,content:O}=S;switch(_){case"user":{for(let T=0;T<O.length;T++){let $=O[T],k=T===O.length-1,M=(o=nr($.providerOptions))!=null?o:k?nr(S.providerOptions):void 0;switch($.type){case"text":{b.push({type:"text",text:$.text,cache_control:M});break}case"file":{if($.mediaType.startsWith("image/"))b.push({type:"image",source:$.data instanceof URL?{type:"url",url:$.data.toString()}:{type:"base64",media_type:$.mediaType==="image/*"?"image/jpeg":$.mediaType,data:$o($.data)},cache_control:M});else if($.mediaType==="application/pdf"){l.add("pdfs-2024-09-25");let N=await y($.providerOptions),U=await p($.providerOptions);b.push({type:"document",source:$.data instanceof URL?{type:"url",url:$.data.toString()}:{type:"base64",media_type:"application/pdf",data:$o($.data)},title:(r=U.title)!=null?r:$.filename,...U.context&&{context:U.context},...N&&{citations:{enabled:!0}},cache_control:M})}else if($.mediaType==="text/plain"){let N=await y($.providerOptions),U=await p($.providerOptions);b.push({type:"document",source:$.data instanceof URL?{type:"url",url:$.data.toString()}:{type:"text",media_type:"text/plain",data:jk($.data)},title:(i=U.title)!=null?i:$.filename,...U.context&&{context:U.context},...N&&{citations:{enabled:!0}},cache_control:M})}else throw new De({functionality:`media type: ${$.mediaType}`});break}}}break}case"tool":{for(let T=0;T<O.length;T++){let $=O[T],k=T===O.length-1,M=(a=nr($.providerOptions))!=null?a:k?nr(S.providerOptions):void 0,N=$.output,U;switch(N.type){case"content":U=N.value.map(Q=>{switch(Q.type){case"text":return{type:"text",text:Q.text,cache_control:void 0};case"media":{if(Q.mediaType.startsWith("image/"))return{type:"image",source:{type:"base64",media_type:Q.mediaType,data:Q.data},cache_control:void 0};throw new De({functionality:`media type: ${Q.mediaType}`})}}});break;case"text":case"error-text":U=N.value;break;case"json":case"error-json":default:U=JSON.stringify(N.value);break}b.push({type:"tool_result",tool_use_id:$.toolCallId,content:U,is_error:N.type==="error-text"||N.type==="error-json"?!0:void 0,cache_control:M})}break}default:{let T=_;throw new Error(`Unsupported role: ${T}`)}}}h.push({role:"user",content:b});break}case"assistant":{let b=[];for(let S=0;S<f.messages.length;S++){let _=f.messages[S],O=S===f.messages.length-1,{content:T}=_;for(let $=0;$<T.length;$++){let k=T[$],M=$===T.length-1,N=(u=nr(k.providerOptions))!=null?u:M?nr(_.providerOptions):void 0;switch(k.type){case"text":{b.push({type:"text",text:v&&O&&M?k.text.trim():k.text,cache_control:N});break}case"reasoning":{if(t){let U=await Me({provider:"anthropic",providerOptions:k.providerOptions,schema:Zk});U!=null?U.signature!=null?b.push({type:"thinking",thinking:k.text,signature:U.signature,cache_control:N}):U.redactedData!=null?b.push({type:"redacted_thinking",data:U.redactedData,cache_control:N}):n.push({type:"other",message:"unsupported reasoning metadata"}):n.push({type:"other",message:"unsupported reasoning metadata"})}else n.push({type:"other",message:"sending reasoning content is disabled for this model"});break}case"tool-call":{if(k.providerExecuted){if(k.toolName==="web_search"){b.push({type:"server_tool_use",id:k.toolCallId,name:"web_search",input:k.input,cache_control:N});break}if(k.toolName==="code_execution"){b.push({type:"server_tool_use",id:k.toolCallId,name:"code_execution",input:k.input,cache_control:N});break}n.push({type:"other",message:`provider executed tool call for tool ${k.toolName} is not supported`});break}b.push({type:"tool_use",id:k.toolCallId,name:k.toolName,input:k.input,cache_control:N});break}case"tool-result":{if(k.toolName==="web_search"){let U=k.output;if(U.type!=="json"){n.push({type:"other",message:`provider executed tool result output type ${U.type} for tool ${k.toolName} is not supported`});break}let Q=Fg.parse(U.value);b.push({type:"web_search_tool_result",tool_use_id:k.toolCallId,content:Q.map(ie=>({url:ie.url,title:ie.title,page_age:ie.pageAge,encrypted_content:ie.encryptedContent,type:ie.type})),cache_control:N});break}if(k.toolName==="code_execution"){let U=k.output;if(U.type!=="json"){n.push({type:"other",message:`provider executed tool result output type ${U.type} for tool ${k.toolName} is not supported`});break}let Q=Mg.parse(U.value);b.push({type:"code_execution_tool_result",tool_use_id:k.toolCallId,content:{type:Q.type,stdout:Q.stdout,stderr:Q.stderr,return_code:Q.return_code},cache_control:N});break}n.push({type:"other",message:`provider executed tool result for tool ${k.toolName} is not supported`});break}}}}h.push({role:"assistant",content:b});break}default:{let b=x;throw new Error(`content type: ${b}`)}}}return{prompt:{system:m,messages:h},betas:l}}function zk(e){let t=[],n;for(let o of e){let{role:r}=o;switch(r){case"system":{n?.type!=="system"&&(n={type:"system",messages:[]},t.push(n)),n.messages.push(o);break}case"assistant":{n?.type!=="assistant"&&(n={type:"assistant",messages:[]},t.push(n)),n.messages.push(o);break}case"user":{n?.type!=="user"&&(n={type:"user",messages:[]},t.push(n)),n.messages.push(o);break}case"tool":{n?.type!=="user"&&(n={type:"user",messages:[]},t.push(n)),n.messages.push(o);break}default:{let i=r;throw new Error(`Unsupported role: ${i}`)}}}return t}function zg({finishReason:e,isJsonResponseFromTool:t}){switch(e){case"pause_turn":case"end_turn":case"stop_sequence":return"stop";case"refusal":return"content-filter";case"tool_use":return t?"stop":"tool-calls";case"max_tokens":return"length";default:return"unknown"}}var Io={webSearchResult:s.object({type:s.literal("web_search_result_location"),cited_text:s.string(),url:s.string(),title:s.string(),encrypted_index:s.string()}),pageLocation:s.object({type:s.literal("page_location"),cited_text:s.string(),document_index:s.number(),document_title:s.string().nullable(),start_page_number:s.number(),end_page_number:s.number()}),charLocation:s.object({type:s.literal("char_location"),cited_text:s.string(),document_index:s.number(),document_title:s.string().nullable(),start_char_index:s.number(),end_char_index:s.number()})},Ug=s.discriminatedUnion("type",[Io.webSearchResult,Io.pageLocation,Io.charLocation]),Ej=s.discriminatedUnion("type",[Io.pageLocation,Io.charLocation]);function Rg(e,t,n,o){if(e.type==="page_location"||e.type==="char_location"){let r=Rk(e,t,n);r&&o(r)}}function Rk(e,t,n){var o;let r=t[e.document_index];if(!r)return null;let i=e.type==="page_location"?{citedText:e.cited_text,startPageNumber:e.start_page_number,endPageNumber:e.end_page_number}:{citedText:e.cited_text,startCharIndex:e.start_char_index,endCharIndex:e.end_char_index};return{type:"source",sourceType:"document",id:n(),mediaType:r.mediaType,title:(o=e.document_title)!=null?o:r.title,filename:r.filename,providerMetadata:{anthropic:i}}}var Fk=class{constructor(e,t){this.specificationVersion="v2";var n;this.modelId=e,this.config=t,this.generateId=(n=t.generateId)!=null?n:lt}supportsUrl(e){return e.protocol==="https:"}get provider(){return this.config.provider}get supportedUrls(){var e,t,n;return(n=(t=(e=this.config).supportedUrls)==null?void 0:t.call(e))!=null?n:{}}async getArgs({prompt:e,maxOutputTokens:t=4096,temperature:n,topP:o,topK:r,frequencyPenalty:i,presencePenalty:a,stopSequences:u,responseFormat:l,seed:c,tools:m,toolChoice:h,providerOptions:y}){var p,d,f;let v=[];i!=null&&v.push({type:"unsupported-setting",setting:"frequencyPenalty"}),a!=null&&v.push({type:"unsupported-setting",setting:"presencePenalty"}),c!=null&&v.push({type:"unsupported-setting",setting:"seed"}),l?.type==="json"&&(l.schema==null?v.push({type:"unsupported-setting",setting:"responseFormat",details:"JSON response format requires a schema. The response format is ignored."}):m!=null&&v.push({type:"unsupported-setting",setting:"tools",details:"JSON response format does not support tools. The provided tools are ignored."}));let x=l?.type==="json"&&l.schema!=null?{type:"function",name:"json",description:"Respond with a JSON object.",inputSchema:l.schema}:void 0,b=await Me({provider:"anthropic",providerOptions:y,schema:Sk}),{prompt:S,betas:_}=await Nk({prompt:e,sendReasoning:(p=b?.sendReasoning)!=null?p:!0,warnings:v}),O=((d=b?.thinking)==null?void 0:d.type)==="enabled",T=(f=b?.thinking)==null?void 0:f.budgetTokens,$={model:this.modelId,max_tokens:t,temperature:n,top_k:r,top_p:o,stop_sequences:u,...O&&{thinking:{type:"enabled",budget_tokens:T}},system:S.system,messages:S.messages};if(O){if(T==null)throw new De({functionality:"thinking requires a budget"});$.temperature!=null&&($.temperature=void 0,v.push({type:"unsupported-setting",setting:"temperature",details:"temperature is not supported when thinking is enabled"})),r!=null&&($.top_k=void 0,v.push({type:"unsupported-setting",setting:"topK",details:"topK is not supported when thinking is enabled"})),o!=null&&($.top_p=void 0,v.push({type:"unsupported-setting",setting:"topP",details:"topP is not supported when thinking is enabled"})),$.max_tokens=t+T}let{tools:k,toolChoice:M,toolWarnings:N,betas:U}=Ak(x!=null?{tools:[x],toolChoice:{type:"tool",toolName:x.name},disableParallelToolUse:!0}:{tools:m??[],toolChoice:h,disableParallelToolUse:b?.disableParallelToolUse});return{args:{...$,tools:k,tool_choice:M},warnings:[...v,...N],betas:new Set([..._,...U]),usesJsonResponseTool:x!=null}}async getHeaders({betas:e,headers:t}){return we(await et(this.config.headers),e.size>0?{"anthropic-beta":Array.from(e).join(",")}:{},t)}buildRequestUrl(e){var t,n,o;return(o=(n=(t=this.config).buildRequestUrl)==null?void 0:n.call(t,this.config.baseURL,e))!=null?o:`${this.config.baseURL}/messages`}transformRequestBody(e){var t,n,o;return(o=(n=(t=this.config).transformRequestBody)==null?void 0:n.call(t,e))!=null?o:e}extractCitationDocuments(e){let t=n=>{var o,r;if(n.type!=="file"||n.mediaType!=="application/pdf"&&n.mediaType!=="text/plain")return!1;let i=(o=n.providerOptions)==null?void 0:o.anthropic,a=i?.citations;return(r=a?.enabled)!=null?r:!1};return e.filter(n=>n.role==="user").flatMap(n=>n.content).filter(t).map(n=>{var o;let r=n;return{title:(o=r.filename)!=null?o:"Untitled Document",filename:r.filename,mediaType:r.mediaType}})}async doGenerate(e){var t,n,o,r,i;let{args:a,warnings:u,betas:l,usesJsonResponseTool:c}=await this.getArgs(e),m=this.extractCitationDocuments(e.prompt),{responseHeaders:h,value:y,rawValue:p}=await be({url:this.buildRequestUrl(!1),headers:await this.getHeaders({betas:l,headers:e.headers}),body:this.transformRequestBody(a),failedResponseHandler:jg,successfulResponseHandler:Ie(Mk),abortSignal:e.abortSignal,fetch:this.config.fetch}),d=[];for(let f of y.content)switch(f.type){case"text":{if(!c&&(d.push({type:"text",text:f.text}),f.citations))for(let v of f.citations)Rg(v,m,this.generateId,x=>d.push(x));break}case"thinking":{d.push({type:"reasoning",text:f.thinking,providerMetadata:{anthropic:{signature:f.signature}}});break}case"redacted_thinking":{d.push({type:"reasoning",text:"",providerMetadata:{anthropic:{redactedData:f.data}}});break}case"tool_use":{d.push(c?{type:"text",text:JSON.stringify(f.input)}:{type:"tool-call",toolCallId:f.id,toolName:f.name,input:JSON.stringify(f.input)});break}case"server_tool_use":{(f.name==="web_search"||f.name==="code_execution")&&d.push({type:"tool-call",toolCallId:f.id,toolName:f.name,input:JSON.stringify(f.input),providerExecuted:!0});break}case"web_search_tool_result":{if(Array.isArray(f.content)){d.push({type:"tool-result",toolCallId:f.tool_use_id,toolName:"web_search",result:f.content.map(v=>{var x;return{url:v.url,title:v.title,pageAge:(x=v.page_age)!=null?x:null,encryptedContent:v.encrypted_content,type:v.type}}),providerExecuted:!0});for(let v of f.content)d.push({type:"source",sourceType:"url",id:this.generateId(),url:v.url,title:v.title,providerMetadata:{anthropic:{pageAge:(t=v.page_age)!=null?t:null}}})}else d.push({type:"tool-result",toolCallId:f.tool_use_id,toolName:"web_search",isError:!0,result:{type:"web_search_tool_result_error",errorCode:f.content.error_code},providerExecuted:!0});break}case"code_execution_tool_result":{f.content.type==="code_execution_result"?d.push({type:"tool-result",toolCallId:f.tool_use_id,toolName:"code_execution",result:{type:f.content.type,stdout:f.content.stdout,stderr:f.content.stderr,return_code:f.content.return_code},providerExecuted:!0}):f.content.type==="code_execution_tool_result_error"&&d.push({type:"tool-result",toolCallId:f.tool_use_id,toolName:"code_execution",isError:!0,result:{type:"code_execution_tool_result_error",errorCode:f.content.error_code},providerExecuted:!0});break}}return{content:d,finishReason:zg({finishReason:y.stop_reason,isJsonResponseFromTool:c}),usage:{inputTokens:y.usage.input_tokens,outputTokens:y.usage.output_tokens,totalTokens:y.usage.input_tokens+y.usage.output_tokens,cachedInputTokens:(n=y.usage.cache_read_input_tokens)!=null?n:void 0},request:{body:a},response:{id:(o=y.id)!=null?o:void 0,modelId:(r=y.model)!=null?r:void 0,headers:h,body:p},warnings:u,providerMetadata:{anthropic:{usage:y.usage,cacheCreationInputTokens:(i=y.usage.cache_creation_input_tokens)!=null?i:null}}}}async doStream(e){let{args:t,warnings:n,betas:o,usesJsonResponseTool:r}=await this.getArgs(e),i=this.extractCitationDocuments(e.prompt),a={...t,stream:!0},{responseHeaders:u,value:l}=await be({url:this.buildRequestUrl(!0),headers:await this.getHeaders({betas:o,headers:e.headers}),body:this.transformRequestBody(a),failedResponseHandler:jg,successfulResponseHandler:rr(Uk),abortSignal:e.abortSignal,fetch:this.config.fetch}),c="unknown",m={inputTokens:void 0,outputTokens:void 0,totalTokens:void 0},h={},y,p,d=this.generateId;return{stream:l.pipeThrough(new TransformStream({start(f){f.enqueue({type:"stream-start",warnings:n})},transform(f,v){var x,b,S,_,O,T,$;if(e.includeRawChunks&&v.enqueue({type:"raw",rawValue:f.rawValue}),!f.success){v.enqueue({type:"error",error:f.error});return}let k=f.value;switch(k.type){case"ping":return;case"content_block_start":{let M=k.content_block.type;switch(p=M,M){case"text":{h[k.index]={type:"text"},v.enqueue({type:"text-start",id:String(k.index)});return}case"thinking":{h[k.index]={type:"reasoning"},v.enqueue({type:"reasoning-start",id:String(k.index)});return}case"redacted_thinking":{h[k.index]={type:"reasoning"},v.enqueue({type:"reasoning-start",id:String(k.index),providerMetadata:{anthropic:{redactedData:k.content_block.data}}});return}case"tool_use":{h[k.index]=r?{type:"text"}:{type:"tool-call",toolCallId:k.content_block.id,toolName:k.content_block.name,input:""},v.enqueue(r?{type:"text-start",id:String(k.index)}:{type:"tool-input-start",id:k.content_block.id,toolName:k.content_block.name});return}case"server_tool_use":{(k.content_block.name==="web_search"||k.content_block.name==="code_execution")&&(h[k.index]={type:"tool-call",toolCallId:k.content_block.id,toolName:k.content_block.name,input:"",providerExecuted:!0},v.enqueue({type:"tool-input-start",id:k.content_block.id,toolName:k.content_block.name,providerExecuted:!0}));return}case"web_search_tool_result":{let N=k.content_block;if(Array.isArray(N.content)){v.enqueue({type:"tool-result",toolCallId:N.tool_use_id,toolName:"web_search",result:N.content.map(U=>{var Q;return{url:U.url,title:U.title,pageAge:(Q=U.page_age)!=null?Q:null,encryptedContent:U.encrypted_content,type:U.type}}),providerExecuted:!0});for(let U of N.content)v.enqueue({type:"source",sourceType:"url",id:d(),url:U.url,title:U.title,providerMetadata:{anthropic:{pageAge:(x=U.page_age)!=null?x:null}}})}else v.enqueue({type:"tool-result",toolCallId:N.tool_use_id,toolName:"web_search",isError:!0,result:{type:"web_search_tool_result_error",errorCode:N.content.error_code},providerExecuted:!0});return}case"code_execution_tool_result":{let N=k.content_block;N.content.type==="code_execution_result"?v.enqueue({type:"tool-result",toolCallId:N.tool_use_id,toolName:"code_execution",result:{type:N.content.type,stdout:N.content.stdout,stderr:N.content.stderr,return_code:N.content.return_code},providerExecuted:!0}):N.content.type==="code_execution_tool_result_error"&&v.enqueue({type:"tool-result",toolCallId:N.tool_use_id,toolName:"code_execution",isError:!0,result:{type:"code_execution_tool_result_error",errorCode:N.content.error_code},providerExecuted:!0});return}default:{let N=M;throw new Error(`Unsupported content block type: ${N}`)}}}case"content_block_stop":{if(h[k.index]!=null){let M=h[k.index];switch(M.type){case"text":{v.enqueue({type:"text-end",id:String(k.index)});break}case"reasoning":{v.enqueue({type:"reasoning-end",id:String(k.index)});break}case"tool-call":r||(v.enqueue({type:"tool-input-end",id:M.toolCallId}),v.enqueue(M));break}delete h[k.index]}p=void 0;return}case"content_block_delta":{let M=k.delta.type;switch(M){case"text_delta":{if(r)return;v.enqueue({type:"text-delta",id:String(k.index),delta:k.delta.text});return}case"thinking_delta":{v.enqueue({type:"reasoning-delta",id:String(k.index),delta:k.delta.thinking});return}case"signature_delta":{p==="thinking"&&v.enqueue({type:"reasoning-delta",id:String(k.index),delta:"",providerMetadata:{anthropic:{signature:k.delta.signature}}});return}case"input_json_delta":{let N=h[k.index],U=k.delta.partial_json;if(r){if(N?.type!=="text")return;v.enqueue({type:"text-delta",id:String(k.index),delta:U})}else{if(N?.type!=="tool-call")return;v.enqueue({type:"tool-input-delta",id:N.toolCallId,delta:U}),N.input+=U}return}case"citations_delta":{let N=k.delta.citation;Rg(N,i,d,U=>v.enqueue(U));return}default:{let N=M;throw new Error(`Unsupported delta type: ${N}`)}}}case"message_start":{m.inputTokens=k.message.usage.input_tokens,m.cachedInputTokens=(b=k.message.usage.cache_read_input_tokens)!=null?b:void 0,y={anthropic:{usage:k.message.usage,cacheCreationInputTokens:(S=k.message.usage.cache_creation_input_tokens)!=null?S:null}},v.enqueue({type:"response-metadata",id:(_=k.message.id)!=null?_:void 0,modelId:(O=k.message.model)!=null?O:void 0});return}case"message_delta":{m.outputTokens=k.usage.output_tokens,m.totalTokens=((T=m.inputTokens)!=null?T:0)+(($=k.usage.output_tokens)!=null?$:0),c=zg({finishReason:k.delta.stop_reason,isJsonResponseFromTool:r});return}case"message_stop":{v.enqueue({type:"finish",finishReason:c,usage:m,providerMetadata:y});return}case"error":{v.enqueue({type:"error",error:k.error});return}default:{let M=k;throw new Error(`Unsupported chunk type: ${M}`)}}}})),request:{body:a},response:{headers:u}}}},Mk=s.object({type:s.literal("message"),id:s.string().nullish(),model:s.string().nullish(),content:s.array(s.discriminatedUnion("type",[s.object({type:s.literal("text"),text:s.string(),citations:s.array(Ug).optional()}),s.object({type:s.literal("thinking"),thinking:s.string(),signature:s.string()}),s.object({type:s.literal("redacted_thinking"),data:s.string()}),s.object({type:s.literal("tool_use"),id:s.string(),name:s.string(),input:s.unknown()}),s.object({type:s.literal("server_tool_use"),id:s.string(),name:s.string(),input:s.record(s.string(),s.unknown()).nullish()}),s.object({type:s.literal("web_search_tool_result"),tool_use_id:s.string(),content:s.union([s.array(s.object({type:s.literal("web_search_result"),url:s.string(),title:s.string(),encrypted_content:s.string(),page_age:s.string().nullish()})),s.object({type:s.literal("web_search_tool_result_error"),error_code:s.string()})])}),s.object({type:s.literal("code_execution_tool_result"),tool_use_id:s.string(),content:s.union([s.object({type:s.literal("code_execution_result"),stdout:s.string(),stderr:s.string(),return_code:s.number()}),s.object({type:s.literal("code_execution_tool_result_error"),error_code:s.string()})])})])),stop_reason:s.string().nullish(),usage:s.looseObject({input_tokens:s.number(),output_tokens:s.number(),cache_creation_input_tokens:s.number().nullish(),cache_read_input_tokens:s.number().nullish()})}),Uk=s.discriminatedUnion("type",[s.object({type:s.literal("message_start"),message:s.object({id:s.string().nullish(),model:s.string().nullish(),usage:s.looseObject({input_tokens:s.number(),output_tokens:s.number(),cache_creation_input_tokens:s.number().nullish(),cache_read_input_tokens:s.number().nullish()})})}),s.object({type:s.literal("content_block_start"),index:s.number(),content_block:s.discriminatedUnion("type",[s.object({type:s.literal("text"),text:s.string()}),s.object({type:s.literal("thinking"),thinking:s.string()}),s.object({type:s.literal("tool_use"),id:s.string(),name:s.string()}),s.object({type:s.literal("redacted_thinking"),data:s.string()}),s.object({type:s.literal("server_tool_use"),id:s.string(),name:s.string(),input:s.record(s.string(),s.unknown()).nullish()}),s.object({type:s.literal("web_search_tool_result"),tool_use_id:s.string(),content:s.union([s.array(s.object({type:s.literal("web_search_result"),url:s.string(),title:s.string(),encrypted_content:s.string(),page_age:s.string().nullish()})),s.object({type:s.literal("web_search_tool_result_error"),error_code:s.string()})])}),s.object({type:s.literal("code_execution_tool_result"),tool_use_id:s.string(),content:s.union([s.object({type:s.literal("code_execution_result"),stdout:s.string(),stderr:s.string(),return_code:s.number()}),s.object({type:s.literal("code_execution_tool_result_error"),error_code:s.string()})])})])}),s.object({type:s.literal("content_block_delta"),index:s.number(),delta:s.discriminatedUnion("type",[s.object({type:s.literal("input_json_delta"),partial_json:s.string()}),s.object({type:s.literal("text_delta"),text:s.string()}),s.object({type:s.literal("thinking_delta"),thinking:s.string()}),s.object({type:s.literal("signature_delta"),signature:s.string()}),s.object({type:s.literal("citations_delta"),citation:Ug})])}),s.object({type:s.literal("content_block_stop"),index:s.number()}),s.object({type:s.literal("error"),error:s.object({type:s.string(),message:s.string()})}),s.object({type:s.literal("message_delta"),delta:s.object({stop_reason:s.string().nullish()}),usage:s.object({output_tokens:s.number()})}),s.object({type:s.literal("message_stop")}),s.object({type:s.literal("ping")})]),Zk=s.object({signature:s.string().optional(),redactedData:s.string().optional()}),Lk=Ue({id:"anthropic.bash_20241022",name:"bash",inputSchema:Xt.object({command:Xt.string(),restart:Xt.boolean().optional()})}),Bk=Ue({id:"anthropic.bash_20250124",name:"bash",inputSchema:Xt.object({command:Xt.string(),restart:Xt.boolean().optional()})}),Vk=Ue({id:"anthropic.computer_20241022",name:"computer",inputSchema:s.object({action:s.enum(["key","type","mouse_move","left_click","left_click_drag","right_click","middle_click","double_click","screenshot","cursor_position"]),coordinate:s.array(s.number().int()).optional(),text:s.string().optional()})}),qk=Ue({id:"anthropic.computer_20250124",name:"computer",inputSchema:s.object({action:s.enum(["key","hold_key","type","cursor_position","mouse_move","left_mouse_down","left_mouse_up","left_click","left_click_drag","right_click","middle_click","double_click","triple_click","scroll","wait","screenshot"]),coordinate:s.tuple([s.number().int(),s.number().int()]).optional(),duration:s.number().optional(),scroll_amount:s.number().optional(),scroll_direction:s.enum(["up","down","left","right"]).optional(),start_coordinate:s.tuple([s.number().int(),s.number().int()]).optional(),text:s.string().optional()})}),Jk=Ue({id:"anthropic.text_editor_20241022",name:"str_replace_editor",inputSchema:s.object({command:s.enum(["view","create","str_replace","insert","undo_edit"]),path:s.string(),file_text:s.string().optional(),insert_line:s.number().int().optional(),new_str:s.string().optional(),old_str:s.string().optional(),view_range:s.array(s.number().int()).optional()})}),Gk=Ue({id:"anthropic.text_editor_20250124",name:"str_replace_editor",inputSchema:s.object({command:s.enum(["view","create","str_replace","insert","undo_edit"]),path:s.string(),file_text:s.string().optional(),insert_line:s.number().int().optional(),new_str:s.string().optional(),old_str:s.string().optional(),view_range:s.array(s.number().int()).optional()})}),Wk=Ue({id:"anthropic.text_editor_20250429",name:"str_replace_based_edit_tool",inputSchema:s.object({command:s.enum(["view","create","str_replace","insert"]),path:s.string(),file_text:s.string().optional(),insert_line:s.number().int().optional(),new_str:s.string().optional(),old_str:s.string().optional(),view_range:s.array(s.number().int()).optional()})}),Kk={bash_20241022:Lk,bash_20250124:Bk,codeExecution_20250522:Ok,computer_20241022:Vk,computer_20250124:qk,textEditor_20241022:Jk,textEditor_20250124:Gk,textEditor_20250429:Wk,webSearch_20250305:Tk};function cd(e={}){var t;let n=(t=tn(e.baseURL))!=null?t:"https://api.anthropic.com/v1",o=()=>({"anthropic-version":"2023-06-01","x-api-key":xg({apiKey:e.apiKey,environmentVariableName:"ANTHROPIC_API_KEY",description:"Anthropic"}),...e.headers}),r=a=>{var u;return new Fk(a,{provider:"anthropic.messages",baseURL:n,headers:o,fetch:e.fetch,generateId:(u=e.generateId)!=null?u:lt,supportedUrls:()=>({"image/*":[/^https?:\/\/.*$/]})})},i=function(a){if(new.target)throw new Error("The Anthropic model function cannot be called with the new keyword.");return r(a)};return i.languageModel=r,i.chat=r,i.messages=r,i.textEmbeddingModel=a=>{throw new _n({modelId:a,modelType:"textEmbeddingModel"})},i.imageModel=a=>{throw new _n({modelId:a,modelType:"imageModel"})},i.tools=Kk,i}var Bj=cd();var Hk="vercel.ai.gateway.error",dd=Symbol.for(Hk),Zg,Lg,We=class lh extends(Lg=Error,Zg=dd,Lg){constructor({message:t,statusCode:n=500,cause:o}){super(t),this[Zg]=!0,this.statusCode=n,this.cause=o}static isInstance(t){return lh.hasMarker(t)}static hasMarker(t){return typeof t=="object"&&t!==null&&dd in t&&t[dd]===!0}},ch="GatewayAuthenticationError",Yk=`vercel.ai.gateway.error.${ch}`,Bg=Symbol.for(Yk),Vg,qg,To=class dh extends(qg=We,Vg=Bg,qg){constructor({message:t="Authentication failed",statusCode:n=401,cause:o}={}){super({message:t,statusCode:n,cause:o}),this[Vg]=!0,this.name=ch,this.type="authentication_error"}static isInstance(t){return We.hasMarker(t)&&Bg in t}static createContextualError({apiKeyProvided:t,oidcTokenProvided:n,message:o="Authentication failed",statusCode:r=401,cause:i}){let a;return t?a=`AI Gateway authentication failed: Invalid API key provided.
|
|
50
|
+
${t}:`]}}function Eg({id:e,model:t,created:n}){return{id:e??void 0,modelId:t??void 0,timestamp:n!=null?new Date(n*1e3):void 0}}function Tg(e){switch(e){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"unknown"}}var hk=s.object({echo:s.boolean().optional(),logitBias:s.record(s.string(),s.number()).optional(),suffix:s.string().optional(),user:s.string().optional()}),vk=class{constructor(e,t){this.specificationVersion="v2";var n;this.modelId=e,this.config=t;let o=(n=t.errorStructure)!=null?n:ca;this.chunkSchema=bk(o.errorSchema),this.failedResponseHandler=ke(o)}get provider(){return this.config.provider}get providerOptionsName(){return this.config.provider.split(".")[0].trim()}get supportedUrls(){var e,t,n;return(n=(t=(e=this.config).supportedUrls)==null?void 0:t.call(e))!=null?n:{}}async getArgs({prompt:e,maxOutputTokens:t,temperature:n,topP:o,topK:r,frequencyPenalty:i,presencePenalty:a,stopSequences:u,responseFormat:l,seed:c,providerOptions:m,tools:h,toolChoice:y}){var p;let d=[],f=(p=await Me({provider:this.providerOptionsName,providerOptions:m,schema:hk}))!=null?p:{};r!=null&&d.push({type:"unsupported-setting",setting:"topK"}),h?.length&&d.push({type:"unsupported-setting",setting:"tools"}),y!=null&&d.push({type:"unsupported-setting",setting:"toolChoice"}),l!=null&&l.type!=="text"&&d.push({type:"unsupported-setting",setting:"responseFormat",details:"JSON response format is not supported."});let{prompt:v,stopSequences:x}=gk({prompt:e}),b=[...x??[],...u??[]];return{args:{model:this.modelId,echo:f.echo,logit_bias:f.logitBias,suffix:f.suffix,user:f.user,max_tokens:t,temperature:n,top_p:o,frequency_penalty:i,presence_penalty:a,seed:c,...m?.[this.providerOptionsName],prompt:v,stop:b.length>0?b:void 0},warnings:d}}async doGenerate(e){var t,n,o,r,i,a;let{args:u,warnings:l}=await this.getArgs(e),{responseHeaders:c,value:m,rawValue:h}=await be({url:this.config.url({path:"/completions",modelId:this.modelId}),headers:we(this.config.headers(),e.headers),body:u,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:Ie(yk),abortSignal:e.abortSignal,fetch:this.config.fetch}),y=m.choices[0],p=[];return y.text!=null&&y.text.length>0&&p.push({type:"text",text:y.text}),{content:p,usage:{inputTokens:(n=(t=m.usage)==null?void 0:t.prompt_tokens)!=null?n:void 0,outputTokens:(r=(o=m.usage)==null?void 0:o.completion_tokens)!=null?r:void 0,totalTokens:(a=(i=m.usage)==null?void 0:i.total_tokens)!=null?a:void 0},finishReason:Tg(y.finish_reason),request:{body:u},response:{...Eg(m),headers:c,body:h},warnings:l}}async doStream(e){let{args:t,warnings:n}=await this.getArgs(e),o={...t,stream:!0,stream_options:this.config.includeUsage?{include_usage:!0}:void 0},{responseHeaders:r,value:i}=await be({url:this.config.url({path:"/completions",modelId:this.modelId}),headers:we(this.config.headers(),e.headers),body:o,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:rr(this.chunkSchema),abortSignal:e.abortSignal,fetch:this.config.fetch}),a="unknown",u={inputTokens:void 0,outputTokens:void 0,totalTokens:void 0},l=!0;return{stream:i.pipeThrough(new TransformStream({start(c){c.enqueue({type:"stream-start",warnings:n})},transform(c,m){var h,y,p;if(e.includeRawChunks&&m.enqueue({type:"raw",rawValue:c.rawValue}),!c.success){a="error",m.enqueue({type:"error",error:c.error});return}let d=c.value;if("error"in d){a="error",m.enqueue({type:"error",error:d.error});return}l&&(l=!1,m.enqueue({type:"response-metadata",...Eg(d)}),m.enqueue({type:"text-start",id:"0"})),d.usage!=null&&(u.inputTokens=(h=d.usage.prompt_tokens)!=null?h:void 0,u.outputTokens=(y=d.usage.completion_tokens)!=null?y:void 0,u.totalTokens=(p=d.usage.total_tokens)!=null?p:void 0);let f=d.choices[0];f?.finish_reason!=null&&(a=Tg(f.finish_reason)),f?.text!=null&&m.enqueue({type:"text-delta",id:"0",delta:f.text})},flush(c){l||c.enqueue({type:"text-end",id:"0"}),c.enqueue({type:"finish",finishReason:a,usage:u})}})),request:{body:o},response:{headers:r}}}},Pg=s.object({prompt_tokens:s.number(),completion_tokens:s.number(),total_tokens:s.number()}),yk=s.object({id:s.string().nullish(),created:s.number().nullish(),model:s.string().nullish(),choices:s.array(s.object({text:s.string(),finish_reason:s.string()})),usage:Pg.nullish()}),bk=e=>s.union([s.object({id:s.string().nullish(),created:s.number().nullish(),model:s.string().nullish(),choices:s.array(s.object({text:s.string(),finish_reason:s.string().nullish(),index:s.number()})),usage:Pg.nullish()}),e]),Cg=s.object({dimensions:s.number().optional(),user:s.string().optional()}),_k=class{constructor(e,t){this.specificationVersion="v2",this.modelId=e,this.config=t}get provider(){return this.config.provider}get maxEmbeddingsPerCall(){var e;return(e=this.config.maxEmbeddingsPerCall)!=null?e:2048}get supportsParallelCalls(){var e;return(e=this.config.supportsParallelCalls)!=null?e:!0}get providerOptionsName(){return this.config.provider.split(".")[0].trim()}async doEmbed({values:e,headers:t,abortSignal:n,providerOptions:o}){var r,i,a;let u=Object.assign((r=await Me({provider:"openai-compatible",providerOptions:o,schema:Cg}))!=null?r:{},(i=await Me({provider:this.providerOptionsName,providerOptions:o,schema:Cg}))!=null?i:{});if(e.length>this.maxEmbeddingsPerCall)throw new Lp({provider:this.provider,modelId:this.modelId,maxEmbeddingsPerCall:this.maxEmbeddingsPerCall,values:e});let{responseHeaders:l,value:c,rawValue:m}=await be({url:this.config.url({path:"/embeddings",modelId:this.modelId}),headers:we(this.config.headers(),t),body:{model:this.modelId,input:e,encoding_format:"float",dimensions:u.dimensions,user:u.user},failedResponseHandler:ke((a=this.config.errorStructure)!=null?a:ca),successfulResponseHandler:Ie(xk),abortSignal:n,fetch:this.config.fetch});return{embeddings:c.data.map(h=>h.embedding),usage:c.usage?{tokens:c.usage.prompt_tokens}:void 0,providerMetadata:c.providerMetadata,response:{headers:l,body:m}}}},xk=s.object({data:s.array(s.object({embedding:s.array(s.number())})),usage:s.object({prompt_tokens:s.number()}).nullish(),providerMetadata:s.record(s.string(),s.record(s.string(),s.any())).optional()}),Dk=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v2",this.maxImagesPerCall=10}get provider(){return this.config.provider}async doGenerate({prompt:e,n:t,size:n,aspectRatio:o,seed:r,providerOptions:i,headers:a,abortSignal:u}){var l,c,m,h,y;let p=[];o!=null&&p.push({type:"unsupported-setting",setting:"aspectRatio",details:"This model does not support aspect ratio. Use `size` instead."}),r!=null&&p.push({type:"unsupported-setting",setting:"seed"});let d=(m=(c=(l=this.config._internal)==null?void 0:l.currentDate)==null?void 0:c.call(l))!=null?m:new Date,{value:f,responseHeaders:v}=await be({url:this.config.url({path:"/images/generations",modelId:this.modelId}),headers:we(this.config.headers(),a),body:{model:this.modelId,prompt:e,n:t,size:n,...(h=i.openai)!=null?h:{},response_format:"b64_json"},failedResponseHandler:ke((y=this.config.errorStructure)!=null?y:ca),successfulResponseHandler:Ie(wk),abortSignal:u,fetch:this.config.fetch});return{images:f.data.map(x=>x.b64_json),warnings:p,response:{timestamp:d,modelId:this.modelId,headers:v}}}},wk=s.object({data:s.array(s.object({b64_json:s.string()}))}),kk="1.0.17";function Og(e){let t=tn(e.baseURL),n=e.name,o={...e.apiKey&&{Authorization:`Bearer ${e.apiKey}`},...e.headers},r=()=>Qr(o,`ai-sdk/openai-compatible/${kk}`),i=y=>({provider:`${n}.${y}`,url:({path:p})=>{let d=new URL(`${t}${p}`);return e.queryParams&&(d.search=new URLSearchParams(e.queryParams).toString()),d.toString()},headers:r,fetch:e.fetch}),a=y=>u(y),u=y=>new pk(y,{...i("chat"),includeUsage:e.includeUsage}),l=y=>new vk(y,{...i("completion"),includeUsage:e.includeUsage}),c=y=>new _k(y,{...i("embedding")}),m=y=>new Dk(y,i("image")),h=y=>a(y);return h.languageModel=a,h.chatModel=u,h.completionModel=l,h.textEmbeddingModel=c,h.imageModel=m,h}var $k=s.object({type:s.literal("error"),error:s.object({type:s.string(),message:s.string()})}),jg=ke({errorSchema:$k,errorToMessage:e=>e.error.message}),Ng=s.object({citations:s.object({enabled:s.boolean()}).optional(),title:s.string().optional(),context:s.string().optional()}),Sk=s.object({sendReasoning:s.boolean().optional(),thinking:s.object({type:s.union([s.literal("enabled"),s.literal("disabled")]),budgetTokens:s.number().optional()}).optional(),disableParallelToolUse:s.boolean().optional(),cacheControl:s.object({type:s.literal("ephemeral"),ttl:s.union([s.literal("5m"),s.literal("1h")]).optional()}).optional()});function nr(e){var t;let n=e?.anthropic;return(t=n?.cacheControl)!=null?t:n?.cache_control}var Ik=s.object({maxUses:s.number().optional(),allowedDomains:s.array(s.string()).optional(),blockedDomains:s.array(s.string()).optional(),userLocation:s.object({type:s.literal("approximate"),city:s.string().optional(),region:s.string().optional(),country:s.string().optional(),timezone:s.string().optional()}).optional()}),Fg=s.array(s.object({url:s.string(),title:s.string(),pageAge:s.string().nullable(),encryptedContent:s.string(),type:s.string()})),Ek=la({id:"anthropic.web_search_20250305",name:"web_search",inputSchema:s.object({query:s.string()}),outputSchema:Fg}),Tk=(e={})=>Ek(e);function Ck(e){return typeof e=="object"&&e!==null&&"type"in e&&e.type==="web_search_20250305"}function Ak({tools:e,toolChoice:t,disableParallelToolUse:n}){e=e?.length?e:void 0;let o=[],r=new Set;if(e==null)return{tools:void 0,toolChoice:void 0,toolWarnings:o,betas:r};let i=[];for(let u of e){if(Ck(u)){i.push(u);continue}switch(u.type){case"function":let l=nr(u.providerOptions);i.push({name:u.name,description:u.description,input_schema:u.inputSchema,cache_control:l});break;case"provider-defined":switch(u.id){case"anthropic.computer_20250124":r.add("computer-use-2025-01-24"),i.push({name:"computer",type:"computer_20250124",display_width_px:u.args.displayWidthPx,display_height_px:u.args.displayHeightPx,display_number:u.args.displayNumber});break;case"anthropic.computer_20241022":r.add("computer-use-2024-10-22"),i.push({name:"computer",type:"computer_20241022",display_width_px:u.args.displayWidthPx,display_height_px:u.args.displayHeightPx,display_number:u.args.displayNumber});break;case"anthropic.text_editor_20250124":r.add("computer-use-2025-01-24"),i.push({name:"str_replace_editor",type:"text_editor_20250124"});break;case"anthropic.text_editor_20241022":r.add("computer-use-2024-10-22"),i.push({name:"str_replace_editor",type:"text_editor_20241022"});break;case"anthropic.text_editor_20250429":r.add("computer-use-2025-01-24"),i.push({name:"str_replace_based_edit_tool",type:"text_editor_20250429"});break;case"anthropic.bash_20250124":r.add("computer-use-2025-01-24"),i.push({name:"bash",type:"bash_20250124"});break;case"anthropic.bash_20241022":r.add("computer-use-2024-10-22"),i.push({name:"bash",type:"bash_20241022"});break;case"anthropic.web_search_20250305":{let c=Ik.parse(u.args);i.push({type:"web_search_20250305",name:"web_search",max_uses:c.maxUses,allowed_domains:c.allowedDomains,blocked_domains:c.blockedDomains,user_location:c.userLocation});break}case"anthropic.code_execution_20250522":{r.add("code-execution-2025-05-22"),i.push({type:"code_execution_20250522",name:"code_execution"});break}default:o.push({type:"unsupported-tool",tool:u});break}break;default:o.push({type:"unsupported-tool",tool:u});break}}if(t==null)return{tools:i,toolChoice:n?{type:"auto",disable_parallel_tool_use:n}:void 0,toolWarnings:o,betas:r};let a=t.type;switch(a){case"auto":return{tools:i,toolChoice:{type:"auto",disable_parallel_tool_use:n},toolWarnings:o,betas:r};case"required":return{tools:i,toolChoice:{type:"any",disable_parallel_tool_use:n},toolWarnings:o,betas:r};case"none":return{tools:void 0,toolChoice:void 0,toolWarnings:o,betas:r};case"tool":return{tools:i,toolChoice:{type:"tool",name:t.toolName,disable_parallel_tool_use:n},toolWarnings:o,betas:r};default:{let u=a;throw new De({functionality:`tool choice type: ${u}`})}}}var Mg=s.object({type:s.literal("code_execution_result"),stdout:s.string(),stderr:s.string(),return_code:s.number()}),Pk=la({id:"anthropic.code_execution_20250522",name:"code_execution",inputSchema:s.object({code:s.string()}),outputSchema:Mg}),Ok=(e={})=>Pk(e);function jk(e){if(typeof e=="string")return Buffer.from(e,"base64").toString("utf-8");if(e instanceof Uint8Array)return new TextDecoder().decode(e);throw e instanceof URL?new De({functionality:"URL-based text documents are not supported for citations"}):new De({functionality:`unsupported data type for text documents: ${typeof e}`})}async function Nk({prompt:e,sendReasoning:t,warnings:n}){var o,r,i,a,u;let l=new Set,c=zk(e),m,h=[];async function y(d){var f,v;let x=await Me({provider:"anthropic",providerOptions:d,schema:Ng});return(v=(f=x?.citations)==null?void 0:f.enabled)!=null?v:!1}async function p(d){let f=await Me({provider:"anthropic",providerOptions:d,schema:Ng});return{title:f?.title,context:f?.context}}for(let d=0;d<c.length;d++){let f=c[d],v=d===c.length-1,x=f.type;switch(x){case"system":{if(m!=null)throw new De({functionality:"Multiple system messages that are separated by user/assistant messages"});m=f.messages.map(({content:b,providerOptions:S})=>({type:"text",text:b,cache_control:nr(S)}));break}case"user":{let b=[];for(let S of f.messages){let{role:_,content:O}=S;switch(_){case"user":{for(let T=0;T<O.length;T++){let $=O[T],k=T===O.length-1,M=(o=nr($.providerOptions))!=null?o:k?nr(S.providerOptions):void 0;switch($.type){case"text":{b.push({type:"text",text:$.text,cache_control:M});break}case"file":{if($.mediaType.startsWith("image/"))b.push({type:"image",source:$.data instanceof URL?{type:"url",url:$.data.toString()}:{type:"base64",media_type:$.mediaType==="image/*"?"image/jpeg":$.mediaType,data:$o($.data)},cache_control:M});else if($.mediaType==="application/pdf"){l.add("pdfs-2024-09-25");let N=await y($.providerOptions),U=await p($.providerOptions);b.push({type:"document",source:$.data instanceof URL?{type:"url",url:$.data.toString()}:{type:"base64",media_type:"application/pdf",data:$o($.data)},title:(r=U.title)!=null?r:$.filename,...U.context&&{context:U.context},...N&&{citations:{enabled:!0}},cache_control:M})}else if($.mediaType==="text/plain"){let N=await y($.providerOptions),U=await p($.providerOptions);b.push({type:"document",source:$.data instanceof URL?{type:"url",url:$.data.toString()}:{type:"text",media_type:"text/plain",data:jk($.data)},title:(i=U.title)!=null?i:$.filename,...U.context&&{context:U.context},...N&&{citations:{enabled:!0}},cache_control:M})}else throw new De({functionality:`media type: ${$.mediaType}`});break}}}break}case"tool":{for(let T=0;T<O.length;T++){let $=O[T],k=T===O.length-1,M=(a=nr($.providerOptions))!=null?a:k?nr(S.providerOptions):void 0,N=$.output,U;switch(N.type){case"content":U=N.value.map(Q=>{switch(Q.type){case"text":return{type:"text",text:Q.text,cache_control:void 0};case"media":{if(Q.mediaType.startsWith("image/"))return{type:"image",source:{type:"base64",media_type:Q.mediaType,data:Q.data},cache_control:void 0};throw new De({functionality:`media type: ${Q.mediaType}`})}}});break;case"text":case"error-text":U=N.value;break;case"json":case"error-json":default:U=JSON.stringify(N.value);break}b.push({type:"tool_result",tool_use_id:$.toolCallId,content:U,is_error:N.type==="error-text"||N.type==="error-json"?!0:void 0,cache_control:M})}break}default:{let T=_;throw new Error(`Unsupported role: ${T}`)}}}h.push({role:"user",content:b});break}case"assistant":{let b=[];for(let S=0;S<f.messages.length;S++){let _=f.messages[S],O=S===f.messages.length-1,{content:T}=_;for(let $=0;$<T.length;$++){let k=T[$],M=$===T.length-1,N=(u=nr(k.providerOptions))!=null?u:M?nr(_.providerOptions):void 0;switch(k.type){case"text":{b.push({type:"text",text:v&&O&&M?k.text.trim():k.text,cache_control:N});break}case"reasoning":{if(t){let U=await Me({provider:"anthropic",providerOptions:k.providerOptions,schema:Zk});U!=null?U.signature!=null?b.push({type:"thinking",thinking:k.text,signature:U.signature,cache_control:N}):U.redactedData!=null?b.push({type:"redacted_thinking",data:U.redactedData,cache_control:N}):n.push({type:"other",message:"unsupported reasoning metadata"}):n.push({type:"other",message:"unsupported reasoning metadata"})}else n.push({type:"other",message:"sending reasoning content is disabled for this model"});break}case"tool-call":{if(k.providerExecuted){if(k.toolName==="web_search"){b.push({type:"server_tool_use",id:k.toolCallId,name:"web_search",input:k.input,cache_control:N});break}if(k.toolName==="code_execution"){b.push({type:"server_tool_use",id:k.toolCallId,name:"code_execution",input:k.input,cache_control:N});break}n.push({type:"other",message:`provider executed tool call for tool ${k.toolName} is not supported`});break}b.push({type:"tool_use",id:k.toolCallId,name:k.toolName,input:k.input,cache_control:N});break}case"tool-result":{if(k.toolName==="web_search"){let U=k.output;if(U.type!=="json"){n.push({type:"other",message:`provider executed tool result output type ${U.type} for tool ${k.toolName} is not supported`});break}let Q=Fg.parse(U.value);b.push({type:"web_search_tool_result",tool_use_id:k.toolCallId,content:Q.map(ie=>({url:ie.url,title:ie.title,page_age:ie.pageAge,encrypted_content:ie.encryptedContent,type:ie.type})),cache_control:N});break}if(k.toolName==="code_execution"){let U=k.output;if(U.type!=="json"){n.push({type:"other",message:`provider executed tool result output type ${U.type} for tool ${k.toolName} is not supported`});break}let Q=Mg.parse(U.value);b.push({type:"code_execution_tool_result",tool_use_id:k.toolCallId,content:{type:Q.type,stdout:Q.stdout,stderr:Q.stderr,return_code:Q.return_code},cache_control:N});break}n.push({type:"other",message:`provider executed tool result for tool ${k.toolName} is not supported`});break}}}}h.push({role:"assistant",content:b});break}default:{let b=x;throw new Error(`content type: ${b}`)}}}return{prompt:{system:m,messages:h},betas:l}}function zk(e){let t=[],n;for(let o of e){let{role:r}=o;switch(r){case"system":{n?.type!=="system"&&(n={type:"system",messages:[]},t.push(n)),n.messages.push(o);break}case"assistant":{n?.type!=="assistant"&&(n={type:"assistant",messages:[]},t.push(n)),n.messages.push(o);break}case"user":{n?.type!=="user"&&(n={type:"user",messages:[]},t.push(n)),n.messages.push(o);break}case"tool":{n?.type!=="user"&&(n={type:"user",messages:[]},t.push(n)),n.messages.push(o);break}default:{let i=r;throw new Error(`Unsupported role: ${i}`)}}}return t}function zg({finishReason:e,isJsonResponseFromTool:t}){switch(e){case"pause_turn":case"end_turn":case"stop_sequence":return"stop";case"refusal":return"content-filter";case"tool_use":return t?"stop":"tool-calls";case"max_tokens":return"length";default:return"unknown"}}var Io={webSearchResult:s.object({type:s.literal("web_search_result_location"),cited_text:s.string(),url:s.string(),title:s.string(),encrypted_index:s.string()}),pageLocation:s.object({type:s.literal("page_location"),cited_text:s.string(),document_index:s.number(),document_title:s.string().nullable(),start_page_number:s.number(),end_page_number:s.number()}),charLocation:s.object({type:s.literal("char_location"),cited_text:s.string(),document_index:s.number(),document_title:s.string().nullable(),start_char_index:s.number(),end_char_index:s.number()})},Ug=s.discriminatedUnion("type",[Io.webSearchResult,Io.pageLocation,Io.charLocation]),Ej=s.discriminatedUnion("type",[Io.pageLocation,Io.charLocation]);function Rg(e,t,n,o){if(e.type==="page_location"||e.type==="char_location"){let r=Rk(e,t,n);r&&o(r)}}function Rk(e,t,n){var o;let r=t[e.document_index];if(!r)return null;let i=e.type==="page_location"?{citedText:e.cited_text,startPageNumber:e.start_page_number,endPageNumber:e.end_page_number}:{citedText:e.cited_text,startCharIndex:e.start_char_index,endCharIndex:e.end_char_index};return{type:"source",sourceType:"document",id:n(),mediaType:r.mediaType,title:(o=e.document_title)!=null?o:r.title,filename:r.filename,providerMetadata:{anthropic:i}}}var Fk=class{constructor(e,t){this.specificationVersion="v2";var n;this.modelId=e,this.config=t,this.generateId=(n=t.generateId)!=null?n:lt}supportsUrl(e){return e.protocol==="https:"}get provider(){return this.config.provider}get supportedUrls(){var e,t,n;return(n=(t=(e=this.config).supportedUrls)==null?void 0:t.call(e))!=null?n:{}}async getArgs({prompt:e,maxOutputTokens:t=4096,temperature:n,topP:o,topK:r,frequencyPenalty:i,presencePenalty:a,stopSequences:u,responseFormat:l,seed:c,tools:m,toolChoice:h,providerOptions:y}){var p,d,f;let v=[];i!=null&&v.push({type:"unsupported-setting",setting:"frequencyPenalty"}),a!=null&&v.push({type:"unsupported-setting",setting:"presencePenalty"}),c!=null&&v.push({type:"unsupported-setting",setting:"seed"}),l?.type==="json"&&(l.schema==null?v.push({type:"unsupported-setting",setting:"responseFormat",details:"JSON response format requires a schema. The response format is ignored."}):m!=null&&v.push({type:"unsupported-setting",setting:"tools",details:"JSON response format does not support tools. The provided tools are ignored."}));let x=l?.type==="json"&&l.schema!=null?{type:"function",name:"json",description:"Respond with a JSON object.",inputSchema:l.schema}:void 0,b=await Me({provider:"anthropic",providerOptions:y,schema:Sk}),{prompt:S,betas:_}=await Nk({prompt:e,sendReasoning:(p=b?.sendReasoning)!=null?p:!0,warnings:v}),O=((d=b?.thinking)==null?void 0:d.type)==="enabled",T=(f=b?.thinking)==null?void 0:f.budgetTokens,$={model:this.modelId,max_tokens:t,temperature:n,top_k:r,top_p:o,stop_sequences:u,...O&&{thinking:{type:"enabled",budget_tokens:T}},system:S.system,messages:S.messages};if(O){if(T==null)throw new De({functionality:"thinking requires a budget"});$.temperature!=null&&($.temperature=void 0,v.push({type:"unsupported-setting",setting:"temperature",details:"temperature is not supported when thinking is enabled"})),r!=null&&($.top_k=void 0,v.push({type:"unsupported-setting",setting:"topK",details:"topK is not supported when thinking is enabled"})),o!=null&&($.top_p=void 0,v.push({type:"unsupported-setting",setting:"topP",details:"topP is not supported when thinking is enabled"})),$.max_tokens=t+T}let{tools:k,toolChoice:M,toolWarnings:N,betas:U}=Ak(x!=null?{tools:[x],toolChoice:{type:"tool",toolName:x.name},disableParallelToolUse:!0}:{tools:m??[],toolChoice:h,disableParallelToolUse:b?.disableParallelToolUse});return{args:{...$,tools:k,tool_choice:M},warnings:[...v,...N],betas:new Set([..._,...U]),usesJsonResponseTool:x!=null}}async getHeaders({betas:e,headers:t}){return we(await et(this.config.headers),e.size>0?{"anthropic-beta":Array.from(e).join(",")}:{},t)}buildRequestUrl(e){var t,n,o;return(o=(n=(t=this.config).buildRequestUrl)==null?void 0:n.call(t,this.config.baseURL,e))!=null?o:`${this.config.baseURL}/messages`}transformRequestBody(e){var t,n,o;return(o=(n=(t=this.config).transformRequestBody)==null?void 0:n.call(t,e))!=null?o:e}extractCitationDocuments(e){let t=n=>{var o,r;if(n.type!=="file"||n.mediaType!=="application/pdf"&&n.mediaType!=="text/plain")return!1;let i=(o=n.providerOptions)==null?void 0:o.anthropic,a=i?.citations;return(r=a?.enabled)!=null?r:!1};return e.filter(n=>n.role==="user").flatMap(n=>n.content).filter(t).map(n=>{var o;let r=n;return{title:(o=r.filename)!=null?o:"Untitled Document",filename:r.filename,mediaType:r.mediaType}})}async doGenerate(e){var t,n,o,r,i;let{args:a,warnings:u,betas:l,usesJsonResponseTool:c}=await this.getArgs(e),m=this.extractCitationDocuments(e.prompt),{responseHeaders:h,value:y,rawValue:p}=await be({url:this.buildRequestUrl(!1),headers:await this.getHeaders({betas:l,headers:e.headers}),body:this.transformRequestBody(a),failedResponseHandler:jg,successfulResponseHandler:Ie(Mk),abortSignal:e.abortSignal,fetch:this.config.fetch}),d=[];for(let f of y.content)switch(f.type){case"text":{if(!c&&(d.push({type:"text",text:f.text}),f.citations))for(let v of f.citations)Rg(v,m,this.generateId,x=>d.push(x));break}case"thinking":{d.push({type:"reasoning",text:f.thinking,providerMetadata:{anthropic:{signature:f.signature}}});break}case"redacted_thinking":{d.push({type:"reasoning",text:"",providerMetadata:{anthropic:{redactedData:f.data}}});break}case"tool_use":{d.push(c?{type:"text",text:JSON.stringify(f.input)}:{type:"tool-call",toolCallId:f.id,toolName:f.name,input:JSON.stringify(f.input)});break}case"server_tool_use":{(f.name==="web_search"||f.name==="code_execution")&&d.push({type:"tool-call",toolCallId:f.id,toolName:f.name,input:JSON.stringify(f.input),providerExecuted:!0});break}case"web_search_tool_result":{if(Array.isArray(f.content)){d.push({type:"tool-result",toolCallId:f.tool_use_id,toolName:"web_search",result:f.content.map(v=>{var x;return{url:v.url,title:v.title,pageAge:(x=v.page_age)!=null?x:null,encryptedContent:v.encrypted_content,type:v.type}}),providerExecuted:!0});for(let v of f.content)d.push({type:"source",sourceType:"url",id:this.generateId(),url:v.url,title:v.title,providerMetadata:{anthropic:{pageAge:(t=v.page_age)!=null?t:null}}})}else d.push({type:"tool-result",toolCallId:f.tool_use_id,toolName:"web_search",isError:!0,result:{type:"web_search_tool_result_error",errorCode:f.content.error_code},providerExecuted:!0});break}case"code_execution_tool_result":{f.content.type==="code_execution_result"?d.push({type:"tool-result",toolCallId:f.tool_use_id,toolName:"code_execution",result:{type:f.content.type,stdout:f.content.stdout,stderr:f.content.stderr,return_code:f.content.return_code},providerExecuted:!0}):f.content.type==="code_execution_tool_result_error"&&d.push({type:"tool-result",toolCallId:f.tool_use_id,toolName:"code_execution",isError:!0,result:{type:"code_execution_tool_result_error",errorCode:f.content.error_code},providerExecuted:!0});break}}return{content:d,finishReason:zg({finishReason:y.stop_reason,isJsonResponseFromTool:c}),usage:{inputTokens:y.usage.input_tokens,outputTokens:y.usage.output_tokens,totalTokens:y.usage.input_tokens+y.usage.output_tokens,cachedInputTokens:(n=y.usage.cache_read_input_tokens)!=null?n:void 0},request:{body:a},response:{id:(o=y.id)!=null?o:void 0,modelId:(r=y.model)!=null?r:void 0,headers:h,body:p},warnings:u,providerMetadata:{anthropic:{usage:y.usage,cacheCreationInputTokens:(i=y.usage.cache_creation_input_tokens)!=null?i:null}}}}async doStream(e){let{args:t,warnings:n,betas:o,usesJsonResponseTool:r}=await this.getArgs(e),i=this.extractCitationDocuments(e.prompt),a={...t,stream:!0},{responseHeaders:u,value:l}=await be({url:this.buildRequestUrl(!0),headers:await this.getHeaders({betas:o,headers:e.headers}),body:this.transformRequestBody(a),failedResponseHandler:jg,successfulResponseHandler:rr(Uk),abortSignal:e.abortSignal,fetch:this.config.fetch}),c="unknown",m={inputTokens:void 0,outputTokens:void 0,totalTokens:void 0},h={},y,p,d=this.generateId;return{stream:l.pipeThrough(new TransformStream({start(f){f.enqueue({type:"stream-start",warnings:n})},transform(f,v){var x,b,S,_,O,T,$;if(e.includeRawChunks&&v.enqueue({type:"raw",rawValue:f.rawValue}),!f.success){v.enqueue({type:"error",error:f.error});return}let k=f.value;switch(k.type){case"ping":return;case"content_block_start":{let M=k.content_block.type;switch(p=M,M){case"text":{h[k.index]={type:"text"},v.enqueue({type:"text-start",id:String(k.index)});return}case"thinking":{h[k.index]={type:"reasoning"},v.enqueue({type:"reasoning-start",id:String(k.index)});return}case"redacted_thinking":{h[k.index]={type:"reasoning"},v.enqueue({type:"reasoning-start",id:String(k.index),providerMetadata:{anthropic:{redactedData:k.content_block.data}}});return}case"tool_use":{h[k.index]=r?{type:"text"}:{type:"tool-call",toolCallId:k.content_block.id,toolName:k.content_block.name,input:""},v.enqueue(r?{type:"text-start",id:String(k.index)}:{type:"tool-input-start",id:k.content_block.id,toolName:k.content_block.name});return}case"server_tool_use":{(k.content_block.name==="web_search"||k.content_block.name==="code_execution")&&(h[k.index]={type:"tool-call",toolCallId:k.content_block.id,toolName:k.content_block.name,input:"",providerExecuted:!0},v.enqueue({type:"tool-input-start",id:k.content_block.id,toolName:k.content_block.name,providerExecuted:!0}));return}case"web_search_tool_result":{let N=k.content_block;if(Array.isArray(N.content)){v.enqueue({type:"tool-result",toolCallId:N.tool_use_id,toolName:"web_search",result:N.content.map(U=>{var Q;return{url:U.url,title:U.title,pageAge:(Q=U.page_age)!=null?Q:null,encryptedContent:U.encrypted_content,type:U.type}}),providerExecuted:!0});for(let U of N.content)v.enqueue({type:"source",sourceType:"url",id:d(),url:U.url,title:U.title,providerMetadata:{anthropic:{pageAge:(x=U.page_age)!=null?x:null}}})}else v.enqueue({type:"tool-result",toolCallId:N.tool_use_id,toolName:"web_search",isError:!0,result:{type:"web_search_tool_result_error",errorCode:N.content.error_code},providerExecuted:!0});return}case"code_execution_tool_result":{let N=k.content_block;N.content.type==="code_execution_result"?v.enqueue({type:"tool-result",toolCallId:N.tool_use_id,toolName:"code_execution",result:{type:N.content.type,stdout:N.content.stdout,stderr:N.content.stderr,return_code:N.content.return_code},providerExecuted:!0}):N.content.type==="code_execution_tool_result_error"&&v.enqueue({type:"tool-result",toolCallId:N.tool_use_id,toolName:"code_execution",isError:!0,result:{type:"code_execution_tool_result_error",errorCode:N.content.error_code},providerExecuted:!0});return}default:{let N=M;throw new Error(`Unsupported content block type: ${N}`)}}}case"content_block_stop":{if(h[k.index]!=null){let M=h[k.index];switch(M.type){case"text":{v.enqueue({type:"text-end",id:String(k.index)});break}case"reasoning":{v.enqueue({type:"reasoning-end",id:String(k.index)});break}case"tool-call":r||(v.enqueue({type:"tool-input-end",id:M.toolCallId}),v.enqueue(M));break}delete h[k.index]}p=void 0;return}case"content_block_delta":{let M=k.delta.type;switch(M){case"text_delta":{if(r)return;v.enqueue({type:"text-delta",id:String(k.index),delta:k.delta.text});return}case"thinking_delta":{v.enqueue({type:"reasoning-delta",id:String(k.index),delta:k.delta.thinking});return}case"signature_delta":{p==="thinking"&&v.enqueue({type:"reasoning-delta",id:String(k.index),delta:"",providerMetadata:{anthropic:{signature:k.delta.signature}}});return}case"input_json_delta":{let N=h[k.index],U=k.delta.partial_json;if(r){if(N?.type!=="text")return;v.enqueue({type:"text-delta",id:String(k.index),delta:U})}else{if(N?.type!=="tool-call")return;v.enqueue({type:"tool-input-delta",id:N.toolCallId,delta:U}),N.input+=U}return}case"citations_delta":{let N=k.delta.citation;Rg(N,i,d,U=>v.enqueue(U));return}default:{let N=M;throw new Error(`Unsupported delta type: ${N}`)}}}case"message_start":{m.inputTokens=k.message.usage.input_tokens,m.cachedInputTokens=(b=k.message.usage.cache_read_input_tokens)!=null?b:void 0,y={anthropic:{usage:k.message.usage,cacheCreationInputTokens:(S=k.message.usage.cache_creation_input_tokens)!=null?S:null}},v.enqueue({type:"response-metadata",id:(_=k.message.id)!=null?_:void 0,modelId:(O=k.message.model)!=null?O:void 0});return}case"message_delta":{m.outputTokens=k.usage.output_tokens,m.totalTokens=((T=m.inputTokens)!=null?T:0)+(($=k.usage.output_tokens)!=null?$:0),c=zg({finishReason:k.delta.stop_reason,isJsonResponseFromTool:r});return}case"message_stop":{v.enqueue({type:"finish",finishReason:c,usage:m,providerMetadata:y});return}case"error":{v.enqueue({type:"error",error:k.error});return}default:{let M=k;throw new Error(`Unsupported chunk type: ${M}`)}}}})),request:{body:a},response:{headers:u}}}},Mk=s.object({type:s.literal("message"),id:s.string().nullish(),model:s.string().nullish(),content:s.array(s.discriminatedUnion("type",[s.object({type:s.literal("text"),text:s.string(),citations:s.array(Ug).optional()}),s.object({type:s.literal("thinking"),thinking:s.string(),signature:s.string()}),s.object({type:s.literal("redacted_thinking"),data:s.string()}),s.object({type:s.literal("tool_use"),id:s.string(),name:s.string(),input:s.unknown()}),s.object({type:s.literal("server_tool_use"),id:s.string(),name:s.string(),input:s.record(s.string(),s.unknown()).nullish()}),s.object({type:s.literal("web_search_tool_result"),tool_use_id:s.string(),content:s.union([s.array(s.object({type:s.literal("web_search_result"),url:s.string(),title:s.string(),encrypted_content:s.string(),page_age:s.string().nullish()})),s.object({type:s.literal("web_search_tool_result_error"),error_code:s.string()})])}),s.object({type:s.literal("code_execution_tool_result"),tool_use_id:s.string(),content:s.union([s.object({type:s.literal("code_execution_result"),stdout:s.string(),stderr:s.string(),return_code:s.number()}),s.object({type:s.literal("code_execution_tool_result_error"),error_code:s.string()})])})])),stop_reason:s.string().nullish(),usage:s.looseObject({input_tokens:s.number(),output_tokens:s.number(),cache_creation_input_tokens:s.number().nullish(),cache_read_input_tokens:s.number().nullish()})}),Uk=s.discriminatedUnion("type",[s.object({type:s.literal("message_start"),message:s.object({id:s.string().nullish(),model:s.string().nullish(),usage:s.looseObject({input_tokens:s.number(),output_tokens:s.number(),cache_creation_input_tokens:s.number().nullish(),cache_read_input_tokens:s.number().nullish()})})}),s.object({type:s.literal("content_block_start"),index:s.number(),content_block:s.discriminatedUnion("type",[s.object({type:s.literal("text"),text:s.string()}),s.object({type:s.literal("thinking"),thinking:s.string()}),s.object({type:s.literal("tool_use"),id:s.string(),name:s.string()}),s.object({type:s.literal("redacted_thinking"),data:s.string()}),s.object({type:s.literal("server_tool_use"),id:s.string(),name:s.string(),input:s.record(s.string(),s.unknown()).nullish()}),s.object({type:s.literal("web_search_tool_result"),tool_use_id:s.string(),content:s.union([s.array(s.object({type:s.literal("web_search_result"),url:s.string(),title:s.string(),encrypted_content:s.string(),page_age:s.string().nullish()})),s.object({type:s.literal("web_search_tool_result_error"),error_code:s.string()})])}),s.object({type:s.literal("code_execution_tool_result"),tool_use_id:s.string(),content:s.union([s.object({type:s.literal("code_execution_result"),stdout:s.string(),stderr:s.string(),return_code:s.number()}),s.object({type:s.literal("code_execution_tool_result_error"),error_code:s.string()})])})])}),s.object({type:s.literal("content_block_delta"),index:s.number(),delta:s.discriminatedUnion("type",[s.object({type:s.literal("input_json_delta"),partial_json:s.string()}),s.object({type:s.literal("text_delta"),text:s.string()}),s.object({type:s.literal("thinking_delta"),thinking:s.string()}),s.object({type:s.literal("signature_delta"),signature:s.string()}),s.object({type:s.literal("citations_delta"),citation:Ug})])}),s.object({type:s.literal("content_block_stop"),index:s.number()}),s.object({type:s.literal("error"),error:s.object({type:s.string(),message:s.string()})}),s.object({type:s.literal("message_delta"),delta:s.object({stop_reason:s.string().nullish()}),usage:s.object({output_tokens:s.number()})}),s.object({type:s.literal("message_stop")}),s.object({type:s.literal("ping")})]),Zk=s.object({signature:s.string().optional(),redactedData:s.string().optional()}),Lk=Ue({id:"anthropic.bash_20241022",name:"bash",inputSchema:Xt.object({command:Xt.string(),restart:Xt.boolean().optional()})}),Bk=Ue({id:"anthropic.bash_20250124",name:"bash",inputSchema:Xt.object({command:Xt.string(),restart:Xt.boolean().optional()})}),qk=Ue({id:"anthropic.computer_20241022",name:"computer",inputSchema:s.object({action:s.enum(["key","type","mouse_move","left_click","left_click_drag","right_click","middle_click","double_click","screenshot","cursor_position"]),coordinate:s.array(s.number().int()).optional(),text:s.string().optional()})}),Vk=Ue({id:"anthropic.computer_20250124",name:"computer",inputSchema:s.object({action:s.enum(["key","hold_key","type","cursor_position","mouse_move","left_mouse_down","left_mouse_up","left_click","left_click_drag","right_click","middle_click","double_click","triple_click","scroll","wait","screenshot"]),coordinate:s.tuple([s.number().int(),s.number().int()]).optional(),duration:s.number().optional(),scroll_amount:s.number().optional(),scroll_direction:s.enum(["up","down","left","right"]).optional(),start_coordinate:s.tuple([s.number().int(),s.number().int()]).optional(),text:s.string().optional()})}),Jk=Ue({id:"anthropic.text_editor_20241022",name:"str_replace_editor",inputSchema:s.object({command:s.enum(["view","create","str_replace","insert","undo_edit"]),path:s.string(),file_text:s.string().optional(),insert_line:s.number().int().optional(),new_str:s.string().optional(),old_str:s.string().optional(),view_range:s.array(s.number().int()).optional()})}),Gk=Ue({id:"anthropic.text_editor_20250124",name:"str_replace_editor",inputSchema:s.object({command:s.enum(["view","create","str_replace","insert","undo_edit"]),path:s.string(),file_text:s.string().optional(),insert_line:s.number().int().optional(),new_str:s.string().optional(),old_str:s.string().optional(),view_range:s.array(s.number().int()).optional()})}),Wk=Ue({id:"anthropic.text_editor_20250429",name:"str_replace_based_edit_tool",inputSchema:s.object({command:s.enum(["view","create","str_replace","insert"]),path:s.string(),file_text:s.string().optional(),insert_line:s.number().int().optional(),new_str:s.string().optional(),old_str:s.string().optional(),view_range:s.array(s.number().int()).optional()})}),Kk={bash_20241022:Lk,bash_20250124:Bk,codeExecution_20250522:Ok,computer_20241022:qk,computer_20250124:Vk,textEditor_20241022:Jk,textEditor_20250124:Gk,textEditor_20250429:Wk,webSearch_20250305:Tk};function cd(e={}){var t;let n=(t=tn(e.baseURL))!=null?t:"https://api.anthropic.com/v1",o=()=>({"anthropic-version":"2023-06-01","x-api-key":xg({apiKey:e.apiKey,environmentVariableName:"ANTHROPIC_API_KEY",description:"Anthropic"}),...e.headers}),r=a=>{var u;return new Fk(a,{provider:"anthropic.messages",baseURL:n,headers:o,fetch:e.fetch,generateId:(u=e.generateId)!=null?u:lt,supportedUrls:()=>({"image/*":[/^https?:\/\/.*$/]})})},i=function(a){if(new.target)throw new Error("The Anthropic model function cannot be called with the new keyword.");return r(a)};return i.languageModel=r,i.chat=r,i.messages=r,i.textEmbeddingModel=a=>{throw new _n({modelId:a,modelType:"textEmbeddingModel"})},i.imageModel=a=>{throw new _n({modelId:a,modelType:"imageModel"})},i.tools=Kk,i}var Bj=cd();var Hk="vercel.ai.gateway.error",dd=Symbol.for(Hk),Zg,Lg,We=class lh extends(Lg=Error,Zg=dd,Lg){constructor({message:t,statusCode:n=500,cause:o}){super(t),this[Zg]=!0,this.statusCode=n,this.cause=o}static isInstance(t){return lh.hasMarker(t)}static hasMarker(t){return typeof t=="object"&&t!==null&&dd in t&&t[dd]===!0}},ch="GatewayAuthenticationError",Yk=`vercel.ai.gateway.error.${ch}`,Bg=Symbol.for(Yk),qg,Vg,To=class dh extends(Vg=We,qg=Bg,Vg){constructor({message:t="Authentication failed",statusCode:n=401,cause:o}={}){super({message:t,statusCode:n,cause:o}),this[qg]=!0,this.name=ch,this.type="authentication_error"}static isInstance(t){return We.hasMarker(t)&&Bg in t}static createContextualError({apiKeyProvided:t,oidcTokenProvided:n,message:o="Authentication failed",statusCode:r=401,cause:i}){let a;return t?a=`AI Gateway authentication failed: Invalid API key provided.
|
|
51
51
|
|
|
52
52
|
The token is expected to be provided via the 'apiKey' option or 'AI_GATEWAY_API_KEY' environment variable.`:n?a=`AI Gateway authentication failed: Invalid OIDC token provided.
|
|
53
53
|
|
|
@@ -71,11 +71,11 @@ The token is expected to be provided via the 'VERCEL_OIDC_TOKEN' environment var
|
|
|
71
71
|
- make sure your Vercel project settings have OIDC enabled
|
|
72
72
|
- if running locally with 'vercel dev', the token is automatically obtained and refreshed
|
|
73
73
|
- if running locally with your own dev server, run 'vercel env pull' to fetch the token
|
|
74
|
-
- in production/preview, the token is automatically obtained and refreshed`,new dh({message:a,statusCode:r,cause:i})}},ph="GatewayInvalidRequestError",Xk=`vercel.ai.gateway.error.${ph}`,Jg=Symbol.for(Xk),Gg,Wg,Qk=class extends(Wg=We,Gg=Jg,Wg){constructor({message:e="Invalid request",statusCode:t=400,cause:n}={}){super({message:e,statusCode:t,cause:n}),this[Gg]=!0,this.name=ph,this.type="invalid_request_error"}static isInstance(e){return We.hasMarker(e)&&Jg in e}},mh="GatewayRateLimitError",e$=`vercel.ai.gateway.error.${mh}`,Kg=Symbol.for(e$),Hg,Yg,t$=class extends(Yg=We,Hg=Kg,Yg){constructor({message:e="Rate limit exceeded",statusCode:t=429,cause:n}={}){super({message:e,statusCode:t,cause:n}),this[Hg]=!0,this.name=mh,this.type="rate_limit_exceeded"}static isInstance(e){return We.hasMarker(e)&&Kg in e}},fh="GatewayModelNotFoundError",r$=`vercel.ai.gateway.error.${fh}`,Xg=Symbol.for(r$),n$=s.object({modelId:s.string()}),Qg,eh,pd=class extends(eh=We,Qg=Xg,eh){constructor({message:e="Model not found",statusCode:t=404,modelId:n,cause:o}={}){super({message:e,statusCode:t,cause:o}),this[Qg]=!0,this.name=fh,this.type="model_not_found",this.modelId=n}static isInstance(e){return We.hasMarker(e)&&Xg in e}},gh="GatewayInternalServerError",o$=`vercel.ai.gateway.error.${gh}`,th=Symbol.for(o$),rh,nh,oh=class extends(nh=We,rh=th,nh){constructor({message:e="Internal server error",statusCode:t=500,cause:n}={}){super({message:e,statusCode:t,cause:n}),this[rh]=!0,this.name=gh,this.type="internal_server_error"}static isInstance(e){return We.hasMarker(e)&&th in e}},hh="GatewayResponseError",i$=`vercel.ai.gateway.error.${hh}`,ih=Symbol.for(i$),ah,sh,a$=class extends(sh=We,ah=ih,sh){constructor({message:e="Invalid response from Gateway",statusCode:t=502,response:n,validationError:o,cause:r}={}){super({message:e,statusCode:t,cause:r}),this[ah]=!0,this.name=hh,this.type="response_error",this.response=n,this.validationError=o}static isInstance(e){return We.hasMarker(e)&&ih in e}};function uh({response:e,statusCode:t,defaultMessage:n="Gateway request failed",cause:o,authMethod:r}){let i=s$.safeParse(e);if(!i.success)return new a$({message:`Invalid error response format: ${n}`,statusCode:t,response:e,validationError:i.error,cause:o});let a=i.data,u=a.error.type,l=a.error.message;switch(u){case"authentication_error":return To.createContextualError({apiKeyProvided:r==="api-key",oidcTokenProvided:r==="oidc",statusCode:t,cause:o});case"invalid_request_error":return new Qk({message:l,statusCode:t,cause:o});case"rate_limit_exceeded":return new t$({message:l,statusCode:t,cause:o});case"model_not_found":{let c=n$.safeParse(a.error.param);return new pd({message:l,statusCode:t,modelId:c.success?c.data.modelId:void 0,cause:o})}case"internal_server_error":return new oh({message:l,statusCode:t,cause:o});default:return new oh({message:l,statusCode:t,cause:o})}}var s$=s.object({error:s.object({message:s.string(),type:s.string().nullish(),param:s.unknown().nullish(),code:s.union([s.string(),s.number()]).nullish()})});function Eo(e,t){var n;return We.isInstance(e)?e:le.isInstance(e)?uh({response:u$(e),statusCode:(n=e.statusCode)!=null?n:500,defaultMessage:"Gateway request failed",cause:e,authMethod:t}):uh({response:{},statusCode:500,defaultMessage:e instanceof Error?`Gateway request failed: ${e.message}`:"Unknown Gateway error",cause:e,authMethod:t})}function u$(e){if(e.data!==void 0)return e.data;if(e.responseBody!=null)try{return JSON.parse(e.responseBody)}catch{return e.responseBody}return{}}var vh="ai-gateway-auth-method";function da(e){let t=l$.safeParse(e[vh]);return t.success?t.data:void 0}var l$=s.union([s.literal("api-key"),s.literal("oidc")]),c$=class{constructor(e){this.config=e}async getAvailableModels(){try{let{value:e}=await bg({url:`${this.config.baseURL}/config`,headers:await et(this.config.headers()),successfulResponseHandler:Ie(f$),failedResponseHandler:ke({errorSchema:s.any(),errorToMessage:t=>t}),fetch:this.config.fetch});return e}catch(e){throw Eo(e)}}},d$=s.object({specificationVersion:s.literal("v2"),provider:s.string(),modelId:s.string()}),p$=s.object({input:s.string(),output:s.string(),input_cache_read:s.string().nullish(),input_cache_write:s.string().nullish()}).transform(({input:e,output:t,input_cache_read:n,input_cache_write:o})=>({input:e,output:t,...n?{cachedInputTokens:n}:{},...o?{cacheCreationInputTokens:o}:{}})),m$=s.object({id:s.string(),name:s.string(),description:s.string().nullish(),pricing:p$.nullish(),specification:d$,modelType:s.enum(["language","embedding","image"]).nullish()}),f$=s.object({models:s.array(m$)}),g$=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v2",this.supportedUrls={"*/*":[/.*/]}}get provider(){return this.config.provider}async getArgs(e){let{abortSignal:t,...n}=e;return{args:this.maybeEncodeFileParts(n),warnings:[]}}async doGenerate(e){let{args:t,warnings:n}=await this.getArgs(e),{abortSignal:o}=e,r=await et(this.config.headers());try{let{responseHeaders:i,value:a,rawValue:u}=await be({url:this.getUrl(),headers:we(r,e.headers,this.getModelConfigHeaders(this.modelId,!1),await et(this.config.o11yHeaders)),body:t,successfulResponseHandler:Ie(s.any()),failedResponseHandler:ke({errorSchema:s.any(),errorToMessage:l=>l}),...o&&{abortSignal:o},fetch:this.config.fetch});return{...a,request:{body:t},response:{headers:i,body:u},warnings:n}}catch(i){throw Eo(i,da(r))}}async doStream(e){let{args:t,warnings:n}=await this.getArgs(e),{abortSignal:o}=e,r=await et(this.config.headers());try{let{value:i,responseHeaders:a}=await be({url:this.getUrl(),headers:we(r,e.headers,this.getModelConfigHeaders(this.modelId,!0),await et(this.config.o11yHeaders)),body:t,successfulResponseHandler:rr(s.any()),failedResponseHandler:ke({errorSchema:s.any(),errorToMessage:u=>u}),...o&&{abortSignal:o},fetch:this.config.fetch});return{stream:i.pipeThrough(new TransformStream({start(u){n.length>0&&u.enqueue({type:"stream-start",warnings:n})},transform(u,l){if(u.success){let c=u.value;if(c.type==="raw"&&!e.includeRawChunks)return;c.type==="response-metadata"&&c.timestamp&&typeof c.timestamp=="string"&&(c.timestamp=new Date(c.timestamp)),l.enqueue(c)}else l.error(u.error)}})),request:{body:t},response:{headers:a}}}catch(i){throw Eo(i,da(r))}}isFilePart(e){return e&&typeof e=="object"&&"type"in e&&e.type==="file"}maybeEncodeFileParts(e){for(let t of e.prompt)for(let n of t.content)if(this.isFilePart(n)){let o=n;if(o.data instanceof Uint8Array){let r=Uint8Array.from(o.data),i=Buffer.from(r).toString("base64");o.data=new URL(`data:${o.mediaType||"application/octet-stream"};base64,${i}`)}}return e}getUrl(){return`${this.config.baseURL}/language-model`}getModelConfigHeaders(e,t){return{"ai-language-model-specification-version":"2","ai-language-model-id":e,"ai-language-model-streaming":String(t)}}},h$=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v2",this.maxEmbeddingsPerCall=2048,this.supportsParallelCalls=!0}get provider(){return this.config.provider}async doEmbed({values:e,headers:t,abortSignal:n,providerOptions:o}){var r;let i=await et(this.config.headers());try{let{responseHeaders:a,value:u,rawValue:l}=await be({url:this.getUrl(),headers:we(i,t??{},this.getModelConfigHeaders(),await et(this.config.o11yHeaders)),body:{input:e.length===1?e[0]:e,...o?{providerOptions:o}:{}},successfulResponseHandler:Ie(v$),failedResponseHandler:ke({errorSchema:s.any(),errorToMessage:c=>c}),...n&&{abortSignal:n},fetch:this.config.fetch});return{embeddings:u.embeddings,usage:(r=u.usage)!=null?r:void 0,providerMetadata:u.providerMetadata,response:{headers:a,body:l}}}catch(a){throw Eo(a,da(i))}}getUrl(){return`${this.config.baseURL}/embedding-model`}getModelConfigHeaders(){return{"ai-embedding-model-specification-version":"2","ai-model-id":this.modelId}}},v$=s.object({embeddings:s.array(s.array(s.number())),usage:s.object({tokens:s.number()}).nullish(),providerMetadata:s.record(s.string(),s.record(s.string(),s.unknown())).optional()});async function y$(){var e,t;let n=(t=(e=yh().headers)==null?void 0:e["x-vercel-oidc-token"])!=null?t:process.env.VERCEL_OIDC_TOKEN;if(!n)throw new To({message:"OIDC token not available",statusCode:401});return n}async function b$(){var e;return(e=yh().headers)==null?void 0:e["x-vercel-id"]}var _$=Symbol.for("@vercel/request-context");function yh(){var e,t,n;return(n=(t=(e=globalThis[_$])==null?void 0:e.get)==null?void 0:t.call(e))!=null?n:{}}var x$="0.0.1";function D$(e={}){var t,n;let o=null,r=null,i=(t=e.metadataCacheRefreshMillis)!=null?t:1e3*60*5,a=0,u=(n=tn(e.baseURL))!=null?n:"https://ai-gateway.vercel.sh/v1/ai",l=async()=>{let p=await w$(e);if(p)return{Authorization:`Bearer ${p.token}`,"ai-gateway-protocol-version":x$,[vh]:p.authMethod,...e.headers};throw To.createContextualError({apiKeyProvided:!1,oidcTokenProvided:!1,statusCode:401})},c=()=>{let p=wo({settingValue:void 0,environmentVariableName:"VERCEL_DEPLOYMENT_ID"}),d=wo({settingValue:void 0,environmentVariableName:"VERCEL_ENV"}),f=wo({settingValue:void 0,environmentVariableName:"VERCEL_REGION"});return async()=>{let v=await b$();return{...p&&{"ai-o11y-deployment-id":p},...d&&{"ai-o11y-environment":d},...f&&{"ai-o11y-region":f},...v&&{"ai-o11y-request-id":v}}}},m=p=>new g$(p,{provider:"gateway",baseURL:u,headers:l,fetch:e.fetch,o11yHeaders:c()}),h=async()=>{var p,d,f;let v=(f=(d=(p=e._internal)==null?void 0:p.currentDate)==null?void 0:d.call(p).getTime())!=null?f:Date.now();return(!o||v-a>i)&&(a=v,o=new c$({baseURL:u,headers:l,fetch:e.fetch}).getAvailableModels().then(x=>(r=x,x)).catch(async x=>{throw Eo(x,da(await l()))})),r?Promise.resolve(r):o},y=function(p){if(new.target)throw new Error("The Gateway Provider model function cannot be called with the new keyword.");return m(p)};return y.getAvailableModels=h,y.imageModel=p=>{throw new _n({modelId:p,modelType:"imageModel"})},y.languageModel=m,y.textEmbeddingModel=p=>new h$(p,{provider:"gateway",baseURL:u,headers:l,fetch:e.fetch,o11yHeaders:c()}),y}var bh=D$();async function w$(e){let t=wo({settingValue:e.apiKey,environmentVariableName:"AI_GATEWAY_API_KEY"});if(t)return{token:t,authMethod:"api-key"};try{return{token:await y$(),authMethod:"oidc"}}catch{return null}}var _h=typeof globalThis=="object"?globalThis:global;var Ft="1.9.0";var xh=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function k$(e){var t=new Set([e]),n=new Set,o=e.match(xh);if(!o)return function(){return!1};var r={major:+o[1],minor:+o[2],patch:+o[3],prerelease:o[4]};if(r.prerelease!=null)return function(l){return l===e};function i(u){return n.add(u),!1}function a(u){return t.add(u),!0}return function(l){if(t.has(l))return!0;if(n.has(l))return!1;var c=l.match(xh);if(!c)return i(l);var m={major:+c[1],minor:+c[2],patch:+c[3],prerelease:c[4]};return m.prerelease!=null||r.major!==m.major?i(l):r.major===0?r.minor===m.minor&&r.patch<=m.patch?a(l):i(l):r.minor<=m.minor?a(l):i(l)}}var Dh=k$(Ft);var $$=Ft.split(".")[0],Co=Symbol.for("opentelemetry.js.api."+$$),Ao=_h;function rn(e,t,n,o){var r;o===void 0&&(o=!1);var i=Ao[Co]=(r=Ao[Co])!==null&&r!==void 0?r:{version:Ft};if(!o&&i[e]){var a=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return n.error(a.stack||a.message),!1}if(i.version!==Ft){var a=new Error("@opentelemetry/api: Registration of version v"+i.version+" for "+e+" does not match previously registered API v"+Ft);return n.error(a.stack||a.message),!1}return i[e]=t,n.debug("@opentelemetry/api: Registered a global for "+e+" v"+Ft+"."),!0}function Mt(e){var t,n,o=(t=Ao[Co])===null||t===void 0?void 0:t.version;if(!(!o||!Dh(o)))return(n=Ao[Co])===null||n===void 0?void 0:n[e]}function nn(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+Ft+".");var n=Ao[Co];n&&delete n[e]}var S$=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(u){a={error:u}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},I$=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))},wh=(function(){function e(t){this._namespace=t.namespace||"DiagComponentLogger"}return e.prototype.debug=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Po("debug",this._namespace,t)},e.prototype.error=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Po("error",this._namespace,t)},e.prototype.info=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Po("info",this._namespace,t)},e.prototype.warn=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Po("warn",this._namespace,t)},e.prototype.verbose=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Po("verbose",this._namespace,t)},e})();function Po(e,t,n){var o=Mt("diag");if(o)return n.unshift(t),o[e].apply(o,I$([],S$(n),!1))}var Oe;(function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"})(Oe||(Oe={}));function kh(e,t){e<Oe.NONE?e=Oe.NONE:e>Oe.ALL&&(e=Oe.ALL),t=t||{};function n(o,r){var i=t[o];return typeof i=="function"&&e>=r?i.bind(t):function(){}}return{error:n("error",Oe.ERROR),warn:n("warn",Oe.WARN),info:n("info",Oe.INFO),debug:n("debug",Oe.DEBUG),verbose:n("verbose",Oe.VERBOSE)}}var E$=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(u){a={error:u}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},T$=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))},C$="diag",on=(function(){function e(){function t(r){return function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];var u=Mt("diag");if(u)return u[r].apply(u,T$([],E$(i),!1))}}var n=this,o=function(r,i){var a,u,l;if(i===void 0&&(i={logLevel:Oe.INFO}),r===n){var c=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return n.error((a=c.stack)!==null&&a!==void 0?a:c.message),!1}typeof i=="number"&&(i={logLevel:i});var m=Mt("diag"),h=kh((u=i.logLevel)!==null&&u!==void 0?u:Oe.INFO,r);if(m&&!i.suppressOverrideMessage){var y=(l=new Error().stack)!==null&&l!==void 0?l:"<failed to generate stacktrace>";m.warn("Current logger will be overwritten from "+y),h.warn("Current logger will overwrite one already registered from "+y)}return rn("diag",h,n,!0)};n.setLogger=o,n.disable=function(){nn(C$,n)},n.createComponentLogger=function(r){return new wh(r)},n.verbose=t("verbose"),n.debug=t("debug"),n.info=t("info"),n.warn=t("warn"),n.error=t("error")}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e})();function $h(e){return Symbol.for(e)}var A$=(function(){function e(t){var n=this;n._currentContext=t?new Map(t):new Map,n.getValue=function(o){return n._currentContext.get(o)},n.setValue=function(o,r){var i=new e(n._currentContext);return i._currentContext.set(o,r),i},n.deleteValue=function(o){var r=new e(n._currentContext);return r._currentContext.delete(o),r}}return e})(),Sh=new A$;var P$=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(u){a={error:u}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},O$=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))},Ih=(function(){function e(){}return e.prototype.active=function(){return Sh},e.prototype.with=function(t,n,o){for(var r=[],i=3;i<arguments.length;i++)r[i-3]=arguments[i];return n.call.apply(n,O$([o],P$(r),!1))},e.prototype.bind=function(t,n){return n},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e})();var j$=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(u){a={error:u}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},N$=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))},md="context",z$=new Ih,pa=(function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalContextManager=function(t){return rn(md,t,on.instance())},e.prototype.active=function(){return this._getContextManager().active()},e.prototype.with=function(t,n,o){for(var r,i=[],a=3;a<arguments.length;a++)i[a-3]=arguments[a];return(r=this._getContextManager()).with.apply(r,N$([t,n,o],j$(i),!1))},e.prototype.bind=function(t,n){return this._getContextManager().bind(t,n)},e.prototype._getContextManager=function(){return Mt(md)||z$},e.prototype.disable=function(){this._getContextManager().disable(),nn(md,on.instance())},e})();var ma;(function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"})(ma||(ma={}));var fd="0000000000000000",gd="00000000000000000000000000000000",Eh={traceId:gd,spanId:fd,traceFlags:ma.NONE};var or=(function(){function e(t){t===void 0&&(t=Eh),this._spanContext=t}return e.prototype.spanContext=function(){return this._spanContext},e.prototype.setAttribute=function(t,n){return this},e.prototype.setAttributes=function(t){return this},e.prototype.addEvent=function(t,n){return this},e.prototype.addLink=function(t){return this},e.prototype.addLinks=function(t){return this},e.prototype.setStatus=function(t){return this},e.prototype.updateName=function(t){return this},e.prototype.end=function(t){},e.prototype.isRecording=function(){return!1},e.prototype.recordException=function(t,n){},e})();var hd=$h("OpenTelemetry Context Key SPAN");function fa(e){return e.getValue(hd)||void 0}function Th(){return fa(pa.getInstance().active())}function Oo(e,t){return e.setValue(hd,t)}function Ch(e){return e.deleteValue(hd)}function Ah(e,t){return Oo(e,new or(t))}function ga(e){var t;return(t=fa(e))===null||t===void 0?void 0:t.spanContext()}var R$=/^([0-9a-f]{32})$/i,F$=/^[0-9a-f]{16}$/i;function M$(e){return R$.test(e)&&e!==gd}function U$(e){return F$.test(e)&&e!==fd}function ha(e){return M$(e.traceId)&&U$(e.spanId)}function Ph(e){return new or(e)}var vd=pa.getInstance(),va=(function(){function e(){}return e.prototype.startSpan=function(t,n,o){o===void 0&&(o=vd.active());var r=!!n?.root;if(r)return new or;var i=o&&ga(o);return Z$(i)&&ha(i)?new or(i):new or},e.prototype.startActiveSpan=function(t,n,o,r){var i,a,u;if(!(arguments.length<2)){arguments.length===2?u=n:arguments.length===3?(i=n,u=o):(i=n,a=o,u=r);var l=a??vd.active(),c=this.startSpan(t,i,l),m=Oo(l,c);return vd.with(m,u,void 0,c)}},e})();function Z$(e){return typeof e=="object"&&typeof e.spanId=="string"&&typeof e.traceId=="string"&&typeof e.traceFlags=="number"}var L$=new va,Oh=(function(){function e(t,n,o,r){this._provider=t,this.name=n,this.version=o,this.options=r}return e.prototype.startSpan=function(t,n,o){return this._getTracer().startSpan(t,n,o)},e.prototype.startActiveSpan=function(t,n,o,r){var i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)},e.prototype._getTracer=function(){if(this._delegate)return this._delegate;var t=this._provider.getDelegateTracer(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):L$},e})();var jh=(function(){function e(){}return e.prototype.getTracer=function(t,n,o){return new va},e})();var B$=new jh,yd=(function(){function e(){}return e.prototype.getTracer=function(t,n,o){var r;return(r=this.getDelegateTracer(t,n,o))!==null&&r!==void 0?r:new Oh(this,t,n,o)},e.prototype.getDelegate=function(){var t;return(t=this._delegate)!==null&&t!==void 0?t:B$},e.prototype.setDelegate=function(t){this._delegate=t},e.prototype.getDelegateTracer=function(t,n,o){var r;return(r=this._delegate)===null||r===void 0?void 0:r.getTracer(t,n,o)},e})();var an;(function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"})(an||(an={}));var bd="trace",Nh=(function(){function e(){this._proxyTracerProvider=new yd,this.wrapSpanContext=Ph,this.isSpanContextValid=ha,this.deleteSpan=Ch,this.getSpan=fa,this.getActiveSpan=Th,this.getSpanContext=ga,this.setSpan=Oo,this.setSpanContext=Ah}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalTracerProvider=function(t){var n=rn(bd,this._proxyTracerProvider,on.instance());return n&&this._proxyTracerProvider.setDelegate(t),n},e.prototype.getTracerProvider=function(){return Mt(bd)||this._proxyTracerProvider},e.prototype.getTracer=function(t,n){return this.getTracerProvider().getTracer(t,n)},e.prototype.disable=function(){nn(bd,on.instance()),this._proxyTracerProvider=new yd},e})();var _d=Nh.getInstance();var V$=Object.defineProperty,q$=(e,t)=>{for(var n in t)V$(e,n,{get:t[n],enumerable:!0})},qh="AI_NoOutputSpecifiedError",Jh=`vercel.ai.error.${qh}`,J$=Symbol.for(Jh),Gh,G$=class extends Z{constructor({message:e="No output specified."}={}){super({name:qh,message:e}),this[Gh]=!0}static isInstance(e){return Z.hasMarker(e,Jh)}};Gh=J$;function W$(e){let t="AI SDK Warning:";switch(e.type){case"unsupported-setting":{let n=`${t} The "${e.setting}" setting is not supported by this model`;return e.details&&(n+=` - ${e.details}`),n}case"unsupported-tool":{let n="name"in e.tool?e.tool.name:"unknown tool",o=`${t} The tool "${n}" is not supported by this model`;return e.details&&(o+=` - ${e.details}`),o}case"other":return`${t} ${e.message}`;default:return`${t} ${JSON.stringify(e,null,2)}`}}var K$="AI SDK Warning System: To turn off warning logging, set the AI_SDK_LOG_WARNINGS global to false.",zh=!1,H$=e=>{if(e.length===0)return;let t=globalThis.AI_SDK_LOG_WARNINGS;if(t!==!1){if(typeof t=="function"){t(e);return}zh||(zh=!0,console.info(K$));for(let n of e)console.warn(W$(n))}},Wh="AI_InvalidArgumentError",Kh=`vercel.ai.error.${Wh}`,Y$=Symbol.for(Kh),Hh,bt=class extends Z{constructor({parameter:e,value:t,message:n}){super({name:Wh,message:`Invalid argument for parameter ${e}: ${n}`}),this[Hh]=!0,this.parameter=e,this.value=t}static isInstance(e){return Z.hasMarker(e,Kh)}};Hh=Y$;var X$="AI_InvalidStreamPartError",Q$=`vercel.ai.error.${X$}`,eS=Symbol.for(Q$),tS;tS=eS;var Yh="AI_InvalidToolInputError",Xh=`vercel.ai.error.${Yh}`,rS=Symbol.for(Xh),Qh,ev=class extends Z{constructor({toolInput:e,toolName:t,cause:n,message:o=`Invalid input for tool ${t}: ${ft(n)}`}){super({name:Yh,message:o,cause:n}),this[Qh]=!0,this.toolInput=e,this.toolName=t}static isInstance(e){return Z.hasMarker(e,Xh)}};Qh=rS;var nS="AI_MCPClientError",oS=`vercel.ai.error.${nS}`,iS=Symbol.for(oS),aS;aS=iS;var sS="AI_NoImageGeneratedError",uS=`vercel.ai.error.${sS}`,lS=Symbol.for(uS),cS;cS=lS;var tv="AI_NoObjectGeneratedError",rv=`vercel.ai.error.${tv}`,dS=Symbol.for(rv),nv,Rh=class extends Z{constructor({message:e="No object generated.",cause:t,text:n,response:o,usage:r,finishReason:i}){super({name:tv,message:e,cause:t}),this[nv]=!0,this.text=n,this.response=o,this.usage=r,this.finishReason=i}static isInstance(e){return Z.hasMarker(e,rv)}};nv=dS;var ov="AI_NoOutputGeneratedError",iv=`vercel.ai.error.${ov}`,pS=Symbol.for(iv),av,mS=class extends Z{constructor({message:e="No output generated.",cause:t}={}){super({name:ov,message:e,cause:t}),this[av]=!0}static isInstance(e){return Z.hasMarker(e,iv)}};av=pS;var sv="AI_NoSuchToolError",uv=`vercel.ai.error.${sv}`,fS=Symbol.for(uv),lv,kd=class extends Z{constructor({toolName:e,availableTools:t=void 0,message:n=`Model tried to call unavailable tool '${e}'. ${t===void 0?"No tools are available.":`Available tools: ${t.join(", ")}.`}`}){super({name:sv,message:n}),this[lv]=!0,this.toolName=e,this.availableTools=t}static isInstance(e){return Z.hasMarker(e,uv)}};lv=fS;var cv="AI_ToolCallRepairError",dv=`vercel.ai.error.${cv}`,gS=Symbol.for(dv),pv,hS=class extends Z{constructor({cause:e,originalError:t,message:n=`Error repairing tool call: ${ft(e)}`}){super({name:cv,message:n,cause:e}),this[pv]=!0,this.originalError=t}static isInstance(e){return Z.hasMarker(e,dv)}};pv=gS;var vS=class extends Z{constructor(e){super({name:"AI_UnsupportedModelVersionError",message:`Unsupported model version ${e.version} for provider "${e.provider}" and model "${e.modelId}". AI SDK 5 only supports models that implement specification version "v2".`}),this.version=e.version,this.provider=e.provider,this.modelId=e.modelId}},yS="AI_InvalidDataContentError",bS=`vercel.ai.error.${yS}`,_S=Symbol.for(bS),xS;xS=_S;var mv="AI_InvalidMessageRoleError",fv=`vercel.ai.error.${mv}`,DS=Symbol.for(fv),gv,wS=class extends Z{constructor({role:e,message:t=`Invalid message role: '${e}'. Must be one of: "system", "user", "assistant", "tool".`}){super({name:mv,message:t}),this[gv]=!0,this.role=e}static isInstance(e){return Z.hasMarker(e,fv)}};gv=DS;var kS="AI_MessageConversionError",$S=`vercel.ai.error.${kS}`,SS=Symbol.for($S),IS;IS=SS;var hv="AI_DownloadError",vv=`vercel.ai.error.${hv}`,ES=Symbol.for(vv),yv,xd=class extends Z{constructor({url:e,statusCode:t,statusText:n,cause:o,message:r=o==null?`Failed to download ${e}: ${t} ${n}`:`Failed to download ${e}: ${o}`}){super({name:hv,message:r,cause:o}),this[yv]=!0,this.url=e,this.statusCode=t,this.statusText=n}static isInstance(e){return Z.hasMarker(e,vv)}};yv=ES;var bv="AI_RetryError",_v=`vercel.ai.error.${bv}`,TS=Symbol.for(_v),xv,Fh=class extends Z{constructor({message:e,reason:t,errors:n}){super({name:bv,message:e}),this[xv]=!0,this.reason=t,this.errors=n,this.lastError=n[n.length-1]}static isInstance(e){return Z.hasMarker(e,_v)}};xv=TS;function Dv(e){if(typeof e!="string"){if(e.specificationVersion!=="v2")throw new vS({version:e.specificationVersion,provider:e.provider,modelId:e.modelId});return e}return CS().languageModel(e)}function CS(){var e;return(e=globalThis.AI_SDK_DEFAULT_PROVIDER)!=null?e:bh}var AS=[{mediaType:"image/gif",bytesPrefix:[71,73,70],base64Prefix:"R0lG"},{mediaType:"image/png",bytesPrefix:[137,80,78,71],base64Prefix:"iVBORw"},{mediaType:"image/jpeg",bytesPrefix:[255,216],base64Prefix:"/9j/"},{mediaType:"image/webp",bytesPrefix:[82,73,70,70],base64Prefix:"UklGRg"},{mediaType:"image/bmp",bytesPrefix:[66,77],base64Prefix:"Qk"},{mediaType:"image/tiff",bytesPrefix:[73,73,42,0],base64Prefix:"SUkqAA"},{mediaType:"image/tiff",bytesPrefix:[77,77,0,42],base64Prefix:"TU0AKg"},{mediaType:"image/avif",bytesPrefix:[0,0,0,32,102,116,121,112,97,118,105,102],base64Prefix:"AAAAIGZ0eXBhdmlm"},{mediaType:"image/heic",bytesPrefix:[0,0,0,32,102,116,121,112,104,101,105,99],base64Prefix:"AAAAIGZ0eXBoZWlj"}];var PS=e=>{let t=typeof e=="string"?ko(e):e,n=(t[6]&127)<<21|(t[7]&127)<<14|(t[8]&127)<<7|t[9]&127;return t.slice(n+10)};function OS(e){return typeof e=="string"&&e.startsWith("SUQz")||typeof e!="string"&&e.length>10&&e[0]===73&&e[1]===68&&e[2]===51?PS(e):e}function jS({data:e,signatures:t}){let n=OS(e);for(let o of t)if(typeof n=="string"?n.startsWith(o.base64Prefix):n.length>=o.bytesPrefix.length&&o.bytesPrefix.every((r,i)=>n[i]===r))return o.mediaType}var NS=async({url:e})=>{var t;let n=e.toString();try{let o=await fetch(n);if(!o.ok)throw new xd({url:n,statusCode:o.status,statusText:o.statusText});return{data:new Uint8Array(await o.arrayBuffer()),mediaType:(t=o.headers.get("content-type"))!=null?t:void 0}}catch(o){throw xd.isInstance(o)?o:new xd({url:n,cause:o})}},zS=(e=NS)=>t=>Promise.all(t.map(async n=>n.isUrlSupportedByModel?null:e(n)));function RS(e){try{let[t,n]=e.split(",");return{mediaType:t.split(";")[0].split(":")[1],base64Content:n}}catch{return{mediaType:void 0,base64Content:void 0}}}var wv=s.union([s.string(),s.instanceof(Uint8Array),s.instanceof(ArrayBuffer),s.custom(e=>{var t,n;return(n=(t=globalThis.Buffer)==null?void 0:t.isBuffer(e))!=null?n:!1},{message:"Must be a Buffer"})]);function kv(e){if(e instanceof Uint8Array)return{data:e,mediaType:void 0};if(e instanceof ArrayBuffer)return{data:new Uint8Array(e),mediaType:void 0};if(typeof e=="string")try{e=new URL(e)}catch{}if(e instanceof URL&&e.protocol==="data:"){let{mediaType:t,base64Content:n}=RS(e.toString());if(t==null||n==null)throw new Z({name:"InvalidDataContentError",message:`Invalid data URL format in content ${e.toString()}`});return{data:n,mediaType:t}}return{data:e,mediaType:void 0}}function FS(e){return typeof e=="string"?e:e instanceof ArrayBuffer?en(new Uint8Array(e)):en(e)}async function MS({prompt:e,supportedUrls:t,download:n=zS()}){let o=await ZS(e.messages,n,t);return[...e.system!=null?[{role:"system",content:e.system}]:[],...e.messages.map(r=>US({message:r,downloadedAssets:o}))]}function US({message:e,downloadedAssets:t}){let n=e.role;switch(n){case"system":return{role:"system",content:e.content,providerOptions:e.providerOptions};case"user":return typeof e.content=="string"?{role:"user",content:[{type:"text",text:e.content}],providerOptions:e.providerOptions}:{role:"user",content:e.content.map(o=>LS(o,t)).filter(o=>o.type!=="text"||o.text!==""),providerOptions:e.providerOptions};case"assistant":return typeof e.content=="string"?{role:"assistant",content:[{type:"text",text:e.content}],providerOptions:e.providerOptions}:{role:"assistant",content:e.content.filter(o=>o.type!=="text"||o.text!=="").map(o=>{let r=o.providerOptions;switch(o.type){case"file":{let{data:i,mediaType:a}=kv(o.data);return{type:"file",data:i,filename:o.filename,mediaType:a??o.mediaType,providerOptions:r}}case"reasoning":return{type:"reasoning",text:o.text,providerOptions:r};case"text":return{type:"text",text:o.text,providerOptions:r};case"tool-call":return{type:"tool-call",toolCallId:o.toolCallId,toolName:o.toolName,input:o.input,providerExecuted:o.providerExecuted,providerOptions:r};case"tool-result":return{type:"tool-result",toolCallId:o.toolCallId,toolName:o.toolName,output:o.output,providerOptions:r}}}),providerOptions:e.providerOptions};case"tool":return{role:"tool",content:e.content.map(o=>({type:"tool-result",toolCallId:o.toolCallId,toolName:o.toolName,output:o.output,providerOptions:o.providerOptions})),providerOptions:e.providerOptions};default:{let o=n;throw new wS({role:o})}}}async function ZS(e,t,n){let o=e.filter(i=>i.role==="user").map(i=>i.content).filter(i=>Array.isArray(i)).flat().filter(i=>i.type==="image"||i.type==="file").map(i=>{var a;let u=(a=i.mediaType)!=null?a:i.type==="image"?"image/*":void 0,l=i.type==="image"?i.image:i.data;if(typeof l=="string")try{l=new URL(l)}catch{}return{mediaType:u,data:l}}).filter(i=>i.data instanceof URL).map(i=>({url:i.data,isUrlSupportedByModel:i.mediaType!=null&&_g({url:i.data.toString(),mediaType:i.mediaType,supportedUrls:n})})),r=await t(o);return Object.fromEntries(r.filter(i=>i?.data!=null).map(({data:i,mediaType:a},u)=>[o[u].url.toString(),{data:i,mediaType:a}]))}function LS(e,t){var n;if(e.type==="text")return{type:"text",text:e.text,providerOptions:e.providerOptions};let o,r=e.type;switch(r){case"image":o=e.image;break;case"file":o=e.data;break;default:throw new Error(`Unsupported part type: ${r}`)}let{data:i,mediaType:a}=kv(o),u=a??e.mediaType,l=i;if(l instanceof URL){let c=t[l.toString()];c&&(l=c.data,u??(u=c.mediaType))}switch(r){case"image":return(l instanceof Uint8Array||typeof l=="string")&&(u=(n=jS({data:l,signatures:AS}))!=null?n:u),{type:"file",mediaType:u??"image/*",filename:void 0,data:l,providerOptions:e.providerOptions};case"file":{if(u==null)throw new Error("Media type is missing for file part");return{type:"file",mediaType:u,filename:e.filename,data:l,providerOptions:e.providerOptions}}}}function BS({maxOutputTokens:e,temperature:t,topP:n,topK:o,presencePenalty:r,frequencyPenalty:i,seed:a,stopSequences:u}){if(e!=null){if(!Number.isInteger(e))throw new bt({parameter:"maxOutputTokens",value:e,message:"maxOutputTokens must be an integer"});if(e<1)throw new bt({parameter:"maxOutputTokens",value:e,message:"maxOutputTokens must be >= 1"})}if(t!=null&&typeof t!="number")throw new bt({parameter:"temperature",value:t,message:"temperature must be a number"});if(n!=null&&typeof n!="number")throw new bt({parameter:"topP",value:n,message:"topP must be a number"});if(o!=null&&typeof o!="number")throw new bt({parameter:"topK",value:o,message:"topK must be a number"});if(r!=null&&typeof r!="number")throw new bt({parameter:"presencePenalty",value:r,message:"presencePenalty must be a number"});if(i!=null&&typeof i!="number")throw new bt({parameter:"frequencyPenalty",value:i,message:"frequencyPenalty must be a number"});if(a!=null&&!Number.isInteger(a))throw new bt({parameter:"seed",value:a,message:"seed must be an integer"});return{maxOutputTokens:e,temperature:t,topP:n,topK:o,presencePenalty:r,frequencyPenalty:i,stopSequences:u,seed:a}}function VS(e){return e!=null&&Object.keys(e).length>0}function qS({tools:e,toolChoice:t,activeTools:n}){return VS(e)?{tools:(n!=null?Object.entries(e).filter(([r])=>n.includes(r)):Object.entries(e)).map(([r,i])=>{let a=i.type;switch(a){case void 0:case"dynamic":case"function":return{type:"function",name:r,description:i.description,inputSchema:fr(i.inputSchema).jsonSchema,providerOptions:i.providerOptions};case"provider-defined":return{type:"provider-defined",name:r,id:i.id,args:i.args};default:{let u=a;throw new Error(`Unsupported tool type: ${u}`)}}}),toolChoice:t==null?{type:"auto"}:typeof t=="string"?{type:t}:{type:"tool",toolName:t.toolName}}:{tools:void 0,toolChoice:void 0}}var No=s.lazy(()=>s.union([s.null(),s.string(),s.number(),s.boolean(),s.record(s.string(),No),s.array(No)])),Y=s.record(s.string(),s.record(s.string(),No)),$v=s.object({type:s.literal("text"),text:s.string(),providerOptions:Y.optional()}),JS=s.object({type:s.literal("image"),image:s.union([wv,s.instanceof(URL)]),mediaType:s.string().optional(),providerOptions:Y.optional()}),Sv=s.object({type:s.literal("file"),data:s.union([wv,s.instanceof(URL)]),filename:s.string().optional(),mediaType:s.string(),providerOptions:Y.optional()}),GS=s.object({type:s.literal("reasoning"),text:s.string(),providerOptions:Y.optional()}),WS=s.object({type:s.literal("tool-call"),toolCallId:s.string(),toolName:s.string(),input:s.unknown(),providerOptions:Y.optional(),providerExecuted:s.boolean().optional()}),KS=s.discriminatedUnion("type",[s.object({type:s.literal("text"),value:s.string()}),s.object({type:s.literal("json"),value:No}),s.object({type:s.literal("error-text"),value:s.string()}),s.object({type:s.literal("error-json"),value:No}),s.object({type:s.literal("content"),value:s.array(s.union([s.object({type:s.literal("text"),text:s.string()}),s.object({type:s.literal("media"),data:s.string(),mediaType:s.string()})]))})]),Iv=s.object({type:s.literal("tool-result"),toolCallId:s.string(),toolName:s.string(),output:KS,providerOptions:Y.optional()}),HS=s.object({role:s.literal("system"),content:s.string(),providerOptions:Y.optional()});var YS=s.object({role:s.literal("user"),content:s.union([s.string(),s.array(s.union([$v,JS,Sv]))]),providerOptions:Y.optional()});var XS=s.object({role:s.literal("assistant"),content:s.union([s.string(),s.array(s.union([$v,Sv,GS,WS,Iv]))]),providerOptions:Y.optional()});var QS=s.object({role:s.literal("tool"),content:s.array(Iv),providerOptions:Y.optional()});var eI=s.union([HS,YS,XS,QS]);async function tI(e){if(e.prompt==null&&e.messages==null)throw new $t({prompt:e,message:"prompt or messages must be defined"});if(e.prompt!=null&&e.messages!=null)throw new $t({prompt:e,message:"prompt and messages cannot be defined at the same time"});if(e.system!=null&&typeof e.system!="string")throw new $t({prompt:e,message:"system must be a string"});let t;if(e.prompt!=null&&typeof e.prompt=="string")t=[{role:"user",content:e.prompt}];else if(e.prompt!=null&&Array.isArray(e.prompt))t=e.prompt;else if(e.messages!=null)t=e.messages;else throw new $t({prompt:e,message:"prompt or messages must be defined"});if(t.length===0)throw new $t({prompt:e,message:"messages must not be empty"});let n=await Rt({value:t,schema:s.array(eI)});if(!n.success)throw new $t({prompt:e,message:"The messages must be a ModelMessage[]. If you have passed a UIMessage[], you can use convertToModelMessages to convert them.",cause:n.error});return{messages:t,system:e.system}}function rI(e){return To.isInstance(e)||pd.isInstance(e)?new Z({name:"GatewayError",message:"Vercel AI Gateway access failed. If you want to use AI SDK providers directly, use the providers, e.g. @ai-sdk/openai, or register a different global default provider.",cause:e}):e}function $d({operationId:e,telemetry:t}){return{"operation.name":`${e}${t?.functionId!=null?` ${t.functionId}`:""}`,"resource.name":t?.functionId,"ai.operationId":e,"ai.telemetry.functionId":t?.functionId}}function nI({model:e,settings:t,telemetry:n,headers:o}){var r;return{"ai.model.provider":e.provider,"ai.model.id":e.modelId,...Object.entries(t).reduce((i,[a,u])=>(i[`ai.settings.${a}`]=u,i),{}),...Object.entries((r=n?.metadata)!=null?r:{}).reduce((i,[a,u])=>(i[`ai.telemetry.metadata.${a}`]=u,i),{}),...Object.entries(o??{}).reduce((i,[a,u])=>(u!==void 0&&(i[`ai.request.headers.${a}`]=u),i),{})}}var oI={startSpan(){return ya},startActiveSpan(e,t,n,o){if(typeof t=="function")return t(ya);if(typeof n=="function")return n(ya);if(typeof o=="function")return o(ya)}},ya={spanContext(){return iI},setAttribute(){return this},setAttributes(){return this},addEvent(){return this},addLink(){return this},addLinks(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording(){return!1},recordException(){return this}},iI={traceId:"",spanId:"",traceFlags:0};function aI({isEnabled:e=!1,tracer:t}={}){return e?t||_d.getTracer("ai"):oI}function Sd({name:e,tracer:t,attributes:n,fn:o,endWhenDone:r=!0}){return t.startActiveSpan(e,{attributes:n},async i=>{try{let a=await o(i);return r&&i.end(),a}catch(a){try{Ev(i,a)}finally{i.end()}throw a}})}function Ev(e,t){t instanceof Error?(e.recordException({name:t.name,message:t.message,stack:t.stack}),e.setStatus({code:an.ERROR,message:t.message})):e.setStatus({code:an.ERROR})}function sn({telemetry:e,attributes:t}){return e?.isEnabled!==!0?{}:Object.entries(t).reduce((n,[o,r])=>{if(r==null)return n;if(typeof r=="object"&&"input"in r&&typeof r.input=="function"){if(e?.recordInputs===!1)return n;let i=r.input();return i==null?n:{...n,[o]:i}}if(typeof r=="object"&&"output"in r&&typeof r.output=="function"){if(e?.recordOutputs===!1)return n;let i=r.output();return i==null?n:{...n,[o]:i}}return{...n,[o]:r}},{})}function sI(e){return JSON.stringify(e.map(t=>({...t,content:typeof t.content=="string"?t.content:t.content.map(n=>n.type==="file"?{...n,data:n.data instanceof Uint8Array?FS(n.data):n.data}:n)})))}function uI(e,t){return{inputTokens:jo(e.inputTokens,t.inputTokens),outputTokens:jo(e.outputTokens,t.outputTokens),totalTokens:jo(e.totalTokens,t.totalTokens),reasoningTokens:jo(e.reasoningTokens,t.reasoningTokens),cachedInputTokens:jo(e.cachedInputTokens,t.cachedInputTokens)}}function jo(e,t){return e==null&&t==null?void 0:(e??0)+(t??0)}function Mh(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function lI({error:e,exponentialBackoffDelay:t}){let n=e.responseHeaders;if(!n)return t;let o,r=n["retry-after-ms"];if(r){let a=parseFloat(r);Number.isNaN(a)||(o=a)}let i=n["retry-after"];if(i&&o===void 0){let a=parseFloat(i);Number.isNaN(a)?o=Date.parse(i)-Date.now():o=a*1e3}return o!=null&&!Number.isNaN(o)&&0<=o&&(o<60*1e3||o<t)?o:t}var cI=({maxRetries:e=2,initialDelayInMs:t=2e3,backoffFactor:n=2,abortSignal:o}={})=>async r=>Tv(r,{maxRetries:e,delayInMs:t,backoffFactor:n,abortSignal:o});async function Tv(e,{maxRetries:t,delayInMs:n,backoffFactor:o,abortSignal:r},i=[]){try{return await e()}catch(a){if(Nt(a)||t===0)throw a;let u=Do(a),l=[...i,a],c=l.length;if(c>t)throw new Fh({message:`Failed after ${c} attempts. Last error: ${u}`,reason:"maxRetriesExceeded",errors:l});if(a instanceof Error&&le.isInstance(a)&&a.isRetryable===!0&&c<=t)return await gg(lI({error:a,exponentialBackoffDelay:n}),{abortSignal:r}),Tv(e,{maxRetries:t,delayInMs:o*n,backoffFactor:o,abortSignal:r},l);throw c===1?a:new Fh({message:`Failed after ${c} attempts with non-retryable error: '${u}'`,reason:"errorNotRetryable",errors:l})}}function dI({maxRetries:e,abortSignal:t}){if(e!=null){if(!Number.isInteger(e))throw new bt({parameter:"maxRetries",value:e,message:"maxRetries must be an integer"});if(e<0)throw new bt({parameter:"maxRetries",value:e,message:"maxRetries must be >= 0"})}let n=e??2;return{maxRetries:n,retry:cI({maxRetries:n,abortSignal:t})}}var pI=class{constructor({data:e,mediaType:t}){let n=e instanceof Uint8Array;this.base64Data=n?void 0:e,this.uint8ArrayData=n?e:void 0,this.mediaType=t}get base64(){return this.base64Data==null&&(this.base64Data=en(this.uint8ArrayData)),this.base64Data}get uint8Array(){return this.uint8ArrayData==null&&(this.uint8ArrayData=ko(this.base64Data)),this.uint8ArrayData}},mI=class extends pI{constructor(e){super(e),this.type="file"}};async function fI({toolCall:e,tools:t,repairToolCall:n,system:o,messages:r}){try{if(t==null)throw new kd({toolName:e.toolName});try{return await Uh({toolCall:e,tools:t})}catch(i){if(n==null||!(kd.isInstance(i)||ev.isInstance(i)))throw i;let a=null;try{a=await n({toolCall:e,tools:t,inputSchema:({toolName:u})=>{let{inputSchema:l}=t[u];return fr(l).jsonSchema},system:o,messages:r,error:i})}catch(u){throw new hS({cause:u,originalError:i})}if(a==null)throw i;return await Uh({toolCall:a,tools:t})}}catch(i){let a=await yt({text:e.input}),u=a.success?a.value:e.input;return{type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,input:u,dynamic:!0,invalid:!0,error:i}}}async function Uh({toolCall:e,tools:t}){let n=e.toolName,o=t[n];if(o==null)throw new kd({toolName:e.toolName,availableTools:Object.keys(t)});let r=fr(o.inputSchema),i=e.input.trim()===""?await Rt({value:{},schema:r}):await yt({text:e.input,schema:r});if(i.success===!1)throw new ev({toolName:n,toolInput:e.input,cause:i.error});return o.type==="dynamic"?{type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,input:i.value,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,dynamic:!0}:{type:"tool-call",toolCallId:e.toolCallId,toolName:n,input:i.value,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}}var gI=class{constructor({content:e,finishReason:t,usage:n,warnings:o,request:r,response:i,providerMetadata:a}){this.content=e,this.finishReason=t,this.usage=n,this.warnings=o,this.request=r,this.response=i,this.providerMetadata=a}get text(){return this.content.filter(e=>e.type==="text").map(e=>e.text).join("")}get reasoning(){return this.content.filter(e=>e.type==="reasoning")}get reasoningText(){return this.reasoning.length===0?void 0:this.reasoning.map(e=>e.text).join("")}get files(){return this.content.filter(e=>e.type==="file").map(e=>e.file)}get sources(){return this.content.filter(e=>e.type==="source")}get toolCalls(){return this.content.filter(e=>e.type==="tool-call")}get staticToolCalls(){return this.toolCalls.filter(e=>e.dynamic===!1)}get dynamicToolCalls(){return this.toolCalls.filter(e=>e.dynamic===!0)}get toolResults(){return this.content.filter(e=>e.type==="tool-result")}get staticToolResults(){return this.toolResults.filter(e=>e.dynamic===!1)}get dynamicToolResults(){return this.toolResults.filter(e=>e.dynamic===!0)}};function hI(e){return({steps:t})=>t.length===e}async function vI({stopConditions:e,steps:t}){return(await Promise.all(e.map(n=>n({steps:t})))).some(n=>n)}function Dd({output:e,tool:t,errorMode:n}){return n==="text"?{type:"error-text",value:ft(e)}:n==="json"?{type:"error-json",value:Zh(e)}:t?.toModelOutput?t.toModelOutput(e):typeof e=="string"?{type:"text",value:e}:{type:"json",value:Zh(e)}}function Zh(e){return e===void 0?null:e}function Lh({content:e,tools:t}){let n=[],o=e.filter(i=>i.type!=="source").filter(i=>(i.type!=="tool-result"||i.providerExecuted)&&(i.type!=="tool-error"||i.providerExecuted)).filter(i=>i.type!=="text"||i.text.length>0).map(i=>{switch(i.type){case"text":return{type:"text",text:i.text,providerOptions:i.providerMetadata};case"reasoning":return{type:"reasoning",text:i.text,providerOptions:i.providerMetadata};case"file":return{type:"file",data:i.file.base64,mediaType:i.file.mediaType,providerOptions:i.providerMetadata};case"tool-call":return{type:"tool-call",toolCallId:i.toolCallId,toolName:i.toolName,input:i.input,providerExecuted:i.providerExecuted,providerOptions:i.providerMetadata};case"tool-result":return{type:"tool-result",toolCallId:i.toolCallId,toolName:i.toolName,output:Dd({tool:t?.[i.toolName],output:i.output,errorMode:"none"}),providerExecuted:!0,providerOptions:i.providerMetadata};case"tool-error":return{type:"tool-result",toolCallId:i.toolCallId,toolName:i.toolName,output:Dd({tool:t?.[i.toolName],output:i.error,errorMode:"json"}),providerOptions:i.providerMetadata}}});o.length>0&&n.push({role:"assistant",content:o});let r=e.filter(i=>i.type==="tool-result"||i.type==="tool-error").filter(i=>!i.providerExecuted).map(i=>({type:"tool-result",toolCallId:i.toolCallId,toolName:i.toolName,output:Dd({tool:t?.[i.toolName],output:i.type==="tool-result"?i.output:i.error,errorMode:i.type==="tool-error"?"text":"none"})}));return r.length>0&&n.push({role:"tool",content:r}),n}var t4=zt({prefix:"aitxt",size:24});function xa(e,t){let n=new Headers(e??{});for(let[o,r]of Object.entries(t))n.has(o)||n.set(o,r);return n}function yI({status:e,statusText:t,headers:n,textStream:o}){return new Response(o.pipeThrough(new TextEncoderStream),{status:e??200,statusText:t,headers:xa(n,{"content-type":"text/plain; charset=utf-8"})})}function Cv({response:e,status:t,statusText:n,headers:o,stream:r}){e.writeHead(t??200,n,o);let i=r.getReader();(async()=>{try{for(;;){let{done:u,value:l}=await i.read();if(u)break;e.write(l)}}catch(u){throw u}finally{e.end()}})()}function bI({response:e,status:t,statusText:n,headers:o,textStream:r}){Cv({response:e,status:t,statusText:n,headers:Object.fromEntries(xa(o,{"content-type":"text/plain; charset=utf-8"}).entries()),stream:r.pipeThrough(new TextEncoderStream)})}var Av=class extends TransformStream{constructor(){super({transform(e,t){t.enqueue(`data: ${JSON.stringify(e)}
|
|
74
|
+
- in production/preview, the token is automatically obtained and refreshed`,new dh({message:a,statusCode:r,cause:i})}},ph="GatewayInvalidRequestError",Xk=`vercel.ai.gateway.error.${ph}`,Jg=Symbol.for(Xk),Gg,Wg,Qk=class extends(Wg=We,Gg=Jg,Wg){constructor({message:e="Invalid request",statusCode:t=400,cause:n}={}){super({message:e,statusCode:t,cause:n}),this[Gg]=!0,this.name=ph,this.type="invalid_request_error"}static isInstance(e){return We.hasMarker(e)&&Jg in e}},mh="GatewayRateLimitError",e$=`vercel.ai.gateway.error.${mh}`,Kg=Symbol.for(e$),Hg,Yg,t$=class extends(Yg=We,Hg=Kg,Yg){constructor({message:e="Rate limit exceeded",statusCode:t=429,cause:n}={}){super({message:e,statusCode:t,cause:n}),this[Hg]=!0,this.name=mh,this.type="rate_limit_exceeded"}static isInstance(e){return We.hasMarker(e)&&Kg in e}},fh="GatewayModelNotFoundError",r$=`vercel.ai.gateway.error.${fh}`,Xg=Symbol.for(r$),n$=s.object({modelId:s.string()}),Qg,eh,pd=class extends(eh=We,Qg=Xg,eh){constructor({message:e="Model not found",statusCode:t=404,modelId:n,cause:o}={}){super({message:e,statusCode:t,cause:o}),this[Qg]=!0,this.name=fh,this.type="model_not_found",this.modelId=n}static isInstance(e){return We.hasMarker(e)&&Xg in e}},gh="GatewayInternalServerError",o$=`vercel.ai.gateway.error.${gh}`,th=Symbol.for(o$),rh,nh,oh=class extends(nh=We,rh=th,nh){constructor({message:e="Internal server error",statusCode:t=500,cause:n}={}){super({message:e,statusCode:t,cause:n}),this[rh]=!0,this.name=gh,this.type="internal_server_error"}static isInstance(e){return We.hasMarker(e)&&th in e}},hh="GatewayResponseError",i$=`vercel.ai.gateway.error.${hh}`,ih=Symbol.for(i$),ah,sh,a$=class extends(sh=We,ah=ih,sh){constructor({message:e="Invalid response from Gateway",statusCode:t=502,response:n,validationError:o,cause:r}={}){super({message:e,statusCode:t,cause:r}),this[ah]=!0,this.name=hh,this.type="response_error",this.response=n,this.validationError=o}static isInstance(e){return We.hasMarker(e)&&ih in e}};function uh({response:e,statusCode:t,defaultMessage:n="Gateway request failed",cause:o,authMethod:r}){let i=s$.safeParse(e);if(!i.success)return new a$({message:`Invalid error response format: ${n}`,statusCode:t,response:e,validationError:i.error,cause:o});let a=i.data,u=a.error.type,l=a.error.message;switch(u){case"authentication_error":return To.createContextualError({apiKeyProvided:r==="api-key",oidcTokenProvided:r==="oidc",statusCode:t,cause:o});case"invalid_request_error":return new Qk({message:l,statusCode:t,cause:o});case"rate_limit_exceeded":return new t$({message:l,statusCode:t,cause:o});case"model_not_found":{let c=n$.safeParse(a.error.param);return new pd({message:l,statusCode:t,modelId:c.success?c.data.modelId:void 0,cause:o})}case"internal_server_error":return new oh({message:l,statusCode:t,cause:o});default:return new oh({message:l,statusCode:t,cause:o})}}var s$=s.object({error:s.object({message:s.string(),type:s.string().nullish(),param:s.unknown().nullish(),code:s.union([s.string(),s.number()]).nullish()})});function Eo(e,t){var n;return We.isInstance(e)?e:le.isInstance(e)?uh({response:u$(e),statusCode:(n=e.statusCode)!=null?n:500,defaultMessage:"Gateway request failed",cause:e,authMethod:t}):uh({response:{},statusCode:500,defaultMessage:e instanceof Error?`Gateway request failed: ${e.message}`:"Unknown Gateway error",cause:e,authMethod:t})}function u$(e){if(e.data!==void 0)return e.data;if(e.responseBody!=null)try{return JSON.parse(e.responseBody)}catch{return e.responseBody}return{}}var vh="ai-gateway-auth-method";function da(e){let t=l$.safeParse(e[vh]);return t.success?t.data:void 0}var l$=s.union([s.literal("api-key"),s.literal("oidc")]),c$=class{constructor(e){this.config=e}async getAvailableModels(){try{let{value:e}=await bg({url:`${this.config.baseURL}/config`,headers:await et(this.config.headers()),successfulResponseHandler:Ie(f$),failedResponseHandler:ke({errorSchema:s.any(),errorToMessage:t=>t}),fetch:this.config.fetch});return e}catch(e){throw Eo(e)}}},d$=s.object({specificationVersion:s.literal("v2"),provider:s.string(),modelId:s.string()}),p$=s.object({input:s.string(),output:s.string(),input_cache_read:s.string().nullish(),input_cache_write:s.string().nullish()}).transform(({input:e,output:t,input_cache_read:n,input_cache_write:o})=>({input:e,output:t,...n?{cachedInputTokens:n}:{},...o?{cacheCreationInputTokens:o}:{}})),m$=s.object({id:s.string(),name:s.string(),description:s.string().nullish(),pricing:p$.nullish(),specification:d$,modelType:s.enum(["language","embedding","image"]).nullish()}),f$=s.object({models:s.array(m$)}),g$=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v2",this.supportedUrls={"*/*":[/.*/]}}get provider(){return this.config.provider}async getArgs(e){let{abortSignal:t,...n}=e;return{args:this.maybeEncodeFileParts(n),warnings:[]}}async doGenerate(e){let{args:t,warnings:n}=await this.getArgs(e),{abortSignal:o}=e,r=await et(this.config.headers());try{let{responseHeaders:i,value:a,rawValue:u}=await be({url:this.getUrl(),headers:we(r,e.headers,this.getModelConfigHeaders(this.modelId,!1),await et(this.config.o11yHeaders)),body:t,successfulResponseHandler:Ie(s.any()),failedResponseHandler:ke({errorSchema:s.any(),errorToMessage:l=>l}),...o&&{abortSignal:o},fetch:this.config.fetch});return{...a,request:{body:t},response:{headers:i,body:u},warnings:n}}catch(i){throw Eo(i,da(r))}}async doStream(e){let{args:t,warnings:n}=await this.getArgs(e),{abortSignal:o}=e,r=await et(this.config.headers());try{let{value:i,responseHeaders:a}=await be({url:this.getUrl(),headers:we(r,e.headers,this.getModelConfigHeaders(this.modelId,!0),await et(this.config.o11yHeaders)),body:t,successfulResponseHandler:rr(s.any()),failedResponseHandler:ke({errorSchema:s.any(),errorToMessage:u=>u}),...o&&{abortSignal:o},fetch:this.config.fetch});return{stream:i.pipeThrough(new TransformStream({start(u){n.length>0&&u.enqueue({type:"stream-start",warnings:n})},transform(u,l){if(u.success){let c=u.value;if(c.type==="raw"&&!e.includeRawChunks)return;c.type==="response-metadata"&&c.timestamp&&typeof c.timestamp=="string"&&(c.timestamp=new Date(c.timestamp)),l.enqueue(c)}else l.error(u.error)}})),request:{body:t},response:{headers:a}}}catch(i){throw Eo(i,da(r))}}isFilePart(e){return e&&typeof e=="object"&&"type"in e&&e.type==="file"}maybeEncodeFileParts(e){for(let t of e.prompt)for(let n of t.content)if(this.isFilePart(n)){let o=n;if(o.data instanceof Uint8Array){let r=Uint8Array.from(o.data),i=Buffer.from(r).toString("base64");o.data=new URL(`data:${o.mediaType||"application/octet-stream"};base64,${i}`)}}return e}getUrl(){return`${this.config.baseURL}/language-model`}getModelConfigHeaders(e,t){return{"ai-language-model-specification-version":"2","ai-language-model-id":e,"ai-language-model-streaming":String(t)}}},h$=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v2",this.maxEmbeddingsPerCall=2048,this.supportsParallelCalls=!0}get provider(){return this.config.provider}async doEmbed({values:e,headers:t,abortSignal:n,providerOptions:o}){var r;let i=await et(this.config.headers());try{let{responseHeaders:a,value:u,rawValue:l}=await be({url:this.getUrl(),headers:we(i,t??{},this.getModelConfigHeaders(),await et(this.config.o11yHeaders)),body:{input:e.length===1?e[0]:e,...o?{providerOptions:o}:{}},successfulResponseHandler:Ie(v$),failedResponseHandler:ke({errorSchema:s.any(),errorToMessage:c=>c}),...n&&{abortSignal:n},fetch:this.config.fetch});return{embeddings:u.embeddings,usage:(r=u.usage)!=null?r:void 0,providerMetadata:u.providerMetadata,response:{headers:a,body:l}}}catch(a){throw Eo(a,da(i))}}getUrl(){return`${this.config.baseURL}/embedding-model`}getModelConfigHeaders(){return{"ai-embedding-model-specification-version":"2","ai-model-id":this.modelId}}},v$=s.object({embeddings:s.array(s.array(s.number())),usage:s.object({tokens:s.number()}).nullish(),providerMetadata:s.record(s.string(),s.record(s.string(),s.unknown())).optional()});async function y$(){var e,t;let n=(t=(e=yh().headers)==null?void 0:e["x-vercel-oidc-token"])!=null?t:process.env.VERCEL_OIDC_TOKEN;if(!n)throw new To({message:"OIDC token not available",statusCode:401});return n}async function b$(){var e;return(e=yh().headers)==null?void 0:e["x-vercel-id"]}var _$=Symbol.for("@vercel/request-context");function yh(){var e,t,n;return(n=(t=(e=globalThis[_$])==null?void 0:e.get)==null?void 0:t.call(e))!=null?n:{}}var x$="0.0.1";function D$(e={}){var t,n;let o=null,r=null,i=(t=e.metadataCacheRefreshMillis)!=null?t:1e3*60*5,a=0,u=(n=tn(e.baseURL))!=null?n:"https://ai-gateway.vercel.sh/v1/ai",l=async()=>{let p=await w$(e);if(p)return{Authorization:`Bearer ${p.token}`,"ai-gateway-protocol-version":x$,[vh]:p.authMethod,...e.headers};throw To.createContextualError({apiKeyProvided:!1,oidcTokenProvided:!1,statusCode:401})},c=()=>{let p=wo({settingValue:void 0,environmentVariableName:"VERCEL_DEPLOYMENT_ID"}),d=wo({settingValue:void 0,environmentVariableName:"VERCEL_ENV"}),f=wo({settingValue:void 0,environmentVariableName:"VERCEL_REGION"});return async()=>{let v=await b$();return{...p&&{"ai-o11y-deployment-id":p},...d&&{"ai-o11y-environment":d},...f&&{"ai-o11y-region":f},...v&&{"ai-o11y-request-id":v}}}},m=p=>new g$(p,{provider:"gateway",baseURL:u,headers:l,fetch:e.fetch,o11yHeaders:c()}),h=async()=>{var p,d,f;let v=(f=(d=(p=e._internal)==null?void 0:p.currentDate)==null?void 0:d.call(p).getTime())!=null?f:Date.now();return(!o||v-a>i)&&(a=v,o=new c$({baseURL:u,headers:l,fetch:e.fetch}).getAvailableModels().then(x=>(r=x,x)).catch(async x=>{throw Eo(x,da(await l()))})),r?Promise.resolve(r):o},y=function(p){if(new.target)throw new Error("The Gateway Provider model function cannot be called with the new keyword.");return m(p)};return y.getAvailableModels=h,y.imageModel=p=>{throw new _n({modelId:p,modelType:"imageModel"})},y.languageModel=m,y.textEmbeddingModel=p=>new h$(p,{provider:"gateway",baseURL:u,headers:l,fetch:e.fetch,o11yHeaders:c()}),y}var bh=D$();async function w$(e){let t=wo({settingValue:e.apiKey,environmentVariableName:"AI_GATEWAY_API_KEY"});if(t)return{token:t,authMethod:"api-key"};try{return{token:await y$(),authMethod:"oidc"}}catch{return null}}var _h=typeof globalThis=="object"?globalThis:global;var Ft="1.9.0";var xh=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function k$(e){var t=new Set([e]),n=new Set,o=e.match(xh);if(!o)return function(){return!1};var r={major:+o[1],minor:+o[2],patch:+o[3],prerelease:o[4]};if(r.prerelease!=null)return function(l){return l===e};function i(u){return n.add(u),!1}function a(u){return t.add(u),!0}return function(l){if(t.has(l))return!0;if(n.has(l))return!1;var c=l.match(xh);if(!c)return i(l);var m={major:+c[1],minor:+c[2],patch:+c[3],prerelease:c[4]};return m.prerelease!=null||r.major!==m.major?i(l):r.major===0?r.minor===m.minor&&r.patch<=m.patch?a(l):i(l):r.minor<=m.minor?a(l):i(l)}}var Dh=k$(Ft);var $$=Ft.split(".")[0],Co=Symbol.for("opentelemetry.js.api."+$$),Ao=_h;function rn(e,t,n,o){var r;o===void 0&&(o=!1);var i=Ao[Co]=(r=Ao[Co])!==null&&r!==void 0?r:{version:Ft};if(!o&&i[e]){var a=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return n.error(a.stack||a.message),!1}if(i.version!==Ft){var a=new Error("@opentelemetry/api: Registration of version v"+i.version+" for "+e+" does not match previously registered API v"+Ft);return n.error(a.stack||a.message),!1}return i[e]=t,n.debug("@opentelemetry/api: Registered a global for "+e+" v"+Ft+"."),!0}function Mt(e){var t,n,o=(t=Ao[Co])===null||t===void 0?void 0:t.version;if(!(!o||!Dh(o)))return(n=Ao[Co])===null||n===void 0?void 0:n[e]}function nn(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+Ft+".");var n=Ao[Co];n&&delete n[e]}var S$=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(u){a={error:u}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},I$=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))},wh=(function(){function e(t){this._namespace=t.namespace||"DiagComponentLogger"}return e.prototype.debug=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Po("debug",this._namespace,t)},e.prototype.error=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Po("error",this._namespace,t)},e.prototype.info=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Po("info",this._namespace,t)},e.prototype.warn=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Po("warn",this._namespace,t)},e.prototype.verbose=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Po("verbose",this._namespace,t)},e})();function Po(e,t,n){var o=Mt("diag");if(o)return n.unshift(t),o[e].apply(o,I$([],S$(n),!1))}var Oe;(function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"})(Oe||(Oe={}));function kh(e,t){e<Oe.NONE?e=Oe.NONE:e>Oe.ALL&&(e=Oe.ALL),t=t||{};function n(o,r){var i=t[o];return typeof i=="function"&&e>=r?i.bind(t):function(){}}return{error:n("error",Oe.ERROR),warn:n("warn",Oe.WARN),info:n("info",Oe.INFO),debug:n("debug",Oe.DEBUG),verbose:n("verbose",Oe.VERBOSE)}}var E$=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(u){a={error:u}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},T$=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))},C$="diag",on=(function(){function e(){function t(r){return function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];var u=Mt("diag");if(u)return u[r].apply(u,T$([],E$(i),!1))}}var n=this,o=function(r,i){var a,u,l;if(i===void 0&&(i={logLevel:Oe.INFO}),r===n){var c=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return n.error((a=c.stack)!==null&&a!==void 0?a:c.message),!1}typeof i=="number"&&(i={logLevel:i});var m=Mt("diag"),h=kh((u=i.logLevel)!==null&&u!==void 0?u:Oe.INFO,r);if(m&&!i.suppressOverrideMessage){var y=(l=new Error().stack)!==null&&l!==void 0?l:"<failed to generate stacktrace>";m.warn("Current logger will be overwritten from "+y),h.warn("Current logger will overwrite one already registered from "+y)}return rn("diag",h,n,!0)};n.setLogger=o,n.disable=function(){nn(C$,n)},n.createComponentLogger=function(r){return new wh(r)},n.verbose=t("verbose"),n.debug=t("debug"),n.info=t("info"),n.warn=t("warn"),n.error=t("error")}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e})();function $h(e){return Symbol.for(e)}var A$=(function(){function e(t){var n=this;n._currentContext=t?new Map(t):new Map,n.getValue=function(o){return n._currentContext.get(o)},n.setValue=function(o,r){var i=new e(n._currentContext);return i._currentContext.set(o,r),i},n.deleteValue=function(o){var r=new e(n._currentContext);return r._currentContext.delete(o),r}}return e})(),Sh=new A$;var P$=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(u){a={error:u}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},O$=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))},Ih=(function(){function e(){}return e.prototype.active=function(){return Sh},e.prototype.with=function(t,n,o){for(var r=[],i=3;i<arguments.length;i++)r[i-3]=arguments[i];return n.call.apply(n,O$([o],P$(r),!1))},e.prototype.bind=function(t,n){return n},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e})();var j$=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(u){a={error:u}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},N$=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))},md="context",z$=new Ih,pa=(function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalContextManager=function(t){return rn(md,t,on.instance())},e.prototype.active=function(){return this._getContextManager().active()},e.prototype.with=function(t,n,o){for(var r,i=[],a=3;a<arguments.length;a++)i[a-3]=arguments[a];return(r=this._getContextManager()).with.apply(r,N$([t,n,o],j$(i),!1))},e.prototype.bind=function(t,n){return this._getContextManager().bind(t,n)},e.prototype._getContextManager=function(){return Mt(md)||z$},e.prototype.disable=function(){this._getContextManager().disable(),nn(md,on.instance())},e})();var ma;(function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"})(ma||(ma={}));var fd="0000000000000000",gd="00000000000000000000000000000000",Eh={traceId:gd,spanId:fd,traceFlags:ma.NONE};var or=(function(){function e(t){t===void 0&&(t=Eh),this._spanContext=t}return e.prototype.spanContext=function(){return this._spanContext},e.prototype.setAttribute=function(t,n){return this},e.prototype.setAttributes=function(t){return this},e.prototype.addEvent=function(t,n){return this},e.prototype.addLink=function(t){return this},e.prototype.addLinks=function(t){return this},e.prototype.setStatus=function(t){return this},e.prototype.updateName=function(t){return this},e.prototype.end=function(t){},e.prototype.isRecording=function(){return!1},e.prototype.recordException=function(t,n){},e})();var hd=$h("OpenTelemetry Context Key SPAN");function fa(e){return e.getValue(hd)||void 0}function Th(){return fa(pa.getInstance().active())}function Oo(e,t){return e.setValue(hd,t)}function Ch(e){return e.deleteValue(hd)}function Ah(e,t){return Oo(e,new or(t))}function ga(e){var t;return(t=fa(e))===null||t===void 0?void 0:t.spanContext()}var R$=/^([0-9a-f]{32})$/i,F$=/^[0-9a-f]{16}$/i;function M$(e){return R$.test(e)&&e!==gd}function U$(e){return F$.test(e)&&e!==fd}function ha(e){return M$(e.traceId)&&U$(e.spanId)}function Ph(e){return new or(e)}var vd=pa.getInstance(),va=(function(){function e(){}return e.prototype.startSpan=function(t,n,o){o===void 0&&(o=vd.active());var r=!!n?.root;if(r)return new or;var i=o&&ga(o);return Z$(i)&&ha(i)?new or(i):new or},e.prototype.startActiveSpan=function(t,n,o,r){var i,a,u;if(!(arguments.length<2)){arguments.length===2?u=n:arguments.length===3?(i=n,u=o):(i=n,a=o,u=r);var l=a??vd.active(),c=this.startSpan(t,i,l),m=Oo(l,c);return vd.with(m,u,void 0,c)}},e})();function Z$(e){return typeof e=="object"&&typeof e.spanId=="string"&&typeof e.traceId=="string"&&typeof e.traceFlags=="number"}var L$=new va,Oh=(function(){function e(t,n,o,r){this._provider=t,this.name=n,this.version=o,this.options=r}return e.prototype.startSpan=function(t,n,o){return this._getTracer().startSpan(t,n,o)},e.prototype.startActiveSpan=function(t,n,o,r){var i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)},e.prototype._getTracer=function(){if(this._delegate)return this._delegate;var t=this._provider.getDelegateTracer(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):L$},e})();var jh=(function(){function e(){}return e.prototype.getTracer=function(t,n,o){return new va},e})();var B$=new jh,yd=(function(){function e(){}return e.prototype.getTracer=function(t,n,o){var r;return(r=this.getDelegateTracer(t,n,o))!==null&&r!==void 0?r:new Oh(this,t,n,o)},e.prototype.getDelegate=function(){var t;return(t=this._delegate)!==null&&t!==void 0?t:B$},e.prototype.setDelegate=function(t){this._delegate=t},e.prototype.getDelegateTracer=function(t,n,o){var r;return(r=this._delegate)===null||r===void 0?void 0:r.getTracer(t,n,o)},e})();var an;(function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"})(an||(an={}));var bd="trace",Nh=(function(){function e(){this._proxyTracerProvider=new yd,this.wrapSpanContext=Ph,this.isSpanContextValid=ha,this.deleteSpan=Ch,this.getSpan=fa,this.getActiveSpan=Th,this.getSpanContext=ga,this.setSpan=Oo,this.setSpanContext=Ah}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalTracerProvider=function(t){var n=rn(bd,this._proxyTracerProvider,on.instance());return n&&this._proxyTracerProvider.setDelegate(t),n},e.prototype.getTracerProvider=function(){return Mt(bd)||this._proxyTracerProvider},e.prototype.getTracer=function(t,n){return this.getTracerProvider().getTracer(t,n)},e.prototype.disable=function(){nn(bd,on.instance()),this._proxyTracerProvider=new yd},e})();var _d=Nh.getInstance();var q$=Object.defineProperty,V$=(e,t)=>{for(var n in t)q$(e,n,{get:t[n],enumerable:!0})},Vh="AI_NoOutputSpecifiedError",Jh=`vercel.ai.error.${Vh}`,J$=Symbol.for(Jh),Gh,G$=class extends Z{constructor({message:e="No output specified."}={}){super({name:Vh,message:e}),this[Gh]=!0}static isInstance(e){return Z.hasMarker(e,Jh)}};Gh=J$;function W$(e){let t="AI SDK Warning:";switch(e.type){case"unsupported-setting":{let n=`${t} The "${e.setting}" setting is not supported by this model`;return e.details&&(n+=` - ${e.details}`),n}case"unsupported-tool":{let n="name"in e.tool?e.tool.name:"unknown tool",o=`${t} The tool "${n}" is not supported by this model`;return e.details&&(o+=` - ${e.details}`),o}case"other":return`${t} ${e.message}`;default:return`${t} ${JSON.stringify(e,null,2)}`}}var K$="AI SDK Warning System: To turn off warning logging, set the AI_SDK_LOG_WARNINGS global to false.",zh=!1,H$=e=>{if(e.length===0)return;let t=globalThis.AI_SDK_LOG_WARNINGS;if(t!==!1){if(typeof t=="function"){t(e);return}zh||(zh=!0,console.info(K$));for(let n of e)console.warn(W$(n))}},Wh="AI_InvalidArgumentError",Kh=`vercel.ai.error.${Wh}`,Y$=Symbol.for(Kh),Hh,bt=class extends Z{constructor({parameter:e,value:t,message:n}){super({name:Wh,message:`Invalid argument for parameter ${e}: ${n}`}),this[Hh]=!0,this.parameter=e,this.value=t}static isInstance(e){return Z.hasMarker(e,Kh)}};Hh=Y$;var X$="AI_InvalidStreamPartError",Q$=`vercel.ai.error.${X$}`,eS=Symbol.for(Q$),tS;tS=eS;var Yh="AI_InvalidToolInputError",Xh=`vercel.ai.error.${Yh}`,rS=Symbol.for(Xh),Qh,ev=class extends Z{constructor({toolInput:e,toolName:t,cause:n,message:o=`Invalid input for tool ${t}: ${ft(n)}`}){super({name:Yh,message:o,cause:n}),this[Qh]=!0,this.toolInput=e,this.toolName=t}static isInstance(e){return Z.hasMarker(e,Xh)}};Qh=rS;var nS="AI_MCPClientError",oS=`vercel.ai.error.${nS}`,iS=Symbol.for(oS),aS;aS=iS;var sS="AI_NoImageGeneratedError",uS=`vercel.ai.error.${sS}`,lS=Symbol.for(uS),cS;cS=lS;var tv="AI_NoObjectGeneratedError",rv=`vercel.ai.error.${tv}`,dS=Symbol.for(rv),nv,Rh=class extends Z{constructor({message:e="No object generated.",cause:t,text:n,response:o,usage:r,finishReason:i}){super({name:tv,message:e,cause:t}),this[nv]=!0,this.text=n,this.response=o,this.usage=r,this.finishReason=i}static isInstance(e){return Z.hasMarker(e,rv)}};nv=dS;var ov="AI_NoOutputGeneratedError",iv=`vercel.ai.error.${ov}`,pS=Symbol.for(iv),av,mS=class extends Z{constructor({message:e="No output generated.",cause:t}={}){super({name:ov,message:e,cause:t}),this[av]=!0}static isInstance(e){return Z.hasMarker(e,iv)}};av=pS;var sv="AI_NoSuchToolError",uv=`vercel.ai.error.${sv}`,fS=Symbol.for(uv),lv,kd=class extends Z{constructor({toolName:e,availableTools:t=void 0,message:n=`Model tried to call unavailable tool '${e}'. ${t===void 0?"No tools are available.":`Available tools: ${t.join(", ")}.`}`}){super({name:sv,message:n}),this[lv]=!0,this.toolName=e,this.availableTools=t}static isInstance(e){return Z.hasMarker(e,uv)}};lv=fS;var cv="AI_ToolCallRepairError",dv=`vercel.ai.error.${cv}`,gS=Symbol.for(dv),pv,hS=class extends Z{constructor({cause:e,originalError:t,message:n=`Error repairing tool call: ${ft(e)}`}){super({name:cv,message:n,cause:e}),this[pv]=!0,this.originalError=t}static isInstance(e){return Z.hasMarker(e,dv)}};pv=gS;var vS=class extends Z{constructor(e){super({name:"AI_UnsupportedModelVersionError",message:`Unsupported model version ${e.version} for provider "${e.provider}" and model "${e.modelId}". AI SDK 5 only supports models that implement specification version "v2".`}),this.version=e.version,this.provider=e.provider,this.modelId=e.modelId}},yS="AI_InvalidDataContentError",bS=`vercel.ai.error.${yS}`,_S=Symbol.for(bS),xS;xS=_S;var mv="AI_InvalidMessageRoleError",fv=`vercel.ai.error.${mv}`,DS=Symbol.for(fv),gv,wS=class extends Z{constructor({role:e,message:t=`Invalid message role: '${e}'. Must be one of: "system", "user", "assistant", "tool".`}){super({name:mv,message:t}),this[gv]=!0,this.role=e}static isInstance(e){return Z.hasMarker(e,fv)}};gv=DS;var kS="AI_MessageConversionError",$S=`vercel.ai.error.${kS}`,SS=Symbol.for($S),IS;IS=SS;var hv="AI_DownloadError",vv=`vercel.ai.error.${hv}`,ES=Symbol.for(vv),yv,xd=class extends Z{constructor({url:e,statusCode:t,statusText:n,cause:o,message:r=o==null?`Failed to download ${e}: ${t} ${n}`:`Failed to download ${e}: ${o}`}){super({name:hv,message:r,cause:o}),this[yv]=!0,this.url=e,this.statusCode=t,this.statusText=n}static isInstance(e){return Z.hasMarker(e,vv)}};yv=ES;var bv="AI_RetryError",_v=`vercel.ai.error.${bv}`,TS=Symbol.for(_v),xv,Fh=class extends Z{constructor({message:e,reason:t,errors:n}){super({name:bv,message:e}),this[xv]=!0,this.reason=t,this.errors=n,this.lastError=n[n.length-1]}static isInstance(e){return Z.hasMarker(e,_v)}};xv=TS;function Dv(e){if(typeof e!="string"){if(e.specificationVersion!=="v2")throw new vS({version:e.specificationVersion,provider:e.provider,modelId:e.modelId});return e}return CS().languageModel(e)}function CS(){var e;return(e=globalThis.AI_SDK_DEFAULT_PROVIDER)!=null?e:bh}var AS=[{mediaType:"image/gif",bytesPrefix:[71,73,70],base64Prefix:"R0lG"},{mediaType:"image/png",bytesPrefix:[137,80,78,71],base64Prefix:"iVBORw"},{mediaType:"image/jpeg",bytesPrefix:[255,216],base64Prefix:"/9j/"},{mediaType:"image/webp",bytesPrefix:[82,73,70,70],base64Prefix:"UklGRg"},{mediaType:"image/bmp",bytesPrefix:[66,77],base64Prefix:"Qk"},{mediaType:"image/tiff",bytesPrefix:[73,73,42,0],base64Prefix:"SUkqAA"},{mediaType:"image/tiff",bytesPrefix:[77,77,0,42],base64Prefix:"TU0AKg"},{mediaType:"image/avif",bytesPrefix:[0,0,0,32,102,116,121,112,97,118,105,102],base64Prefix:"AAAAIGZ0eXBhdmlm"},{mediaType:"image/heic",bytesPrefix:[0,0,0,32,102,116,121,112,104,101,105,99],base64Prefix:"AAAAIGZ0eXBoZWlj"}];var PS=e=>{let t=typeof e=="string"?ko(e):e,n=(t[6]&127)<<21|(t[7]&127)<<14|(t[8]&127)<<7|t[9]&127;return t.slice(n+10)};function OS(e){return typeof e=="string"&&e.startsWith("SUQz")||typeof e!="string"&&e.length>10&&e[0]===73&&e[1]===68&&e[2]===51?PS(e):e}function jS({data:e,signatures:t}){let n=OS(e);for(let o of t)if(typeof n=="string"?n.startsWith(o.base64Prefix):n.length>=o.bytesPrefix.length&&o.bytesPrefix.every((r,i)=>n[i]===r))return o.mediaType}var NS=async({url:e})=>{var t;let n=e.toString();try{let o=await fetch(n);if(!o.ok)throw new xd({url:n,statusCode:o.status,statusText:o.statusText});return{data:new Uint8Array(await o.arrayBuffer()),mediaType:(t=o.headers.get("content-type"))!=null?t:void 0}}catch(o){throw xd.isInstance(o)?o:new xd({url:n,cause:o})}},zS=(e=NS)=>t=>Promise.all(t.map(async n=>n.isUrlSupportedByModel?null:e(n)));function RS(e){try{let[t,n]=e.split(",");return{mediaType:t.split(";")[0].split(":")[1],base64Content:n}}catch{return{mediaType:void 0,base64Content:void 0}}}var wv=s.union([s.string(),s.instanceof(Uint8Array),s.instanceof(ArrayBuffer),s.custom(e=>{var t,n;return(n=(t=globalThis.Buffer)==null?void 0:t.isBuffer(e))!=null?n:!1},{message:"Must be a Buffer"})]);function kv(e){if(e instanceof Uint8Array)return{data:e,mediaType:void 0};if(e instanceof ArrayBuffer)return{data:new Uint8Array(e),mediaType:void 0};if(typeof e=="string")try{e=new URL(e)}catch{}if(e instanceof URL&&e.protocol==="data:"){let{mediaType:t,base64Content:n}=RS(e.toString());if(t==null||n==null)throw new Z({name:"InvalidDataContentError",message:`Invalid data URL format in content ${e.toString()}`});return{data:n,mediaType:t}}return{data:e,mediaType:void 0}}function FS(e){return typeof e=="string"?e:e instanceof ArrayBuffer?en(new Uint8Array(e)):en(e)}async function MS({prompt:e,supportedUrls:t,download:n=zS()}){let o=await ZS(e.messages,n,t);return[...e.system!=null?[{role:"system",content:e.system}]:[],...e.messages.map(r=>US({message:r,downloadedAssets:o}))]}function US({message:e,downloadedAssets:t}){let n=e.role;switch(n){case"system":return{role:"system",content:e.content,providerOptions:e.providerOptions};case"user":return typeof e.content=="string"?{role:"user",content:[{type:"text",text:e.content}],providerOptions:e.providerOptions}:{role:"user",content:e.content.map(o=>LS(o,t)).filter(o=>o.type!=="text"||o.text!==""),providerOptions:e.providerOptions};case"assistant":return typeof e.content=="string"?{role:"assistant",content:[{type:"text",text:e.content}],providerOptions:e.providerOptions}:{role:"assistant",content:e.content.filter(o=>o.type!=="text"||o.text!=="").map(o=>{let r=o.providerOptions;switch(o.type){case"file":{let{data:i,mediaType:a}=kv(o.data);return{type:"file",data:i,filename:o.filename,mediaType:a??o.mediaType,providerOptions:r}}case"reasoning":return{type:"reasoning",text:o.text,providerOptions:r};case"text":return{type:"text",text:o.text,providerOptions:r};case"tool-call":return{type:"tool-call",toolCallId:o.toolCallId,toolName:o.toolName,input:o.input,providerExecuted:o.providerExecuted,providerOptions:r};case"tool-result":return{type:"tool-result",toolCallId:o.toolCallId,toolName:o.toolName,output:o.output,providerOptions:r}}}),providerOptions:e.providerOptions};case"tool":return{role:"tool",content:e.content.map(o=>({type:"tool-result",toolCallId:o.toolCallId,toolName:o.toolName,output:o.output,providerOptions:o.providerOptions})),providerOptions:e.providerOptions};default:{let o=n;throw new wS({role:o})}}}async function ZS(e,t,n){let o=e.filter(i=>i.role==="user").map(i=>i.content).filter(i=>Array.isArray(i)).flat().filter(i=>i.type==="image"||i.type==="file").map(i=>{var a;let u=(a=i.mediaType)!=null?a:i.type==="image"?"image/*":void 0,l=i.type==="image"?i.image:i.data;if(typeof l=="string")try{l=new URL(l)}catch{}return{mediaType:u,data:l}}).filter(i=>i.data instanceof URL).map(i=>({url:i.data,isUrlSupportedByModel:i.mediaType!=null&&_g({url:i.data.toString(),mediaType:i.mediaType,supportedUrls:n})})),r=await t(o);return Object.fromEntries(r.filter(i=>i?.data!=null).map(({data:i,mediaType:a},u)=>[o[u].url.toString(),{data:i,mediaType:a}]))}function LS(e,t){var n;if(e.type==="text")return{type:"text",text:e.text,providerOptions:e.providerOptions};let o,r=e.type;switch(r){case"image":o=e.image;break;case"file":o=e.data;break;default:throw new Error(`Unsupported part type: ${r}`)}let{data:i,mediaType:a}=kv(o),u=a??e.mediaType,l=i;if(l instanceof URL){let c=t[l.toString()];c&&(l=c.data,u??(u=c.mediaType))}switch(r){case"image":return(l instanceof Uint8Array||typeof l=="string")&&(u=(n=jS({data:l,signatures:AS}))!=null?n:u),{type:"file",mediaType:u??"image/*",filename:void 0,data:l,providerOptions:e.providerOptions};case"file":{if(u==null)throw new Error("Media type is missing for file part");return{type:"file",mediaType:u,filename:e.filename,data:l,providerOptions:e.providerOptions}}}}function BS({maxOutputTokens:e,temperature:t,topP:n,topK:o,presencePenalty:r,frequencyPenalty:i,seed:a,stopSequences:u}){if(e!=null){if(!Number.isInteger(e))throw new bt({parameter:"maxOutputTokens",value:e,message:"maxOutputTokens must be an integer"});if(e<1)throw new bt({parameter:"maxOutputTokens",value:e,message:"maxOutputTokens must be >= 1"})}if(t!=null&&typeof t!="number")throw new bt({parameter:"temperature",value:t,message:"temperature must be a number"});if(n!=null&&typeof n!="number")throw new bt({parameter:"topP",value:n,message:"topP must be a number"});if(o!=null&&typeof o!="number")throw new bt({parameter:"topK",value:o,message:"topK must be a number"});if(r!=null&&typeof r!="number")throw new bt({parameter:"presencePenalty",value:r,message:"presencePenalty must be a number"});if(i!=null&&typeof i!="number")throw new bt({parameter:"frequencyPenalty",value:i,message:"frequencyPenalty must be a number"});if(a!=null&&!Number.isInteger(a))throw new bt({parameter:"seed",value:a,message:"seed must be an integer"});return{maxOutputTokens:e,temperature:t,topP:n,topK:o,presencePenalty:r,frequencyPenalty:i,stopSequences:u,seed:a}}function qS(e){return e!=null&&Object.keys(e).length>0}function VS({tools:e,toolChoice:t,activeTools:n}){return qS(e)?{tools:(n!=null?Object.entries(e).filter(([r])=>n.includes(r)):Object.entries(e)).map(([r,i])=>{let a=i.type;switch(a){case void 0:case"dynamic":case"function":return{type:"function",name:r,description:i.description,inputSchema:fr(i.inputSchema).jsonSchema,providerOptions:i.providerOptions};case"provider-defined":return{type:"provider-defined",name:r,id:i.id,args:i.args};default:{let u=a;throw new Error(`Unsupported tool type: ${u}`)}}}),toolChoice:t==null?{type:"auto"}:typeof t=="string"?{type:t}:{type:"tool",toolName:t.toolName}}:{tools:void 0,toolChoice:void 0}}var No=s.lazy(()=>s.union([s.null(),s.string(),s.number(),s.boolean(),s.record(s.string(),No),s.array(No)])),Y=s.record(s.string(),s.record(s.string(),No)),$v=s.object({type:s.literal("text"),text:s.string(),providerOptions:Y.optional()}),JS=s.object({type:s.literal("image"),image:s.union([wv,s.instanceof(URL)]),mediaType:s.string().optional(),providerOptions:Y.optional()}),Sv=s.object({type:s.literal("file"),data:s.union([wv,s.instanceof(URL)]),filename:s.string().optional(),mediaType:s.string(),providerOptions:Y.optional()}),GS=s.object({type:s.literal("reasoning"),text:s.string(),providerOptions:Y.optional()}),WS=s.object({type:s.literal("tool-call"),toolCallId:s.string(),toolName:s.string(),input:s.unknown(),providerOptions:Y.optional(),providerExecuted:s.boolean().optional()}),KS=s.discriminatedUnion("type",[s.object({type:s.literal("text"),value:s.string()}),s.object({type:s.literal("json"),value:No}),s.object({type:s.literal("error-text"),value:s.string()}),s.object({type:s.literal("error-json"),value:No}),s.object({type:s.literal("content"),value:s.array(s.union([s.object({type:s.literal("text"),text:s.string()}),s.object({type:s.literal("media"),data:s.string(),mediaType:s.string()})]))})]),Iv=s.object({type:s.literal("tool-result"),toolCallId:s.string(),toolName:s.string(),output:KS,providerOptions:Y.optional()}),HS=s.object({role:s.literal("system"),content:s.string(),providerOptions:Y.optional()});var YS=s.object({role:s.literal("user"),content:s.union([s.string(),s.array(s.union([$v,JS,Sv]))]),providerOptions:Y.optional()});var XS=s.object({role:s.literal("assistant"),content:s.union([s.string(),s.array(s.union([$v,Sv,GS,WS,Iv]))]),providerOptions:Y.optional()});var QS=s.object({role:s.literal("tool"),content:s.array(Iv),providerOptions:Y.optional()});var eI=s.union([HS,YS,XS,QS]);async function tI(e){if(e.prompt==null&&e.messages==null)throw new $t({prompt:e,message:"prompt or messages must be defined"});if(e.prompt!=null&&e.messages!=null)throw new $t({prompt:e,message:"prompt and messages cannot be defined at the same time"});if(e.system!=null&&typeof e.system!="string")throw new $t({prompt:e,message:"system must be a string"});let t;if(e.prompt!=null&&typeof e.prompt=="string")t=[{role:"user",content:e.prompt}];else if(e.prompt!=null&&Array.isArray(e.prompt))t=e.prompt;else if(e.messages!=null)t=e.messages;else throw new $t({prompt:e,message:"prompt or messages must be defined"});if(t.length===0)throw new $t({prompt:e,message:"messages must not be empty"});let n=await Rt({value:t,schema:s.array(eI)});if(!n.success)throw new $t({prompt:e,message:"The messages must be a ModelMessage[]. If you have passed a UIMessage[], you can use convertToModelMessages to convert them.",cause:n.error});return{messages:t,system:e.system}}function rI(e){return To.isInstance(e)||pd.isInstance(e)?new Z({name:"GatewayError",message:"Vercel AI Gateway access failed. If you want to use AI SDK providers directly, use the providers, e.g. @ai-sdk/openai, or register a different global default provider.",cause:e}):e}function $d({operationId:e,telemetry:t}){return{"operation.name":`${e}${t?.functionId!=null?` ${t.functionId}`:""}`,"resource.name":t?.functionId,"ai.operationId":e,"ai.telemetry.functionId":t?.functionId}}function nI({model:e,settings:t,telemetry:n,headers:o}){var r;return{"ai.model.provider":e.provider,"ai.model.id":e.modelId,...Object.entries(t).reduce((i,[a,u])=>(i[`ai.settings.${a}`]=u,i),{}),...Object.entries((r=n?.metadata)!=null?r:{}).reduce((i,[a,u])=>(i[`ai.telemetry.metadata.${a}`]=u,i),{}),...Object.entries(o??{}).reduce((i,[a,u])=>(u!==void 0&&(i[`ai.request.headers.${a}`]=u),i),{})}}var oI={startSpan(){return ya},startActiveSpan(e,t,n,o){if(typeof t=="function")return t(ya);if(typeof n=="function")return n(ya);if(typeof o=="function")return o(ya)}},ya={spanContext(){return iI},setAttribute(){return this},setAttributes(){return this},addEvent(){return this},addLink(){return this},addLinks(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording(){return!1},recordException(){return this}},iI={traceId:"",spanId:"",traceFlags:0};function aI({isEnabled:e=!1,tracer:t}={}){return e?t||_d.getTracer("ai"):oI}function Sd({name:e,tracer:t,attributes:n,fn:o,endWhenDone:r=!0}){return t.startActiveSpan(e,{attributes:n},async i=>{try{let a=await o(i);return r&&i.end(),a}catch(a){try{Ev(i,a)}finally{i.end()}throw a}})}function Ev(e,t){t instanceof Error?(e.recordException({name:t.name,message:t.message,stack:t.stack}),e.setStatus({code:an.ERROR,message:t.message})):e.setStatus({code:an.ERROR})}function sn({telemetry:e,attributes:t}){return e?.isEnabled!==!0?{}:Object.entries(t).reduce((n,[o,r])=>{if(r==null)return n;if(typeof r=="object"&&"input"in r&&typeof r.input=="function"){if(e?.recordInputs===!1)return n;let i=r.input();return i==null?n:{...n,[o]:i}}if(typeof r=="object"&&"output"in r&&typeof r.output=="function"){if(e?.recordOutputs===!1)return n;let i=r.output();return i==null?n:{...n,[o]:i}}return{...n,[o]:r}},{})}function sI(e){return JSON.stringify(e.map(t=>({...t,content:typeof t.content=="string"?t.content:t.content.map(n=>n.type==="file"?{...n,data:n.data instanceof Uint8Array?FS(n.data):n.data}:n)})))}function uI(e,t){return{inputTokens:jo(e.inputTokens,t.inputTokens),outputTokens:jo(e.outputTokens,t.outputTokens),totalTokens:jo(e.totalTokens,t.totalTokens),reasoningTokens:jo(e.reasoningTokens,t.reasoningTokens),cachedInputTokens:jo(e.cachedInputTokens,t.cachedInputTokens)}}function jo(e,t){return e==null&&t==null?void 0:(e??0)+(t??0)}function Mh(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function lI({error:e,exponentialBackoffDelay:t}){let n=e.responseHeaders;if(!n)return t;let o,r=n["retry-after-ms"];if(r){let a=parseFloat(r);Number.isNaN(a)||(o=a)}let i=n["retry-after"];if(i&&o===void 0){let a=parseFloat(i);Number.isNaN(a)?o=Date.parse(i)-Date.now():o=a*1e3}return o!=null&&!Number.isNaN(o)&&0<=o&&(o<60*1e3||o<t)?o:t}var cI=({maxRetries:e=2,initialDelayInMs:t=2e3,backoffFactor:n=2,abortSignal:o}={})=>async r=>Tv(r,{maxRetries:e,delayInMs:t,backoffFactor:n,abortSignal:o});async function Tv(e,{maxRetries:t,delayInMs:n,backoffFactor:o,abortSignal:r},i=[]){try{return await e()}catch(a){if(Nt(a)||t===0)throw a;let u=Do(a),l=[...i,a],c=l.length;if(c>t)throw new Fh({message:`Failed after ${c} attempts. Last error: ${u}`,reason:"maxRetriesExceeded",errors:l});if(a instanceof Error&&le.isInstance(a)&&a.isRetryable===!0&&c<=t)return await gg(lI({error:a,exponentialBackoffDelay:n}),{abortSignal:r}),Tv(e,{maxRetries:t,delayInMs:o*n,backoffFactor:o,abortSignal:r},l);throw c===1?a:new Fh({message:`Failed after ${c} attempts with non-retryable error: '${u}'`,reason:"errorNotRetryable",errors:l})}}function dI({maxRetries:e,abortSignal:t}){if(e!=null){if(!Number.isInteger(e))throw new bt({parameter:"maxRetries",value:e,message:"maxRetries must be an integer"});if(e<0)throw new bt({parameter:"maxRetries",value:e,message:"maxRetries must be >= 0"})}let n=e??2;return{maxRetries:n,retry:cI({maxRetries:n,abortSignal:t})}}var pI=class{constructor({data:e,mediaType:t}){let n=e instanceof Uint8Array;this.base64Data=n?void 0:e,this.uint8ArrayData=n?e:void 0,this.mediaType=t}get base64(){return this.base64Data==null&&(this.base64Data=en(this.uint8ArrayData)),this.base64Data}get uint8Array(){return this.uint8ArrayData==null&&(this.uint8ArrayData=ko(this.base64Data)),this.uint8ArrayData}},mI=class extends pI{constructor(e){super(e),this.type="file"}};async function fI({toolCall:e,tools:t,repairToolCall:n,system:o,messages:r}){try{if(t==null)throw new kd({toolName:e.toolName});try{return await Uh({toolCall:e,tools:t})}catch(i){if(n==null||!(kd.isInstance(i)||ev.isInstance(i)))throw i;let a=null;try{a=await n({toolCall:e,tools:t,inputSchema:({toolName:u})=>{let{inputSchema:l}=t[u];return fr(l).jsonSchema},system:o,messages:r,error:i})}catch(u){throw new hS({cause:u,originalError:i})}if(a==null)throw i;return await Uh({toolCall:a,tools:t})}}catch(i){let a=await yt({text:e.input}),u=a.success?a.value:e.input;return{type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,input:u,dynamic:!0,invalid:!0,error:i}}}async function Uh({toolCall:e,tools:t}){let n=e.toolName,o=t[n];if(o==null)throw new kd({toolName:e.toolName,availableTools:Object.keys(t)});let r=fr(o.inputSchema),i=e.input.trim()===""?await Rt({value:{},schema:r}):await yt({text:e.input,schema:r});if(i.success===!1)throw new ev({toolName:n,toolInput:e.input,cause:i.error});return o.type==="dynamic"?{type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,input:i.value,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,dynamic:!0}:{type:"tool-call",toolCallId:e.toolCallId,toolName:n,input:i.value,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}}var gI=class{constructor({content:e,finishReason:t,usage:n,warnings:o,request:r,response:i,providerMetadata:a}){this.content=e,this.finishReason=t,this.usage=n,this.warnings=o,this.request=r,this.response=i,this.providerMetadata=a}get text(){return this.content.filter(e=>e.type==="text").map(e=>e.text).join("")}get reasoning(){return this.content.filter(e=>e.type==="reasoning")}get reasoningText(){return this.reasoning.length===0?void 0:this.reasoning.map(e=>e.text).join("")}get files(){return this.content.filter(e=>e.type==="file").map(e=>e.file)}get sources(){return this.content.filter(e=>e.type==="source")}get toolCalls(){return this.content.filter(e=>e.type==="tool-call")}get staticToolCalls(){return this.toolCalls.filter(e=>e.dynamic===!1)}get dynamicToolCalls(){return this.toolCalls.filter(e=>e.dynamic===!0)}get toolResults(){return this.content.filter(e=>e.type==="tool-result")}get staticToolResults(){return this.toolResults.filter(e=>e.dynamic===!1)}get dynamicToolResults(){return this.toolResults.filter(e=>e.dynamic===!0)}};function hI(e){return({steps:t})=>t.length===e}async function vI({stopConditions:e,steps:t}){return(await Promise.all(e.map(n=>n({steps:t})))).some(n=>n)}function Dd({output:e,tool:t,errorMode:n}){return n==="text"?{type:"error-text",value:ft(e)}:n==="json"?{type:"error-json",value:Zh(e)}:t?.toModelOutput?t.toModelOutput(e):typeof e=="string"?{type:"text",value:e}:{type:"json",value:Zh(e)}}function Zh(e){return e===void 0?null:e}function Lh({content:e,tools:t}){let n=[],o=e.filter(i=>i.type!=="source").filter(i=>(i.type!=="tool-result"||i.providerExecuted)&&(i.type!=="tool-error"||i.providerExecuted)).filter(i=>i.type!=="text"||i.text.length>0).map(i=>{switch(i.type){case"text":return{type:"text",text:i.text,providerOptions:i.providerMetadata};case"reasoning":return{type:"reasoning",text:i.text,providerOptions:i.providerMetadata};case"file":return{type:"file",data:i.file.base64,mediaType:i.file.mediaType,providerOptions:i.providerMetadata};case"tool-call":return{type:"tool-call",toolCallId:i.toolCallId,toolName:i.toolName,input:i.input,providerExecuted:i.providerExecuted,providerOptions:i.providerMetadata};case"tool-result":return{type:"tool-result",toolCallId:i.toolCallId,toolName:i.toolName,output:Dd({tool:t?.[i.toolName],output:i.output,errorMode:"none"}),providerExecuted:!0,providerOptions:i.providerMetadata};case"tool-error":return{type:"tool-result",toolCallId:i.toolCallId,toolName:i.toolName,output:Dd({tool:t?.[i.toolName],output:i.error,errorMode:"json"}),providerOptions:i.providerMetadata}}});o.length>0&&n.push({role:"assistant",content:o});let r=e.filter(i=>i.type==="tool-result"||i.type==="tool-error").filter(i=>!i.providerExecuted).map(i=>({type:"tool-result",toolCallId:i.toolCallId,toolName:i.toolName,output:Dd({tool:t?.[i.toolName],output:i.type==="tool-result"?i.output:i.error,errorMode:i.type==="tool-error"?"text":"none"})}));return r.length>0&&n.push({role:"tool",content:r}),n}var t4=zt({prefix:"aitxt",size:24});function xa(e,t){let n=new Headers(e??{});for(let[o,r]of Object.entries(t))n.has(o)||n.set(o,r);return n}function yI({status:e,statusText:t,headers:n,textStream:o}){return new Response(o.pipeThrough(new TextEncoderStream),{status:e??200,statusText:t,headers:xa(n,{"content-type":"text/plain; charset=utf-8"})})}function Cv({response:e,status:t,statusText:n,headers:o,stream:r}){e.writeHead(t??200,n,o);let i=r.getReader();(async()=>{try{for(;;){let{done:u,value:l}=await i.read();if(u)break;e.write(l)}}catch(u){throw u}finally{e.end()}})()}function bI({response:e,status:t,statusText:n,headers:o,textStream:r}){Cv({response:e,status:t,statusText:n,headers:Object.fromEntries(xa(o,{"content-type":"text/plain; charset=utf-8"}).entries()),stream:r.pipeThrough(new TextEncoderStream)})}var Av=class extends TransformStream{constructor(){super({transform(e,t){t.enqueue(`data: ${JSON.stringify(e)}
|
|
75
75
|
|
|
76
76
|
`)},flush(e){e.enqueue(`data: [DONE]
|
|
77
77
|
|
|
78
|
-
`)}})}},Pv={"content-type":"text/event-stream","cache-control":"no-cache",connection:"keep-alive","x-vercel-ai-ui-message-stream":"v1","x-accel-buffering":"no"};function _I({status:e,statusText:t,headers:n,stream:o,consumeSseStream:r}){let i=o.pipeThrough(new Av);if(r){let[a,u]=i.tee();i=a,r({stream:u})}return new Response(i.pipeThrough(new TextEncoderStream),{status:e,statusText:t,headers:xa(n,Pv)})}function xI({originalMessages:e,responseMessageId:t}){if(e==null)return;let n=e[e.length-1];return n?.role==="assistant"?n.id:typeof t=="function"?t():t}var a4=s.union([s.strictObject({type:s.literal("text-start"),id:s.string(),providerMetadata:Y.optional()}),s.strictObject({type:s.literal("text-delta"),id:s.string(),delta:s.string(),providerMetadata:Y.optional()}),s.strictObject({type:s.literal("text-end"),id:s.string(),providerMetadata:Y.optional()}),s.strictObject({type:s.literal("error"),errorText:s.string()}),s.strictObject({type:s.literal("tool-input-start"),toolCallId:s.string(),toolName:s.string(),providerExecuted:s.boolean().optional(),dynamic:s.boolean().optional()}),s.strictObject({type:s.literal("tool-input-delta"),toolCallId:s.string(),inputTextDelta:s.string()}),s.strictObject({type:s.literal("tool-input-available"),toolCallId:s.string(),toolName:s.string(),input:s.unknown(),providerExecuted:s.boolean().optional(),providerMetadata:Y.optional(),dynamic:s.boolean().optional()}),s.strictObject({type:s.literal("tool-input-error"),toolCallId:s.string(),toolName:s.string(),input:s.unknown(),providerExecuted:s.boolean().optional(),providerMetadata:Y.optional(),dynamic:s.boolean().optional(),errorText:s.string()}),s.strictObject({type:s.literal("tool-output-available"),toolCallId:s.string(),output:s.unknown(),providerExecuted:s.boolean().optional(),dynamic:s.boolean().optional(),preliminary:s.boolean().optional()}),s.strictObject({type:s.literal("tool-output-error"),toolCallId:s.string(),errorText:s.string(),providerExecuted:s.boolean().optional(),dynamic:s.boolean().optional()}),s.strictObject({type:s.literal("reasoning"),text:s.string(),providerMetadata:Y.optional()}),s.strictObject({type:s.literal("reasoning-start"),id:s.string(),providerMetadata:Y.optional()}),s.strictObject({type:s.literal("reasoning-delta"),id:s.string(),delta:s.string(),providerMetadata:Y.optional()}),s.strictObject({type:s.literal("reasoning-end"),id:s.string(),providerMetadata:Y.optional()}),s.strictObject({type:s.literal("reasoning-part-finish")}),s.strictObject({type:s.literal("source-url"),sourceId:s.string(),url:s.string(),title:s.string().optional(),providerMetadata:Y.optional()}),s.strictObject({type:s.literal("source-document"),sourceId:s.string(),mediaType:s.string(),title:s.string(),filename:s.string().optional(),providerMetadata:Y.optional()}),s.strictObject({type:s.literal("file"),url:s.string(),mediaType:s.string(),providerMetadata:Y.optional()}),s.strictObject({type:s.string().startsWith("data-"),id:s.string().optional(),data:s.unknown(),transient:s.boolean().optional()}),s.strictObject({type:s.literal("start-step")}),s.strictObject({type:s.literal("finish-step")}),s.strictObject({type:s.literal("start"),messageId:s.string().optional(),messageMetadata:s.unknown().optional()}),s.strictObject({type:s.literal("finish"),messageMetadata:s.unknown().optional()}),s.strictObject({type:s.literal("abort")}),s.strictObject({type:s.literal("message-metadata"),messageMetadata:s.unknown()})]);function DI(e){return e.type.startsWith("data-")}function Ov(e,t){if(e===void 0&&t===void 0)return;if(e===void 0)return t;if(t===void 0)return e;let n={...e};for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o];if(r===void 0)continue;let i=o in e?e[o]:void 0,a=r!==null&&typeof r=="object"&&!Array.isArray(r)&&!(r instanceof Date)&&!(r instanceof RegExp),u=i!=null&&typeof i=="object"&&!Array.isArray(i)&&!(i instanceof Date)&&!(i instanceof RegExp);a&&u?n[o]=Ov(i,r):n[o]=r}return n}function wI(e){let t=["ROOT"],n=-1,o=null;function r(l,c,m){switch(l){case'"':{n=c,t.pop(),t.push(m),t.push("INSIDE_STRING");break}case"f":case"t":case"n":{n=c,o=c,t.pop(),t.push(m),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(m),t.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=c,t.pop(),t.push(m),t.push("INSIDE_NUMBER");break}case"{":{n=c,t.pop(),t.push(m),t.push("INSIDE_OBJECT_START");break}case"[":{n=c,t.pop(),t.push(m),t.push("INSIDE_ARRAY_START");break}}}function i(l,c){switch(l){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=c,t.pop();break}}}function a(l,c){switch(l){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=c,t.pop();break}}}for(let l=0;l<e.length;l++){let c=e[l];switch(t[t.length-1]){case"ROOT":r(c,l,"FINISH");break;case"INSIDE_OBJECT_START":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}case"}":{n=l,t.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}}break}case"INSIDE_OBJECT_KEY":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY");break}}break}case"INSIDE_OBJECT_AFTER_KEY":{switch(c){case":":{t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE");break}}break}case"INSIDE_OBJECT_BEFORE_VALUE":{r(c,l,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{i(c,l);break}case"INSIDE_STRING":{switch(c){case'"':{t.pop(),n=l;break}case"\\":{t.push("INSIDE_STRING_ESCAPE");break}default:n=l}break}case"INSIDE_ARRAY_START":{switch(c){case"]":{n=l,t.pop();break}default:{n=l,r(c,l,"INSIDE_ARRAY_AFTER_VALUE");break}}break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(c){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=l,t.pop();break}default:{n=l;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{r(c,l,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{t.pop(),n=l;break}case"INSIDE_NUMBER":{switch(c){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=l;break}case"e":case"E":case"-":case".":break;case",":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(c,l),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&i(c,l);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&i(c,l);break}case"]":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(c,l);break}default:{t.pop();break}}break}case"INSIDE_LITERAL":{let h=e.substring(o,l+1);!"false".startsWith(h)&&!"true".startsWith(h)&&!"null".startsWith(h)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?i(c,l):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(c,l)):n=l;break}}}let u=e.slice(0,n+1);for(let l=t.length-1;l>=0;l--)switch(t[l]){case"INSIDE_STRING":{u+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{u+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{u+="]";break}case"INSIDE_LITERAL":{let m=e.substring(o,e.length);"true".startsWith(m)?u+="true".slice(m.length):"false".startsWith(m)?u+="false".slice(m.length):"null".startsWith(m)&&(u+="null".slice(m.length))}}return u}async function jv(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=await yt({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await yt({text:wI(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}function wd(e){return e.type.startsWith("tool-")}function Bh(e){return e.type.split("-").slice(1).join("-")}function kI({lastMessage:e,messageId:t}){return{message:e?.role==="assistant"?e:{id:t,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function $I({stream:e,messageMetadataSchema:t,dataPartSchemas:n,runUpdateMessageJob:o,onError:r,onToolCall:i,onData:a}){return e.pipeThrough(new TransformStream({async transform(u,l){await o(async({state:c,write:m})=>{var h,y,p,d;function f(_){let T=c.message.parts.filter(wd).find($=>$.toolCallId===_);if(T==null)throw new Error("tool-output-error must be preceded by a tool-input-available");return T}function v(_){let T=c.message.parts.filter($=>$.type==="dynamic-tool").find($=>$.toolCallId===_);if(T==null)throw new Error("tool-output-error must be preceded by a tool-input-available");return T}function x(_){var O;let T=c.message.parts.find(M=>wd(M)&&M.toolCallId===_.toolCallId),$=_,k=T;T!=null?(T.state=_.state,k.input=$.input,k.output=$.output,k.errorText=$.errorText,k.rawInput=$.rawInput,k.preliminary=$.preliminary,k.providerExecuted=(O=$.providerExecuted)!=null?O:T.providerExecuted,$.providerMetadata!=null&&T.state==="input-available"&&(T.callProviderMetadata=$.providerMetadata)):c.message.parts.push({type:`tool-${_.toolName}`,toolCallId:_.toolCallId,state:_.state,input:$.input,output:$.output,rawInput:$.rawInput,errorText:$.errorText,providerExecuted:$.providerExecuted,preliminary:$.preliminary,...$.providerMetadata!=null?{callProviderMetadata:$.providerMetadata}:{}})}function b(_){var O;let T=c.message.parts.find(M=>M.type==="dynamic-tool"&&M.toolCallId===_.toolCallId),$=_,k=T;T!=null?(T.state=_.state,k.toolName=_.toolName,k.input=$.input,k.output=$.output,k.errorText=$.errorText,k.rawInput=(O=$.rawInput)!=null?O:k.rawInput,k.preliminary=$.preliminary,$.providerMetadata!=null&&T.state==="input-available"&&(T.callProviderMetadata=$.providerMetadata)):c.message.parts.push({type:"dynamic-tool",toolName:_.toolName,toolCallId:_.toolCallId,state:_.state,input:$.input,output:$.output,errorText:$.errorText,preliminary:$.preliminary,...$.providerMetadata!=null?{callProviderMetadata:$.providerMetadata}:{}})}async function S(_){if(_!=null){let O=c.message.metadata!=null?Ov(c.message.metadata,_):_;t!=null&&await ua({value:O,schema:t}),c.message.metadata=O}}switch(u.type){case"text-start":{let _={type:"text",text:"",providerMetadata:u.providerMetadata,state:"streaming"};c.activeTextParts[u.id]=_,c.message.parts.push(_),m();break}case"text-delta":{let _=c.activeTextParts[u.id];_.text+=u.delta,_.providerMetadata=(h=u.providerMetadata)!=null?h:_.providerMetadata,m();break}case"text-end":{let _=c.activeTextParts[u.id];_.state="done",_.providerMetadata=(y=u.providerMetadata)!=null?y:_.providerMetadata,delete c.activeTextParts[u.id],m();break}case"reasoning-start":{let _={type:"reasoning",text:"",providerMetadata:u.providerMetadata,state:"streaming"};c.activeReasoningParts[u.id]=_,c.message.parts.push(_),m();break}case"reasoning-delta":{let _=c.activeReasoningParts[u.id];_.text+=u.delta,_.providerMetadata=(p=u.providerMetadata)!=null?p:_.providerMetadata,m();break}case"reasoning-end":{let _=c.activeReasoningParts[u.id];_.providerMetadata=(d=u.providerMetadata)!=null?d:_.providerMetadata,_.state="done",delete c.activeReasoningParts[u.id],m();break}case"file":{c.message.parts.push({type:"file",mediaType:u.mediaType,url:u.url}),m();break}case"source-url":{c.message.parts.push({type:"source-url",sourceId:u.sourceId,url:u.url,title:u.title,providerMetadata:u.providerMetadata}),m();break}case"source-document":{c.message.parts.push({type:"source-document",sourceId:u.sourceId,mediaType:u.mediaType,title:u.title,filename:u.filename,providerMetadata:u.providerMetadata}),m();break}case"tool-input-start":{let _=c.message.parts.filter(wd);c.partialToolCalls[u.toolCallId]={text:"",toolName:u.toolName,index:_.length,dynamic:u.dynamic},u.dynamic?b({toolCallId:u.toolCallId,toolName:u.toolName,state:"input-streaming",input:void 0}):x({toolCallId:u.toolCallId,toolName:u.toolName,state:"input-streaming",input:void 0,providerExecuted:u.providerExecuted}),m();break}case"tool-input-delta":{let _=c.partialToolCalls[u.toolCallId];_.text+=u.inputTextDelta;let{value:O}=await jv(_.text);_.dynamic?b({toolCallId:u.toolCallId,toolName:_.toolName,state:"input-streaming",input:O}):x({toolCallId:u.toolCallId,toolName:_.toolName,state:"input-streaming",input:O}),m();break}case"tool-input-available":{u.dynamic?b({toolCallId:u.toolCallId,toolName:u.toolName,state:"input-available",input:u.input,providerMetadata:u.providerMetadata}):x({toolCallId:u.toolCallId,toolName:u.toolName,state:"input-available",input:u.input,providerExecuted:u.providerExecuted,providerMetadata:u.providerMetadata}),m(),i&&!u.providerExecuted&&await i({toolCall:u});break}case"tool-input-error":{u.dynamic?b({toolCallId:u.toolCallId,toolName:u.toolName,state:"output-error",input:u.input,errorText:u.errorText,providerMetadata:u.providerMetadata}):x({toolCallId:u.toolCallId,toolName:u.toolName,state:"output-error",input:void 0,rawInput:u.input,errorText:u.errorText,providerExecuted:u.providerExecuted,providerMetadata:u.providerMetadata}),m();break}case"tool-output-available":{if(u.dynamic){let _=v(u.toolCallId);b({toolCallId:u.toolCallId,toolName:_.toolName,state:"output-available",input:_.input,output:u.output,preliminary:u.preliminary})}else{let _=f(u.toolCallId);x({toolCallId:u.toolCallId,toolName:Bh(_),state:"output-available",input:_.input,output:u.output,providerExecuted:u.providerExecuted,preliminary:u.preliminary})}m();break}case"tool-output-error":{if(u.dynamic){let _=v(u.toolCallId);b({toolCallId:u.toolCallId,toolName:_.toolName,state:"output-error",input:_.input,errorText:u.errorText})}else{let _=f(u.toolCallId);x({toolCallId:u.toolCallId,toolName:Bh(_),state:"output-error",input:_.input,rawInput:_.rawInput,errorText:u.errorText})}m();break}case"start-step":{c.message.parts.push({type:"step-start"});break}case"finish-step":{c.activeTextParts={},c.activeReasoningParts={};break}case"start":{u.messageId!=null&&(c.message.id=u.messageId),await S(u.messageMetadata),(u.messageId!=null||u.messageMetadata!=null)&&m();break}case"finish":{await S(u.messageMetadata),u.messageMetadata!=null&&m();break}case"message-metadata":{await S(u.messageMetadata),u.messageMetadata!=null&&m();break}case"error":{r?.(new Error(u.errorText));break}default:if(DI(u)){n?.[u.type]!=null&&await ua({value:u.data,schema:n[u.type]});let _=u;if(_.transient){a?.(_);break}let O=_.id!=null?c.message.parts.find(T=>_.type===T.type&&_.id===T.id):void 0;O!=null?O.data=_.data:c.message.parts.push(_),a?.(_),m()}}l.enqueue(u)})}}))}function SI({messageId:e,originalMessages:t=[],onFinish:n,onError:o,stream:r}){let i=t?.[t.length-1];i?.role!=="assistant"?i=void 0:e=i.id;let a=!1,u=r.pipeThrough(new TransformStream({transform(y,p){if(y.type==="start"){let d=y;d.messageId==null&&e!=null&&(d.messageId=e)}y.type==="abort"&&(a=!0),p.enqueue(y)}}));if(n==null)return u;let l=kI({lastMessage:i?structuredClone(i):void 0,messageId:e??""}),c=async y=>{await y({state:l,write:()=>{}})},m=!1,h=async()=>{if(m||!n)return;m=!0;let y=l.message.id===i?.id;await n({isAborted:a,isContinuation:y,responseMessage:l.message,messages:[...y?t.slice(0,-1):t,l.message]})};return $I({stream:u,runUpdateMessageJob:c,onError:o}).pipeThrough(new TransformStream({transform(y,p){p.enqueue(y)},async cancel(){await h()},async flush(){await h()}}))}function II({response:e,status:t,statusText:n,headers:o,stream:r,consumeSseStream:i}){let a=r.pipeThrough(new Av);if(i){let[u,l]=a.tee();a=u,i({stream:l})}Cv({response:e,status:t,statusText:n,headers:Object.fromEntries(xa(o,Pv).entries()),stream:a.pipeThrough(new TextEncoderStream)})}function ba(e){let t=e.pipeThrough(new TransformStream);return t[Symbol.asyncIterator]=function(){let n=this.getReader(),o=!1;async function r(i){var a;o=!0;try{i&&await((a=n.cancel)==null?void 0:a.call(n))}finally{try{n.releaseLock()}catch{}}}return{async next(){if(o)return{done:!0,value:void 0};let{done:i,value:a}=await n.read();return i?(await r(!0),{done:!0,value:void 0}):{done:!1,value:a}},async return(){return await r(!0),{done:!0,value:void 0}},async throw(i){throw await r(!0),i}}},t}async function EI({stream:e,onError:t}){let n=e.getReader();try{for(;;){let{done:o}=await n.read();if(o)break}}catch(o){t?.(o)}finally{n.releaseLock()}}function Vh(){let e,t;return{promise:new Promise((o,r)=>{e=o,t=r}),resolve:e,reject:t}}function TI(){let e=[],t=null,n=!1,o=Vh(),r=()=>{n=!0,o.resolve(),e.forEach(a=>a.cancel()),e=[],t?.close()},i=async()=>{if(n&&e.length===0){t?.close();return}if(e.length===0)return o=Vh(),await o.promise,i();try{let{value:a,done:u}=await e[0].read();u?(e.shift(),e.length>0?await i():n&&t?.close()):t?.enqueue(a)}catch(a){t?.error(a),e.shift(),r()}};return{stream:new ReadableStream({start(a){t=a},pull:i,async cancel(){for(let a of e)await a.cancel();e=[],n=!0}}),addStream:a=>{if(n)throw new Error("Cannot add inner stream: outer stream is closed");e.push(a.getReader()),o.resolve()},close:()=>{n=!0,o.resolve(),e.length===0&&t?.close()},terminate:r}}var _a=class{constructor(){this.status={type:"pending"},this._resolve=void 0,this._reject=void 0}get promise(){return this._promise?this._promise:(this._promise=new Promise((e,t)=>{this.status.type==="resolved"?e(this.status.value):this.status.type==="rejected"&&t(this.status.error),this._resolve=e,this._reject=t}),this._promise)}resolve(e){var t;this.status={type:"resolved",value:e},this._promise&&((t=this._resolve)==null||t.call(this,e))}reject(e){var t;this.status={type:"rejected",error:e},this._promise&&((t=this._reject)==null||t.call(this,e))}};function CI(){var e,t;return(t=(e=globalThis?.performance)==null?void 0:e.now())!=null?t:Date.now()}function AI({tools:e,generatorStream:t,tracer:n,telemetry:o,system:r,messages:i,abortSignal:a,repairToolCall:u,experimental_context:l}){let c=null,m=new ReadableStream({start(x){c=x}}),h=new Set,y=new Map,p=!1,d;function f(){p&&h.size===0&&(d!=null&&c.enqueue(d),c.close())}let v=new TransformStream({async transform(x,b){let S=x.type;switch(S){case"stream-start":case"text-start":case"text-delta":case"text-end":case"reasoning-start":case"reasoning-delta":case"reasoning-end":case"tool-input-start":case"tool-input-delta":case"tool-input-end":case"source":case"response-metadata":case"error":case"raw":{b.enqueue(x);break}case"file":{b.enqueue({type:"file",file:new mI({data:x.data,mediaType:x.mediaType})});break}case"finish":{d={type:"finish",finishReason:x.finishReason,usage:x.usage,providerMetadata:x.providerMetadata};break}case"tool-call":{try{let _=await fI({toolCall:x,tools:e,repairToolCall:u,system:r,messages:i});if(b.enqueue(_),_.invalid){c.enqueue({type:"tool-error",toolCallId:_.toolCallId,toolName:_.toolName,input:_.input,error:Do(_.error),dynamic:!0});break}let O=e[_.toolName];if(y.set(_.toolCallId,_.input),O.onInputAvailable!=null&&await O.onInputAvailable({input:_.input,toolCallId:_.toolCallId,messages:i,abortSignal:a,experimental_context:l}),O.execute!=null&&_.providerExecuted!==!0){let T=lt();h.add(T),Sd({name:"ai.toolCall",attributes:sn({telemetry:o,attributes:{...$d({operationId:"ai.toolCall",telemetry:o}),"ai.toolCall.name":_.toolName,"ai.toolCall.id":_.toolCallId,"ai.toolCall.args":{output:()=>JSON.stringify(_.input)}}}),tracer:n,fn:async $=>{let k;try{let M=ud({execute:O.execute.bind(O),input:_.input,options:{toolCallId:_.toolCallId,messages:i,abortSignal:a,experimental_context:l}});for await(let N of M)c.enqueue({..._,type:"tool-result",output:N.output,...N.type==="preliminary"&&{preliminary:!0}}),N.type==="final"&&(k=N.output)}catch(M){Ev($,M),c.enqueue({..._,type:"tool-error",error:M}),h.delete(T),f();return}h.delete(T),f();try{$.setAttributes(sn({telemetry:o,attributes:{"ai.toolCall.result":{output:()=>JSON.stringify(k)}}}))}catch{}}})}}catch(_){c.enqueue({type:"error",error:_})}break}case"tool-result":{let _=x.toolName;x.isError?c.enqueue({type:"tool-error",toolCallId:x.toolCallId,toolName:_,input:y.get(x.toolCallId),providerExecuted:x.providerExecuted,error:x.result}):b.enqueue({type:"tool-result",toolCallId:x.toolCallId,toolName:_,input:y.get(x.toolCallId),output:x.result,providerExecuted:x.providerExecuted});break}default:{let _=S;throw new Error(`Unhandled chunk type: ${_}`)}}},flush(){p=!0,f()}});return new ReadableStream({async start(x){return Promise.all([t.pipeThrough(v).pipeTo(new WritableStream({write(b){x.enqueue(b)},close(){}})),m.pipeTo(new WritableStream({write(b){x.enqueue(b)},close(){x.close()}}))])}})}var PI=zt({prefix:"aitxt",size:24});function Nv({model:e,tools:t,toolChoice:n,system:o,prompt:r,messages:i,maxRetries:a,abortSignal:u,headers:l,stopWhen:c=hI(1),experimental_output:m,experimental_telemetry:h,prepareStep:y,providerOptions:p,experimental_activeTools:d,activeTools:f=d,experimental_repairToolCall:v,experimental_transform:x,experimental_download:b,includeRawChunks:S=!1,onChunk:_,onError:O=({error:re})=>{console.error(re)},onFinish:T,onAbort:$,onStepFinish:k,experimental_context:M,_internal:{now:N=CI,generateId:U=PI,currentDate:Q=()=>new Date}={},...ie}){return new jI({model:Dv(e),telemetry:h,headers:l,settings:ie,maxRetries:a,abortSignal:u,system:o,prompt:r,messages:i,tools:t,toolChoice:n,transforms:Mh(x),activeTools:f,repairToolCall:v,stopConditions:Mh(c),output:m,providerOptions:p,prepareStep:y,includeRawChunks:S,onChunk:_,onError:O,onFinish:T,onAbort:$,onStepFinish:k,now:N,currentDate:Q,generateId:U,experimental_context:M,download:b})}function OI(e){if(!e)return new TransformStream({transform(a,u){u.enqueue({part:a,partialOutput:void 0})}});let t,n="",o="",r="";function i({controller:a,partialOutput:u=void 0}){a.enqueue({part:{type:"text-delta",id:t,text:o},partialOutput:u}),o=""}return new TransformStream({async transform(a,u){if(a.type==="finish-step"&&o.length>0&&i({controller:u}),a.type!=="text-delta"&&a.type!=="text-start"&&a.type!=="text-end"){u.enqueue({part:a,partialOutput:void 0});return}if(t==null)t=a.id;else if(a.id!==t){u.enqueue({part:a,partialOutput:void 0});return}if(a.type==="text-start"){u.enqueue({part:a,partialOutput:void 0});return}if(a.type==="text-end"){o.length>0&&i({controller:u}),u.enqueue({part:a,partialOutput:void 0});return}n+=a.text,o+=a.text;let l=await e.parsePartial({text:n});if(l!=null){let c=JSON.stringify(l.partial);c!==r&&(i({controller:u,partialOutput:l.partial}),r=c)}}})}var jI=class{constructor({model:e,telemetry:t,headers:n,settings:o,maxRetries:r,abortSignal:i,system:a,prompt:u,messages:l,tools:c,toolChoice:m,transforms:h,activeTools:y,repairToolCall:p,stopConditions:d,output:f,providerOptions:v,prepareStep:x,includeRawChunks:b,now:S,currentDate:_,generateId:O,onChunk:T,onError:$,onFinish:k,onAbort:M,onStepFinish:N,experimental_context:U,download:Q}){this._totalUsage=new _a,this._finishReason=new _a,this._steps=new _a,this.output=f,this.includeRawChunks=b,this.tools=c;let ie,re=[],Dt=[],dt,_r,me={},tt=[],ne=[],de,ye={},xr={},Xy=new TransformStream({async transform(pe,fe){var _e,X,rt;fe.enqueue(pe);let{part:R}=pe;if((R.type==="text-delta"||R.type==="reasoning-delta"||R.type==="source"||R.type==="tool-call"||R.type==="tool-result"||R.type==="tool-input-start"||R.type==="tool-input-delta"||R.type==="raw")&&await T?.({chunk:R}),R.type==="error"&&await $({error:rI(R.error)}),R.type==="text-start"&&(ye[R.id]={type:"text",text:"",providerMetadata:R.providerMetadata},re.push(ye[R.id])),R.type==="text-delta"){let ge=ye[R.id];if(ge==null){fe.enqueue({part:{type:"error",error:`text part ${R.id} not found`},partialOutput:void 0});return}ge.text+=R.text,ge.providerMetadata=(_e=R.providerMetadata)!=null?_e:ge.providerMetadata}if(R.type==="text-end"&&delete ye[R.id],R.type==="reasoning-start"&&(xr[R.id]={type:"reasoning",text:"",providerMetadata:R.providerMetadata},re.push(xr[R.id])),R.type==="reasoning-delta"){let ge=xr[R.id];if(ge==null){fe.enqueue({part:{type:"error",error:`reasoning part ${R.id} not found`},partialOutput:void 0});return}ge.text+=R.text,ge.providerMetadata=(X=R.providerMetadata)!=null?X:ge.providerMetadata}if(R.type==="reasoning-end"){let ge=xr[R.id];if(ge==null){fe.enqueue({part:{type:"error",error:`reasoning part ${R.id} not found`},partialOutput:void 0});return}ge.providerMetadata=(rt=R.providerMetadata)!=null?rt:ge.providerMetadata,delete xr[R.id]}if(R.type==="file"&&re.push({type:"file",file:R.file}),R.type==="source"&&re.push(R),R.type==="tool-call"&&re.push(R),R.type==="tool-result"&&!R.preliminary&&re.push(R),R.type==="tool-error"&&re.push(R),R.type==="start-step"&&(me=R.request,tt=R.warnings),R.type==="finish-step"){let ge=Lh({content:re,tools:c}),mn=new gI({content:re,finishReason:R.finishReason,usage:R.usage,warnings:tt,request:me,response:{...R.response,messages:[...Dt,...ge]},providerMetadata:R.providerMetadata});await N?.(mn),H$(tt),ne.push(mn),re=[],xr={},ye={},Dt.push(...ge),ie.resolve()}R.type==="finish"&&(_r=R.totalUsage,dt=R.finishReason)},async flush(pe){try{if(ne.length===0){let rt=new mS({message:"No output generated. Check the stream for errors."});He._finishReason.reject(rt),He._totalUsage.reject(rt),He._steps.reject(rt);return}let fe=dt??"unknown",_e=_r??{inputTokens:void 0,outputTokens:void 0,totalTokens:void 0};He._finishReason.resolve(fe),He._totalUsage.resolve(_e),He._steps.resolve(ne);let X=ne[ne.length-1];await k?.({finishReason:fe,totalUsage:_e,usage:X.usage,content:X.content,text:X.text,reasoningText:X.reasoningText,reasoning:X.reasoning,files:X.files,sources:X.sources,toolCalls:X.toolCalls,staticToolCalls:X.staticToolCalls,dynamicToolCalls:X.dynamicToolCalls,toolResults:X.toolResults,staticToolResults:X.staticToolResults,dynamicToolResults:X.dynamicToolResults,request:X.request,response:X.response,warnings:X.warnings,providerMetadata:X.providerMetadata,steps:ne}),de.setAttributes(sn({telemetry:t,attributes:{"ai.response.finishReason":fe,"ai.response.text":{output:()=>X.text},"ai.response.toolCalls":{output:()=>{var rt;return(rt=X.toolCalls)!=null&&rt.length?JSON.stringify(X.toolCalls):void 0}},"ai.response.providerMetadata":JSON.stringify(X.providerMetadata),"ai.usage.inputTokens":_e.inputTokens,"ai.usage.outputTokens":_e.outputTokens,"ai.usage.totalTokens":_e.totalTokens,"ai.usage.reasoningTokens":_e.reasoningTokens,"ai.usage.cachedInputTokens":_e.cachedInputTokens}}))}catch(fe){pe.error(fe)}finally{de.end()}}}),pn=TI();this.addStream=pn.addStream,this.closeStream=pn.close;let Qy=pn.stream.getReader(),Ra=new ReadableStream({async start(pe){pe.enqueue({type:"start"})},async pull(pe){function fe(){M?.({steps:ne}),pe.enqueue({type:"abort"}),pe.close()}try{let{done:_e,value:X}=await Qy.read();if(_e){pe.close();return}if(i?.aborted){fe();return}pe.enqueue(X)}catch(_e){Nt(_e)&&i?.aborted?fe():pe.error(_e)}},cancel(pe){return pn.stream.cancel(pe)}});for(let pe of h)Ra=Ra.pipeThrough(pe({tools:c,stopStream(){pn.terminate()}}));this.baseStream=Ra.pipeThrough(OI(f)).pipeThrough(Xy);let{maxRetries:eb,retry:tb}=dI({maxRetries:r,abortSignal:i}),Fa=aI(t),wt=BS(o),Xd=nI({model:e,telemetry:t,headers:n,settings:{...wt,maxRetries:eb}}),He=this;Sd({name:"ai.streamText",attributes:sn({telemetry:t,attributes:{...$d({operationId:"ai.streamText",telemetry:t}),...Xd,"ai.prompt":{input:()=>JSON.stringify({system:a,prompt:u,messages:l})}}}),tracer:Fa,endWhenDone:!1,fn:async pe=>{de=pe;async function fe({currentStep:_e,responseMessages:X,usage:rt}){var R,ge,mn,Qd,ep;let tp=He.includeRawChunks;ie=new _a;let rp=await tI({system:a,prompt:u,messages:l}),fn=[...rp.messages,...X],pt=await x?.({model:e,steps:ne,stepNumber:ne.length,messages:fn}),np=await MS({prompt:{system:(R=pt?.system)!=null?R:rp.system,messages:(ge=pt?.messages)!=null?ge:fn},supportedUrls:await e.supportedUrls,download:Q}),gn=Dv((mn=pt?.model)!=null?mn:e),{toolChoice:Ma,tools:Ua}=qS({tools:c,toolChoice:(Qd=pt?.toolChoice)!=null?Qd:m,activeTools:(ep=pt?.activeTools)!=null?ep:y}),{result:{stream:rb,response:op,request:ip},doStreamSpan:Dr,startTimestampMs:ap}=await tb(()=>Sd({name:"ai.streamText.doStream",attributes:sn({telemetry:t,attributes:{...$d({operationId:"ai.streamText.doStream",telemetry:t}),...Xd,"ai.model.provider":gn.provider,"ai.model.id":gn.modelId,"ai.prompt.messages":{input:()=>sI(np)},"ai.prompt.tools":{input:()=>Ua?.map(L=>JSON.stringify(L))},"ai.prompt.toolChoice":{input:()=>Ma!=null?JSON.stringify(Ma):void 0},"gen_ai.system":gn.provider,"gen_ai.request.model":gn.modelId,"gen_ai.request.frequency_penalty":wt.frequencyPenalty,"gen_ai.request.max_tokens":wt.maxOutputTokens,"gen_ai.request.presence_penalty":wt.presencePenalty,"gen_ai.request.stop_sequences":wt.stopSequences,"gen_ai.request.temperature":wt.temperature,"gen_ai.request.top_k":wt.topK,"gen_ai.request.top_p":wt.topP}}),tracer:Fa,endWhenDone:!1,fn:async L=>({startTimestampMs:S(),doStreamSpan:L,result:await gn.doStream({...wt,tools:Ua,toolChoice:Ma,responseFormat:f?.responseFormat,prompt:np,providerOptions:v,abortSignal:i,headers:n,includeRawChunks:tp})})})),nb=AI({tools:c,generatorStream:rb,tracer:Fa,telemetry:t,system:a,messages:fn,repairToolCall:p,abortSignal:i,experimental_context:U}),ob=ip??{},Vo=[],Za=[],La,Ba={},wr="unknown",nt={inputTokens:void 0,outputTokens:void 0,totalTokens:void 0},Va,sp=!0,mt={id:O(),timestamp:_(),modelId:e.modelId},up="";He.addStream(nb.pipeThrough(new TransformStream({async transform(L,xe){var hn,vn,qo,kt;if(L.type==="stream-start"){La=L.warnings;return}if(sp){let Te=S()-ap;sp=!1,Dr.addEvent("ai.stream.firstChunk",{"ai.response.msToFirstChunk":Te}),Dr.setAttributes({"ai.response.msToFirstChunk":Te}),xe.enqueue({type:"start-step",request:ob,warnings:La??[]})}let lp=L.type;switch(lp){case"text-start":case"text-end":{xe.enqueue(L);break}case"text-delta":{L.delta.length>0&&(xe.enqueue({type:"text-delta",id:L.id,text:L.delta,providerMetadata:L.providerMetadata}),up+=L.delta);break}case"reasoning-start":case"reasoning-end":{xe.enqueue(L);break}case"reasoning-delta":{xe.enqueue({type:"reasoning-delta",id:L.id,text:L.delta,providerMetadata:L.providerMetadata});break}case"tool-call":{xe.enqueue(L),Vo.push(L);break}case"tool-result":{xe.enqueue(L),L.preliminary||Za.push(L);break}case"tool-error":{xe.enqueue(L),Za.push(L);break}case"response-metadata":{mt={id:(hn=L.id)!=null?hn:mt.id,timestamp:(vn=L.timestamp)!=null?vn:mt.timestamp,modelId:(qo=L.modelId)!=null?qo:mt.modelId};break}case"finish":{nt=L.usage,wr=L.finishReason,Va=L.providerMetadata;let Te=S()-ap;Dr.addEvent("ai.stream.finish"),Dr.setAttributes({"ai.response.msToFinish":Te,"ai.response.avgOutputTokensPerSecond":1e3*((kt=nt.outputTokens)!=null?kt:0)/Te});break}case"file":{xe.enqueue(L);break}case"source":{xe.enqueue(L);break}case"tool-input-start":{Ba[L.id]=L.toolName;let Te=c?.[L.toolName];Te?.onInputStart!=null&&await Te.onInputStart({toolCallId:L.id,messages:fn,abortSignal:i,experimental_context:U}),xe.enqueue({...L,dynamic:Te?.type==="dynamic"});break}case"tool-input-end":{delete Ba[L.id],xe.enqueue(L);break}case"tool-input-delta":{let Te=Ba[L.id],qa=c?.[Te];qa?.onInputDelta!=null&&await qa.onInputDelta({inputTextDelta:L.delta,toolCallId:L.id,messages:fn,abortSignal:i,experimental_context:U}),xe.enqueue(L);break}case"error":{xe.enqueue(L),wr="error";break}case"raw":{tp&&xe.enqueue(L);break}default:{let Te=lp;throw new Error(`Unknown chunk type: ${Te}`)}}},async flush(L){let xe=Vo.length>0?JSON.stringify(Vo):void 0;try{Dr.setAttributes(sn({telemetry:t,attributes:{"ai.response.finishReason":wr,"ai.response.text":{output:()=>up},"ai.response.toolCalls":{output:()=>xe},"ai.response.id":mt.id,"ai.response.model":mt.modelId,"ai.response.timestamp":mt.timestamp.toISOString(),"ai.response.providerMetadata":JSON.stringify(Va),"ai.usage.inputTokens":nt.inputTokens,"ai.usage.outputTokens":nt.outputTokens,"ai.usage.totalTokens":nt.totalTokens,"ai.usage.reasoningTokens":nt.reasoningTokens,"ai.usage.cachedInputTokens":nt.cachedInputTokens,"gen_ai.response.finish_reasons":[wr],"gen_ai.response.id":mt.id,"gen_ai.response.model":mt.modelId,"gen_ai.usage.input_tokens":nt.inputTokens,"gen_ai.usage.output_tokens":nt.outputTokens}}))}catch{}finally{Dr.end()}L.enqueue({type:"finish-step",finishReason:wr,usage:nt,providerMetadata:Va,response:{...mt,headers:op?.headers}});let hn=uI(rt,nt);await ie.promise;let vn=Vo.filter(kt=>kt.providerExecuted!==!0),qo=Za.filter(kt=>kt.providerExecuted!==!0);if(vn.length>0&&qo.length===vn.length&&!await vI({stopConditions:d,steps:ne})){X.push(...Lh({content:ne[ne.length-1].content,tools:c}));try{await fe({currentStep:_e+1,responseMessages:X,usage:hn})}catch(kt){L.enqueue({type:"error",error:kt}),He.closeStream()}}else L.enqueue({type:"finish",finishReason:wr,totalUsage:hn}),He.closeStream()}})))}await fe({currentStep:0,responseMessages:[],usage:{inputTokens:void 0,outputTokens:void 0,totalTokens:void 0}})}}).catch(pe=>{He.addStream(new ReadableStream({start(fe){fe.enqueue({type:"error",error:pe}),fe.close()}})),He.closeStream()})}get steps(){return this.consumeStream(),this._steps.promise}get finalStep(){return this.steps.then(e=>e[e.length-1])}get content(){return this.finalStep.then(e=>e.content)}get warnings(){return this.finalStep.then(e=>e.warnings)}get providerMetadata(){return this.finalStep.then(e=>e.providerMetadata)}get text(){return this.finalStep.then(e=>e.text)}get reasoningText(){return this.finalStep.then(e=>e.reasoningText)}get reasoning(){return this.finalStep.then(e=>e.reasoning)}get sources(){return this.finalStep.then(e=>e.sources)}get files(){return this.finalStep.then(e=>e.files)}get toolCalls(){return this.finalStep.then(e=>e.toolCalls)}get staticToolCalls(){return this.finalStep.then(e=>e.staticToolCalls)}get dynamicToolCalls(){return this.finalStep.then(e=>e.dynamicToolCalls)}get toolResults(){return this.finalStep.then(e=>e.toolResults)}get staticToolResults(){return this.finalStep.then(e=>e.staticToolResults)}get dynamicToolResults(){return this.finalStep.then(e=>e.dynamicToolResults)}get usage(){return this.finalStep.then(e=>e.usage)}get request(){return this.finalStep.then(e=>e.request)}get response(){return this.finalStep.then(e=>e.response)}get totalUsage(){return this.consumeStream(),this._totalUsage.promise}get finishReason(){return this.consumeStream(),this._finishReason.promise}teeStream(){let[e,t]=this.baseStream.tee();return this.baseStream=t,e}get textStream(){return ba(this.teeStream().pipeThrough(new TransformStream({transform({part:e},t){e.type==="text-delta"&&t.enqueue(e.text)}})))}get fullStream(){return ba(this.teeStream().pipeThrough(new TransformStream({transform({part:e},t){t.enqueue(e)}})))}async consumeStream(e){var t;try{await EI({stream:this.fullStream,onError:e?.onError})}catch(n){(t=e?.onError)==null||t.call(e,n)}}get experimental_partialOutputStream(){if(this.output==null)throw new G$;return ba(this.teeStream().pipeThrough(new TransformStream({transform({partialOutput:e},t){e!=null&&t.enqueue(e)}})))}toUIMessageStream({originalMessages:e,generateMessageId:t,onFinish:n,messageMetadata:o,sendReasoning:r=!0,sendSources:i=!1,sendStart:a=!0,sendFinish:u=!0,onError:l=ft}={}){let c=t!=null?xI({originalMessages:e,responseMessageId:t}):void 0,m={},h=p=>{var d,f;let v=m[p];return((f=(d=this.tools)==null?void 0:d[v])==null?void 0:f.type)==="dynamic"?!0:void 0},y=this.fullStream.pipeThrough(new TransformStream({transform:async(p,d)=>{let f=o?.({part:p}),v=p.type;switch(v){case"text-start":{d.enqueue({type:"text-start",id:p.id,...p.providerMetadata!=null?{providerMetadata:p.providerMetadata}:{}});break}case"text-delta":{d.enqueue({type:"text-delta",id:p.id,delta:p.text,...p.providerMetadata!=null?{providerMetadata:p.providerMetadata}:{}});break}case"text-end":{d.enqueue({type:"text-end",id:p.id,...p.providerMetadata!=null?{providerMetadata:p.providerMetadata}:{}});break}case"reasoning-start":{d.enqueue({type:"reasoning-start",id:p.id,...p.providerMetadata!=null?{providerMetadata:p.providerMetadata}:{}});break}case"reasoning-delta":{r&&d.enqueue({type:"reasoning-delta",id:p.id,delta:p.text,...p.providerMetadata!=null?{providerMetadata:p.providerMetadata}:{}});break}case"reasoning-end":{d.enqueue({type:"reasoning-end",id:p.id,...p.providerMetadata!=null?{providerMetadata:p.providerMetadata}:{}});break}case"file":{d.enqueue({type:"file",mediaType:p.file.mediaType,url:`data:${p.file.mediaType};base64,${p.file.base64}`});break}case"source":{i&&p.sourceType==="url"&&d.enqueue({type:"source-url",sourceId:p.id,url:p.url,title:p.title,...p.providerMetadata!=null?{providerMetadata:p.providerMetadata}:{}}),i&&p.sourceType==="document"&&d.enqueue({type:"source-document",sourceId:p.id,mediaType:p.mediaType,title:p.title,filename:p.filename,...p.providerMetadata!=null?{providerMetadata:p.providerMetadata}:{}});break}case"tool-input-start":{m[p.id]=p.toolName;let x=h(p.id);d.enqueue({type:"tool-input-start",toolCallId:p.id,toolName:p.toolName,...p.providerExecuted!=null?{providerExecuted:p.providerExecuted}:{},...x!=null?{dynamic:x}:{}});break}case"tool-input-delta":{d.enqueue({type:"tool-input-delta",toolCallId:p.id,inputTextDelta:p.delta});break}case"tool-call":{m[p.toolCallId]=p.toolName;let x=h(p.toolCallId);p.invalid?d.enqueue({type:"tool-input-error",toolCallId:p.toolCallId,toolName:p.toolName,input:p.input,...p.providerExecuted!=null?{providerExecuted:p.providerExecuted}:{},...p.providerMetadata!=null?{providerMetadata:p.providerMetadata}:{},...x!=null?{dynamic:x}:{},errorText:l(p.error)}):d.enqueue({type:"tool-input-available",toolCallId:p.toolCallId,toolName:p.toolName,input:p.input,...p.providerExecuted!=null?{providerExecuted:p.providerExecuted}:{},...p.providerMetadata!=null?{providerMetadata:p.providerMetadata}:{},...x!=null?{dynamic:x}:{}});break}case"tool-result":{let x=h(p.toolCallId);d.enqueue({type:"tool-output-available",toolCallId:p.toolCallId,output:p.output,...p.providerExecuted!=null?{providerExecuted:p.providerExecuted}:{},...p.preliminary!=null?{preliminary:p.preliminary}:{},...x!=null?{dynamic:x}:{}});break}case"tool-error":{let x=h(p.toolCallId);d.enqueue({type:"tool-output-error",toolCallId:p.toolCallId,errorText:l(p.error),...p.providerExecuted!=null?{providerExecuted:p.providerExecuted}:{},...x!=null?{dynamic:x}:{}});break}case"error":{d.enqueue({type:"error",errorText:l(p.error)});break}case"start-step":{d.enqueue({type:"start-step"});break}case"finish-step":{d.enqueue({type:"finish-step"});break}case"start":{a&&d.enqueue({type:"start",...f!=null?{messageMetadata:f}:{},...c!=null?{messageId:c}:{}});break}case"finish":{u&&d.enqueue({type:"finish",...f!=null?{messageMetadata:f}:{}});break}case"abort":{d.enqueue(p);break}case"tool-input-end":break;case"raw":break;default:{let x=v;throw new Error(`Unknown chunk type: ${x}`)}}f!=null&&v!=="start"&&v!=="finish"&&d.enqueue({type:"message-metadata",messageMetadata:f})}}));return ba(SI({stream:y,messageId:c??t?.(),originalMessages:e,onFinish:n,onError:l}))}pipeUIMessageStreamToResponse(e,{originalMessages:t,generateMessageId:n,onFinish:o,messageMetadata:r,sendReasoning:i,sendSources:a,sendFinish:u,sendStart:l,onError:c,...m}={}){II({response:e,stream:this.toUIMessageStream({originalMessages:t,generateMessageId:n,onFinish:o,messageMetadata:r,sendReasoning:i,sendSources:a,sendFinish:u,sendStart:l,onError:c}),...m})}pipeTextStreamToResponse(e,t){bI({response:e,textStream:this.textStream,...t})}toUIMessageStreamResponse({originalMessages:e,generateMessageId:t,onFinish:n,messageMetadata:o,sendReasoning:r,sendSources:i,sendFinish:a,sendStart:u,onError:l,...c}={}){return _I({stream:this.toUIMessageStream({originalMessages:e,generateMessageId:t,onFinish:n,messageMetadata:o,sendReasoning:r,sendSources:i,sendFinish:a,sendStart:u,onError:l}),...c})}toTextStreamResponse(e){return yI({textStream:this.textStream,...e})}};var c4=zt({prefix:"aiobj",size:24});var p4=zt({prefix:"aiobj",size:24});var NI={};q$(NI,{object:()=>RI,text:()=>zI});var zI=()=>({type:"text",responseFormat:{type:"text"},async parsePartial({text:e}){return{partial:e}},async parseOutput({text:e}){return e}}),RI=({schema:e})=>{let t=fr(e);return{type:"object",responseFormat:{type:"json",schema:t.jsonSchema},async parsePartial({text:n}){let o=await jv(n);switch(o.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:o.value};default:{let r=o.state;throw new Error(`Unsupported parse state: ${r}`)}}},async parseOutput({text:n},o){let r=await yt({text:n});if(!r.success)throw new Rh({message:"No object generated: could not parse the response.",cause:r.error,text:n,response:o.response,usage:o.usage,finishReason:o.finishReason});let i=await Rt({value:r.value,schema:t});if(!i.success)throw new Rh({message:"No object generated: response did not match schema.",cause:i.error,text:n,response:o.response,usage:o.usage,finishReason:o.finishReason});return i.value}}};var FI="AI_NoSuchProviderError",MI=`vercel.ai.error.${FI}`,UI=Symbol.for(MI),ZI;ZI=UI;var LI=s.looseObject({name:s.string(),version:s.string()}),Id=s.looseObject({_meta:s.optional(s.object({}).loose())}),zo=Id,BI=s.object({method:s.string(),params:s.optional(Id)}),VI=s.looseObject({experimental:s.optional(s.object({}).loose()),logging:s.optional(s.object({}).loose()),prompts:s.optional(s.looseObject({listChanged:s.optional(s.boolean())})),resources:s.optional(s.looseObject({subscribe:s.optional(s.boolean()),listChanged:s.optional(s.boolean())})),tools:s.optional(s.looseObject({listChanged:s.optional(s.boolean())}))}),h4=zo.extend({protocolVersion:s.string(),capabilities:VI,serverInfo:LI,instructions:s.optional(s.string())}),qI=zo.extend({nextCursor:s.optional(s.string())}),JI=s.object({name:s.string(),description:s.optional(s.string()),inputSchema:s.object({type:s.literal("object"),properties:s.optional(s.object({}).loose())}).loose()}).loose(),v4=qI.extend({tools:s.array(JI)}),GI=s.object({type:s.literal("text"),text:s.string()}).loose(),WI=s.object({type:s.literal("image"),data:s.base64(),mimeType:s.string()}).loose(),zv=s.object({uri:s.string(),mimeType:s.optional(s.string())}).loose(),KI=zv.extend({text:s.string()}),HI=zv.extend({blob:s.base64()}),YI=s.object({type:s.literal("resource"),resource:s.union([KI,HI])}).loose(),y4=zo.extend({content:s.array(s.union([GI,WI,YI])),isError:s.boolean().default(!1).optional()}).or(zo.extend({toolResult:s.unknown()})),Da="2.0",XI=s.object({jsonrpc:s.literal(Da),id:s.union([s.string(),s.number().int()])}).merge(BI).strict(),QI=s.object({jsonrpc:s.literal(Da),id:s.union([s.string(),s.number().int()]),result:zo}).strict(),eE=s.object({jsonrpc:s.literal(Da),id:s.union([s.string(),s.number().int()]),error:s.object({code:s.number().int(),message:s.string(),data:s.optional(s.unknown())})}).strict(),tE=s.object({jsonrpc:s.literal(Da)}).merge(s.object({method:s.string(),params:s.optional(Id)})).strict(),b4=s.union([XI,tE,QI,eE]);var rE=s.object({type:s.literal("text"),text:s.string(),state:s.enum(["streaming","done"]).optional(),providerMetadata:Y.optional()}),nE=s.object({type:s.literal("reasoning"),text:s.string(),state:s.enum(["streaming","done"]).optional(),providerMetadata:Y.optional()}),oE=s.object({type:s.literal("source-url"),sourceId:s.string(),url:s.string(),title:s.string().optional(),providerMetadata:Y.optional()}),iE=s.object({type:s.literal("source-document"),sourceId:s.string(),mediaType:s.string(),title:s.string(),filename:s.string().optional(),providerMetadata:Y.optional()}),aE=s.object({type:s.literal("file"),mediaType:s.string(),filename:s.string().optional(),url:s.string(),providerMetadata:Y.optional()}),sE=s.object({type:s.literal("step-start")}),uE=s.object({type:s.string().startsWith("data-"),id:s.string().optional(),data:s.unknown()}),lE=[s.object({type:s.literal("dynamic-tool"),toolName:s.string(),toolCallId:s.string(),state:s.literal("input-streaming"),input:s.unknown().optional(),output:s.never().optional(),errorText:s.never().optional()}),s.object({type:s.literal("dynamic-tool"),toolName:s.string(),toolCallId:s.string(),state:s.literal("input-available"),input:s.unknown(),output:s.never().optional(),errorText:s.never().optional(),callProviderMetadata:Y.optional()}),s.object({type:s.literal("dynamic-tool"),toolName:s.string(),toolCallId:s.string(),state:s.literal("output-available"),input:s.unknown(),output:s.unknown(),errorText:s.never().optional(),callProviderMetadata:Y.optional(),preliminary:s.boolean().optional()}),s.object({type:s.literal("dynamic-tool"),toolName:s.string(),toolCallId:s.string(),state:s.literal("output-error"),input:s.unknown(),output:s.never().optional(),errorText:s.string(),callProviderMetadata:Y.optional()})],cE=[s.object({type:s.string().startsWith("tool-"),toolCallId:s.string(),state:s.literal("input-streaming"),providerExecuted:s.boolean().optional(),input:s.unknown().optional(),output:s.never().optional(),errorText:s.never().optional()}),s.object({type:s.string().startsWith("tool-"),toolCallId:s.string(),state:s.literal("input-available"),providerExecuted:s.boolean().optional(),input:s.unknown(),output:s.never().optional(),errorText:s.never().optional(),callProviderMetadata:Y.optional()}),s.object({type:s.string().startsWith("tool-"),toolCallId:s.string(),state:s.literal("output-available"),providerExecuted:s.boolean().optional(),input:s.unknown(),output:s.unknown(),errorText:s.never().optional(),callProviderMetadata:Y.optional(),preliminary:s.boolean().optional()}),s.object({type:s.string().startsWith("tool-"),toolCallId:s.string(),state:s.literal("output-error"),providerExecuted:s.boolean().optional(),input:s.unknown(),output:s.never().optional(),errorText:s.string(),callProviderMetadata:Y.optional()})],x4=s.object({id:s.string(),role:s.enum(["system","user","assistant"]),metadata:s.unknown().optional(),parts:s.array(s.union([rE,nE,oE,iE,aE,sE,uE,...lE,...cE]))});var Ze="make a 300 word story";import Ro from"fs";var Rv={reset:"\x1B[0m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",bright:"\x1B[1m",dim:"\x1B[2m"};function je(e,t){return`${Rv[t]}${e}${Rv.reset}`}var wa=class{constructor(t,n){this.providerName=t,this.modelName=n,this.config=this.loadConfig(),this.validateProviderAndModel()}loadConfig(){let t="ai-benchmark-config.json";if(!Ro.existsSync(t))throw new Error("Configuration file ai-benchmark-config.json not found");let n=Ro.readFileSync(t,"utf8");return JSON.parse(n)}validateProviderAndModel(){let t=this.config.providers.find(o=>o.name===this.providerName);if(!t)throw new Error(`Provider '${this.providerName}' not found in configuration`);let n=t.models.find(o=>o.name===this.modelName);if(!n)throw new Error(`Model '${this.modelName}' not found for provider '${this.providerName}'`);this.provider=t,this.model=n}async runBenchmark(){console.log("=== LLM Benchmark ==="),console.log(`Provider: ${this.providerName}`),console.log(`Model: ${this.modelName} (${this.model.name})`),console.log("Starting benchmark..."),this.startTime=new Date,console.log(`Start time: ${this.startTime.toISOString()}`);let t=await this.makeApiCall();this.endTime=new Date,console.log(`End time: ${this.endTime.toISOString()}`),this.calculateAndDisplayMetrics(t)}async makeApiCall(){let t=this.provider.type==="anthropic"?"/v1/messages":"/chat/completions",n=`${this.provider.baseUrl}${t}`,o={"Content-Type":"application/json",Authorization:`Bearer ${this.provider.apiKey}`};this.provider.type==="anthropic"&&(o["x-api-key"]=this.provider.apiKey,o["anthropic-version"]="2023-06-01");let r={model:this.model.name,messages:[{role:"user",content:Ze}],max_tokens:1e3,temperature:.7};this.provider.type==="anthropic"&&(r.model=this.model.name,r.max_tokens=1e3);let i=await fetch(n,{method:"POST",headers:o,body:JSON.stringify(r)});if(!i.ok)throw new Error(`API request failed: ${i.status} ${i.statusText}`);return await i.json()}calculateAndDisplayMetrics(t){let n=(this.endTime-this.startTime)/1e3,o,r;this.provider.type==="anthropic"?(o=t.usage?.input_tokens||this.estimateTokens(Ze),r=t.usage?.output_tokens||this.estimateTokens(t.content?.[0]?.text||"")):(o=t.usage?.prompt_tokens||this.estimateTokens(Ze),r=t.usage?.completion_tokens||this.estimateTokens(t.choices?.[0]?.message?.content||""));let i=o+r,a=n>0?i/n:0;console.log(`
|
|
78
|
+
`)}})}},Pv={"content-type":"text/event-stream","cache-control":"no-cache",connection:"keep-alive","x-vercel-ai-ui-message-stream":"v1","x-accel-buffering":"no"};function _I({status:e,statusText:t,headers:n,stream:o,consumeSseStream:r}){let i=o.pipeThrough(new Av);if(r){let[a,u]=i.tee();i=a,r({stream:u})}return new Response(i.pipeThrough(new TextEncoderStream),{status:e,statusText:t,headers:xa(n,Pv)})}function xI({originalMessages:e,responseMessageId:t}){if(e==null)return;let n=e[e.length-1];return n?.role==="assistant"?n.id:typeof t=="function"?t():t}var a4=s.union([s.strictObject({type:s.literal("text-start"),id:s.string(),providerMetadata:Y.optional()}),s.strictObject({type:s.literal("text-delta"),id:s.string(),delta:s.string(),providerMetadata:Y.optional()}),s.strictObject({type:s.literal("text-end"),id:s.string(),providerMetadata:Y.optional()}),s.strictObject({type:s.literal("error"),errorText:s.string()}),s.strictObject({type:s.literal("tool-input-start"),toolCallId:s.string(),toolName:s.string(),providerExecuted:s.boolean().optional(),dynamic:s.boolean().optional()}),s.strictObject({type:s.literal("tool-input-delta"),toolCallId:s.string(),inputTextDelta:s.string()}),s.strictObject({type:s.literal("tool-input-available"),toolCallId:s.string(),toolName:s.string(),input:s.unknown(),providerExecuted:s.boolean().optional(),providerMetadata:Y.optional(),dynamic:s.boolean().optional()}),s.strictObject({type:s.literal("tool-input-error"),toolCallId:s.string(),toolName:s.string(),input:s.unknown(),providerExecuted:s.boolean().optional(),providerMetadata:Y.optional(),dynamic:s.boolean().optional(),errorText:s.string()}),s.strictObject({type:s.literal("tool-output-available"),toolCallId:s.string(),output:s.unknown(),providerExecuted:s.boolean().optional(),dynamic:s.boolean().optional(),preliminary:s.boolean().optional()}),s.strictObject({type:s.literal("tool-output-error"),toolCallId:s.string(),errorText:s.string(),providerExecuted:s.boolean().optional(),dynamic:s.boolean().optional()}),s.strictObject({type:s.literal("reasoning"),text:s.string(),providerMetadata:Y.optional()}),s.strictObject({type:s.literal("reasoning-start"),id:s.string(),providerMetadata:Y.optional()}),s.strictObject({type:s.literal("reasoning-delta"),id:s.string(),delta:s.string(),providerMetadata:Y.optional()}),s.strictObject({type:s.literal("reasoning-end"),id:s.string(),providerMetadata:Y.optional()}),s.strictObject({type:s.literal("reasoning-part-finish")}),s.strictObject({type:s.literal("source-url"),sourceId:s.string(),url:s.string(),title:s.string().optional(),providerMetadata:Y.optional()}),s.strictObject({type:s.literal("source-document"),sourceId:s.string(),mediaType:s.string(),title:s.string(),filename:s.string().optional(),providerMetadata:Y.optional()}),s.strictObject({type:s.literal("file"),url:s.string(),mediaType:s.string(),providerMetadata:Y.optional()}),s.strictObject({type:s.string().startsWith("data-"),id:s.string().optional(),data:s.unknown(),transient:s.boolean().optional()}),s.strictObject({type:s.literal("start-step")}),s.strictObject({type:s.literal("finish-step")}),s.strictObject({type:s.literal("start"),messageId:s.string().optional(),messageMetadata:s.unknown().optional()}),s.strictObject({type:s.literal("finish"),messageMetadata:s.unknown().optional()}),s.strictObject({type:s.literal("abort")}),s.strictObject({type:s.literal("message-metadata"),messageMetadata:s.unknown()})]);function DI(e){return e.type.startsWith("data-")}function Ov(e,t){if(e===void 0&&t===void 0)return;if(e===void 0)return t;if(t===void 0)return e;let n={...e};for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o];if(r===void 0)continue;let i=o in e?e[o]:void 0,a=r!==null&&typeof r=="object"&&!Array.isArray(r)&&!(r instanceof Date)&&!(r instanceof RegExp),u=i!=null&&typeof i=="object"&&!Array.isArray(i)&&!(i instanceof Date)&&!(i instanceof RegExp);a&&u?n[o]=Ov(i,r):n[o]=r}return n}function wI(e){let t=["ROOT"],n=-1,o=null;function r(l,c,m){switch(l){case'"':{n=c,t.pop(),t.push(m),t.push("INSIDE_STRING");break}case"f":case"t":case"n":{n=c,o=c,t.pop(),t.push(m),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(m),t.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=c,t.pop(),t.push(m),t.push("INSIDE_NUMBER");break}case"{":{n=c,t.pop(),t.push(m),t.push("INSIDE_OBJECT_START");break}case"[":{n=c,t.pop(),t.push(m),t.push("INSIDE_ARRAY_START");break}}}function i(l,c){switch(l){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=c,t.pop();break}}}function a(l,c){switch(l){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=c,t.pop();break}}}for(let l=0;l<e.length;l++){let c=e[l];switch(t[t.length-1]){case"ROOT":r(c,l,"FINISH");break;case"INSIDE_OBJECT_START":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}case"}":{n=l,t.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}}break}case"INSIDE_OBJECT_KEY":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY");break}}break}case"INSIDE_OBJECT_AFTER_KEY":{switch(c){case":":{t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE");break}}break}case"INSIDE_OBJECT_BEFORE_VALUE":{r(c,l,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{i(c,l);break}case"INSIDE_STRING":{switch(c){case'"':{t.pop(),n=l;break}case"\\":{t.push("INSIDE_STRING_ESCAPE");break}default:n=l}break}case"INSIDE_ARRAY_START":{switch(c){case"]":{n=l,t.pop();break}default:{n=l,r(c,l,"INSIDE_ARRAY_AFTER_VALUE");break}}break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(c){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=l,t.pop();break}default:{n=l;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{r(c,l,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{t.pop(),n=l;break}case"INSIDE_NUMBER":{switch(c){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=l;break}case"e":case"E":case"-":case".":break;case",":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(c,l),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&i(c,l);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&i(c,l);break}case"]":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(c,l);break}default:{t.pop();break}}break}case"INSIDE_LITERAL":{let h=e.substring(o,l+1);!"false".startsWith(h)&&!"true".startsWith(h)&&!"null".startsWith(h)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?i(c,l):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(c,l)):n=l;break}}}let u=e.slice(0,n+1);for(let l=t.length-1;l>=0;l--)switch(t[l]){case"INSIDE_STRING":{u+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{u+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{u+="]";break}case"INSIDE_LITERAL":{let m=e.substring(o,e.length);"true".startsWith(m)?u+="true".slice(m.length):"false".startsWith(m)?u+="false".slice(m.length):"null".startsWith(m)&&(u+="null".slice(m.length))}}return u}async function jv(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=await yt({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await yt({text:wI(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}function wd(e){return e.type.startsWith("tool-")}function Bh(e){return e.type.split("-").slice(1).join("-")}function kI({lastMessage:e,messageId:t}){return{message:e?.role==="assistant"?e:{id:t,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function $I({stream:e,messageMetadataSchema:t,dataPartSchemas:n,runUpdateMessageJob:o,onError:r,onToolCall:i,onData:a}){return e.pipeThrough(new TransformStream({async transform(u,l){await o(async({state:c,write:m})=>{var h,y,p,d;function f(_){let T=c.message.parts.filter(wd).find($=>$.toolCallId===_);if(T==null)throw new Error("tool-output-error must be preceded by a tool-input-available");return T}function v(_){let T=c.message.parts.filter($=>$.type==="dynamic-tool").find($=>$.toolCallId===_);if(T==null)throw new Error("tool-output-error must be preceded by a tool-input-available");return T}function x(_){var O;let T=c.message.parts.find(M=>wd(M)&&M.toolCallId===_.toolCallId),$=_,k=T;T!=null?(T.state=_.state,k.input=$.input,k.output=$.output,k.errorText=$.errorText,k.rawInput=$.rawInput,k.preliminary=$.preliminary,k.providerExecuted=(O=$.providerExecuted)!=null?O:T.providerExecuted,$.providerMetadata!=null&&T.state==="input-available"&&(T.callProviderMetadata=$.providerMetadata)):c.message.parts.push({type:`tool-${_.toolName}`,toolCallId:_.toolCallId,state:_.state,input:$.input,output:$.output,rawInput:$.rawInput,errorText:$.errorText,providerExecuted:$.providerExecuted,preliminary:$.preliminary,...$.providerMetadata!=null?{callProviderMetadata:$.providerMetadata}:{}})}function b(_){var O;let T=c.message.parts.find(M=>M.type==="dynamic-tool"&&M.toolCallId===_.toolCallId),$=_,k=T;T!=null?(T.state=_.state,k.toolName=_.toolName,k.input=$.input,k.output=$.output,k.errorText=$.errorText,k.rawInput=(O=$.rawInput)!=null?O:k.rawInput,k.preliminary=$.preliminary,$.providerMetadata!=null&&T.state==="input-available"&&(T.callProviderMetadata=$.providerMetadata)):c.message.parts.push({type:"dynamic-tool",toolName:_.toolName,toolCallId:_.toolCallId,state:_.state,input:$.input,output:$.output,errorText:$.errorText,preliminary:$.preliminary,...$.providerMetadata!=null?{callProviderMetadata:$.providerMetadata}:{}})}async function S(_){if(_!=null){let O=c.message.metadata!=null?Ov(c.message.metadata,_):_;t!=null&&await ua({value:O,schema:t}),c.message.metadata=O}}switch(u.type){case"text-start":{let _={type:"text",text:"",providerMetadata:u.providerMetadata,state:"streaming"};c.activeTextParts[u.id]=_,c.message.parts.push(_),m();break}case"text-delta":{let _=c.activeTextParts[u.id];_.text+=u.delta,_.providerMetadata=(h=u.providerMetadata)!=null?h:_.providerMetadata,m();break}case"text-end":{let _=c.activeTextParts[u.id];_.state="done",_.providerMetadata=(y=u.providerMetadata)!=null?y:_.providerMetadata,delete c.activeTextParts[u.id],m();break}case"reasoning-start":{let _={type:"reasoning",text:"",providerMetadata:u.providerMetadata,state:"streaming"};c.activeReasoningParts[u.id]=_,c.message.parts.push(_),m();break}case"reasoning-delta":{let _=c.activeReasoningParts[u.id];_.text+=u.delta,_.providerMetadata=(p=u.providerMetadata)!=null?p:_.providerMetadata,m();break}case"reasoning-end":{let _=c.activeReasoningParts[u.id];_.providerMetadata=(d=u.providerMetadata)!=null?d:_.providerMetadata,_.state="done",delete c.activeReasoningParts[u.id],m();break}case"file":{c.message.parts.push({type:"file",mediaType:u.mediaType,url:u.url}),m();break}case"source-url":{c.message.parts.push({type:"source-url",sourceId:u.sourceId,url:u.url,title:u.title,providerMetadata:u.providerMetadata}),m();break}case"source-document":{c.message.parts.push({type:"source-document",sourceId:u.sourceId,mediaType:u.mediaType,title:u.title,filename:u.filename,providerMetadata:u.providerMetadata}),m();break}case"tool-input-start":{let _=c.message.parts.filter(wd);c.partialToolCalls[u.toolCallId]={text:"",toolName:u.toolName,index:_.length,dynamic:u.dynamic},u.dynamic?b({toolCallId:u.toolCallId,toolName:u.toolName,state:"input-streaming",input:void 0}):x({toolCallId:u.toolCallId,toolName:u.toolName,state:"input-streaming",input:void 0,providerExecuted:u.providerExecuted}),m();break}case"tool-input-delta":{let _=c.partialToolCalls[u.toolCallId];_.text+=u.inputTextDelta;let{value:O}=await jv(_.text);_.dynamic?b({toolCallId:u.toolCallId,toolName:_.toolName,state:"input-streaming",input:O}):x({toolCallId:u.toolCallId,toolName:_.toolName,state:"input-streaming",input:O}),m();break}case"tool-input-available":{u.dynamic?b({toolCallId:u.toolCallId,toolName:u.toolName,state:"input-available",input:u.input,providerMetadata:u.providerMetadata}):x({toolCallId:u.toolCallId,toolName:u.toolName,state:"input-available",input:u.input,providerExecuted:u.providerExecuted,providerMetadata:u.providerMetadata}),m(),i&&!u.providerExecuted&&await i({toolCall:u});break}case"tool-input-error":{u.dynamic?b({toolCallId:u.toolCallId,toolName:u.toolName,state:"output-error",input:u.input,errorText:u.errorText,providerMetadata:u.providerMetadata}):x({toolCallId:u.toolCallId,toolName:u.toolName,state:"output-error",input:void 0,rawInput:u.input,errorText:u.errorText,providerExecuted:u.providerExecuted,providerMetadata:u.providerMetadata}),m();break}case"tool-output-available":{if(u.dynamic){let _=v(u.toolCallId);b({toolCallId:u.toolCallId,toolName:_.toolName,state:"output-available",input:_.input,output:u.output,preliminary:u.preliminary})}else{let _=f(u.toolCallId);x({toolCallId:u.toolCallId,toolName:Bh(_),state:"output-available",input:_.input,output:u.output,providerExecuted:u.providerExecuted,preliminary:u.preliminary})}m();break}case"tool-output-error":{if(u.dynamic){let _=v(u.toolCallId);b({toolCallId:u.toolCallId,toolName:_.toolName,state:"output-error",input:_.input,errorText:u.errorText})}else{let _=f(u.toolCallId);x({toolCallId:u.toolCallId,toolName:Bh(_),state:"output-error",input:_.input,rawInput:_.rawInput,errorText:u.errorText})}m();break}case"start-step":{c.message.parts.push({type:"step-start"});break}case"finish-step":{c.activeTextParts={},c.activeReasoningParts={};break}case"start":{u.messageId!=null&&(c.message.id=u.messageId),await S(u.messageMetadata),(u.messageId!=null||u.messageMetadata!=null)&&m();break}case"finish":{await S(u.messageMetadata),u.messageMetadata!=null&&m();break}case"message-metadata":{await S(u.messageMetadata),u.messageMetadata!=null&&m();break}case"error":{r?.(new Error(u.errorText));break}default:if(DI(u)){n?.[u.type]!=null&&await ua({value:u.data,schema:n[u.type]});let _=u;if(_.transient){a?.(_);break}let O=_.id!=null?c.message.parts.find(T=>_.type===T.type&&_.id===T.id):void 0;O!=null?O.data=_.data:c.message.parts.push(_),a?.(_),m()}}l.enqueue(u)})}}))}function SI({messageId:e,originalMessages:t=[],onFinish:n,onError:o,stream:r}){let i=t?.[t.length-1];i?.role!=="assistant"?i=void 0:e=i.id;let a=!1,u=r.pipeThrough(new TransformStream({transform(y,p){if(y.type==="start"){let d=y;d.messageId==null&&e!=null&&(d.messageId=e)}y.type==="abort"&&(a=!0),p.enqueue(y)}}));if(n==null)return u;let l=kI({lastMessage:i?structuredClone(i):void 0,messageId:e??""}),c=async y=>{await y({state:l,write:()=>{}})},m=!1,h=async()=>{if(m||!n)return;m=!0;let y=l.message.id===i?.id;await n({isAborted:a,isContinuation:y,responseMessage:l.message,messages:[...y?t.slice(0,-1):t,l.message]})};return $I({stream:u,runUpdateMessageJob:c,onError:o}).pipeThrough(new TransformStream({transform(y,p){p.enqueue(y)},async cancel(){await h()},async flush(){await h()}}))}function II({response:e,status:t,statusText:n,headers:o,stream:r,consumeSseStream:i}){let a=r.pipeThrough(new Av);if(i){let[u,l]=a.tee();a=u,i({stream:l})}Cv({response:e,status:t,statusText:n,headers:Object.fromEntries(xa(o,Pv).entries()),stream:a.pipeThrough(new TextEncoderStream)})}function ba(e){let t=e.pipeThrough(new TransformStream);return t[Symbol.asyncIterator]=function(){let n=this.getReader(),o=!1;async function r(i){var a;o=!0;try{i&&await((a=n.cancel)==null?void 0:a.call(n))}finally{try{n.releaseLock()}catch{}}}return{async next(){if(o)return{done:!0,value:void 0};let{done:i,value:a}=await n.read();return i?(await r(!0),{done:!0,value:void 0}):{done:!1,value:a}},async return(){return await r(!0),{done:!0,value:void 0}},async throw(i){throw await r(!0),i}}},t}async function EI({stream:e,onError:t}){let n=e.getReader();try{for(;;){let{done:o}=await n.read();if(o)break}}catch(o){t?.(o)}finally{n.releaseLock()}}function qh(){let e,t;return{promise:new Promise((o,r)=>{e=o,t=r}),resolve:e,reject:t}}function TI(){let e=[],t=null,n=!1,o=qh(),r=()=>{n=!0,o.resolve(),e.forEach(a=>a.cancel()),e=[],t?.close()},i=async()=>{if(n&&e.length===0){t?.close();return}if(e.length===0)return o=qh(),await o.promise,i();try{let{value:a,done:u}=await e[0].read();u?(e.shift(),e.length>0?await i():n&&t?.close()):t?.enqueue(a)}catch(a){t?.error(a),e.shift(),r()}};return{stream:new ReadableStream({start(a){t=a},pull:i,async cancel(){for(let a of e)await a.cancel();e=[],n=!0}}),addStream:a=>{if(n)throw new Error("Cannot add inner stream: outer stream is closed");e.push(a.getReader()),o.resolve()},close:()=>{n=!0,o.resolve(),e.length===0&&t?.close()},terminate:r}}var _a=class{constructor(){this.status={type:"pending"},this._resolve=void 0,this._reject=void 0}get promise(){return this._promise?this._promise:(this._promise=new Promise((e,t)=>{this.status.type==="resolved"?e(this.status.value):this.status.type==="rejected"&&t(this.status.error),this._resolve=e,this._reject=t}),this._promise)}resolve(e){var t;this.status={type:"resolved",value:e},this._promise&&((t=this._resolve)==null||t.call(this,e))}reject(e){var t;this.status={type:"rejected",error:e},this._promise&&((t=this._reject)==null||t.call(this,e))}};function CI(){var e,t;return(t=(e=globalThis?.performance)==null?void 0:e.now())!=null?t:Date.now()}function AI({tools:e,generatorStream:t,tracer:n,telemetry:o,system:r,messages:i,abortSignal:a,repairToolCall:u,experimental_context:l}){let c=null,m=new ReadableStream({start(x){c=x}}),h=new Set,y=new Map,p=!1,d;function f(){p&&h.size===0&&(d!=null&&c.enqueue(d),c.close())}let v=new TransformStream({async transform(x,b){let S=x.type;switch(S){case"stream-start":case"text-start":case"text-delta":case"text-end":case"reasoning-start":case"reasoning-delta":case"reasoning-end":case"tool-input-start":case"tool-input-delta":case"tool-input-end":case"source":case"response-metadata":case"error":case"raw":{b.enqueue(x);break}case"file":{b.enqueue({type:"file",file:new mI({data:x.data,mediaType:x.mediaType})});break}case"finish":{d={type:"finish",finishReason:x.finishReason,usage:x.usage,providerMetadata:x.providerMetadata};break}case"tool-call":{try{let _=await fI({toolCall:x,tools:e,repairToolCall:u,system:r,messages:i});if(b.enqueue(_),_.invalid){c.enqueue({type:"tool-error",toolCallId:_.toolCallId,toolName:_.toolName,input:_.input,error:Do(_.error),dynamic:!0});break}let O=e[_.toolName];if(y.set(_.toolCallId,_.input),O.onInputAvailable!=null&&await O.onInputAvailable({input:_.input,toolCallId:_.toolCallId,messages:i,abortSignal:a,experimental_context:l}),O.execute!=null&&_.providerExecuted!==!0){let T=lt();h.add(T),Sd({name:"ai.toolCall",attributes:sn({telemetry:o,attributes:{...$d({operationId:"ai.toolCall",telemetry:o}),"ai.toolCall.name":_.toolName,"ai.toolCall.id":_.toolCallId,"ai.toolCall.args":{output:()=>JSON.stringify(_.input)}}}),tracer:n,fn:async $=>{let k;try{let M=ud({execute:O.execute.bind(O),input:_.input,options:{toolCallId:_.toolCallId,messages:i,abortSignal:a,experimental_context:l}});for await(let N of M)c.enqueue({..._,type:"tool-result",output:N.output,...N.type==="preliminary"&&{preliminary:!0}}),N.type==="final"&&(k=N.output)}catch(M){Ev($,M),c.enqueue({..._,type:"tool-error",error:M}),h.delete(T),f();return}h.delete(T),f();try{$.setAttributes(sn({telemetry:o,attributes:{"ai.toolCall.result":{output:()=>JSON.stringify(k)}}}))}catch{}}})}}catch(_){c.enqueue({type:"error",error:_})}break}case"tool-result":{let _=x.toolName;x.isError?c.enqueue({type:"tool-error",toolCallId:x.toolCallId,toolName:_,input:y.get(x.toolCallId),providerExecuted:x.providerExecuted,error:x.result}):b.enqueue({type:"tool-result",toolCallId:x.toolCallId,toolName:_,input:y.get(x.toolCallId),output:x.result,providerExecuted:x.providerExecuted});break}default:{let _=S;throw new Error(`Unhandled chunk type: ${_}`)}}},flush(){p=!0,f()}});return new ReadableStream({async start(x){return Promise.all([t.pipeThrough(v).pipeTo(new WritableStream({write(b){x.enqueue(b)},close(){}})),m.pipeTo(new WritableStream({write(b){x.enqueue(b)},close(){x.close()}}))])}})}var PI=zt({prefix:"aitxt",size:24});function Nv({model:e,tools:t,toolChoice:n,system:o,prompt:r,messages:i,maxRetries:a,abortSignal:u,headers:l,stopWhen:c=hI(1),experimental_output:m,experimental_telemetry:h,prepareStep:y,providerOptions:p,experimental_activeTools:d,activeTools:f=d,experimental_repairToolCall:v,experimental_transform:x,experimental_download:b,includeRawChunks:S=!1,onChunk:_,onError:O=({error:re})=>{console.error(re)},onFinish:T,onAbort:$,onStepFinish:k,experimental_context:M,_internal:{now:N=CI,generateId:U=PI,currentDate:Q=()=>new Date}={},...ie}){return new jI({model:Dv(e),telemetry:h,headers:l,settings:ie,maxRetries:a,abortSignal:u,system:o,prompt:r,messages:i,tools:t,toolChoice:n,transforms:Mh(x),activeTools:f,repairToolCall:v,stopConditions:Mh(c),output:m,providerOptions:p,prepareStep:y,includeRawChunks:S,onChunk:_,onError:O,onFinish:T,onAbort:$,onStepFinish:k,now:N,currentDate:Q,generateId:U,experimental_context:M,download:b})}function OI(e){if(!e)return new TransformStream({transform(a,u){u.enqueue({part:a,partialOutput:void 0})}});let t,n="",o="",r="";function i({controller:a,partialOutput:u=void 0}){a.enqueue({part:{type:"text-delta",id:t,text:o},partialOutput:u}),o=""}return new TransformStream({async transform(a,u){if(a.type==="finish-step"&&o.length>0&&i({controller:u}),a.type!=="text-delta"&&a.type!=="text-start"&&a.type!=="text-end"){u.enqueue({part:a,partialOutput:void 0});return}if(t==null)t=a.id;else if(a.id!==t){u.enqueue({part:a,partialOutput:void 0});return}if(a.type==="text-start"){u.enqueue({part:a,partialOutput:void 0});return}if(a.type==="text-end"){o.length>0&&i({controller:u}),u.enqueue({part:a,partialOutput:void 0});return}n+=a.text,o+=a.text;let l=await e.parsePartial({text:n});if(l!=null){let c=JSON.stringify(l.partial);c!==r&&(i({controller:u,partialOutput:l.partial}),r=c)}}})}var jI=class{constructor({model:e,telemetry:t,headers:n,settings:o,maxRetries:r,abortSignal:i,system:a,prompt:u,messages:l,tools:c,toolChoice:m,transforms:h,activeTools:y,repairToolCall:p,stopConditions:d,output:f,providerOptions:v,prepareStep:x,includeRawChunks:b,now:S,currentDate:_,generateId:O,onChunk:T,onError:$,onFinish:k,onAbort:M,onStepFinish:N,experimental_context:U,download:Q}){this._totalUsage=new _a,this._finishReason=new _a,this._steps=new _a,this.output=f,this.includeRawChunks=b,this.tools=c;let ie,re=[],Dt=[],dt,_r,me={},tt=[],ne=[],de,ye={},xr={},Xy=new TransformStream({async transform(pe,fe){var _e,X,rt;fe.enqueue(pe);let{part:R}=pe;if((R.type==="text-delta"||R.type==="reasoning-delta"||R.type==="source"||R.type==="tool-call"||R.type==="tool-result"||R.type==="tool-input-start"||R.type==="tool-input-delta"||R.type==="raw")&&await T?.({chunk:R}),R.type==="error"&&await $({error:rI(R.error)}),R.type==="text-start"&&(ye[R.id]={type:"text",text:"",providerMetadata:R.providerMetadata},re.push(ye[R.id])),R.type==="text-delta"){let ge=ye[R.id];if(ge==null){fe.enqueue({part:{type:"error",error:`text part ${R.id} not found`},partialOutput:void 0});return}ge.text+=R.text,ge.providerMetadata=(_e=R.providerMetadata)!=null?_e:ge.providerMetadata}if(R.type==="text-end"&&delete ye[R.id],R.type==="reasoning-start"&&(xr[R.id]={type:"reasoning",text:"",providerMetadata:R.providerMetadata},re.push(xr[R.id])),R.type==="reasoning-delta"){let ge=xr[R.id];if(ge==null){fe.enqueue({part:{type:"error",error:`reasoning part ${R.id} not found`},partialOutput:void 0});return}ge.text+=R.text,ge.providerMetadata=(X=R.providerMetadata)!=null?X:ge.providerMetadata}if(R.type==="reasoning-end"){let ge=xr[R.id];if(ge==null){fe.enqueue({part:{type:"error",error:`reasoning part ${R.id} not found`},partialOutput:void 0});return}ge.providerMetadata=(rt=R.providerMetadata)!=null?rt:ge.providerMetadata,delete xr[R.id]}if(R.type==="file"&&re.push({type:"file",file:R.file}),R.type==="source"&&re.push(R),R.type==="tool-call"&&re.push(R),R.type==="tool-result"&&!R.preliminary&&re.push(R),R.type==="tool-error"&&re.push(R),R.type==="start-step"&&(me=R.request,tt=R.warnings),R.type==="finish-step"){let ge=Lh({content:re,tools:c}),mn=new gI({content:re,finishReason:R.finishReason,usage:R.usage,warnings:tt,request:me,response:{...R.response,messages:[...Dt,...ge]},providerMetadata:R.providerMetadata});await N?.(mn),H$(tt),ne.push(mn),re=[],xr={},ye={},Dt.push(...ge),ie.resolve()}R.type==="finish"&&(_r=R.totalUsage,dt=R.finishReason)},async flush(pe){try{if(ne.length===0){let rt=new mS({message:"No output generated. Check the stream for errors."});He._finishReason.reject(rt),He._totalUsage.reject(rt),He._steps.reject(rt);return}let fe=dt??"unknown",_e=_r??{inputTokens:void 0,outputTokens:void 0,totalTokens:void 0};He._finishReason.resolve(fe),He._totalUsage.resolve(_e),He._steps.resolve(ne);let X=ne[ne.length-1];await k?.({finishReason:fe,totalUsage:_e,usage:X.usage,content:X.content,text:X.text,reasoningText:X.reasoningText,reasoning:X.reasoning,files:X.files,sources:X.sources,toolCalls:X.toolCalls,staticToolCalls:X.staticToolCalls,dynamicToolCalls:X.dynamicToolCalls,toolResults:X.toolResults,staticToolResults:X.staticToolResults,dynamicToolResults:X.dynamicToolResults,request:X.request,response:X.response,warnings:X.warnings,providerMetadata:X.providerMetadata,steps:ne}),de.setAttributes(sn({telemetry:t,attributes:{"ai.response.finishReason":fe,"ai.response.text":{output:()=>X.text},"ai.response.toolCalls":{output:()=>{var rt;return(rt=X.toolCalls)!=null&&rt.length?JSON.stringify(X.toolCalls):void 0}},"ai.response.providerMetadata":JSON.stringify(X.providerMetadata),"ai.usage.inputTokens":_e.inputTokens,"ai.usage.outputTokens":_e.outputTokens,"ai.usage.totalTokens":_e.totalTokens,"ai.usage.reasoningTokens":_e.reasoningTokens,"ai.usage.cachedInputTokens":_e.cachedInputTokens}}))}catch(fe){pe.error(fe)}finally{de.end()}}}),pn=TI();this.addStream=pn.addStream,this.closeStream=pn.close;let Qy=pn.stream.getReader(),Ra=new ReadableStream({async start(pe){pe.enqueue({type:"start"})},async pull(pe){function fe(){M?.({steps:ne}),pe.enqueue({type:"abort"}),pe.close()}try{let{done:_e,value:X}=await Qy.read();if(_e){pe.close();return}if(i?.aborted){fe();return}pe.enqueue(X)}catch(_e){Nt(_e)&&i?.aborted?fe():pe.error(_e)}},cancel(pe){return pn.stream.cancel(pe)}});for(let pe of h)Ra=Ra.pipeThrough(pe({tools:c,stopStream(){pn.terminate()}}));this.baseStream=Ra.pipeThrough(OI(f)).pipeThrough(Xy);let{maxRetries:eb,retry:tb}=dI({maxRetries:r,abortSignal:i}),Fa=aI(t),wt=BS(o),Xd=nI({model:e,telemetry:t,headers:n,settings:{...wt,maxRetries:eb}}),He=this;Sd({name:"ai.streamText",attributes:sn({telemetry:t,attributes:{...$d({operationId:"ai.streamText",telemetry:t}),...Xd,"ai.prompt":{input:()=>JSON.stringify({system:a,prompt:u,messages:l})}}}),tracer:Fa,endWhenDone:!1,fn:async pe=>{de=pe;async function fe({currentStep:_e,responseMessages:X,usage:rt}){var R,ge,mn,Qd,ep;let tp=He.includeRawChunks;ie=new _a;let rp=await tI({system:a,prompt:u,messages:l}),fn=[...rp.messages,...X],pt=await x?.({model:e,steps:ne,stepNumber:ne.length,messages:fn}),np=await MS({prompt:{system:(R=pt?.system)!=null?R:rp.system,messages:(ge=pt?.messages)!=null?ge:fn},supportedUrls:await e.supportedUrls,download:Q}),gn=Dv((mn=pt?.model)!=null?mn:e),{toolChoice:Ma,tools:Ua}=VS({tools:c,toolChoice:(Qd=pt?.toolChoice)!=null?Qd:m,activeTools:(ep=pt?.activeTools)!=null?ep:y}),{result:{stream:rb,response:op,request:ip},doStreamSpan:Dr,startTimestampMs:ap}=await tb(()=>Sd({name:"ai.streamText.doStream",attributes:sn({telemetry:t,attributes:{...$d({operationId:"ai.streamText.doStream",telemetry:t}),...Xd,"ai.model.provider":gn.provider,"ai.model.id":gn.modelId,"ai.prompt.messages":{input:()=>sI(np)},"ai.prompt.tools":{input:()=>Ua?.map(L=>JSON.stringify(L))},"ai.prompt.toolChoice":{input:()=>Ma!=null?JSON.stringify(Ma):void 0},"gen_ai.system":gn.provider,"gen_ai.request.model":gn.modelId,"gen_ai.request.frequency_penalty":wt.frequencyPenalty,"gen_ai.request.max_tokens":wt.maxOutputTokens,"gen_ai.request.presence_penalty":wt.presencePenalty,"gen_ai.request.stop_sequences":wt.stopSequences,"gen_ai.request.temperature":wt.temperature,"gen_ai.request.top_k":wt.topK,"gen_ai.request.top_p":wt.topP}}),tracer:Fa,endWhenDone:!1,fn:async L=>({startTimestampMs:S(),doStreamSpan:L,result:await gn.doStream({...wt,tools:Ua,toolChoice:Ma,responseFormat:f?.responseFormat,prompt:np,providerOptions:v,abortSignal:i,headers:n,includeRawChunks:tp})})})),nb=AI({tools:c,generatorStream:rb,tracer:Fa,telemetry:t,system:a,messages:fn,repairToolCall:p,abortSignal:i,experimental_context:U}),ob=ip??{},qo=[],Za=[],La,Ba={},wr="unknown",nt={inputTokens:void 0,outputTokens:void 0,totalTokens:void 0},qa,sp=!0,mt={id:O(),timestamp:_(),modelId:e.modelId},up="";He.addStream(nb.pipeThrough(new TransformStream({async transform(L,xe){var hn,vn,Vo,kt;if(L.type==="stream-start"){La=L.warnings;return}if(sp){let Te=S()-ap;sp=!1,Dr.addEvent("ai.stream.firstChunk",{"ai.response.msToFirstChunk":Te}),Dr.setAttributes({"ai.response.msToFirstChunk":Te}),xe.enqueue({type:"start-step",request:ob,warnings:La??[]})}let lp=L.type;switch(lp){case"text-start":case"text-end":{xe.enqueue(L);break}case"text-delta":{L.delta.length>0&&(xe.enqueue({type:"text-delta",id:L.id,text:L.delta,providerMetadata:L.providerMetadata}),up+=L.delta);break}case"reasoning-start":case"reasoning-end":{xe.enqueue(L);break}case"reasoning-delta":{xe.enqueue({type:"reasoning-delta",id:L.id,text:L.delta,providerMetadata:L.providerMetadata});break}case"tool-call":{xe.enqueue(L),qo.push(L);break}case"tool-result":{xe.enqueue(L),L.preliminary||Za.push(L);break}case"tool-error":{xe.enqueue(L),Za.push(L);break}case"response-metadata":{mt={id:(hn=L.id)!=null?hn:mt.id,timestamp:(vn=L.timestamp)!=null?vn:mt.timestamp,modelId:(Vo=L.modelId)!=null?Vo:mt.modelId};break}case"finish":{nt=L.usage,wr=L.finishReason,qa=L.providerMetadata;let Te=S()-ap;Dr.addEvent("ai.stream.finish"),Dr.setAttributes({"ai.response.msToFinish":Te,"ai.response.avgOutputTokensPerSecond":1e3*((kt=nt.outputTokens)!=null?kt:0)/Te});break}case"file":{xe.enqueue(L);break}case"source":{xe.enqueue(L);break}case"tool-input-start":{Ba[L.id]=L.toolName;let Te=c?.[L.toolName];Te?.onInputStart!=null&&await Te.onInputStart({toolCallId:L.id,messages:fn,abortSignal:i,experimental_context:U}),xe.enqueue({...L,dynamic:Te?.type==="dynamic"});break}case"tool-input-end":{delete Ba[L.id],xe.enqueue(L);break}case"tool-input-delta":{let Te=Ba[L.id],Va=c?.[Te];Va?.onInputDelta!=null&&await Va.onInputDelta({inputTextDelta:L.delta,toolCallId:L.id,messages:fn,abortSignal:i,experimental_context:U}),xe.enqueue(L);break}case"error":{xe.enqueue(L),wr="error";break}case"raw":{tp&&xe.enqueue(L);break}default:{let Te=lp;throw new Error(`Unknown chunk type: ${Te}`)}}},async flush(L){let xe=qo.length>0?JSON.stringify(qo):void 0;try{Dr.setAttributes(sn({telemetry:t,attributes:{"ai.response.finishReason":wr,"ai.response.text":{output:()=>up},"ai.response.toolCalls":{output:()=>xe},"ai.response.id":mt.id,"ai.response.model":mt.modelId,"ai.response.timestamp":mt.timestamp.toISOString(),"ai.response.providerMetadata":JSON.stringify(qa),"ai.usage.inputTokens":nt.inputTokens,"ai.usage.outputTokens":nt.outputTokens,"ai.usage.totalTokens":nt.totalTokens,"ai.usage.reasoningTokens":nt.reasoningTokens,"ai.usage.cachedInputTokens":nt.cachedInputTokens,"gen_ai.response.finish_reasons":[wr],"gen_ai.response.id":mt.id,"gen_ai.response.model":mt.modelId,"gen_ai.usage.input_tokens":nt.inputTokens,"gen_ai.usage.output_tokens":nt.outputTokens}}))}catch{}finally{Dr.end()}L.enqueue({type:"finish-step",finishReason:wr,usage:nt,providerMetadata:qa,response:{...mt,headers:op?.headers}});let hn=uI(rt,nt);await ie.promise;let vn=qo.filter(kt=>kt.providerExecuted!==!0),Vo=Za.filter(kt=>kt.providerExecuted!==!0);if(vn.length>0&&Vo.length===vn.length&&!await vI({stopConditions:d,steps:ne})){X.push(...Lh({content:ne[ne.length-1].content,tools:c}));try{await fe({currentStep:_e+1,responseMessages:X,usage:hn})}catch(kt){L.enqueue({type:"error",error:kt}),He.closeStream()}}else L.enqueue({type:"finish",finishReason:wr,totalUsage:hn}),He.closeStream()}})))}await fe({currentStep:0,responseMessages:[],usage:{inputTokens:void 0,outputTokens:void 0,totalTokens:void 0}})}}).catch(pe=>{He.addStream(new ReadableStream({start(fe){fe.enqueue({type:"error",error:pe}),fe.close()}})),He.closeStream()})}get steps(){return this.consumeStream(),this._steps.promise}get finalStep(){return this.steps.then(e=>e[e.length-1])}get content(){return this.finalStep.then(e=>e.content)}get warnings(){return this.finalStep.then(e=>e.warnings)}get providerMetadata(){return this.finalStep.then(e=>e.providerMetadata)}get text(){return this.finalStep.then(e=>e.text)}get reasoningText(){return this.finalStep.then(e=>e.reasoningText)}get reasoning(){return this.finalStep.then(e=>e.reasoning)}get sources(){return this.finalStep.then(e=>e.sources)}get files(){return this.finalStep.then(e=>e.files)}get toolCalls(){return this.finalStep.then(e=>e.toolCalls)}get staticToolCalls(){return this.finalStep.then(e=>e.staticToolCalls)}get dynamicToolCalls(){return this.finalStep.then(e=>e.dynamicToolCalls)}get toolResults(){return this.finalStep.then(e=>e.toolResults)}get staticToolResults(){return this.finalStep.then(e=>e.staticToolResults)}get dynamicToolResults(){return this.finalStep.then(e=>e.dynamicToolResults)}get usage(){return this.finalStep.then(e=>e.usage)}get request(){return this.finalStep.then(e=>e.request)}get response(){return this.finalStep.then(e=>e.response)}get totalUsage(){return this.consumeStream(),this._totalUsage.promise}get finishReason(){return this.consumeStream(),this._finishReason.promise}teeStream(){let[e,t]=this.baseStream.tee();return this.baseStream=t,e}get textStream(){return ba(this.teeStream().pipeThrough(new TransformStream({transform({part:e},t){e.type==="text-delta"&&t.enqueue(e.text)}})))}get fullStream(){return ba(this.teeStream().pipeThrough(new TransformStream({transform({part:e},t){t.enqueue(e)}})))}async consumeStream(e){var t;try{await EI({stream:this.fullStream,onError:e?.onError})}catch(n){(t=e?.onError)==null||t.call(e,n)}}get experimental_partialOutputStream(){if(this.output==null)throw new G$;return ba(this.teeStream().pipeThrough(new TransformStream({transform({partialOutput:e},t){e!=null&&t.enqueue(e)}})))}toUIMessageStream({originalMessages:e,generateMessageId:t,onFinish:n,messageMetadata:o,sendReasoning:r=!0,sendSources:i=!1,sendStart:a=!0,sendFinish:u=!0,onError:l=ft}={}){let c=t!=null?xI({originalMessages:e,responseMessageId:t}):void 0,m={},h=p=>{var d,f;let v=m[p];return((f=(d=this.tools)==null?void 0:d[v])==null?void 0:f.type)==="dynamic"?!0:void 0},y=this.fullStream.pipeThrough(new TransformStream({transform:async(p,d)=>{let f=o?.({part:p}),v=p.type;switch(v){case"text-start":{d.enqueue({type:"text-start",id:p.id,...p.providerMetadata!=null?{providerMetadata:p.providerMetadata}:{}});break}case"text-delta":{d.enqueue({type:"text-delta",id:p.id,delta:p.text,...p.providerMetadata!=null?{providerMetadata:p.providerMetadata}:{}});break}case"text-end":{d.enqueue({type:"text-end",id:p.id,...p.providerMetadata!=null?{providerMetadata:p.providerMetadata}:{}});break}case"reasoning-start":{d.enqueue({type:"reasoning-start",id:p.id,...p.providerMetadata!=null?{providerMetadata:p.providerMetadata}:{}});break}case"reasoning-delta":{r&&d.enqueue({type:"reasoning-delta",id:p.id,delta:p.text,...p.providerMetadata!=null?{providerMetadata:p.providerMetadata}:{}});break}case"reasoning-end":{d.enqueue({type:"reasoning-end",id:p.id,...p.providerMetadata!=null?{providerMetadata:p.providerMetadata}:{}});break}case"file":{d.enqueue({type:"file",mediaType:p.file.mediaType,url:`data:${p.file.mediaType};base64,${p.file.base64}`});break}case"source":{i&&p.sourceType==="url"&&d.enqueue({type:"source-url",sourceId:p.id,url:p.url,title:p.title,...p.providerMetadata!=null?{providerMetadata:p.providerMetadata}:{}}),i&&p.sourceType==="document"&&d.enqueue({type:"source-document",sourceId:p.id,mediaType:p.mediaType,title:p.title,filename:p.filename,...p.providerMetadata!=null?{providerMetadata:p.providerMetadata}:{}});break}case"tool-input-start":{m[p.id]=p.toolName;let x=h(p.id);d.enqueue({type:"tool-input-start",toolCallId:p.id,toolName:p.toolName,...p.providerExecuted!=null?{providerExecuted:p.providerExecuted}:{},...x!=null?{dynamic:x}:{}});break}case"tool-input-delta":{d.enqueue({type:"tool-input-delta",toolCallId:p.id,inputTextDelta:p.delta});break}case"tool-call":{m[p.toolCallId]=p.toolName;let x=h(p.toolCallId);p.invalid?d.enqueue({type:"tool-input-error",toolCallId:p.toolCallId,toolName:p.toolName,input:p.input,...p.providerExecuted!=null?{providerExecuted:p.providerExecuted}:{},...p.providerMetadata!=null?{providerMetadata:p.providerMetadata}:{},...x!=null?{dynamic:x}:{},errorText:l(p.error)}):d.enqueue({type:"tool-input-available",toolCallId:p.toolCallId,toolName:p.toolName,input:p.input,...p.providerExecuted!=null?{providerExecuted:p.providerExecuted}:{},...p.providerMetadata!=null?{providerMetadata:p.providerMetadata}:{},...x!=null?{dynamic:x}:{}});break}case"tool-result":{let x=h(p.toolCallId);d.enqueue({type:"tool-output-available",toolCallId:p.toolCallId,output:p.output,...p.providerExecuted!=null?{providerExecuted:p.providerExecuted}:{},...p.preliminary!=null?{preliminary:p.preliminary}:{},...x!=null?{dynamic:x}:{}});break}case"tool-error":{let x=h(p.toolCallId);d.enqueue({type:"tool-output-error",toolCallId:p.toolCallId,errorText:l(p.error),...p.providerExecuted!=null?{providerExecuted:p.providerExecuted}:{},...x!=null?{dynamic:x}:{}});break}case"error":{d.enqueue({type:"error",errorText:l(p.error)});break}case"start-step":{d.enqueue({type:"start-step"});break}case"finish-step":{d.enqueue({type:"finish-step"});break}case"start":{a&&d.enqueue({type:"start",...f!=null?{messageMetadata:f}:{},...c!=null?{messageId:c}:{}});break}case"finish":{u&&d.enqueue({type:"finish",...f!=null?{messageMetadata:f}:{}});break}case"abort":{d.enqueue(p);break}case"tool-input-end":break;case"raw":break;default:{let x=v;throw new Error(`Unknown chunk type: ${x}`)}}f!=null&&v!=="start"&&v!=="finish"&&d.enqueue({type:"message-metadata",messageMetadata:f})}}));return ba(SI({stream:y,messageId:c??t?.(),originalMessages:e,onFinish:n,onError:l}))}pipeUIMessageStreamToResponse(e,{originalMessages:t,generateMessageId:n,onFinish:o,messageMetadata:r,sendReasoning:i,sendSources:a,sendFinish:u,sendStart:l,onError:c,...m}={}){II({response:e,stream:this.toUIMessageStream({originalMessages:t,generateMessageId:n,onFinish:o,messageMetadata:r,sendReasoning:i,sendSources:a,sendFinish:u,sendStart:l,onError:c}),...m})}pipeTextStreamToResponse(e,t){bI({response:e,textStream:this.textStream,...t})}toUIMessageStreamResponse({originalMessages:e,generateMessageId:t,onFinish:n,messageMetadata:o,sendReasoning:r,sendSources:i,sendFinish:a,sendStart:u,onError:l,...c}={}){return _I({stream:this.toUIMessageStream({originalMessages:e,generateMessageId:t,onFinish:n,messageMetadata:o,sendReasoning:r,sendSources:i,sendFinish:a,sendStart:u,onError:l}),...c})}toTextStreamResponse(e){return yI({textStream:this.textStream,...e})}};var c4=zt({prefix:"aiobj",size:24});var p4=zt({prefix:"aiobj",size:24});var NI={};V$(NI,{object:()=>RI,text:()=>zI});var zI=()=>({type:"text",responseFormat:{type:"text"},async parsePartial({text:e}){return{partial:e}},async parseOutput({text:e}){return e}}),RI=({schema:e})=>{let t=fr(e);return{type:"object",responseFormat:{type:"json",schema:t.jsonSchema},async parsePartial({text:n}){let o=await jv(n);switch(o.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:o.value};default:{let r=o.state;throw new Error(`Unsupported parse state: ${r}`)}}},async parseOutput({text:n},o){let r=await yt({text:n});if(!r.success)throw new Rh({message:"No object generated: could not parse the response.",cause:r.error,text:n,response:o.response,usage:o.usage,finishReason:o.finishReason});let i=await Rt({value:r.value,schema:t});if(!i.success)throw new Rh({message:"No object generated: response did not match schema.",cause:i.error,text:n,response:o.response,usage:o.usage,finishReason:o.finishReason});return i.value}}};var FI="AI_NoSuchProviderError",MI=`vercel.ai.error.${FI}`,UI=Symbol.for(MI),ZI;ZI=UI;var LI=s.looseObject({name:s.string(),version:s.string()}),Id=s.looseObject({_meta:s.optional(s.object({}).loose())}),zo=Id,BI=s.object({method:s.string(),params:s.optional(Id)}),qI=s.looseObject({experimental:s.optional(s.object({}).loose()),logging:s.optional(s.object({}).loose()),prompts:s.optional(s.looseObject({listChanged:s.optional(s.boolean())})),resources:s.optional(s.looseObject({subscribe:s.optional(s.boolean()),listChanged:s.optional(s.boolean())})),tools:s.optional(s.looseObject({listChanged:s.optional(s.boolean())}))}),h4=zo.extend({protocolVersion:s.string(),capabilities:qI,serverInfo:LI,instructions:s.optional(s.string())}),VI=zo.extend({nextCursor:s.optional(s.string())}),JI=s.object({name:s.string(),description:s.optional(s.string()),inputSchema:s.object({type:s.literal("object"),properties:s.optional(s.object({}).loose())}).loose()}).loose(),v4=VI.extend({tools:s.array(JI)}),GI=s.object({type:s.literal("text"),text:s.string()}).loose(),WI=s.object({type:s.literal("image"),data:s.base64(),mimeType:s.string()}).loose(),zv=s.object({uri:s.string(),mimeType:s.optional(s.string())}).loose(),KI=zv.extend({text:s.string()}),HI=zv.extend({blob:s.base64()}),YI=s.object({type:s.literal("resource"),resource:s.union([KI,HI])}).loose(),y4=zo.extend({content:s.array(s.union([GI,WI,YI])),isError:s.boolean().default(!1).optional()}).or(zo.extend({toolResult:s.unknown()})),Da="2.0",XI=s.object({jsonrpc:s.literal(Da),id:s.union([s.string(),s.number().int()])}).merge(BI).strict(),QI=s.object({jsonrpc:s.literal(Da),id:s.union([s.string(),s.number().int()]),result:zo}).strict(),eE=s.object({jsonrpc:s.literal(Da),id:s.union([s.string(),s.number().int()]),error:s.object({code:s.number().int(),message:s.string(),data:s.optional(s.unknown())})}).strict(),tE=s.object({jsonrpc:s.literal(Da)}).merge(s.object({method:s.string(),params:s.optional(Id)})).strict(),b4=s.union([XI,tE,QI,eE]);var rE=s.object({type:s.literal("text"),text:s.string(),state:s.enum(["streaming","done"]).optional(),providerMetadata:Y.optional()}),nE=s.object({type:s.literal("reasoning"),text:s.string(),state:s.enum(["streaming","done"]).optional(),providerMetadata:Y.optional()}),oE=s.object({type:s.literal("source-url"),sourceId:s.string(),url:s.string(),title:s.string().optional(),providerMetadata:Y.optional()}),iE=s.object({type:s.literal("source-document"),sourceId:s.string(),mediaType:s.string(),title:s.string(),filename:s.string().optional(),providerMetadata:Y.optional()}),aE=s.object({type:s.literal("file"),mediaType:s.string(),filename:s.string().optional(),url:s.string(),providerMetadata:Y.optional()}),sE=s.object({type:s.literal("step-start")}),uE=s.object({type:s.string().startsWith("data-"),id:s.string().optional(),data:s.unknown()}),lE=[s.object({type:s.literal("dynamic-tool"),toolName:s.string(),toolCallId:s.string(),state:s.literal("input-streaming"),input:s.unknown().optional(),output:s.never().optional(),errorText:s.never().optional()}),s.object({type:s.literal("dynamic-tool"),toolName:s.string(),toolCallId:s.string(),state:s.literal("input-available"),input:s.unknown(),output:s.never().optional(),errorText:s.never().optional(),callProviderMetadata:Y.optional()}),s.object({type:s.literal("dynamic-tool"),toolName:s.string(),toolCallId:s.string(),state:s.literal("output-available"),input:s.unknown(),output:s.unknown(),errorText:s.never().optional(),callProviderMetadata:Y.optional(),preliminary:s.boolean().optional()}),s.object({type:s.literal("dynamic-tool"),toolName:s.string(),toolCallId:s.string(),state:s.literal("output-error"),input:s.unknown(),output:s.never().optional(),errorText:s.string(),callProviderMetadata:Y.optional()})],cE=[s.object({type:s.string().startsWith("tool-"),toolCallId:s.string(),state:s.literal("input-streaming"),providerExecuted:s.boolean().optional(),input:s.unknown().optional(),output:s.never().optional(),errorText:s.never().optional()}),s.object({type:s.string().startsWith("tool-"),toolCallId:s.string(),state:s.literal("input-available"),providerExecuted:s.boolean().optional(),input:s.unknown(),output:s.never().optional(),errorText:s.never().optional(),callProviderMetadata:Y.optional()}),s.object({type:s.string().startsWith("tool-"),toolCallId:s.string(),state:s.literal("output-available"),providerExecuted:s.boolean().optional(),input:s.unknown(),output:s.unknown(),errorText:s.never().optional(),callProviderMetadata:Y.optional(),preliminary:s.boolean().optional()}),s.object({type:s.string().startsWith("tool-"),toolCallId:s.string(),state:s.literal("output-error"),providerExecuted:s.boolean().optional(),input:s.unknown(),output:s.never().optional(),errorText:s.string(),callProviderMetadata:Y.optional()})],x4=s.object({id:s.string(),role:s.enum(["system","user","assistant"]),metadata:s.unknown().optional(),parts:s.array(s.union([rE,nE,oE,iE,aE,sE,uE,...lE,...cE]))});var Ze="make a 300 word story";import Ro from"fs";var Rv={reset:"\x1B[0m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",bright:"\x1B[1m",dim:"\x1B[2m"};function je(e,t){return`${Rv[t]}${e}${Rv.reset}`}var wa=class{constructor(t,n){this.providerName=t,this.modelName=n,this.config=this.loadConfig(),this.validateProviderAndModel()}loadConfig(){let t="ai-benchmark-config.json";if(!Ro.existsSync(t))throw new Error("Configuration file ai-benchmark-config.json not found");let n=Ro.readFileSync(t,"utf8");return JSON.parse(n)}validateProviderAndModel(){let t=this.config.providers.find(o=>o.name===this.providerName);if(!t)throw new Error(`Provider '${this.providerName}' not found in configuration`);let n=t.models.find(o=>o.name===this.modelName);if(!n)throw new Error(`Model '${this.modelName}' not found for provider '${this.providerName}'`);this.provider=t,this.model=n}async runBenchmark(){console.log("=== LLM Benchmark ==="),console.log(`Provider: ${this.providerName}`),console.log(`Model: ${this.modelName} (${this.model.name})`),console.log("Starting benchmark..."),this.startTime=new Date,console.log(`Start time: ${this.startTime.toISOString()}`);let t=await this.makeApiCall();this.endTime=new Date,console.log(`End time: ${this.endTime.toISOString()}`),this.calculateAndDisplayMetrics(t)}async makeApiCall(){let t=this.provider.type==="anthropic"?"/v1/messages":"/chat/completions",n=`${this.provider.baseUrl}${t}`,o={"Content-Type":"application/json",Authorization:`Bearer ${this.provider.apiKey}`};this.provider.type==="anthropic"&&(o["x-api-key"]=this.provider.apiKey,o["anthropic-version"]="2023-06-01");let r={model:this.model.name,messages:[{role:"user",content:Ze}],max_tokens:1e3,temperature:.7};this.provider.type==="anthropic"&&(r.model=this.model.name,r.max_tokens=1e3);let i=await fetch(n,{method:"POST",headers:o,body:JSON.stringify(r)});if(!i.ok)throw new Error(`API request failed: ${i.status} ${i.statusText}`);return await i.json()}calculateAndDisplayMetrics(t){let n=(this.endTime-this.startTime)/1e3,o,r;this.provider.type==="anthropic"?(o=t.usage?.input_tokens||this.estimateTokens(Ze),r=t.usage?.output_tokens||this.estimateTokens(t.content?.[0]?.text||"")):(o=t.usage?.prompt_tokens||this.estimateTokens(Ze),r=t.usage?.completion_tokens||this.estimateTokens(t.choices?.[0]?.message?.content||""));let i=o+r,a=n>0?i/n:0;console.log(`
|
|
79
79
|
=== Results ===`),console.log(`Duration: ${n.toFixed(3)} seconds`),console.log(`Input tokens: ${o}`),console.log(`Output tokens: ${r}`),console.log(`Total tokens: ${i}`),console.log(`Tokens per second: ${a.toFixed(2)}`)}estimateTokens(t){return Math.round(t.length/4)}async runBenchmarkForResults(){try{this.startTime=new Date;let t=await this.makeApiCall();this.endTime=new Date;let n=(this.endTime-this.startTime)/1e3,o,r;this.provider.type==="anthropic"?(o=t.usage?.input_tokens||this.estimateTokens(Ze),r=t.usage?.output_tokens||this.estimateTokens(t.content?.[0]?.text||"")):(o=t.usage?.prompt_tokens||this.estimateTokens(Ze),r=t.usage?.completion_tokens||this.estimateTokens(t.choices?.[0]?.message?.content||""));let i=o+r,a=n>0?i/n:0;return{provider:this.providerName,model:this.modelName,totalTokens:i,tokensPerSecond:Math.round(a*100)/100,duration:Math.round(n*1e3)/1e3,success:!0}}catch(t){return{provider:this.providerName,model:this.modelName,totalTokens:0,tokensPerSecond:0,duration:0,success:!1,error:t.message}}}},ka=class{constructor(t){this.config=t}async runAll(){console.log("=== LLM Benchmark ==="),console.log("Running benchmarks on all configured models..."),console.log(`Starting at ${new Date().toISOString()}`),console.log("");let t=this.createBenchmarks(),n=await this.runParallel(t);this.displayResultsTable(n),this.displaySummary(n)}async runSilent(){let t=this.createBenchmarks();return await this.runParallel(t)}createBenchmarks(){let t=[];return this.config.providers.forEach(n=>{n.models.forEach(o=>{t.push(new wa(n.name,o.name))})}),t}async runParallel(t){let n=[],o=t.map(i=>i.runBenchmarkForResults()),r=await Promise.all(o);return n.push(...r),n}displayResultsTable(t){let n=t.sort((m,h)=>h.tokensPerSecond-m.tokensPerSecond),o=6,r=Math.max(...n.map(m=>m.provider.length),8),i=Math.max(...n.map(m=>m.model.length),5),a=12,u=15,l=`| ${"Rank".padStart(o)} | ${"Provider".padEnd(r)} | ${"Model".padEnd(i)} | ${"Total Tokens".padStart(a)} | ${"Tokens/sec".padStart(u)} |`,c=`| ${"-".repeat(o)} | ${"-".repeat(r)} | ${"-".repeat(i)} | ${"-".repeat(a)} | ${"-".repeat(u)} |`;console.log(""),console.log(je("PERFORMANCE RANKINGS - Fastest at Top","cyan")),console.log(l),console.log(c),n.forEach((m,h)=>{let y=h+1,p=y.toString().padStart(o);if(m.success){let d=m.provider.padEnd(r),f=m.model.padEnd(i),v=m.totalTokens.toString().padStart(a),x=m.tokensPerSecond.toString().padStart(u),b=p;y===1?b=je("1st","yellow")+p.slice(3):y===2?b=je("2nd","white")+p.slice(3):y===3&&(b=je("3rd","bright")+p.slice(3)),console.log(`| ${b} | ${d} | ${f} | ${v} | ${x} |`)}else{let d=m.provider.padEnd(r),f=m.model.padEnd(i),v="ERROR".padStart(a),x="FAILED".padStart(u);console.log(`| ${p} | ${d} | ${f} | ${v} | ${x} |`)}}),console.log("")}displaySummary(t){let n=t.filter(r=>r.success),o=t.filter(r=>!r.success);if(console.log(je("=== SUMMARY ===","cyan")),console.log(je(`Total benchmarks: ${t.length}`,"white")),console.log(je(`Successful: ${n.length}`,"green")),console.log(je(`Failed: ${o.length}`,"red")),n.length>0){let r=n.reduce((u,l)=>u+l.tokensPerSecond,0)/n.length,i=n.reduce((u,l)=>l.tokensPerSecond>u.tokensPerSecond?l:u),a=n.reduce((u,l)=>l.tokensPerSecond<u.tokensPerSecond?l:u);console.log(je(`Average tokens/sec: ${r.toFixed(2)}`,"yellow")),console.log(je(`Fastest: ${i.provider}/${i.model} (${i.tokensPerSecond} tokens/sec)`,"green")),console.log(je(`Slowest: ${a.provider}/${a.model} (${a.tokensPerSecond} tokens/sec)`,"red"))}if(o.length>0&&(console.log(je(`
|
|
80
80
|
Failed benchmarks:`,"red")),o.forEach(r=>{console.log(je(` FAILED ${r.provider}/${r.model}: ${r.error}`,"red"))})),n.length>0){console.log(je(`
|
|
81
81
|
=== PROVIDER PERFORMANCE ===`,"cyan"));let r={};n.forEach(a=>{r[a.provider]||(r[a.provider]={totalTps:0,count:0,models:[]}),r[a.provider].totalTps+=a.tokensPerSecond,r[a.provider].count+=1,r[a.provider].models.push(a)}),Object.entries(r).map(([a,u])=>({provider:a,avgTps:u.totalTps/u.count,modelCount:u.count,models:u.models})).sort((a,u)=>u.avgTps-a.avgTps).forEach((a,u)=>{let l=u+1,c=l===1?"1st":l===2?"2nd":l===3?"3rd":`${l}th`;console.log(je(`${c} ${a.provider}: ${a.avgTps.toFixed(2)} avg tokens/sec (${a.modelCount} models)`,l===1?"yellow":l===2?"white":l===3?"bright":"white"))})}}},Ed=class{constructor(t){this.config=t,this.csvFile=`llm_benchmark_results_${new Date().toISOString().replace(/[:.]/g,"-").slice(0,-5)}.csv`,this.running=!0,this.setupSignalHandlers()}setupSignalHandlers(){process.on("SIGINT",()=>{this.running=!1,console.log(`
|
|
@@ -85,8 +85,8 @@ Tracking stopped by user`),console.log(`Results saved to: ${this.csvFile}`)}init
|
|
|
85
85
|
`)}async runTrackingCycle(){let t=new Date;console.log(`[${t.toISOString()}] Running benchmark cycle...`);let o=await new ka(this.config).runSilent();this.writeResultsToCsv(t,o),this.displayCycleSummary(o)}writeResultsToCsv(t,n){let o=n.filter(r=>r.success).map(r=>{let i=`${r.provider}+${r.model}`;return[t.toISOString(),i,r.tokensPerSecond,r.totalTokens,r.duration].join(",")}).join(`
|
|
86
86
|
`);o&&Ro.appendFileSync(this.csvFile,o+`
|
|
87
87
|
`)}displayCycleSummary(t){let n=t.filter(r=>r.success),o=t.filter(r=>!r.success);if(console.log(` Completed: ${n.length} successful, ${o.length} failed`),n.length>0){let r=n.reduce((i,a)=>i+a.tokensPerSecond,0)/n.length;console.log(` Average tokens/sec: ${r.toFixed(2)}`)}if(o.length>0){let r=o.map(i=>`${i.provider}/${i.model}`).join(", ");console.log(` Failed: ${r}`)}}sleep(t){return new Promise(n=>setTimeout(n,t))}};function dE(){let e=process.argv.slice(2),t={};for(let n=0;n<e.length;n++)switch(e[n]){case"--provider":t.provider=e[++n];break;case"--model":t.model=e[++n];break;case"--all":t.all=!0;break;case"--track":t.track=!0;break;case"--help":pE(),process.exit(0);break}if(t.track&&!t.all&&(console.log("Error: --track requires --all"),console.log("Use --help for usage information"),process.exit(1)),t.all)return t;if(t.provider&&t.model)return t;console.log("Error: Either --provider and --model, or --all is required"),console.log("Use --help for usage information"),process.exit(1)}function pE(){console.log("Usage: node benchmark-rest.js --provider PROVIDER --model MODEL"),console.log(" node benchmark-rest.js --all [--track]"),console.log(""),console.log("Options:"),console.log(" --provider PROVIDER Provider name from ai-benchmark-config.json"),console.log(" --model MODEL Model name from ai-benchmark-config.json"),console.log(" --all Run benchmark on all configured models"),console.log(" --track Enable continuous tracking with CSV output (requires --all)"),console.log(" --help Display this help message")}async function mE(){try{let e=dE();if(e.all){let t=JSON.parse(Ro.readFileSync("ai-benchmark-config.json","utf8"));e.track?await new Ed(t).startTracking():await new ka(t).runAll()}else await new wa(e.provider,e.model).runBenchmark()}catch(e){console.error(`Error: ${e.message}`),process.exit(1)}}process.on("SIGINT",()=>{console.log(`
|
|
88
|
-
Benchmark interrupted by user`),process.exit(0)});import.meta.url===`file://${process.argv[1]}`&&process.argv[1].endsWith("benchmark-rest.js")&&mE();import Ut from"fs";import $a from"path";import{homedir as gE}from"os";var Td={"custom-verified-providers":{"zai-code-anth":{id:"zai-code-anth",name:"zai-code-anth",baseUrl:"https://api.z.ai/api/anthropic/v1",type:"anthropic",models:{"glm-4-5":{id:"glm-4.5",name:"GLM-4.5-anth"},"glm-4-5-air":{id:"glm-4.5-air",name:"GLM-4.5-air-anth"},"glm-4-6":{id:"glm-4.6",name:"GLM-4.6-anth"}}},"zai-china-anth-base":{id:"zai-china-anth-base",name:"zai-china-anth-base",baseUrl:"https://open.bigmodel.cn/api/anthropic/v1",type:"anthropic",models:{"glm-4-5":{id:"glm-4.5",name:"GLM-4.5-china-anth"},"glm-4-5-air":{id:"glm-4.5-air",name:"GLM-4.5-air-china-anth"},"glm-4-6":{id:"glm-4.6",name:"GLM-4.6-china-anth"}}},"extra-models-dev":{chutes:{"deepseek-ai/DeepSeek-V3.1-Terminus":{id:"deepseek-ai/DeepSeek-V3.1-Terminus",name:"DeepSeek V3.1 Terminus"},"meituan-longcat/LongCat-Flash-Thinking-FP8":{id:"meituan-longcat/LongCat-Flash-Thinking-FP8",name:"LongCat Flash Thinking FP8"},"zai-org/GLM-4.5-turbo":{id:"zai-org/GLM-4.5-turbo",name:"GLM-4.5 Turbo"},"deepseek-ai/DeepSeek-V3.1-turbo":{id:"deepseek-ai/DeepSeek-V3.1-turbo",name:"DeepSeek V3.1 Turbo"}}},"nanogpt-plan":{id:"nanogpt-plan",name:"nanogpt-plan",baseUrl:"https://nano-gpt.com/api/v1",type:"openai-compatible",models:{"deepseek-ai/DeepSeek-V3.1-Terminus":{id:"deepseek-ai/DeepSeek-V3.1-Terminus",name:"DeepSeek V3.1 Terminus"},"deepseek-ai/DeepSeek-V3.1":{id:"deepseek-ai/DeepSeek-V3.1",name:"DeepSeek V3.1"},"deepseek-ai/DeepSeek-V3.1-Terminus:thinking":{id:"deepseek-ai/DeepSeek-V3.1-Terminus:thinking",name:"DeepSeek V3.1 Terminus Thinking"},"zai-org/GLM-4.5-FP8":{id:"zai-org/GLM-4.5-FP8",name:"GLM 4.5 FP8"},"zai-org/GLM-4.5-FP8:thinking":{id:"zai-org/GLM-4.5-FP8:thinking",name:"GLM 4.5 FP8 Thinking"},"zai-org/GLM-4.5-Air":{id:"zai-org/GLM-4.5-Air",name:"GLM 4.5 Air"},"moonshotai/Kimi-K2-Instruct":{id:"moonshotai/Kimi-K2-Instruct",name:"Kimi K2 Instruct"},"moonshotai/Kimi-K2-Instruct-0905":{id:"moonshotai/Kimi-K2-Instruct-0905",name:"Kimi K2 Instruct 0905"},"deepseek-ai/deepseek-v3.2-exp":{id:"deepseek-ai/deepseek-v3.2-exp",name:"DeepSeek V3.2 Exp"},"z-ai/glm-4.6":{id:"z-ai/glm-4.6",name:"GLM 4.6"},"z-ai/glm-4.6:thinking":{id:"z-ai/glm-4.6:thinking",name:"GLM 4.6 Thinking"},"qwen3-vl-235b-a22b-instruct":{id:"qwen3-vl-235b-a22b-instruct",name:"Qwen3 VL 235B A22B Instruct"}}}}};var Cd=$a.join(gE(),".cache","ai-speedometer"),Ad=$a.join(Cd,"models.json"),Fv=[{id:"openai",name:"OpenAI",baseUrl:"https://api.openai.com/v1",type:"openai-compatible",models:[{id:"gpt-4o",name:"GPT-4o"},{id:"gpt-4o-mini",name:"GPT-4o Mini"},{id:"gpt-4-turbo",name:"GPT-4 Turbo"},{id:"gpt-3.5-turbo",name:"GPT-3.5 Turbo"}]},{id:"anthropic",name:"Anthropic",baseUrl:"https://api.anthropic.com",type:"anthropic",models:[{id:"claude-3-5-sonnet-20241022",name:"Claude 3.5 Sonnet"},{id:"claude-3-5-haiku-20241022",name:"Claude 3.5 Haiku"},{id:"claude-3-opus-20240229",name:"Claude 3 Opus"}]},{id:"openrouter",name:"OpenRouter",baseUrl:"https://openrouter.ai/api/v1",type:"openai-compatible",models:[{id:"anthropic/claude-3.5-sonnet",name:"Claude 3.5 Sonnet"},{id:"openai/gpt-4o",name:"GPT-4o"},{id:"openai/gpt-4o-mini",name:"GPT-4o Mini"}]}];function hE(){try{Ut.existsSync(Cd)||Ut.mkdirSync(Cd,{recursive:!0})}catch(e){console.warn("Warning: Could not create cache directory:",e.message)}}function vE(e){if(!e.timestamp)return!0;let n=Date.now()-e.timestamp,o=3600*1e3;return n>o}function yE(){try{if(Ut.existsSync(Ad)){let e=Ut.readFileSync(Ad,"utf8"),t=JSON.parse(e);return vE(t)?null:t}}catch(e){console.warn("Warning: Could not load cache:",e.message)}return null}function bE(e){try{hE();let t={...e,timestamp:Date.now()};Ut.writeFileSync(Ad,JSON.stringify(t,null,2))}catch(t){console.warn("Warning: Could not save cache:",t.message)}}async function _E(){try{let e=await fetch("https://models.dev/api.json");if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);return await e.json()}catch(e){return console.warn("Warning: Could not fetch from models.dev API:",e.message),null}}function Fo(){try{let e=Td,t=$a.join(process.cwd(),"custom-verified-providers.json");if(Ut.existsSync(t))try{let o=Ut.readFileSync(t,"utf8");e=JSON.parse(o)}catch(o){console.warn("Warning: Could not load custom providers from file, using embedded data:",o.message)}let n=[];if(e["custom-verified-providers"]){for(let[,o]of Object.entries(e["custom-verified-providers"]))if(o.id!=="extra-models-dev"&&o.id&&o.name&&o.models){let r={id:o.id,name:o.name,baseUrl:o.baseUrl||"",type:o.type||"openai-compatible",models:Object.values(o.models).map(i=>({id:i.id,name:i.name}))};n.push(r)}}return n}catch(e){console.warn("Warning: Could not load custom verified providers:",e.message)}return[]}function Mv(){try{let e=Td,t=$a.join(process.cwd(),"custom-verified-providers.json");if(Ut.existsSync(t))try{let o=Ut.readFileSync(t,"utf8");e=JSON.parse(o)}catch(o){console.warn("Warning: Could not load extra models from file, using embedded data:",o.message)}let n={};if(e["custom-verified-providers"]&&e["custom-verified-providers"]["extra-models-dev"])for(let[o,r]of Object.entries(e["custom-verified-providers"]["extra-models-dev"]))n[o]=Object.values(r).map(i=>({id:i.id,name:i.name}));return n}catch(e){console.warn("Warning: Could not load extra models:",e.message)}return{}}function xE(e){let t=[],n=Fo();t.push(...n);let o=Mv();if(e){for(let[,r]of Object.entries(e))if(r.id&&r.name&&r.models){let i=Object.values(r.models).map(u=>({id:u.id,name:u.name}));o[r.id]&&i.push(...o[r.id]);let a={id:r.id,name:r.name,baseUrl:r.api||r.baseUrl||"",type:r.npm&&r.npm.includes("anthropic")?"anthropic":"openai-compatible",models:i};t.push(a)}}return t.length===0?Fv:t}async function gr(){let e=yE();if(e&&e.providers){let i=Fo(),a=new Set(e.providers.map(l=>l.id)),u=i.filter(l=>!a.has(l.id));return u.length>0&&e.providers.push(...u),e.providers}let t=await _E();if(t){let i=xE(t);return bE({providers:i}),i}let n=[...Fv],o=Mv(),r=Fo();return n.forEach(i=>{o[i.id]&&i.models.push(...o[i.id])}),n.push(...r),n}async function Pd(e){let t=await gr(),n=e.toLowerCase();return t.filter(o=>o.name.toLowerCase().includes(n)||o.id.toLowerCase().includes(n))}async function Sa(e){let n=(await gr()).find(o=>o.id===e);return n?n.models:[]}import ar from"fs";import ln from"path";import{homedir as Uv}from"os";import{parse as TE}from"jsonc-parser";var Rd=()=>{let e=process.env.XDG_DATA_HOME||ln.join(Uv(),".local","share"),t=process.env.XDG_CONFIG_HOME||ln.join(Uv(),".config");return{data:ln.join(e,"opencode"),config:ln.join(t,"opencode")}},Fd=()=>{let e=Rd();return{authJson:ln.join(e.data,"auth.json"),opencodeJson:ln.join(e.config,"opencode.json")}},CE=()=>{let e=Rd();[e.data,e.config].forEach(t=>{ar.existsSync(t)||ar.mkdirSync(t,{recursive:!0})})},Md=async()=>{let{authJson:e}=Fd();try{if(!ar.existsSync(e))return{};let t=ar.readFileSync(e,"utf8"),n=[],o=TE(t,n,{allowTrailingComma:!0});return n.length>0?(console.warn("Warning: JSONC parsing errors in auth.json:",n.map(r=>r.error).join(", ")),o||{}):o}catch(t){return console.warn("Warning: Could not read auth.json:",t.message),{}}},AE=async e=>{let{authJson:t}=Fd();try{CE();let n=JSON.stringify(e,null,2);return ar.writeFileSync(t,n),ar.chmodSync(t,384),!0}catch(n){return console.error("Error writing auth.json:",n.message),!1}};var PE=async()=>{let e=await Md(),t=await gr(),n=[];for(let[o,r]of Object.entries(e)){let i=t.find(a=>a.id===o);if(i&&r.type==="api"&&r.key){let a=await Sa(o);n.push({id:o,name:i.name,type:i.type,baseUrl:i.baseUrl,apiKey:r.key,authType:r.type,models:a.map(u=>({name:u.name,id:`${o}_${u.id}`}))})}}return n};var OE=async e=>{try{return(await gr()).find(n=>n.id===e)}catch(t){return console.warn("Warning: Could not verify provider:",t.message),null}},Ud=async(e,t)=>{let n=await Md();return n[e]={type:"api",key:t},await AE(n)};var Zv=async()=>{let[e,t,n]=await Promise.all([PE(),(async()=>{try{let{getCustomProvidersFromConfig:r}=await Promise.resolve().then(()=>(vr(),un));return await r()}catch(r){return console.warn("Warning: Could not load custom providers:",r.message),[]}})(),(async()=>{try{return Fo()}catch(r){return console.warn("Warning: Could not load custom verified providers:",r.message),[]}})()]),o=new Map;return n.forEach(r=>{o.set(r.id,r)}),t.forEach(r=>{o.set(r.id,r)}),e.forEach(r=>{o.set(r.id,r)}),Array.from(o.values())};var Lv=async e=>{let t={migrated:0,failed:0,errors:[]};try{if(e.verifiedProviders)for(let[n,o]of Object.entries(e.verifiedProviders))await OE(n)?await Ud(n,o)?t.migrated++:(t.failed++,t.errors.push(`Failed to migrate ${n}`)):(t.failed++,t.errors.push(`Provider ${n} not found in models.dev`));if(e.customProviders&&e.customProviders.length>0)try{let{addCustomProvider:n,readAIConfig:o,writeAIConfig:r}=await Promise.resolve().then(()=>(vr(),un)),i=await o();for(let a of e.customProviders)try{let u={id:a.id,name:a.name,type:a.type,baseUrl:a.baseUrl,apiKey:a.apiKey,models:a.models||[]};i.customProviders=i.customProviders||[],i.customProviders.push(u),t.migrated++}catch(u){t.failed++,t.errors.push(`Failed to migrate custom provider ${a.name}: ${u.message}`)}await r(i)}catch(n){t.failed++,t.errors.push(`Failed to migrate custom providers: ${n.message}`)}return t}catch(n){return t.failed++,t.errors.push(`Migration failed: ${n.message}`),t}},Bv=async()=>{let e=Fd(),[t,n]=await Promise.all([Md(),(async()=>{try{let{getAIConfigPaths:a}=await Promise.resolve().then(()=>(vr(),un));return await a()}catch{return{configDir:"N/A",configJson:"N/A",configExists:!1}}})()]),o=ar.existsSync(e.authJson),r=ar.existsSync(e.opencodeJson),i={verifiedProviders:{},customProviders:[]};try{let{readAIConfig:a}=await Promise.resolve().then(()=>(vr(),un));i=await a()}catch{}return{opencodePaths:e,authExists:o,configExists:r,authData:Object.keys(t),configProviders:[],aiConfigPaths:n,aiConfigData:{verifiedProviders:Object.keys(i.verifiedProviders||{}),customProviders:(i.customProviders||[]).map(a=>a.id)},xdgPaths:Rd()}};vr();var Wy=pb(Vy(),1);import"dotenv/config";var Yd=process.argv.includes("--debug"),Bo=null;function ve(e){if(!Yd)return;let n=`[${new Date().toISOString()}] ${e}
|
|
89
|
-
`;Bo||(Bo=Na.createWriteStream("debug.log",{flags:"w"})),Bo.write(n),(e.includes("ERROR")||e.includes("Creating")||e.includes("API Request"))&&console.log(n.trim())}function yT(e,t){ve(`Creating Anthropic provider with baseUrl: ${e}`),ve(`API Key length: ${t?t.length:0}`);let n=cd({apiKey:t,baseURL:e,fetch:Yd?async(o,r)=>{ve(`API Request to: ${o}`);let i=await fetch(o,r);return ve(`Response status: ${i.status}`),i}:void 0});return ve(`Provider created successfully: ${n?"yes":"no"}`),n}var za=vT.createInterface({input:process.stdin,output:process.stdout}),
|
|
88
|
+
Benchmark interrupted by user`),process.exit(0)});import.meta.url===`file://${process.argv[1]}`&&process.argv[1].endsWith("benchmark-rest.js")&&mE();import Ut from"fs";import $a from"path";import{homedir as gE}from"os";var Td={"custom-verified-providers":{"zai-code-anth":{id:"zai-code-anth",name:"zai-code-anth",baseUrl:"https://api.z.ai/api/anthropic/v1",type:"anthropic",models:{"glm-4-5":{id:"glm-4.5",name:"GLM-4.5-anth"},"glm-4-5-air":{id:"glm-4.5-air",name:"GLM-4.5-air-anth"},"glm-4-6":{id:"glm-4.6",name:"GLM-4.6-anth"}}},"zai-china-anth-base":{id:"zai-china-anth-base",name:"zai-china-anth-base",baseUrl:"https://open.bigmodel.cn/api/anthropic/v1",type:"anthropic",models:{"glm-4-5":{id:"glm-4.5",name:"GLM-4.5-china-anth"},"glm-4-5-air":{id:"glm-4.5-air",name:"GLM-4.5-air-china-anth"},"glm-4-6":{id:"glm-4.6",name:"GLM-4.6-china-anth"}}},"extra-models-dev":{chutes:{"deepseek-ai/DeepSeek-V3.1-Terminus":{id:"deepseek-ai/DeepSeek-V3.1-Terminus",name:"DeepSeek V3.1 Terminus"},"meituan-longcat/LongCat-Flash-Thinking-FP8":{id:"meituan-longcat/LongCat-Flash-Thinking-FP8",name:"LongCat Flash Thinking FP8"},"zai-org/GLM-4.6-turbo":{id:"zai-org/GLM-4.6-turbo",name:"GLM-4.6 Turbo"}}},"nanogpt-plan":{id:"nanogpt-plan",name:"nanogpt-plan",baseUrl:"https://nano-gpt.com/api/v1",type:"openai-compatible",models:{"deepseek-ai/DeepSeek-V3.1-Terminus":{id:"deepseek-ai/DeepSeek-V3.1-Terminus",name:"DeepSeek V3.1 Terminus"},"deepseek-ai/DeepSeek-V3.1":{id:"deepseek-ai/DeepSeek-V3.1",name:"DeepSeek V3.1"},"deepseek-ai/DeepSeek-V3.1-Terminus:thinking":{id:"deepseek-ai/DeepSeek-V3.1-Terminus:thinking",name:"DeepSeek V3.1 Terminus Thinking"},"zai-org/GLM-4.5-FP8":{id:"zai-org/GLM-4.5-FP8",name:"GLM 4.5 FP8"},"zai-org/GLM-4.5-FP8:thinking":{id:"zai-org/GLM-4.5-FP8:thinking",name:"GLM 4.5 FP8 Thinking"},"zai-org/GLM-4.5-Air":{id:"zai-org/GLM-4.5-Air",name:"GLM 4.5 Air"},"moonshotai/Kimi-K2-Instruct":{id:"moonshotai/Kimi-K2-Instruct",name:"Kimi K2 Instruct"},"moonshotai/Kimi-K2-Instruct-0905":{id:"moonshotai/Kimi-K2-Instruct-0905",name:"Kimi K2 Instruct 0905"},"deepseek-ai/deepseek-v3.2-exp":{id:"deepseek-ai/deepseek-v3.2-exp",name:"DeepSeek V3.2 Exp"},"z-ai/glm-4.6":{id:"z-ai/glm-4.6",name:"GLM 4.6"},"z-ai/glm-4.6:thinking":{id:"z-ai/glm-4.6:thinking",name:"GLM 4.6 Thinking"},"qwen3-vl-235b-a22b-instruct":{id:"qwen3-vl-235b-a22b-instruct",name:"Qwen3 VL 235B A22B Instruct"}}}}};var Cd=$a.join(gE(),".cache","ai-speedometer"),Ad=$a.join(Cd,"models.json"),Fv=[{id:"openai",name:"OpenAI",baseUrl:"https://api.openai.com/v1",type:"openai-compatible",models:[{id:"gpt-4o",name:"GPT-4o"},{id:"gpt-4o-mini",name:"GPT-4o Mini"},{id:"gpt-4-turbo",name:"GPT-4 Turbo"},{id:"gpt-3.5-turbo",name:"GPT-3.5 Turbo"}]},{id:"anthropic",name:"Anthropic",baseUrl:"https://api.anthropic.com",type:"anthropic",models:[{id:"claude-3-5-sonnet-20241022",name:"Claude 3.5 Sonnet"},{id:"claude-3-5-haiku-20241022",name:"Claude 3.5 Haiku"},{id:"claude-3-opus-20240229",name:"Claude 3 Opus"}]},{id:"openrouter",name:"OpenRouter",baseUrl:"https://openrouter.ai/api/v1",type:"openai-compatible",models:[{id:"anthropic/claude-3.5-sonnet",name:"Claude 3.5 Sonnet"},{id:"openai/gpt-4o",name:"GPT-4o"},{id:"openai/gpt-4o-mini",name:"GPT-4o Mini"}]}];function hE(){try{Ut.existsSync(Cd)||Ut.mkdirSync(Cd,{recursive:!0})}catch(e){console.warn("Warning: Could not create cache directory:",e.message)}}function vE(e){if(!e.timestamp)return!0;let n=Date.now()-e.timestamp,o=3600*1e3;return n>o}function yE(){try{if(Ut.existsSync(Ad)){let e=Ut.readFileSync(Ad,"utf8"),t=JSON.parse(e);return vE(t)?null:t}}catch(e){console.warn("Warning: Could not load cache:",e.message)}return null}function bE(e){try{hE();let t={...e,timestamp:Date.now()};Ut.writeFileSync(Ad,JSON.stringify(t,null,2))}catch(t){console.warn("Warning: Could not save cache:",t.message)}}async function _E(){try{let e=await fetch("https://models.dev/api.json");if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);return await e.json()}catch(e){return console.warn("Warning: Could not fetch from models.dev API:",e.message),null}}function Fo(){try{let e=Td,t=$a.join(process.cwd(),"custom-verified-providers.json");if(Ut.existsSync(t))try{let o=Ut.readFileSync(t,"utf8");e=JSON.parse(o)}catch(o){console.warn("Warning: Could not load custom providers from file, using embedded data:",o.message)}let n=[];if(e["custom-verified-providers"]){for(let[,o]of Object.entries(e["custom-verified-providers"]))if(o.id!=="extra-models-dev"&&o.id&&o.name&&o.models){let r={id:o.id,name:o.name,baseUrl:o.baseUrl||"",type:o.type||"openai-compatible",models:Object.values(o.models).map(i=>({id:i.id,name:i.name}))};n.push(r)}}return n}catch(e){console.warn("Warning: Could not load custom verified providers:",e.message)}return[]}function Mv(){try{let e=Td,t=$a.join(process.cwd(),"custom-verified-providers.json");if(Ut.existsSync(t))try{let o=Ut.readFileSync(t,"utf8");e=JSON.parse(o)}catch(o){console.warn("Warning: Could not load extra models from file, using embedded data:",o.message)}let n={};if(e["custom-verified-providers"]&&e["custom-verified-providers"]["extra-models-dev"])for(let[o,r]of Object.entries(e["custom-verified-providers"]["extra-models-dev"]))n[o]=Object.values(r).map(i=>({id:i.id,name:i.name}));return n}catch(e){console.warn("Warning: Could not load extra models:",e.message)}return{}}function xE(e){let t=[],n=Fo();t.push(...n);let o=Mv();if(e){for(let[,r]of Object.entries(e))if(r.id&&r.name&&r.models){let i=Object.values(r.models).map(u=>({id:u.id,name:u.name}));o[r.id]&&i.push(...o[r.id]);let a={id:r.id,name:r.name,baseUrl:r.api||r.baseUrl||"",type:r.npm&&r.npm.includes("anthropic")?"anthropic":"openai-compatible",models:i};t.push(a)}}return t.length===0?Fv:t}async function gr(){let e=yE();if(e&&e.providers){let i=Fo(),a=new Set(e.providers.map(l=>l.id)),u=i.filter(l=>!a.has(l.id));return u.length>0&&e.providers.push(...u),e.providers}let t=await _E();if(t){let i=xE(t);return bE({providers:i}),i}let n=[...Fv],o=Mv(),r=Fo();return n.forEach(i=>{o[i.id]&&i.models.push(...o[i.id])}),n.push(...r),n}async function Pd(e){let t=await gr(),n=e.toLowerCase();return t.filter(o=>o.name.toLowerCase().includes(n)||o.id.toLowerCase().includes(n))}async function Sa(e){let n=(await gr()).find(o=>o.id===e);return n?n.models:[]}import ar from"fs";import ln from"path";import{homedir as Uv}from"os";import{parse as TE}from"jsonc-parser";var Rd=()=>{let e=process.env.XDG_DATA_HOME||ln.join(Uv(),".local","share"),t=process.env.XDG_CONFIG_HOME||ln.join(Uv(),".config");return{data:ln.join(e,"opencode"),config:ln.join(t,"opencode")}},Fd=()=>{let e=Rd();return{authJson:ln.join(e.data,"auth.json"),opencodeJson:ln.join(e.config,"opencode.json")}},CE=()=>{let e=Rd();[e.data,e.config].forEach(t=>{ar.existsSync(t)||ar.mkdirSync(t,{recursive:!0})})},Md=async()=>{let{authJson:e}=Fd();try{if(!ar.existsSync(e))return{};let t=ar.readFileSync(e,"utf8"),n=[],o=TE(t,n,{allowTrailingComma:!0});return n.length>0?(console.warn("Warning: JSONC parsing errors in auth.json:",n.map(r=>r.error).join(", ")),o||{}):o}catch(t){return console.warn("Warning: Could not read auth.json:",t.message),{}}},AE=async e=>{let{authJson:t}=Fd();try{CE();let n=JSON.stringify(e,null,2);return ar.writeFileSync(t,n),ar.chmodSync(t,384),!0}catch(n){return console.error("Error writing auth.json:",n.message),!1}};var PE=async()=>{let e=await Md(),t=await gr(),n=[];for(let[o,r]of Object.entries(e)){let i=t.find(a=>a.id===o);if(i&&r.type==="api"&&r.key){let a=await Sa(o);n.push({id:o,name:i.name,type:i.type,baseUrl:i.baseUrl,apiKey:r.key,authType:r.type,models:a.map(u=>({name:u.name,id:`${o}_${u.id}`}))})}}return n};var OE=async e=>{try{return(await gr()).find(n=>n.id===e)}catch(t){return console.warn("Warning: Could not verify provider:",t.message),null}},Ud=async(e,t)=>{let n=await Md();return n[e]={type:"api",key:t},await AE(n)};var Zv=async()=>{let[e,t,n]=await Promise.all([PE(),(async()=>{try{let{getCustomProvidersFromConfig:r}=await Promise.resolve().then(()=>(vr(),un));return await r()}catch(r){return console.warn("Warning: Could not load custom providers:",r.message),[]}})(),(async()=>{try{return Fo()}catch(r){return console.warn("Warning: Could not load custom verified providers:",r.message),[]}})()]),o=new Map;return n.forEach(r=>{o.set(r.id,r)}),t.forEach(r=>{o.set(r.id,r)}),e.forEach(r=>{o.set(r.id,r)}),Array.from(o.values())};var Lv=async e=>{let t={migrated:0,failed:0,errors:[]};try{if(e.verifiedProviders)for(let[n,o]of Object.entries(e.verifiedProviders))await OE(n)?await Ud(n,o)?t.migrated++:(t.failed++,t.errors.push(`Failed to migrate ${n}`)):(t.failed++,t.errors.push(`Provider ${n} not found in models.dev`));if(e.customProviders&&e.customProviders.length>0)try{let{addCustomProvider:n,readAIConfig:o,writeAIConfig:r}=await Promise.resolve().then(()=>(vr(),un)),i=await o();for(let a of e.customProviders)try{let u={id:a.id,name:a.name,type:a.type,baseUrl:a.baseUrl,apiKey:a.apiKey,models:a.models||[]};i.customProviders=i.customProviders||[],i.customProviders.push(u),t.migrated++}catch(u){t.failed++,t.errors.push(`Failed to migrate custom provider ${a.name}: ${u.message}`)}await r(i)}catch(n){t.failed++,t.errors.push(`Failed to migrate custom providers: ${n.message}`)}return t}catch(n){return t.failed++,t.errors.push(`Migration failed: ${n.message}`),t}},Bv=async()=>{let e=Fd(),[t,n]=await Promise.all([Md(),(async()=>{try{let{getAIConfigPaths:a}=await Promise.resolve().then(()=>(vr(),un));return await a()}catch{return{configDir:"N/A",configJson:"N/A",configExists:!1}}})()]),o=ar.existsSync(e.authJson),r=ar.existsSync(e.opencodeJson),i={verifiedProviders:{},customProviders:[]};try{let{readAIConfig:a}=await Promise.resolve().then(()=>(vr(),un));i=await a()}catch{}return{opencodePaths:e,authExists:o,configExists:r,authData:Object.keys(t),configProviders:[],aiConfigPaths:n,aiConfigData:{verifiedProviders:Object.keys(i.verifiedProviders||{}),customProviders:(i.customProviders||[]).map(a=>a.id)},xdgPaths:Rd()}};vr();var Wy=pb(qy(),1);import"dotenv/config";var Yd=process.argv.includes("--debug"),Bo=null;function ve(e){if(!Yd)return;let n=`[${new Date().toISOString()}] ${e}
|
|
89
|
+
`;Bo||(Bo=Na.createWriteStream("debug.log",{flags:"w"})),Bo.write(n),(e.includes("ERROR")||e.includes("Creating")||e.includes("API Request"))&&console.log(n.trim())}function yT(e,t){ve(`Creating Anthropic provider with baseUrl: ${e}`),ve(`API Key length: ${t?t.length:0}`);let n=cd({apiKey:t,baseURL:e,fetch:Yd?async(o,r)=>{ve(`API Request to: ${o}`);let i=await fetch(o,r);return ve(`Response status: ${i.status}`),i}:void 0});return ve(`Provider created successfully: ${n?"yes":"no"}`),n}var za=vT.createInterface({input:process.stdin,output:process.stdout}),Vy={reset:"\x1B[0m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",bright:"\x1B[1m",dim:"\x1B[2m",bgRed:"\x1B[41m",bgGreen:"\x1B[42m",bgYellow:"\x1B[43m",bgBlue:"\x1B[44m",bgMagenta:"\x1B[45m",bgCyan:"\x1B[46m",bgWhite:"\x1B[47m"};function g(e,t){return`${Vy[t]}${e}${Vy.reset}`}try{process.stdin.setRawMode(!0),process.stdin.resume(),process.stdin.setEncoding("utf8")}catch{}function te(e){return new Promise(t=>za.question(e,t))}function $e(){console.clear()}function xt(){console.log(g("Ai-speedometer","cyan")),console.log(g("=============================","cyan")),console.log(g("Note: opencode uses ai-sdk","dim")),console.log("")}async function Ky(){try{let e="ai-benchmark-config.json";if(Na.existsSync(e)){console.log(g("Migrating from old config format to new format...","yellow"));try{let n=Na.readFileSync(e,"utf8"),o=JSON.parse(n),r=await Lv(o);console.log(g(`Migration complete: ${r.migrated} items migrated`,"green")),r.failed>0&&(console.log(g(`Migration warnings: ${r.failed} items failed`,"yellow")),r.errors.forEach(i=>{console.log(g(` - ${i}`,"dim"))})),Na.renameSync(e,`${e}.backup`),console.log(g("Old config backed up as ai-benchmark-config.json.backup","cyan")),await te(g("Press Enter to continue...","yellow"))}catch(n){console.log(g("Migration failed: ","red")+n.message),await te(g("Press Enter to continue with empty config...","yellow"))}}return{providers:await Zv(),verifiedProviders:{}}}catch(e){return console.log(g("Error loading config, starting fresh: ","yellow")+e.message),{providers:[],verifiedProviders:{}}}}async function q2(e){console.log(g("Note: Configuration is now automatically saved to ai-benchmark-config.json and auth.json","cyan"))}function br(){return new Promise(e=>{process.stdin.isRaw?process.stdin.once("data",t=>{t===""&&process.exit(0),e(t)}):za.question(g("Press Enter to continue...","yellow"),()=>{e("\r")})})}async function Jy(){$e(),xt(),console.log(g("Select Models for Benchmark","magenta")),console.log("");let e=await Ky();if(await Ca(),e.providers.length===0)return console.log(g("No providers available. Please add a provider first.","red")),await te(g("Press Enter to continue...","yellow")),[];let t=[];e.providers.forEach(y=>{y.models.forEach(p=>{t.push({...p,providerName:y.name,providerType:y.type,providerId:y.id,providerConfig:{...y,apiKey:y.apiKey||"",baseUrl:y.baseUrl||""},selected:!1})})});let n=await zd(),o=[];n.forEach(y=>{let p=t.find(d=>d.id===y.modelId&&d.providerName===y.providerName);p&&o.push({...p,isRecent:!0})});let r=0,i=0,a="",u=y=>{if(!y.trim()){let d=new Set(o.map(v=>v.id)),f=t.filter(v=>!d.has(v.id));return[...o,...f]}let p=y.toLowerCase().split(/\s+/).filter(d=>d.length>0);return t.filter(d=>{let f=`${d.name} ${d.providerName} ${d.providerId} ${d.providerType}`.toLowerCase();return p.every(v=>f.includes(v))})},l=u(""),c=!0,m,h=(y,p)=>{clearTimeout(m),m=setTimeout(()=>{l=u(y),c=!0,p(l)},50)};for(;;){let y=Yy(12),p=Math.ceil(l.length/y);if(c){let f="";f+=g("Ai-speedometer","cyan")+`
|
|
90
90
|
`,f+=g("=============================","cyan")+`
|
|
91
91
|
`,f+=g("Note: opencode uses ai-sdk","dim")+`
|
|
92
92
|
`,f+=`
|
|
@@ -177,4 +177,4 @@ Press Enter to continue...`,"yellow"))}async function IT(e){if(e.length===0){con
|
|
|
177
177
|
`,e.forEach((r,i)=>{let a=i===t,u=a?g("\u25CF","green"):g("\u25CB","dim"),l=a?g(r.text,"bright"):g(r.text,"yellow");n+=`${u} ${l}
|
|
178
178
|
`}),$e(),console.log(n);let o=await br();if(o==="\x1B[A")t=(t-1+e.length)%e.length;else if(o==="\x1B[B")t=(t+1)%e.length;else if(o==="\r"){if(await e[t].action()==="back")return}else o===""&&process.exit(0)}}process.on("SIGINT",()=>{console.log(g(`
|
|
179
179
|
|
|
180
|
-
CLI interrupted by user`,"yellow")),za.close(),process.exit(0)});(import.meta.url===`file://${process.argv[1]}`||process.argv.length===2||process.argv.length===3&&process.argv[2]==="--debug")&&Ca().then(()=>{Gy()}).catch(()=>{Gy()});export{kT as listProviders,Ky as loadConfig,bT as runStreamingBenchmark,
|
|
180
|
+
CLI interrupted by user`,"yellow")),za.close(),process.exit(0)});(import.meta.url===`file://${process.argv[1]}`||process.argv.length===2||process.argv.length===3&&process.argv[2]==="--debug")&&Ca().then(()=>{Gy()}).catch(()=>{Gy()});export{kT as listProviders,Ky as loadConfig,bT as runStreamingBenchmark,q2 as saveConfig,Jy as selectModelsCircular,Gy as showMainMenu};
|