@avantf/dsh-identity 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/README.md +117 -2
- package/cordis.patch.yml +13 -0
- package/lib/assets/presets/analyst/en/IDENTITY.md +1 -0
- package/lib/assets/presets/analyst/en/RULES.md +8 -0
- package/lib/assets/presets/analyst/en/SOUL.md +5 -0
- package/lib/assets/presets/analyst/zh/IDENTITY.md +1 -0
- package/lib/assets/presets/analyst/zh/RULES.md +8 -0
- package/lib/assets/presets/analyst/zh/SOUL.md +5 -0
- package/lib/assets/presets/assistant/en/IDENTITY.md +1 -0
- package/lib/assets/presets/assistant/en/RULES.md +8 -0
- package/lib/assets/presets/assistant/en/SOUL.md +5 -0
- package/lib/assets/presets/assistant/zh/IDENTITY.md +1 -0
- package/lib/assets/presets/assistant/zh/RULES.md +8 -0
- package/lib/assets/presets/assistant/zh/SOUL.md +5 -0
- package/lib/assets/presets/coder/en/IDENTITY.md +1 -0
- package/lib/assets/presets/coder/en/RULES.md +8 -0
- package/lib/assets/presets/coder/en/SOUL.md +5 -0
- package/lib/assets/presets/coder/zh/IDENTITY.md +1 -0
- package/lib/assets/presets/coder/zh/RULES.md +8 -0
- package/lib/assets/presets/coder/zh/SOUL.md +5 -0
- package/lib/client.js +61 -0
- package/lib/dsh-build.json +6 -0
- package/lib/envinit-bootstrap.js +341 -0
- package/lib/index.js +1517 -0
- package/lib/interface-version.json +4 -0
- package/lib/types/atomic-write.d.ts +3 -0
- package/lib/types/atomic-write.d.ts.map +1 -0
- package/lib/types/base.d.ts +45 -0
- package/lib/types/base.d.ts.map +1 -0
- package/lib/types/client/IdentitySection.d.ts +29 -0
- package/lib/types/client/IdentitySection.d.ts.map +1 -0
- package/lib/types/client/api.d.ts +204 -0
- package/lib/types/client/api.d.ts.map +1 -0
- package/lib/types/client/index.d.ts +57 -0
- package/lib/types/client/index.d.ts.map +1 -0
- package/lib/types/documents.d.ts +65 -0
- package/lib/types/documents.d.ts.map +1 -0
- package/lib/types/envinit.d.ts +22 -0
- package/lib/types/envinit.d.ts.map +1 -0
- package/lib/types/gateway.d.ts +124 -0
- package/lib/types/gateway.d.ts.map +1 -0
- package/lib/types/index.d.ts +97 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/interface_gate.d.ts +121 -0
- package/lib/types/interface_gate.d.ts.map +1 -0
- package/lib/types/log.d.ts +18 -0
- package/lib/types/log.d.ts.map +1 -0
- package/lib/types/paths.d.ts +45 -0
- package/lib/types/paths.d.ts.map +1 -0
- package/lib/types/presets.d.ts +201 -0
- package/lib/types/presets.d.ts.map +1 -0
- package/lib/types/session-freeze.d.ts +33 -0
- package/lib/types/session-freeze.d.ts.map +1 -0
- package/lib/types/state.d.ts +190 -0
- package/lib/types/state.d.ts.map +1 -0
- package/lib/types/versions.d.ts +19 -0
- package/lib/types/versions.d.ts.map +1 -0
- package/lib/types/volatile.d.ts +28 -0
- package/lib/types/volatile.d.ts.map +1 -0
- package/lib/types/wire.d.ts +86 -0
- package/lib/types/wire.d.ts.map +1 -0
- package/package.json +104 -3
package/lib/client.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
window.__ModuleLoader__.load({ id: "@avantf/dsh-identity", factory: (require) => {
|
|
2
|
+
var module = { exports: {} }; var exports = module.exports;
|
|
3
|
+
"use strict";var wt=Object.defineProperty;var xc=Object.getOwnPropertyDescriptor;var vc=Object.getOwnPropertyNames;var bc=Object.prototype.hasOwnProperty;var Nr=(e,t)=>{for(var r in t)wt(e,r,{get:t[r],enumerable:!0})},zc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of vc(t))!bc.call(e,o)&&o!==r&&wt(e,o,{get:()=>t[o],enumerable:!(n=xc(t,o))||n.enumerable});return e};var $c=e=>zc(wt({},"__esModule",{value:!0}),e);var ul={};Nr(ul,{apply:()=>al,inject:()=>ol,name:()=>nl});module.exports=$c(ul);var pc=require("react");var b={};Nr(b,{BIGINT_FORMAT_RANGES:()=>He,CONSTANT_CATCH:()=>Wr,Class:()=>Pt,NUMBER_FORMAT_RANGES:()=>Ae,aborted:()=>V,allowsEval:()=>Ct,assert:()=>Oc,assertEqual:()=>wc,assertIs:()=>Pc,assertNever:()=>Zc,assertNotEqual:()=>kc,assignProp:()=>J,attachSchema:()=>Qe,base64ToUint8Array:()=>Kr,base64urlToUint8Array:()=>Gc,cached:()=>Ee,captureStackTrace:()=>Xe,cleanEnum:()=>Wc,cleanRegex:()=>Ce,clone:()=>K,cloneDef:()=>Cc,codePointLength:()=>Ne,constantCatch:()=>Gr,createTransparentProxy:()=>jc,defineLazy:()=>jr,defineLazyInternal:()=>k,derived:()=>qc,esc:()=>It,escapeRegex:()=>pe,explicitlyAborted:()=>Rt,extend:()=>Uc,finalizeIssue:()=>Q,floatSafeRemainder:()=>Ot,getElementAtPath:()=>Tc,getEnumValues:()=>xe,getLengthableOrigin:()=>De,getParsedType:()=>Dc,getSizableOrigin:()=>Jr,hexToUint8Array:()=>Yc,hide:()=>et,installLazyProp:()=>ra,isObject:()=>_e,isPlainObject:()=>le,issue:()=>be,joinValues:()=>Ge,jsonStringifyReplacer:()=>ve,members:()=>Dt,merge:()=>Bc,mergeDefs:()=>q,normalizeParams:()=>_,nullish:()=>Zt,numKeys:()=>Nc,objectClone:()=>Ic,omit:()=>Fc,optionalKeys:()=>At,own:()=>ce,parsedType:()=>Nt,partial:()=>Jc,pick:()=>Lc,prefixIssues:()=>Re,primitiveTypes:()=>Mr,promiseAllObject:()=>Ac,propertyKeyTypes:()=>Tt,randomString:()=>Rc,rawShape:()=>Te,required:()=>Kc,safeExtend:()=>Mc,shallowClone:()=>Ur,slugify:()=>Et,stringifyPrimitive:()=>Ye,toZod:()=>Sc,uint8ArrayToBase64:()=>Vr,uint8ArrayToBase64url:()=>Xc,uint8ArrayToHex:()=>Hc,unwrapMessage:()=>ye});function wc(e){return e}function kc(e){return e}function Sc(){return e=>e}function Pc(e){}function Zc(e){throw new Error("Unexpected value in exhaustive check")}function Oc(e){}function xe(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function Ge(e,t="|"){return e.map(r=>Ye(r)).join(t)}function ve(e,t){return typeof t=="bigint"?t.toString():t}var St=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function Ee(e){return new St(e)}function Zt(e){return e==null}function Ce(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Ot(e,t){let r=e/t,n=Math.round(r),o=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<o?0:r-n}var Dr=Symbol("evaluating");function jr(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Dr)return n===void 0&&(n=Dr,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Ic(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function J(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Te(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function H(e){return Te(e._zod.def)??e._zod.def.shape}function Lr(e,t,r){Object.defineProperty(e,t,{get(){let n=r();return J(this,t,n),n},enumerable:!0,configurable:!0})}function Fr(e,t,r){t in e?J(e,t,r):e[t]=r}function ue(e,t,r,n){let o=H(t);for(let i of r){let s=Object.getOwnPropertyDescriptor(o,i);s.enumerable&&(s.get?Lr(e,i,()=>{let c=t._zod.def.shape[i];return n?n(c,i):c}):Fr(e,i,n?n(s.value,i):s.value))}}function Ec(e,t){for(let r of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,r);n.enumerable&&(n.get?Lr(e,r,()=>t[r]):Fr(e,r,n.value))}}function q(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function Cc(e){return q(e._zod.def)}function Tc(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function Ac(e){let t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{let o={};for(let i=0;i<t.length;i++)o[t[i]]=n[i];return o})}function Rc(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function It(e){return JSON.stringify(e)}function Et(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Xe="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function _e(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Ct=Ee(()=>{if(U.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function le(e){if(_e(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(_e(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Ur(e){return le(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Nc(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var Dc=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}`)}},Tt=new Set(["string","number","symbol"]),Mr=new Set(["string","number","bigint","boolean","symbol","undefined"]);function pe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function K(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function _(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 jc(e){let t;return new Proxy({},{get(r,n,o){return t??(t=e()),Reflect.get(t,n,o)},set(r,n,o,i){return t??(t=e()),Reflect.set(t,n,o,i)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,o){return t??(t=e()),Reflect.defineProperty(t,n,o)}})}function Ye(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function At(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Ae={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]},He={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Lc(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i={};return ue(i,e,qe(e,t)),K(e,q(r,{shape:i,checks:[]}))}function qe(e,t){let r=H(e),n=[];for(let o of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,o)?.enumerable)throw new Error(`Unrecognized key: "${String(o)}"`);t[o]&&n.push(o)}return n}function Fc(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(qe(e,t)),s={};return ue(s,e,Reflect.ownKeys(H(e)).filter(c=>!i.has(c))),K(e,q(r,{shape:s,checks:[]}))}function Uc(e,t){if(!le(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=H(e);for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return K(e,q(e._zod.def,{shape:Br(e,t)}))}function Br(e,t){let r={};return ue(r,e,Reflect.ownKeys(H(e))),Ec(r,t),r}function Mc(e,t){if(!le(t))throw new Error("Invalid input to safeExtend: expected a plain object");return K(e,q(e._zod.def,{shape:Br(e,t)}))}function Bc(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};ue(r,e,Reflect.ownKeys(H(e))),ue(r,t,Reflect.ownKeys(H(t)));let n=q(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return K(e,n)}function Jc(e,t,r,n="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw new Error(`.${n}() cannot be used on object schemas containing refinements`);let c=r?new Set(qe(t,r)):void 0,a={};return ue(a,t,Reflect.ownKeys(H(t)),e&&((u,p)=>c&&!c.has(p)?u:new e({type:"optional",innerType:u}))),K(t,q(t._zod.def,{shape:a,checks:[]}))}function Kc(e,t,r){let n=r?new Set(qe(t,r)):void 0,o={};return ue(o,t,Reflect.ownKeys(H(t)),(i,s)=>n&&!n.has(s)?i:new e({type:"nonoptional",innerType:i})),K(t,q(t._zod.def,{shape:o}))}function V(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 Rt(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 Re(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function ye(e){return typeof e=="string"?e:e?.message}function Qe(e,t,r){var n;for(let o=t;o<e.length;o++)(n=e[o]).schema??(n.schema=r)}function Q(e,t,r){var n;let o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?(n=e).schema??(n.schema=e.inst):e.schema=e.inst);let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:ye(e.inst?._zod.def?.error?.(e))??ye(i?.(e))??ye(t?.error?.(e))??ye(r.customError?.(e))??ye(r.localeError?.(e))??"Invalid input",c={};for(let a of Object.keys(e))a==="inst"||a==="schema"||a==="continue"||a==="input"||a==="__proto__"||(c[a]=e[a]);return c.path??(c.path=[]),c.message=s,t?.reportInput&&(c.input=e.input),c}function Jr(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var Vc=/[\uD800-\uDBFF]/;function Ne(e){let t=e.length;if(!Vc.test(e))return t;let r=t;for(let n=0;n<t-1;n++)(e.charCodeAt(n)&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320&&(r--,n++);return r}function De(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Nt(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 be(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function Wc(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Kr(e){let t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function Vr(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Gc(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Kr(t+r)}function Xc(e){return Vr(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Yc(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 n=0;n<t.length;n+=2)r[n/2]=Number.parseInt(t.slice(n,n+2),16);return r}function Hc(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Pt=class{constructor(...t){}};function Dt(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);n.get?Object.defineProperty(e,r,{...n,enumerable:!1}):Qc(e,r,n.value)}}function ce(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function et(e,t,r){return ce(e,t,r,!1)}function qc(e,t){for(let r in e){let n=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return ce(this,r,n(this))},set(o){ce(this,r,o)}})}return t}function Qc(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:ce(this,t,r.bind(this))},set(n){ce(this,t,n)}})}function ea(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var kt,se=!1,ta={configurable:!0,get(){se=!0}};function k(e,t,r){let n=Object.getPrototypeOf(e._zod);if(t in n&&kt!==e._zod){kt=void 0;return}kt=e._zod,Object.defineProperty(n,t,{configurable:!0,get(){Object.defineProperty(this,t,ta);let o=se;se=!1;try{let i=r(this);return se?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i}),se=se||o,i}catch(i){throw delete this[t],se=se||o,i}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function ra(e,t,r,n){let o=ea(e,t);o&&Object.defineProperty(o,t,{configurable:!0,get(){let i={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,t,i),i.value=r(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:n,value:i})}})}var Wr="~constantCatch";function Gr(e){let t=()=>e;return t[Wr]=!0,t}var Xr;var jt={value:void 0,enumerable:!1},Yr="captureStackTrace"in Error?Error:null;function na(e){let t=Yr;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return Yr=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function l(e,t,r,n){let o={};function i(d){this.def=d,this.constr=f,this.traits=new Set}i.prototype=o;let s=r,c=s&&new WeakSet;function a(d,m){if(d._zod){if(d._zod.traits.has(e))return}else{jt.value=new i(m);try{Object.defineProperty(d,"_zod",jt)}finally{jt.value=void 0}}if(d._zod.traits.add(e),t(d,m),c){let x=Object.getPrototypeOf(d),y=d._zod.constr.prototype,P=x;for(;P&&P!==y;)P=Object.getPrototypeOf(P);let F=P??x;c.has(F)||(c.add(F),Dt(F,s))}let h=f.prototype;for(let x in h)Object.prototype.hasOwnProperty.call(h,x)&&(x in d||(d[x]=h[x].bind(d)))}let u=n?.Parent??Object;class p extends u{}Object.defineProperty(p,"name",{value:e});function f(d){let m=n?.Parent?na(p):this;a(m,d);let h=m._zod.deferred;if(h){for(let y of h)y();m._zod.deferred=void 0}let x=globalThis.__zod_globalConfig?.postProcessor;return x&&x(m),m}return Object.defineProperty(f,"init",{value:a}),Object.defineProperty(f,Symbol.hasInstance,{value:d=>n?.Parent&&d instanceof n.Parent?!0:d?._zod?.traits?.has(e)}),Object.defineProperty(f,"name",{value:e}),f}var W=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},ze=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(Xr=globalThis).__zod_globalConfig??(Xr.__zod_globalConfig={});var U=globalThis.__zod_globalConfig;function G(e){return e&&Object.assign(U,e),U}function oa(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,ve,2)),e.message}function ia(e){this._zod.message=e}var sa={get:oa,set:ia,enumerable:!0,configurable:!0},Ft={value:void 0,enumerable:!1},Hr=new WeakSet([Object.prototype,Error.prototype]),qr=(e,t)=>{e.name="$ZodError",Ft.value=t,Object.defineProperty(e,"issues",Ft),Ft.value=void 0,Object.defineProperty(e,"message",sa);let r=Object.getPrototypeOf(e);Hr.has(r)||(Hr.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let n=()=>this.message;return Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0})}}))},Qr=l("$ZodError",qr),ml=l("$ZodError",qr,void 0,{Parent:Error});function ca(e,t,r){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0}):e[t]=r()),e[t]}function en(e,t=r=>r.message){let r={},n=[];for(let o of e.issues)o.path.length>0?ca(r,o.path[0],()=>[]).push(t(o)):n.push(t(o));return{formErrors:n,fieldErrors:r}}function tn(e,t=r=>r.message){let r={_errors:[]},n=(o,i=[])=>{for(let s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(c=>n({issues:c},[...i,...s.path]));else if(s.code==="invalid_key")n({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")n({issues:s.issues},[...i,...s.path]);else{let c=[...i,...s.path];if(c.length===0)r._errors.push(t(s));else{let a=r,u=0;for(;u<c.length;){let p=c[u],f=u===c.length-1;if(p==="_errors"){f&&a._errors.push(t(s)),u++;continue}Object.prototype.hasOwnProperty.call(a,p)||Object.defineProperty(a,p,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let d=a[p];f&&d._errors.push(t(s)),a=d,u++}}}};return n(e),r}function tt(e,t){return{callee:t?.callee??e,Err:t?.Err}}var rt=e=>{let t=(r,n,o,i)=>{let s=o?{...o,async:!1}:{async:!1},c=r._zod.run({value:n,issues:[]},s);if(c instanceof Promise)throw new W;if(c.issues.length){let a=new(i?.Err??e)(c.issues.map(u=>Q(u,s,G())));throw Xe(a,i?.callee??t),a}return c.value};return t};var nt=e=>{let t=async(r,n,o,i)=>{let s=o?{...o,async:!0}:{async:!0},c=r._zod.run({value:n,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let a=new(i?.Err??e)(c.issues.map(u=>Q(u,s,G())));throw Xe(a,i?.callee??t),a}return c.value};return t};var ot=e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new W;return i.issues.length?rn(e,i.issues,o):{success:!0,data:i.value}};function rn(e,t,r){let n;return{success:!1,get error(){return n||(n=new e(t.map(o=>Q(o,r,G()))),t=void 0,r=void 0),n},set error(o){n=o,t=void 0,r=void 0}}}var it=e=>async(t,r,n)=>{let o=n?{...n,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?rn(e,i.issues,o):{success:!0,data:i.value}};var aa=Symbol.for("zod.compile.invalid"),ua=Symbol.for("zod.compile.fallback"),Ut=(e,t,r)=>{let n=e._zod.bag.validator;if(n!==void 0){if(n(t)!==aa)return!0;if(n.definite===!0&&r===void 0)return!1}return la(e,t,r)};function la(e,t,r){let n=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun,i;if(o?(n[ua]=!0,i=o({value:t,issues:[]},n)):i=e._zod.run({value:t,issues:[]},n),i instanceof Promise)throw new W;return i.issues.length===0}var Mt=async(e,t,r)=>{let n=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},o=e._zod.run({value:t,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length===0},nn=e=>{let t=rt(e),r=(n,o,i,s)=>{let c=i?{...i,direction:"backward"}:{direction:"backward"};return t(n,o,c,tt(r,s))};return r};var on=e=>{let t=rt(e),r=(n,o,i,s)=>t(n,o,i,tt(r,s));return r};var sn=e=>{let t=nt(e),r=async(n,o,i,s)=>{let c=i?{...i,direction:"backward"}:{direction:"backward"};return await t(n,o,c,tt(r,s))};return r};var cn=e=>{let t=nt(e),r=async(n,o,i,s)=>await t(n,o,i,tt(r,s));return r};var an=e=>(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return ot(e)(t,r,o)};var un=e=>(t,r,n)=>ot(e)(t,r,n);var ln=e=>async(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return it(e)(t,r,o)};var pn=e=>async(t,r,n)=>it(e)(t,r,n);var fn=/^[cC][0-9a-z]{6,}$/,dn=/^[0-9a-z]+$/,mn=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,hn=/^[0-9a-vA-V]{20}$/,gn=/^[A-Za-z0-9]{27}$/,yn=/^[a-zA-Z0-9_-]{21}$/;function _n(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var xn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var vn=/^([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})$/,Jt=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)$/;var bn=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var pa="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function zn(){return new RegExp(pa,"u")}var $n=/^(?:(?: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])$/,wn=/^(([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}|:))$/;var kn=/^((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])$/,Sn=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Pn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Zn=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var On=/^https?$/,In=/^\+[1-9]\d{6,14}$/;var En="(?:(?:\\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])))";function fa(e){return new RegExp(`^${e}$`)}var Cn=fa(En);function Bt(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}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Tn(e){return new RegExp(`^${Bt(e)}$`)}function An(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${Bt({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,n=e.local?`${r}|${Bt({precision:e.precision})}`:r;return new RegExp(`^${En}T(?:${n})$`)}var Rn=/^[\s\S]{0,}$/;var Kt=/^-?\d+(?:\.\d+)?$/,Nn=/^(?:true|false)$/i;var Dn=/^[^A-Z]*$/,jn=/^[^a-z]*$/;var R=l("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var Vt=e=>{let t=e.value;return!Zt(t)&&t.length!==void 0},st={number:"number",bigint:"bigint",object:"date"},Wt=l("$ZodCheckLessThan",(e,t)=>{R.init(e,t);let r=st[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:st[typeof n.value]??r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Gt=l("$ZodCheckGreaterThan",(e,t)=>{R.init(e,t);let r=st[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:st[typeof n.value]??r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ln=l("$ZodCheckMultipleOf",(e,t)=>{R.init(e,t),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"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):Ot(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})}}),Fn=l("$ZodCheckNumberFormat",(e,t)=>{R.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=Ae[t.format];e._zod.check=s=>{let c=s.value;if(r){if(!Number.isInteger(c)){s.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?s.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):s.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}c<o&&s.issues.push({origin:"number",input:c,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),c>i&&s.issues.push({origin:"number",input:c,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}});var Un=l("$ZodCheckMaxLength",(e,t)=>{var r;R.init(e,t),(r=e._zod.def).when??(r.when=Vt),e._zod.check=n=>{let o=n.value,i=o.length;if((typeof o=="string"&&i>t.maximum?Ne(o):i)<=t.maximum)return;let c=De(o);n.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Mn=l("$ZodCheckMinLength",(e,t)=>{var r;R.init(e,t),(r=e._zod.def).when??(r.when=Vt),e._zod.check=n=>{let o=n.value,i=o.length;if((typeof o=="string"&&i>=t.minimum&&i<t.minimum*2?Ne(o):i)>=t.minimum)return;let c=De(o);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Bn=l("$ZodCheckLengthEquals",(e,t)=>{var r;R.init(e,t),(r=e._zod.def).when??(r.when=Vt),e._zod.check=n=>{let o=n.value,i=o.length,s=typeof o=="string"&&i>=t.length&&i<=t.length*2?Ne(o):i;if(s===t.length)return;let c=De(o),a=s>t.length;n.issues.push({origin:c,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Le=l("$ZodCheckStringFormat",(e,t)=>{var r,n;R.init(e,t),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Jn=l("$ZodCheckRegex",(e,t)=>{Le.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})}}),Kn=l("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Dn),Le.init(e,t)}),Vn=l("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=jn),Le.init(e,t)}),Wn=l("$ZodCheckIncludes",(e,t)=>{R.init(e,t);let r=pe(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position},}${r}`:r);t.pattern=n,e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),Gn=l("$ZodCheckStartsWith",(e,t)=>{R.init(e,t);let r=new RegExp(`^${pe(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Xn=l("$ZodCheckEndsWith",(e,t)=>{R.init(e,t);let r=new RegExp(`.*${pe(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});var Yn=l("$ZodCheckOverwrite",(e,t)=>{R.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var ct=class{constructor(t=[],r={}){this.content=[],this.indent=0,this.args=t,this.closed=r}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let n=t.split(`
|
|
4
|
+
`).filter(s=>s),o=Math.min(...n.map(s=>s.length-s.trimStart().length)),i=n.map(s=>s.slice(o)).map(s=>" ".repeat(this.indent*2)+s);for(let s of i)this.content.push(s)}compile(){let t=Function,r=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
5
|
+
${r.join(`
|
|
6
|
+
`)}
|
|
7
|
+
};`)(...Object.values(this.closed))}};var qn={major:4,minor:6,patch:5};var I=l("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=qn;let n=e._zod.def.checks,o=e._zod.traits.has("$ZodCheck")?[e,...n??[]]:n?.length?[...n]:[];for(let i of o)for(let s of i._zod.onattach)s(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=(c,a,u)=>{if(c.memo)return c;let p=V(c),f;for(let d of a){if(d._zod.def.when){if(Rt(c)||!d._zod.def.when(c))continue}else if(p)continue;let m=c.issues.length,h=d._zod.check(c);if(h instanceof Promise&&u?.async===!1)throw new W;if(f||h instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await h,c.issues.length!==m&&(Qe(c.issues,m,e),p||(p=V(c,m)))});else{if(c.issues.length===m)continue;Qe(c.issues,m,e),p||(p=V(c,m))}}return f?f.then(()=>c):c},s=(c,a,u)=>{if(V(c))return c.aborted=!0,c;let p=i(a,o,u);if(p instanceof Promise){if(u.async===!1)throw new W;return p.then(f=>e._zod.parse(f,u))}return e._zod.parse(p,u)};e._zod.run=(c,a)=>{if(a.skipChecks)return e._zod.parse(c,a);if(a.direction==="backward"){let p=e._zod.parse({value:c.value,issues:[]},{...a,skipChecks:!0});return p instanceof Promise?p.then(f=>s(f,c,a)):s(p,c,a)}let u=e._zod.parse(c,a);if(u instanceof Promise){if(a.async===!1)throw new W;return u.then(p=>i(p,o,a))}return i(u,o,a)}}},{get"~standard"(){return et(this,"~standard",Yt(this))},set"~standard"(e){ce(this,"~standard",e)}}),uo=(e,t)=>e.issues.length?{issues:e.issues.map(r=>Q(r,t,G()))}:{value:e.value};async function ma(e,t){let r={async:!0};return uo(await e._zod.run({value:t,issues:[]},r),r)}function Yt(e){return{validate:t=>{let r={async:!1};try{let n=e._zod.run({value:t,issues:[]},r);if(!(n instanceof Promise))return uo(n,r)}catch{}return ma(e,t)},vendor:"zod",version:1}}var pt=l("$ZodString",(e,t)=>{I.init(e,t),e._zod.pattern=t.pattern??Rn,e._zod.parse=(r,n)=>{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}}),Z=l("$ZodStringFormat",(e,t)=>{Le.init(e,t),pt.init(e,t)}),lo=l("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=vn),Z.init(e,t)}),po=l("$ZodUUID",(e,t)=>{if(t.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Jt(n))}else t.pattern??(t.pattern=Jt());Z.init(e,t)}),fo=l("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=bn),Z.init(e,t)}),mo=1,ut=2;function ho(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function ha(e,t){return!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?ho(e)||ut:ga(e,t)}function ga(e,t){if(!t.normalize&&t.protocol?.source===On.source&&!/^https?:\/\//i.test(e))return mo;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse=="function")return r.parse(e)??ut}return new URL(e)}catch{return ut}}var ya=/[\t\n\r]/g;function Qn(e){return e.replace(ya,"")}function _a(e,t){return t.lastIndex=0,t.test(e.hostname)}function xa(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var go=l("$ZodURL",(e,t)=>{Z.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),o=ha(n,t);if(o===mo){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(o===ut){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(o===!0){r.value=Qn(n);return}t.hostname&&!_a(o,t.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&&!xa(o,t.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort}),r.value=t.normalize?o.href:Qn(n);return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),yo=l("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=zn()),Z.init(e,t)}),_o=l("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?yn:_n(t.length)),Z.init(e,t)}),xo=l("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=fn),Z.init(e,t)}),vo=l("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=dn),Z.init(e,t)}),bo=l("$ZodULID",(e,t)=>{t.pattern??(t.pattern=mn),Z.init(e,t)}),zo=l("$ZodXID",(e,t)=>{t.pattern??(t.pattern=hn),Z.init(e,t)}),$o=l("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=gn),Z.init(e,t)}),wo=l("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=An(t)),Z.init(e,t)}),ko=l("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Cn),Z.init(e,t)}),So=l("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Tn(t)),Z.init(e,t)}),Po=l("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=xn),Z.init(e,t)}),Zo=l("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=$n),Z.init(e,t)}),va=/^[0-9a-fA-F:.]+$/;function Oo(e){return va.test(e)?ho(`http://[${e}]`):!1}var Io=l("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=wn),Z.init(e,t),e._zod.check=r=>{Oo(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}});var Eo=l("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=kn),Z.init(e,t)});function ba(e){let t=e.split("/");if(t.length!==2)return!1;let[r,n]=t;if(!n)return!1;let o=Number(n);return`${o}`!==n||o<0||o>128?!1:Oo(r)}var Co=l("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Sn),Z.init(e,t),e._zod.check=r=>{ba(r.value)||r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function To(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Ht=/^[0-9a-zA-Z+/]*={0,2}$/,Ao=l("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Ht),Z.init(e,t),e._zod.check=r=>{To(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),ft=/^[A-Za-z0-9_-]*$/;function za(e){if(!ft.test(e))return!1;let t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return To(r)}var Ro=l("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ft),Z.init(e,t),e._zod.check=r=>{za(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),No=l("$ZodE164",(e,t)=>{t.pattern??(t.pattern=In),Z.init(e,t)});function $a(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}var Do=l("$ZodJWT",(e,t)=>{Z.init(e,t),e._zod.check=r=>{$a(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var qt=l("$ZodNumber",(e,t)=>{I.init(e,t),e._zod.pattern=Kt,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:String(o):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),r}}),jo=l("$ZodNumberFormat",(e,t)=>{Fn.init(e,t),qt.init(e,t)}),Lo=l("$ZodBoolean",(e,t)=>{I.init(e,t),e._zod.pattern=Nn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}});var Fo=l("$ZodAny",(e,t)=>{I.init(e,t),e._zod.parse=r=>r}),Uo=l("$ZodUnknown",(e,t)=>{I.init(e,t),e._zod.parse=r=>r}),Mo=l("$ZodNever",(e,t)=>{I.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function eo(e,t,r){e.issues.length&&t.issues.push(...Re(r,e.issues)),t.value[r]=e.value}var Bo=l("$ZodArray",(e,t)=>{I.init(e,t);let r=U.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=r?r.alloc(e,n,Array(i.length),o):Array(i.length);let s=[],c=o?.abortEarly;for(let a=0;a<i.length;a++){let u=i[a],p=t.element._zod.run({value:u,issues:[]},o);if(p instanceof Promise)s.push(p.then(f=>eo(f,n,a)));else if(eo(p,n,a),c&&p.issues.length!==0&&V(p))break}return s.length?Promise.all(s).then(()=>n):n}});function lt(e,t,r,n,o,i){let s=r in n,c=i==="optional";if(!(!s&&c&&o==="optional")){if(e.issues.length){if(o!==void 0&&c&&!s)return;t.issues.push(...Re(r,e.issues))}if(!s&&o===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?(s||o==="defaulted"&&!c)&&(t.value[r]=void 0):t.value[r]=e.value}}var wa=[];function Jo(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),n=r.length?r:wa,o=n.length?[...t,...n]:t;for(let s of o)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(s)}": expected a Zod schema`);let i=At(e.shape);return{...e,allKeys:o,symbolKeys:n,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function Ko(e,t,r,n,o,i,s){let c=[],a=o.keySet,u=o.catchall._zod,p=u.def.type,f=u.optin,d=u.optout,m=0;for(let h in t){if(s&&r.issues.length!==m){if(V(r,m))break;m=r.issues.length}if(a.has(h))continue;if(h==="__proto__"){p==="never"&&c.push(h);continue}if(p==="never"){c.push(h);continue}let x=u.run({value:t[h],issues:[]},n);x instanceof Promise?e.push(x.then(y=>lt(y,r,h,t,f,d))):lt(x,r,h,t,f,d)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:i,continue:!0}),e.length?Promise.all(e).then(()=>r):r}var ka=l("$ZodObject",(e,t)=>{I.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),n=r?.get?r.get.raw:t.shape??{};if(n){let u=()=>{let p={...n};return Object.defineProperty(t,"shape",{value:p}),u.raw=p,p};u.raw=n,Object.defineProperty(t,"shape",{get:u})}let o=Ee(()=>Jo(t));k(e,"propValues",u=>{let p=u.def.shape,f={};for(let d in p){let m=p[d]._zod;if(m.values){Object.prototype.hasOwnProperty.call(f,d)||J(f,d,new Set);for(let h of m.values)f[d].add(h);m.optin!==void 0&&f[d].add(void 0)}}return f});let i=_e,s=t.catchall,c,a=U.memoizer;a?.attach(e),e._zod.parse=(u,p)=>{c??(c=o.value);let f=u.value;if(!i(f))return u.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),u;u.value=a?a.alloc(e,u,{},p):{};let d=[],m=c.shape,h=p?.abortEarly,x=u.issues.length;for(let y of c.allKeys){if(h&&u.issues.length!==x){if(V(u,x))break;x=u.issues.length}if(y==="__proto__")continue;let P=m[y],F=P._zod.optin,ne=P._zod.optout,oe=P._zod.run({value:f[y],issues:[]},p);oe instanceof Promise?d.push(oe.then(O=>lt(O,u,y,f,F,ne))):lt(oe,u,y,f,F,ne)}return s?Ko(d,f,u,p,o.value,e,h===!0):d.length?Promise.all(d).then(()=>u):u}}),Vo=l("$ZodObjectJIT",(e,t)=>{ka.init(e,t);let r=e._zod.parse,n=Ee(()=>Jo(t)),o=U.memoizer,i=m=>{let h=n.value,x=h.symbolKeys,y=new ct(["payload","ctx"],{shape:m,inst:e,memo:o,syms:x}),P=O=>`shape[${O}]._zod.run({ value: input[${O}], issues: [] }, ctx)`,F=(O,S)=>`
|
|
8
|
+
let ${O}_ab = false;
|
|
9
|
+
for (let i = 0; i < ${O}.issues.length; i++) {
|
|
10
|
+
const iss = ${O}.issues[i];
|
|
11
|
+
iss.path = iss.path ? [${S}, ...iss.path] : [${S}];
|
|
12
|
+
payload.issues.push(iss);
|
|
13
|
+
if (iss.continue !== true) ${O}_ab = true;
|
|
14
|
+
}
|
|
15
|
+
if (${O}_ab && ctx && ctx.abortEarly) {
|
|
16
|
+
payload.value = newResult;
|
|
17
|
+
return payload;
|
|
18
|
+
}`;y.write("const input = payload.value;");let ne=Object.create(null),oe=0;for(let O of h.allKeys)ne[O]=`key_${oe++}`;y.write(o?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let O of h.allKeys){if(O==="__proto__")continue;let S=ne[O],L=typeof O=="symbol"?`syms[${x.indexOf(O)}]`:It(O),Y=`${L} in input`,ie=m[O],Pe=ie?._zod?.optin,he=Pe!==void 0,We=ie?._zod?.optout==="optional";if(y.write(`const ${S} = ${P(L)};`),he&&We){let Ze=Pe==="optional"?`${S}_present`:`${S}.value !== undefined || ${S}_present`;y.write(`
|
|
19
|
+
const ${S}_present = ${Y};
|
|
20
|
+
if (!${S}.issues.length || ${S}_present) {
|
|
21
|
+
if (${S}.issues.length) {${F(S,L)}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (${Ze}) {
|
|
25
|
+
newResult[${L}] = ${S}.value;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
`)}else he?(y.write(`
|
|
30
|
+
if (${S}.issues.length) {${F(S,L)}
|
|
31
|
+
}
|
|
32
|
+
`),Pe==="defaulted"?y.write(`newResult[${L}] = ${S}.value;`):y.write(`
|
|
33
|
+
if (${S}.value !== undefined || ${Y}) {
|
|
34
|
+
newResult[${L}] = ${S}.value;
|
|
35
|
+
}
|
|
36
|
+
`)):y.write(`
|
|
37
|
+
const ${S}_present = ${Y};
|
|
38
|
+
if (${S}.issues.length) {${F(S,L)}
|
|
39
|
+
}
|
|
40
|
+
if (!${S}_present && !${S}.issues.length) {
|
|
41
|
+
payload.issues.push({
|
|
42
|
+
code: "invalid_type",
|
|
43
|
+
expected: "nonoptional",
|
|
44
|
+
input: undefined,
|
|
45
|
+
path: [${L}]
|
|
46
|
+
});
|
|
47
|
+
if (ctx && ctx.abortEarly) {
|
|
48
|
+
payload.value = newResult;
|
|
49
|
+
return payload;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (${S}_present) {
|
|
54
|
+
newResult[${L}] = ${S}.value;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
`)}return y.write("payload.value = newResult;"),y.write("return payload;"),y.compile()},s,c=_e,a=!U.jitless,p=a&&Ct.value,f=t.catchall,d;e._zod.parse=(m,h)=>{d??(d=n.value);let x=m.value;return c(x)?a&&p&&h?.async===!1&&h.jitless!==!0?(s||(s=i(t.shape)),m=s(m,h),f?Ko([],x,m,h,d,e,h?.abortEarly===!0):m):r(m,h):(m.issues.push({expected:"object",code:"invalid_type",input:x,inst:e}),m)}});function to(e,t,r,n){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let o=e.filter(i=>!V(i));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(s=>Q(s,n,G())))}),t)}var Wo=l("$ZodUnion",(e,t)=>{I.init(e,t),k(e,"optin",n=>n.def.options.some(o=>o._zod.optin==="defaulted")?"defaulted":n.def.options.some(o=>o._zod.optin!==void 0)?"optional":void 0),k(e,"optout",n=>n.def.options.some(o=>o._zod.optout==="optional")?"optional":void 0),k(e,"values",n=>{if(n.def.options.every(o=>o._zod.values))return new Set(n.def.options.flatMap(o=>Array.from(o._zod.values)))}),k(e,"pattern",n=>{if(n.def.options.every(o=>o._zod.pattern)){let o=n.def.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>Ce(i.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,o)=>{if(r)return r(n,o);let i=!1,s=[];for(let c of t.options){let a=c._zod.run({value:n.value,issues:[]},o);if(a instanceof Promise)s.push(a),i=!0;else{if(a.issues.length===0)return a;s.push(a)}}return i?Promise.all(s).then(c=>to(c,n,e,o)):to(s,n,e,o)}});var Go=l("$ZodIntersection",(e,t)=>{I.init(e,t),e._zod.parse=(r,n)=>{let o=r.value,i=t.left._zod.run({value:o,issues:[]},n),s=t.right._zod.run({value:o,issues:[]},n);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([a,u])=>ro(r,a,u)):ro(r,i,s)}});function Xt(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(le(e)&&le(t)){let r=Object.keys(t),n=Object.keys(e).filter(i=>r.indexOf(i)!==-1),o={...e,...t};Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__;for(let i of n){if(i==="__proto__")continue;let s=Xt(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let o=e[n],i=t[n],s=Xt(o,i);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function ro(e,t,r){let n=new Map,o,i=new Map,s=(u,p)=>{let f;if(u.code==="unrecognized_keys"&&!u.path?.length)o??(o=u),f=u.keys;else if(u.code==="invalid_key"&&u.origin==="record"&&u.path?.length===1){let d=String(u.path[0]);i.has(d)||i.set(d,u),f=[d]}else return!1;for(let d of f)n.has(d)||n.set(d,{}),n.get(d)[p]=!0;return!0};for(let u of t.issues)s(u,"l")||e.issues.push(u);for(let u of r.issues)s(u,"r")||e.issues.push(u);let c=[...n].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(c.length){let u=o?c.filter(p=>o.keys.includes(p)):[];u.length&&e.issues.push({...o,keys:u});for(let p of c)!u.includes(p)&&i.has(p)&&e.issues.push(i.get(p))}let a=Xt(t.value,r.value);if(!a.valid){if(V(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`)}return e.value=a.data,e}var Xo=l("$ZodEnum",(e,t)=>{I.init(e,t);let r=xe(t.entries),n=new Set(r);e._zod.values=n,k(e,"pattern",o=>{let i=xe(o.def.entries).filter(s=>Tt.has(typeof s));return new RegExp(i.length?`^(${i.map(s=>pe(s.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,i)=>{let s=o.value;return n.has(s)||o.issues.push({code:"invalid_value",values:r,input:s,inst:e}),o}});var Yo=l("$ZodTransform",(e,t)=>{I.init(e,t),e._zod.optin="optional",U.memoizer?.guard(e),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new ze(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(r.value=s,r));if(o instanceof Promise)throw new W;return r.value=o,r}});function no(e,t){return e.value=t.issues.length?void 0:t.value,e}var Qt=l("$ZodOptional",(e,t)=>{I.init(e,t),k(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",k(e,"values",r=>{let n=r.def.innerType._zod.values;return n?new Set([...n,void 0]):void 0}),k(e,"pattern",r=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${Ce(n.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let o=t.innerType._zod.run({value:r.value,issues:[]},n);return o instanceof Promise?o.then(i=>no(r,i)):no(r,o)}return t.innerType._zod.run(r,n)}}),Ho=l("$ZodExactOptional",(e,t)=>{Qt.init(e,t),k(e,"values",r=>r.def.innerType._zod.values),k(e,"pattern",r=>r.def.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),qo=l("$ZodNullable",(e,t)=>{I.init(e,t),k(e,"optin",r=>r.def.innerType._zod.optin),k(e,"optout",r=>r.def.innerType._zod.optout),k(e,"pattern",r=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${Ce(n.source)}|null)$`):void 0}),k(e,"values",r=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),Qo=l("$ZodDefault",(e,t)=>{I.init(e,t),e._zod.optin="defaulted",k(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>oo(i,t)):oo(o,t)}});function oo(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var ei=l("$ZodPrefault",(e,t)=>{I.init(e,t),e._zod.optin="defaulted",k(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),ti=l("$ZodNonOptional",(e,t)=>{I.init(e,t),k(e,"values",r=>{let n=r.def.innerType._zod.values;return n?new Set([...n].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>io(i,e)):io(o,e)}});function io(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function so(e,t,r,n){return t.issues.length?(e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map(o=>Q(o,n,G()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var ri=l("$ZodCatch",(e,t)=>{I.init(e,t),k(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),k(e,"optout",r=>r.def.innerType._zod.optout),k(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run({value:r.value,issues:[]},n);return o instanceof Promise?o.then(i=>so(r,i,t,n)):so(r,o,t,n)}});var ni=l("$ZodPipe",(e,t)=>{I.init(e,t),k(e,"values",r=>r.def.in._zod.values),k(e,"optin",r=>r.def.in._zod.optin),k(e,"optout",r=>r.def.out._zod.optout),k(e,"propValues",r=>r.def.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let i=t.out._zod.run(r,n);return i instanceof Promise?i.then(s=>at(s,t.in,n)):at(i,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>at(i,t.out,n)):at(o,t.out,n)}});function at(e,t,r){return e.issues.some(n=>n.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}var oi=l("$ZodReadonly",(e,t)=>{I.init(e,t),k(e,"propValues",r=>r.def.innerType._zod.propValues),k(e,"values",r=>r.def.innerType._zod.values),k(e,"optin",r=>r.def.innerType?._zod?.optin),k(e,"optout",r=>r.def.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(co):co(o)}});function co(e){return e.memo||(e.value=Object.freeze(e.value)),e}var ii=l("$ZodCustom",(e,t)=>{R.init(e,t),I.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(i=>ao(i,r,n,e));ao(o,r,n,e)}});function ao(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(be(o))}}var tr=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},rr="~memo",si=[];function ci(e){return e!==null&&typeof e=="object"}function er(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}var ai=new WeakMap,Fe=0,ht=1,Ue=2;function gt(e,t,r){let n=ai.get(e);if(n!==void 0)return n?Ue:Fe;if(t.has(e))return Ue;t.add(e);let o=Fe,i=p=>{if(o!==Ue&&p?._zod){let f=gt(p,t,r);f>o&&(o=f)}},s=(p,f)=>{let d=Fe;for(let m of Reflect.ownKeys(p)){let h=Object.getOwnPropertyDescriptor(p,m);if(f&&!h.enumerable)continue;let x=h.get?ht:h.value?._zod?gt(h.value,t,r):Fe;x>d&&(d=x)}return d},c=p=>{p>o&&(o=p)},a=e._zod.def,u=a.type;switch(u){case"object":{let p=Te(a);c(p?s(p,!0):ht),i(a.catchall);break}case"array":i(a.element);break;case"tuple":for(let p of a.items)i(p);i(a.rest);break;case"record":case"map":i(a.keyType),i(a.valueType);break;case"set":i(a.valueType);break;case"union":for(let p of a.options)i(p);break;case"intersection":i(a.left),i(a.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":i(a.innerType);break;case"pipe":i(a.in),i(a.out);break;case"function":i(a.input),i(a.output);break;case"lazy":{let p=a._cachedInner??(r?e._zod.innerType:void 0);c(p?gt(p,t,!1):ht);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let p in a){let f=Object.getOwnPropertyDescriptor(a,p);if(!f||f.get)continue;let d=f.value;if(!(!d||typeof d!="object")){if(d._zod)i(d);else if(Array.isArray(d))for(let m of d)i(m)}}}return t.delete(e),Sa(e,o)}function Sa(e,t){return t!==ht&&ai.set(e,t===Ue),t}function Pa(e,t){let r=e.buckets.get(t);return r||(r=new WeakMap,e.buckets.set(t,r)),r}var dt,mt=[],Za={alloc(e,t,r){let n=dt;if(!n)return r;dt=void 0;let o={value:r,issues:null};return n.set(t.value,o),mt.push(o),r},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,n=(o,i)=>{if(i.direction!=="backward"&&Oa(i,o.value))throw new tr;return r(o,i)};e._zod.parse=n,e._zod.run===r&&(e._zod.run=n)})},attach(e){var t;let r,n=!1,o,i;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let s=e._zod.parse,c=(a,u)=>{if(r===void 0){let P=gt(e,new Set,!1);if(P===Fe)return e._zod.parse=s,e._zod.run===c&&(e._zod.run=s),s(a,u);P===Ue||n?r=!0:n=!0}let p=a.value;if(!ci(p))return s(a,u);let f=u[rr];f||(f={buckets:new WeakMap,backEdges:void 0},u[rr]=f);let d;o===u?d=i:(d=Pa(f,e),o=u,i=d);let m=d.get(p);if(m)return a.value=m.value,m.issues?m.issues.length&&a.issues.push(...er(m.issues)):(a.memo=!0,f.backEdges??(f.backEdges=new WeakSet),f.backEdges.add(m.value)),a;dt=d;let h=mt.length,x=s(a,u);dt=void 0;let y=mt.length>h?mt.pop():void 0;return x instanceof Promise?x.then(P=>(y&&(y.issues=P.issues.length?er(P.issues):si),P)):(y&&(y.issues=x.issues.length?er(x.issues):si),x)};e._zod.parse=c,e._zod.run===s&&(e._zod.run=c)})}};function ui(){return Za}function Oa(e,t){let r=e[rr]?.backEdges;return r!==void 0&&ci(t)&&r.has(t)}var Ia=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(i){return e[i]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};function o(i,s){return i==="number"&&typeof s=="number"&&!Number.isFinite(s)?String(s):n[i]??i}return i=>{switch(i.code){case"invalid_type":{let s=o(i.expected),c=Nt(i.input),a=o(c,i.input);return`Invalid input: expected ${s}, received ${a}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${Ye(i.values[0])}`:`Invalid option: expected one of ${Ge(i.values,"|")}`;case"too_big":{let s=i.exact?"exactly ":i.inclusive?"<=":"<",c=t(i.origin);return c?`Too big: expected ${i.origin??"value"} to have ${s}${i.maximum.toString()} ${c.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${s}${i.maximum.toString()}`}case"too_small":{let s=i.exact?"exactly ":i.inclusive?">=":">",c=t(i.origin);return c?`Too small: expected ${i.origin} to have ${s}${i.minimum.toString()} ${c.unit}`:`Too small: expected ${i.origin} to be ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${r[s.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${Ge(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`Invalid discriminator value. Expected ${i.options.map(c=>`'${c}'`).join(" | ")}`:i.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function li(){return{localeError:Ia()}}var pi;var nr=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function Ea(){return new nr}(pi=globalThis).__zod_globalRegistry??(pi.__zod_globalRegistry=Ea());var fe=globalThis.__zod_globalRegistry;function fi(e){return e.checks&&(e.checks=[...e.checks]),e}function di(e,t){return new e(fi({type:"string",..._(t)}))}function mi(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,..._(t)})}function hi(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,..._(t)})}function gi(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,..._(t)})}function yi(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",..._(t)})}function _i(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",..._(t)})}function xi(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",..._(t)})}function vi(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,..._(t)})}function bi(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,..._(t)})}function zi(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,..._(t)})}function $i(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,..._(t)})}function wi(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,..._(t)})}function ki(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,..._(t)})}function Si(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,..._(t)})}function Pi(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,..._(t)})}function Zi(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,..._(t)})}function Oi(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,..._(t)})}function Ii(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,..._(t)})}function Ei(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,..._(t)})}function Ci(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,..._(t)})}function Ti(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,..._(t)})}function Ai(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,..._(t)})}function Ri(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,..._(t)})}function Ni(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,..._(t)})}function Di(e,t){return new e({type:"string",format:"date",check:"string_format",..._(t)})}function ji(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,..._(t)})}function Li(e,t){return new e({type:"string",format:"duration",check:"string_format",..._(t)})}function Fi(e,t){return new e(fi({type:"number",checks:[],..._(t)}))}function Ui(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",..._(t)})}function Mi(e,t){return new e({type:"boolean",..._(t)})}function Bi(e){return new e({type:"any"})}function Ji(e){return new e({type:"unknown"})}function Ki(e,t){return new e({type:"never",..._(t)})}function yt(e,t){return new Wt({check:"less_than",..._(t),value:e,inclusive:!1})}function Me(e,t){return new Wt({check:"less_than",..._(t),value:e,inclusive:!0})}function _t(e,t){return new Gt({check:"greater_than",..._(t),value:e,inclusive:!1})}function Be(e,t){return new Gt({check:"greater_than",..._(t),value:e,inclusive:!0})}function xt(e,t){return new Ln({check:"multiple_of",..._(t),value:e})}function vt(e,t){return new Un({check:"max_length",..._(t),maximum:e})}function $e(e,t){return new Mn({check:"min_length",..._(t),minimum:e})}function bt(e,t){return new Bn({check:"length_equals",..._(t),length:e})}function or(e,t){return new Jn({check:"string_format",format:"regex",..._(t),pattern:e})}function ir(e){return new Kn({check:"string_format",format:"lowercase",..._(e)})}function sr(e){return new Vn({check:"string_format",format:"uppercase",..._(e)})}function cr(e,t){return new Wn({check:"string_format",format:"includes",..._(t),includes:e})}function ar(e,t){return new Gn({check:"string_format",format:"starts_with",..._(t),prefix:e})}function ur(e,t){return new Xn({check:"string_format",format:"ends_with",..._(t),suffix:e})}function ae(e){return new Yn({check:"overwrite",tx:e})}function lr(e){return ae(t=>t.normalize(e))}function pr(){return ae(e=>e.trim())}function fr(){return ae(e=>e.toLowerCase())}function dr(){return ae(e=>e.toUpperCase())}function mr(){return ae(e=>Et(e))}function Vi(e,t,r){return new e({type:"array",element:t,..._(r)})}function Wi(e,t,r){return new e({type:"custom",check:"custom",fn:t,..._(r)})}function Gi(e,t){let r=Ca(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(be(o,n.value,r._zod.def));else{let i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=n.value),i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),n.issues.push(be(i))}},e(n.value,n)),t);return r}function Ca(e,t){let r=new R({check:"custom",..._(t)});return r._zod.check=e,r}function Je(e,...t){for(let r of t)for(let n of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,n)&&J(e,n,r[n]);return e}function gr(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??fe,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function de(e,t,r,n,o){let i=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:n.path,message:o}):t.unrepresentable;if(i==="any")return!1;if(i===void 0||i==="throw")throw new Error(o);return Object.assign(r,i),!0}function A(e,t,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let c=e._zod.toJSONSchema?.();if(c)s.schema=c;else{let p={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,p);else{let d=s.schema,m=t.processors[o.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);m(e,t,d,p)}let f=e._zod.parent;f&&(s.ref||(s.ref=f),A(f,t,p),t.seen.get(f).isParent=!0)}let a=t.metadataRegistry.get(e);return a&&Je(s.schema,a),t.io==="input"&&j(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&"_prefault"in s.schema&&((n=s.schema).default??(n.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function Xi(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function yr(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let n=new Map;for(let s of e.seen.entries()){let c=e.metadataRegistry.get(s[0])?.id;if(c){let a=n.get(c);if(a&&a!==s[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(c,s[0])}}let o=s=>{let c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let f=e.external.registry.get(s[0])?.id,d=e.external.uri??(h=>h);if(f)return{ref:d(f)};let m=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=m,{defId:m,ref:`${d("__shared")}#/${c}/${Xi(m)}`}}let a="#",u=`${a}/${c}/`;if(s[1]===r&&!s[1].schema.id)return{ref:a};let p=s[1].schema.id??`__schema${e.counter++}`;return{defId:p,ref:u+Xi(p)}},i=s=>{if(s[1].schema.$ref)return;let c=s[1],{ref:a,defId:u}=o(s);c.def={...c.schema},u&&(c.defId=u);let p=c.schema;for(let f in p)delete p[f];p.$ref=a};if(e.cycles==="throw")for(let s of e.seen.entries()){let c=s[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
58
|
+
|
|
59
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let c=s[1];if(t===s[0]){i(s);continue}if(e.external){let u=e.external.registry.get(s[0])?.id;if(t!==s[0]&&u){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(c.cycle){i(s);continue}c.count>1&&e.reused==="ref"&&i(s)}e.external&&(e.sharedDefsExtractedFor=e.external)}function qi(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let r=[];for(let n of t){if(!n||typeof n!="object")return;qi(n);let o=Object.keys(n);if(o.length!==1||o[0]!=="type")return;let i=n.type;for(let s of Array.isArray(i)?i:[i]){if(typeof s!="string")return;r.includes(s)||r.push(s)}}delete e.anyOf,e.type=r.length===1?r[0]:r}var Qi=new Set(["type","properties","required","additionalProperties"]),Yi=["oneOf","anyOf"];function Hi(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function hr(e){let t=[];for(let i of e){if(typeof i!="object"||i.type!=="object")return null;for(let s in i)if(!Qi.has(s))return null;t.push(i)}let r={},n=new Set;for(let i of t){for(let s in i.properties){if(Object.prototype.hasOwnProperty.call(r,s))continue;let c=[];for(let u of t){let p=u.properties?.[s]??Hi(u);p!=null&&(c.some(f=>JSON.stringify(f)===JSON.stringify(p))||c.push(p))}let a=c.length===1?c[0]:hr(c)??{allOf:c};J(r,s,a)}for(let s of i.required??[])n.add(s)}let o={type:"object",properties:r};if(n.size&&(o.required=[...n]),t.every(i=>i.additionalProperties===!1))o.additionalProperties=!1;else{let i=[];for(let s of t){let c=Hi(s);c&&!i.some(a=>JSON.stringify(a)===JSON.stringify(c))&&i.push(c)}i.length===1?o.additionalProperties=i[0]:i.length>1&&(o.additionalProperties={allOf:i})}return o}function Ta(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let o of Qi)if(o in e)return;let r=t.filter(o=>Yi.some(i=>Array.isArray(o[i]))),n=null;if(!r.length)n=hr(t);else{let o=r[0],i=Yi.find(a=>Array.isArray(o[a]));if(Object.keys(o).length!==1)return;let s=t.filter(a=>a!==o),c=o[i].map(a=>hr([...s,a]));if(c.some(a=>!a))return;n={[i]:c}}n&&(delete e.allOf,Je(e,n))}function _r(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=c=>{let a=e.seen.get(c);if(a.ref===null)return;let u=a.def??a.schema,p={...u},f=a.ref;if(a.ref=null,f){n(f);let m=e.seen.get(f),h=m.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(h)):Je(u,h),Je(u,p),c._zod.parent===f)for(let y in u)y==="$ref"||y==="allOf"||y in p||delete u[y];if(h.$ref&&m.def)for(let y in u)y==="$ref"||y==="allOf"||y in m.def&&JSON.stringify(u[y])===JSON.stringify(m.def[y])&&delete u[y]}let d=c._zod.parent;if(d&&d!==f){n(d);let m=e.seen.get(d);if(m?.schema.$ref&&(u.$ref=m.schema.$ref,m.def))for(let h in u)h==="$ref"||h==="allOf"||h in m.def&&JSON.stringify(u[h])===JSON.stringify(m.def[h])&&delete u[h]}e.override({zodSchema:c,jsonSchema:u,path:a.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let c of[...e.seen.entries()].reverse())n(c[0]);if(e.target!=="openapi-3.0")for(let c of e.seen.entries())qi(c[1].def??c[1].schema);for(let c of e.deferred)c();if(e.intersections.length){let c=new Map;for(let a of e.seen.values())for(let u of[a.schema,a.def]){let p=u?.allOf;if(!Array.isArray(p))continue;let f=c.get(p);f?f.push(u):c.set(p,[u])}for(let a of e.intersections)for(let u of c.get(a)??[])Ta(u)}}let o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let c=e.external.registry.get(t)?.id;if(!c)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(c)}Je(o,r.defId?r.schema:r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;i!==void 0&&o.id===i&&delete o.id;let s=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let c of e.seen.entries()){let a=c[1];a.def&&a.defId&&(a.def.id===a.defId&&delete a.def.id,J(s,a.defId,a.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{let c=JSON.parse(JSON.stringify(o));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:Ke(t,"input",e.processors),output:Ke(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function j(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return j(n.element,r);if(n.type==="set")return j(n.valueType,r);if(n.type==="lazy")return j(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault"||n.type==="catch")return j(n.innerType,r);if(n.type==="intersection")return j(n.left,r)||j(n.right,r);if(n.type==="record"||n.type==="map")return j(n.keyType,r)||j(n.valueType,r);if(n.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:j(n.in,r)||j(n.out,r);if(n.type==="object"){for(let o in n.shape)if(j(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(let o of n.options)if(j(o,r))return!0;return!1}if(n.type==="tuple"){for(let o of n.items)if(j(o,r))return!0;return!!(n.rest&&j(n.rest,r))}return!1}var es=(e,t={})=>r=>{let n=gr({...r,processors:t});return A(e,n),yr(n,e),_r(n,e)},Ke=(e,t,r={})=>n=>{let{libraryOptions:o,target:i}=n??{},s=gr({...o??{},target:i,io:t,processors:r});return A(e,s),yr(s,e),_r(s,e)};var we=(e,t,r)=>{(e[t]===void 0||r>e[t])&&(e[t]=r)},ke=(e,t,r)=>{(e[t]===void 0||r<e[t])&&(e[t]=r)},ts=(e,t)=>{we(e,"minimum",t),ke(e,"maximum",t)},is=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},ss=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},cs=(e,t)=>{e.mime=e.mime?e.mime.filter(r=>t.includes(r)):[...t]},as=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},rs=(e,t)=>we(e,"minimum",t.minimum),ns=(e,t)=>ke(e,"maximum",t.maximum),os=e=>(t,r)=>{as(t,r.format);let[n,o]=e[r.format];we(t,"minimum",n),ke(t,"maximum",o)},Aa={greater_than:(e,t)=>we(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>ke(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>is(e,t.value),number_format:os(Ae),bigint_format:os(He),min_length:rs,max_length:ns,length_equals:(e,t)=>ts(e,t.length),min_size:rs,max_size:ns,size_equals:(e,t)=>ts(e,t.size),string_format:(e,t)=>{as(e,t.format),t.pattern&&ss(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>cs(e,t.mime)};function X(e){let t={},r=e._zod.def,n=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let i of n)Aa[i._zod.def.check]?.(t,i._zod.def);let o=e._zod.bag;o.minimum!==void 0&&we(t,"minimum",o.minimum),o.exclusiveMinimum!==void 0&&we(t,"exclusiveMinimum",o.exclusiveMinimum),o.maximum!==void 0&&ke(t,"maximum",o.maximum),o.exclusiveMaximum!==void 0&&ke(t,"exclusiveMaximum",o.exclusiveMaximum),o.multipleOf!==void 0&&is(t,o.multipleOf),o.format!==void 0&&(t.format??(t.format=o.format),o.format.includes("int")&&(t.isInt=!0)),o.mime&&cs(t,o.mime);for(let i of o.patterns??[])ss(t,i);return t}var Ra={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Na=new Map([[Ht,Pn],[ft,Zn]]),Da=e=>Na.get(e)??e,us=(e,t,r,n)=>{let o=r;o.type="string";let{minimum:i,maximum:s,format:c,patterns:a,contentEncoding:u,laxFormat:p}=X(e);if(typeof i=="number"&&(o.minLength=i),typeof s=="number"&&(o.maxLength=s),c&&(o.format=Ra[c]??c,o.format===""&&delete o.format,(c==="time"||p)&&delete o.format),u&&(o.contentEncoding=u),a&&a.size>0){let f=[...a].map(Da);f.length===1?o.pattern=f[0].source:f.length>1&&(o.allOf=[...f.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},ls=(e,t,r,n)=>{let o=r,{minimum:i,maximum:s,multipleOf:c,exclusiveMaximum:a,exclusiveMinimum:u,isInt:p}=X(e);o.type=p?"integer":"number";let f=typeof u=="number"&&u>=(i??Number.NEGATIVE_INFINITY),d=typeof a=="number"&&a<=(s??Number.POSITIVE_INFINITY),m=t.target==="draft-04"||t.target==="openapi-3.0";if(f?m?(o.minimum=u,o.exclusiveMinimum=!0):o.exclusiveMinimum=u:typeof i=="number"&&(o.minimum=i),d?m?(o.maximum=a,o.exclusiveMaximum=!0):o.exclusiveMaximum=a:typeof s=="number"&&(o.maximum=s),c){let h=new Set;for(let P of c)Number.isFinite(P)&&P!==0?h.add(Math.abs(P)):de(e,t,o,n,`A multipleOf divisor of ${P} cannot be represented in JSON Schema`);let[x,...y]=h;x!==void 0&&(o.multipleOf=x),y.length&&(o.allOf=[...o.allOf??[],...y.map(P=>({multipleOf:P}))])}},ps=(e,t,r,n)=>{r.type="boolean"};var fs=(e,t,r,n)=>{r.not={}},ds=(e,t,r,n)=>{},ms=(e,t,r,n)=>{};var hs=(e,t,r,n)=>{let o=e._zod.def,i=xe(o.entries);if(i.length===0){r.not={};return}i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),r.enum=i};var gs=(e,t,r,n)=>{de(e,t,r,n,"Custom types cannot be represented in JSON Schema")};var ys=(e,t,r,n)=>{de(e,t,r,n,"Transforms cannot be represented in JSON Schema")};var _s=(e,t,r,n)=>{let o=r,i=e._zod.def,{minimum:s,maximum:c}=X(e);typeof s=="number"&&(o.minItems=s),typeof c=="number"&&(o.maxItems=c),o.type="array",o.items=A(i.element,t,{...n,path:[...n.path,"items"]})};function xr(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?xr(t.out):t.type==="catch"?xr(t.innerType):e._zod.optin}var xs=(e,t,r,n)=>{let o=r,i=e._zod.def,s=i.shape;if(Object.getOwnPropertySymbols(s).length&&de(e,t,o,n,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(let u in s)J(o.properties,u,A(s[u],t,{...n,path:[...n.path,"properties",u]}));let a=[];for(let u of Object.keys(s)){let p=i.shape[u];(t.io==="input"?xr(p)===void 0:p._zod.optout===void 0)&&a.push(u)}a.length>0&&(o.required=a),i.catchall?._zod.def.type==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=A(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},vs=(e,t,r,n)=>{let o=e._zod.def,i=o.inclusive===!1,s=o.options.map((c,a)=>A(c,t,{...n,path:[...n.path,i?"oneOf":"anyOf",a]}));i?r.oneOf=s:r.anyOf=s},bs=(e,t,r,n)=>{let o=e._zod.def,i=A(o.left,t,{...n,path:[...n.path,"allOf",0]}),s=A(o.right,t,{...n,path:[...n.path,"allOf",1]}),c=u=>"allOf"in u&&Object.keys(u).length===1,a=[...c(i)?i.allOf:[i],...c(s)?s.allOf:[s]];r.allOf=a,t.intersections.push(a)};var zs=(e,t,r,n)=>{let o=e._zod.def,i=A(o.innerType,t,n),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=o.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},$s=(e,t,r,n)=>{let o=e._zod.def;A(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType},vr=Symbol();function ws(e,t,r,n,o){let i=!1,s=JSON.stringify(e,(c,a)=>typeof a!="bigint"?a:(i=!0,null));return i?(de(t,r,n,o,"BigInt defaults cannot be represented in JSON Schema"),vr):JSON.parse(s)}var ks=(e,t,r,n)=>{let o=e._zod.def;A(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let s=ws(o.defaultValue,e,t,r,n);s!==vr&&(r.default=s)},Ss=(e,t,r,n)=>{let o=e._zod.def;A(o.innerType,t,n);let i=t.seen.get(e);if(i.ref=o.innerType,t.io!=="input")return;let s=ws(o.defaultValue,e,t,r,n);s!==vr&&(r._prefault=s)},Ps=(e,t,r,n)=>{let o=e._zod.def;A(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0)}catch{de(e,t,r,n,"Dynamic catch values are not supported in JSON Schema");return}r.default=s},Zs=(e,t,r,n)=>{let o=e._zod.def,i=o.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?i?o.out:o.in:o.out;A(s,t,n);let c=t.seen.get(e);c.ref=s},Os=(e,t,r,n)=>{let o=e._zod.def;A(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType,r.readOnly=!0};var br=(e,t,r,n)=>{let o=e._zod.def;A(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType};var Is=new WeakSet([Object.prototype,Error.prototype]);function zt(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let n=r(this);return Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0})}})}var Ka=(e,t)=>{Qr.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);Is.has(r)||(Is.add(r),zt(r,"format",n=>o=>tn(n,o)),zt(r,"flatten",n=>o=>en(n,o)),zt(r,"addIssue",n=>o=>{n.issues.push(o),n.message=JSON.stringify(n.issues,ve,2)}),zt(r,"addIssues",n=>o=>{n.issues.push(...o),n.message=JSON.stringify(n.issues,ve,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))};var M=l("ZodError",Ka,void 0,{Parent:Error});var Es=rt(M),Cs=nt(M),Ts=ot(M),As=it(M),Rs=nn(M),Ns=on(M),Ds=sn(M),js=cn(M),Ls=an(M),Fs=un(M),Us=ln(M),Ms=pn(M);function Wa(){U.localeError||G(li())}function wr(){U.memoizer||G({memoizer:ui()})}var C=l("ZodType",(e,t)=>(Wa(),I.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(b.mergeDefs(t,{checks:[...t.checks??[],...e.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return K(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ku(e,t))},superRefine(e,t){return this.check(Vu(e,t))},overwrite(e){return this.check(ae(e))},optional(){return Ks(this)},exactOptional(){return Cu(this)},nullable(){return Vs(this)},nullish(){return Ks(Vs(this))},nonoptional(e){return ju(this,e)},array(){return ee(this)},or(e){return Su([this,e])},and(e){return Zu(this,e)},transform(e){return Ws(this,Eu(e))},default(e){return Ru(this,e)},prefault(e){return Du(this,e)},catch(e){return Fu(this,e)},pipe(e){return Ws(this,e)},readonly(){return Bu(this)},describe(e){let t=this.clone();return fe.add(t,{description:e}),t},meta(...e){if(e.length===0)return fe.get(this);let t=this.clone();return fe.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return b.hide(this,"~standard",{...Yt(this),jsonSchema:{input:Ke(this,"input"),output:Ke(this,"output")}})},set"~standard"(e){b.own(this,"~standard",e)},parse:function e(t,r){return Es(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await Cs(this,t,r,{callee:e})},safeParse(e,t){return Ts(this,e,t)},async safeParseAsync(e,t){return As(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){b.own(this,"spa",e)},validate(e,t){return Ut(this,e,t)},validateAsync(e,t){return Mt(this,e,t)},encode:function e(t,r){return Rs(this,t,r,{callee:e})},decode:function e(t,r){return Ns(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await Ds(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await js(this,t,r,{callee:e})},safeEncode(e,t){return Ls(this,e,t)},safeDecode(e,t){return Fs(this,e,t)},async safeEncodeAsync(e,t){return Us(this,e,t)},async safeDecodeAsync(e,t){return Ms(this,e,t)},toJSONSchema(e){return es(this,{})(e)},get description(){return fe.get(this)?.description},get _def(){return this._zod.def}}),Gs=l("_ZodString",(e,t)=>{pt.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>us(e,r,n,o)},b.derived({format:e=>X(e).format??null,minLength:e=>X(e).minimum??null,maxLength:e=>X(e).maximum??null},{regex(...e){return this.check(or(...e))},includes(...e){return this.check(cr(...e))},startsWith(...e){return this.check(ar(...e))},endsWith(...e){return this.check(ur(...e))},min(...e){return this.check($e(...e))},max(...e){return this.check(vt(...e))},length(...e){return this.check(bt(...e))},nonempty(...e){return this.check($e(1,...e))},lowercase(e){return this.check(ir(e))},uppercase(e){return this.check(sr(e))},trim(){return this.check(pr())},normalize(...e){return this.check(lr(...e))},toLowerCase(){return this.check(fr())},toUpperCase(){return this.check(dr())},slugify(){return this.check(mr())}})),Ga=l("ZodString",(e,t)=>{pt.init(e,t),Gs.init(e,t)},{email(e){return this.check(mi(Qa,e))},url(e){return this.check(vi(tu,e))},jwt(e){return this.check(Ri(gu,e))},emoji(e){return this.check(bi(ru,e))},guid(e){return this.check(hi(eu,e))},uuid(e){return this.check(gi($t,e))},uuidv4(e){return this.check(yi($t,e))},uuidv6(e){return this.check(_i($t,e))},uuidv7(e){return this.check(xi($t,e))},nanoid(e){return this.check(zi(nu,e))},cuid(e){return this.check($i(ou,e))},cuid2(e){return this.check(wi(iu,e))},ulid(e){return this.check(ki(su,e))},base64(e){return this.check(Ci(du,e))},base64url(e){return this.check(Ti(mu,e))},xid(e){return this.check(Si(cu,e))},ksuid(e){return this.check(Pi(au,e))},ipv4(e){return this.check(Zi(uu,e))},ipv6(e){return this.check(Oi(lu,e))},cidrv4(e){return this.check(Ii(pu,e))},cidrv6(e){return this.check(Ei(fu,e))},e164(e){return this.check(Ai(hu,e))},datetime(e){return this.check(Ni(Xa,e))},date(e){return this.check(Di(Ya,e))},time(e){return this.check(ji(Ha,e))},duration(e){return this.check(Li(qa,e))}});function kr(e){return di(Ga,e)}var E=l("ZodStringFormat",(e,t)=>{Z.init(e,t),Gs.init(e,t)}),Xa=l("ZodISODateTime",(e,t)=>{wo.init(e,t),E.init(e,t)}),Ya=l("ZodISODate",(e,t)=>{ko.init(e,t),E.init(e,t)}),Ha=l("ZodISOTime",(e,t)=>{So.init(e,t),E.init(e,t)}),qa=l("ZodISODuration",(e,t)=>{Po.init(e,t),E.init(e,t)}),Qa=l("ZodEmail",(e,t)=>{fo.init(e,t),E.init(e,t)});var eu=l("ZodGUID",(e,t)=>{lo.init(e,t),E.init(e,t)});var $t=l("ZodUUID",(e,t)=>{po.init(e,t),E.init(e,t)});var tu=l("ZodURL",(e,t)=>{go.init(e,t),E.init(e,t)});var ru=l("ZodEmoji",(e,t)=>{yo.init(e,t),E.init(e,t)});var nu=l("ZodNanoID",(e,t)=>{_o.init(e,t),E.init(e,t)});var ou=l("ZodCUID",(e,t)=>{xo.init(e,t),E.init(e,t)});var iu=l("ZodCUID2",(e,t)=>{vo.init(e,t),E.init(e,t)});var su=l("ZodULID",(e,t)=>{bo.init(e,t),E.init(e,t)});var cu=l("ZodXID",(e,t)=>{zo.init(e,t),E.init(e,t)});var au=l("ZodKSUID",(e,t)=>{$o.init(e,t),E.init(e,t)});var uu=l("ZodIPv4",(e,t)=>{Zo.init(e,t),E.init(e,t)});var lu=l("ZodIPv6",(e,t)=>{Io.init(e,t),E.init(e,t)});var pu=l("ZodCIDRv4",(e,t)=>{Eo.init(e,t),E.init(e,t)});var fu=l("ZodCIDRv6",(e,t)=>{Co.init(e,t),E.init(e,t)});var du=l("ZodBase64",(e,t)=>{Ao.init(e,t),E.init(e,t)});var mu=l("ZodBase64URL",(e,t)=>{Ro.init(e,t),E.init(e,t)});var hu=l("ZodE164",(e,t)=>{No.init(e,t),E.init(e,t)});var gu=l("ZodJWT",(e,t)=>{Do.init(e,t),E.init(e,t)});var Xs=l("ZodNumber",(e,t)=>{qt.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ls(e,r,n,o),e.isFinite=!0},b.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:r}=X(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:t,exclusiveMaximum:r}=X(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:t,multipleOf:r}=X(e);return!!t||!!r?.some(Number.isSafeInteger)},format:e=>X(e).format??null},{gt(e,t){return this.check(_t(e,t))},gte(e,t){return this.check(Be(e,t))},min(e,t){return this.check(Be(e,t))},lt(e,t){return this.check(yt(e,t))},lte(e,t){return this.check(Me(e,t))},max(e,t){return this.check(Me(e,t))},int(e){return this.check(Bs(e))},safe(e){return this.check(Bs(e))},positive(e){return this.check(_t(0,e))},nonnegative(e){return this.check(Be(0,e))},negative(e){return this.check(yt(0,e))},nonpositive(e){return this.check(Me(0,e))},multipleOf(e,t){return this.check(xt(e,t))},step(e,t){return this.check(xt(e,t))},finite(){return this}}));function me(e){return Fi(Xs,e)}var yu=l("ZodNumberFormat",(e,t)=>{jo.init(e,t),Xs.init(e,t)});function Bs(e){return Ui(yu,e)}var _u=l("ZodBoolean",(e,t)=>{Lo.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ps(e,r,n,o)});function B(e){return Mi(_u,e)}var xu=l("ZodAny",(e,t)=>{Fo.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ds(e,r,n,o)});function Sr(){return Bi(xu)}var vu=l("ZodUnknown",(e,t)=>{Uo.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ms(e,r,n,o)});function Js(){return Ji(vu)}var bu=l("ZodNever",(e,t)=>{Mo.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>fs(e,r,n,o)});function zu(e){return Ki(bu,e)}var $u=l("ZodArray",(e,t)=>{wr(),Bo.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>_s(e,r,n,o),e.element=t.element},{min(e,t){return this.check($e(e,t))},nonempty(e){return this.check($e(1,e))},max(e,t){return this.check(vt(e,t))},length(e,t){return this.check(bt(e,t))},unwrap(){return this.element}});function ee(e,t){return Vi($u,e,t)}var wu=l("ZodObject",(e,t)=>{wr(),Vo.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>xs(e,r,n,o),b.installLazyProp(e,"shape",r=>r._zod.def.shape,!1)},{keyof(){return Ou(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(b.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(b.mergeDefs(this._zod.def,{catchall:Js()}))},loose(){return this.clone(b.mergeDefs(this._zod.def,{catchall:Js()}))},strict(){return this.clone(b.mergeDefs(this._zod.def,{catchall:zu()}))},strip(){return this.clone(b.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return b.extend(this,e)},safeExtend(e){return b.safeExtend(this,e)},merge(e){return b.merge(this,e)},pick(e){return b.pick(this,e)},omit(e){return b.omit(this,e)},partial(...e){return b.partial(Ys,this,e[0])},exactPartial(...e){return b.partial(Hs,this,e[0],"exactPartial")},required(...e){return b.required(qs,this,e[0])}});function N(e,t){let r={type:"object",shape:e??{},...b.normalizeParams(t)};return new wu(r)}var ku=l("ZodUnion",(e,t)=>{Wo.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>vs(e,r,n,o),e.options=t.options});function Su(e,t){return new ku({type:"union",options:e,...b.normalizeParams(t)})}var Pu=l("ZodIntersection",(e,t)=>{Go.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>bs(e,r,n,o)});function Zu(e,t){return new Pu({type:"intersection",left:e,right:t})}var $r=l("ZodEnum",(e,t)=>{Xo.init(e,t),C.init(e,t),e._zod.processJSONSchema=(n,o,i)=>hs(e,n,o,i),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{let i={};for(let s of n)if(r.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new $r({...t,checks:[],...b.normalizeParams(o),entries:i})},e.exclude=(n,o)=>{let i={...t.entries};for(let s of n)if(r.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new $r({...t,checks:[],...b.normalizeParams(o),entries:i})}});function Ou(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new $r({type:"enum",entries:r,...b.normalizeParams(t)})}var Iu=l("ZodTransform",(e,t)=>{wr(),Yo.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ys(e,r,n,o),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new ze(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(b.issue(i,r.value,t));else{let s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),"input"in s||(s.input=r.value),s.inst??(s.inst=e),r.issues.push(b.issue(s))}};let o=t.transform(r.value,r);return o instanceof Promise?o.then(i=>(r.value=i,r)):(r.value=o,r)}});function Eu(e){return new Iu({type:"transform",transform:e})}var Ys=l("ZodOptional",(e,t)=>{Qt.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>br(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Ks(e){return new Ys({type:"optional",innerType:e})}var Hs=l("ZodExactOptional",(e,t)=>{Ho.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>br(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Cu(e){return new Hs({type:"optional",innerType:e})}var Tu=l("ZodNullable",(e,t)=>{qo.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>zs(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Vs(e){return new Tu({type:"nullable",innerType:e})}var Au=l("ZodDefault",(e,t)=>{Qo.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ks(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ru(e,t){return new Au({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():b.shallowClone(t)}})}var Nu=l("ZodPrefault",(e,t)=>{ei.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ss(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Du(e,t){return new Nu({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():b.shallowClone(t)}})}var qs=l("ZodNonOptional",(e,t)=>{ti.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>$s(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function ju(e,t){return new qs({type:"nonoptional",innerType:e,...b.normalizeParams(t)})}var Lu=l("ZodCatch",(e,t)=>{ri.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ps(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Fu(e,t){return new Lu({type:"catch",innerType:e,catchValue:typeof t=="function"?t:b.constantCatch(t)})}var Uu=l("ZodPipe",(e,t)=>{ni.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Zs(e,r,n,o),e.in=t.in,e.out=t.out});function Ws(e,t){return new Uu({type:"pipe",in:e,out:t})}var Mu=l("ZodReadonly",(e,t)=>{oi.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Os(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Bu(e){return new Mu({type:"readonly",innerType:e})}var Ju=l("ZodCustom",(e,t)=>{ii.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>gs(e,r,n,o)});function Ku(e,t={}){return Wi(Ju,e,t)}function Vu(e,t){return Gi(e,t)}var Or="@avantf/dsh-identity",Se="avantfIdentity";function Pr(e,t){return{mode:"strict",typeSymbol:t,schema:e,create:()=>e}}var ec=e=>`${Or}#${Se}/${e}`,Zr=(e,t)=>`${Or}#${Se}/${e}:${t}`;function te(e,t){return{id:ec(e),service:Se,namespace:Se,method:e,invocation:{kind:"direct"},parameters:[{name:"args",wire:"args",source:"json",codec:Pr(t,Zr(e,"args"))}],result:Pr(Sr(),Zr(e,"result"))}}function Qs(e){return{id:ec(e),service:Se,namespace:Se,method:e,invocation:{kind:"direct"},parameters:[],result:Pr(Sr(),Zr(e,"result"))}}var re=kr().optional(),$=kr(),tc=[te("status",N({locale:re})),Qs("listPresets"),Qs("readProfile"),te("writeProfileFile",N({name:$,text:$})),te("ensureProfile",N({locale:re})),te("applyPreset",N({id:$,locale:re})),te("resetToPreset",N({id:$,locale:re})),te("saveAsPreset",N({id:$,locale:re})),te("readPreset",N({id:$,locale:re})),te("writePresetFile",N({id:$,name:$,text:$,locale:re})),te("deletePreset",N({id:$}))],rc=N({name:$,file:$,text:$,present:B(),bytes:me()}),Wu=N({name:$,file:$,path:$,present:B(),bytes:me()}),Gu=N({id:$,locales:ee($),active:B()}),Xu=N({enabled:B(),profile:$,dataHome:$,identityDir:$,presetsDir:$,fileCount:me(),totalBytes:me(),maxBytes:me(),interpolate:B(),replaceScope:$,drop:ee($),fallbackToNative:B(),activePreset:$,activeLocale:$,hasLocalEdit:B(),locale:$,localeSource:$,files:ee(Wu),presets:ee(Gu)}),Yu=N({profile:$,identityDir:$,totalBytes:me(),files:ee(rc)}),Hu=N({found:B(),id:$,requestedLocale:$,resolvedLocale:$,fellBack:B(),files:ee(rc)}),qu=N({ok:B(),error:re,resolvedLocale:re,fellBack:B().optional(),files:ee($).optional()}),Ve=(e,t)=>({name:e,schema:t,create:()=>t}),Nf=[...tc.flatMap(e=>e.parameters.map(t=>Ve(`${e.method}${t.name}`,t.codec.schema))),Ve("statusResult",Xu),Ve("profileResult",Yu),Ve("writeResult",qu),Ve("presetResult",Hu)];var nc={package:Or,descriptors:tc};var D=require("react"),v=require("react/jsx-runtime"),oc=["IDENTITY","SOUL","RULES"],ic={boxSizing:"border-box",height:"32px",padding:"0 8px",borderRadius:"var(--dsw-radius-md, 6px)",border:"0.5px solid var(--dsw-alias-border-l4, #444)",background:"var(--dsw-alias-bg-layer-1, transparent)",color:"var(--dsw-alias-label-primary, inherit)",fontSize:"14px",lineHeight:"22px"},z={root:{display:"flex",flexDirection:"column",gap:"14px",padding:"4px 2px 20px",color:"var(--dsw-alias-label-primary, inherit)"},title:{fontSize:"17px",fontWeight:600,margin:0},card:{border:"1px solid var(--dsw-alias-border-l2, #3a3a3a)",borderRadius:"8px",background:"var(--dsw-alias-bg-layer-1, transparent)",padding:"12px",display:"flex",flexDirection:"column",gap:"8px"},row:{display:"flex",alignItems:"center",gap:"10px",flexWrap:"wrap"},identityRow:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"10px"},overlay:{position:"fixed",inset:0,zIndex:1100,display:"flex",alignItems:"center",justifyContent:"center",padding:"24px",background:"var(--dsw-alias-bg-mask-1, rgba(0, 0, 0, 0.45))",backdropFilter:"var(--dsw-mask-blur, none)"},dialog:{boxSizing:"border-box",display:"flex",flexDirection:"column",gap:"20px",width:"min(380px, 100%)",padding:"20px 24px 24px",borderRadius:"var(--dsw-radius-panel, 12px)",background:"var(--dsw-alias-bg-layer-2, #242424)",boxShadow:"var(--dsw-elevation-prominent, 0 12px 32px rgba(0, 0, 0, 0.45))"},dialogTitle:{margin:0,fontSize:"16px",lineHeight:"24px",fontWeight:500,color:"var(--dsw-alias-label-primary, inherit)"},dialogFooter:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"8px"},label:{fontSize:"12px",fontWeight:600},hint:{fontSize:"11px",color:"var(--dsw-alias-label-secondary, #888)",lineHeight:1.6},textarea:{width:"100%",minHeight:"120px",resize:"vertical",boxSizing:"border-box",fontFamily:"ui-monospace, SFMono-Regular, monospace",fontSize:"12px",lineHeight:1.6,padding:"8px",borderRadius:"var(--dsw-radius-md, 6px)",color:"var(--dsw-alias-label-primary, inherit)",background:"var(--dsw-alias-bg-layer-1, transparent)",border:"0.5px solid var(--dsw-alias-border-l4, #444)"},input:ic,identitySelect:{...ic,flex:"1 1 auto",minWidth:0},button:{padding:"5px 12px",borderRadius:"var(--dsw-radius-md, 6px)",fontSize:"13px",cursor:"pointer",color:"var(--dsw-alias-label-primary, inherit)",background:"transparent",border:"0.5px solid var(--dsw-alias-border-l3, #3a3a3a)"},primary:{padding:"5px 12px",borderRadius:"var(--dsw-radius-md, 6px)",fontSize:"13px",cursor:"pointer",color:"var(--dsw-alias-label-primary-foreground, #fff)",background:"var(--dsw-alias-button-primary-fill, #2f6feb)",border:"0.5px solid transparent"},error:{fontSize:"12px",color:"var(--dsw-alias-state-error-primary, #d9534f)"},ok:{fontSize:"12px",color:"var(--dsw-alias-state-success-primary, #3aa76d)"}},Qu={IDENTITY:"fileIdentity",SOUL:"fileSoul",RULES:"fileRules"},el=["profile","dataHome","fileCount","drop","files","presets"];function cc(e){let{t,getRemote:r,whenMounted:n,getConfigForm:o,locale:i}=e,[s,c]=(0,D.useState)(void 0),[a,u]=(0,D.useState)({IDENTITY:"",SOUL:"",RULES:""}),[p,f]=(0,D.useState)({IDENTITY:"",SOUL:"",RULES:""}),[d,m]=(0,D.useState)(void 0),[h,x]=(0,D.useState)(void 0),[y,P]=(0,D.useState)(!1),[F,ne]=(0,D.useState)(void 0),[oe,O]=(0,D.useState)(void 0),[S,L]=(0,D.useState)(""),[Y,ie]=(0,D.useState)(void 0),[Pe,he]=(0,D.useState)(!1),We=g=>{O(g instanceof Error?g.message:String(g)),ne(void 0)},Ze=(0,D.useCallback)(async()=>{let g=r();if(g!==void 0)try{let[w,T]=await Promise.all([g.status({locale:i()}),g.readProfile()]);c(w),u(sc(T.files)),f(sc(T.files)),O(void 0)}catch(w){We(w)}},[r,i]);(0,D.useEffect)(()=>{let g=o();if(g===void 0)return;m(g);let w=()=>{try{x(g.getSnapshot().value?.enabled===!0)}catch{x(void 0)}};return w(),g.subscribe(w)},[o]),(0,D.useEffect)(()=>{let g=!0;return n().then(()=>{g&&Ze()}),()=>{g=!1}},[n,Ze]);let Cr=async g=>{P(!0);try{await g(),O(void 0),await Ze()}catch(w){We(w)}finally{P(!1)}},Oe=async g=>{let w=r();w!==void 0&&await Cr(()=>g(w))},fc=async g=>{d!==void 0&&await Cr(async()=>{if(await d.set("enabled",g)&&x(g),g){let w=r();if(w?.ensureProfile!==void 0){let T=await w.ensureProfile({locale:i()});if(!T.ok)throw new Error(T.error??"seeding the identity failed")}}})},dc=async()=>{await Oe(async g=>{for(let w of oc){if(a[w]===p[w])continue;let T=await g.writeProfileFile({name:w,text:a[w]});if(!T.ok)throw new Error(T.error??`writing ${w}.md failed`)}ne(t("saved"))})},mc=async g=>{await Oe(async w=>{let T=await w.applyPreset({id:g,locale:i()});if(!T.ok)throw new Error(T.error??"apply failed")})},hc=async g=>{let w=r();if(w!==void 0){if(w.resetToPreset===void 0){O(t("unavailable"));return}await Oe(async T=>{let Rr=await T.resetToPreset({id:g,locale:i()});if(!Rr.ok)throw new Error(Rr.error??"restore failed")})}},gc=async g=>{await Oe(async w=>{let T=await w.deletePreset({id:g});if(!T.ok)throw new Error(T.error??"delete failed")})},yc=async()=>{await Oe(async g=>{let w=await g.saveAsPreset({id:S.trim(),locale:i()});if(!w.ok)throw new Error(w.error??"save-as failed");L("")})},ge=r()===void 0,Tr=s?.presets??[],Ie=Tr.find(g=>g.active)?.id??"",_c=s===void 0?[]:Object.keys(s),Ar=s===void 0?[]:el.filter(g=>s[g]===void 0);return(0,v.jsxs)("div",{style:z.root,children:[(0,v.jsx)("h2",{style:z.title,children:t("title")}),ge?(0,v.jsx)("div",{style:z.error,children:t("unavailable")}):null,oe!==void 0?(0,v.jsx)("div",{style:z.error,children:oe}):null,F!==void 0?(0,v.jsx)("div",{style:z.ok,children:F}):null,Ar.length>0?(0,v.jsxs)("div",{style:z.error,children:[t("missingFields"),": ",Ar.join(", ")," \xB7 ",t("received"),": ",_c.join(", ")||t("empty")]}):null,(0,v.jsx)("div",{style:z.card,children:(0,v.jsxs)("div",{style:z.row,children:[(0,v.jsx)("input",{type:"checkbox",checked:h===!0,disabled:d===void 0||y,onChange:g=>{fc(g.target.checked)}}),(0,v.jsx)("span",{style:z.label,children:t("switch")}),d===void 0?(0,v.jsx)("span",{style:z.hint,children:t("noConfigForm")}):null]})}),h===!0?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)("div",{style:z.card,children:[(0,v.jsxs)("div",{style:z.identityRow,children:[(0,v.jsx)("select",{style:z.identitySelect,value:Ie,disabled:y||ge,onChange:g=>{g.target.value!==""&&ie({kind:"apply",id:g.target.value})},children:Tr.map(g=>(0,v.jsx)("option",{value:g.id,children:g.id},g.id))}),(0,v.jsx)("button",{type:"button",style:z.button,disabled:y||ge||Ie==="",onClick:()=>{ie({kind:"delete",id:Ie})},children:t("del")})]}),s?.hasLocalEdit===!0?(0,v.jsxs)("div",{style:z.row,children:[(0,v.jsx)("span",{style:z.hint,children:t("modified")}),(0,v.jsx)("button",{type:"button",style:z.button,disabled:y||ge||Ie==="",onClick:()=>{ie({kind:"restore",id:Ie})},children:t("restore")})]}):null]}),(0,v.jsxs)("div",{style:z.card,children:[oc.map(g=>(0,v.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[(0,v.jsx)("span",{style:z.label,children:t(Qu[g])}),(0,v.jsx)("textarea",{style:z.textarea,value:a[g],placeholder:t("empty"),onChange:w=>{u(T=>({...T,[g]:w.target.value}))}})]},g)),(0,v.jsxs)("div",{style:z.row,children:[(0,v.jsx)("button",{type:"button",style:z.primary,disabled:y||ge,onClick:()=>{dc()},children:t("save")}),(0,v.jsx)("button",{type:"button",style:z.button,disabled:y||ge,onClick:()=>{L(""),he(!0)},children:t("saveAs")}),(0,v.jsx)("span",{style:z.hint,children:t("saved")})]})]})]}):null,Y!==void 0?(0,v.jsx)("div",{style:z.overlay,role:"presentation",children:(0,v.jsxs)("div",{style:z.dialog,role:"dialog","aria-modal":"true",children:[(0,v.jsx)("h3",{style:z.dialogTitle,children:t(Y.kind==="apply"?"confirmApply":Y.kind==="restore"?"confirmReset":"confirmDelete",{id:Y.id})}),(0,v.jsxs)("div",{style:z.dialogFooter,children:[(0,v.jsx)("button",{type:"button",style:z.button,onClick:()=>{ie(void 0)},children:t("cancel")}),(0,v.jsx)("button",{type:"button",style:z.primary,disabled:y,onClick:()=>{let g=Y;ie(void 0),g.kind==="apply"?mc(g.id):g.kind==="restore"?hc(g.id):gc(g.id)},children:t("ok")})]})]})}):null,Pe?(0,v.jsx)("div",{style:z.overlay,role:"presentation",children:(0,v.jsxs)("div",{style:z.dialog,role:"dialog","aria-modal":"true",children:[(0,v.jsx)("h3",{style:z.dialogTitle,children:t("saveAs")}),(0,v.jsx)("input",{style:z.input,value:S,placeholder:t("newPresetId"),onChange:g=>{L(g.target.value)}}),(0,v.jsxs)("div",{style:z.dialogFooter,children:[(0,v.jsx)("button",{type:"button",style:z.button,onClick:()=>{he(!1)},children:t("cancel")}),(0,v.jsx)("button",{type:"button",style:z.primary,disabled:y||S.trim()==="",onClick:()=>{he(!1),yc()},children:t("ok")})]})]})}):null]})}function sc(e){let t={IDENTITY:"",SOUL:"",RULES:""};for(let r of e)(r.name==="IDENTITY"||r.name==="SOUL"||r.name==="RULES")&&(t[r.name]=r.text);return t}function ac(e,t){let r=e;if(!(r==null||typeof r.get!="function"))try{let n=r.get(t);return typeof n?.subscribe=="function"&&typeof n.getSnapshot=="function"?n:void 0}catch{return}}var tl=["status","listPresets","readProfile","writeProfileFile","ensureProfile","applyPreset","resetToPreset","saveAsPreset","readPreset","writePresetFile","deletePreset"],Ir=class extends Error{};function rl(e){let t=e;if(!(t!==null&&typeof t=="object"&&typeof t.ok=="boolean"))return e;if(t.ok===!1){let n=typeof t.error=="string"?t.error:JSON.stringify(t.error??"transport failed");throw new Ir(n)}return Object.hasOwn(t,"value")?t.value:e}function uc(e){if(e===void 0)return;let t=e,r={};for(let n of tl){let o=t[n];typeof o=="function"&&(r[n]=async i=>rl(await o.apply(e,i===void 0?[]:[i])))}return r}var nl="avantf-identity",ol=["remote","slots","locale"],il="avantf-identity",Er="settings.identity",lc="[avantf-identity]",sl={nav:"\u8EAB\u4EFD",title:"\u8EAB\u4EFD",switch:"\u542F\u7528\u8EAB\u4EFD",fileIdentity:"\u8EAB\u4EFD\uFF08IDENTITY.md\uFF09",fileSoul:"\u6027\u683C\uFF08SOUL.md\uFF09",fileRules:"\u89C4\u5219\uFF08RULES.md\uFF09",save:"\u4FDD\u5B58",saved:"\u5DF2\u4FDD\u5B58\uFF0C\u65B0\u4F1A\u8BDD\u751F\u6548",empty:"\uFF08\u7A7A\uFF09",del:"\u5220\u9664",saveAs:"\u5B58\u4E3A\u65B0\u9884\u8BBE",newPresetId:"\u65B0\u9884\u8BBE id\uFF08\u5C0F\u5199\u5B57\u6BCD\u3001\u6570\u5B57\u4E0E\u8FDE\u5B57\u7B26\uFF09",ok:"\u786E\u5B9A",cancel:"\u53D6\u6D88",unavailable:"\u8EAB\u4EFD Remote \u5C1A\u672A\u6302\u8F7D\uFF1A\u8BF7\u91CD\u542F dsh \u540E\u518D\u8BD5\u3002",noConfigForm:"\u8BBE\u7F6E\u8868\u5355\u5C1A\u672A\u5C31\u7EEA\uFF0C\u5F00\u5173\u6682\u4E0D\u53EF\u7528\u3002",confirmApply:"\u662F\u5426\u542F\u7528 {id}\uFF1F\u786E\u5B9A\u540E\u65B0\u4F1A\u8BDD\u751F\u6548\u3002",confirmDelete:"\u5220\u9664\u8FD9\u4E2A\u9884\u8BBE\uFF1F\uFF08\u4F60\u5728\u672C profile \u4FDD\u5B58\u7684\u8BE5\u8EAB\u4EFD\u7248\u672C\u4E5F\u4F1A\u4E00\u8D77\u5220\u9664\uFF09",restore:"\u6062\u590D\u9884\u8BBE\u539F\u6587",confirmReset:"\u628A\u300C{id}\u300D\u6062\u590D\u4E3A\u9884\u8BBE\u539F\u6587\uFF1F\u4F60\u5728\u672C profile \u5BF9\u5B83\u505A\u7684\u4FEE\u6539\u4F1A\u88AB\u4E22\u5F03\u3002",modified:"\u5DF2\u4FEE\u6539\uFF08\u672C profile\uFF09",missingFields:"\u72B6\u6001\u5B57\u6BB5\u7F3A\u5931",received:"\u5B9E\u6536\u5B57\u6BB5"},cl={nav:"Identity",title:"Identity",switch:"Use the identity",fileIdentity:"Identity (IDENTITY.md)",fileSoul:"Soul (SOUL.md)",fileRules:"Rules (RULES.md)",save:"Save",saved:"Saved; it takes effect in a new session",empty:"(empty)",del:"Delete",saveAs:"Save as preset",newPresetId:"New preset id (lower-case letters, digits, hyphens)",ok:"OK",cancel:"Cancel",unavailable:"The identity Remote is not mounted yet; restart dsh and try again.",noConfigForm:"The settings form is not ready yet, so the switch is unavailable.",confirmApply:"Enable {id}? It takes effect in a new session.",confirmDelete:"Delete this preset? Your saved version of it in this profile goes too.",restore:"Restore preset text",confirmReset:"Restore \u201C{id}\u201D to its preset text? Your changes to it in this profile are discarded.",modified:"modified (this profile)",missingFields:"status fields missing",received:"received"};function al(e){let t=(u,p)=>{console[u](`${lc} ${p}`);try{u==="error"&&e.logger.error(`${lc} ${p}`)}catch{}};t("log","client half mounting: settings.section page + avantfIdentity Remote namespace"),e.effect(()=>e.locale.register(Er,{zh:sl,en:cl}),"avantf-identity: dictionaries");let r={},n=(()=>{let u=()=>{};return{promise:new Promise(f=>{u=f}),settle:u}})();e.remote.$mount(nc).then(()=>{r.remote=uc(e.get("remote.avantfIdentity")),t(r.remote===void 0?"error":"log",r.remote===void 0?'contribution mounted but ctx.get("remote.avantfIdentity") is undefined; the page will report it':"Remote namespace mounted: the identity page can read and write the files"),n.settle()}).catch(u=>{t("error",`mounting the Remote contribution failed: ${String(u)}`),n.settle()});let o=e.locale.bind(Er),i=()=>{try{let u=e.locale.getSnapshot().active;return typeof u=="string"&&u!==""?u:"en"}catch{return"en"}},s={name:"settings.section",id:"identity",order:25,locale:Er,label:()=>o("nav")},c={t:o,getRemote:()=>r.remote,whenMounted:()=>n.promise,getConfigForm:()=>ac(e.get("configForms"),il),locale:i},a=u=>(0,pc.createElement)(cc,{close:u.close,...c});e.slots.inject("settings.section",()=>e.slots.register(s,a)),t("log","registered the settings.section page: id=identity order=25")}
|
|
60
|
+
|
|
61
|
+
return module.exports; } });
|