@modality-counter/core 2.10.10 → 2.10.12
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/index.js
CHANGED
|
@@ -640,7 +640,7 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
|
|
|
640
640
|
`)},flush(e){e.enqueue(`data: [DONE]
|
|
641
641
|
|
|
642
642
|
`)}})}},O={NEVER:gDt,array:Rje,boolean:Pje,custom:vzt,discriminatedUnion:dzt,enum:pzt,extend:lzt,int:azt,literal:fzt,looseObject:cSn,maximum:Z8,minLength:y4,never:szt,nonnegative:Ydn,number:Aje,object:uzt,optional:zje,pipe:gzt,positive:Kdn,record:Mje,refine:xzt,safeParse:BLe,startsWith:pNt,string:lB,transform:mzt,union:Nje,unknown:Dje},ge={array:ir,boolean:nu,custom:kyn,discriminatedUnion:C4t,instanceof:Cyn,lazy:P4t,literal:to,null:k4t,number:ar,object:ne,record:Of,string:V,union:Tu,unknown:yl},E4=ge.lazy(()=>ge.union([ge.null(),ge.string(),ge.number(),ge.boolean(),ge.record(ge.string(),E4.optional()),ge.array(E4)])),gn=ge.record(ge.string(),ge.record(ge.string(),E4.optional()));function Yzt(e){return O.object({source:O.discriminatedUnion("sourceType",[O.object({type:O.literal("source"),sourceType:O.literal("url"),id:O.string(),url:O.string(),title:O.optional(O.string()),providerMetadata:O.optional(e)}),O.object({type:O.literal("source"),sourceType:O.literal("document"),id:O.string(),mediaType:O.string(),title:O.string(),filename:O.optional(O.string()),providerMetadata:O.optional(e)})]),startIndex:O.optional(O.number().check(O.int()).check(O.nonnegative())),endIndex:O.optional(O.number().check(O.int()).check(O.nonnegative())),citedText:O.optional(O.string())})}var G1n=Yzt(gn),m8=O.record(O.string(),O.optional(E4)),Mfi=_t(()=>vt(O.union([O.looseObject({type:O.literal("text-start"),id:O.string(),providerMetadata:O.optional(gn)}),O.looseObject({type:O.literal("text-delta"),id:O.string(),delta:O.string(),providerMetadata:O.optional(gn)}),O.looseObject({type:O.literal("text-end"),id:O.string(),citations:O.optional(O.array(G1n)),providerMetadata:O.optional(gn)}),O.looseObject({type:O.literal("error"),errorText:O.string()}),O.looseObject({type:O.literal("tool-input-start"),toolCallId:O.string(),toolName:O.string(),inputEncoding:O.optional(O.enum(["json","text"])),providerExecuted:O.optional(O.boolean()),providerMetadata:O.optional(gn),toolMetadata:O.optional(m8),dynamic:O.optional(O.boolean()),title:O.optional(O.string())}),O.looseObject({type:O.literal("tool-input-delta"),toolCallId:O.string(),inputTextDelta:O.string()}),O.looseObject({type:O.literal("tool-input-available"),toolCallId:O.string(),toolName:O.string(),input:O.unknown(),providerExecuted:O.optional(O.boolean()),providerMetadata:O.optional(gn),toolMetadata:O.optional(m8),dynamic:O.optional(O.boolean()),title:O.optional(O.string())}),O.looseObject({type:O.literal("tool-input-error"),toolCallId:O.string(),toolName:O.string(),input:O.unknown(),providerExecuted:O.optional(O.boolean()),providerMetadata:O.optional(gn),toolMetadata:O.optional(m8),dynamic:O.optional(O.boolean()),errorText:O.string(),title:O.optional(O.string())}),O.looseObject({type:O.literal("tool-approval-request"),approvalId:O.string(),toolCallId:O.string(),approvalDescriptor:O.optional(O.unknown()),inputSchemaInput:O.optional(O.unknown()),reason:O.optional(O.string()),isAutomatic:O.optional(O.boolean()),signature:O.optional(O.string())}),O.looseObject({type:O.literal("tool-approval-response"),approvalId:O.string(),approved:O.boolean(),reason:O.optional(O.string()),providerExecuted:O.optional(O.boolean()),providerMetadata:O.optional(gn)}),O.looseObject({type:O.literal("tool-output-available"),toolCallId:O.string(),output:O.unknown(),providerExecuted:O.optional(O.boolean()),providerMetadata:O.optional(gn),toolMetadata:O.optional(m8),dynamic:O.optional(O.boolean()),preliminary:O.optional(O.boolean())}),O.looseObject({type:O.literal("tool-output-error"),toolCallId:O.string(),errorText:O.string(),providerExecuted:O.optional(O.boolean()),providerMetadata:O.optional(gn),toolMetadata:O.optional(m8),dynamic:O.optional(O.boolean())}),O.looseObject({type:O.literal("tool-output-denied"),toolCallId:O.string()}),O.looseObject({type:O.literal("reasoning-start"),id:O.string(),providerMetadata:O.optional(gn)}),O.looseObject({type:O.literal("reasoning-delta"),id:O.string(),delta:O.string(),providerMetadata:O.optional(gn)}),O.looseObject({type:O.literal("reasoning-end"),id:O.string(),providerMetadata:O.optional(gn)}),O.looseObject({type:O.literal("custom"),kind:O.pipe(O.string(),O.transform(e=>e)),providerMetadata:O.optional(gn)}),O.looseObject({type:O.literal("source-url"),sourceId:O.string(),url:O.string(),title:O.optional(O.string()),providerMetadata:O.optional(gn)}),O.looseObject({type:O.literal("source-document"),sourceId:O.string(),mediaType:O.string(),title:O.string(),filename:O.optional(O.string()),providerMetadata:O.optional(gn)}),O.looseObject({type:O.literal("file"),url:O.string(),mediaType:O.string(),providerMetadata:O.optional(gn)}),O.looseObject({type:O.literal("reasoning-file"),url:O.string(),mediaType:O.string(),providerMetadata:O.optional(gn)}),O.looseObject({type:O.literal("steering-message"),id:O.string(),parts:O.array(O.union([O.looseObject({type:O.literal("text"),text:O.string(),providerMetadata:O.optional(gn)}),O.looseObject({type:O.literal("file"),mediaType:O.string(),url:O.string(),filename:O.optional(O.string()),providerReference:O.optional(O.record(O.string(),O.string())),providerMetadata:O.optional(gn)})]))}),O.looseObject({type:O.custom(e=>typeof e=="string"&&e.startsWith("data-"),{message:'Type must start with "data-"'}),id:O.optional(O.string()),data:O.unknown(),transient:O.optional(O.boolean())}),O.looseObject({type:O.literal("start-step")}),O.looseObject({type:O.literal("finish-step")}),O.looseObject({type:O.literal("reset-step")}),O.looseObject({type:O.literal("start"),messageId:O.optional(O.string()),messageMetadata:O.optional(O.unknown())}),O.looseObject({type:O.literal("finish"),finishReason:O.optional(O.enum(["stop","length","content-filter","tool-calls","error","interrupted","other"])),messageMetadata:O.optional(O.unknown())}),O.looseObject({type:O.literal("abort"),reason:O.optional(O.string())}),O.looseObject({type:O.literal("message-metadata"),messageMetadata:O.unknown()})])));var zfi=Vd({prefix:"aitxt",size:24}),Lfi=Vd({prefix:"call",size:24}),jfi=Vd({prefix:"aitxt",size:24}),Ufi=Vd({prefix:"call",size:24});var XS=Symbol("invalid");function J1n(e){let t=[],r=jje(e,t,new Set);return r===XS?{success:!1,path:t}:{success:!0,value:r}}function jje(e,t,r){switch(typeof e){case"string":case"boolean":return e;case"number":return Number.isFinite(e)?e:XS;case"object":{if(e===null)return e;if(r.has(e))return XS;r.add(e);let o=Array.isArray(e)?K1n(e,t,r):Y1n(e,t,r);return r.delete(e),o}default:return XS}}function K1n(e,t,r){let o;for(let n=0;n<e.length;n++){let i=e[n];t.push(n);let a=jje(i,t,r);if(a===XS)return XS;t.pop(),o!=null?o.push(a):a!==i&&(o=e.slice(0,n),o.push(a))}return o??e}function Y1n(e,t,r){if(!X1n(e)||Q1n(e))return XS;let o=Object.keys(e),n;for(let i=0;i<o.length;i++){let a=o[i];if(a==="__proto__"){n??(n=tDt(e,o,i));continue}let s=e[a],c=s;if(s!==void 0){if(t.push(a),c=jje(s,t,r),c===XS)return XS;t.pop()}n!=null?n[a]=c:c!==s&&(n=tDt(e,o,i),n[a]=c)}return n??e}function tDt(e,t,r){let o={};for(let n=0;n<r;n++)o[t[n]]=e[t[n]];return o}function X1n(e){let t=e.constructor;if(typeof t!="function")return!0;let r=t.prototype;return r!==null&&typeof r=="object"&&Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function Q1n(e){let t=Object.getOwnPropertySymbols(e);for(let r=0;r<t.length;r++)if(Object.prototype.propertyIsEnumerable.call(e,t[r]))return!0;return!1}var Xzt=O.pipe(O.unknown(),O.transform((e,t)=>{let r=J1n(e);return r.success?r.value:(t.issues.push({code:"custom",message:"Invalid JSON value. Expected null, a string, a finite number, a boolean, an array, or an object.",input:e,path:r.path}),O.NEVER)})),Qzt=O.custom(),jm=O.pipe(Xzt,O.record(O.string(),Qzt)),Xa=O.pipe(Xzt,O.record(O.string(),O.record(O.string(),Qzt))),rDt=O.record(O.string(),O.string()),eIn=Yzt(Xa);function Pie(e){return O.pipe(O.array(O.unknown()),O.transform((t,r)=>{let o=[];for(let[n,i]of t.entries()){let a=O.safeParse(e(i),i);if(!a.success){for(let s of a.error.issues)r.issues.push({...s,path:[n,...s.path]});return O.NEVER}o.push(a.data)}return o}))}var Ffi=_t(()=>{let e=O.object({id:O.string(),approved:O.optional(O.never()),descriptor:O.optional(O.unknown()),requestReason:O.optional(O.string()),reason:O.optional(O.never()),isAutomatic:O.optional(O.boolean()),signature:O.optional(O.string()),inputSchemaInput:O.optional(O.unknown())}),t=O.extend(e,{approved:O.boolean(),reason:O.optional(O.string())}),r=O.extend(t,{approved:O.literal(!0)}),o=O.extend(t,{approved:O.literal(!1)}),n=O.discriminatedUnion("type",[O.object({type:O.literal("text"),text:O.string(),providerMetadata:O.optional(Xa)}),O.object({type:O.literal("file"),mediaType:O.string(),filename:O.optional(O.string()),url:O.string(),providerReference:O.optional(rDt),providerMetadata:O.optional(Xa)})]),i='Invalid UI message part type. Expected a known part type (for example "text" or "dynamic-tool") or a type starting with "data-" or "tool-".',a=O.discriminatedUnion("type",[O.object({type:O.literal("text"),text:O.string(),citations:O.optional(Pie(()=>eIn)),state:O.optional(O.enum(["streaming","done"])),providerMetadata:O.optional(Xa)}),O.object({type:O.literal("reasoning"),id:O.optional(O.string()),text:O.string(),state:O.optional(O.enum(["streaming","done"])),providerMetadata:O.optional(Xa)}),O.object({type:O.literal("custom"),kind:O.string(),providerMetadata:O.optional(Xa)}),O.object({type:O.literal("source-url"),sourceId:O.string(),url:O.string(),title:O.optional(O.string()),providerMetadata:O.optional(Xa)}),O.object({type:O.literal("source-document"),sourceId:O.string(),mediaType:O.string(),title:O.string(),filename:O.optional(O.string()),providerMetadata:O.optional(Xa)}),O.object({type:O.literal("file"),mediaType:O.string(),filename:O.optional(O.string()),url:O.string(),providerReference:O.optional(rDt),providerMetadata:O.optional(Xa)}),O.object({type:O.literal("reasoning-file"),mediaType:O.string(),url:O.string(),providerMetadata:O.optional(Xa)}),O.object({type:O.literal("steering-message"),id:O.string(),parts:Pie(()=>n)}),O.object({type:O.literal("step-start")})],{error:d=>d.code==="invalid_union"?i:void 0}),s=O.object({type:O.string().check(O.startsWith("data-")),id:O.optional(O.string()),data:O.unknown()}),c=O.discriminatedUnion("state",[O.object({type:O.literal("dynamic-tool"),dynamic:O.optional(O.literal(!1)),toolName:O.string(),toolCallId:O.string(),title:O.optional(O.string()),toolMetadata:O.optional(jm),state:O.literal("input-streaming"),input:O.optional(O.unknown()),rawInput:O.optional(O.string()),inputEncoding:O.optional(O.enum(["json","text"])),providerExecuted:O.optional(O.boolean()),callProviderMetadata:O.optional(Xa),output:O.optional(O.never()),errorText:O.optional(O.never()),approval:O.optional(O.never())}),O.object({type:O.literal("dynamic-tool"),dynamic:O.optional(O.literal(!1)),toolName:O.string(),toolCallId:O.string(),title:O.optional(O.string()),toolMetadata:O.optional(jm),state:O.literal("input-available"),input:O.unknown(),providerExecuted:O.optional(O.boolean()),output:O.optional(O.never()),errorText:O.optional(O.never()),callProviderMetadata:O.optional(Xa),approval:O.optional(O.never())}),O.object({type:O.literal("dynamic-tool"),dynamic:O.optional(O.literal(!1)),toolName:O.string(),toolCallId:O.string(),title:O.optional(O.string()),toolMetadata:O.optional(jm),state:O.literal("approval-requested"),input:O.unknown(),providerExecuted:O.optional(O.boolean()),output:O.optional(O.never()),errorText:O.optional(O.never()),callProviderMetadata:O.optional(Xa),approval:e}),O.object({type:O.literal("dynamic-tool"),dynamic:O.optional(O.literal(!1)),toolName:O.string(),toolCallId:O.string(),title:O.optional(O.string()),toolMetadata:O.optional(jm),state:O.literal("approval-responded"),input:O.unknown(),providerExecuted:O.optional(O.boolean()),output:O.optional(O.never()),errorText:O.optional(O.never()),callProviderMetadata:O.optional(Xa),approval:t}),O.object({type:O.literal("dynamic-tool"),dynamic:O.optional(O.literal(!1)),toolName:O.string(),toolCallId:O.string(),title:O.optional(O.string()),toolMetadata:O.optional(jm),state:O.literal("output-available"),input:O.unknown(),providerExecuted:O.optional(O.boolean()),output:O.unknown(),errorText:O.optional(O.never()),callProviderMetadata:O.optional(Xa),resultProviderMetadata:O.optional(Xa),preliminary:O.optional(O.boolean()),approval:O.optional(r)}),O.object({type:O.literal("dynamic-tool"),dynamic:O.optional(O.literal(!1)),toolName:O.string(),toolCallId:O.string(),title:O.optional(O.string()),toolMetadata:O.optional(jm),state:O.literal("output-error"),input:O.optional(O.unknown()),rawInput:O.optional(O.unknown()),providerExecuted:O.optional(O.boolean()),output:O.optional(O.never()),errorText:O.string(),callProviderMetadata:O.optional(Xa),resultProviderMetadata:O.optional(Xa),approval:O.optional(r)}),O.object({type:O.literal("dynamic-tool"),dynamic:O.optional(O.literal(!1)),toolName:O.string(),toolCallId:O.string(),title:O.optional(O.string()),toolMetadata:O.optional(jm),state:O.literal("output-denied"),input:O.unknown(),providerExecuted:O.optional(O.boolean()),output:O.optional(O.never()),errorText:O.optional(O.never()),callProviderMetadata:O.optional(Xa),approval:o})]),u=O.discriminatedUnion("state",[O.object({type:O.string().check(O.startsWith("tool-")),toolCallId:O.string(),title:O.optional(O.string()),toolMetadata:O.optional(jm),state:O.literal("input-streaming"),providerExecuted:O.optional(O.boolean()),callProviderMetadata:O.optional(Xa),input:O.optional(O.unknown()),rawInput:O.optional(O.string()),inputEncoding:O.optional(O.enum(["json","text"])),output:O.optional(O.never()),errorText:O.optional(O.never()),approval:O.optional(O.never())}),O.object({type:O.string().check(O.startsWith("tool-")),toolCallId:O.string(),title:O.optional(O.string()),toolMetadata:O.optional(jm),state:O.literal("input-available"),providerExecuted:O.optional(O.boolean()),input:O.unknown(),output:O.optional(O.never()),errorText:O.optional(O.never()),callProviderMetadata:O.optional(Xa),approval:O.optional(O.never())}),O.object({type:O.string().check(O.startsWith("tool-")),toolCallId:O.string(),title:O.optional(O.string()),toolMetadata:O.optional(jm),state:O.literal("approval-requested"),input:O.unknown(),providerExecuted:O.optional(O.boolean()),output:O.optional(O.never()),errorText:O.optional(O.never()),callProviderMetadata:O.optional(Xa),approval:e}),O.object({type:O.string().check(O.startsWith("tool-")),toolCallId:O.string(),title:O.optional(O.string()),toolMetadata:O.optional(jm),state:O.literal("approval-responded"),input:O.unknown(),providerExecuted:O.optional(O.boolean()),output:O.optional(O.never()),errorText:O.optional(O.never()),callProviderMetadata:O.optional(Xa),approval:t}),O.object({type:O.string().check(O.startsWith("tool-")),toolCallId:O.string(),title:O.optional(O.string()),toolMetadata:O.optional(jm),state:O.literal("output-available"),providerExecuted:O.optional(O.boolean()),input:O.unknown(),output:O.unknown(),errorText:O.optional(O.never()),callProviderMetadata:O.optional(Xa),resultProviderMetadata:O.optional(Xa),preliminary:O.optional(O.boolean()),approval:O.optional(r)}),O.object({type:O.string().check(O.startsWith("tool-")),toolCallId:O.string(),title:O.optional(O.string()),toolMetadata:O.optional(jm),state:O.literal("output-error"),providerExecuted:O.optional(O.boolean()),input:O.optional(O.unknown()),rawInput:O.optional(O.unknown()),output:O.optional(O.never()),errorText:O.string(),callProviderMetadata:O.optional(Xa),resultProviderMetadata:O.optional(Xa),approval:O.optional(r)}),O.object({type:O.string().check(O.startsWith("tool-")),toolCallId:O.string(),title:O.optional(O.string()),toolMetadata:O.optional(jm),state:O.literal("output-denied"),providerExecuted:O.optional(O.boolean()),input:O.unknown(),output:O.optional(O.never()),errorText:O.optional(O.never()),callProviderMetadata:O.optional(Xa),approval:o})]),l=O.object({id:O.string(),role:O.enum(["system","user","assistant"]),metadata:O.optional(O.unknown()),parts:Pie(d=>{let f=d?.type;if(typeof f=="string"){if(f.startsWith("data-"))return s;if(f.startsWith("tool-"))return u;if(f==="dynamic-tool")return c}return a})}).check(d=>{let f=d.value;f.role!=="assistant"&&f.parts.length===0&&d.issues.push({continue:!0,origin:"array",code:"too_small",minimum:1,inclusive:!0,input:f.parts,path:["parts"],message:"Message must contain at least one part"})});return vt(Pie(()=>l).check(O.minLength(1,"Messages array must not be empty")))});var qfi=Vd({prefix:"call",size:24});var Bfi=Vd({prefix:"call",size:24}),Zfi=new TextEncoder,Vfi=Vd({prefix:"call",size:24}),Hfi=Vd({prefix:"aiobj",size:24});function e3t(e){let t=({url:r,abortSignal:o})=>W1n({url:r,maxBytes:e?.maxBytes,abortSignal:o,fetch:e?.fetch});return r=>Array.isArray(r)?Promise.all(r.map(o=>o.isUrlSupportedByModel?null:t(o))):t(r)}var{atob:Wfi}=globalThis,Gfi=Vd({prefix:"aiobj",size:24}),Jfi=Vd({prefix:"call",size:24}),Kfi=e3t(),gB=ge.union([ge.string(),ge.custom(bje,{message:"Must be a Uint8Array"}),ge.custom(R4t,{message:"Must be an ArrayBuffer"}),ge.custom(cvn,{message:"Must be a Buffer"})]),Uje=ge.record(ge.string(),ge.string()),t3t=ge.object({type:ge.literal("text"),text:ge.string(),providerOptions:gn.optional()}),tIn=ge.object({type:ge.literal("image"),image:ge.union([gB,ge.instanceof(URL),Uje]),mediaType:ge.string().optional(),providerOptions:gn.optional()}),r3t=ge.discriminatedUnion("type",[ge.object({type:ge.literal("data"),data:gB}),ge.object({type:ge.literal("url"),url:ge.instanceof(URL)}),ge.object({type:ge.literal("reference"),reference:Uje}),ge.object({type:ge.literal("text"),text:ge.string()})]),rIn=ge.discriminatedUnion("type",[ge.object({type:ge.literal("data"),data:gB}),ge.object({type:ge.literal("url"),url:ge.instanceof(URL)})]),n3t=ge.object({type:ge.literal("file"),data:ge.union([r3t,gB,ge.instanceof(URL),Uje]),filename:ge.string().optional(),mediaType:ge.string(),providerOptions:gn.optional()}),nIn=ge.object({type:ge.literal("reasoning"),text:ge.string(),providerOptions:gn.optional()}),oIn=ge.object({type:ge.literal("custom"),kind:ge.string().transform(e=>e),providerOptions:gn.optional()}),iIn=ge.object({type:ge.literal("reasoning-file"),data:ge.union([rIn,gB,ge.instanceof(URL)]),mediaType:ge.string(),providerOptions:gn.optional()}),aIn=ge.object({type:ge.literal("tool-call"),toolCallId:ge.string(),toolName:ge.string(),input:ge.unknown(),providerOptions:gn.optional(),providerExecuted:ge.boolean().optional()}),sIn=ge.discriminatedUnion("type",[ge.object({type:ge.literal("text"),value:ge.string(),providerOptions:gn.optional()}),ge.object({type:ge.literal("json"),value:E4,providerOptions:gn.optional()}),ge.object({type:ge.literal("execution-denied"),reason:ge.string().optional(),providerOptions:gn.optional()}),ge.object({type:ge.literal("error-text"),value:ge.string(),providerOptions:gn.optional()}),ge.object({type:ge.literal("error-json"),value:E4,providerOptions:gn.optional()}),ge.object({type:ge.literal("content"),value:ge.array(ge.union([ge.object({type:ge.literal("text"),text:ge.string(),providerOptions:gn.optional()}),ge.object({type:ge.literal("file"),data:r3t,mediaType:ge.string(),filename:ge.string().optional(),providerOptions:gn.optional()}),ge.object({type:ge.literal("file-data"),data:ge.string(),mediaType:ge.string(),filename:ge.string().optional(),providerOptions:gn.optional()}),ge.object({type:ge.literal("file-url"),url:ge.string(),mediaType:ge.string().optional(),providerOptions:gn.optional()}),ge.object({type:ge.literal("file-id"),fileId:ge.union([ge.string(),ge.record(ge.string(),ge.string())]),providerOptions:gn.optional()}),ge.object({type:ge.literal("file-reference"),providerReference:ge.record(ge.string(),ge.string()),providerOptions:gn.optional()}),ge.object({type:ge.literal("image-data"),data:ge.string(),mediaType:ge.string(),providerOptions:gn.optional()}),ge.object({type:ge.literal("image-url"),url:ge.string(),providerOptions:gn.optional()}),ge.object({type:ge.literal("image-file-id"),fileId:ge.union([ge.string(),ge.record(ge.string(),ge.string())]),providerOptions:gn.optional()}),ge.object({type:ge.literal("image-file-reference"),providerReference:ge.record(ge.string(),ge.string()),providerOptions:gn.optional()}),ge.object({type:ge.literal("custom"),providerOptions:gn.optional()})]))})]),o3t=ge.object({type:ge.literal("tool-result"),toolCallId:ge.string(),toolName:ge.string(),output:sIn,providerOptions:gn.optional()}),cIn=ge.object({type:ge.literal("tool-approval-request"),approvalId:ge.string(),toolCallId:ge.string(),reason:ge.string().optional(),isAutomatic:ge.boolean().optional(),signature:ge.string().optional(),inputSchemaInput:ge.unknown().optional()}),uIn=ge.object({type:ge.literal("tool-approval-response"),approvalId:ge.string(),approved:ge.boolean(),reason:ge.string().optional()}),lIn=ge.object({role:ge.literal("system"),content:ge.string(),providerOptions:gn.optional()}),dIn=ge.object({role:ge.literal("user"),content:ge.union([ge.string(),ge.array(ge.union([t3t,tIn,n3t]))]),providerOptions:gn.optional()}),pIn=ge.object({role:ge.literal("assistant"),content:ge.union([ge.string(),ge.array(ge.union([t3t,oIn,n3t,nIn,iIn,aIn,o3t,cIn]))]),providerOptions:gn.optional()}),fIn=ge.object({role:ge.literal("tool"),content:ge.array(ge.union([o3t,uIn])),providerOptions:gn.optional()}),Yfi=ge.union([lIn,dIn,pIn,fIn]),Xfi=O.object({token:O.string().check(O.refine(e=>e.trim().length>0)),url:O.string().check(O.refine(e=>{try{let t=new URL(e);return(t.protocol==="ws:"||t.protocol==="wss:")&&t.hostname!==""}catch{return!1}})),expiresAt:O.optional(O.number().check(O.positive()).check(O.maximum(Number.MAX_SAFE_INTEGER))),tools:O.optional(O.array(O.object({type:O.literal("function"),name:O.string().check(O.minLength(1)),description:O.optional(O.string()),parameters:O.record(O.string(),O.unknown())})))}),mIn="AI_NoSuchProviderError",hIn=`vercel.ai.error.${mIn}`,Qfi=Symbol.for(hIn),emi=Vd({prefix:"call",size:24}),tmi=Vd({prefix:"call",size:24}),rmi=e3t(),nmi=Vd({prefix:"call",size:24});fB();fB();var gIn=dA("stream-mcp"),zLe=class{constructor(t,r){k(this,"transport");k(this,"onStreamingContent");k(this,"onclose");k(this,"onerror");k(this,"onmessage");let o=new eA(new URL(t));this.transport=o,this.transport.onclose=()=>this.onclose?.(),this.transport.onerror=n=>this.onerror?.(n),this.transport.onmessage=n=>{this.interceptStreamingMessage(n),this.onmessage?.(n)},this.onStreamingContent=r}interceptStreamingMessage(t){if(t&&typeof t=="object"){if("method"in t&&t.method==="notifications/tool/streamContent"){let r=t.params;if(r&&r.content&&Array.isArray(r.content))for(let o of r.content)o.type==="text"&&o.text&&(console.log(`\u{1F4E2} Captured streaming content: "${o.text}"`),this.onStreamingContent?.(o.text))}if("result"in t&&t.result&&typeof t.result=="object"){let r=t.result;if(r.content&&Array.isArray(r.content))for(let o of r.content)o.type==="text"&&o.text&&console.log(`\u{1F4E2} Final result content: "${o.text}"`)}}}async start(){return this.transport.start()}async close(){return this.transport.close()}async send(t){return gIn.info("\u{1F50D} Intercepting send operation to monitor for SSE streaming..."),this.transport.send(t)}get sessionId(){return this.transport.sessionId}};fB();var i3t="modality-client",Xze=dA(i3t),dB=class{constructor(t,r=6e4){k(this,"client");k(this,"transportConfig");k(this,"timeout");k(this,"transport",null);k(this,"connected",!1);this.client=new Rq({name:i3t,version:"1.0.0"}),this.transportConfig=t,this.timeout=r}async getOrCreateTransport(){if(!this.transport||!this.connected){if(this.transport)try{await this.transport.close()}catch{}this.transport=this.createTransport(),await this.client.connect(this.transport),this.connected=!0}return this.transport}createTransport(){switch(this.transportConfig.type){case"http":return new eA(new URL(this.transportConfig.url),this.transportConfig.options);case"stdio":return new zoe(this.transportConfig.serverParams);case"sse":return new Foe(new URL(this.transportConfig.url),this.transportConfig.options);default:throw new Error(`Unsupported transport type: ${this.transportConfig.type}`)}}getTransportIdentifier(){switch(this.transportConfig.type){case"http":case"sse":return this.transportConfig.url;case"stdio":return`stdio:${this.transportConfig.serverParams.command}`;default:return"unknown-transport"}}async closeTransportAndKillProcess(t){if(await t.close(),this.transportConfig.type==="stdio"){let o=t.pid;if(o)try{process.kill(o,"SIGTERM"),await new Promise(n=>setTimeout(n,50));try{process.kill(o,0),process.kill(o,"SIGKILL")}catch{}}catch{}}}async call(t,r,o=!0){try{await this.getOrCreateTransport();let n=await this.client.callTool({name:t,arguments:r},void 0,{timeout:this.timeout});return o?this.parseContent(n):n}catch(n){this.connected=!1;let i=this.getTransportIdentifier();throw Xze.error(`${i}-call-failed`,n),n}}async callOnceInternal(t,r,o,n){try{return await this.call(t,r,o)}finally{if(n&&this.transport)try{await this.closeTransportAndKillProcess(this.transport)}catch{}await this.close()}}async callOnce(t,r,o=!0){return this.callOnceInternal(t,r,o,!1)}async callOnceAndKill(t,r,o=!0){return this.callOnceInternal(t,r,o,!0)}callStream(t,r,o){if(this.transportConfig.type!=="http")throw new Error(`Streaming not supported for ${this.transportConfig.type} transport`);let n=this.client,i=this.transportConfig.url,a=this.getTransportIdentifier();return new ReadableStream({async start(s){try{let c=new zLe(i,l=>s.enqueue(l));await n.connect(c);let u=await n.callTool({name:t,arguments:r});await c.close(),s.close(),o?.(u)}catch(c){Xze.error(`${a}-stream-failed`,c),s.error(c)}}})}async close(){if(this.transport)try{await this.transport.close()}catch{}this.client.close(),this.connected=!1,this.transport=null}async listTools(){try{return await this.getOrCreateTransport(),await this.client.listTools()}catch(t){this.connected=!1;let r=this.getTransportIdentifier();throw Xze.error(`${r}-listTools-failed`,t),t}}parseContent(t){let o=(Array.isArray(t?.content)?t.content:[]).filter(s=>s?.type==="text"&&s.text).map(s=>{try{return JSON.parse(s.text)}catch{return s.text}});if(o.length===0)return t?.content?.[0]??t;let n=o.filter(s=>typeof s=="object"&&s!==null&&!Array.isArray(s)),i=o.filter(s=>typeof s!="object"||s===null||Array.isArray(s));if(n.length===0)return o.length===1?o[0]:o;let a=Object.assign({},...n);if(i.length>0){let s=n.some(c=>"_extra"in c)?"__extra":"_extra";a[s]=i.length===1?i[0]:i}return a.success===void 0&&(a.success=t?.isError!==!0),a}};function yIn(e,t,r){return new dB({type:"http",url:e,options:r},t)}function vIn(e,t){return new dB({type:"stdio",serverParams:e},t)}function xIn(e,t,r){return new dB({type:"sse",url:e,options:r},t)}var a3t={http:yIn,stdio:vIn,sse:xIn},umi=dA("vscode-lm");fB();fB();var pmi=_In(bIn(),".cache","counter"),fmi=300*1e3,mmi={initialize:1800*1e3,"tools/list":300*1e3,"resources/list":60*1e3,"prompts/list":300*1e3};var Fje=class{constructor(t){k(this,"client",a3t.http("https://mcp.deepwiki.com/mcp",3e4));k(this,"toolParams");k(this,"toolName","");k(this,"repoName");this.repoName=t}read_wiki_structure(){return this.toolParams={repoName:this.repoName},this.toolName="read_wiki_structure",this}read_wiki_contents(){return this.toolParams={repoName:this.repoName},this.toolName="read_wiki_contents",this}async callOnce(t=3,r=3e3){for(let o=1;o<=t;o++)try{let n=await this.client.callOnce(this.toolName,this.toolParams);if((typeof n=="string"?n:JSON.stringify(n)).includes("429")){if(o<t){let a=r*o;console.warn(`[DeepWiki] 429 rate limit in response, retrying in ${a}ms (attempt ${o}/${t})`),await new Promise(s=>setTimeout(s,a));continue}throw new Error(`DeepWiki rate limited (429) after ${t} attempts. The upstream ai.devin.ai API is throttling requests.`)}return n}catch(n){if((n?.message?.includes("429")||n?.data?.code===429)&&o<t){let a=r*o;console.warn(`[DeepWiki] 429 rate limit error, retrying in ${a}ms (attempt ${o}/${t})`),await new Promise(s=>setTimeout(s,a));continue}throw n}}listTools(){return this.client.listTools()}getToolParams(){return this.toolParams}};function qje(e,t){let r=t?.size??4096;if(r<=0)throw new Error("Chunk size must be greater than 0");let o=wIn(e,r),n=o.length;return{getChunk(i=0){if(!Number.isInteger(i)||i<0||i>=n)throw new Error(`Invalid chunk index: ${i}. Valid range: 0-${n-1}`);return{index:i,content:o[i],total:n,is_last:i===n-1}},getChunks(){return o.map((i,a)=>({index:a,content:i,total:n,is_last:a===n-1}))},streamChunks(i){for(let a=0;a<n;a++)i({index:a,content:o[a],total:n,is_last:a===n-1})},getTotalChunks(){return n},isValidIndex(i){return Number.isInteger(i)&&i>=0&&i<n}}}function wIn(e,t){if(!e)return e?[""]:[];let r=[],o=0;for(;o<e.length;){let n=Math.min(o+t,e.length);if(n>=e.length){r.push(e.slice(o));break}let i=SIn(e,o,n);r.push(e.slice(o,i)),o=i}return r.length===0?[""]:r}function SIn(e,t,r){if(r>=e.length)return e.length;let o=Math.max(10,Math.floor((r-t)*.1)),n=Math.max(t,r-o);for(let i=r;i>=n;i--)if(e[i]===`
|
|
643
|
-
`)return i+1;for(let i=r;i>=n;i--){let a=e[i];if(a===" "||a===" "||a==="-"||a===",")return i+1}return r}function kIn(e,t,r=23e3){let o;return Array.isArray(e)?o=s3t(e,r).length:o=qje(e,{size:r}).getTotalChunks(),{chunk_index:t,next_chunk_index:t+1,total_chunks:o,is_last:t===o-1,chunk_pagination_guide:TIn({maxChars:r}).chunk_pagination_guide}}function EIn(e,t=23e3){return Array.isArray(e)?JSON.stringify(e).length>t:e.length>t}function s3t(e,t){if(e.length===0)return[];let r=[],o=[],n=0;for(let i of e){let a=JSON.stringify(i).length;n+a>t&&o.length>0&&(r.push(o),o=[],n=0),o.push(i),n+=a}return o.length>0&&r.push(o),r}function IIn(e,t=0,r=23e3){if(Array.isArray(e)){let n=s3t(e,r);if(t<0||t>=n.length)throw new Error(`Invalid chunk index: ${t}. Valid range: 0-${n.length-1}`);return n[t]}let o=qje(e,{size:r});if(!o.isValidIndex(t))throw new Error(`Invalid chunk index: ${t}. Valid range: 0-${o.getTotalChunks()-1}`);return o.getChunk(t).content}function TIn(e={}){let{maxChars:t=23e3,description:r="File too large - exceeds character limit"}=e;return{chunk_pagination_guide:{strategy:`${r} (${t}K max) - Retrieve file in chunks using chunk_index pagination: fetch sequentially from chunk 0, incrementing until is_last=true for complete file`,approach:["1. Request next_chunk_index: chunk_index={next_chunk_index}","2. Read pagination metadata in response (is_last)","3. Request next chunk by incrementing chunk_index until is_last=true"],example:{chunk_0:"{chunk_index: 0}",chunk_1:"{chunk_index: 1}",continue:"Increment chunk_index sequentially until is_last=true"},chunk_index:{meaning:"Zero-based chunk identifier for pagination",start:"0 (always start with first chunk)",increment:"Add 1 to fetch next chunk"}}}}import{readFileSync as Xzn}from"fs";var $Gt=_p(WB());_ce();import{jsx as CGt}from"react/jsx-runtime";function OGt(e,t){let r={...e};return Q8e(e)&&Q8e(t)&&Object.keys(t).forEach(o=>{Array.isArray(t[o])?Array.isArray(r[o])?r[o].push(...t[o]):r[o]=t[o]:Q8e(t[o])&&o in e?r[o]=OGt(e[o],t[o]):r[o]=t[o]}),r}function Q8e(e){return e&&typeof e=="object"&&!Array.isArray(e)}var Qzn=async(e,t)=>{let{readMdx:r,importMdx:o}=await Promise.resolve().then(()=>(TGt(),IGt));if(typeof e=="string"){let n=await o(e);return r(CGt(n,{...t}))}else return r(CGt(e,{...t}))},uT=async(e,t)=>{let r=await Qzn(e,t),o=t3n(r,!0);if(typeof e=="string"){let n=Xzn(e,"utf-8"),i=q4(n);Object.assign(o,i)}return o};function e3n(e){let t=/```(\w+)?\n?([\s\S]*?)\n?```/g,r=[],o;for(;(o=t.exec(e))!==null;)r.push({language:o[1]?.toLowerCase().trim()||"",code:o[2].trim()});return r}function t3n(e,t){let r=e3n(e).filter(o=>o.language==="yaml"||o.language==="yml");return t?r.reduce((o,n)=>{let i=(0,$Gt.parse)(n.code);return OGt(o,i)},{}):r}import{existsSync as _ei}from"fs";import{join as wei,basename as Pxt,extname as Sei,dirname as kei}from"path";var r3n=new Set(["__proto__","constructor","prototype"]),n3n=function(t){return t.some(function(r){return r3n.has(String(r))})},o3n=function(t,r,o,n,i){if(t==null||typeof t!="object")throw new TypeError("Target must be an object.");if(!Array.isArray(r))throw new TypeError("Path must be an array.");if(r.length===0)throw new Error("Path must not be empty.");if(!i&&n3n(r))throw new Error("Contain un-safe key.");let a=r[r.length-1],s=r.slice(0,-1),c=t;s.forEach(function(u){var l;if(c[u]!=null&&typeof c[u]!="object")throw new TypeError(`Cannot set property along path: "${u}" is not an object.`);c[u]=(l=c[u])!=null?l:Object.create(null),c=c[u]}),n&&(!c[a]||!c[a].push)?c[a]?c[a]=[c[a],o]:c[a]=[o]:n&&c[a].push?c[a].push(o):c[a]=o};var w6=o3n;var Ale=["persona","method","workflow"],AGt=ce.object({topic:ce.string().describe("The topic for the Counter to discuss and debate"),context:ce.string().optional().describe("Optional additional context or background for the discussion"),recommendedHeroes:ce.array(ce.string()).optional().describe("Optional array of recommended hero names or call signs to prioritize for the discussion"),deployedHeroes:ce.array(ce.string()).optional().describe("CRITICAL: Array of hero names or call signs already active in current session - prevents duplicate deployment and maintains session continuity. Use when adding heroes to existing active sessions.")}).describe("Start a party mode discussion with all Counter heroes");function i3n(e){if(!e||typeof e!="object"||Array.isArray(e))return e;let t=e;if(Object.keys(t).filter(a=>a.startsWith("params.")).length===0)return e;let o=t.params,n=o&&typeof o=="object"&&!Array.isArray(o)?{...o}:{},i={};for(let[a,s]of Object.entries(t))if(a.startsWith("params.")){let c=a.slice(7);try{w6(n,[c],s)}catch{}}else if(a!=="params")try{w6(i,[a],s)}catch{}return i.params=n,i}function eBe(e){return e.replace(/^-+/,"").replace(/-+([a-z0-9])/gi,(t,r)=>r.toUpperCase())}function a3n(e){if(!e||typeof e!="object"||Array.isArray(e))return e;let t=e,r={};for(let[o,n]of Object.entries(t)){let i=eBe(o);if(!(i!==o&&Object.prototype.hasOwnProperty.call(t,i)))try{w6(r,[i],n)}catch{}}return r}function s3n(e){if(!e||typeof e!="object"||Array.isArray(e))return e;let t=e;if(typeof t.input!="string")return e;let r=t.input.trim().split(/\s+/).filter(Boolean),o={},n=[];for(let c of r)if(c.startsWith("-")&&/^-+[a-zA-Z_]/.test(c)){let u=c.replace(/^-+/,"");if(u.includes("=")){let l=u.indexOf("="),d=u.slice(0,l),f=u.slice(l+1),p=f;try{p=JSON.parse(f)}catch{}let h=eBe(d);try{w6(o,[h],p)}catch{}}else{let l=eBe(u);try{w6(o,[l],!0)}catch{}}}else n.push(c);if(Object.keys(o).length===0)return e;let{input:i,...a}=t,s={...o,...a};return n.length>0&&(s.input=n.join(" ")),s}var Ple=ce.preprocess(i3n,ce.object({method:ce.string().describe("The method name to execute"),params:ce.preprocess(e=>{let t=typeof e=="string"?JSON.parse(e):e;return s3n(a3n(t))},ce.record(ce.string(),ce.any())).optional().describe("Parameters for the method")})),PGt=ce.object({callSign:ce.string().describe("The callSign to deploy (e.g., 'SARAH', 'JAMES')")}).describe("Deploy a specific Counter hero persona"),DGt=ce.object({name:ce.string().describe("The workflow identifier to deploy (e.g., 'team-architect')")}).describe("Execute a specific Counter workflow for multi-step task orchestration");function c3n(e){if(!e||typeof e!="object"||Array.isArray(e))return e;let{type:t,...r}=e;return t===void 0||"types"in r?e:{...r,types:Array.isArray(t)?t:[t]}}var tBe=ce.preprocess(c3n,ce.object({types:ce.array(ce.enum(Ale)).min(1).default(["persona"]).describe("Resource types to search. Defaults to ['persona'] (heroes). Example: ['persona'] to look up a hero, ['method'] or ['workflow'] for those. The singular key 'type' is also accepted."),keyword:ce.string().nullable().default(null).describe("REQUIRED to get results. A hero name or fuzzy term matched against each item's id, name and description (e.g. 'Peter' finds the PETER persona). Pass '*' to list all items of the requested types. Omit, null or blank returns an empty result with guidance \u2014 it does NOT list all.")}).describe("Search Counter resources (heroes/personas, methods, workflows) by type and keyword"));iUr();var cht=(e,t)=>(t&&Object.entries(e).forEach(([r,o])=>{let n=o.name!=null?o.name:r,{inputSchema:i,...a}=o;t.addTool({...a,parameters:i,name:n})}),e);hyt();import{jsx as HYi,jsxs as WYi}from"hono/jsx/jsx-runtime";hyt();import{homedir as fKo}from"node:os";import{join as mKo}from"node:path";var hKo=mKo(fKo(),".cache","counter");var NXi=300*1e3,MXi={initialize:1800*1e3,"tools/list":300*1e3,"resources/list":60*1e3,"prompts/list":300*1e3};import{createRequire as vKo}from"node:module";import{readdirSync as sei,statSync as cei,realpathSync as yyt}from"fs";import{join as VBr,extname as uei,sep as lei}from"path";var xKo=Object.defineProperty,bKo=e=>e;function _Ko(e,t){this[e]=bKo.bind(null,t)}var IS=(e,t)=>{for(var r in t)xKo(e,r,{get:t[r],enumerable:!0,configurable:!0,set:_Ko.bind(t,r)})},KXi=vKo(import.meta.url),vyt=class extends Error{constructor(r,o){super(r);k(this,"cause");this.name=this.constructor.name,o&&(this.cause=o)}},wKo=["text","image","audio","resource_link","resource"];function Cyt(e){let t=e?structuredClone(e):null,r=new Array;return Array.isArray(t)?r.push(...t.map(o=>typeof o=="string"?{type:"text",text:o}:o.type&&wKo.includes(o.type)?o:{type:"text",text:JSON.stringify(o)})):t!=null&&r.push({type:"text",text:typeof t=="string"?t:JSON.stringify(t)}),r}function rN(e,t){let r=structuredClone(e),n={isError:r.success!=null?!r.success:!1,content:[{type:"text",text:JSON.stringify(r)}]},i=Cyt(t);if(i.length>0&&n.content.push(...i),process.env.DEBUG){let a=JSON.stringify(n).length;n.content.push({type:"text",text:`Response size: ${a} bytes`})}return n}function d5(e,t,r){let o,n=!0;if(typeof e=="string")o={error:e,operation:t,meta:r};else if(e instanceof vyt)o={error:e.message,operation:t,meta:r,code:e.code,reason:e.cause?.message};else if(e instanceof Error)o={error:e.message,operation:t,meta:r};else if(typeof e=="object"&&e!==null&&typeof e.message=="string"){let i=e;n=!i.success,o={error:i.message,code:i.code,operation:i.operation||t,meta:r}}else o={error:"Unknown error",operation:t,meta:r};return{isError:n,content:[{type:"text",text:JSON.stringify(o)}]}}var gyt=[null,"debug","info","warn","error","success"],xyt=class{constructor(t,r){k(this,"options",{});k(this,"logLevel");typeof t=="string"?this.options.name=t:this.options={...this.options,...t},this.logLevel=r||null}getTimestamp(){if(this.options.timestampFormat===!1)return;let t=new Date;return this.options.timestampFormat==="locale"?t.toLocaleString():t.toISOString()}initLogLevel(){let t=null;typeof process<"u"&&(t=process.env.MODALITY_LOG_LEVEL),this.logLevel=gyt.indexOf(t)!==-1?t:"info"}shouldLog(t){return this.logLevel||this.initLogLevel(),gyt.indexOf(t)>=gyt.indexOf(this.logLevel)}setLogLevel(t){this.logLevel=t}format(t,r){let o=this.getTimestamp(),n="";switch(t){case"debug":n="\u{1F50D}";break;case"info":n="\u2139\uFE0F";break;case"warn":n="\u26A0\uFE0F";break;case"error":n="\u274C";break;case"success":n="\u2705";break}return o&&(n+=` [${o}]`),this.options.name&&(n+=` [${this.options.name}]`),r&&(n+=` [${r}]`),n}log(t,r,o){if(!this.shouldLog(t))return;let n=(t&&this.options.levelMap?.[t])??t;this.output(n,r,o,t)}cook(t,r){if(t==null)return t;let o=typeof t=="string"?{message:t}:{...t};return r&&(o.data=r),o}debug(t,r){this.log("debug",this.cook(t,r))}info(t,r){this.log("info",this.cook(t,r))}warn(t,r){this.log("warn",this.cook(t,r))}error(t,r,o){let n={error:r};this.log("error",this.cook(n,o),t)}success(t,r){this.log("success",this.cook(t,r))}},UIe=class e extends xyt{static getInstance(t,r){return new e(t,r)}output(t,r,o,n){let i=this.format(n??t,o);switch(console.group(i),n??t){case"debug":console.debug(r);break;case"info":{let{message:a,...s}=r;console.info(a),Object.keys(s).length&&console.dir(s,{depth:null,colors:!0,maxArrayLength:null});break}case"warn":{let{message:a,...s}=r;console.warn(a),console.dir(s,{depth:null,colors:!0,maxArrayLength:null});break}case"error":{let a=r.error;if(a instanceof Error||a.stack){delete r.error;let{message:s,stack:c,...u}=a;c?Object.keys(u).length?(console.error(u),console.log(c)):console.error(c):(s&&(r.error=s),console.error(r))}else console.error(r);break}case"success":console.log(r);break}console.groupEnd()}},Eee=UIe.getInstance.bind(UIe),YXi=Eee("Safe to Handle");var SKo={};IS(SKo,{symbolKinds:()=>RGr,symbolKindSchema:()=>iei,rangeSchema:()=>aei});var t_={};IS(t_,{xor:()=>cGr,xid:()=>AWr,void:()=>rGr,uuidv7:()=>SWr,uuidv6:()=>wWr,uuidv4:()=>_Wr,uuid:()=>bWr,util:()=>Yo,url:()=>kWr,uppercase:()=>oTe,unknown:()=>tN,union:()=>RTe,undefined:()=>eGr,ulid:()=>OWr,uint64:()=>XWr,uint32:()=>JWr,tuple:()=>Yvt,trim:()=>lTe,treeifyError:()=>sZr,transform:()=>MTe,toUpperCase:()=>pTe,toLowerCase:()=>dTe,toJSONSchema:()=>XHr,templateLiteral:()=>wGr,symbol:()=>QWr,superRefine:()=>Ext,success:()=>vGr,stringbool:()=>$Gr,stringFormat:()=>qWr,string:()=>_ee,strictObject:()=>aGr,startsWith:()=>aTe,slugify:()=>fTe,size:()=>Nee,setErrorMap:()=>GQo,set:()=>fGr,safeParseAsync:()=>uWr,safeParse:()=>cWr,safeEncodeAsync:()=>gWr,safeEncode:()=>mWr,safeDecodeAsync:()=>yWr,safeDecode:()=>hWr,registry:()=>tvt,regexes:()=>iO,regex:()=>rTe,refine:()=>kxt,record:()=>Xvt,readonly:()=>vxt,property:()=>Ivt,promise:()=>SGr,prettifyError:()=>uZr,preprocess:()=>AGr,prefault:()=>lxt,positive:()=>wvt,pipe:()=>JIe,partialRecord:()=>lGr,parseAsync:()=>sWr,parse:()=>aWr,overwrite:()=>L1,optional:()=>See,object:()=>iGr,number:()=>Nvt,nullish:()=>yGr,nullable:()=>kee,null:()=>Uvt,normalize:()=>uTe,nonpositive:()=>kvt,nonoptional:()=>dxt,nonnegative:()=>Evt,never:()=>PTe,negative:()=>Svt,nativeEnum:()=>mGr,nanoid:()=>TWr,nan:()=>xGr,multipleOf:()=>i5,minSize:()=>cO,minLength:()=>eN,mime:()=>cTe,meta:()=>TGr,maxSize:()=>p5,maxLength:()=>Mee,map:()=>pGr,mac:()=>RWr,lte:()=>Gx,lt:()=>aO,lowercase:()=>nTe,looseRecord:()=>dGr,looseObject:()=>sGr,locales:()=>evt,literal:()=>hGr,length:()=>zee,lazy:()=>_xt,ksuid:()=>PWr,keyof:()=>oGr,jwt:()=>FWr,json:()=>OGr,iso:()=>$vt,ipv6:()=>NWr,ipv4:()=>DWr,invertCodec:()=>_Gr,intersection:()=>Jvt,int64:()=>YWr,int32:()=>GWr,int:()=>GIe,instanceof:()=>CGr,includes:()=>iTe,httpUrl:()=>EWr,hostname:()=>BWr,hex:()=>ZWr,hash:()=>VWr,guid:()=>xWr,gte:()=>ng,gt:()=>sO,globalRegistry:()=>Wx,getErrorMap:()=>JQo,function:()=>KIe,fromJSONSchema:()=>QQo,formatError:()=>Dyt,float64:()=>WWr,float32:()=>HWr,flattenError:()=>Pyt,file:()=>gGr,exactOptional:()=>ixt,enum:()=>NTe,endsWith:()=>sTe,encodeAsync:()=>pWr,encode:()=>lWr,emoji:()=>IWr,email:()=>vWr,e164:()=>UWr,discriminatedUnion:()=>uGr,describe:()=>IGr,decodeAsync:()=>fWr,decode:()=>dWr,date:()=>nGr,custom:()=>EGr,cuid2:()=>$Wr,cuid:()=>CWr,core:()=>HBr,config:()=>yp,coerce:()=>DGr,codec:()=>bGr,clone:()=>Jx,cidrv6:()=>zWr,cidrv4:()=>MWr,check:()=>kGr,catch:()=>mxt,boolean:()=>Mvt,bigint:()=>KWr,base64url:()=>jWr,base64:()=>LWr,array:()=>Vee,any:()=>tGr,_function:()=>KIe,_default:()=>cxt,_ZodString:()=>mTe,ZodXor:()=>Hvt,ZodXID:()=>_Te,ZodVoid:()=>Zvt,ZodUnknown:()=>qvt,ZodUnion:()=>Wee,ZodUndefined:()=>Lvt,ZodUUID:()=>ES,ZodURL:()=>Fee,ZodULID:()=>bTe,ZodType:()=>so,ZodTuple:()=>Kvt,ZodTransform:()=>nxt,ZodTemplateLiteral:()=>xxt,ZodSymbol:()=>zvt,ZodSuccess:()=>pxt,ZodStringFormat:()=>$s,ZodString:()=>Uee,ZodSet:()=>ext,ZodRecord:()=>u5,ZodRealError:()=>Zy,ZodReadonly:()=>yxt,ZodPromise:()=>wxt,ZodPreprocess:()=>gxt,ZodPrefault:()=>uxt,ZodPipe:()=>Gee,ZodOptional:()=>zTe,ZodObject:()=>Hee,ZodNumberFormat:()=>oN,ZodNumber:()=>qee,ZodNullable:()=>axt,ZodNull:()=>jvt,ZodNonOptional:()=>LTe,ZodNever:()=>Bvt,ZodNanoID:()=>yTe,ZodNaN:()=>hxt,ZodMap:()=>Qvt,ZodMAC:()=>Rvt,ZodLiteral:()=>txt,ZodLazy:()=>bxt,ZodKSUID:()=>wTe,ZodJWT:()=>OTe,ZodIssueCode:()=>WQo,ZodIntersection:()=>Gvt,ZodISOTime:()=>Pvt,ZodISODuration:()=>Dvt,ZodISODateTime:()=>Ovt,ZodISODate:()=>Avt,ZodIPv6:()=>kTe,ZodIPv4:()=>STe,ZodGUID:()=>wee,ZodFunction:()=>Sxt,ZodFirstPartyTypeKind:()=>Tyt,ZodFile:()=>rxt,ZodExactOptional:()=>oxt,ZodError:()=>HQo,ZodEnum:()=>l5,ZodEmoji:()=>gTe,ZodEmail:()=>hTe,ZodE164:()=>$Te,ZodDiscriminatedUnion:()=>Wvt,ZodDefault:()=>sxt,ZodDate:()=>DTe,ZodCustomStringFormat:()=>f5,ZodCustom:()=>Kee,ZodCodec:()=>Jee,ZodCatch:()=>fxt,ZodCUID2:()=>xTe,ZodCUID:()=>vTe,ZodCIDRv6:()=>ITe,ZodCIDRv4:()=>ETe,ZodBoolean:()=>Bee,ZodBigIntFormat:()=>ATe,ZodBigInt:()=>Zee,ZodBase64URL:()=>CTe,ZodBase64:()=>TTe,ZodArray:()=>Vvt,ZodAny:()=>Fvt,TimePrecision:()=>A7r,NEVER:()=>WBr,$output:()=>I7r,$input:()=>T7r,$brand:()=>GBr});var HBr={};IS(HBr,{version:()=>uVr,util:()=>Yo,treeifyError:()=>sZr,toJSONSchema:()=>XHr,toDotPath:()=>cZr,safeParseAsync:()=>dZr,safeParse:()=>lZr,safeEncodeAsync:()=>tYo,safeEncode:()=>QKo,safeDecodeAsync:()=>rYo,safeDecode:()=>eYo,registry:()=>tvt,regexes:()=>iO,process:()=>ms,prettifyError:()=>uZr,parseAsync:()=>Syt,parse:()=>wyt,meta:()=>pHr,locales:()=>evt,isValidJWT:()=>RVr,isValidBase64URL:()=>AVr,isValidBase64:()=>Hyt,initializeContext:()=>a5,globalRegistry:()=>Wx,globalConfig:()=>xee,formatError:()=>Dyt,flattenError:()=>Pyt,finalize:()=>c5,extractDefs:()=>s5,encodeAsync:()=>YKo,encode:()=>JKo,describe:()=>dHr,decodeAsync:()=>XKo,decode:()=>KKo,createToJSONSchemaMethod:()=>mHr,createStandardJSONSchemaMethod:()=>bee,config:()=>yp,clone:()=>Jx,_xor:()=>wQo,_xid:()=>pvt,_void:()=>tHr,_uuidv7:()=>avt,_uuidv6:()=>ivt,_uuidv4:()=>ovt,_uuid:()=>nvt,_url:()=>tTe,_uppercase:()=>oTe,_unknown:()=>Q7r,_union:()=>_Qo,_undefined:()=>K7r,_ulid:()=>dvt,_uint64:()=>G7r,_uint32:()=>q7r,_tuple:()=>EQo,_trim:()=>lTe,_transform:()=>PQo,_toUpperCase:()=>pTe,_toLowerCase:()=>dTe,_templateLiteral:()=>FQo,_symbol:()=>J7r,_superRefine:()=>uHr,_success:()=>zQo,_stringbool:()=>fHr,_stringFormat:()=>Lee,_string:()=>C7r,_startsWith:()=>aTe,_slugify:()=>fTe,_size:()=>Nee,_set:()=>CQo,_safeParseAsync:()=>Oee,_safeParse:()=>$ee,_safeEncodeAsync:()=>Uyt,_safeEncode:()=>Lyt,_safeDecodeAsync:()=>Fyt,_safeDecode:()=>jyt,_regex:()=>rTe,_refine:()=>cHr,_record:()=>IQo,_readonly:()=>UQo,_property:()=>Ivt,_promise:()=>BQo,_positive:()=>wvt,_pipe:()=>jQo,_parseAsync:()=>Cee,_parse:()=>Tee,_overwrite:()=>L1,_optional:()=>DQo,_number:()=>M7r,_nullable:()=>RQo,_null:()=>Y7r,_normalize:()=>uTe,_nonpositive:()=>kvt,_nonoptional:()=>MQo,_nonnegative:()=>Evt,_never:()=>eHr,_negative:()=>Svt,_nativeEnum:()=>OQo,_nanoid:()=>cvt,_nan:()=>oHr,_multipleOf:()=>i5,_minSize:()=>cO,_minLength:()=>eN,_min:()=>ng,_mime:()=>cTe,_maxSize:()=>p5,_maxLength:()=>Mee,_max:()=>Gx,_map:()=>TQo,_mac:()=>O7r,_lte:()=>Gx,_lt:()=>aO,_lowercase:()=>nTe,_literal:()=>AQo,_length:()=>zee,_lazy:()=>qQo,_ksuid:()=>fvt,_jwt:()=>_vt,_isoTime:()=>R7r,_isoDuration:()=>N7r,_isoDateTime:()=>P7r,_isoDate:()=>D7r,_ipv6:()=>hvt,_ipv4:()=>mvt,_intersection:()=>kQo,_int64:()=>W7r,_int32:()=>F7r,_int:()=>L7r,_includes:()=>iTe,_guid:()=>WIe,_gte:()=>ng,_gt:()=>sO,_float64:()=>U7r,_float32:()=>j7r,_file:()=>aHr,_enum:()=>$Qo,_endsWith:()=>sTe,_encodeAsync:()=>Myt,_encode:()=>Ryt,_emoji:()=>svt,_email:()=>rvt,_e164:()=>bvt,_discriminatedUnion:()=>SQo,_default:()=>NQo,_decodeAsync:()=>zyt,_decode:()=>Nyt,_date:()=>rHr,_custom:()=>sHr,_cuid2:()=>lvt,_cuid:()=>uvt,_coercedString:()=>$7r,_coercedNumber:()=>z7r,_coercedDate:()=>nHr,_coercedBoolean:()=>Z7r,_coercedBigint:()=>H7r,_cidrv6:()=>yvt,_cidrv4:()=>gvt,_check:()=>lHr,_catch:()=>LQo,_boolean:()=>B7r,_bigint:()=>V7r,_base64url:()=>xvt,_base64:()=>vvt,_array:()=>iHr,_any:()=>X7r,TimePrecision:()=>A7r,NEVER:()=>WBr,JSONSchemaGenerator:()=>Iyt,JSONSchema:()=>VQo,Doc:()=>ZIe,$output:()=>I7r,$input:()=>T7r,$constructor:()=>me,$brand:()=>GBr,$ZodXor:()=>XVr,$ZodXID:()=>xVr,$ZodVoid:()=>VVr,$ZodUnknown:()=>BVr,$ZodUnion:()=>eTe,$ZodUndefined:()=>UVr,$ZodUUID:()=>dVr,$ZodURL:()=>fVr,$ZodULID:()=>vVr,$ZodType:()=>Hn,$ZodTuple:()=>Kyt,$ZodTransform:()=>s7r,$ZodTemplateLiteral:()=>v7r,$ZodSymbol:()=>jVr,$ZodSuccess:()=>f7r,$ZodStringFormat:()=>Cs,$ZodString:()=>Ree,$ZodSet:()=>n7r,$ZodRegistry:()=>HIe,$ZodRecord:()=>t7r,$ZodRealError:()=>By,$ZodReadonly:()=>y7r,$ZodPromise:()=>b7r,$ZodPreprocess:()=>g7r,$ZodPrefault:()=>d7r,$ZodPipe:()=>Xyt,$ZodOptional:()=>Yyt,$ZodObjectJIT:()=>YVr,$ZodObject:()=>KVr,$ZodNumberFormat:()=>zVr,$ZodNumber:()=>Wyt,$ZodNullable:()=>u7r,$ZodNull:()=>FVr,$ZodNonOptional:()=>p7r,$ZodNever:()=>ZVr,$ZodNanoID:()=>hVr,$ZodNaN:()=>h7r,$ZodMap:()=>r7r,$ZodMAC:()=>TVr,$ZodLiteral:()=>i7r,$ZodLazy:()=>_7r,$ZodKSUID:()=>bVr,$ZodJWT:()=>NVr,$ZodIntersection:()=>e7r,$ZodISOTime:()=>SVr,$ZodISODuration:()=>kVr,$ZodISODateTime:()=>_Vr,$ZodISODate:()=>wVr,$ZodIPv6:()=>IVr,$ZodIPv4:()=>EVr,$ZodGUID:()=>lVr,$ZodFunction:()=>x7r,$ZodFile:()=>a7r,$ZodExactOptional:()=>c7r,$ZodError:()=>Ayt,$ZodEnum:()=>o7r,$ZodEncodeError:()=>r5,$ZodEmoji:()=>mVr,$ZodEmail:()=>pVr,$ZodE164:()=>DVr,$ZodDiscriminatedUnion:()=>QVr,$ZodDefault:()=>l7r,$ZodDate:()=>HVr,$ZodCustomStringFormat:()=>MVr,$ZodCustom:()=>w7r,$ZodCodec:()=>Qyt,$ZodCheckUpperCase:()=>rVr,$ZodCheckStringFormat:()=>Dee,$ZodCheckStartsWith:()=>oVr,$ZodCheckSizeEquals:()=>KZr,$ZodCheckRegex:()=>eVr,$ZodCheckProperty:()=>aVr,$ZodCheckOverwrite:()=>cVr,$ZodCheckNumberFormat:()=>HZr,$ZodCheckMultipleOf:()=>VZr,$ZodCheckMinSize:()=>JZr,$ZodCheckMinLength:()=>XZr,$ZodCheckMimeType:()=>sVr,$ZodCheckMaxSize:()=>GZr,$ZodCheckMaxLength:()=>YZr,$ZodCheckLowerCase:()=>tVr,$ZodCheckLessThan:()=>Zyt,$ZodCheckLengthEquals:()=>QZr,$ZodCheckIncludes:()=>nVr,$ZodCheckGreaterThan:()=>Vyt,$ZodCheckEndsWith:()=>iVr,$ZodCheckBigIntFormat:()=>WZr,$ZodCheck:()=>Pc,$ZodCatch:()=>m7r,$ZodCUID2:()=>yVr,$ZodCUID:()=>gVr,$ZodCIDRv6:()=>$Vr,$ZodCIDRv4:()=>CVr,$ZodBoolean:()=>Gyt,$ZodBigIntFormat:()=>LVr,$ZodBigInt:()=>Jyt,$ZodBase64URL:()=>PVr,$ZodBase64:()=>OVr,$ZodAsyncError:()=>N1,$ZodArray:()=>WVr,$ZodAny:()=>qVr});var bBr,WBr=Object.freeze({status:"aborted"});function me(e,t,r){function o(s,c){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:c,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,c);let u=a.prototype,l=Object.keys(u);for(let d=0;d<l.length;d++){let f=l[d];f in s||(s[f]=u[f].bind(s))}}let n=r?.Parent??Object;class i extends n{}Object.defineProperty(i,"name",{value:e});function a(s){var c;let u=r?.Parent?new i:this;o(u,s),(c=u._zod).deferred??(c.deferred=[]);for(let l of u._zod.deferred)l();return u}return Object.defineProperty(a,"init",{value:o}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}var GBr=Symbol("zod_brand"),N1=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},r5=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(bBr=globalThis).__zod_globalConfig??(bBr.__zod_globalConfig={});var xee=globalThis.__zod_globalConfig;function yp(e){return e&&Object.assign(xee,e),xee}var Yo={};IS(Yo,{unwrapMessage:()=>vee,uint8ArrayToHex:()=>GKo,uint8ArrayToBase64url:()=>HKo,uint8ArrayToBase64:()=>iZr,stringifyPrimitive:()=>Wr,slugify:()=>KBr,shallowClone:()=>XBr,safeExtend:()=>UKo,required:()=>BKo,randomString:()=>DKo,propertyKeyTypes:()=>qIe,promiseAllObject:()=>PKo,primitiveTypes:()=>QBr,prefixIssues:()=>Hx,pick:()=>zKo,partial:()=>qKo,parsedType:()=>rn,optionalKeys:()=>eZr,omit:()=>LKo,objectClone:()=>$Ko,numKeys:()=>RKo,nullish:()=>nN,normalizeParams:()=>mt,mergeDefs:()=>z1,merge:()=>FKo,jsonStringifyReplacer:()=>FIe,joinValues:()=>tt,issue:()=>BIe,isPlainObject:()=>QR,isObject:()=>n5,hexToUint8Array:()=>WKo,getSizableOrigin:()=>XIe,getParsedType:()=>NKo,getLengthableOrigin:()=>QIe,getEnumValues:()=>$yt,getElementAtPath:()=>AKo,floatSafeRemainder:()=>JBr,finalizeIssue:()=>qy,extend:()=>jKo,explicitlyAborted:()=>nZr,escapeRegex:()=>M1,esc:()=>byt,defineLazy:()=>Xo,createTransparentProxy:()=>MKo,cloneDef:()=>OKo,clone:()=>Jx,cleanRegex:()=>YIe,cleanEnum:()=>ZKo,captureStackTrace:()=>Oyt,cached:()=>Iee,base64urlToUint8Array:()=>VKo,base64ToUint8Array:()=>oZr,assignProp:()=>uO,assertNotEqual:()=>EKo,assertNever:()=>TKo,assertIs:()=>IKo,assertEqual:()=>kKo,assert:()=>CKo,allowsEval:()=>YBr,aborted:()=>XR,NUMBER_FORMAT_RANGES:()=>tZr,Class:()=>_yt,BIGINT_FORMAT_RANGES:()=>rZr});function kKo(e){return e}function EKo(e){return e}function IKo(e){}function TKo(e){throw new Error("Unexpected value in exhaustive check")}function CKo(e){}function $yt(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function tt(e,t="|"){return e.map(r=>Wr(r)).join(t)}function FIe(e,t){return typeof t=="bigint"?t.toString():t}function Iee(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function nN(e){return e==null}function YIe(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function JBr(e,t){let r=e/t,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}var _Br=Symbol("evaluating");function Xo(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==_Br)return o===void 0&&(o=_Br,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function $Ko(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function uO(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function z1(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function OKo(e){return z1(e._zod.def)}function AKo(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function PKo(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let i=0;i<t.length;i++)n[t[i]]=o[i];return n})}function DKo(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function byt(e){return JSON.stringify(e)}function KBr(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Oyt="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function n5(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var YBr=Iee(()=>{if(xee.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function QR(e){if(n5(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(n5(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function XBr(e){return QR(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function RKo(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var NKo=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}`)}},qIe=new Set(["string","number","symbol"]),QBr=new Set(["string","number","bigint","boolean","symbol","undefined"]);function M1(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Jx(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function mt(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 MKo(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,i){return t??(t=e()),Reflect.set(t,o,n,i)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function Wr(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function eZr(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var tZr={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]},rZr={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function zKo(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i=z1(e._zod.def,{get shape(){let a={};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(a[s]=r.shape[s])}return uO(this,"shape",a),a},checks:[]});return Jx(e,i)}function LKo(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=z1(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete a[s]}return uO(this,"shape",a),a},checks:[]});return Jx(e,i)}function jKo(e,t){if(!QR(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let i=e._zod.def.shape;for(let a in t)if(Object.getOwnPropertyDescriptor(i,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=z1(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return uO(this,"shape",i),i}});return Jx(e,n)}function UKo(e,t){if(!QR(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=z1(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return uO(this,"shape",o),o}});return Jx(e,r)}function FKo(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=z1(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return uO(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Jx(e,r)}function qKo(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=z1(t._zod.def,{get shape(){let s=t._zod.def.shape,c={...s};if(r)for(let u in r){if(!(u in s))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(c[u]=e?new e({type:"optional",innerType:s[u]}):s[u])}else for(let u in s)c[u]=e?new e({type:"optional",innerType:s[u]}):s[u];return uO(this,"shape",c),c},checks:[]});return Jx(t,a)}function BKo(e,t,r){let o=z1(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let a in r){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(i[a]=new e({type:"nonoptional",innerType:n[a]}))}else for(let a in n)i[a]=new e({type:"nonoptional",innerType:n[a]});return uO(this,"shape",i),i}});return Jx(t,o)}function XR(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function nZr(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function Hx(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function vee(e){return typeof e=="string"?e:e?.message}function qy(e,t,r){let o=e.message?e.message:vee(e.inst?._zod.def?.error?.(e))??vee(t?.error?.(e))??vee(r.customError?.(e))??vee(r.localeError?.(e))??"Invalid input",{inst:n,continue:i,input:a,...s}=e;return s.path??(s.path=[]),s.message=o,t?.reportInput&&(s.input=a),s}function XIe(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function QIe(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function rn(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function BIe(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function ZKo(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function oZr(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function iZr(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function VKo(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return oZr(t+r)}function HKo(e){return iZr(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function WKo(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function GKo(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var _yt=class{constructor(...t){}},aZr=(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,FIe,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ayt=me("$ZodError",aZr),By=me("$ZodError",aZr,{Parent:Error});function Pyt(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):o.push(t(n));return{formErrors:o,fieldErrors:r}}function Dyt(e,t=r=>r.message){let r={_errors:[]},o=(n,i=[])=>{for(let a of n.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>o({issues:s},[...i,...a.path]));else if(a.code==="invalid_key")o({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")o({issues:a.issues},[...i,...a.path]);else{let s=[...i,...a.path];if(s.length===0)r._errors.push(t(a));else{let c=r,u=0;for(;u<s.length;){let l=s[u];u===s.length-1?(c[l]=c[l]||{_errors:[]},c[l]._errors.push(t(a))):c[l]=c[l]||{_errors:[]},c=c[l],u++}}}};return o(e),r}function sZr(e,t=r=>r.message){let r={errors:[]},o=(n,i=[])=>{var a,s;for(let c of n.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(u=>o({issues:u},[...i,...c.path]));else if(c.code==="invalid_key")o({issues:c.issues},[...i,...c.path]);else if(c.code==="invalid_element")o({issues:c.issues},[...i,...c.path]);else{let u=[...i,...c.path];if(u.length===0){r.errors.push(t(c));continue}let l=r,d=0;for(;d<u.length;){let f=u[d],p=d===u.length-1;typeof f=="string"?(l.properties??(l.properties={}),(a=l.properties)[f]??(a[f]={errors:[]}),l=l.properties[f]):(l.items??(l.items=[]),(s=l.items)[f]??(s[f]={errors:[]}),l=l.items[f]),p&&l.errors.push(t(c)),d++}}};return o(e),r}function cZr(e){let t=[],r=e.map(o=>typeof o=="object"?o.key:o);for(let o of r)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 uZr(e){let t=[],r=[...e.issues].sort((o,n)=>(o.path??[]).length-(n.path??[]).length);for(let o of r)t.push(`\u2716 ${o.message}`),o.path?.length&&t.push(` \u2192 at ${cZr(o.path)}`);return t.join(`
|
|
643
|
+
`)return i+1;for(let i=r;i>=n;i--){let a=e[i];if(a===" "||a===" "||a==="-"||a===",")return i+1}return r}function kIn(e,t,r=23e3){let o;return Array.isArray(e)?o=s3t(e,r).length:o=qje(e,{size:r}).getTotalChunks(),{chunk_index:t,next_chunk_index:t+1,total_chunks:o,is_last:t===o-1,chunk_pagination_guide:TIn({maxChars:r}).chunk_pagination_guide}}function EIn(e,t=23e3){return Array.isArray(e)?JSON.stringify(e).length>t:e.length>t}function s3t(e,t){if(e.length===0)return[];let r=[],o=[],n=0;for(let i of e){let a=JSON.stringify(i).length;n+a>t&&o.length>0&&(r.push(o),o=[],n=0),o.push(i),n+=a}return o.length>0&&r.push(o),r}function IIn(e,t=0,r=23e3){if(Array.isArray(e)){let n=s3t(e,r);if(t<0||t>=n.length)throw new Error(`Invalid chunk index: ${t}. Valid range: 0-${n.length-1}`);return n[t]}let o=qje(e,{size:r});if(!o.isValidIndex(t))throw new Error(`Invalid chunk index: ${t}. Valid range: 0-${o.getTotalChunks()-1}`);return o.getChunk(t).content}function TIn(e={}){let{maxChars:t=23e3,description:r="File too large - exceeds character limit"}=e;return{chunk_pagination_guide:{strategy:`${r} (${t}K max) - Retrieve file in chunks using chunk_index pagination: fetch sequentially from chunk 0, incrementing until is_last=true for complete file`,approach:["1. Request next_chunk_index: chunk_index={next_chunk_index}","2. Read pagination metadata in response (is_last)","3. Request next chunk by incrementing chunk_index until is_last=true"],example:{chunk_0:"{chunk_index: 0}",chunk_1:"{chunk_index: 1}",continue:"Increment chunk_index sequentially until is_last=true"},chunk_index:{meaning:"Zero-based chunk identifier for pagination",start:"0 (always start with first chunk)",increment:"Add 1 to fetch next chunk"}}}}import{readFileSync as Xzn}from"fs";var $Gt=_p(WB());_ce();import{jsx as CGt}from"react/jsx-runtime";function OGt(e,t){let r={...e};return Q8e(e)&&Q8e(t)&&Object.keys(t).forEach(o=>{Array.isArray(t[o])?Array.isArray(r[o])?r[o].push(...t[o]):r[o]=t[o]:Q8e(t[o])&&o in e?r[o]=OGt(e[o],t[o]):r[o]=t[o]}),r}function Q8e(e){return e&&typeof e=="object"&&!Array.isArray(e)}var Qzn=async(e,t)=>{let{readMdx:r,importMdx:o}=await Promise.resolve().then(()=>(TGt(),IGt));if(typeof e=="string"){let n=await o(e);return r(CGt(n,{...t}))}else return r(CGt(e,{...t}))},uT=async(e,t)=>{let r=await Qzn(e,t),o=t3n(r,!0);if(typeof e=="string"){let n=Xzn(e,"utf-8"),i=q4(n);Object.assign(o,i)}return o};function e3n(e){let t=/```(\w+)?\n?([\s\S]*?)\n?```/g,r=[],o;for(;(o=t.exec(e))!==null;)r.push({language:o[1]?.toLowerCase().trim()||"",code:o[2].trim()});return r}function t3n(e,t){let r=e3n(e).filter(o=>o.language==="yaml"||o.language==="yml");return t?r.reduce((o,n)=>{let i=(0,$Gt.parse)(n.code);return OGt(o,i)},{}):r}import{existsSync as _ei}from"fs";import{join as wei,basename as Pxt,extname as Sei,dirname as kei}from"path";var r3n=new Set(["__proto__","constructor","prototype"]),n3n=function(t){return t.some(function(r){return r3n.has(String(r))})},o3n=function(t,r,o,n,i){if(t==null||typeof t!="object")throw new TypeError("Target must be an object.");if(!Array.isArray(r))throw new TypeError("Path must be an array.");if(r.length===0)throw new Error("Path must not be empty.");if(!i&&n3n(r))throw new Error("Contain un-safe key.");let a=r[r.length-1],s=r.slice(0,-1),c=t;s.forEach(function(u){var l;if(c[u]!=null&&typeof c[u]!="object")throw new TypeError(`Cannot set property along path: "${u}" is not an object.`);c[u]=(l=c[u])!=null?l:Object.create(null),c=c[u]}),n&&(!c[a]||!c[a].push)?c[a]?c[a]=[c[a],o]:c[a]=[o]:n&&c[a].push?c[a].push(o):c[a]=o};var w6=o3n;var Ale=["persona","method","workflow"],AGt=ce.object({topic:ce.string().describe("The topic for the Counter to discuss and debate"),context:ce.string().optional().describe("Optional additional context or background for the discussion"),recommendedHeroes:ce.array(ce.string()).optional().describe("Optional array of recommended hero names or call signs to prioritize for the discussion"),deployedHeroes:ce.array(ce.string()).optional().describe("CRITICAL: Array of hero names or call signs already active in current session - prevents duplicate deployment and maintains session continuity. Use when adding heroes to existing active sessions.")}).describe("Start a party mode discussion with all Counter heroes");function i3n(e){if(!e||typeof e!="object"||Array.isArray(e))return e;let t=e;if(Object.keys(t).filter(a=>a.startsWith("params.")).length===0)return e;let o=t.params,n=o&&typeof o=="object"&&!Array.isArray(o)?{...o}:{},i={};for(let[a,s]of Object.entries(t))if(a.startsWith("params.")){let c=a.slice(7);try{w6(n,[c],s)}catch{}}else if(a!=="params")try{w6(i,[a],s)}catch{}return i.params=n,i}function eBe(e){return e.replace(/^-+/,"").replace(/-+([a-z0-9])/gi,(t,r)=>r.toUpperCase())}function a3n(e){if(!e||typeof e!="object"||Array.isArray(e))return e;let t=e,r={};for(let[o,n]of Object.entries(t)){let i=eBe(o);if(!(i!==o&&Object.prototype.hasOwnProperty.call(t,i)))try{w6(r,[i],n)}catch{}}return r}function s3n(e){if(!e||typeof e!="object"||Array.isArray(e))return e;let t=e;if(typeof t.input!="string")return e;let r=t.input.trim().split(/\s+/).filter(Boolean),o={},n=[];for(let c of r)if(c.startsWith("-")&&/^-+[a-zA-Z_]/.test(c)){let u=c.replace(/^-+/,"");if(u.includes("=")){let l=u.indexOf("="),d=u.slice(0,l),f=u.slice(l+1),p=f;try{p=JSON.parse(f)}catch{}let h=eBe(d);try{w6(o,[h],p)}catch{}}else{let l=eBe(u);try{w6(o,[l],!0)}catch{}}}else n.push(c);if(Object.keys(o).length===0)return e;let{input:i,...a}=t,s={...o,...a};return n.length>0&&(s.input=n.join(" ")),s}var Ple=ce.preprocess(i3n,ce.object({method:ce.string().describe("The method name to execute"),params:ce.preprocess(e=>{let t=typeof e=="string"?JSON.parse(e):e;return s3n(a3n(t))},ce.record(ce.string(),ce.any()).nullable()).optional().describe("Parameters for the method")})),PGt=ce.object({callSign:ce.string().describe("The callSign to deploy (e.g., 'SARAH', 'JAMES')")}).describe("Deploy a specific Counter hero persona"),DGt=ce.object({name:ce.string().describe("The workflow identifier to deploy (e.g., 'team-architect')")}).describe("Execute a specific Counter workflow for multi-step task orchestration");function c3n(e){if(!e||typeof e!="object"||Array.isArray(e))return e;let{type:t,...r}=e;return t===void 0||"types"in r?e:{...r,types:Array.isArray(t)?t:[t]}}var tBe=ce.preprocess(c3n,ce.object({types:ce.array(ce.enum(Ale)).min(1).default(["persona"]).describe("Resource types to search. Defaults to ['persona'] (heroes). Example: ['persona'] to look up a hero, ['method'] or ['workflow'] for those. The singular key 'type' is also accepted."),keyword:ce.string().nullable().default(null).describe("REQUIRED to get results. A hero name or fuzzy term matched against each item's id, name and description (e.g. 'Peter' finds the PETER persona). Pass '*' to list all items of the requested types. Omit, null or blank returns an empty result with guidance \u2014 it does NOT list all.")}).describe("Search Counter resources (heroes/personas, methods, workflows) by type and keyword"));iUr();var cht=(e,t)=>(t&&Object.entries(e).forEach(([r,o])=>{let n=o.name!=null?o.name:r,{inputSchema:i,...a}=o;t.addTool({...a,parameters:i,name:n})}),e);hyt();import{jsx as HYi,jsxs as WYi}from"hono/jsx/jsx-runtime";hyt();import{homedir as fKo}from"node:os";import{join as mKo}from"node:path";var hKo=mKo(fKo(),".cache","counter");var NXi=300*1e3,MXi={initialize:1800*1e3,"tools/list":300*1e3,"resources/list":60*1e3,"prompts/list":300*1e3};import{createRequire as vKo}from"node:module";import{readdirSync as sei,statSync as cei,realpathSync as yyt}from"fs";import{join as VBr,extname as uei,sep as lei}from"path";var xKo=Object.defineProperty,bKo=e=>e;function _Ko(e,t){this[e]=bKo.bind(null,t)}var IS=(e,t)=>{for(var r in t)xKo(e,r,{get:t[r],enumerable:!0,configurable:!0,set:_Ko.bind(t,r)})},KXi=vKo(import.meta.url),vyt=class extends Error{constructor(r,o){super(r);k(this,"cause");this.name=this.constructor.name,o&&(this.cause=o)}},wKo=["text","image","audio","resource_link","resource"];function Cyt(e){let t=e?structuredClone(e):null,r=new Array;return Array.isArray(t)?r.push(...t.map(o=>typeof o=="string"?{type:"text",text:o}:o.type&&wKo.includes(o.type)?o:{type:"text",text:JSON.stringify(o)})):t!=null&&r.push({type:"text",text:typeof t=="string"?t:JSON.stringify(t)}),r}function rN(e,t){let r=structuredClone(e),n={isError:r.success!=null?!r.success:!1,content:[{type:"text",text:JSON.stringify(r)}]},i=Cyt(t);if(i.length>0&&n.content.push(...i),process.env.DEBUG){let a=JSON.stringify(n).length;n.content.push({type:"text",text:`Response size: ${a} bytes`})}return n}function d5(e,t,r){let o,n=!0;if(typeof e=="string")o={error:e,operation:t,meta:r};else if(e instanceof vyt)o={error:e.message,operation:t,meta:r,code:e.code,reason:e.cause?.message};else if(e instanceof Error)o={error:e.message,operation:t,meta:r};else if(typeof e=="object"&&e!==null&&typeof e.message=="string"){let i=e;n=!i.success,o={error:i.message,code:i.code,operation:i.operation||t,meta:r}}else o={error:"Unknown error",operation:t,meta:r};return{isError:n,content:[{type:"text",text:JSON.stringify(o)}]}}var gyt=[null,"debug","info","warn","error","success"],xyt=class{constructor(t,r){k(this,"options",{});k(this,"logLevel");typeof t=="string"?this.options.name=t:this.options={...this.options,...t},this.logLevel=r||null}getTimestamp(){if(this.options.timestampFormat===!1)return;let t=new Date;return this.options.timestampFormat==="locale"?t.toLocaleString():t.toISOString()}initLogLevel(){let t=null;typeof process<"u"&&(t=process.env.MODALITY_LOG_LEVEL),this.logLevel=gyt.indexOf(t)!==-1?t:"info"}shouldLog(t){return this.logLevel||this.initLogLevel(),gyt.indexOf(t)>=gyt.indexOf(this.logLevel)}setLogLevel(t){this.logLevel=t}format(t,r){let o=this.getTimestamp(),n="";switch(t){case"debug":n="\u{1F50D}";break;case"info":n="\u2139\uFE0F";break;case"warn":n="\u26A0\uFE0F";break;case"error":n="\u274C";break;case"success":n="\u2705";break}return o&&(n+=` [${o}]`),this.options.name&&(n+=` [${this.options.name}]`),r&&(n+=` [${r}]`),n}log(t,r,o){if(!this.shouldLog(t))return;let n=(t&&this.options.levelMap?.[t])??t;this.output(n,r,o,t)}cook(t,r){if(t==null)return t;let o=typeof t=="string"?{message:t}:{...t};return r&&(o.data=r),o}debug(t,r){this.log("debug",this.cook(t,r))}info(t,r){this.log("info",this.cook(t,r))}warn(t,r){this.log("warn",this.cook(t,r))}error(t,r,o){let n={error:r};this.log("error",this.cook(n,o),t)}success(t,r){this.log("success",this.cook(t,r))}},UIe=class e extends xyt{static getInstance(t,r){return new e(t,r)}output(t,r,o,n){let i=this.format(n??t,o);switch(console.group(i),n??t){case"debug":console.debug(r);break;case"info":{let{message:a,...s}=r;console.info(a),Object.keys(s).length&&console.dir(s,{depth:null,colors:!0,maxArrayLength:null});break}case"warn":{let{message:a,...s}=r;console.warn(a),console.dir(s,{depth:null,colors:!0,maxArrayLength:null});break}case"error":{let a=r.error;if(a instanceof Error||a.stack){delete r.error;let{message:s,stack:c,...u}=a;c?Object.keys(u).length?(console.error(u),console.log(c)):console.error(c):(s&&(r.error=s),console.error(r))}else console.error(r);break}case"success":console.log(r);break}console.groupEnd()}},Eee=UIe.getInstance.bind(UIe),YXi=Eee("Safe to Handle");var SKo={};IS(SKo,{symbolKinds:()=>RGr,symbolKindSchema:()=>iei,rangeSchema:()=>aei});var t_={};IS(t_,{xor:()=>cGr,xid:()=>AWr,void:()=>rGr,uuidv7:()=>SWr,uuidv6:()=>wWr,uuidv4:()=>_Wr,uuid:()=>bWr,util:()=>Yo,url:()=>kWr,uppercase:()=>oTe,unknown:()=>tN,union:()=>RTe,undefined:()=>eGr,ulid:()=>OWr,uint64:()=>XWr,uint32:()=>JWr,tuple:()=>Yvt,trim:()=>lTe,treeifyError:()=>sZr,transform:()=>MTe,toUpperCase:()=>pTe,toLowerCase:()=>dTe,toJSONSchema:()=>XHr,templateLiteral:()=>wGr,symbol:()=>QWr,superRefine:()=>Ext,success:()=>vGr,stringbool:()=>$Gr,stringFormat:()=>qWr,string:()=>_ee,strictObject:()=>aGr,startsWith:()=>aTe,slugify:()=>fTe,size:()=>Nee,setErrorMap:()=>GQo,set:()=>fGr,safeParseAsync:()=>uWr,safeParse:()=>cWr,safeEncodeAsync:()=>gWr,safeEncode:()=>mWr,safeDecodeAsync:()=>yWr,safeDecode:()=>hWr,registry:()=>tvt,regexes:()=>iO,regex:()=>rTe,refine:()=>kxt,record:()=>Xvt,readonly:()=>vxt,property:()=>Ivt,promise:()=>SGr,prettifyError:()=>uZr,preprocess:()=>AGr,prefault:()=>lxt,positive:()=>wvt,pipe:()=>JIe,partialRecord:()=>lGr,parseAsync:()=>sWr,parse:()=>aWr,overwrite:()=>L1,optional:()=>See,object:()=>iGr,number:()=>Nvt,nullish:()=>yGr,nullable:()=>kee,null:()=>Uvt,normalize:()=>uTe,nonpositive:()=>kvt,nonoptional:()=>dxt,nonnegative:()=>Evt,never:()=>PTe,negative:()=>Svt,nativeEnum:()=>mGr,nanoid:()=>TWr,nan:()=>xGr,multipleOf:()=>i5,minSize:()=>cO,minLength:()=>eN,mime:()=>cTe,meta:()=>TGr,maxSize:()=>p5,maxLength:()=>Mee,map:()=>pGr,mac:()=>RWr,lte:()=>Gx,lt:()=>aO,lowercase:()=>nTe,looseRecord:()=>dGr,looseObject:()=>sGr,locales:()=>evt,literal:()=>hGr,length:()=>zee,lazy:()=>_xt,ksuid:()=>PWr,keyof:()=>oGr,jwt:()=>FWr,json:()=>OGr,iso:()=>$vt,ipv6:()=>NWr,ipv4:()=>DWr,invertCodec:()=>_Gr,intersection:()=>Jvt,int64:()=>YWr,int32:()=>GWr,int:()=>GIe,instanceof:()=>CGr,includes:()=>iTe,httpUrl:()=>EWr,hostname:()=>BWr,hex:()=>ZWr,hash:()=>VWr,guid:()=>xWr,gte:()=>ng,gt:()=>sO,globalRegistry:()=>Wx,getErrorMap:()=>JQo,function:()=>KIe,fromJSONSchema:()=>QQo,formatError:()=>Dyt,float64:()=>WWr,float32:()=>HWr,flattenError:()=>Pyt,file:()=>gGr,exactOptional:()=>ixt,enum:()=>NTe,endsWith:()=>sTe,encodeAsync:()=>pWr,encode:()=>lWr,emoji:()=>IWr,email:()=>vWr,e164:()=>UWr,discriminatedUnion:()=>uGr,describe:()=>IGr,decodeAsync:()=>fWr,decode:()=>dWr,date:()=>nGr,custom:()=>EGr,cuid2:()=>$Wr,cuid:()=>CWr,core:()=>HBr,config:()=>yp,coerce:()=>DGr,codec:()=>bGr,clone:()=>Jx,cidrv6:()=>zWr,cidrv4:()=>MWr,check:()=>kGr,catch:()=>mxt,boolean:()=>Mvt,bigint:()=>KWr,base64url:()=>jWr,base64:()=>LWr,array:()=>Vee,any:()=>tGr,_function:()=>KIe,_default:()=>cxt,_ZodString:()=>mTe,ZodXor:()=>Hvt,ZodXID:()=>_Te,ZodVoid:()=>Zvt,ZodUnknown:()=>qvt,ZodUnion:()=>Wee,ZodUndefined:()=>Lvt,ZodUUID:()=>ES,ZodURL:()=>Fee,ZodULID:()=>bTe,ZodType:()=>so,ZodTuple:()=>Kvt,ZodTransform:()=>nxt,ZodTemplateLiteral:()=>xxt,ZodSymbol:()=>zvt,ZodSuccess:()=>pxt,ZodStringFormat:()=>$s,ZodString:()=>Uee,ZodSet:()=>ext,ZodRecord:()=>u5,ZodRealError:()=>Zy,ZodReadonly:()=>yxt,ZodPromise:()=>wxt,ZodPreprocess:()=>gxt,ZodPrefault:()=>uxt,ZodPipe:()=>Gee,ZodOptional:()=>zTe,ZodObject:()=>Hee,ZodNumberFormat:()=>oN,ZodNumber:()=>qee,ZodNullable:()=>axt,ZodNull:()=>jvt,ZodNonOptional:()=>LTe,ZodNever:()=>Bvt,ZodNanoID:()=>yTe,ZodNaN:()=>hxt,ZodMap:()=>Qvt,ZodMAC:()=>Rvt,ZodLiteral:()=>txt,ZodLazy:()=>bxt,ZodKSUID:()=>wTe,ZodJWT:()=>OTe,ZodIssueCode:()=>WQo,ZodIntersection:()=>Gvt,ZodISOTime:()=>Pvt,ZodISODuration:()=>Dvt,ZodISODateTime:()=>Ovt,ZodISODate:()=>Avt,ZodIPv6:()=>kTe,ZodIPv4:()=>STe,ZodGUID:()=>wee,ZodFunction:()=>Sxt,ZodFirstPartyTypeKind:()=>Tyt,ZodFile:()=>rxt,ZodExactOptional:()=>oxt,ZodError:()=>HQo,ZodEnum:()=>l5,ZodEmoji:()=>gTe,ZodEmail:()=>hTe,ZodE164:()=>$Te,ZodDiscriminatedUnion:()=>Wvt,ZodDefault:()=>sxt,ZodDate:()=>DTe,ZodCustomStringFormat:()=>f5,ZodCustom:()=>Kee,ZodCodec:()=>Jee,ZodCatch:()=>fxt,ZodCUID2:()=>xTe,ZodCUID:()=>vTe,ZodCIDRv6:()=>ITe,ZodCIDRv4:()=>ETe,ZodBoolean:()=>Bee,ZodBigIntFormat:()=>ATe,ZodBigInt:()=>Zee,ZodBase64URL:()=>CTe,ZodBase64:()=>TTe,ZodArray:()=>Vvt,ZodAny:()=>Fvt,TimePrecision:()=>A7r,NEVER:()=>WBr,$output:()=>I7r,$input:()=>T7r,$brand:()=>GBr});var HBr={};IS(HBr,{version:()=>uVr,util:()=>Yo,treeifyError:()=>sZr,toJSONSchema:()=>XHr,toDotPath:()=>cZr,safeParseAsync:()=>dZr,safeParse:()=>lZr,safeEncodeAsync:()=>tYo,safeEncode:()=>QKo,safeDecodeAsync:()=>rYo,safeDecode:()=>eYo,registry:()=>tvt,regexes:()=>iO,process:()=>ms,prettifyError:()=>uZr,parseAsync:()=>Syt,parse:()=>wyt,meta:()=>pHr,locales:()=>evt,isValidJWT:()=>RVr,isValidBase64URL:()=>AVr,isValidBase64:()=>Hyt,initializeContext:()=>a5,globalRegistry:()=>Wx,globalConfig:()=>xee,formatError:()=>Dyt,flattenError:()=>Pyt,finalize:()=>c5,extractDefs:()=>s5,encodeAsync:()=>YKo,encode:()=>JKo,describe:()=>dHr,decodeAsync:()=>XKo,decode:()=>KKo,createToJSONSchemaMethod:()=>mHr,createStandardJSONSchemaMethod:()=>bee,config:()=>yp,clone:()=>Jx,_xor:()=>wQo,_xid:()=>pvt,_void:()=>tHr,_uuidv7:()=>avt,_uuidv6:()=>ivt,_uuidv4:()=>ovt,_uuid:()=>nvt,_url:()=>tTe,_uppercase:()=>oTe,_unknown:()=>Q7r,_union:()=>_Qo,_undefined:()=>K7r,_ulid:()=>dvt,_uint64:()=>G7r,_uint32:()=>q7r,_tuple:()=>EQo,_trim:()=>lTe,_transform:()=>PQo,_toUpperCase:()=>pTe,_toLowerCase:()=>dTe,_templateLiteral:()=>FQo,_symbol:()=>J7r,_superRefine:()=>uHr,_success:()=>zQo,_stringbool:()=>fHr,_stringFormat:()=>Lee,_string:()=>C7r,_startsWith:()=>aTe,_slugify:()=>fTe,_size:()=>Nee,_set:()=>CQo,_safeParseAsync:()=>Oee,_safeParse:()=>$ee,_safeEncodeAsync:()=>Uyt,_safeEncode:()=>Lyt,_safeDecodeAsync:()=>Fyt,_safeDecode:()=>jyt,_regex:()=>rTe,_refine:()=>cHr,_record:()=>IQo,_readonly:()=>UQo,_property:()=>Ivt,_promise:()=>BQo,_positive:()=>wvt,_pipe:()=>jQo,_parseAsync:()=>Cee,_parse:()=>Tee,_overwrite:()=>L1,_optional:()=>DQo,_number:()=>M7r,_nullable:()=>RQo,_null:()=>Y7r,_normalize:()=>uTe,_nonpositive:()=>kvt,_nonoptional:()=>MQo,_nonnegative:()=>Evt,_never:()=>eHr,_negative:()=>Svt,_nativeEnum:()=>OQo,_nanoid:()=>cvt,_nan:()=>oHr,_multipleOf:()=>i5,_minSize:()=>cO,_minLength:()=>eN,_min:()=>ng,_mime:()=>cTe,_maxSize:()=>p5,_maxLength:()=>Mee,_max:()=>Gx,_map:()=>TQo,_mac:()=>O7r,_lte:()=>Gx,_lt:()=>aO,_lowercase:()=>nTe,_literal:()=>AQo,_length:()=>zee,_lazy:()=>qQo,_ksuid:()=>fvt,_jwt:()=>_vt,_isoTime:()=>R7r,_isoDuration:()=>N7r,_isoDateTime:()=>P7r,_isoDate:()=>D7r,_ipv6:()=>hvt,_ipv4:()=>mvt,_intersection:()=>kQo,_int64:()=>W7r,_int32:()=>F7r,_int:()=>L7r,_includes:()=>iTe,_guid:()=>WIe,_gte:()=>ng,_gt:()=>sO,_float64:()=>U7r,_float32:()=>j7r,_file:()=>aHr,_enum:()=>$Qo,_endsWith:()=>sTe,_encodeAsync:()=>Myt,_encode:()=>Ryt,_emoji:()=>svt,_email:()=>rvt,_e164:()=>bvt,_discriminatedUnion:()=>SQo,_default:()=>NQo,_decodeAsync:()=>zyt,_decode:()=>Nyt,_date:()=>rHr,_custom:()=>sHr,_cuid2:()=>lvt,_cuid:()=>uvt,_coercedString:()=>$7r,_coercedNumber:()=>z7r,_coercedDate:()=>nHr,_coercedBoolean:()=>Z7r,_coercedBigint:()=>H7r,_cidrv6:()=>yvt,_cidrv4:()=>gvt,_check:()=>lHr,_catch:()=>LQo,_boolean:()=>B7r,_bigint:()=>V7r,_base64url:()=>xvt,_base64:()=>vvt,_array:()=>iHr,_any:()=>X7r,TimePrecision:()=>A7r,NEVER:()=>WBr,JSONSchemaGenerator:()=>Iyt,JSONSchema:()=>VQo,Doc:()=>ZIe,$output:()=>I7r,$input:()=>T7r,$constructor:()=>me,$brand:()=>GBr,$ZodXor:()=>XVr,$ZodXID:()=>xVr,$ZodVoid:()=>VVr,$ZodUnknown:()=>BVr,$ZodUnion:()=>eTe,$ZodUndefined:()=>UVr,$ZodUUID:()=>dVr,$ZodURL:()=>fVr,$ZodULID:()=>vVr,$ZodType:()=>Hn,$ZodTuple:()=>Kyt,$ZodTransform:()=>s7r,$ZodTemplateLiteral:()=>v7r,$ZodSymbol:()=>jVr,$ZodSuccess:()=>f7r,$ZodStringFormat:()=>Cs,$ZodString:()=>Ree,$ZodSet:()=>n7r,$ZodRegistry:()=>HIe,$ZodRecord:()=>t7r,$ZodRealError:()=>By,$ZodReadonly:()=>y7r,$ZodPromise:()=>b7r,$ZodPreprocess:()=>g7r,$ZodPrefault:()=>d7r,$ZodPipe:()=>Xyt,$ZodOptional:()=>Yyt,$ZodObjectJIT:()=>YVr,$ZodObject:()=>KVr,$ZodNumberFormat:()=>zVr,$ZodNumber:()=>Wyt,$ZodNullable:()=>u7r,$ZodNull:()=>FVr,$ZodNonOptional:()=>p7r,$ZodNever:()=>ZVr,$ZodNanoID:()=>hVr,$ZodNaN:()=>h7r,$ZodMap:()=>r7r,$ZodMAC:()=>TVr,$ZodLiteral:()=>i7r,$ZodLazy:()=>_7r,$ZodKSUID:()=>bVr,$ZodJWT:()=>NVr,$ZodIntersection:()=>e7r,$ZodISOTime:()=>SVr,$ZodISODuration:()=>kVr,$ZodISODateTime:()=>_Vr,$ZodISODate:()=>wVr,$ZodIPv6:()=>IVr,$ZodIPv4:()=>EVr,$ZodGUID:()=>lVr,$ZodFunction:()=>x7r,$ZodFile:()=>a7r,$ZodExactOptional:()=>c7r,$ZodError:()=>Ayt,$ZodEnum:()=>o7r,$ZodEncodeError:()=>r5,$ZodEmoji:()=>mVr,$ZodEmail:()=>pVr,$ZodE164:()=>DVr,$ZodDiscriminatedUnion:()=>QVr,$ZodDefault:()=>l7r,$ZodDate:()=>HVr,$ZodCustomStringFormat:()=>MVr,$ZodCustom:()=>w7r,$ZodCodec:()=>Qyt,$ZodCheckUpperCase:()=>rVr,$ZodCheckStringFormat:()=>Dee,$ZodCheckStartsWith:()=>oVr,$ZodCheckSizeEquals:()=>KZr,$ZodCheckRegex:()=>eVr,$ZodCheckProperty:()=>aVr,$ZodCheckOverwrite:()=>cVr,$ZodCheckNumberFormat:()=>HZr,$ZodCheckMultipleOf:()=>VZr,$ZodCheckMinSize:()=>JZr,$ZodCheckMinLength:()=>XZr,$ZodCheckMimeType:()=>sVr,$ZodCheckMaxSize:()=>GZr,$ZodCheckMaxLength:()=>YZr,$ZodCheckLowerCase:()=>tVr,$ZodCheckLessThan:()=>Zyt,$ZodCheckLengthEquals:()=>QZr,$ZodCheckIncludes:()=>nVr,$ZodCheckGreaterThan:()=>Vyt,$ZodCheckEndsWith:()=>iVr,$ZodCheckBigIntFormat:()=>WZr,$ZodCheck:()=>Pc,$ZodCatch:()=>m7r,$ZodCUID2:()=>yVr,$ZodCUID:()=>gVr,$ZodCIDRv6:()=>$Vr,$ZodCIDRv4:()=>CVr,$ZodBoolean:()=>Gyt,$ZodBigIntFormat:()=>LVr,$ZodBigInt:()=>Jyt,$ZodBase64URL:()=>PVr,$ZodBase64:()=>OVr,$ZodAsyncError:()=>N1,$ZodArray:()=>WVr,$ZodAny:()=>qVr});var bBr,WBr=Object.freeze({status:"aborted"});function me(e,t,r){function o(s,c){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:c,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,c);let u=a.prototype,l=Object.keys(u);for(let d=0;d<l.length;d++){let f=l[d];f in s||(s[f]=u[f].bind(s))}}let n=r?.Parent??Object;class i extends n{}Object.defineProperty(i,"name",{value:e});function a(s){var c;let u=r?.Parent?new i:this;o(u,s),(c=u._zod).deferred??(c.deferred=[]);for(let l of u._zod.deferred)l();return u}return Object.defineProperty(a,"init",{value:o}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}var GBr=Symbol("zod_brand"),N1=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},r5=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(bBr=globalThis).__zod_globalConfig??(bBr.__zod_globalConfig={});var xee=globalThis.__zod_globalConfig;function yp(e){return e&&Object.assign(xee,e),xee}var Yo={};IS(Yo,{unwrapMessage:()=>vee,uint8ArrayToHex:()=>GKo,uint8ArrayToBase64url:()=>HKo,uint8ArrayToBase64:()=>iZr,stringifyPrimitive:()=>Wr,slugify:()=>KBr,shallowClone:()=>XBr,safeExtend:()=>UKo,required:()=>BKo,randomString:()=>DKo,propertyKeyTypes:()=>qIe,promiseAllObject:()=>PKo,primitiveTypes:()=>QBr,prefixIssues:()=>Hx,pick:()=>zKo,partial:()=>qKo,parsedType:()=>rn,optionalKeys:()=>eZr,omit:()=>LKo,objectClone:()=>$Ko,numKeys:()=>RKo,nullish:()=>nN,normalizeParams:()=>mt,mergeDefs:()=>z1,merge:()=>FKo,jsonStringifyReplacer:()=>FIe,joinValues:()=>tt,issue:()=>BIe,isPlainObject:()=>QR,isObject:()=>n5,hexToUint8Array:()=>WKo,getSizableOrigin:()=>XIe,getParsedType:()=>NKo,getLengthableOrigin:()=>QIe,getEnumValues:()=>$yt,getElementAtPath:()=>AKo,floatSafeRemainder:()=>JBr,finalizeIssue:()=>qy,extend:()=>jKo,explicitlyAborted:()=>nZr,escapeRegex:()=>M1,esc:()=>byt,defineLazy:()=>Xo,createTransparentProxy:()=>MKo,cloneDef:()=>OKo,clone:()=>Jx,cleanRegex:()=>YIe,cleanEnum:()=>ZKo,captureStackTrace:()=>Oyt,cached:()=>Iee,base64urlToUint8Array:()=>VKo,base64ToUint8Array:()=>oZr,assignProp:()=>uO,assertNotEqual:()=>EKo,assertNever:()=>TKo,assertIs:()=>IKo,assertEqual:()=>kKo,assert:()=>CKo,allowsEval:()=>YBr,aborted:()=>XR,NUMBER_FORMAT_RANGES:()=>tZr,Class:()=>_yt,BIGINT_FORMAT_RANGES:()=>rZr});function kKo(e){return e}function EKo(e){return e}function IKo(e){}function TKo(e){throw new Error("Unexpected value in exhaustive check")}function CKo(e){}function $yt(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function tt(e,t="|"){return e.map(r=>Wr(r)).join(t)}function FIe(e,t){return typeof t=="bigint"?t.toString():t}function Iee(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function nN(e){return e==null}function YIe(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function JBr(e,t){let r=e/t,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}var _Br=Symbol("evaluating");function Xo(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==_Br)return o===void 0&&(o=_Br,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function $Ko(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function uO(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function z1(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function OKo(e){return z1(e._zod.def)}function AKo(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function PKo(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let i=0;i<t.length;i++)n[t[i]]=o[i];return n})}function DKo(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function byt(e){return JSON.stringify(e)}function KBr(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Oyt="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function n5(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var YBr=Iee(()=>{if(xee.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function QR(e){if(n5(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(n5(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function XBr(e){return QR(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function RKo(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var NKo=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}`)}},qIe=new Set(["string","number","symbol"]),QBr=new Set(["string","number","bigint","boolean","symbol","undefined"]);function M1(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Jx(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function mt(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 MKo(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,i){return t??(t=e()),Reflect.set(t,o,n,i)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function Wr(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function eZr(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var tZr={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]},rZr={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function zKo(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i=z1(e._zod.def,{get shape(){let a={};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(a[s]=r.shape[s])}return uO(this,"shape",a),a},checks:[]});return Jx(e,i)}function LKo(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=z1(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete a[s]}return uO(this,"shape",a),a},checks:[]});return Jx(e,i)}function jKo(e,t){if(!QR(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let i=e._zod.def.shape;for(let a in t)if(Object.getOwnPropertyDescriptor(i,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=z1(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return uO(this,"shape",i),i}});return Jx(e,n)}function UKo(e,t){if(!QR(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=z1(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return uO(this,"shape",o),o}});return Jx(e,r)}function FKo(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=z1(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return uO(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Jx(e,r)}function qKo(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=z1(t._zod.def,{get shape(){let s=t._zod.def.shape,c={...s};if(r)for(let u in r){if(!(u in s))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(c[u]=e?new e({type:"optional",innerType:s[u]}):s[u])}else for(let u in s)c[u]=e?new e({type:"optional",innerType:s[u]}):s[u];return uO(this,"shape",c),c},checks:[]});return Jx(t,a)}function BKo(e,t,r){let o=z1(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let a in r){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(i[a]=new e({type:"nonoptional",innerType:n[a]}))}else for(let a in n)i[a]=new e({type:"nonoptional",innerType:n[a]});return uO(this,"shape",i),i}});return Jx(t,o)}function XR(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function nZr(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function Hx(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function vee(e){return typeof e=="string"?e:e?.message}function qy(e,t,r){let o=e.message?e.message:vee(e.inst?._zod.def?.error?.(e))??vee(t?.error?.(e))??vee(r.customError?.(e))??vee(r.localeError?.(e))??"Invalid input",{inst:n,continue:i,input:a,...s}=e;return s.path??(s.path=[]),s.message=o,t?.reportInput&&(s.input=a),s}function XIe(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function QIe(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function rn(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function BIe(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function ZKo(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function oZr(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function iZr(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function VKo(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return oZr(t+r)}function HKo(e){return iZr(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function WKo(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function GKo(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var _yt=class{constructor(...t){}},aZr=(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,FIe,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ayt=me("$ZodError",aZr),By=me("$ZodError",aZr,{Parent:Error});function Pyt(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):o.push(t(n));return{formErrors:o,fieldErrors:r}}function Dyt(e,t=r=>r.message){let r={_errors:[]},o=(n,i=[])=>{for(let a of n.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>o({issues:s},[...i,...a.path]));else if(a.code==="invalid_key")o({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")o({issues:a.issues},[...i,...a.path]);else{let s=[...i,...a.path];if(s.length===0)r._errors.push(t(a));else{let c=r,u=0;for(;u<s.length;){let l=s[u];u===s.length-1?(c[l]=c[l]||{_errors:[]},c[l]._errors.push(t(a))):c[l]=c[l]||{_errors:[]},c=c[l],u++}}}};return o(e),r}function sZr(e,t=r=>r.message){let r={errors:[]},o=(n,i=[])=>{var a,s;for(let c of n.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(u=>o({issues:u},[...i,...c.path]));else if(c.code==="invalid_key")o({issues:c.issues},[...i,...c.path]);else if(c.code==="invalid_element")o({issues:c.issues},[...i,...c.path]);else{let u=[...i,...c.path];if(u.length===0){r.errors.push(t(c));continue}let l=r,d=0;for(;d<u.length;){let f=u[d],p=d===u.length-1;typeof f=="string"?(l.properties??(l.properties={}),(a=l.properties)[f]??(a[f]={errors:[]}),l=l.properties[f]):(l.items??(l.items=[]),(s=l.items)[f]??(s[f]={errors:[]}),l=l.items[f]),p&&l.errors.push(t(c)),d++}}};return o(e),r}function cZr(e){let t=[],r=e.map(o=>typeof o=="object"?o.key:o);for(let o of r)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 uZr(e){let t=[],r=[...e.issues].sort((o,n)=>(o.path??[]).length-(n.path??[]).length);for(let o of r)t.push(`\u2716 ${o.message}`),o.path?.length&&t.push(` \u2192 at ${cZr(o.path)}`);return t.join(`
|
|
644
644
|
`)}var Tee=e=>(t,r,o,n)=>{let i=o?{...o,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new N1;if(a.issues.length){let s=new(n?.Err??e)(a.issues.map(c=>qy(c,i,yp())));throw Oyt(s,n?.callee),s}return a.value},wyt=Tee(By),Cee=e=>async(t,r,o,n)=>{let i=o?{...o,async:!0}:{async:!0},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){let s=new(n?.Err??e)(a.issues.map(c=>qy(c,i,yp())));throw Oyt(s,n?.callee),s}return a.value},Syt=Cee(By),$ee=e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)throw new N1;return i.issues.length?{success:!1,error:new(e??Ayt)(i.issues.map(a=>qy(a,n,yp())))}:{success:!0,data:i.value}},lZr=$ee(By),Oee=e=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},n);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(a=>qy(a,n,yp())))}:{success:!0,data:i.value}},dZr=Oee(By),Ryt=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Tee(e)(t,r,n)},JKo=Ryt(By),Nyt=e=>(t,r,o)=>Tee(e)(t,r,o),KKo=Nyt(By),Myt=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Cee(e)(t,r,n)},YKo=Myt(By),zyt=e=>async(t,r,o)=>Cee(e)(t,r,o),XKo=zyt(By),Lyt=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return $ee(e)(t,r,n)},QKo=Lyt(By),jyt=e=>(t,r,o)=>$ee(e)(t,r,o),eYo=jyt(By),Uyt=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Oee(e)(t,r,n)},tYo=Uyt(By),Fyt=e=>async(t,r,o)=>Oee(e)(t,r,o),rYo=Fyt(By),iO={};IS(iO,{xid:()=>hZr,uuid7:()=>aYo,uuid6:()=>iYo,uuid4:()=>oYo,uuid:()=>o5,uppercase:()=>BZr,unicodeEmail:()=>_Zr,undefined:()=>FZr,ulid:()=>mZr,time:()=>RZr,string:()=>MZr,sha512_hex:()=>TYo,sha512_base64url:()=>$Yo,sha512_base64:()=>CYo,sha384_hex:()=>kYo,sha384_base64url:()=>IYo,sha384_base64:()=>EYo,sha256_hex:()=>_Yo,sha256_base64url:()=>SYo,sha256_base64:()=>wYo,sha1_hex:()=>vYo,sha1_base64url:()=>bYo,sha1_base64:()=>xYo,rfc5322Email:()=>cYo,number:()=>Byt,null:()=>UZr,nanoid:()=>yZr,md5_hex:()=>hYo,md5_base64url:()=>yYo,md5_base64:()=>gYo,mac:()=>EZr,lowercase:()=>qZr,ksuid:()=>gZr,ipv6:()=>kZr,ipv4:()=>SZr,integer:()=>LZr,idnEmail:()=>uYo,httpProtocol:()=>$Zr,html5Email:()=>sYo,hostname:()=>pYo,hex:()=>mYo,guid:()=>xZr,extendedDuration:()=>nYo,emoji:()=>wZr,email:()=>bZr,e164:()=>OZr,duration:()=>vZr,domain:()=>fYo,datetime:()=>NZr,date:()=>PZr,cuid2:()=>fZr,cuid:()=>pZr,cidrv6:()=>TZr,cidrv4:()=>IZr,browserEmail:()=>lYo,boolean:()=>jZr,bigint:()=>zZr,base64url:()=>qyt,base64:()=>CZr});var pZr=/^[cC][0-9a-z]{6,}$/,fZr=/^[0-9a-z]+$/,mZr=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,hZr=/^[0-9a-vA-V]{20}$/,gZr=/^[A-Za-z0-9]{27}$/,yZr=/^[a-zA-Z0-9_-]{21}$/,vZr=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,nYo=/^[-+]?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)?)??$/,xZr=/^([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})$/,o5=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)$/,oYo=o5(4),iYo=o5(6),aYo=o5(7),bZr=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,sYo=/^[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])?)*$/,cYo=/^(([^<>()\[\]\\.,;:\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,}))$/,_Zr=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,uYo=_Zr,lYo=/^[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])?)*$/,dYo="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function wZr(){return new RegExp(dYo,"u")}var SZr=/^(?:(?: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])$/,kZr=/^(([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}|:))$/,EZr=e=>{let t=M1(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},IZr=/^((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])$/,TZr=/^(([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])$/,CZr=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,qyt=/^[A-Za-z0-9_-]*$/,pYo=/^(?=.{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])?)*\.?$/,fYo=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,$Zr=/^https?$/,OZr=/^\+[1-9]\d{6,14}$/,AZr="(?:(?:\\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])))",PZr=new RegExp(`^${AZr}$`);function DZr(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 RZr(e){return new RegExp(`^${DZr(e)}$`)}function NZr(e){let t=DZr({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${r.join("|")})`;return new RegExp(`^${AZr}T(?:${o})$`)}var MZr=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},zZr=/^-?\d+n?$/,LZr=/^-?\d+$/,Byt=/^-?\d+(?:\.\d+)?$/,jZr=/^(?:true|false)$/i,UZr=/^null$/i,FZr=/^undefined$/i,qZr=/^[^A-Z]*$/,BZr=/^[^a-z]*$/,mYo=/^[0-9a-fA-F]*$/;function Aee(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Pee(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var hYo=/^[0-9a-fA-F]{32}$/,gYo=Aee(22,"=="),yYo=Pee(22),vYo=/^[0-9a-fA-F]{40}$/,xYo=Aee(27,"="),bYo=Pee(27),_Yo=/^[0-9a-fA-F]{64}$/,wYo=Aee(43,"="),SYo=Pee(43),kYo=/^[0-9a-fA-F]{96}$/,EYo=Aee(64,""),IYo=Pee(64),TYo=/^[0-9a-fA-F]{128}$/,CYo=Aee(86,"=="),$Yo=Pee(86),Pc=me("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),ZZr={number:"number",bigint:"bigint",object:"date"},Zyt=me("$ZodCheckLessThan",(e,t)=>{Pc.init(e,t);let r=ZZr[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Vyt=me("$ZodCheckGreaterThan",(e,t)=>{Pc.init(e,t);let r=ZZr[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),VZr=me("$ZodCheckMultipleOf",(e,t)=>{Pc.init(e,t),e._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):JBr(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),HZr=me("$ZodCheckNumberFormat",(e,t)=>{Pc.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,i]=tZr[t.format];e._zod.onattach.push(a=>{let s=a._zod.bag;s.format=t.format,s.minimum=n,s.maximum=i,r&&(s.pattern=LZr)}),e._zod.check=a=>{let s=a.value;if(r){if(!Number.isInteger(s)){a.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}s<n&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),s>i&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),WZr=me("$ZodCheckBigIntFormat",(e,t)=>{Pc.init(e,t);let[r,o]=rZr[t.format];e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,i.minimum=r,i.maximum=o}),e._zod.check=n=>{let i=n.value;i<r&&n.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),i>o&&n.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),GZr=me("$ZodCheckMaxSize",(e,t)=>{var r;Pc.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!nN(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;n.size<=t.maximum||o.issues.push({origin:XIe(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),JZr=me("$ZodCheckMinSize",(e,t)=>{var r;Pc.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!nN(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;n.size>=t.minimum||o.issues.push({origin:XIe(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),KZr=me("$ZodCheckSizeEquals",(e,t)=>{var r;Pc.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!nN(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=o=>{let n=o.value,i=n.size;if(i===t.size)return;let a=i>t.size;o.issues.push({origin:XIe(n),...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})}}),YZr=me("$ZodCheckMaxLength",(e,t)=>{var r;Pc.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!nN(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;if(n.length<=t.maximum)return;let a=QIe(n);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),XZr=me("$ZodCheckMinLength",(e,t)=>{var r;Pc.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!nN(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;if(n.length>=t.minimum)return;let a=QIe(n);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),QZr=me("$ZodCheckLengthEquals",(e,t)=>{var r;Pc.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!nN(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=o=>{let n=o.value,i=n.length;if(i===t.length)return;let a=QIe(n),s=i>t.length;o.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Dee=me("$ZodCheckStringFormat",(e,t)=>{var r,o;Pc.init(e,t),e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),eVr=me("$ZodCheckRegex",(e,t)=>{Dee.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),tVr=me("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=qZr),Dee.init(e,t)}),rVr=me("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=BZr),Dee.init(e,t)}),nVr=me("$ZodCheckIncludes",(e,t)=>{Pc.init(e,t);let r=M1(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),oVr=me("$ZodCheckStartsWith",(e,t)=>{Pc.init(e,t);let r=new RegExp(`^${M1(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),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})}}),iVr=me("$ZodCheckEndsWith",(e,t)=>{Pc.init(e,t);let r=new RegExp(`.*${M1(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),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 wBr(e,t,r){e.issues.length&&t.issues.push(...Hx(r,e.issues))}var aVr=me("$ZodCheckProperty",(e,t)=>{Pc.init(e,t),e._zod.check=r=>{let o=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then(n=>wBr(n,r,t.property));wBr(o,r,t.property)}}),sVr=me("$ZodCheckMimeType",(e,t)=>{Pc.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=t.mime}),e._zod.check=o=>{r.has(o.value.type)||o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),cVr=me("$ZodCheckOverwrite",(e,t)=>{Pc.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}}),ZIe=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(`
|
|
645
645
|
`).filter(a=>a),n=Math.min(...o.map(a=>a.length-a.trimStart().length)),i=o.map(a=>a.slice(n)).map(a=>" ".repeat(this.indent*2)+a);for(let a of i)this.content.push(a)}compile(){let t=Function,r=this?.args,n=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...r,n.join(`
|
|
646
646
|
`))}},uVr={major:4,minor:4,patch:3},Hn=me("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=uVr;let o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let n of o)for(let i of n._zod.onattach)i(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(a,s,c)=>{let u=XR(a),l;for(let d of s){if(d._zod.def.when){if(nZr(a)||!d._zod.def.when(a))continue}else if(u)continue;let f=a.issues.length,p=d._zod.check(a);if(p instanceof Promise&&c?.async===!1)throw new N1;if(l||p instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await p,a.issues.length!==f&&(u||(u=XR(a,f)))});else{if(a.issues.length===f)continue;u||(u=XR(a,f))}}return l?l.then(()=>a):a},i=(a,s,c)=>{if(XR(a))return a.aborted=!0,a;let u=n(s,o,c);if(u instanceof Promise){if(c.async===!1)throw new N1;return u.then(l=>e._zod.parse(l,c))}return e._zod.parse(u,c)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if(s.direction==="backward"){let u=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return u instanceof Promise?u.then(l=>i(l,a,s)):i(u,a,s)}let c=e._zod.parse(a,s);if(c instanceof Promise){if(s.async===!1)throw new N1;return c.then(u=>n(u,o,s))}return n(c,o,s)}}Xo(e,"~standard",()=>({validate:n=>{try{let i=lZr(e,n);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return dZr(e,n).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),Ree=me("$ZodString",(e,t)=>{Hn.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??MZr(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Cs=me("$ZodStringFormat",(e,t)=>{Dee.init(e,t),Ree.init(e,t)}),lVr=me("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=xZr),Cs.init(e,t)}),dVr=me("$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=o5(o))}else t.pattern??(t.pattern=o5());Cs.init(e,t)}),pVr=me("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=bZr),Cs.init(e,t)}),fVr=me("$ZodURL",(e,t)=>{Cs.init(e,t),e._zod.check=r=>{try{let o=r.value.trim();if(!t.normalize&&t.protocol?.source===$Zr.source&&!/^https?:\/\//i.test(o)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}let n=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=n.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),mVr=me("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=wZr()),Cs.init(e,t)}),hVr=me("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=yZr),Cs.init(e,t)}),gVr=me("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=pZr),Cs.init(e,t)}),yVr=me("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=fZr),Cs.init(e,t)}),vVr=me("$ZodULID",(e,t)=>{t.pattern??(t.pattern=mZr),Cs.init(e,t)}),xVr=me("$ZodXID",(e,t)=>{t.pattern??(t.pattern=hZr),Cs.init(e,t)}),bVr=me("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=gZr),Cs.init(e,t)}),_Vr=me("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=NZr(t)),Cs.init(e,t)}),wVr=me("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=PZr),Cs.init(e,t)}),SVr=me("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=RZr(t)),Cs.init(e,t)}),kVr=me("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=vZr),Cs.init(e,t)}),EVr=me("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=SZr),Cs.init(e,t),e._zod.bag.format="ipv4"}),IVr=me("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=kZr),Cs.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),TVr=me("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=EZr(t.delimiter)),Cs.init(e,t),e._zod.bag.format="mac"}),CVr=me("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=IZr),Cs.init(e,t)}),$Vr=me("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=TZr),Cs.init(e,t),e._zod.check=r=>{let o=r.value.split("/");try{if(o.length!==2)throw new Error;let[n,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://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Hyt(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var OVr=me("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=CZr),Cs.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Hyt(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function AVr(e){if(!qyt.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Hyt(r)}var PVr=me("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=qyt),Cs.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{AVr(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),DVr=me("$ZodE164",(e,t)=>{t.pattern??(t.pattern=OZr),Cs.init(e,t)});function RVr(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}var NVr=me("$ZodJWT",(e,t)=>{Cs.init(e,t),e._zod.check=r=>{RVr(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),MVr=me("$ZodCustomStringFormat",(e,t)=>{Cs.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),Wyt=me("$ZodNumber",(e,t)=>{Hn.init(e,t),e._zod.pattern=e._zod.bag.pattern??Byt,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let i=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...i?{received:i}:{}}),r}}),zVr=me("$ZodNumberFormat",(e,t)=>{HZr.init(e,t),Wyt.init(e,t)}),Gyt=me("$ZodBoolean",(e,t)=>{Hn.init(e,t),e._zod.pattern=jZr,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),Jyt=me("$ZodBigInt",(e,t)=>{Hn.init(e,t),e._zod.pattern=zZr,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),LVr=me("$ZodBigIntFormat",(e,t)=>{WZr.init(e,t),Jyt.init(e,t)}),jVr=me("$ZodSymbol",(e,t)=>{Hn.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),r}}),UVr=me("$ZodUndefined",(e,t)=>{Hn.init(e,t),e._zod.pattern=FZr,e._zod.values=new Set([void 0]),e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),r}}),FVr=me("$ZodNull",(e,t)=>{Hn.init(e,t),e._zod.pattern=UZr,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),qVr=me("$ZodAny",(e,t)=>{Hn.init(e,t),e._zod.parse=r=>r}),BVr=me("$ZodUnknown",(e,t)=>{Hn.init(e,t),e._zod.parse=r=>r}),ZVr=me("$ZodNever",(e,t)=>{Hn.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),VVr=me("$ZodVoid",(e,t)=>{Hn.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),r}}),HVr=me("$ZodDate",(e,t)=>{Hn.init(e,t),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,i=n instanceof Date;return i&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...i?{received:"Invalid Date"}:{},inst:e}),r}});function SBr(e,t,r){e.issues.length&&t.issues.push(...Hx(r,e.issues)),t.value[r]=e.value}var WVr=me("$ZodArray",(e,t)=>{Hn.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);let i=[];for(let a=0;a<n.length;a++){let s=n[a],c=t.element._zod.run({value:s,issues:[]},o);c instanceof Promise?i.push(c.then(u=>SBr(u,r,a))):SBr(c,r,a)}return i.length?Promise.all(i).then(()=>r):r}});function VIe(e,t,r,o,n,i){let a=r in o;if(e.issues.length){if(n&&i&&!a)return;t.issues.push(...Hx(r,e.issues))}if(!a&&!n){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?a&&(t.value[r]=void 0):t.value[r]=e.value}function GVr(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 r=eZr(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function JVr(e,t,r,o,n,i){let a=[],s=n.keySet,c=n.catchall._zod,u=c.def.type,l=c.optin==="optional",d=c.optout==="optional";for(let f in t){if(f==="__proto__"||s.has(f))continue;if(u==="never"){a.push(f);continue}let p=c.run({value:t[f],issues:[]},o);p instanceof Promise?e.push(p.then(h=>VIe(h,r,f,t,l,d))):VIe(p,r,f,t,l,d)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i}),e.length?Promise.all(e).then(()=>r):r}var KVr=me("$ZodObject",(e,t)=>{if(Hn.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let s=t.shape;Object.defineProperty(t,"shape",{get:()=>{let c={...s};return Object.defineProperty(t,"shape",{value:c}),c}})}let o=Iee(()=>GVr(t));Xo(e._zod,"propValues",()=>{let s=t.shape,c={};for(let u in s){let l=s[u]._zod;if(l.values){c[u]??(c[u]=new Set);for(let d of l.values)c[u].add(d)}}return c});let n=n5,i=t.catchall,a;e._zod.parse=(s,c)=>{a??(a=o.value);let u=s.value;if(!n(u))return s.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),s;s.value={};let l=[],d=a.shape;for(let f of a.keys){let p=d[f],h=p._zod.optin==="optional",y=p._zod.optout==="optional",_=p._zod.run({value:u[f],issues:[]},c);_ instanceof Promise?l.push(_.then(w=>VIe(w,s,f,u,h,y))):VIe(_,s,f,u,h,y)}return i?JVr(l,u,s,c,o.value,e):l.length?Promise.all(l).then(()=>s):s}}),YVr=me("$ZodObjectJIT",(e,t)=>{KVr.init(e,t);let r=e._zod.parse,o=Iee(()=>GVr(t)),n=f=>{let p=new ZIe(["shape","payload","ctx"]),h=o.value,y=E=>{let x=byt(E);return`shape[${x}]._zod.run({ value: input[${x}], issues: [] }, ctx)`};p.write("const input = payload.value;");let _=Object.create(null),w=0;for(let E of h.keys)_[E]=`key_${w++}`;p.write("const newResult = {};");for(let E of h.keys){let x=_[E],C=byt(E),$=f[E],A=$?._zod?.optin==="optional",P=$?._zod?.optout==="optional";p.write(`const ${x} = ${y(E)};`),A&&P?p.write(`
|