appos 0.1.18-0 → 0.1.20-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.
Files changed (113) hide show
  1. package/build/exports/adapter-factory-CLtf7vT5-djMsiEBl.mjs +88 -0
  2. package/build/exports/appos.d.ts +82 -0
  3. package/build/exports/bun-sqlite-dialect-DN7EKoIB-B0dpsiEy.mjs +1 -0
  4. package/build/exports/chunk-BYI67GdN.mjs +1 -0
  5. package/build/exports/chunk-DQj_Q5LL.mjs +1 -0
  6. package/build/exports/client-Cf0k1wnb.mjs +7 -0
  7. package/build/exports/client.d.ts +2093 -2082
  8. package/build/exports/client.js +22 -60
  9. package/build/exports/date.d.ts +1 -1
  10. package/build/exports/date.js +1 -1
  11. package/build/exports/db.d.mts +5195 -0
  12. package/build/exports/db.mjs +8 -0
  13. package/build/exports/dialect-BeMwdQoz-BUgv8nHa.mjs +1 -0
  14. package/build/exports/dist-cjs-6zIKAlZR.mjs +1 -0
  15. package/build/exports/dist-cjs-8ShtoC4L.mjs +1 -0
  16. package/build/exports/dist-cjs-8w9IfsHf.mjs +1 -0
  17. package/build/exports/dist-cjs-B5EVkyOL.mjs +1 -0
  18. package/build/exports/dist-cjs-BCXEF6CM.mjs +1 -0
  19. package/build/exports/dist-cjs-BEWqPJiY.mjs +1 -0
  20. package/build/exports/dist-cjs-BY2gcA7W.mjs +22 -0
  21. package/build/exports/dist-cjs-BilOG_GK.mjs +5 -0
  22. package/build/exports/dist-cjs-BurjEDDY.mjs +1 -0
  23. package/build/exports/dist-cjs-CkmP5Wcr.mjs +1 -0
  24. package/build/exports/dist-cjs-D9iFq61w.mjs +1 -0
  25. package/build/exports/dist-cjs-DBYzdOBR.mjs +10 -0
  26. package/build/exports/dist-cjs-DO06FS0-.mjs +1 -0
  27. package/build/exports/dist-cjs-Ddwe8ROf.mjs +1 -0
  28. package/build/exports/dist-cjs-DpVGmjIF.mjs +1 -0
  29. package/build/exports/esm-FzcFIiBQ.mjs +3 -0
  30. package/build/exports/event-streams-BOfsfbfw.mjs +1 -0
  31. package/build/exports/file-preview-dialog-BquzKbRO.mjs +59 -0
  32. package/build/exports/kysely-adapter-WhLCdqvu.mjs +1 -0
  33. package/build/exports/magic-string.es-jZcifc5m.mjs +14 -0
  34. package/build/exports/memory-adapter-CBfVsIEf.mjs +1 -0
  35. package/build/exports/node-ponyfill-PofhX7d2.mjs +1 -0
  36. package/build/exports/node-sqlite-dialect-BqISUSC3-DSS_lf2e.mjs +1 -0
  37. package/build/exports/package-DfozRyK6.mjs +1 -0
  38. package/build/exports/react-dom-DRJH8-Wa.mjs +42 -0
  39. package/build/exports/server.d.mts +71688 -0
  40. package/build/exports/server.mjs +325 -0
  41. package/build/exports/sso-oidc-DMxhsWZu.mjs +1 -0
  42. package/build/exports/sts-CqD3bswo.mjs +1 -0
  43. package/build/exports/sts-DJilo-ly.mjs +1 -0
  44. package/build/exports/test.d.mts +8922 -0
  45. package/build/exports/test.mjs +1255 -0
  46. package/build/exports/ui/index.d.ts +1595 -568
  47. package/build/exports/ui/index.js +112 -162
  48. package/build/exports/utils.d.ts +6 -4
  49. package/build/exports/utils.js +1 -1
  50. package/build/exports/zod.d.ts +2 -1
  51. package/build/exports/zod.js +13 -13
  52. package/package.json +9 -8
  53. package/build/exports/bun-sqlite-dialect-DN7EKoIB-U6HWGDKS.js +0 -1
  54. package/build/exports/chunk-2LU65C2X.js +0 -1
  55. package/build/exports/chunk-3RRIQKOV.js +0 -2
  56. package/build/exports/chunk-A2LPCJPF.js +0 -5
  57. package/build/exports/chunk-CWTDMDIJ.js +0 -2
  58. package/build/exports/chunk-FBFACBKZ.js +0 -20
  59. package/build/exports/chunk-FZ26Y4SI.js +0 -1
  60. package/build/exports/chunk-GQYUAAFT.js +0 -1
  61. package/build/exports/chunk-HZYRJBRQ.js +0 -1
  62. package/build/exports/chunk-IAPQO6XO.js +0 -1
  63. package/build/exports/chunk-JIMTVXLP.js +0 -5
  64. package/build/exports/chunk-KNTGSRCW.js +0 -20
  65. package/build/exports/chunk-KRQ2L5OP.js +0 -1
  66. package/build/exports/chunk-MQK6VFZR.js +0 -1
  67. package/build/exports/chunk-N756FM5W.js +0 -6
  68. package/build/exports/chunk-NJ2TZAVN.js +0 -169
  69. package/build/exports/chunk-NM7CITTT.js +0 -2
  70. package/build/exports/chunk-PECJ5CRS.js +0 -1
  71. package/build/exports/chunk-PYGCG54X.js +0 -94
  72. package/build/exports/chunk-QMFB7WUQ.js +0 -1
  73. package/build/exports/chunk-QWUKON2B.js +0 -4
  74. package/build/exports/chunk-S3F2U5VR.js +0 -1
  75. package/build/exports/chunk-S6CGHQRG.js +0 -2
  76. package/build/exports/chunk-TLDYRTHH.js +0 -1
  77. package/build/exports/chunk-TX6WXZHJ.js +0 -1
  78. package/build/exports/chunk-Y6DVQ7FD.js +0 -1
  79. package/build/exports/chunk-YBDDYGAW.js +0 -1
  80. package/build/exports/db.d.ts +0 -5194
  81. package/build/exports/db.js +0 -9
  82. package/build/exports/dist-es-442MVKMG.js +0 -1
  83. package/build/exports/dist-es-5NPX4IPA.js +0 -2
  84. package/build/exports/dist-es-AAGJZOKW.js +0 -1
  85. package/build/exports/dist-es-BA4XRQMD.js +0 -1
  86. package/build/exports/dist-es-CEXBPGKD.js +0 -1
  87. package/build/exports/dist-es-D7P74EQC.js +0 -2
  88. package/build/exports/dist-es-K23RHFIG.js +0 -2
  89. package/build/exports/dist-es-K6CZFUD7.js +0 -5
  90. package/build/exports/dist-es-PV5MXZPQ.js +0 -5
  91. package/build/exports/dist-es-PV6DSUWC.js +0 -1
  92. package/build/exports/dist-es-PYWXCUQO.js +0 -2
  93. package/build/exports/dist-es-QLJ2PEMO.js +0 -1
  94. package/build/exports/dist-es-TDQNJYF5.js +0 -1
  95. package/build/exports/dist-es-VXQY2642.js +0 -1
  96. package/build/exports/event-streams-JL44VPIA.js +0 -1
  97. package/build/exports/file-preview-dialog-XJMPJ764.js +0 -15
  98. package/build/exports/kysely-adapter-UB5EKM3L.js +0 -1
  99. package/build/exports/loadSso-ATQGBCEY.js +0 -1
  100. package/build/exports/loadSso-ILXKFPPV.js +0 -1
  101. package/build/exports/magic-string.es-TEACLLHX.js +0 -13
  102. package/build/exports/memory-adapter-LJJR2XXS.js +0 -1
  103. package/build/exports/node-ponyfill-6NJTIN4I.js +0 -1
  104. package/build/exports/node-sqlite-dialect-BqISUSC3-3545EWOZ.js +0 -1
  105. package/build/exports/plugin-56OEBMME.js +0 -4
  106. package/build/exports/server.d.ts +0 -71779
  107. package/build/exports/server.js +0 -435
  108. package/build/exports/sso-oidc-7POVDJYK.js +0 -1
  109. package/build/exports/sso-oidc-TUR3VC4Y.js +0 -1
  110. package/build/exports/sts-35P3OWOX.js +0 -6
  111. package/build/exports/sts-ZDKVF6HW.js +0 -1
  112. package/build/exports/test.d.ts +0 -8942
  113. package/build/exports/test.js +0 -1583
@@ -0,0 +1,88 @@
1
+ import{r as e}from"./chunk-DQj_Q5LL.mjs";const t=e=>{let t=(e.plugins??[]).reduce((e,t)=>{let n=t.schema;if(!n)return e;for(let[t,r]of Object.entries(n))e[t]={fields:{...e[t]?.fields,...r.fields},modelName:r.modelName||t};return e},{}),n=e.rateLimit?.storage===`database`,r={rateLimit:{modelName:e.rateLimit?.modelName||`rateLimit`,fields:{key:{type:`string`,fieldName:e.rateLimit?.fields?.key||`key`},count:{type:`number`,fieldName:e.rateLimit?.fields?.count||`count`},lastRequest:{type:`number`,bigint:!0,fieldName:e.rateLimit?.fields?.lastRequest||`lastRequest`}}}},{user:i,session:a,account:o,...s}=t,c={session:{modelName:e.session?.modelName||`session`,fields:{expiresAt:{type:`date`,required:!0,fieldName:e.session?.fields?.expiresAt||`expiresAt`},token:{type:`string`,required:!0,fieldName:e.session?.fields?.token||`token`,unique:!0},createdAt:{type:`date`,required:!0,fieldName:e.session?.fields?.createdAt||`createdAt`,defaultValue:()=>new Date},updatedAt:{type:`date`,required:!0,fieldName:e.session?.fields?.updatedAt||`updatedAt`,onUpdate:()=>new Date},ipAddress:{type:`string`,required:!1,fieldName:e.session?.fields?.ipAddress||`ipAddress`},userAgent:{type:`string`,required:!1,fieldName:e.session?.fields?.userAgent||`userAgent`},userId:{type:`string`,fieldName:e.session?.fields?.userId||`userId`,references:{model:e.user?.modelName||`user`,field:`id`,onDelete:`cascade`},required:!0,index:!0},...a?.fields,...e.session?.additionalFields},order:2}};return{user:{modelName:e.user?.modelName||`user`,fields:{name:{type:`string`,required:!0,fieldName:e.user?.fields?.name||`name`,sortable:!0},email:{type:`string`,unique:!0,required:!0,fieldName:e.user?.fields?.email||`email`,sortable:!0},emailVerified:{type:`boolean`,defaultValue:!1,required:!0,fieldName:e.user?.fields?.emailVerified||`emailVerified`,input:!1},image:{type:`string`,required:!1,fieldName:e.user?.fields?.image||`image`},createdAt:{type:`date`,defaultValue:()=>new Date,required:!0,fieldName:e.user?.fields?.createdAt||`createdAt`},updatedAt:{type:`date`,defaultValue:()=>new Date,onUpdate:()=>new Date,required:!0,fieldName:e.user?.fields?.updatedAt||`updatedAt`},...i?.fields,...e.user?.additionalFields},order:1},...!e.secondaryStorage||e.session?.storeSessionInDatabase?c:{},account:{modelName:e.account?.modelName||`account`,fields:{accountId:{type:`string`,required:!0,fieldName:e.account?.fields?.accountId||`accountId`},providerId:{type:`string`,required:!0,fieldName:e.account?.fields?.providerId||`providerId`},userId:{type:`string`,references:{model:e.user?.modelName||`user`,field:`id`,onDelete:`cascade`},required:!0,fieldName:e.account?.fields?.userId||`userId`,index:!0},accessToken:{type:`string`,required:!1,fieldName:e.account?.fields?.accessToken||`accessToken`},refreshToken:{type:`string`,required:!1,fieldName:e.account?.fields?.refreshToken||`refreshToken`},idToken:{type:`string`,required:!1,fieldName:e.account?.fields?.idToken||`idToken`},accessTokenExpiresAt:{type:`date`,required:!1,fieldName:e.account?.fields?.accessTokenExpiresAt||`accessTokenExpiresAt`},refreshTokenExpiresAt:{type:`date`,required:!1,fieldName:e.account?.fields?.refreshTokenExpiresAt||`refreshTokenExpiresAt`},scope:{type:`string`,required:!1,fieldName:e.account?.fields?.scope||`scope`},password:{type:`string`,required:!1,fieldName:e.account?.fields?.password||`password`},createdAt:{type:`date`,required:!0,fieldName:e.account?.fields?.createdAt||`createdAt`,defaultValue:()=>new Date},updatedAt:{type:`date`,required:!0,fieldName:e.account?.fields?.updatedAt||`updatedAt`,onUpdate:()=>new Date},...o?.fields,...e.account?.additionalFields},order:3},verification:{modelName:e.verification?.modelName||`verification`,fields:{identifier:{type:`string`,required:!0,fieldName:e.verification?.fields?.identifier||`identifier`,index:!0},value:{type:`string`,required:!0,fieldName:e.verification?.fields?.value||`value`},expiresAt:{type:`date`,required:!0,fieldName:e.verification?.fields?.expiresAt||`expiresAt`},createdAt:{type:`date`,required:!0,defaultValue:()=>new Date,fieldName:e.verification?.fields?.createdAt||`createdAt`},updatedAt:{type:`date`,required:!0,defaultValue:()=>new Date,onUpdate:()=>new Date,fieldName:e.verification?.fields?.updatedAt||`updatedAt`}},order:4},...s,...n?r:{}}};function n(e){return e}const r=n({USER_NOT_FOUND:`User not found`,FAILED_TO_CREATE_USER:`Failed to create user`,FAILED_TO_CREATE_SESSION:`Failed to create session`,FAILED_TO_UPDATE_USER:`Failed to update user`,FAILED_TO_GET_SESSION:`Failed to get session`,INVALID_PASSWORD:`Invalid password`,INVALID_EMAIL:`Invalid email`,INVALID_EMAIL_OR_PASSWORD:`Invalid email or password`,SOCIAL_ACCOUNT_ALREADY_LINKED:`Social account already linked`,PROVIDER_NOT_FOUND:`Provider not found`,INVALID_TOKEN:`Invalid token`,ID_TOKEN_NOT_SUPPORTED:`id_token not supported`,FAILED_TO_GET_USER_INFO:`Failed to get user info`,USER_EMAIL_NOT_FOUND:`User email not found`,EMAIL_NOT_VERIFIED:`Email not verified`,PASSWORD_TOO_SHORT:`Password too short`,PASSWORD_TOO_LONG:`Password too long`,USER_ALREADY_EXISTS:`User already exists.`,USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL:`User already exists. Use another email.`,EMAIL_CAN_NOT_BE_UPDATED:`Email can not be updated`,CREDENTIAL_ACCOUNT_NOT_FOUND:`Credential account not found`,SESSION_EXPIRED:`Session expired. Re-authenticate to perform this action.`,FAILED_TO_UNLINK_LAST_ACCOUNT:`You can't unlink your last account`,ACCOUNT_NOT_FOUND:`Account not found`,USER_ALREADY_HAS_PASSWORD:`User already has a password. Provide that to delete the account.`});var i=class extends Error{constructor(e,t){super(e),this.name=`BetterAuthError`,this.message=e,this.cause=t,this.stack=``}};function a(e){return e?`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`:`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`}function o(e,t,n){let r=``,i=0,a=0;for(let n of e)for(i=i<<8|n,a+=8;a>=6;)a-=6,r+=t[i>>a&63];if(a>0&&(r+=t[i<<6-a&63]),n){let e=(4-r.length%4)%4;r+=`=`.repeat(e)}return r}function s(e,t){let n=new Map;for(let e=0;e<t.length;e++)n.set(t[e],e);let r=[],i=0,a=0;for(let t of e){if(t===`=`)break;let e=n.get(t);if(e===void 0)throw Error(`Invalid Base64 character: ${t}`);i=i<<6|e,a+=6,a>=8&&(a-=8,r.push(i>>a&255))}return Uint8Array.from(r)}const c={encode(e,t={}){let n=a(!1);return o(typeof e==`string`?new TextEncoder().encode(e):new Uint8Array(e),n,t.padding??!0)},decode(e){typeof e!=`string`&&(e=new TextDecoder().decode(e));let t=a(e.includes(`-`)||e.includes(`_`));return s(e,t)}},l={encode(e,t={}){let n=a(!0);return o(typeof e==`string`?new TextEncoder().encode(e):new Uint8Array(e),n,t.padding??!0)},decode(e){return s(e,a(e.includes(`-`)||e.includes(`_`)))}};function u(){let e=typeof globalThis<`u`&&globalThis.crypto;if(e&&typeof e.subtle==`object`&&e.subtle!=null)return e.subtle;throw Error(`crypto.subtle must be defined`)}function d(e,t){return{digest:async n=>{let r=new TextEncoder,i=typeof n==`string`?r.encode(n):n,a=await u().digest(e,i);return t===`hex`?Array.from(new Uint8Array(a)).map(e=>e.toString(16).padStart(2,`0`)).join(``):t===`base64`||t===`base64url`||t===`base64urlnopad`?t.includes(`url`)?l.encode(a,{padding:t!==`base64urlnopad`}):c.encode(a):a}}}
2
+ /*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */
3
+ function f(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`}function p(e){if(typeof e!=`boolean`)throw Error(`boolean expected, not ${e}`)}function m(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`positive integer expected, got `+e)}function h(e,t,n=``){let r=f(e),i=e?.length,a=t!==void 0;if(!r||a&&i!==t){let o=n&&`"${n}" `,s=a?` of length ${t}`:``,c=r?`length=${i}`:`type=${typeof e}`;throw Error(o+`expected Uint8Array`+s+`, got `+c)}return e}function g(e,t=!0){if(e.destroyed)throw Error(`Hash instance has been destroyed`);if(t&&e.finished)throw Error(`Hash#digest() has already been called`)}function _(e,t){h(e,void 0,`output`);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least `+n)}function v(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function y(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function ee(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}const te=(()=>new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68)(),b=(()=>typeof Uint8Array.from([]).toHex==`function`&&typeof Uint8Array.fromHex==`function`)(),ne=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function x(e){if(h(e),b)return e.toHex();let t=``;for(let n=0;n<e.length;n++)t+=ne[e[n]];return t}const S={_0:48,_9:57,A:65,F:70,a:97,f:102};function C(e){if(e>=S._0&&e<=S._9)return e-S._0;if(e>=S.A&&e<=S.F)return e-(S.A-10);if(e>=S.a&&e<=S.f)return e-(S.a-10)}function w(e){if(typeof e!=`string`)throw Error(`hex string expected, got `+typeof e);if(b)return Uint8Array.fromHex(e);let t=e.length,n=t/2;if(t%2)throw Error(`hex string expected, got unpadded hex of length `+t);let r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){let n=C(e.charCodeAt(i)),a=C(e.charCodeAt(i+1));if(n===void 0||a===void 0){let t=e[i]+e[i+1];throw Error(`hex string expected, got non-hex character "`+t+`" at index `+i)}r[t]=n*16+a}return r}function T(e){if(typeof e!=`string`)throw Error(`string expected`);return new Uint8Array(new TextEncoder().encode(e))}function E(...e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];h(r),t+=r.length}let n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){let i=e[t];n.set(i,r),r+=i.length}return n}function D(e,t){if(typeof t!=`object`||!t)throw Error(`options must be defined`);return Object.assign(e,t)}function O(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return n===0}const k=(e,t)=>{function n(n,...r){if(h(n,void 0,`key`),!te)throw Error(`Non little-endian hardware is not yet supported`);if(e.nonceLength!==void 0){let t=r[0];h(t,e.varSizeNonce?void 0:e.nonceLength,`nonce`)}let i=e.tagLength;i&&r[1]!==void 0&&h(r[1],void 0,`AAD`);let a=t(n,...r),o=(e,t)=>{if(t!==void 0){if(e!==2)throw Error(`cipher output not supported`);h(t,void 0,`output`)}},s=!1;return{encrypt(e,t){if(s)throw Error(`cannot encrypt() twice with same key + nonce`);return s=!0,h(e),o(a.encrypt.length,t),a.encrypt(e,t)},decrypt(e,t){if(h(e),i&&e.length<i)throw Error(`"ciphertext" expected length bigger than tagLength=`+i);return o(a.decrypt.length,t),a.decrypt(e,t)}}}return Object.assign(n,e),n};function A(e,t,n=!0){if(t===void 0)return new Uint8Array(e);if(t.length!==e)throw Error(`"output" expected Uint8Array of length `+e+`, got: `+t.length);if(n&&!M(t))throw Error(`invalid output, must be aligned`);return t}function j(e,t,n){p(n);let r=new Uint8Array(16),i=ee(r);return i.setBigUint64(0,BigInt(t),n),i.setBigUint64(8,BigInt(e),n),r}function M(e){return e.byteOffset%4==0}function N(e){return Uint8Array.from(e)}function P(e=32){let t=typeof globalThis==`object`?globalThis.crypto:null;if(typeof t?.getRandomValues!=`function`)throw Error(`crypto.getRandomValues must be defined`);return t.getRandomValues(new Uint8Array(e))}function F(e,t=P){let{nonceLength:n}=e;m(n);let r=(e,t)=>{let n=E(e,t);return t.fill(0),n};return((i,...a)=>({encrypt(o){h(o);let s=t(n),c=e(i,s,...a).encrypt(o);return c instanceof Promise?c.then(e=>r(s,e)):r(s,c)},decrypt(t){h(t);let r=t.subarray(0,n),o=t.subarray(n);return e(i,r,...a).decrypt(o)}}))}const re=e=>Uint8Array.from(e.split(``),e=>e.charCodeAt(0)),ie=re(`expand 16-byte k`),ae=re(`expand 32-byte k`),oe=v(ie),se=v(ae);function I(e,t){return e<<t|e>>>32-t}function ce(e){return e.byteOffset%4==0}const le=2**32-1,ue=Uint32Array.of();function de(e,t,n,r,i,a,o,s){let c=i.length,l=new Uint8Array(64),u=v(l),d=ce(i)&&ce(a),f=d?v(i):ue,p=d?v(a):ue;for(let m=0;m<c;o++){if(e(t,n,r,u,o,s),o>=le)throw Error(`arx: counter overflow`);let h=Math.min(64,c-m);if(d&&h===64){let e=m/4;if(m%4!=0)throw Error(`arx: invalid block position`);for(let t=0,n;t<16;t++)n=e+t,p[n]=f[n]^u[t];m+=64;continue}for(let e=0,t;e<h;e++)t=m+e,a[t]=i[t]^l[e];m+=h}}function fe(e,t){let{allowShortKeys:n,extendNonceFn:r,counterLength:i,counterRight:a,rounds:o}=D({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},t);if(typeof e!=`function`)throw Error(`core must be a function`);return m(i),m(o),p(a),p(n),(t,s,c,l,u=0)=>{h(t,void 0,`key`),h(s,void 0,`nonce`),h(c,void 0,`data`);let d=c.length;if(l===void 0&&(l=new Uint8Array(d)),h(l,void 0,`output`),m(u),u<0||u>=le)throw Error(`arx: counter overflow`);if(l.length<d)throw Error(`arx: output (${l.length}) is shorter than data (${d})`);let f=[],p=t.length,g,_;if(p===32)f.push(g=N(t)),_=se;else if(p===16&&n)g=new Uint8Array(32),g.set(t),g.set(t,16),_=oe,f.push(g);else throw h(t,32,`arx key`),Error(`invalid key size`);ce(s)||f.push(s=N(s));let ee=v(g);if(r){if(s.length!==24)throw Error(`arx: extended nonce must be 24 bytes`);r(_,ee,v(s.subarray(0,16)),ee),s=s.subarray(16)}let te=16-i;if(te!==s.length)throw Error(`arx: nonce must be ${te} or 16 bytes`);if(te!==12){let e=new Uint8Array(12);e.set(s,a?0:12-s.length),s=e,f.push(s)}let b=v(s);return de(e,_,ee,b,c,l,u,o),y(...f),l}}function pe(e,t){return e[t++]&255|(e[t++]&255)<<8}var me=class{blockLen=16;outputLen=16;buffer=new Uint8Array(16);r=new Uint16Array(10);h=new Uint16Array(10);pad=new Uint16Array(8);pos=0;finished=!1;constructor(e){e=N(h(e,32,`key`));let t=pe(e,0),n=pe(e,2),r=pe(e,4),i=pe(e,6),a=pe(e,8),o=pe(e,10),s=pe(e,12),c=pe(e,14);this.r[0]=t&8191,this.r[1]=(t>>>13|n<<3)&8191,this.r[2]=(n>>>10|r<<6)&7939,this.r[3]=(r>>>7|i<<9)&8191,this.r[4]=(i>>>4|a<<12)&255,this.r[5]=a>>>1&8190,this.r[6]=(a>>>14|o<<2)&8191,this.r[7]=(o>>>11|s<<5)&8065,this.r[8]=(s>>>8|c<<8)&8191,this.r[9]=c>>>5&127;for(let t=0;t<8;t++)this.pad[t]=pe(e,16+2*t)}process(e,t,n=!1){let r=n?0:2048,{h:i,r:a}=this,o=a[0],s=a[1],c=a[2],l=a[3],u=a[4],d=a[5],f=a[6],p=a[7],m=a[8],h=a[9],g=pe(e,t+0),_=pe(e,t+2),v=pe(e,t+4),y=pe(e,t+6),ee=pe(e,t+8),te=pe(e,t+10),b=pe(e,t+12),ne=pe(e,t+14),x=i[0]+(g&8191),S=i[1]+((g>>>13|_<<3)&8191),C=i[2]+((_>>>10|v<<6)&8191),w=i[3]+((v>>>7|y<<9)&8191),T=i[4]+((y>>>4|ee<<12)&8191),E=i[5]+(ee>>>1&8191),D=i[6]+((ee>>>14|te<<2)&8191),O=i[7]+((te>>>11|b<<5)&8191),k=i[8]+((b>>>8|ne<<8)&8191),A=i[9]+(ne>>>5|r),j=0,M=j+x*o+S*(5*h)+C*(5*m)+w*(5*p)+T*(5*f);j=M>>>13,M&=8191,M+=E*(5*d)+D*(5*u)+O*(5*l)+k*(5*c)+A*(5*s),j+=M>>>13,M&=8191;let N=j+x*s+S*o+C*(5*h)+w*(5*m)+T*(5*p);j=N>>>13,N&=8191,N+=E*(5*f)+D*(5*d)+O*(5*u)+k*(5*l)+A*(5*c),j+=N>>>13,N&=8191;let P=j+x*c+S*s+C*o+w*(5*h)+T*(5*m);j=P>>>13,P&=8191,P+=E*(5*p)+D*(5*f)+O*(5*d)+k*(5*u)+A*(5*l),j+=P>>>13,P&=8191;let F=j+x*l+S*c+C*s+w*o+T*(5*h);j=F>>>13,F&=8191,F+=E*(5*m)+D*(5*p)+O*(5*f)+k*(5*d)+A*(5*u),j+=F>>>13,F&=8191;let re=j+x*u+S*l+C*c+w*s+T*o;j=re>>>13,re&=8191,re+=E*(5*h)+D*(5*m)+O*(5*p)+k*(5*f)+A*(5*d),j+=re>>>13,re&=8191;let ie=j+x*d+S*u+C*l+w*c+T*s;j=ie>>>13,ie&=8191,ie+=E*o+D*(5*h)+O*(5*m)+k*(5*p)+A*(5*f),j+=ie>>>13,ie&=8191;let ae=j+x*f+S*d+C*u+w*l+T*c;j=ae>>>13,ae&=8191,ae+=E*s+D*o+O*(5*h)+k*(5*m)+A*(5*p),j+=ae>>>13,ae&=8191;let oe=j+x*p+S*f+C*d+w*u+T*l;j=oe>>>13,oe&=8191,oe+=E*c+D*s+O*o+k*(5*h)+A*(5*m),j+=oe>>>13,oe&=8191;let se=j+x*m+S*p+C*f+w*d+T*u;j=se>>>13,se&=8191,se+=E*l+D*c+O*s+k*o+A*(5*h),j+=se>>>13,se&=8191;let I=j+x*h+S*m+C*p+w*f+T*d;j=I>>>13,I&=8191,I+=E*u+D*l+O*c+k*s+A*o,j+=I>>>13,I&=8191,j=(j<<2)+j|0,j=j+M|0,M=j&8191,j>>>=13,N+=j,i[0]=M,i[1]=N,i[2]=P,i[3]=F,i[4]=re,i[5]=ie,i[6]=ae,i[7]=oe,i[8]=se,i[9]=I}finalize(){let{h:e,pad:t}=this,n=new Uint16Array(10),r=e[1]>>>13;e[1]&=8191;for(let t=2;t<10;t++)e[t]+=r,r=e[t]>>>13,e[t]&=8191;e[0]+=r*5,r=e[0]>>>13,e[0]&=8191,e[1]+=r,r=e[1]>>>13,e[1]&=8191,e[2]+=r,n[0]=e[0]+5,r=n[0]>>>13,n[0]&=8191;for(let t=1;t<10;t++)n[t]=e[t]+r,r=n[t]>>>13,n[t]&=8191;n[9]-=8192;let i=(r^1)-1;for(let e=0;e<10;e++)n[e]&=i;i=~i;for(let t=0;t<10;t++)e[t]=e[t]&i|n[t];e[0]=(e[0]|e[1]<<13)&65535,e[1]=(e[1]>>>3|e[2]<<10)&65535,e[2]=(e[2]>>>6|e[3]<<7)&65535,e[3]=(e[3]>>>9|e[4]<<4)&65535,e[4]=(e[4]>>>12|e[5]<<1|e[6]<<14)&65535,e[5]=(e[6]>>>2|e[7]<<11)&65535,e[6]=(e[7]>>>5|e[8]<<8)&65535,e[7]=(e[8]>>>8|e[9]<<5)&65535;let a=e[0]+t[0];e[0]=a&65535;for(let n=1;n<8;n++)a=(e[n]+t[n]|0)+(a>>>16)|0,e[n]=a&65535;y(n)}update(e){g(this),h(e),e=N(e);let{buffer:t,blockLen:n}=this,r=e.length;for(let i=0;i<r;){let a=Math.min(n-this.pos,r-i);if(a===n){for(;n<=r-i;i+=n)this.process(e,i);continue}t.set(e.subarray(i,i+a),this.pos),this.pos+=a,i+=a,this.pos===n&&(this.process(t,0,!1),this.pos=0)}return this}destroy(){y(this.h,this.r,this.buffer,this.pad)}digestInto(e){g(this),_(e,this),this.finished=!0;let{buffer:t,h:n}=this,{pos:r}=this;if(r){for(t[r++]=1;r<16;r++)t[r]=0;this.process(t,0,!0)}this.finalize();let i=0;for(let t=0;t<8;t++)e[i++]=n[t]>>>0,e[i++]=n[t]>>>8;return e}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}};function he(e){let t=(t,n)=>e(n).update(t).digest(),n=e(new Uint8Array(32));return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t}const ge=(()=>he(e=>new me(e)))();function _e(e,t,n,r,i,a=20){let o=e[0],s=e[1],c=e[2],l=e[3],u=t[0],d=t[1],f=t[2],p=t[3],m=t[4],h=t[5],g=t[6],_=t[7],v=i,y=n[0],ee=n[1],te=n[2],b=o,ne=s,x=c,S=l,C=u,w=d,T=f,E=p,D=m,O=h,k=g,A=_,j=v,M=y,N=ee,P=te;for(let e=0;e<a;e+=2)b=b+C|0,j=I(j^b,16),D=D+j|0,C=I(C^D,12),b=b+C|0,j=I(j^b,8),D=D+j|0,C=I(C^D,7),ne=ne+w|0,M=I(M^ne,16),O=O+M|0,w=I(w^O,12),ne=ne+w|0,M=I(M^ne,8),O=O+M|0,w=I(w^O,7),x=x+T|0,N=I(N^x,16),k=k+N|0,T=I(T^k,12),x=x+T|0,N=I(N^x,8),k=k+N|0,T=I(T^k,7),S=S+E|0,P=I(P^S,16),A=A+P|0,E=I(E^A,12),S=S+E|0,P=I(P^S,8),A=A+P|0,E=I(E^A,7),b=b+w|0,P=I(P^b,16),k=k+P|0,w=I(w^k,12),b=b+w|0,P=I(P^b,8),k=k+P|0,w=I(w^k,7),ne=ne+T|0,j=I(j^ne,16),A=A+j|0,T=I(T^A,12),ne=ne+T|0,j=I(j^ne,8),A=A+j|0,T=I(T^A,7),x=x+E|0,M=I(M^x,16),D=D+M|0,E=I(E^D,12),x=x+E|0,M=I(M^x,8),D=D+M|0,E=I(E^D,7),S=S+C|0,N=I(N^S,16),O=O+N|0,C=I(C^O,12),S=S+C|0,N=I(N^S,8),O=O+N|0,C=I(C^O,7);let F=0;r[F++]=o+b|0,r[F++]=s+ne|0,r[F++]=c+x|0,r[F++]=l+S|0,r[F++]=u+C|0,r[F++]=d+w|0,r[F++]=f+T|0,r[F++]=p+E|0,r[F++]=m+D|0,r[F++]=h+O|0,r[F++]=g+k|0,r[F++]=_+A|0,r[F++]=v+j|0,r[F++]=y+M|0,r[F++]=ee+N|0,r[F++]=te+P|0}function ve(e,t,n,r){let i=e[0],a=e[1],o=e[2],s=e[3],c=t[0],l=t[1],u=t[2],d=t[3],f=t[4],p=t[5],m=t[6],h=t[7],g=n[0],_=n[1],v=n[2],y=n[3];for(let e=0;e<20;e+=2)i=i+c|0,g=I(g^i,16),f=f+g|0,c=I(c^f,12),i=i+c|0,g=I(g^i,8),f=f+g|0,c=I(c^f,7),a=a+l|0,_=I(_^a,16),p=p+_|0,l=I(l^p,12),a=a+l|0,_=I(_^a,8),p=p+_|0,l=I(l^p,7),o=o+u|0,v=I(v^o,16),m=m+v|0,u=I(u^m,12),o=o+u|0,v=I(v^o,8),m=m+v|0,u=I(u^m,7),s=s+d|0,y=I(y^s,16),h=h+y|0,d=I(d^h,12),s=s+d|0,y=I(y^s,8),h=h+y|0,d=I(d^h,7),i=i+l|0,y=I(y^i,16),m=m+y|0,l=I(l^m,12),i=i+l|0,y=I(y^i,8),m=m+y|0,l=I(l^m,7),a=a+u|0,g=I(g^a,16),h=h+g|0,u=I(u^h,12),a=a+u|0,g=I(g^a,8),h=h+g|0,u=I(u^h,7),o=o+d|0,_=I(_^o,16),f=f+_|0,d=I(d^f,12),o=o+d|0,_=I(_^o,8),f=f+_|0,d=I(d^f,7),s=s+c|0,v=I(v^s,16),p=p+v|0,c=I(c^p,12),s=s+c|0,v=I(v^s,8),p=p+v|0,c=I(c^p,7);let ee=0;r[ee++]=i,r[ee++]=a,r[ee++]=o,r[ee++]=s,r[ee++]=g,r[ee++]=_,r[ee++]=v,r[ee++]=y}const ye=fe(_e,{counterRight:!1,counterLength:8,extendNonceFn:ve,allowShortKeys:!1}),be=new Uint8Array(16),xe=(e,t)=>{e.update(t);let n=t.length%16;n&&e.update(be.subarray(n))},Se=new Uint8Array(32);function Ce(e,t,n,r,i){i!==void 0&&h(i,void 0,`AAD`);let a=e(t,n,Se),o=j(r.length,i?i.length:0,!0),s=ge.create(a);i&&xe(s,i),xe(s,r),s.update(o);let c=s.digest();return y(a,o),c}const we=k({blockSize:64,nonceLength:24,tagLength:16},(e=>(t,n,r)=>({encrypt(i,a){let o=i.length;a=A(o+16,a,!1),a.set(i);let s=a.subarray(0,-16);e(t,n,s,s,1);let c=Ce(e,t,n,s,r);return a.set(c,o),y(c),a},decrypt(i,a){a=A(i.length-16,a,!1);let o=i.subarray(0,-16),s=i.subarray(-16),c=Ce(e,t,n,o,r);if(!O(s,c))throw Error(`invalid tag`);return a.set(i.subarray(0,-16)),e(t,n,a,a,1),y(c),a}}))(ye)),Te={encode:e=>{if(typeof e==`string`&&(e=new TextEncoder().encode(e)),e.byteLength===0)return``;let t=new Uint8Array(e),n=``;for(let e of t)n+=e.toString(16).padStart(2,`0`);return n},decode:e=>{if(!e)return``;if(typeof e==`string`){if(e.length%2!=0||!RegExp(`^[0123456789abcdef]+$`).test(e))throw Error(`Invalid hexadecimal string`);let t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2)t[n/2]=parseInt(e.slice(n,n+2),16);return new TextDecoder().decode(t)}return new TextDecoder().decode(e)}};
4
+ /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
5
+ function Ee(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`}function De(e,t=``){if(!Number.isSafeInteger(e)||e<0){let n=t&&`"${t}" `;throw Error(`${n}expected integer >= 0, got ${e}`)}}function Oe(e,t,n=``){let r=Ee(e),i=e?.length,a=t!==void 0;if(!r||a&&i!==t){let o=n&&`"${n}" `,s=a?` of length ${t}`:``,c=r?`length=${i}`:`type=${typeof e}`;throw Error(o+`expected Uint8Array`+s+`, got `+c)}return e}function ke(e){if(typeof e!=`function`||typeof e.create!=`function`)throw Error(`Hash must wrapped by utils.createHasher`);De(e.outputLen),De(e.blockLen)}function Ae(e,t=!0){if(e.destroyed)throw Error(`Hash instance has been destroyed`);if(t&&e.finished)throw Error(`Hash#digest() has already been called`)}function je(e,t){Oe(e,void 0,`digestInto() output`);let n=t.outputLen;if(e.length<n)throw Error(`"digestInto() output" expected to be of length >=`+n)}function Me(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Ne(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Pe(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Fe(e,t){return e<<32-t|e>>>t}function L(e,t){return e<<t|e>>>32-t>>>0}const Ie=(()=>new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68)();function Le(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function Re(e){for(let t=0;t<e.length;t++)e[t]=Le(e[t]);return e}const ze=Ie?e=>e:Re,Be=(()=>typeof Uint8Array.from([]).toHex==`function`&&typeof Uint8Array.fromHex==`function`)(),Ve={_0:48,_9:57,A:65,F:70,a:97,f:102};function He(e){if(e>=Ve._0&&e<=Ve._9)return e-Ve._0;if(e>=Ve.A&&e<=Ve.F)return e-(Ve.A-10);if(e>=Ve.a&&e<=Ve.f)return e-(Ve.a-10)}function Ue(e){if(typeof e!=`string`)throw Error(`hex string expected, got `+typeof e);if(Be)return Uint8Array.fromHex(e);let t=e.length,n=t/2;if(t%2)throw Error(`hex string expected, got unpadded hex of length `+t);let r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){let n=He(e.charCodeAt(i)),a=He(e.charCodeAt(i+1));if(n===void 0||a===void 0){let t=e[i]+e[i+1];throw Error(`hex string expected, got non-hex character "`+t+`" at index `+i)}r[t]=n*16+a}return r}const We=async()=>{};async function Ge(e,t,n){let r=Date.now();for(let i=0;i<e;i++){n(i);let e=Date.now()-r;e>=0&&e<t||(await We(),r+=e)}}function Ke(e){if(typeof e!=`string`)throw Error(`string expected`);return new Uint8Array(new TextEncoder().encode(e))}function qe(e,t=``){return typeof e==`string`?Ke(e):Oe(e,void 0,t)}function Je(e,t){if(t!==void 0&&{}.toString.call(t)!==`[object Object]`)throw Error(`options must be object or undefined`);return Object.assign(e,t)}function Ye(e,t={}){let n=(t,n)=>e(n).update(t).digest(),r=e(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.create=t=>e(t),Object.assign(n,t),Object.freeze(n)}const Xe=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});var Ze=class{oHash;iHash;blockLen;outputLen;finished=!1;destroyed=!1;constructor(e,t){if(ke(e),Oe(t,void 0,`key`),this.iHash=e.create(),typeof this.iHash.update!=`function`)throw Error(`Expected instance of class which extends utils.Hash`);this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let n=this.blockLen,r=new Uint8Array(n);r.set(t.length>n?e.create().update(t).digest():t);for(let e=0;e<r.length;e++)r[e]^=54;this.iHash.update(r),this.oHash=e.create();for(let e=0;e<r.length;e++)r[e]^=106;this.oHash.update(r),Ne(r)}update(e){return Ae(this),this.iHash.update(e),this}digestInto(e){Ae(this),Oe(e,this.outputLen,`output`),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||=Object.create(Object.getPrototypeOf(this),{});let{oHash:t,iHash:n,finished:r,destroyed:i,blockLen:a,outputLen:o}=this;return e=e,e.finished=r,e.destroyed=i,e.blockLen=a,e.outputLen=o,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};const Qe=(e,t,n)=>new Ze(e,t).update(n).digest();Qe.create=(e,t)=>new Ze(e,t);function $e(e,t,n,r){ke(e);let{c:i,dkLen:a,asyncTick:o}=Je({dkLen:32,asyncTick:10},r);if(De(i,`c`),De(a,`dkLen`),De(o,`asyncTick`),i<1)throw Error(`iterations (c) must be >= 1`);let s=qe(t,`password`),c=qe(n,`salt`),l=new Uint8Array(a),u=Qe.create(e,s);return{c:i,dkLen:a,asyncTick:o,DK:l,PRF:u,PRFSalt:u._cloneInto().update(c)}}function et(e,t,n,r,i){return e.destroy(),t.destroy(),r&&r.destroy(),Ne(i),n}function tt(e,t,n,r){let{c:i,dkLen:a,DK:o,PRF:s,PRFSalt:c}=$e(e,t,n,r),l,u=new Uint8Array(4),d=Pe(u),f=new Uint8Array(s.outputLen);for(let e=1,t=0;t<a;e++,t+=s.outputLen){let n=o.subarray(t,t+s.outputLen);d.setInt32(0,e,!1),(l=c._cloneInto(l)).update(u).digestInto(f),n.set(f.subarray(0,n.length));for(let e=1;e<i;e++){s._cloneInto(l).update(f).digestInto(f);for(let e=0;e<n.length;e++)n[e]^=f[e]}}return et(s,c,o,l,f)}function nt(e,t,n){return e&t^~e&n}function rt(e,t,n){return e&t^e&n^t&n}var it=class{blockLen;outputLen;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,t,n,r){this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=Pe(this.buffer)}update(e){Ae(this),Oe(e);let{view:t,buffer:n,blockLen:r}=this,i=e.length;for(let a=0;a<i;){let o=Math.min(r-this.pos,i-a);if(o===r){let t=Pe(e);for(;r<=i-a;a+=r)this.process(t,a);continue}n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Ae(this),je(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:a}=this;t[a++]=128,Ne(this.buffer.subarray(a)),this.padOffset>r-a&&(this.process(n,0),a=0);for(let e=a;e<r;e++)t[e]=0;n.setBigUint64(r-8,BigInt(this.length*8),i),this.process(n,0);let o=Pe(e),s=this.outputLen;if(s%4)throw Error(`_sha2: outputLen must be aligned to 32bit`);let c=s/4,l=this.get();if(c>l.length)throw Error(`_sha2: outputLen bigger than state`);for(let e=0;e<c;e++)o.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:n,length:r,finished:i,destroyed:a,pos:o}=this;return e.destroyed=a,e.finished=i,e.length=r,e.pos=o,r%t&&e.buffer.set(n),e}clone(){return this._cloneInto()}};const at=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ot=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),st=new Uint32Array(64);var ct=class extends it{constructor(e){super(64,e,8,!1)}get(){let{A:e,B:t,C:n,D:r,E:i,F:a,G:o,H:s}=this;return[e,t,n,r,i,a,o,s]}set(e,t,n,r,i,a,o,s){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0,this.F=a|0,this.G=o|0,this.H=s|0}process(e,t){for(let n=0;n<16;n++,t+=4)st[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=st[e-15],n=st[e-2],r=Fe(t,7)^Fe(t,18)^t>>>3;st[e]=(Fe(n,17)^Fe(n,19)^n>>>10)+st[e-7]+r+st[e-16]|0}let{A:n,B:r,C:i,D:a,E:o,F:s,G:c,H:l}=this;for(let e=0;e<64;e++){let t=Fe(o,6)^Fe(o,11)^Fe(o,25),u=l+t+nt(o,s,c)+ot[e]+st[e]|0,d=(Fe(n,2)^Fe(n,13)^Fe(n,22))+rt(n,r,i)|0;l=c,c=s,s=o,o=a+u|0,a=i,i=r,r=n,n=u+d|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,a=a+this.D|0,o=o+this.E|0,s=s+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,i,a,o,s,c,l)}roundClean(){Ne(st)}destroy(){this.set(0,0,0,0,0,0,0,0),Ne(this.buffer)}},lt=class extends ct{A=at[0]|0;B=at[1]|0;C=at[2]|0;D=at[3]|0;E=at[4]|0;F=at[5]|0;G=at[6]|0;H=at[7]|0;constructor(){super(32)}};const ut=Ye(()=>new lt,Xe(1));function dt(e,t,n,r,i,a){let o=e[t++]^n[r++],s=e[t++]^n[r++],c=e[t++]^n[r++],l=e[t++]^n[r++],u=e[t++]^n[r++],d=e[t++]^n[r++],f=e[t++]^n[r++],p=e[t++]^n[r++],m=e[t++]^n[r++],h=e[t++]^n[r++],g=e[t++]^n[r++],_=e[t++]^n[r++],v=e[t++]^n[r++],y=e[t++]^n[r++],ee=e[t++]^n[r++],te=e[t++]^n[r++],b=o,ne=s,x=c,S=l,C=u,w=d,T=f,E=p,D=m,O=h,k=g,A=_,j=v,M=y,N=ee,P=te;for(let e=0;e<8;e+=2)C^=L(b+j|0,7),D^=L(C+b|0,9),j^=L(D+C|0,13),b^=L(j+D|0,18),O^=L(w+ne|0,7),M^=L(O+w|0,9),ne^=L(M+O|0,13),w^=L(ne+M|0,18),N^=L(k+T|0,7),x^=L(N+k|0,9),T^=L(x+N|0,13),k^=L(T+x|0,18),S^=L(P+A|0,7),E^=L(S+P|0,9),A^=L(E+S|0,13),P^=L(A+E|0,18),ne^=L(b+S|0,7),x^=L(ne+b|0,9),S^=L(x+ne|0,13),b^=L(S+x|0,18),T^=L(w+C|0,7),E^=L(T+w|0,9),C^=L(E+T|0,13),w^=L(C+E|0,18),A^=L(k+O|0,7),D^=L(A+k|0,9),O^=L(D+A|0,13),k^=L(O+D|0,18),j^=L(P+N|0,7),M^=L(j+P|0,9),N^=L(M+j|0,13),P^=L(N+M|0,18);i[a++]=o+b|0,i[a++]=s+ne|0,i[a++]=c+x|0,i[a++]=l+S|0,i[a++]=u+C|0,i[a++]=d+w|0,i[a++]=f+T|0,i[a++]=p+E|0,i[a++]=m+D|0,i[a++]=h+O|0,i[a++]=g+k|0,i[a++]=_+A|0,i[a++]=v+j|0,i[a++]=y+M|0,i[a++]=ee+N|0,i[a++]=te+P|0}function ft(e,t,n,r,i){let a=r+0,o=r+16*i;for(let r=0;r<16;r++)n[o+r]=e[t+(2*i-1)*16+r];for(let r=0;r<i;r++,a+=16,t+=16)dt(n,o,e,t,n,a),r>0&&(o+=16),dt(n,a,e,t+=16,n,o)}function pt(e,t,n){let{N:r,r:i,p:a,dkLen:o,asyncTick:s,maxmem:c,onProgress:l}=Je({dkLen:32,asyncTick:10,maxmem:1024**3+1024},n);if(De(r,`N`),De(i,`r`),De(a,`p`),De(o,`dkLen`),De(s,`asyncTick`),De(c,`maxmem`),l!==void 0&&typeof l!=`function`)throw Error(`progressCb must be a function`);let u=128*i,d=u/4,f=2**32;if(r<=1||r&r-1||r>f)throw Error(`"N" expected a power of 2, and 2^1 <= N <= 2^32`);if(a<1||a>(f-1)*32/u)throw Error(`"p" expected integer 1..((2^32 - 1) * 32) / (128 * r)`);if(o<1||o>(f-1)*32)throw Error(`"dkLen" expected integer 1..(2^32 - 1) * 32`);if(u*(r+a)>c)throw Error(`"maxmem" limit was hit, expected 128*r*(N+p) <= "maxmem"=`+c);let p=tt(ut,e,t,{c:1,dkLen:u*a}),m=Me(p),h=Me(new Uint8Array(u*r)),g=Me(new Uint8Array(u)),_=()=>{};if(l){let e=2*r*a,t=Math.max(Math.floor(e/1e4),1),n=0;_=()=>{n++,l&&(!(n%t)||n===e)&&l(n/e)}}return{N:r,r:i,p:a,dkLen:o,blockSize32:d,V:h,B32:m,B:p,tmp:g,blockMixCb:_,asyncTick:s}}function mt(e,t,n,r,i){let a=tt(ut,e,n,{c:1,dkLen:t});return Ne(n,r,i),a}async function ht(e,t,n){let{N:r,r:i,p:a,dkLen:o,blockSize32:s,V:c,B32:l,B:u,tmp:d,blockMixCb:f,asyncTick:p}=pt(e,t,n);ze(l);for(let e=0;e<a;e++){let t=s*e;for(let e=0;e<s;e++)c[e]=l[t+e];let n=0;await Ge(r-1,p,()=>{ft(c,n,c,n+=s,i),f()}),ft(c,(r-1)*s,l,t,i),f(),await Ge(r,p,()=>{let e=(l[t+s-16]&r-1)>>>0;for(let n=0;n<s;n++)d[n]=l[t+n]^c[e*s+n];ft(d,0,l,t,i),f()})}return ze(l),mt(e,o,u,c,d)}function gt(e){switch(e){case`a-z`:return`abcdefghijklmnopqrstuvwxyz`;case`A-Z`:return`ABCDEFGHIJKLMNOPQRSTUVWXYZ`;case`0-9`:return`0123456789`;case`-_`:return`-_`;default:throw Error(`Unsupported alphabet: ${e}`)}}function _t(...e){let t=e.map(gt).join(``);if(t.length===0)throw Error(`No valid characters provided for random string generation.`);let n=t.length;return(e,...r)=>{if(e<=0)throw Error(`Length must be a positive integer.`);let i=t,a=n;r.length>0&&(i=r.map(gt).join(``),a=i.length);let o=Math.floor(256/a)*a,s=new Uint8Array(e*2),c=s.length,l=``,u=c,d;for(;l.length<e;)u>=c&&(crypto.getRandomValues(s),u=0),d=s[u++],d<o&&(l+=i[d%a]);return l}}function vt(e,t){let n=new Uint8Array(e),r=new Uint8Array(t),i=n.length^r.length,a=Math.max(n.length,r.length);for(let e=0;e<a;e++)i|=(e<n.length?n[e]:0)^(e<r.length?r[e]:0);return i===0}const yt={N:16384,r:16,p:1,dkLen:64};async function bt(e,t){return await ht(e.normalize(`NFKC`),t,{N:yt.N,p:yt.p,r:yt.r,dkLen:yt.dkLen,maxmem:128*yt.N*yt.r*2})}const xt=async e=>{let t=Te.encode(crypto.getRandomValues(new Uint8Array(16))),n=await bt(e,t);return`${t}:${Te.encode(n)}`},St=async({hash:e,password:t})=>{let[n,r]=e.split(`:`);if(!n||!r)throw new i(`Invalid password hash`);return vt(await bt(t,n),Ue(r))},Ct=_t(`a-z`,`0-9`,`A-Z`,`-_`),wt=async({key:e,data:t})=>{let n=await d(`SHA-256`).digest(e),r=T(t);return x(F(we)(new Uint8Array(n)).encrypt(r))},Tt=async({key:e,data:t})=>{let n=await d(`SHA-256`).digest(e),r=w(t),i=F(we)(new Uint8Array(n));return new TextDecoder().decode(i.decrypt(r))},Et=import(`node:async_hooks`).then(e=>e.AsyncLocalStorage).catch(e=>{if(`AsyncLocalStorage`in globalThis)return globalThis.AsyncLocalStorage;throw console.warn(`[better-auth] Warning: AsyncLocalStorage is not available in this environment. Some features may not work as expected.`),console.warn(`[better-auth] Please read more about this warning at https://better-auth.com/docs/installation#mount-handler`),console.warn(`[better-auth] If you are using Cloudflare Workers, please see: https://developers.cloudflare.com/workers/configuration/compatibility-flags/#nodejs-compatibility-flag`),e});async function Dt(){return Et}let Ot=null;const kt=async()=>(Ot||=new(await(Dt())),Ot);async function At(){let e=(await kt()).getStore();if(!e)throw Error("No auth context found. Please make sure you are calling this function within a `runWithEndpointContext` callback.");return e}async function jt(e,t){return(await kt()).run(e,t)}let Mt=null;const Nt=async()=>(Mt||=new(await(Dt())),Mt);async function Pt(){return(await Nt()).getStore()!==void 0}async function Ft(){let e=(await Nt()).getStore();if(!e)throw Error("No request state found. Please make sure you are calling this function within a `runWithRequestState` callback.");return e}async function It(e,t){return(await Nt()).run(e,t)}function Lt(e){let t=Object.freeze({});return{get ref(){return t},async get(){let n=await Ft();if(!n.has(t)){let r=await e();return n.set(t,r),r}return n.get(t)},async set(e){(await Ft()).set(t,e)}}}let Rt=null;const zt=async()=>(Rt||=new(await(Dt())),Rt),Bt=async e=>zt().then(t=>t.getStore()||e).catch(()=>e),Vt=async(e,t)=>{let n=!0;return zt().then(r=>(n=!0,r.run(e,t))).catch(e=>{if(!n)return t();throw e})},Ht=async(e,t)=>{let n=!0;return zt().then(r=>(n=!0,e.transaction(async e=>r.run(e,t)))).catch(e=>{if(!n)return t();throw e})},Ut=(()=>{let e=function(){};return e.prototype=Object.create(null),e})();function Wt(){return{root:{key:``},static:new Ut}}function Gt(e){return e.split(`/`).filter(Boolean)}function Kt(e,t){let n=new Ut;for(let[r,i]of t){let t=r<0?e.slice(-1*r).join(`/`):e[r];if(typeof i==`string`)n[i]=t;else{let e=t.match(i);if(e)for(let t in e.groups)n[t]=e.groups[t]}}return n}function qt(e,t=``,n,r){let i=Gt(n),a=e.root,o=0,s=[];for(let e=0;e<i.length;e++){let t=i[e];if(t.startsWith(`**`)){a.wildcard||={key:`**`},a=a.wildcard,s.push([-e,t.split(`:`)[1]||`_`,t.length===2]);break}if(t===`*`||t.includes(`:`)){a.param||={key:`*`},a=a.param;let n=t===`*`;s.push([e,n?`_${o++}`:Jt(t),n]);continue}let n=a.static?.[t];if(n)a=n;else{let e={key:t};a.static||=new Ut,a.static[t]=e,a=e}}let c=s.length>0;a.methods||=new Ut,a.methods[t]||(a.methods[t]=[]),a.methods[t].push({data:r||null,paramsMap:c?s:void 0}),c||(e.static[n]=a)}function Jt(e){if(!e.includes(`:`,1))return e.slice(1);let t=e.replace(/:(\w+)/g,(e,t)=>`(?<${t}>\\w+)`);return RegExp(`^${t}$`)}function Yt(e,t=``,n,r){n[n.length-1]===`/`&&(n=n.slice(0,-1));let i=e.static[n];if(i&&i.methods){let e=i.methods[t]||i.methods[``];if(e!==void 0)return e[0]}let a=Gt(n),o=Xt(e,e.root,t,a,0)?.[0];if(o!==void 0)return r?.params===!1?o:{data:o.data,params:o.paramsMap?Kt(a,o.paramsMap):void 0}}function Xt(e,t,n,r,i){if(i===r.length){if(t.methods){let e=t.methods[n]||t.methods[``];if(e)return e}if(t.param&&t.param.methods){let e=t.param.methods[n]||t.param.methods[``];if(e){let t=e[0].paramsMap;if(t?.[t?.length-1]?.[2])return e}}if(t.wildcard&&t.wildcard.methods){let e=t.wildcard.methods[n]||t.wildcard.methods[``];if(e){let t=e[0].paramsMap;if(t?.[t?.length-1]?.[2])return e}}return}let a=r[i];if(t.static){let o=t.static[a];if(o){let t=Xt(e,o,n,r,i+1);if(t)return t}}if(t.param){let a=Xt(e,t.param,n,r,i+1);if(a)return a}if(t.wildcard&&t.wildcard.methods)return t.wildcard.methods[n]||t.wildcard.methods[``]}function Zt(e,t=``,n,r){n[n.length-1]===`/`&&(n=n.slice(0,-1));let i=Gt(n),a=Qt(e,e.root,t,i,0);return r?.params===!1?a:a.map(e=>({data:e.data,params:e.paramsMap?Kt(i,e.paramsMap):void 0}))}function Qt(e,t,n,r,i,a=[]){let o=r[i];if(t.wildcard&&t.wildcard.methods){let e=t.wildcard.methods[n]||t.wildcard.methods[``];e&&a.push(...e)}if(t.param&&(Qt(e,t.param,n,r,i+1,a),i===r.length&&t.param.methods)){let e=t.param.methods[n]||t.param.methods[``];e&&a.push(...e)}let s=t.static?.[o];if(s&&Qt(e,s,n,r,i+1,a),i===r.length&&t.methods){let e=t.methods[n]||t.methods[``];e&&a.push(...e)}return a}function $t(){let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);return e===void 0?Object.isExtensible(Error):Object.prototype.hasOwnProperty.call(e,`writable`)?e.writable:e.set!==void 0}function en(e){let t=e.split(`
6
+ at `);return t.length<=1?e:(t.splice(1,1),t.join(`
7
+ at `))}function tn(e,t){class n extends e{#e;constructor(...e){if($t()){let t=Error.stackTraceLimit;Error.stackTraceLimit=0,super(...e),Error.stackTraceLimit=t}else super(...e);let t=Error().stack;t&&(this.#e=en(t.replace(/^Error/,this.name)))}get errorStack(){return this.#e}}return Object.defineProperty(n.prototype,`constructor`,{get(){return t},enumerable:!1,configurable:!0}),n}const nn={OK:200,CREATED:201,ACCEPTED:202,NO_CONTENT:204,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,TEMPORARY_REDIRECT:307,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,"I'M_A_TEAPOT":418,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE:431,UNAVAILABLE_FOR_LEGAL_REASONS:451,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511};var rn=class extends Error{constructor(e=`INTERNAL_SERVER_ERROR`,t=void 0,n={},r=typeof e==`number`?e:nn[e]){super(t?.message,t?.cause?{cause:t.cause}:void 0),this.status=e,this.body=t,this.headers=n,this.statusCode=r,this.name=`APIError`,this.status=e,this.headers=n,this.statusCode=r,this.body=t?{code:t?.message?.toUpperCase().replace(/ /g,`_`).replace(/[^A-Z0-9_]/g,``),...t}:void 0}},an=class extends Error{constructor(e){super(e),this.name=`BetterCallError`}};const on=tn(rn,Error);async function sn(e){let t=e.headers.get(`content-type`)||``;if(e.body){if(t.includes(`application/json`))return await e.json();if(t.includes(`application/x-www-form-urlencoded`)){let t=await e.formData(),n={};return t.forEach((e,t)=>{n[t]=e.toString()}),n}if(t.includes(`multipart/form-data`)){let t=await e.formData(),n={};return t.forEach((e,t)=>{n[t]=e}),n}return t.includes(`text/plain`)?await e.text():t.includes(`application/octet-stream`)?await e.arrayBuffer():t.includes(`application/pdf`)||t.includes(`image/`)||t.includes(`video/`)?await e.blob():t.includes(`application/stream`)||e.body instanceof ReadableStream?e.body:await e.text()}}function cn(e){return e instanceof on||e?.name===`APIError`}function ln(e){try{return e.includes(`%`)?decodeURIComponent(e):e}catch{return e}}function un(e){if(e===void 0)return!1;let t=typeof e;return t===`string`||t===`number`||t===`boolean`||t===null?!0:t===`object`?Array.isArray(e)?!0:e.buffer?!1:e.constructor&&e.constructor.name===`Object`||typeof e.toJSON==`function`:!1}function dn(e,t,n){let r=0,i=new WeakMap;return JSON.stringify(e,(e,n)=>{if(typeof n==`bigint`)return n.toString();if(typeof n==`object`&&n){if(i.has(n))return`[Circular ref-${i.get(n)}]`;i.set(n,r++)}return t?t(e,n):n},n)}function fn(e){return!e||typeof e!=`object`?!1:`_flag`in e&&e._flag===`json`}function pn(e,t){if(e instanceof Response)return t?.headers instanceof Headers&&t.headers.forEach((t,n)=>{e.headers.set(n,t)}),e;if(fn(e)){let n=e.body,r=e.routerResponse;if(r instanceof Response)return r;let i=new Headers({...r?.headers,...e.headers,...t?.headers,"Content-Type":`application/json`});return new Response(JSON.stringify(n),{...r,headers:i,status:e.status??t?.status??r?.status,statusText:t?.statusText??r?.statusText})}if(cn(e))return pn(e.body,{status:t?.status??e.statusCode,statusText:e.status.toString(),headers:t?.headers||e.headers});let n=e,r=new Headers(t?.headers);return e?typeof e==`string`?(n=e,r.set(`Content-Type`,`text/plain`)):e instanceof ArrayBuffer||ArrayBuffer.isView(e)?(n=e,r.set(`Content-Type`,`application/octet-stream`)):e instanceof Blob?(n=e,r.set(`Content-Type`,e.type||`application/octet-stream`)):e instanceof FormData?n=e:e instanceof URLSearchParams?(n=e,r.set(`Content-Type`,`application/x-www-form-urlencoded`)):e instanceof ReadableStream?(n=e,r.set(`Content-Type`,`application/octet-stream`)):un(e)&&(n=dn(e),r.set(`Content-Type`,`application/json`)):(e===null&&(n=JSON.stringify(null)),r.set(`content-type`,`application/json`)),new Response(n,{...t,headers:r})}async function mn(e,t={}){let n={body:t.body,query:t.query};if(e.body){let r=await e.body[`~standard`].validate(t.body);if(r.issues)return{data:null,error:hn(r.issues,`body`)};n.body=r.value}if(e.query){let r=await e.query[`~standard`].validate(t.query);if(r.issues)return{data:null,error:hn(r.issues,`query`)};n.query=r.value}return e.requireHeaders&&!t.headers?{data:null,error:{message:`Headers is required`}}:e.requireRequest&&!t.request?{data:null,error:{message:`Request is required`}}:{data:n,error:null}}function hn(e,t){let n=[];for(let t of e){let e=t.message;n.push(e)}return{message:`Invalid ${t} parameters`}}const gn={name:`HMAC`,hash:`SHA-256`},_n=async e=>{let t=typeof e==`string`?new TextEncoder().encode(e):e;return await u().importKey(`raw`,t,gn,!1,[`sign`,`verify`])},vn=async(e,t,n)=>{try{let r=atob(e),i=new Uint8Array(r.length);for(let e=0,t=r.length;e<t;e++)i[e]=r.charCodeAt(e);return await u().verify(gn,n,i,new TextEncoder().encode(t))}catch{return!1}},yn=async(e,t)=>{let n=await _n(t),r=await u().sign(gn.name,n,new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(r)))},bn=async(e,t)=>{let n=await yn(e,t);return e=`${e}.${n}`,e=encodeURIComponent(e),e},xn=(e,t)=>{let n=e;if(t)if(t===`secure`)n=`__Secure-`+e;else if(t===`host`)n=`__Host-`+e;else return;return n};function Sn(e){if(typeof e!=`string`)throw TypeError(`argument str must be a string`);let t=new Map,n=0;for(;n<e.length;){let r=e.indexOf(`=`,n);if(r===-1)break;let i=e.indexOf(`;`,n);if(i===-1)i=e.length;else if(i<r){n=e.lastIndexOf(`;`,r-1)+1;continue}let a=e.slice(n,r).trim();if(!t.has(a)){let n=e.slice(r+1,i).trim();n.codePointAt(0)===34&&(n=n.slice(1,-1)),t.set(a,ln(n))}n=i+1}return t}const Cn=(e,t,n={})=>{let r;if(r=n?.prefix===`secure`?`${`__Secure-${e}`}=${t}`:n?.prefix===`host`?`${`__Host-${e}`}=${t}`:`${e}=${t}`,e.startsWith(`__Secure-`)&&!n.secure&&(n.secure=!0),e.startsWith(`__Host-`)&&(n.secure||=!0,n.path!==`/`&&(n.path=`/`),n.domain&&=void 0),n&&typeof n.maxAge==`number`&&n.maxAge>=0){if(n.maxAge>3456e4)throw Error(`Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration.`);r+=`; Max-Age=${Math.floor(n.maxAge)}`}if(n.domain&&n.prefix!==`host`&&(r+=`; Domain=${n.domain}`),n.path&&(r+=`; Path=${n.path}`),n.expires){if(n.expires.getTime()-Date.now()>3456e7)throw Error(`Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future.`);r+=`; Expires=${n.expires.toUTCString()}`}return n.httpOnly&&(r+=`; HttpOnly`),n.secure&&(r+=`; Secure`),n.sameSite&&(r+=`; SameSite=${n.sameSite.charAt(0).toUpperCase()+n.sameSite.slice(1)}`),n.partitioned&&(n.secure||=!0,r+=`; Partitioned`),r},wn=(e,t,n)=>(t=encodeURIComponent(t),Cn(e,t,n)),Tn=async(e,t,n,r)=>(t=await bn(t,n),Cn(e,t,r)),En=async(e,{options:t,path:n})=>{let r=new Headers,i,{data:a,error:o}=await mn(t,e);if(o)throw new on(400,{message:o.message,code:`VALIDATION_ERROR`});let s=`headers`in e?e.headers instanceof Headers?e.headers:new Headers(e.headers):`request`in e&&e.request instanceof Request?e.request.headers:null,c=s?.get(`cookie`),l=c?Sn(c):void 0,u={...e,body:a.body,query:a.query,path:e.path||n,context:`context`in e&&e.context?e.context:{},returned:void 0,headers:e?.headers,request:e?.request,params:`params`in e?e.params:void 0,method:e.method,setHeader:(e,t)=>{r.set(e,t)},getHeader:e=>s?s.get(e):null,getCookie:(e,t)=>{let n=xn(e,t);return n&&l?.get(n)||null},getSignedCookie:async(e,t,n)=>{let r=xn(e,n);if(!r)return null;let i=l?.get(r);if(!i)return null;let a=i.lastIndexOf(`.`);if(a<1)return null;let o=i.substring(0,a),s=i.substring(a+1);return s.length!==44||!s.endsWith(`=`)?null:await vn(s,o,await _n(t))?o:!1},setCookie:(e,t,n)=>{let i=wn(e,t,n);return r.append(`set-cookie`,i),i},setSignedCookie:async(e,t,n,i)=>{let a=await Tn(e,t,n,i);return r.append(`set-cookie`,a),a},redirect:e=>(r.set(`location`,e),new on(`FOUND`,void 0,r)),error:(e,t,n)=>new on(e,t,n),setStatus:e=>{i=e},json:(t,n)=>e.asResponse?{body:n?.body||t,routerResponse:n,_flag:`json`}:t,responseHeaders:r,get responseStatus(){return i}};for(let e of t.use||[]){let t=await e({...u,returnHeaders:!0,asResponse:!1});t.response&&Object.assign(u.context,t.response),t.headers&&t.headers.forEach((e,t)=>{u.responseHeaders.set(t,e)})}return u},Dn=(e,t,n)=>{if((t.method===`GET`||t.method===`HEAD`)&&t.body)throw new an(`Body is not allowed with GET or HEAD methods`);let r=async(...r)=>{let i=r[0]||{},a=await En(i,{options:t,path:e}),o=await n(a).catch(async e=>{if(cn(e)){let n=t.onAPIError;if(n&&await n(e),i.asResponse)return e}throw e}),s=a.responseHeaders,c=a.responseStatus;return i.asResponse?pn(o,{headers:s,status:c}):i.returnHeaders?i.returnStatus?{headers:s,response:o,status:c}:{headers:s,response:o}:i.returnStatus?{response:o,status:c}:o};return r.options=t,r.path=e,r};Dn.create=e=>(t,n,r)=>Dn(t,{...n,use:[...n?.use||[],...e?.use||[]]},r);function On(e,t){let n=async n=>{let r=n,i=typeof e==`function`?e:t,a=await En(r,{options:typeof e==`function`?{}:e,path:`/`});if(!i)throw Error(`handler must be defined`);let o=await i(a),s=a.responseHeaders;return r.returnHeaders?{headers:s,response:o}:o};return n.options=typeof e==`function`?{}:e,n}On.create=e=>{function t(t,n){if(typeof t==`function`)return On({use:e?.use},t);if(!n)throw Error(`Middleware handler is required`);return On({...t,method:`*`,use:[...e?.use||[],...t.use||[]]},n)}return t},Object.freeze({status:`aborted`});function R(e,t,n){function r(n,r){var i;for(let a in Object.defineProperty(n,`_zod`,{value:n._zod??{},enumerable:!1}),(i=n._zod).traits??(i.traits=new Set),n._zod.traits.add(e),t(n,r),o.prototype)a in n||Object.defineProperty(n,a,{value:o.prototype[a].bind(n)});n._zod.constr=o,n._zod.def=r}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var kn=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}};const An={};function jn(e){return e&&Object.assign(An,e),An}function Mn(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Nn(e,t){return typeof t==`bigint`?t.toString():t}function Pn(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function Fn(e){return e==null}function In(e){let t=e.startsWith(`^`)?1:0,n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function z(e,t,n){Object.defineProperty(e,t,{get(){{let r=n();return e[t]=r,r}throw Error(`cached value already set`)},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Ln(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Rn(e){return JSON.stringify(e)}const zn=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function Bn(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const Vn=Pn(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Hn(e){if(Bn(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(Bn(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}const Un=new Set([`string`,`number`,`symbol`]);function Wn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Gn(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Kn(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 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 qn(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}-Number.MAX_VALUE,Number.MAX_VALUE;function Jn(e,t){let n={},r=e._zod.def;for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&(n[e]=r.shape[e])}return Gn(e,{...e._zod.def,shape:n,checks:[]})}function Yn(e,t){let n={...e._zod.def.shape},r=e._zod.def;for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete n[e]}return Gn(e,{...e._zod.def,shape:n,checks:[]})}function Xn(e,t){if(!Hn(t))throw Error(`Invalid input to extend: expected a plain object`);return Gn(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t};return Ln(this,`shape`,n),n},checks:[]})}function Zn(e,t){return Gn(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Ln(this,`shape`,n),n},catchall:t._zod.def.catchall,checks:[]})}function Qn(e,t,n){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Gn(t,{...t._zod.def,shape:i,checks:[]})}function $n(e,t,n){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return Gn(t,{...t._zod.def,shape:i,checks:[]})}function er(e,t=0){for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function tr(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function nr(e){return typeof e==`string`?e:e?.message}function rr(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=nr(e.inst?._zod.def?.error?.(e))??nr(t?.error?.(e))??nr(n.customError?.(e))??nr(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function ir(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function ar(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}const or=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),Object.defineProperty(e,`message`,{get(){return JSON.stringify(t,Nn,2)},enumerable:!0}),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},sr=R(`$ZodError`,or),cr=R(`$ZodError`,or,{Parent:Error});function lr(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function ur(e,t){let n=t||function(e){return e.message},r={_errors:[]},i=e=>{for(let t of e.issues)if(t.code===`invalid_union`&&t.errors.length)t.errors.map(e=>i({issues:e}));else if(t.code===`invalid_key`)i({issues:t.issues});else if(t.code===`invalid_element`)i({issues:t.issues});else if(t.path.length===0)r._errors.push(n(t));else{let e=r,i=0;for(;i<t.path.length;){let r=t.path[i];i===t.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(n(t))):e[r]=e[r]||{_errors:[]},e=e[r],i++}}};return i(e),r}const dr=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new kn;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>rr(e,a,jn())));throw zn(t,i?.callee),t}return o.value},fr=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>rr(e,a,jn())));throw zn(t,i?.callee),t}return o.value},pr=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new kn;return a.issues.length?{success:!1,error:new(e??sr)(a.issues.map(e=>rr(e,i,jn())))}:{success:!0,data:a.value}},mr=pr(cr),hr=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>rr(e,i,jn())))}:{success:!0,data:a.value}},gr=hr(cr),_r=R(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),vr=R(`$ZodCheckMaxLength`,(e,t)=>{var n;_r.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Fn(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=ir(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),yr=R(`$ZodCheckMinLength`,(e,t)=>{var n;_r.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Fn(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=ir(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),br=R(`$ZodCheckLengthEquals`,(e,t)=>{var n;_r.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Fn(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=ir(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),xr=R(`$ZodCheckOverwrite`,(e,t)=>{_r.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var Sr=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
8
+ `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
9
+ `))}};const Cr={major:4,minor:0,patch:0},wr=R(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Cr;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=er(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new kn;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=er(e,t))});else{if(e.issues.length===t)continue;r||=er(e,t)}}return i?i.then(()=>e):e};e._zod.run=(n,i)=>{let a=e._zod.parse(n,i);if(a instanceof Promise){if(i.async===!1)throw new kn;return a.then(e=>t(e,r,i))}return t(a,r,i)}}e[`~standard`]={validate:t=>{try{let n=mr(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return gr(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}}),Tr=R(`$ZodUnknown`,(e,t)=>{wr.init(e,t),e._zod.parse=e=>e}),Er=R(`$ZodNever`,(e,t)=>{wr.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Dr(e,t,n){e.issues.length&&t.issues.push(...tr(n,e.issues)),t.value[n]=e.value}const Or=R(`$ZodArray`,(e,t)=>{wr.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>Dr(t,n,e))):Dr(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function kr(e,t,n){e.issues.length&&t.issues.push(...tr(n,e.issues)),t.value[n]=e.value}function Ar(e,t,n,r){e.issues.length?r[n]===void 0?n in r?t.value[n]=void 0:t.value[n]=e.value:t.issues.push(...tr(n,e.issues)):e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}const jr=R(`$ZodObject`,(e,t)=>{wr.init(e,t);let n=Pn(()=>{let e=Object.keys(t.shape);for(let n of e)if(!(t.shape[n]instanceof wr))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=qn(t.shape);return{shape:t.shape,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}});z(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=e=>{let t=new Sr([`shape`,`payload`,`ctx`]),r=n.value,i=e=>{let t=Rn(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of r.keys)a[e]=`key_${o++}`;t.write(`const newResult = {}`);for(let e of r.keys)if(r.optionalKeys.has(e)){let n=a[e];t.write(`const ${n} = ${i(e)};`);let r=Rn(e);t.write(`
10
+ if (${n}.issues.length) {
11
+ if (input[${r}] === undefined) {
12
+ if (${r} in input) {
13
+ newResult[${r}] = undefined;
14
+ }
15
+ } else {
16
+ payload.issues = payload.issues.concat(
17
+ ${n}.issues.map((iss) => ({
18
+ ...iss,
19
+ path: iss.path ? [${r}, ...iss.path] : [${r}],
20
+ }))
21
+ );
22
+ }
23
+ } else if (${n}.value === undefined) {
24
+ if (${r} in input) newResult[${r}] = undefined;
25
+ } else {
26
+ newResult[${r}] = ${n}.value;
27
+ }
28
+ `)}else{let n=a[e];t.write(`const ${n} = ${i(e)};`),t.write(`
29
+ if (${n}.issues.length) payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
30
+ ...iss,
31
+ path: iss.path ? [${Rn(e)}, ...iss.path] : [${Rn(e)}]
32
+ })));`),t.write(`newResult[${Rn(e)}] = ${n}.value`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},i,a=Bn,o=!An.jitless,s=o&&Vn.value,c=t.catchall,l;e._zod.parse=(u,d)=>{l??=n.value;let f=u.value;if(!a(f))return u.issues.push({expected:`object`,code:`invalid_type`,input:f,inst:e}),u;let p=[];if(o&&s&&d?.async===!1&&d.jitless!==!0)i||=r(t.shape),u=i(u,d);else{u.value={};let e=l.shape;for(let t of l.keys){let n=e[t],r=n._zod.run({value:f[t],issues:[]},d),i=n._zod.optin===`optional`&&n._zod.optout===`optional`;r instanceof Promise?p.push(r.then(e=>i?Ar(e,u,t,f):kr(e,u,t))):i?Ar(r,u,t,f):kr(r,u,t)}}if(!c)return p.length?Promise.all(p).then(()=>u):u;let m=[],h=l.keySet,g=c._zod,_=g.def.type;for(let e of Object.keys(f)){if(h.has(e))continue;if(_===`never`){m.push(e);continue}let t=g.run({value:f[e],issues:[]},d);t instanceof Promise?p.push(t.then(t=>kr(t,u,e))):kr(t,u,e)}return m.length&&u.issues.push({code:`unrecognized_keys`,keys:m,input:f,inst:e}),p.length?Promise.all(p).then(()=>u):u}});function Mr(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;return t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>rr(e,r,jn())))}),t}const Nr=R(`$ZodUnion`,(e,t)=>{wr.init(e,t),z(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),z(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),z(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),z(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>In(e.source)).join(`|`)})$`)}}),e._zod.parse=(n,r)=>{let i=!1,a=[];for(let e of t.options){let t=e._zod.run({value:n.value,issues:[]},r);if(t instanceof Promise)a.push(t),i=!0;else{if(t.issues.length===0)return t;a.push(t)}}return i?Promise.all(a).then(t=>Mr(t,n,e,r)):Mr(a,n,e,r)}}),Pr=R(`$ZodIntersection`,(e,t)=>{wr.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Ir(e,t,n)):Ir(e,i,a)}});function Fr(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Hn(e)&&Hn(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Fr(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Fr(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Ir(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),er(e))return e;let r=Fr(t.value,n.value);if(!r.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const Lr=R(`$ZodEnum`,(e,t)=>{wr.init(e,t);let n=Mn(t.entries);e._zod.values=new Set(n),e._zod.pattern=RegExp(`^(${n.filter(e=>Un.has(typeof e)).map(e=>typeof e==`string`?Wn(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,r)=>{let i=t.value;return e._zod.values.has(i)||t.issues.push({code:`invalid_value`,values:n,input:i,inst:e}),t}}),Rr=R(`$ZodTransform`,(e,t)=>{wr.init(e,t),e._zod.parse=(e,n)=>{let r=t.transform(e.value,e);if(n.async)return(r instanceof Promise?r:Promise.resolve(r)).then(t=>(e.value=t,e));if(r instanceof Promise)throw new kn;return e.value=r,e}}),zr=R(`$ZodOptional`,(e,t)=>{wr.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,z(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),z(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${In(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>t.innerType._zod.optin===`optional`?t.innerType._zod.run(e,n):e.value===void 0?e:t.innerType._zod.run(e,n)}),Br=R(`$ZodNullable`,(e,t)=>{wr.init(e,t),z(e._zod,`optin`,()=>t.innerType._zod.optin),z(e._zod,`optout`,()=>t.innerType._zod.optout),z(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${In(e.source)}|null)$`):void 0}),z(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Vr=R(`$ZodDefault`,(e,t)=>{wr.init(e,t),e._zod.optin=`optional`,z(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Hr(e,t)):Hr(r,t)}});function Hr(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Ur=R(`$ZodPrefault`,(e,t)=>{wr.init(e,t),e._zod.optin=`optional`,z(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Wr=R(`$ZodNonOptional`,(e,t)=>{wr.init(e,t),z(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Gr(t,e)):Gr(i,e)}});function Gr(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}const Kr=R(`$ZodCatch`,(e,t)=>{wr.init(e,t),e._zod.optin=`optional`,z(e._zod,`optout`,()=>t.innerType._zod.optout),z(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>rr(e,n,jn()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>rr(e,n,jn()))},input:e.value}),e.issues=[]),e)}}),qr=R(`$ZodPipe`,(e,t)=>{wr.init(e,t),z(e._zod,`values`,()=>t.in._zod.values),z(e._zod,`optin`,()=>t.in._zod.optin),z(e._zod,`optout`,()=>t.out._zod.optout),e._zod.parse=(e,n)=>{let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Jr(e,t,n)):Jr(r,t,n)}});function Jr(e,t,n){return er(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}const Yr=R(`$ZodReadonly`,(e,t)=>{wr.init(e,t),z(e._zod,`propValues`,()=>t.innerType._zod.propValues),z(e._zod,`values`,()=>t.innerType._zod.values),z(e._zod,`optin`,()=>t.innerType._zod.optin),z(e._zod,`optout`,()=>t.innerType._zod.optout),e._zod.parse=(e,n)=>{let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Xr):Xr(r)}});function Xr(e){return e.value=Object.freeze(e.value),e}const Zr=R(`$ZodCustom`,(e,t)=>{_r.init(e,t),wr.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Qr(t,n,r,e));Qr(i,n,r,e)}});function Qr(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(ar(e))}}var $r=class{constructor(){this._map=new Map,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n==`object`&&`id`in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}};function ei(){return new $r}const ti=ei();function ni(e){return new e({type:`unknown`})}function ri(e,t){return new e({type:`never`,...Kn(t)})}function ii(e,t){return new vr({check:`max_length`,...Kn(t),maximum:e})}function ai(e,t){return new yr({check:`min_length`,...Kn(t),minimum:e})}function oi(e,t){return new br({check:`length_equals`,...Kn(t),length:e})}function si(e){return new xr({check:`overwrite`,tx:e})}function ci(e,t,n){return new e({type:`array`,element:t,...Kn(n)})}function li(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...Kn(n)})}const ui=(e,t)=>{sr.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>ur(e,t)},flatten:{value:t=>lr(e,t)},addIssue:{value:t=>e.issues.push(t)},addIssues:{value:t=>e.issues.push(...t)},isEmpty:{get(){return e.issues.length===0}}})};R(`ZodError`,ui);const di=R(`ZodError`,ui,{Parent:Error}),fi=dr(di),pi=fr(di),mi=pr(di),hi=hr(di),gi=R(`ZodType`,(e,t)=>(wr.init(e,t),e.def=t,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),e.clone=(t,n)=>Gn(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>fi(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>mi(e,t,n),e.parseAsync=async(t,n)=>pi(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>hi(e,t,n),e.spa=e.safeParseAsync,e.refine=(t,n)=>e.check(Xi(t,n)),e.superRefine=t=>e.check(Zi(t)),e.overwrite=t=>e.check(si(t)),e.optional=()=>Ni(e),e.nullable=()=>Fi(e),e.nullish=()=>Ni(Fi(e)),e.nonoptional=t=>Vi(e,t),e.array=()=>Si(e),e.or=t=>Ti([e,t]),e.and=t=>Di(e,t),e.transform=t=>Gi(e,ji(t)),e.default=t=>Li(e,t),e.prefault=t=>zi(e,t),e.catch=t=>Ui(e,t),e.pipe=t=>Gi(e,t),e.readonly=()=>qi(e),e.describe=t=>{let n=e.clone();return ti.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return ti.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return ti.get(e);let n=e.clone();return ti.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),_i=R(`ZodUnknown`,(e,t)=>{Tr.init(e,t),gi.init(e,t)});function vi(){return ni(_i)}const yi=R(`ZodNever`,(e,t)=>{Er.init(e,t),gi.init(e,t)});function bi(e){return ri(yi,e)}const xi=R(`ZodArray`,(e,t)=>{Or.init(e,t),gi.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(ai(t,n)),e.nonempty=t=>e.check(ai(1,t)),e.max=(t,n)=>e.check(ii(t,n)),e.length=(t,n)=>e.check(oi(t,n)),e.unwrap=()=>e.element});function Si(e,t){return ci(xi,e,t)}const Ci=R(`ZodObject`,(e,t)=>{jr.init(e,t),gi.init(e,t),z(e,`shape`,()=>t.shape),e.keyof=()=>ki(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:vi()}),e.loose=()=>e.clone({...e._zod.def,catchall:vi()}),e.strict=()=>e.clone({...e._zod.def,catchall:bi()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>Xn(e,t),e.merge=t=>Zn(e,t),e.pick=t=>Jn(e,t),e.omit=t=>Yn(e,t),e.partial=(...t)=>Qn(Mi,e,t[0]),e.required=(...t)=>$n(Bi,e,t[0])}),wi=R(`ZodUnion`,(e,t)=>{Nr.init(e,t),gi.init(e,t),e.options=t.options});function Ti(e,t){return new wi({type:`union`,options:e,...Kn(t)})}const Ei=R(`ZodIntersection`,(e,t)=>{Pr.init(e,t),gi.init(e,t)});function Di(e,t){return new Ei({type:`intersection`,left:e,right:t})}const Oi=R(`ZodEnum`,(e,t)=>{Lr.init(e,t),gi.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Oi({...t,checks:[],...Kn(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Oi({...t,checks:[],...Kn(r),entries:i})}});function ki(e,t){return new Oi({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...Kn(t)})}const Ai=R(`ZodTransform`,(e,t)=>{Rr.init(e,t),gi.init(e,t),e._zod.parse=(n,r)=>{n.addIssue=r=>{if(typeof r==`string`)n.issues.push(ar(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,t.continue??=!0,n.issues.push(ar(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function ji(e){return new Ai({type:`transform`,transform:e})}const Mi=R(`ZodOptional`,(e,t)=>{zr.init(e,t),gi.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Ni(e){return new Mi({type:`optional`,innerType:e})}const Pi=R(`ZodNullable`,(e,t)=>{Br.init(e,t),gi.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Fi(e){return new Pi({type:`nullable`,innerType:e})}const Ii=R(`ZodDefault`,(e,t)=>{Vr.init(e,t),gi.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Li(e,t){return new Ii({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():t}})}const Ri=R(`ZodPrefault`,(e,t)=>{Ur.init(e,t),gi.init(e,t),e.unwrap=()=>e._zod.def.innerType});function zi(e,t){return new Ri({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():t}})}const Bi=R(`ZodNonOptional`,(e,t)=>{Wr.init(e,t),gi.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Vi(e,t){return new Bi({type:`nonoptional`,innerType:e,...Kn(t)})}const Hi=R(`ZodCatch`,(e,t)=>{Kr.init(e,t),gi.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ui(e,t){return new Hi({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}const Wi=R(`ZodPipe`,(e,t)=>{qr.init(e,t),gi.init(e,t),e.in=t.in,e.out=t.out});function Gi(e,t){return new Wi({type:`pipe`,in:e,out:t})}const Ki=R(`ZodReadonly`,(e,t)=>{Yr.init(e,t),gi.init(e,t)});function qi(e){return new Ki({type:`readonly`,innerType:e})}const Ji=R(`ZodCustom`,(e,t)=>{Zr.init(e,t),gi.init(e,t)});function Yi(e){let t=new _r({check:`custom`});return t._zod.check=e,t}function Xi(e,t={}){return li(Ji,e,t)}function Zi(e){let t=Yi(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(ar(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(ar(r))}},e(n.value,n)));return t}const Qi={};function $i(e){switch(e.constructor.name){case`ZodString`:return`string`;case`ZodNumber`:return`number`;case`ZodBoolean`:return`boolean`;case`ZodObject`:return`object`;case`ZodArray`:return`array`;default:return`string`}}function ea(e){let t=[];return e.metadata?.openapi?.parameters?(t.push(...e.metadata.openapi.parameters),t):(e.query instanceof Ci&&Object.entries(e.query.shape).forEach(([e,n])=>{n instanceof Ci&&t.push({name:e,in:`query`,schema:{type:$i(n),...`minLength`in n&&n.minLength?{minLength:n.minLength}:{},description:n.description}})}),t)}function ta(e){if(e.metadata?.openapi?.requestBody)return e.metadata.openapi.requestBody;if(e.body&&(e.body instanceof Ci||e.body instanceof Mi)){let t=e.body.shape;if(!t)return;let n={},r=[];return Object.entries(t).forEach(([e,t])=>{t instanceof Ci&&(n[e]={type:$i(t),description:t.description},t instanceof Mi||r.push(e))}),{required:e.body instanceof Mi?!1:!!e.body,content:{"application/json":{schema:{type:`object`,properties:n,required:r}}}}}}function na(e){return{400:{content:{"application/json":{schema:{type:`object`,properties:{message:{type:`string`}},required:[`message`]}}},description:`Bad Request. Usually due to missing parameters, or invalid parameters.`},401:{content:{"application/json":{schema:{type:`object`,properties:{message:{type:`string`}},required:[`message`]}}},description:`Unauthorized. Due to missing or invalid authentication.`},403:{content:{"application/json":{schema:{type:`object`,properties:{message:{type:`string`}}}}},description:`Forbidden. You do not have permission to access this resource or to perform this action.`},404:{content:{"application/json":{schema:{type:`object`,properties:{message:{type:`string`}}}}},description:`Not Found. The requested resource was not found.`},429:{content:{"application/json":{schema:{type:`object`,properties:{message:{type:`string`}}}}},description:`Too Many Requests. You have exceeded the rate limit. Try again later.`},500:{content:{"application/json":{schema:{type:`object`,properties:{message:{type:`string`}}}}},description:`Internal Server Error. This is a problem with the server that you cannot fix.`},...e}}async function ra(e,t){return Object.entries(e).forEach(([e,t])=>{let n=t.options;if(!n.metadata?.SERVER_ONLY&&(n.method===`GET`&&(Qi[t.path]={get:{tags:[`Default`,...n.metadata?.openapi?.tags||[]],description:n.metadata?.openapi?.description,operationId:n.metadata?.openapi?.operationId,security:[{bearerAuth:[]}],parameters:ea(n),responses:na(n.metadata?.openapi?.responses)}}),n.method===`POST`)){let e=ta(n);Qi[t.path]={post:{tags:[`Default`,...n.metadata?.openapi?.tags||[]],description:n.metadata?.openapi?.description,operationId:n.metadata?.openapi?.operationId,security:[{bearerAuth:[]}],parameters:ea(n),...e?{requestBody:e}:{requestBody:{content:{"application/json":{schema:{type:`object`,properties:{}}}}}},responses:na(n.metadata?.openapi?.responses)}}}}),{openapi:`3.1.1`,info:{title:`Better Auth`,description:`API Reference for your Better Auth Instance`,version:`1.1.0`},components:{schemas:{}},security:[{apiKeyCookie:[]}],servers:[{url:t?.url}],tags:[{name:`Default`,description:`Default endpoints that are included with Better Auth by default. These endpoints are not part of any plugin.`}],paths:Qi}}const ia=(e,t)=>`<!doctype html>
33
+ <html>
34
+ <head>
35
+ <title>Scalar API Reference</title>
36
+ <meta charset="utf-8" />
37
+ <meta
38
+ name="viewport"
39
+ content="width=device-width, initial-scale=1" />
40
+ </head>
41
+ <body>
42
+ <script
43
+ id="api-reference"
44
+ type="application/json">
45
+ ${JSON.stringify(e)}
46
+ <\/script>
47
+ <script>
48
+ var configuration = {
49
+ favicon: ${t?.logo?`data:image/svg+xml;utf8,${encodeURIComponent(t.logo)}`:void 0} ,
50
+ theme: ${t?.theme||`saturn`},
51
+ metaData: {
52
+ title: ${t?.title||`Open API Reference`},
53
+ description: ${t?.description||`Better Call Open API`},
54
+ }
55
+ }
56
+ document.getElementById('api-reference').dataset.configuration =
57
+ JSON.stringify(configuration)
58
+ <\/script>
59
+ <script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"><\/script>
60
+ </body>
61
+ </html>`,aa=(e,t)=>{if(!t?.openapi?.disabled){let n={path:`/api/reference`,...t?.openapi};e.openapi=Dn(n.path,{method:`GET`},async t=>{let r=await ra(e);return new Response(ia(r,n.scalar),{headers:{"Content-Type":`text/html`}})})}let n=Wt(),r=Wt();for(let t of Object.values(e)){if(!t.options||t.options?.metadata?.SERVER_ONLY)continue;let e=Array.isArray(t.options?.method)?t.options.method:[t.options?.method];for(let r of e)qt(n,r,t.path,t)}if(t?.routerMiddleware?.length)for(let{path:e,middleware:n}of t.routerMiddleware)qt(r,`*`,e,n);let i=async e=>{let i=new URL(e.url),a=t?.basePath?i.pathname.split(t.basePath).reduce((e,n,r)=>(r!==0&&(r>1?e.push(`${t.basePath}${n}`):e.push(n)),e),[]).join(``):i.pathname;if(!a?.length)return new Response(null,{status:404,statusText:`Not Found`});let o=Yt(n,e.method,a);if(!o?.data)return new Response(null,{status:404,statusText:`Not Found`});let s={};i.searchParams.forEach((e,t)=>{t in s?Array.isArray(s[t])?s[t].push(e):s[t]=[s[t],e]:s[t]=e});let c=o.data,l={path:a,method:e.method,headers:e.headers,params:o.params?JSON.parse(JSON.stringify(o.params)):{},request:e,body:c.options.disableBody?void 0:await sn(c.options.cloneRequest?e.clone():e),query:s,_flag:`router`,asResponse:!0,context:t?.routerContext};try{let e=Zt(r,`*`,a);if(e?.length)for(let{data:t,params:n}of e){let e=await t({...l,params:n,asResponse:!1});if(e instanceof Response)return e}return await c(l)}catch(e){if(t?.onError)try{let n=await t.onError(e);if(n instanceof Response)return pn(n)}catch(e){if(cn(e))return pn(e);throw e}if(t?.throwError)throw e;return cn(e)?pn(e):(console.error(`# SERVER_ERROR: `,e),new Response(null,{status:500,statusText:`Internal Server Error`}))}};return{handler:async e=>{let n=await t?.onRequest?.(e);if(n instanceof Response)return n;let r=await i(n instanceof Request?n:e),a=await t?.onResponse?.(r);return a instanceof Response?a:r},endpoints:e}},oa=Object.freeze({status:`aborted`});function B(e,t,n){function r(n,r){var i;for(let a in Object.defineProperty(n,`_zod`,{value:n._zod??{},enumerable:!1}),(i=n._zod).traits??(i.traits=new Set),n._zod.traits.add(e),t(n,r),o.prototype)a in n||Object.defineProperty(n,a,{value:o.prototype[a].bind(n)});n._zod.constr=o,n._zod.def=r}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}const sa=Symbol(`zod_brand`);var ca=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},la=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};const ua={};function da(e){return e&&Object.assign(ua,e),ua}var fa=e({BIGINT_FORMAT_RANGES:()=>qa,Class:()=>go,NUMBER_FORMAT_RANGES:()=>Ka,aborted:()=>to,allowsEval:()=>Fa,assert:()=>_a,assertEqual:()=>pa,assertIs:()=>ha,assertNever:()=>ga,assertNotEqual:()=>ma,assignProp:()=>Ea,base64ToUint8Array:()=>lo,base64urlToUint8Array:()=>fo,cached:()=>ba,captureStackTrace:()=>Na,cleanEnum:()=>co,cleanRegex:()=>Sa,clone:()=>Ua,cloneDef:()=>Oa,createTransparentProxy:()=>Wa,defineLazy:()=>H,esc:()=>Ma,escapeRegex:()=>Ha,extend:()=>Xa,finalizeIssue:()=>io,floatSafeRemainder:()=>Ca,getElementAtPath:()=>ka,getEnumValues:()=>va,getLengthableOrigin:()=>oo,getParsedType:()=>za,getSizableOrigin:()=>ao,hexToUint8Array:()=>mo,isObject:()=>Pa,isPlainObject:()=>Ia,issue:()=>so,joinValues:()=>V,jsonStringifyReplacer:()=>ya,merge:()=>Qa,mergeDefs:()=>Da,normalizeParams:()=>U,nullish:()=>xa,numKeys:()=>Ra,objectClone:()=>Ta,omit:()=>Ya,optionalKeys:()=>Ga,partial:()=>$a,pick:()=>Ja,prefixIssues:()=>no,primitiveTypes:()=>Va,promiseAllObject:()=>Aa,propertyKeyTypes:()=>Ba,randomString:()=>ja,required:()=>eo,safeExtend:()=>Za,shallowClone:()=>La,stringifyPrimitive:()=>W,uint8ArrayToBase64:()=>uo,uint8ArrayToBase64url:()=>po,uint8ArrayToHex:()=>ho,unwrapMessage:()=>ro});function pa(e){return e}function ma(e){return e}function ha(e){}function ga(e){throw Error()}function _a(e){}function va(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function V(e,t=`|`){return e.map(e=>W(e)).join(t)}function ya(e,t){return typeof t==`bigint`?t.toString():t}function ba(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function xa(e){return e==null}function Sa(e){let t=e.startsWith(`^`)?1:0,n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Ca(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}const wa=Symbol(`evaluating`);function H(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==wa)return r===void 0&&(r=wa,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Ta(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ea(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Da(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Oa(e){return Da(e._zod.def)}function ka(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function Aa(e){let t=Object.keys(e),n=t.map(t=>e[t]);return Promise.all(n).then(e=>{let n={};for(let r=0;r<t.length;r++)n[t[r]]=e[r];return n})}function ja(e=10){let t=``;for(let n=0;n<e;n++)t+=`abcdefghijklmnopqrstuvwxyz`[Math.floor(Math.random()*26)];return t}function Ma(e){return JSON.stringify(e)}const Na=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Pa(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const Fa=ba(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Ia(e){if(Pa(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(Pa(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function La(e){return Ia(e)?{...e}:Array.isArray(e)?[...e]:e}function Ra(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}const za=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 Error(`Unknown data type: ${t}`)}},Ba=new Set([`string`,`number`,`symbol`]),Va=new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]);function Ha(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Ua(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function U(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 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 Wa(e){let t;return new Proxy({},{get(n,r,i){return t??=e(),Reflect.get(t,r,i)},set(n,r,i,a){return t??=e(),Reflect.set(t,r,i,a)},has(n,r){return t??=e(),Reflect.has(t,r)},deleteProperty(n,r){return t??=e(),Reflect.deleteProperty(t,r)},ownKeys(n){return t??=e(),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??=e(),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){return t??=e(),Reflect.defineProperty(t,r,i)}})}function W(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function Ga(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}const Ka={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},qa={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function Ja(e,t){let n=e._zod.def;return Ua(e,Da(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Ea(this,`shape`,e),e},checks:[]}))}function Ya(e,t){let n=e._zod.def;return Ua(e,Da(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Ea(this,`shape`,r),r},checks:[]}))}function Xa(e,t){if(!Ia(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0)throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");return Ua(e,Da(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Ea(this,`shape`,n),n},checks:[]}))}function Za(e,t){if(!Ia(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Ua(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t};return Ea(this,`shape`,n),n},checks:e._zod.def.checks})}function Qa(e,t){return Ua(e,Da(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Ea(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function $a(e,t,n){return Ua(t,Da(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Ea(this,`shape`,i),i},checks:[]}))}function eo(e,t,n){return Ua(t,Da(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return Ea(this,`shape`,i),i},checks:[]}))}function to(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function no(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function ro(e){return typeof e==`string`?e:e?.message}function io(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=ro(e.inst?._zod.def?.error?.(e))??ro(t?.error?.(e))??ro(n.customError?.(e))??ro(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function ao(e){return e instanceof Set?`set`:e instanceof Map?`map`:e instanceof File?`file`:`unknown`}function oo(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function so(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function co(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function lo(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function uo(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function fo(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`);return lo(t+`=`.repeat((4-t.length%4)%4))}function po(e){return uo(e).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function mo(e){let t=e.replace(/^0x/,``);if(t.length%2!=0)throw Error(`Invalid hex string length`);let n=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2)n[e/2]=Number.parseInt(t.slice(e,e+2),16);return n}function ho(e){return Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``)}var go=class{constructor(...e){}};const _o=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,ya,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},vo=B(`$ZodError`,_o),yo=B(`$ZodError`,_o,{Parent:Error});function bo(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function xo(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}function So(e,t=e=>e.message){let n={errors:[]},r=(e,i=[])=>{var a,o;for(let s of e.issues)if(s.code===`invalid_union`&&s.errors.length)s.errors.map(e=>r({issues:e},s.path));else if(s.code===`invalid_key`)r({issues:s.issues},s.path);else if(s.code===`invalid_element`)r({issues:s.issues},s.path);else{let e=[...i,...s.path];if(e.length===0){n.errors.push(t(s));continue}let r=n,c=0;for(;c<e.length;){let n=e[c],i=c===e.length-1;typeof n==`string`?(r.properties??={},(a=r.properties)[n]??(a[n]={errors:[]}),r=r.properties[n]):(r.items??=[],(o=r.items)[n]??(o[n]={errors:[]}),r=r.items[n]),i&&r.errors.push(t(s)),c++}}};return r(e),n}function Co(e){let t=[],n=e.map(e=>typeof e==`object`?e.key:e);for(let e of n)typeof e==`number`?t.push(`[${e}]`):typeof e==`symbol`?t.push(`[${JSON.stringify(String(e))}]`):/[^\w$]/.test(e)?t.push(`[${JSON.stringify(e)}]`):(t.length&&t.push(`.`),t.push(e));return t.join(``)}function wo(e){let t=[],n=[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length);for(let e of n)t.push(`✖ ${e.message}`),e.path?.length&&t.push(` → at ${Co(e.path)}`);return t.join(`
62
+ `)}const To=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new ca;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>io(e,a,da())));throw Na(t,i?.callee),t}return o.value},Eo=To(yo),Do=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>io(e,a,da())));throw Na(t,i?.callee),t}return o.value},Oo=Do(yo),ko=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new ca;return a.issues.length?{success:!1,error:new(e??vo)(a.issues.map(e=>io(e,i,da())))}:{success:!0,data:a.value}},Ao=ko(yo),jo=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>io(e,i,da())))}:{success:!0,data:a.value}},Mo=jo(yo),No=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return To(e)(t,n,i)},Po=No(yo),Fo=e=>(t,n,r)=>To(e)(t,n,r),Io=Fo(yo),Lo=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Do(e)(t,n,i)},Ro=Lo(yo),zo=e=>async(t,n,r)=>Do(e)(t,n,r),Bo=zo(yo),Vo=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return ko(e)(t,n,i)},Ho=Vo(yo),Uo=e=>(t,n,r)=>ko(e)(t,n,r),Wo=Uo(yo),Go=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return jo(e)(t,n,i)},Ko=Go(yo),qo=e=>async(t,n,r)=>jo(e)(t,n,r),Jo=qo(yo);var Yo=e({base64:()=>bs,base64url:()=>xs,bigint:()=>js,boolean:()=>Ps,browserEmail:()=>ms,cidrv4:()=>vs,cidrv6:()=>ys,cuid:()=>Xo,cuid2:()=>Zo,date:()=>Es,datetime:()=>ks,domain:()=>Cs,duration:()=>ns,e164:()=>ws,email:()=>ls,emoji:()=>hs,extendedDuration:()=>rs,guid:()=>is,hex:()=>zs,hostname:()=>Ss,html5Email:()=>us,idnEmail:()=>ps,integer:()=>Ms,ipv4:()=>gs,ipv6:()=>_s,ksuid:()=>es,lowercase:()=>Ls,md5_base64:()=>Us,md5_base64url:()=>Ws,md5_hex:()=>Hs,nanoid:()=>ts,null:()=>Fs,number:()=>Ns,rfc5322Email:()=>ds,sha1_base64:()=>Ks,sha1_base64url:()=>qs,sha1_hex:()=>Gs,sha256_base64:()=>Ys,sha256_base64url:()=>Xs,sha256_hex:()=>Js,sha384_base64:()=>Qs,sha384_base64url:()=>$s,sha384_hex:()=>Zs,sha512_base64:()=>tc,sha512_base64url:()=>nc,sha512_hex:()=>ec,string:()=>As,time:()=>Os,ulid:()=>Qo,undefined:()=>Is,unicodeEmail:()=>fs,uppercase:()=>Rs,uuid:()=>as,uuid4:()=>os,uuid6:()=>ss,uuid7:()=>cs,xid:()=>$o});const Xo=/^[cC][^\s-]{8,}$/,Zo=/^[0-9a-z]+$/,Qo=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,$o=/^[0-9a-vA-V]{20}$/,es=/^[A-Za-z0-9]{27}$/,ts=/^[a-zA-Z0-9_-]{21}$/,ns=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,rs=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,is=/^([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})$/,as=e=>e?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)$/,os=as(4),ss=as(6),cs=as(7),ls=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,us=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,ds=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,fs=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,ps=fs,ms=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;function hs(){return RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)}const gs=/^(?:(?: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])$/,_s=/^(([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}|:))$/,vs=/^((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])$/,ys=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,bs=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,xs=/^[A-Za-z0-9_-]*$/,Ss=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Cs=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,ws=/^\+(?:[0-9]){6,14}[0-9]$/,Ts=`(?:(?:\\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])))`,Es=RegExp(`^${Ts}$`);function Ds(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Os(e){return RegExp(`^${Ds(e)}$`)}function ks(e){let t=Ds({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${Ts}T(?:${r})$`)}const As=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},js=/^-?\d+n?$/,Ms=/^-?\d+$/,Ns=/^-?\d+(?:\.\d+)?/,Ps=/^(?:true|false)$/i,Fs=/^null$/i,Is=/^undefined$/i,Ls=/^[^A-Z]*$/,Rs=/^[^a-z]*$/,zs=/^[0-9a-fA-F]*$/;function Bs(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Vs(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}const Hs=/^[0-9a-fA-F]{32}$/,Us=Bs(22,`==`),Ws=Vs(22),Gs=/^[0-9a-fA-F]{40}$/,Ks=Bs(27,`=`),qs=Vs(27),Js=/^[0-9a-fA-F]{64}$/,Ys=Bs(43,`=`),Xs=Vs(43),Zs=/^[0-9a-fA-F]{96}$/,Qs=Bs(64,``),$s=Vs(64),ec=/^[0-9a-fA-F]{128}$/,tc=Bs(86,`==`),nc=Vs(86),rc=B(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),ic={number:`number`,bigint:`bigint`,object:`date`},ac=B(`$ZodCheckLessThan`,(e,t)=>{rc.init(e,t);let n=ic[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),oc=B(`$ZodCheckGreaterThan`,(e,t)=>{rc.init(e,t);let n=ic[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),sc=B(`$ZodCheckMultipleOf`,(e,t)=>{rc.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):Ca(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),cc=B(`$ZodCheckNumberFormat`,(e,t)=>{rc.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Ka[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=Ms)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inst:e})}}),lc=B(`$ZodCheckBigIntFormat`,(e,t)=>{rc.init(e,t);let[n,r]=qa[t.format];e._zod.onattach.push(e=>{let i=e._zod.bag;i.format=t.format,i.minimum=n,i.maximum=r}),e._zod.check=i=>{let a=i.value;a<n&&i.issues.push({origin:`bigint`,input:a,code:`too_small`,minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>r&&i.issues.push({origin:`bigint`,input:a,code:`too_big`,maximum:r,inst:e})}}),uc=B(`$ZodCheckMaxSize`,(e,t)=>{var n;rc.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!xa(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;r.size<=t.maximum||n.issues.push({origin:ao(r),code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),dc=B(`$ZodCheckMinSize`,(e,t)=>{var n;rc.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!xa(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;r.size>=t.minimum||n.issues.push({origin:ao(r),code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),fc=B(`$ZodCheckSizeEquals`,(e,t)=>{var n;rc.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!xa(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=n=>{let r=n.value,i=r.size;if(i===t.size)return;let a=i>t.size;n.issues.push({origin:ao(r),...a?{code:`too_big`,maximum:t.size}:{code:`too_small`,minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),pc=B(`$ZodCheckMaxLength`,(e,t)=>{var n;rc.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!xa(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=oo(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),mc=B(`$ZodCheckMinLength`,(e,t)=>{var n;rc.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!xa(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=oo(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),hc=B(`$ZodCheckLengthEquals`,(e,t)=>{var n;rc.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!xa(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=oo(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),gc=B(`$ZodCheckStringFormat`,(e,t)=>{var n,r;rc.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),_c=B(`$ZodCheckRegex`,(e,t)=>{gc.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),vc=B(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Ls,gc.init(e,t)}),yc=B(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Rs,gc.init(e,t)}),bc=B(`$ZodCheckIncludes`,(e,t)=>{rc.init(e,t);let n=Ha(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),xc=B(`$ZodCheckStartsWith`,(e,t)=>{rc.init(e,t);let n=RegExp(`^${Ha(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),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})}}),Sc=B(`$ZodCheckEndsWith`,(e,t)=>{rc.init(e,t);let n=RegExp(`.*${Ha(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),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})}});function Cc(e,t,n){e.issues.length&&t.issues.push(...no(n,e.issues))}const wc=B(`$ZodCheckProperty`,(e,t)=>{rc.init(e,t),e._zod.check=e=>{let n=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(n=>Cc(n,e,t.property));Cc(n,e,t.property)}}),Tc=B(`$ZodCheckMimeType`,(e,t)=>{rc.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:`invalid_value`,values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),Ec=B(`$ZodCheckOverwrite`,(e,t)=>{rc.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var Dc=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
63
+ `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
64
+ `))}};const Oc={major:4,minor:1,patch:12},G=B(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Oc;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=to(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new ca;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=to(e,t))});else{if(e.issues.length===t)continue;r||=to(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(to(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new ca;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new ca;return o.then(e=>t(e,r,a))}return t(o,r,a)}}e[`~standard`]={validate:t=>{try{let n=Ao(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Mo(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}}),kc=B(`$ZodString`,(e,t)=>{G.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??As(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),K=B(`$ZodStringFormat`,(e,t)=>{gc.init(e,t),kc.init(e,t)}),Ac=B(`$ZodGUID`,(e,t)=>{t.pattern??=is,K.init(e,t)}),jc=B(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=as(e)}else t.pattern??=as();K.init(e,t)}),Mc=B(`$ZodEmail`,(e,t)=>{t.pattern??=ls,K.init(e,t)}),Nc=B(`$ZodURL`,(e,t)=>{K.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:Ss.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Pc=B(`$ZodEmoji`,(e,t)=>{t.pattern??=hs(),K.init(e,t)}),Fc=B(`$ZodNanoID`,(e,t)=>{t.pattern??=ts,K.init(e,t)}),Ic=B(`$ZodCUID`,(e,t)=>{t.pattern??=Xo,K.init(e,t)}),Lc=B(`$ZodCUID2`,(e,t)=>{t.pattern??=Zo,K.init(e,t)}),Rc=B(`$ZodULID`,(e,t)=>{t.pattern??=Qo,K.init(e,t)}),zc=B(`$ZodXID`,(e,t)=>{t.pattern??=$o,K.init(e,t)}),Bc=B(`$ZodKSUID`,(e,t)=>{t.pattern??=es,K.init(e,t)}),Vc=B(`$ZodISODateTime`,(e,t)=>{t.pattern??=ks(t),K.init(e,t)}),Hc=B(`$ZodISODate`,(e,t)=>{t.pattern??=Es,K.init(e,t)}),Uc=B(`$ZodISOTime`,(e,t)=>{t.pattern??=Os(t),K.init(e,t)}),Wc=B(`$ZodISODuration`,(e,t)=>{t.pattern??=ns,K.init(e,t)}),Gc=B(`$ZodIPv4`,(e,t)=>{t.pattern??=gs,K.init(e,t),e._zod.onattach.push(e=>{let t=e._zod.bag;t.format=`ipv4`})}),Kc=B(`$ZodIPv6`,(e,t)=>{t.pattern??=_s,K.init(e,t),e._zod.onattach.push(e=>{let t=e._zod.bag;t.format=`ipv6`}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),qc=B(`$ZodCIDRv4`,(e,t)=>{t.pattern??=vs,K.init(e,t)}),Jc=B(`$ZodCIDRv6`,(e,t)=>{t.pattern??=ys,K.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function Yc(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Xc=B(`$ZodBase64`,(e,t)=>{t.pattern??=bs,K.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding=`base64`}),e._zod.check=n=>{Yc(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function Zc(e){if(!xs.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Yc(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const Qc=B(`$ZodBase64URL`,(e,t)=>{t.pattern??=xs,K.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding=`base64url`}),e._zod.check=n=>{Zc(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),$c=B(`$ZodE164`,(e,t)=>{t.pattern??=ws,K.init(e,t)});function el(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}const tl=B(`$ZodJWT`,(e,t)=>{K.init(e,t),e._zod.check=n=>{el(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),nl=B(`$ZodCustomStringFormat`,(e,t)=>{K.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:`invalid_format`,format:t.format,input:n.value,inst:e,continue:!t.abort})}}),rl=B(`$ZodNumber`,(e,t)=>{G.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ns,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),il=B(`$ZodNumber`,(e,t)=>{cc.init(e,t),rl.init(e,t)}),al=B(`$ZodBoolean`,(e,t)=>{G.init(e,t),e._zod.pattern=Ps,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),ol=B(`$ZodBigInt`,(e,t)=>{G.init(e,t),e._zod.pattern=js,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value==`bigint`||n.issues.push({expected:`bigint`,code:`invalid_type`,input:n.value,inst:e}),n}}),sl=B(`$ZodBigInt`,(e,t)=>{lc.init(e,t),ol.init(e,t)}),cl=B(`$ZodSymbol`,(e,t)=>{G.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return typeof r==`symbol`||t.issues.push({expected:`symbol`,code:`invalid_type`,input:r,inst:e}),t}}),ll=B(`$ZodUndefined`,(e,t)=>{G.init(e,t),e._zod.pattern=Is,e._zod.values=new Set([void 0]),e._zod.optin=`optional`,e._zod.optout=`optional`,e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),ul=B(`$ZodNull`,(e,t)=>{G.init(e,t),e._zod.pattern=Fs,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),dl=B(`$ZodAny`,(e,t)=>{G.init(e,t),e._zod.parse=e=>e}),fl=B(`$ZodUnknown`,(e,t)=>{G.init(e,t),e._zod.parse=e=>e}),pl=B(`$ZodNever`,(e,t)=>{G.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),ml=B(`$ZodVoid`,(e,t)=>{G.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`void`,code:`invalid_type`,input:r,inst:e}),t}}),hl=B(`$ZodDate`,(e,t)=>{G.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let i=n.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||n.issues.push({expected:`date`,code:`invalid_type`,input:i,...a?{received:`Invalid Date`}:{},inst:e}),n}});function gl(e,t,n){e.issues.length&&t.issues.push(...no(n,e.issues)),t.value[n]=e.value}const _l=B(`$ZodArray`,(e,t)=>{G.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>gl(t,n,e))):gl(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function vl(e,t,n,r){e.issues.length&&t.issues.push(...no(n,e.issues)),e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function yl(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=Ga(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function bl(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type;for(let i of Object.keys(t)){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>vl(e,n,i,t))):vl(a,n,i,t)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const xl=B(`$ZodObject`,(e,t)=>{if(G.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=ba(()=>yl(t));H(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=Pa,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e]._zod.run({value:s[e],issues:[]},o);n instanceof Promise?c.push(n.then(n=>vl(n,t,e,s))):vl(n,t,e,s)}return i?bl(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Sl=B(`$ZodObjectJIT`,(e,t)=>{xl.init(e,t);let n=e._zod.parse,r=ba(()=>yl(t)),i=e=>{let t=new Dc([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=Ma(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let e of n.keys){let n=a[e],r=Ma(e);t.write(`const ${n} = ${i(e)};`),t.write(`
65
+ if (${n}.issues.length) {
66
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
67
+ ...iss,
68
+ path: iss.path ? [${r}, ...iss.path] : [${r}]
69
+ })));
70
+ }
71
+
72
+
73
+ if (${n}.value === undefined) {
74
+ if (${r} in input) {
75
+ newResult[${r}] = undefined;
76
+ }
77
+ } else {
78
+ newResult[${r}] = ${n}.value;
79
+ }
80
+
81
+ `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=Pa,s=!ua.jitless,c=s&&Fa.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?bl([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function Cl(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!to(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>io(e,r,da())))}),t)}const wl=B(`$ZodUnion`,(e,t)=>{G.init(e,t),H(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),H(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),H(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),H(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>Sa(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>Cl(t,i,e,a)):Cl(s,i,e,a)}}),Tl=B(`$ZodDiscriminatedUnion`,(e,t)=>{wl.init(e,t);let n=e._zod.parse;H(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=ba(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!Pa(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),El=B(`$ZodIntersection`,(e,t)=>{G.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Ol(e,t,n)):Ol(e,i,a)}});function Dl(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ia(e)&&Ia(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Dl(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Dl(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Ol(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),to(e))return e;let r=Dl(t.value,n.value);if(!r.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const kl=B(`$ZodTuple`,(e,t)=>{G.init(e,t);let n=t.items,r=n.length-[...n].reverse().findIndex(e=>e._zod.optin!==`optional`);e._zod.parse=(i,a)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:e,expected:`tuple`,code:`invalid_type`}),i;i.value=[];let s=[];if(!t.rest){let t=o.length>n.length,a=o.length<r-1;if(t||a)return i.issues.push({...t?{code:`too_big`,maximum:n.length}:{code:`too_small`,minimum:n.length},input:o,inst:e,origin:`array`}),i}let c=-1;for(let e of n){if(c++,c>=o.length&&c>=r)continue;let t=e._zod.run({value:o[c],issues:[]},a);t instanceof Promise?s.push(t.then(e=>Al(e,i,c))):Al(t,i,c)}if(t.rest){let e=o.slice(n.length);for(let n of e){c++;let e=t.rest._zod.run({value:n,issues:[]},a);e instanceof Promise?s.push(e.then(e=>Al(e,i,c))):Al(e,i,c)}}return s.length?Promise.all(s).then(()=>i):i}});function Al(e,t,n){e.issues.length&&t.issues.push(...no(n,e.issues)),t.value[n]=e.value}const jl=B(`$ZodRecord`,(e,t)=>{G.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Ia(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[];if(t.keyType._zod.values){let o=t.keyType._zod.values;n.value={};for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...no(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...no(e,o.issues)),n.value[e]=o.value)}let s;for(let e in i)o.has(e)||(s??=[],s.push(e));s&&s.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:s})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>io(e,r,da())),input:o,path:[o],inst:e}),n.value[s.value]=s.value;continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...no(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...no(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Ml=B(`$ZodMap`,(e,t)=>{G.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!(i instanceof Map))return n.issues.push({expected:`map`,code:`invalid_type`,input:i,inst:e}),n;let a=[];n.value=new Map;for(let[o,s]of i){let c=t.keyType._zod.run({value:o,issues:[]},r),l=t.valueType._zod.run({value:s,issues:[]},r);c instanceof Promise||l instanceof Promise?a.push(Promise.all([c,l]).then(([t,a])=>{Nl(t,a,n,o,i,e,r)})):Nl(c,l,n,o,i,e,r)}return a.length?Promise.all(a).then(()=>n):n}});function Nl(e,t,n,r,i,a,o){e.issues.length&&(Ba.has(typeof r)?n.issues.push(...no(r,e.issues)):n.issues.push({code:`invalid_key`,origin:`map`,input:i,inst:a,issues:e.issues.map(e=>io(e,o,da()))})),t.issues.length&&(Ba.has(typeof r)?n.issues.push(...no(r,t.issues)):n.issues.push({origin:`map`,code:`invalid_element`,input:i,inst:a,key:r,issues:t.issues.map(e=>io(e,o,da()))})),n.value.set(e.value,t.value)}const Pl=B(`$ZodSet`,(e,t)=>{G.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!(i instanceof Set))return n.issues.push({input:i,inst:e,expected:`set`,code:`invalid_type`}),n;let a=[];n.value=new Set;for(let e of i){let i=t.valueType._zod.run({value:e,issues:[]},r);i instanceof Promise?a.push(i.then(e=>Fl(e,n))):Fl(i,n)}return a.length?Promise.all(a).then(()=>n):n}});function Fl(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}const Il=B(`$ZodEnum`,(e,t)=>{G.init(e,t);let n=va(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>Ba.has(typeof e)).map(e=>typeof e==`string`?Ha(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Ll=B(`$ZodLiteral`,(e,t)=>{if(G.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);e._zod.values=new Set(t.values),e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?Ha(e):e?Ha(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(n,r)=>{let i=n.value;return e._zod.values.has(i)||n.issues.push({code:`invalid_value`,values:t.values,input:i,inst:e}),n}}),Rl=B(`$ZodFile`,(e,t)=>{G.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r instanceof File||t.issues.push({expected:`file`,code:`invalid_type`,input:r,inst:e}),t}}),zl=B(`$ZodTransform`,(e,t)=>{G.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new la(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new ca;return n.value=i,n}});function Bl(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Vl=B(`$ZodOptional`,(e,t)=>{G.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,H(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),H(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Sa(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>Bl(t,e.value)):Bl(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Hl=B(`$ZodNullable`,(e,t)=>{G.init(e,t),H(e._zod,`optin`,()=>t.innerType._zod.optin),H(e._zod,`optout`,()=>t.innerType._zod.optout),H(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Sa(e.source)}|null)$`):void 0}),H(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Ul=B(`$ZodDefault`,(e,t)=>{G.init(e,t),e._zod.optin=`optional`,H(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Wl(e,t)):Wl(r,t)}});function Wl(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Gl=B(`$ZodPrefault`,(e,t)=>{G.init(e,t),e._zod.optin=`optional`,H(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Kl=B(`$ZodNonOptional`,(e,t)=>{G.init(e,t),H(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>ql(t,e)):ql(i,e)}});function ql(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}const Jl=B(`$ZodSuccess`,(e,t)=>{G.init(e,t),e._zod.parse=(e,n)=>{if(n.direction===`backward`)throw new la(`ZodSuccess`);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>(e.value=t.issues.length===0,e)):(e.value=r.issues.length===0,e)}}),Yl=B(`$ZodCatch`,(e,t)=>{G.init(e,t),H(e._zod,`optin`,()=>t.innerType._zod.optin),H(e._zod,`optout`,()=>t.innerType._zod.optout),H(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>io(e,n,da()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>io(e,n,da()))},input:e.value}),e.issues=[]),e)}}),Xl=B(`$ZodNaN`,(e,t)=>{G.init(e,t),e._zod.parse=(t,n)=>((typeof t.value!=`number`||!Number.isNaN(t.value))&&t.issues.push({input:t.value,inst:e,expected:`nan`,code:`invalid_type`}),t)}),Zl=B(`$ZodPipe`,(e,t)=>{G.init(e,t),H(e._zod,`values`,()=>t.in._zod.values),H(e._zod,`optin`,()=>t.in._zod.optin),H(e._zod,`optout`,()=>t.out._zod.optout),H(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Ql(e,t.in,n)):Ql(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Ql(e,t.out,n)):Ql(r,t.out,n)}});function Ql(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const $l=B(`$ZodCodec`,(e,t)=>{G.init(e,t),H(e._zod,`values`,()=>t.in._zod.values),H(e._zod,`optin`,()=>t.in._zod.optin),H(e._zod,`optout`,()=>t.out._zod.optout),H(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if((n.direction||`forward`)===`forward`){let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>eu(e,t,n)):eu(r,t,n)}else{let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>eu(e,t,n)):eu(r,t,n)}}});function eu(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||`forward`)===`forward`){let r=t.transform(e.value,e);return r instanceof Promise?r.then(r=>tu(e,r,t.out,n)):tu(e,r,t.out,n)}else{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(r=>tu(e,r,t.in,n)):tu(e,r,t.in,n)}}function tu(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}const nu=B(`$ZodReadonly`,(e,t)=>{G.init(e,t),H(e._zod,`propValues`,()=>t.innerType._zod.propValues),H(e._zod,`values`,()=>t.innerType._zod.values),H(e._zod,`optin`,()=>t.innerType._zod.optin),H(e._zod,`optout`,()=>t.innerType._zod.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(ru):ru(r)}});function ru(e){return e.value=Object.freeze(e.value),e}const iu=B(`$ZodTemplateLiteral`,(e,t)=>{G.init(e,t);let n=[];for(let e of t.parts)if(typeof e==`object`&&e){if(!e._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);let t=e._zod.pattern instanceof RegExp?e._zod.pattern.source:e._zod.pattern;if(!t)throw Error(`Invalid template literal part: ${e._zod.traits}`);let r=t.startsWith(`^`)?1:0,i=t.endsWith(`$`)?t.length-1:t.length;n.push(t.slice(r,i))}else if(e===null||Va.has(typeof e))n.push(Ha(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${n.join(``)}$`),e._zod.parse=(n,r)=>typeof n.value==`string`?(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:`invalid_format`,format:t.format??`template_literal`,pattern:e._zod.pattern.source}),n):(n.issues.push({input:n.value,inst:e,expected:`template_literal`,code:`invalid_type`}),n)}),au=B(`$ZodFunction`,(e,t)=>(G.init(e,t),e._def=t,e._zod.def=t,e.implement=t=>{if(typeof t!=`function`)throw Error(`implement() must be called with a function`);return function(...n){let r=e._def.input?Eo(e._def.input,n):n,i=Reflect.apply(t,this,r);return e._def.output?Eo(e._def.output,i):i}},e.implementAsync=t=>{if(typeof t!=`function`)throw Error(`implementAsync() must be called with a function`);return async function(...n){let r=e._def.input?await Oo(e._def.input,n):n,i=await Reflect.apply(t,this,r);return e._def.output?await Oo(e._def.output,i):i}},e._zod.parse=(t,n)=>typeof t.value==`function`?(e._def.output&&e._def.output._zod.def.type===`promise`?t.value=e.implementAsync(t.value):t.value=e.implement(t.value),t):(t.issues.push({code:`invalid_type`,expected:`function`,input:t.value,inst:e}),t),e.input=(...t)=>{let n=e.constructor;return Array.isArray(t[0])?new n({type:`function`,input:new kl({type:`tuple`,items:t[0],rest:t[1]}),output:e._def.output}):new n({type:`function`,input:t[0],output:e._def.output})},e.output=t=>{let n=e.constructor;return new n({type:`function`,input:e._def.input,output:t})},e)),ou=B(`$ZodPromise`,(e,t)=>{G.init(e,t),e._zod.parse=(e,n)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},n))}),su=B(`$ZodLazy`,(e,t)=>{G.init(e,t),H(e._zod,`innerType`,()=>t.getter()),H(e._zod,`pattern`,()=>e._zod.innerType._zod.pattern),H(e._zod,`propValues`,()=>e._zod.innerType._zod.propValues),H(e._zod,`optin`,()=>e._zod.innerType._zod.optin??void 0),H(e._zod,`optout`,()=>e._zod.innerType._zod.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),cu=B(`$ZodCustom`,(e,t)=>{rc.init(e,t),G.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>lu(t,n,r,e));lu(i,n,r,e)}});function lu(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(so(e))}}const uu=()=>{let e={string:{unit:`حرف`,verb:`أن يحوي`},file:{unit:`بايت`,verb:`أن يحوي`},array:{unit:`عنصر`,verb:`أن يحوي`},set:{unit:`عنصر`,verb:`أن يحوي`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`مدخل`,email:`بريد إلكتروني`,url:`رابط`,emoji:`إيموجي`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`تاريخ ووقت بمعيار ISO`,date:`تاريخ بمعيار ISO`,time:`وقت بمعيار ISO`,duration:`مدة بمعيار ISO`,ipv4:`عنوان IPv4`,ipv6:`عنوان IPv6`,cidrv4:`مدى عناوين بصيغة IPv4`,cidrv6:`مدى عناوين بصيغة IPv6`,base64:`نَص بترميز base64-encoded`,base64url:`نَص بترميز base64url-encoded`,json_string:`نَص على هيئة JSON`,e164:`رقم هاتف بمعيار E.164`,jwt:`JWT`,template_literal:`مدخل`};return e=>{switch(e.code){case`invalid_type`:return`مدخلات غير مقبولة: يفترض إدخال ${e.expected}، ولكن تم إدخال ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${W(e.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${V(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?` أكبر من اللازم: يفترض أن تكون ${e.origin??`القيمة`} ${n} ${e.maximum.toString()} ${r.unit??`عنصر`}`:`أكبر من اللازم: يفترض أن تكون ${e.origin??`القيمة`} ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`أصغر من اللازم: يفترض لـ ${e.origin} أن يكون ${n} ${e.minimum.toString()} ${r.unit}`:`أصغر من اللازم: يفترض لـ ${e.origin} أن يكون ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`نَص غير مقبول: يجب أن يبدأ بـ "${e.prefix}"`:t.format===`ends_with`?`نَص غير مقبول: يجب أن ينتهي بـ "${t.suffix}"`:t.format===`includes`?`نَص غير مقبول: يجب أن يتضمَّن "${t.includes}"`:t.format===`regex`?`نَص غير مقبول: يجب أن يطابق النمط ${t.pattern}`:`${r[t.format]??e.format} غير مقبول`}case`not_multiple_of`:return`رقم غير مقبول: يجب أن يكون من مضاعفات ${e.divisor}`;case`unrecognized_keys`:return`معرف${e.keys.length>1?`ات`:``} غريب${e.keys.length>1?`ة`:``}: ${V(e.keys,`، `)}`;case`invalid_key`:return`معرف غير مقبول في ${e.origin}`;case`invalid_union`:return`مدخل غير مقبول`;case`invalid_element`:return`مدخل غير مقبول في ${e.origin}`;default:return`مدخل غير مقبول`}}};function du(){return{localeError:uu()}}const fu=()=>{let e={string:{unit:`simvol`,verb:`olmalıdır`},file:{unit:`bayt`,verb:`olmalıdır`},array:{unit:`element`,verb:`olmalıdır`},set:{unit:`element`,verb:`olmalıdır`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},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`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`Yanlış dəyər: gözlənilən ${e.expected}, daxil olan ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Yanlış dəyər: gözlənilən ${W(e.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${V(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Çox böyük: gözlənilən ${e.origin??`dəyər`} ${n}${e.maximum.toString()} ${r.unit??`element`}`:`Çox böyük: gözlənilən ${e.origin??`dəyər`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Çox kiçik: gözlənilən ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`Çox kiçik: gözlənilən ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Yanlış mətn: "${t.prefix}" ilə başlamalıdır`:t.format===`ends_with`?`Yanlış mətn: "${t.suffix}" ilə bitməlidir`:t.format===`includes`?`Yanlış mətn: "${t.includes}" daxil olmalıdır`:t.format===`regex`?`Yanlış mətn: ${t.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${r[t.format]??e.format}`}case`not_multiple_of`:return`Yanlış ədəd: ${e.divisor} ilə bölünə bilən olmalıdır`;case`unrecognized_keys`:return`Tanınmayan açar${e.keys.length>1?`lar`:``}: ${V(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} daxilində yanlış açar`;case`invalid_union`:return`Yanlış dəyər`;case`invalid_element`:return`${e.origin} daxilində yanlış dəyər`;default:return`Yanlış dəyər`}}};function pu(){return{localeError:fu()}}function mu(e,t,n,r){let i=Math.abs(e),a=i%10,o=i%100;return o>=11&&o<=19?r:a===1?t:a>=2&&a<=4?n:r}const hu=()=>{let e={string:{unit:{one:`сімвал`,few:`сімвалы`,many:`сімвалаў`},verb:`мець`},array:{unit:{one:`элемент`,few:`элементы`,many:`элементаў`},verb:`мець`},set:{unit:{one:`элемент`,few:`элементы`,many:`элементаў`},verb:`мець`},file:{unit:{one:`байт`,few:`байты`,many:`байтаў`},verb:`мець`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`лік`;case`object`:if(Array.isArray(e))return`масіў`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`увод`,email:`email адрас`,url:`URL`,emoji:`эмодзі`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO дата і час`,date:`ISO дата`,time:`ISO час`,duration:`ISO працягласць`,ipv4:`IPv4 адрас`,ipv6:`IPv6 адрас`,cidrv4:`IPv4 дыяпазон`,cidrv6:`IPv6 дыяпазон`,base64:`радок у фармаце base64`,base64url:`радок у фармаце base64url`,json_string:`JSON радок`,e164:`нумар E.164`,jwt:`JWT`,template_literal:`увод`};return e=>{switch(e.code){case`invalid_type`:return`Няправільны ўвод: чакаўся ${e.expected}, атрымана ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Няправільны ўвод: чакалася ${W(e.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${V(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=mu(Number(e.maximum),r.unit.one,r.unit.few,r.unit.many);return`Занадта вялікі: чакалася, што ${e.origin??`значэнне`} павінна ${r.verb} ${n}${e.maximum.toString()} ${t}`}return`Занадта вялікі: чакалася, што ${e.origin??`значэнне`} павінна быць ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=mu(Number(e.minimum),r.unit.one,r.unit.few,r.unit.many);return`Занадта малы: чакалася, што ${e.origin} павінна ${r.verb} ${n}${e.minimum.toString()} ${t}`}return`Занадта малы: чакалася, што ${e.origin} павінна быць ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Няправільны радок: павінен пачынацца з "${t.prefix}"`:t.format===`ends_with`?`Няправільны радок: павінен заканчвацца на "${t.suffix}"`:t.format===`includes`?`Няправільны радок: павінен змяшчаць "${t.includes}"`:t.format===`regex`?`Няправільны радок: павінен адпавядаць шаблону ${t.pattern}`:`Няправільны ${r[t.format]??e.format}`}case`not_multiple_of`:return`Няправільны лік: павінен быць кратным ${e.divisor}`;case`unrecognized_keys`:return`Нераспазнаны ${e.keys.length>1?`ключы`:`ключ`}: ${V(e.keys,`, `)}`;case`invalid_key`:return`Няправільны ключ у ${e.origin}`;case`invalid_union`:return`Няправільны ўвод`;case`invalid_element`:return`Няправільнае значэнне ў ${e.origin}`;default:return`Няправільны ўвод`}}};function gu(){return{localeError:hu()}}const _u=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`число`;case`object`:if(Array.isArray(e))return`масив`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},vu=()=>{let e={string:{unit:`символа`,verb:`да съдържа`},file:{unit:`байта`,verb:`да съдържа`},array:{unit:`елемента`,verb:`да съдържа`},set:{unit:`елемента`,verb:`да съдържа`}};function t(t){return e[t]??null}let n={regex:`вход`,email:`имейл адрес`,url:`URL`,emoji:`емоджи`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO време`,date:`ISO дата`,time:`ISO време`,duration:`ISO продължителност`,ipv4:`IPv4 адрес`,ipv6:`IPv6 адрес`,cidrv4:`IPv4 диапазон`,cidrv6:`IPv6 диапазон`,base64:`base64-кодиран низ`,base64url:`base64url-кодиран низ`,json_string:`JSON низ`,e164:`E.164 номер`,jwt:`JWT`,template_literal:`вход`};return e=>{switch(e.code){case`invalid_type`:return`Невалиден вход: очакван ${e.expected}, получен ${_u(e.input)}`;case`invalid_value`:return e.values.length===1?`Невалиден вход: очакван ${W(e.values[0])}`:`Невалидна опция: очаквано едно от ${V(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Твърде голямо: очаква се ${e.origin??`стойност`} да съдържа ${n}${e.maximum.toString()} ${r.unit??`елемента`}`:`Твърде голямо: очаква се ${e.origin??`стойност`} да бъде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Твърде малко: очаква се ${e.origin} да съдържа ${n}${e.minimum.toString()} ${r.unit}`:`Твърде малко: очаква се ${e.origin} да бъде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;if(t.format===`starts_with`)return`Невалиден низ: трябва да започва с "${t.prefix}"`;if(t.format===`ends_with`)return`Невалиден низ: трябва да завършва с "${t.suffix}"`;if(t.format===`includes`)return`Невалиден низ: трябва да включва "${t.includes}"`;if(t.format===`regex`)return`Невалиден низ: трябва да съвпада с ${t.pattern}`;let r=`Невалиден`;return t.format===`emoji`&&(r=`Невалидно`),t.format===`datetime`&&(r=`Невалидно`),t.format===`date`&&(r=`Невалидна`),t.format===`time`&&(r=`Невалидно`),t.format===`duration`&&(r=`Невалидна`),`${r} ${n[t.format]??e.format}`}case`not_multiple_of`:return`Невалидно число: трябва да бъде кратно на ${e.divisor}`;case`unrecognized_keys`:return`Неразпознат${e.keys.length>1?`и`:``} ключ${e.keys.length>1?`ове`:``}: ${V(e.keys,`, `)}`;case`invalid_key`:return`Невалиден ключ в ${e.origin}`;case`invalid_union`:return`Невалиден вход`;case`invalid_element`:return`Невалидна стойност в ${e.origin}`;default:return`Невалиден вход`}}};function yu(){return{localeError:vu()}}const bu=()=>{let e={string:{unit:`caràcters`,verb:`contenir`},file:{unit:`bytes`,verb:`contenir`},array:{unit:`elements`,verb:`contenir`},set:{unit:`elements`,verb:`contenir`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`entrada`,email:`adreça electrònica`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data i hora ISO`,date:`data ISO`,time:`hora ISO`,duration:`durada ISO`,ipv4:`adreça IPv4`,ipv6:`adreça IPv6`,cidrv4:`rang IPv4`,cidrv6:`rang IPv6`,base64:`cadena codificada en base64`,base64url:`cadena codificada en base64url`,json_string:`cadena JSON`,e164:`número E.164`,jwt:`JWT`,template_literal:`entrada`};return e=>{switch(e.code){case`invalid_type`:return`Tipus invàlid: s'esperava ${e.expected}, s'ha rebut ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Valor invàlid: s'esperava ${W(e.values[0])}`:`Opció invàlida: s'esperava una de ${V(e.values,` o `)}`;case`too_big`:{let n=e.inclusive?`com a màxim`:`menys de`,r=t(e.origin);return r?`Massa gran: s'esperava que ${e.origin??`el valor`} contingués ${n} ${e.maximum.toString()} ${r.unit??`elements`}`:`Massa gran: s'esperava que ${e.origin??`el valor`} fos ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`com a mínim`:`més de`,r=t(e.origin);return r?`Massa petit: s'esperava que ${e.origin} contingués ${n} ${e.minimum.toString()} ${r.unit}`:`Massa petit: s'esperava que ${e.origin} fos ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Format invàlid: ha de començar amb "${t.prefix}"`:t.format===`ends_with`?`Format invàlid: ha d'acabar amb "${t.suffix}"`:t.format===`includes`?`Format invàlid: ha d'incloure "${t.includes}"`:t.format===`regex`?`Format invàlid: ha de coincidir amb el patró ${t.pattern}`:`Format invàlid per a ${r[t.format]??e.format}`}case`not_multiple_of`:return`Número invàlid: ha de ser múltiple de ${e.divisor}`;case`unrecognized_keys`:return`Clau${e.keys.length>1?`s`:``} no reconeguda${e.keys.length>1?`s`:``}: ${V(e.keys,`, `)}`;case`invalid_key`:return`Clau invàlida a ${e.origin}`;case`invalid_union`:return`Entrada invàlida`;case`invalid_element`:return`Element invàlid a ${e.origin}`;default:return`Entrada invàlida`}}};function xu(){return{localeError:bu()}}const Su=()=>{let e={string:{unit:`znaků`,verb:`mít`},file:{unit:`bajtů`,verb:`mít`},array:{unit:`prvků`,verb:`mít`},set:{unit:`prvků`,verb:`mít`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`číslo`;case`string`:return`řetězec`;case`boolean`:return`boolean`;case`bigint`:return`bigint`;case`function`:return`funkce`;case`symbol`:return`symbol`;case`undefined`:return`undefined`;case`object`:if(Array.isArray(e))return`pole`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`regulární výraz`,email:`e-mailová adresa`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`datum a čas ve formátu ISO`,date:`datum ve formátu ISO`,time:`čas ve formátu ISO`,duration:`doba trvání ISO`,ipv4:`IPv4 adresa`,ipv6:`IPv6 adresa`,cidrv4:`rozsah IPv4`,cidrv6:`rozsah IPv6`,base64:`řetězec zakódovaný ve formátu base64`,base64url:`řetězec zakódovaný ve formátu base64url`,json_string:`řetězec ve formátu JSON`,e164:`číslo E.164`,jwt:`JWT`,template_literal:`vstup`};return e=>{switch(e.code){case`invalid_type`:return`Neplatný vstup: očekáváno ${e.expected}, obdrženo ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Neplatný vstup: očekáváno ${W(e.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${V(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Hodnota je příliš velká: ${e.origin??`hodnota`} musí mít ${n}${e.maximum.toString()} ${r.unit??`prvků`}`:`Hodnota je příliš velká: ${e.origin??`hodnota`} musí být ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Hodnota je příliš malá: ${e.origin??`hodnota`} musí mít ${n}${e.minimum.toString()} ${r.unit??`prvků`}`:`Hodnota je příliš malá: ${e.origin??`hodnota`} musí být ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neplatný řetězec: musí začínat na "${t.prefix}"`:t.format===`ends_with`?`Neplatný řetězec: musí končit na "${t.suffix}"`:t.format===`includes`?`Neplatný řetězec: musí obsahovat "${t.includes}"`:t.format===`regex`?`Neplatný řetězec: musí odpovídat vzoru ${t.pattern}`:`Neplatný formát ${r[t.format]??e.format}`}case`not_multiple_of`:return`Neplatné číslo: musí být násobkem ${e.divisor}`;case`unrecognized_keys`:return`Neznámé klíče: ${V(e.keys,`, `)}`;case`invalid_key`:return`Neplatný klíč v ${e.origin}`;case`invalid_union`:return`Neplatný vstup`;case`invalid_element`:return`Neplatná hodnota v ${e.origin}`;default:return`Neplatný vstup`}}};function Cu(){return{localeError:Su()}}const wu=()=>{let e={string:{unit:`tegn`,verb:`havde`},file:{unit:`bytes`,verb:`havde`},array:{unit:`elementer`,verb:`indeholdt`},set:{unit:`elementer`,verb:`indeholdt`}},t={string:`streng`,number:`tal`,boolean:`boolean`,array:`liste`,object:`objekt`,set:`sæt`,file:`fil`};function n(t){return e[t]??null}function r(e){return t[e]??e}let i=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`tal`;case`object`:return Array.isArray(e)?`liste`:e===null?`null`:Object.getPrototypeOf(e)!==Object.prototype&&e.constructor?e.constructor.name:`objekt`}return t},a={regex:`input`,email:`e-mailadresse`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO dato- og klokkeslæt`,date:`ISO-dato`,time:`ISO-klokkeslæt`,duration:`ISO-varighed`,ipv4:`IPv4-område`,ipv6:`IPv6-område`,cidrv4:`IPv4-spektrum`,cidrv6:`IPv6-spektrum`,base64:`base64-kodet streng`,base64url:`base64url-kodet streng`,json_string:`JSON-streng`,e164:`E.164-nummer`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`Ugyldigt input: forventede ${r(e.expected)}, fik ${r(i(e.input))}`;case`invalid_value`:return e.values.length===1?`Ugyldig værdi: forventede ${W(e.values[0])}`:`Ugyldigt valg: forventede en af følgende ${V(e.values,`|`)}`;case`too_big`:{let t=e.inclusive?`<=`:`<`,i=n(e.origin),a=r(e.origin);return i?`For stor: forventede ${a??`value`} ${i.verb} ${t} ${e.maximum.toString()} ${i.unit??`elementer`}`:`For stor: forventede ${a??`value`} havde ${t} ${e.maximum.toString()}`}case`too_small`:{let t=e.inclusive?`>=`:`>`,i=n(e.origin),a=r(e.origin);return i?`For lille: forventede ${a} ${i.verb} ${t} ${e.minimum.toString()} ${i.unit}`:`For lille: forventede ${a} havde ${t} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ugyldig streng: skal starte med "${t.prefix}"`:t.format===`ends_with`?`Ugyldig streng: skal ende med "${t.suffix}"`:t.format===`includes`?`Ugyldig streng: skal indeholde "${t.includes}"`:t.format===`regex`?`Ugyldig streng: skal matche mønsteret ${t.pattern}`:`Ugyldig ${a[t.format]??e.format}`}case`not_multiple_of`:return`Ugyldigt tal: skal være deleligt med ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Ukendte nøgler`:`Ukendt nøgle`}: ${V(e.keys,`, `)}`;case`invalid_key`:return`Ugyldig nøgle i ${e.origin}`;case`invalid_union`:return`Ugyldigt input: matcher ingen af de tilladte typer`;case`invalid_element`:return`Ugyldig værdi i ${e.origin}`;default:return`Ugyldigt input`}}};function Tu(){return{localeError:wu()}}const Eu=()=>{let e={string:{unit:`Zeichen`,verb:`zu haben`},file:{unit:`Bytes`,verb:`zu haben`},array:{unit:`Elemente`,verb:`zu haben`},set:{unit:`Elemente`,verb:`zu haben`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`Zahl`;case`object`:if(Array.isArray(e))return`Array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`Eingabe`,email:`E-Mail-Adresse`,url:`URL`,emoji:`Emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-Datum und -Uhrzeit`,date:`ISO-Datum`,time:`ISO-Uhrzeit`,duration:`ISO-Dauer`,ipv4:`IPv4-Adresse`,ipv6:`IPv6-Adresse`,cidrv4:`IPv4-Bereich`,cidrv6:`IPv6-Bereich`,base64:`Base64-codierter String`,base64url:`Base64-URL-codierter String`,json_string:`JSON-String`,e164:`E.164-Nummer`,jwt:`JWT`,template_literal:`Eingabe`};return e=>{switch(e.code){case`invalid_type`:return`Ungültige Eingabe: erwartet ${e.expected}, erhalten ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Ungültige Eingabe: erwartet ${W(e.values[0])}`:`Ungültige Option: erwartet eine von ${V(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Zu groß: erwartet, dass ${e.origin??`Wert`} ${n}${e.maximum.toString()} ${r.unit??`Elemente`} hat`:`Zu groß: erwartet, dass ${e.origin??`Wert`} ${n}${e.maximum.toString()} ist`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Zu klein: erwartet, dass ${e.origin} ${n}${e.minimum.toString()} ${r.unit} hat`:`Zu klein: erwartet, dass ${e.origin} ${n}${e.minimum.toString()} ist`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ungültiger String: muss mit "${t.prefix}" beginnen`:t.format===`ends_with`?`Ungültiger String: muss mit "${t.suffix}" enden`:t.format===`includes`?`Ungültiger String: muss "${t.includes}" enthalten`:t.format===`regex`?`Ungültiger String: muss dem Muster ${t.pattern} entsprechen`:`Ungültig: ${r[t.format]??e.format}`}case`not_multiple_of`:return`Ungültige Zahl: muss ein Vielfaches von ${e.divisor} sein`;case`unrecognized_keys`:return`${e.keys.length>1?`Unbekannte Schlüssel`:`Unbekannter Schlüssel`}: ${V(e.keys,`, `)}`;case`invalid_key`:return`Ungültiger Schlüssel in ${e.origin}`;case`invalid_union`:return`Ungültige Eingabe`;case`invalid_element`:return`Ungültiger Wert in ${e.origin}`;default:return`Ungültige Eingabe`}}};function Du(){return{localeError:Eu()}}const Ou=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},ku=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${e.expected}, received ${Ou(e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${W(e.values[0])}`:`Invalid option: expected one of ${V(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${V(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function Au(){return{localeError:ku()}}const ju=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`nombro`;case`object`:if(Array.isArray(e))return`tabelo`;if(e===null)return`senvalora`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},Mu=()=>{let e={string:{unit:`karaktrojn`,verb:`havi`},file:{unit:`bajtojn`,verb:`havi`},array:{unit:`elementojn`,verb:`havi`},set:{unit:`elementojn`,verb:`havi`}};function t(t){return e[t]??null}let n={regex:`enigo`,email:`retadreso`,url:`URL`,emoji:`emoĝio`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-datotempo`,date:`ISO-dato`,time:`ISO-tempo`,duration:`ISO-daŭro`,ipv4:`IPv4-adreso`,ipv6:`IPv6-adreso`,cidrv4:`IPv4-rango`,cidrv6:`IPv6-rango`,base64:`64-ume kodita karaktraro`,base64url:`URL-64-ume kodita karaktraro`,json_string:`JSON-karaktraro`,e164:`E.164-nombro`,jwt:`JWT`,template_literal:`enigo`};return e=>{switch(e.code){case`invalid_type`:return`Nevalida enigo: atendiĝis ${e.expected}, riceviĝis ${ju(e.input)}`;case`invalid_value`:return e.values.length===1?`Nevalida enigo: atendiĝis ${W(e.values[0])}`:`Nevalida opcio: atendiĝis unu el ${V(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Tro granda: atendiĝis ke ${e.origin??`valoro`} havu ${n}${e.maximum.toString()} ${r.unit??`elementojn`}`:`Tro granda: atendiĝis ke ${e.origin??`valoro`} havu ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Tro malgranda: atendiĝis ke ${e.origin} havu ${n}${e.minimum.toString()} ${r.unit}`:`Tro malgranda: atendiĝis ke ${e.origin} estu ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Nevalida karaktraro: devas komenciĝi per "${t.prefix}"`:t.format===`ends_with`?`Nevalida karaktraro: devas finiĝi per "${t.suffix}"`:t.format===`includes`?`Nevalida karaktraro: devas inkluzivi "${t.includes}"`:t.format===`regex`?`Nevalida karaktraro: devas kongrui kun la modelo ${t.pattern}`:`Nevalida ${n[t.format]??e.format}`}case`not_multiple_of`:return`Nevalida nombro: devas esti oblo de ${e.divisor}`;case`unrecognized_keys`:return`Nekonata${e.keys.length>1?`j`:``} ŝlosilo${e.keys.length>1?`j`:``}: ${V(e.keys,`, `)}`;case`invalid_key`:return`Nevalida ŝlosilo en ${e.origin}`;case`invalid_union`:return`Nevalida enigo`;case`invalid_element`:return`Nevalida valoro en ${e.origin}`;default:return`Nevalida enigo`}}};function Nu(){return{localeError:Mu()}}const Pu=()=>{let e={string:{unit:`caracteres`,verb:`tener`},file:{unit:`bytes`,verb:`tener`},array:{unit:`elementos`,verb:`tener`},set:{unit:`elementos`,verb:`tener`}},t={string:`texto`,number:`número`,boolean:`booleano`,array:`arreglo`,object:`objeto`,set:`conjunto`,file:`archivo`,date:`fecha`,bigint:`número grande`,symbol:`símbolo`,undefined:`indefinido`,null:`nulo`,function:`función`,map:`mapa`,record:`registro`,tuple:`tupla`,enum:`enumeración`,union:`unión`,literal:`literal`,promise:`promesa`,void:`vacío`,never:`nunca`,unknown:`desconocido`,any:`cualquiera`};function n(t){return e[t]??null}function r(e){return t[e]??e}let i=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:return Array.isArray(e)?`array`:e===null?`null`:Object.getPrototypeOf(e)===Object.prototype?`object`:e.constructor.name}return t},a={regex:`entrada`,email:`dirección de correo electrónico`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`fecha y hora ISO`,date:`fecha ISO`,time:`hora ISO`,duration:`duración ISO`,ipv4:`dirección IPv4`,ipv6:`dirección IPv6`,cidrv4:`rango IPv4`,cidrv6:`rango IPv6`,base64:`cadena codificada en base64`,base64url:`URL codificada en base64`,json_string:`cadena JSON`,e164:`número E.164`,jwt:`JWT`,template_literal:`entrada`};return e=>{switch(e.code){case`invalid_type`:return`Entrada inválida: se esperaba ${r(e.expected)}, recibido ${r(i(e.input))}`;case`invalid_value`:return e.values.length===1?`Entrada inválida: se esperaba ${W(e.values[0])}`:`Opción inválida: se esperaba una de ${V(e.values,`|`)}`;case`too_big`:{let t=e.inclusive?`<=`:`<`,i=n(e.origin),a=r(e.origin);return i?`Demasiado grande: se esperaba que ${a??`valor`} tuviera ${t}${e.maximum.toString()} ${i.unit??`elementos`}`:`Demasiado grande: se esperaba que ${a??`valor`} fuera ${t}${e.maximum.toString()}`}case`too_small`:{let t=e.inclusive?`>=`:`>`,i=n(e.origin),a=r(e.origin);return i?`Demasiado pequeño: se esperaba que ${a} tuviera ${t}${e.minimum.toString()} ${i.unit}`:`Demasiado pequeño: se esperaba que ${a} fuera ${t}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Cadena inválida: debe comenzar con "${t.prefix}"`:t.format===`ends_with`?`Cadena inválida: debe terminar en "${t.suffix}"`:t.format===`includes`?`Cadena inválida: debe incluir "${t.includes}"`:t.format===`regex`?`Cadena inválida: debe coincidir con el patrón ${t.pattern}`:`Inválido ${a[t.format]??e.format}`}case`not_multiple_of`:return`Número inválido: debe ser múltiplo de ${e.divisor}`;case`unrecognized_keys`:return`Llave${e.keys.length>1?`s`:``} desconocida${e.keys.length>1?`s`:``}: ${V(e.keys,`, `)}`;case`invalid_key`:return`Llave inválida en ${r(e.origin)}`;case`invalid_union`:return`Entrada inválida`;case`invalid_element`:return`Valor inválido en ${r(e.origin)}`;default:return`Entrada inválida`}}};function Fu(){return{localeError:Pu()}}const Iu=()=>{let e={string:{unit:`کاراکتر`,verb:`داشته باشد`},file:{unit:`بایت`,verb:`داشته باشد`},array:{unit:`آیتم`,verb:`داشته باشد`},set:{unit:`آیتم`,verb:`داشته باشد`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`عدد`;case`object`:if(Array.isArray(e))return`آرایه`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ورودی`,email:`آدرس ایمیل`,url:`URL`,emoji:`ایموجی`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`تاریخ و زمان ایزو`,date:`تاریخ ایزو`,time:`زمان ایزو`,duration:`مدت زمان ایزو`,ipv4:`IPv4 آدرس`,ipv6:`IPv6 آدرس`,cidrv4:`IPv4 دامنه`,cidrv6:`IPv6 دامنه`,base64:`base64-encoded رشته`,base64url:`base64url-encoded رشته`,json_string:`JSON رشته`,e164:`E.164 عدد`,jwt:`JWT`,template_literal:`ورودی`};return e=>{switch(e.code){case`invalid_type`:return`ورودی نامعتبر: می‌بایست ${e.expected} می‌بود، ${n(e.input)} دریافت شد`;case`invalid_value`:return e.values.length===1?`ورودی نامعتبر: می‌بایست ${W(e.values[0])} می‌بود`:`گزینه نامعتبر: می‌بایست یکی از ${V(e.values,`|`)} می‌بود`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`خیلی بزرگ: ${e.origin??`مقدار`} باید ${n}${e.maximum.toString()} ${r.unit??`عنصر`} باشد`:`خیلی بزرگ: ${e.origin??`مقدار`} باید ${n}${e.maximum.toString()} باشد`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`خیلی کوچک: ${e.origin} باید ${n}${e.minimum.toString()} ${r.unit} باشد`:`خیلی کوچک: ${e.origin} باید ${n}${e.minimum.toString()} باشد`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`رشته نامعتبر: باید با "${t.prefix}" شروع شود`:t.format===`ends_with`?`رشته نامعتبر: باید با "${t.suffix}" تمام شود`:t.format===`includes`?`رشته نامعتبر: باید شامل "${t.includes}" باشد`:t.format===`regex`?`رشته نامعتبر: باید با الگوی ${t.pattern} مطابقت داشته باشد`:`${r[t.format]??e.format} نامعتبر`}case`not_multiple_of`:return`عدد نامعتبر: باید مضرب ${e.divisor} باشد`;case`unrecognized_keys`:return`کلید${e.keys.length>1?`های`:``} ناشناس: ${V(e.keys,`, `)}`;case`invalid_key`:return`کلید ناشناس در ${e.origin}`;case`invalid_union`:return`ورودی نامعتبر`;case`invalid_element`:return`مقدار نامعتبر در ${e.origin}`;default:return`ورودی نامعتبر`}}};function Lu(){return{localeError:Iu()}}const Ru=()=>{let e={string:{unit:`merkkiä`,subject:`merkkijonon`},file:{unit:`tavua`,subject:`tiedoston`},array:{unit:`alkiota`,subject:`listan`},set:{unit:`alkiota`,subject:`joukon`},number:{unit:``,subject:`luvun`},bigint:{unit:``,subject:`suuren kokonaisluvun`},int:{unit:``,subject:`kokonaisluvun`},date:{unit:``,subject:`päivämäärän`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`säännöllinen lauseke`,email:`sähköpostiosoite`,url:`URL-osoite`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-aikaleima`,date:`ISO-päivämäärä`,time:`ISO-aika`,duration:`ISO-kesto`,ipv4:`IPv4-osoite`,ipv6:`IPv6-osoite`,cidrv4:`IPv4-alue`,cidrv6:`IPv6-alue`,base64:`base64-koodattu merkkijono`,base64url:`base64url-koodattu merkkijono`,json_string:`JSON-merkkijono`,e164:`E.164-luku`,jwt:`JWT`,template_literal:`templaattimerkkijono`};return e=>{switch(e.code){case`invalid_type`:return`Virheellinen tyyppi: odotettiin ${e.expected}, oli ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Virheellinen syöte: täytyy olla ${W(e.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${V(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Liian suuri: ${r.subject} täytyy olla ${n}${e.maximum.toString()} ${r.unit}`.trim():`Liian suuri: arvon täytyy olla ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Liian pieni: ${r.subject} täytyy olla ${n}${e.minimum.toString()} ${r.unit}`.trim():`Liian pieni: arvon täytyy olla ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Virheellinen syöte: täytyy alkaa "${t.prefix}"`:t.format===`ends_with`?`Virheellinen syöte: täytyy loppua "${t.suffix}"`:t.format===`includes`?`Virheellinen syöte: täytyy sisältää "${t.includes}"`:t.format===`regex`?`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${t.pattern}`:`Virheellinen ${r[t.format]??e.format}`}case`not_multiple_of`:return`Virheellinen luku: täytyy olla luvun ${e.divisor} monikerta`;case`unrecognized_keys`:return`${e.keys.length>1?`Tuntemattomat avaimet`:`Tuntematon avain`}: ${V(e.keys,`, `)}`;case`invalid_key`:return`Virheellinen avain tietueessa`;case`invalid_union`:return`Virheellinen unioni`;case`invalid_element`:return`Virheellinen arvo joukossa`;default:return`Virheellinen syöte`}}};function zu(){return{localeError:Ru()}}const Bu=()=>{let e={string:{unit:`caractères`,verb:`avoir`},file:{unit:`octets`,verb:`avoir`},array:{unit:`éléments`,verb:`avoir`},set:{unit:`éléments`,verb:`avoir`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`nombre`;case`object`:if(Array.isArray(e))return`tableau`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`entrée`,email:`adresse e-mail`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`date et heure ISO`,date:`date ISO`,time:`heure ISO`,duration:`durée ISO`,ipv4:`adresse IPv4`,ipv6:`adresse IPv6`,cidrv4:`plage IPv4`,cidrv6:`plage IPv6`,base64:`chaîne encodée en base64`,base64url:`chaîne encodée en base64url`,json_string:`chaîne JSON`,e164:`numéro E.164`,jwt:`JWT`,template_literal:`entrée`};return e=>{switch(e.code){case`invalid_type`:return`Entrée invalide : ${e.expected} attendu, ${n(e.input)} reçu`;case`invalid_value`:return e.values.length===1?`Entrée invalide : ${W(e.values[0])} attendu`:`Option invalide : une valeur parmi ${V(e.values,`|`)} attendue`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Trop grand : ${e.origin??`valeur`} doit ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`élément(s)`}`:`Trop grand : ${e.origin??`valeur`} doit être ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Trop petit : ${e.origin} doit ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Trop petit : ${e.origin} doit être ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chaîne invalide : doit commencer par "${t.prefix}"`:t.format===`ends_with`?`Chaîne invalide : doit se terminer par "${t.suffix}"`:t.format===`includes`?`Chaîne invalide : doit inclure "${t.includes}"`:t.format===`regex`?`Chaîne invalide : doit correspondre au modèle ${t.pattern}`:`${r[t.format]??e.format} invalide`}case`not_multiple_of`:return`Nombre invalide : doit être un multiple de ${e.divisor}`;case`unrecognized_keys`:return`Clé${e.keys.length>1?`s`:``} non reconnue${e.keys.length>1?`s`:``} : ${V(e.keys,`, `)}`;case`invalid_key`:return`Clé invalide dans ${e.origin}`;case`invalid_union`:return`Entrée invalide`;case`invalid_element`:return`Valeur invalide dans ${e.origin}`;default:return`Entrée invalide`}}};function Vu(){return{localeError:Bu()}}const Hu=()=>{let e={string:{unit:`caractères`,verb:`avoir`},file:{unit:`octets`,verb:`avoir`},array:{unit:`éléments`,verb:`avoir`},set:{unit:`éléments`,verb:`avoir`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`entrée`,email:`adresse courriel`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`date-heure ISO`,date:`date ISO`,time:`heure ISO`,duration:`durée ISO`,ipv4:`adresse IPv4`,ipv6:`adresse IPv6`,cidrv4:`plage IPv4`,cidrv6:`plage IPv6`,base64:`chaîne encodée en base64`,base64url:`chaîne encodée en base64url`,json_string:`chaîne JSON`,e164:`numéro E.164`,jwt:`JWT`,template_literal:`entrée`};return e=>{switch(e.code){case`invalid_type`:return`Entrée invalide : attendu ${e.expected}, reçu ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Entrée invalide : attendu ${W(e.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${V(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`≤`:`<`,r=t(e.origin);return r?`Trop grand : attendu que ${e.origin??`la valeur`} ait ${n}${e.maximum.toString()} ${r.unit}`:`Trop grand : attendu que ${e.origin??`la valeur`} soit ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`≥`:`>`,r=t(e.origin);return r?`Trop petit : attendu que ${e.origin} ait ${n}${e.minimum.toString()} ${r.unit}`:`Trop petit : attendu que ${e.origin} soit ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chaîne invalide : doit commencer par "${t.prefix}"`:t.format===`ends_with`?`Chaîne invalide : doit se terminer par "${t.suffix}"`:t.format===`includes`?`Chaîne invalide : doit inclure "${t.includes}"`:t.format===`regex`?`Chaîne invalide : doit correspondre au motif ${t.pattern}`:`${r[t.format]??e.format} invalide`}case`not_multiple_of`:return`Nombre invalide : doit être un multiple de ${e.divisor}`;case`unrecognized_keys`:return`Clé${e.keys.length>1?`s`:``} non reconnue${e.keys.length>1?`s`:``} : ${V(e.keys,`, `)}`;case`invalid_key`:return`Clé invalide dans ${e.origin}`;case`invalid_union`:return`Entrée invalide`;case`invalid_element`:return`Valeur invalide dans ${e.origin}`;default:return`Entrée invalide`}}};function Uu(){return{localeError:Hu()}}const Wu=()=>{let e={string:{unit:`אותיות`,verb:`לכלול`},file:{unit:`בייטים`,verb:`לכלול`},array:{unit:`פריטים`,verb:`לכלול`},set:{unit:`פריטים`,verb:`לכלול`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`קלט`,email:`כתובת אימייל`,url:`כתובת רשת`,emoji:`אימוג'י`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`תאריך וזמן ISO`,date:`תאריך ISO`,time:`זמן ISO`,duration:`משך זמן ISO`,ipv4:`כתובת IPv4`,ipv6:`כתובת IPv6`,cidrv4:`טווח IPv4`,cidrv6:`טווח IPv6`,base64:`מחרוזת בבסיס 64`,base64url:`מחרוזת בבסיס 64 לכתובות רשת`,json_string:`מחרוזת JSON`,e164:`מספר E.164`,jwt:`JWT`,template_literal:`קלט`};return e=>{switch(e.code){case`invalid_type`:return`קלט לא תקין: צריך ${e.expected}, התקבל ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`קלט לא תקין: צריך ${W(e.values[0])}`:`קלט לא תקין: צריך אחת מהאפשרויות ${V(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`גדול מדי: ${e.origin??`value`} צריך להיות ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`גדול מדי: ${e.origin??`value`} צריך להיות ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`קטן מדי: ${e.origin} צריך להיות ${n}${e.minimum.toString()} ${r.unit}`:`קטן מדי: ${e.origin} צריך להיות ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`מחרוזת לא תקינה: חייבת להתחיל ב"${t.prefix}"`:t.format===`ends_with`?`מחרוזת לא תקינה: חייבת להסתיים ב "${t.suffix}"`:t.format===`includes`?`מחרוזת לא תקינה: חייבת לכלול "${t.includes}"`:t.format===`regex`?`מחרוזת לא תקינה: חייבת להתאים לתבנית ${t.pattern}`:`${r[t.format]??e.format} לא תקין`}case`not_multiple_of`:return`מספר לא תקין: חייב להיות מכפלה של ${e.divisor}`;case`unrecognized_keys`:return`מפתח${e.keys.length>1?`ות`:``} לא מזוה${e.keys.length>1?`ים`:`ה`}: ${V(e.keys,`, `)}`;case`invalid_key`:return`מפתח לא תקין ב${e.origin}`;case`invalid_union`:return`קלט לא תקין`;case`invalid_element`:return`ערך לא תקין ב${e.origin}`;default:return`קלט לא תקין`}}};function Gu(){return{localeError:Wu()}}const Ku=()=>{let e={string:{unit:`karakter`,verb:`legyen`},file:{unit:`byte`,verb:`legyen`},array:{unit:`elem`,verb:`legyen`},set:{unit:`elem`,verb:`legyen`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`szám`;case`object`:if(Array.isArray(e))return`tömb`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`bemenet`,email:`email cím`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO időbélyeg`,date:`ISO dátum`,time:`ISO idő`,duration:`ISO időintervallum`,ipv4:`IPv4 cím`,ipv6:`IPv6 cím`,cidrv4:`IPv4 tartomány`,cidrv6:`IPv6 tartomány`,base64:`base64-kódolt string`,base64url:`base64url-kódolt string`,json_string:`JSON string`,e164:`E.164 szám`,jwt:`JWT`,template_literal:`bemenet`};return e=>{switch(e.code){case`invalid_type`:return`Érvénytelen bemenet: a várt érték ${e.expected}, a kapott érték ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Érvénytelen bemenet: a várt érték ${W(e.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${V(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Túl nagy: ${e.origin??`érték`} mérete túl nagy ${n}${e.maximum.toString()} ${r.unit??`elem`}`:`Túl nagy: a bemeneti érték ${e.origin??`érték`} túl nagy: ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Túl kicsi: a bemeneti érték ${e.origin} mérete túl kicsi ${n}${e.minimum.toString()} ${r.unit}`:`Túl kicsi: a bemeneti érték ${e.origin} túl kicsi ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Érvénytelen string: "${t.prefix}" értékkel kell kezdődnie`:t.format===`ends_with`?`Érvénytelen string: "${t.suffix}" értékkel kell végződnie`:t.format===`includes`?`Érvénytelen string: "${t.includes}" értéket kell tartalmaznia`:t.format===`regex`?`Érvénytelen string: ${t.pattern} mintának kell megfelelnie`:`Érvénytelen ${r[t.format]??e.format}`}case`not_multiple_of`:return`Érvénytelen szám: ${e.divisor} többszörösének kell lennie`;case`unrecognized_keys`:return`Ismeretlen kulcs${e.keys.length>1?`s`:``}: ${V(e.keys,`, `)}`;case`invalid_key`:return`Érvénytelen kulcs ${e.origin}`;case`invalid_union`:return`Érvénytelen bemenet`;case`invalid_element`:return`Érvénytelen érték: ${e.origin}`;default:return`Érvénytelen bemenet`}}};function qu(){return{localeError:Ku()}}const Ju=()=>{let e={string:{unit:`karakter`,verb:`memiliki`},file:{unit:`byte`,verb:`memiliki`},array:{unit:`item`,verb:`memiliki`},set:{unit:`item`,verb:`memiliki`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`input`,email:`alamat email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`tanggal dan waktu format ISO`,date:`tanggal format ISO`,time:`jam format ISO`,duration:`durasi format ISO`,ipv4:`alamat IPv4`,ipv6:`alamat IPv6`,cidrv4:`rentang alamat IPv4`,cidrv6:`rentang alamat IPv6`,base64:`string dengan enkode base64`,base64url:`string dengan enkode base64url`,json_string:`string JSON`,e164:`angka E.164`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`Input tidak valid: diharapkan ${e.expected}, diterima ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Input tidak valid: diharapkan ${W(e.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${V(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Terlalu besar: diharapkan ${e.origin??`value`} memiliki ${n}${e.maximum.toString()} ${r.unit??`elemen`}`:`Terlalu besar: diharapkan ${e.origin??`value`} menjadi ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Terlalu kecil: diharapkan ${e.origin} memiliki ${n}${e.minimum.toString()} ${r.unit}`:`Terlalu kecil: diharapkan ${e.origin} menjadi ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`String tidak valid: harus dimulai dengan "${t.prefix}"`:t.format===`ends_with`?`String tidak valid: harus berakhir dengan "${t.suffix}"`:t.format===`includes`?`String tidak valid: harus menyertakan "${t.includes}"`:t.format===`regex`?`String tidak valid: harus sesuai pola ${t.pattern}`:`${r[t.format]??e.format} tidak valid`}case`not_multiple_of`:return`Angka tidak valid: harus kelipatan dari ${e.divisor}`;case`unrecognized_keys`:return`Kunci tidak dikenali ${e.keys.length>1?`s`:``}: ${V(e.keys,`, `)}`;case`invalid_key`:return`Kunci tidak valid di ${e.origin}`;case`invalid_union`:return`Input tidak valid`;case`invalid_element`:return`Nilai tidak valid di ${e.origin}`;default:return`Input tidak valid`}}};function Yu(){return{localeError:Ju()}}const Xu=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`númer`;case`object`:if(Array.isArray(e))return`fylki`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},Zu=()=>{let e={string:{unit:`stafi`,verb:`að hafa`},file:{unit:`bæti`,verb:`að hafa`},array:{unit:`hluti`,verb:`að hafa`},set:{unit:`hluti`,verb:`að hafa`}};function t(t){return e[t]??null}let n={regex:`gildi`,email:`netfang`,url:`vefslóð`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO dagsetning og tími`,date:`ISO dagsetning`,time:`ISO tími`,duration:`ISO tímalengd`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded strengur`,base64url:`base64url-encoded strengur`,json_string:`JSON strengur`,e164:`E.164 tölugildi`,jwt:`JWT`,template_literal:`gildi`};return e=>{switch(e.code){case`invalid_type`:return`Rangt gildi: Þú slóst inn ${Xu(e.input)} þar sem á að vera ${e.expected}`;case`invalid_value`:return e.values.length===1?`Rangt gildi: gert ráð fyrir ${W(e.values[0])}`:`Ógilt val: má vera eitt af eftirfarandi ${V(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Of stórt: gert er ráð fyrir að ${e.origin??`gildi`} hafi ${n}${e.maximum.toString()} ${r.unit??`hluti`}`:`Of stórt: gert er ráð fyrir að ${e.origin??`gildi`} sé ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Of lítið: gert er ráð fyrir að ${e.origin} hafi ${n}${e.minimum.toString()} ${r.unit}`:`Of lítið: gert er ráð fyrir að ${e.origin} sé ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ógildur strengur: verður að byrja á "${t.prefix}"`:t.format===`ends_with`?`Ógildur strengur: verður að enda á "${t.suffix}"`:t.format===`includes`?`Ógildur strengur: verður að innihalda "${t.includes}"`:t.format===`regex`?`Ógildur strengur: verður að fylgja mynstri ${t.pattern}`:`Rangt ${n[t.format]??e.format}`}case`not_multiple_of`:return`Röng tala: verður að vera margfeldi af ${e.divisor}`;case`unrecognized_keys`:return`Óþekkt ${e.keys.length>1?`ir lyklar`:`ur lykill`}: ${V(e.keys,`, `)}`;case`invalid_key`:return`Rangur lykill í ${e.origin}`;case`invalid_union`:return`Rangt gildi`;case`invalid_element`:return`Rangt gildi í ${e.origin}`;default:return`Rangt gildi`}}};function Qu(){return{localeError:Zu()}}const $u=()=>{let e={string:{unit:`caratteri`,verb:`avere`},file:{unit:`byte`,verb:`avere`},array:{unit:`elementi`,verb:`avere`},set:{unit:`elementi`,verb:`avere`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`numero`;case`object`:if(Array.isArray(e))return`vettore`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`input`,email:`indirizzo email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data e ora ISO`,date:`data ISO`,time:`ora ISO`,duration:`durata ISO`,ipv4:`indirizzo IPv4`,ipv6:`indirizzo IPv6`,cidrv4:`intervallo IPv4`,cidrv6:`intervallo IPv6`,base64:`stringa codificata in base64`,base64url:`URL codificata in base64`,json_string:`stringa JSON`,e164:`numero E.164`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`Input non valido: atteso ${e.expected}, ricevuto ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Input non valido: atteso ${W(e.values[0])}`:`Opzione non valida: atteso uno tra ${V(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Troppo grande: ${e.origin??`valore`} deve avere ${n}${e.maximum.toString()} ${r.unit??`elementi`}`:`Troppo grande: ${e.origin??`valore`} deve essere ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Troppo piccolo: ${e.origin} deve avere ${n}${e.minimum.toString()} ${r.unit}`:`Troppo piccolo: ${e.origin} deve essere ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Stringa non valida: deve iniziare con "${t.prefix}"`:t.format===`ends_with`?`Stringa non valida: deve terminare con "${t.suffix}"`:t.format===`includes`?`Stringa non valida: deve includere "${t.includes}"`:t.format===`regex`?`Stringa non valida: deve corrispondere al pattern ${t.pattern}`:`Invalid ${r[t.format]??e.format}`}case`not_multiple_of`:return`Numero non valido: deve essere un multiplo di ${e.divisor}`;case`unrecognized_keys`:return`Chiav${e.keys.length>1?`i`:`e`} non riconosciut${e.keys.length>1?`e`:`a`}: ${V(e.keys,`, `)}`;case`invalid_key`:return`Chiave non valida in ${e.origin}`;case`invalid_union`:return`Input non valido`;case`invalid_element`:return`Valore non valido in ${e.origin}`;default:return`Input non valido`}}};function ed(){return{localeError:$u()}}const td=()=>{let e={string:{unit:`文字`,verb:`である`},file:{unit:`バイト`,verb:`である`},array:{unit:`要素`,verb:`である`},set:{unit:`要素`,verb:`である`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`数値`;case`object`:if(Array.isArray(e))return`配列`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`入力値`,email:`メールアドレス`,url:`URL`,emoji:`絵文字`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO日時`,date:`ISO日付`,time:`ISO時刻`,duration:`ISO期間`,ipv4:`IPv4アドレス`,ipv6:`IPv6アドレス`,cidrv4:`IPv4範囲`,cidrv6:`IPv6範囲`,base64:`base64エンコード文字列`,base64url:`base64urlエンコード文字列`,json_string:`JSON文字列`,e164:`E.164番号`,jwt:`JWT`,template_literal:`入力値`};return e=>{switch(e.code){case`invalid_type`:return`無効な入力: ${e.expected}が期待されましたが、${n(e.input)}が入力されました`;case`invalid_value`:return e.values.length===1?`無効な入力: ${W(e.values[0])}が期待されました`:`無効な選択: ${V(e.values,`、`)}のいずれかである必要があります`;case`too_big`:{let n=e.inclusive?`以下である`:`より小さい`,r=t(e.origin);return r?`大きすぎる値: ${e.origin??`値`}は${e.maximum.toString()}${r.unit??`要素`}${n}必要があります`:`大きすぎる値: ${e.origin??`値`}は${e.maximum.toString()}${n}必要があります`}case`too_small`:{let n=e.inclusive?`以上である`:`より大きい`,r=t(e.origin);return r?`小さすぎる値: ${e.origin}は${e.minimum.toString()}${r.unit}${n}必要があります`:`小さすぎる値: ${e.origin}は${e.minimum.toString()}${n}必要があります`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`無効な文字列: "${t.prefix}"で始まる必要があります`:t.format===`ends_with`?`無効な文字列: "${t.suffix}"で終わる必要があります`:t.format===`includes`?`無効な文字列: "${t.includes}"を含む必要があります`:t.format===`regex`?`無効な文字列: パターン${t.pattern}に一致する必要があります`:`無効な${r[t.format]??e.format}`}case`not_multiple_of`:return`無効な数値: ${e.divisor}の倍数である必要があります`;case`unrecognized_keys`:return`認識されていないキー${e.keys.length>1?`群`:``}: ${V(e.keys,`、`)}`;case`invalid_key`:return`${e.origin}内の無効なキー`;case`invalid_union`:return`無効な入力`;case`invalid_element`:return`${e.origin}内の無効な値`;default:return`無効な入力`}}};function nd(){return{localeError:td()}}const rd=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`რიცხვი`;case`object`:if(Array.isArray(e))return`მასივი`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return{string:`სტრინგი`,boolean:`ბულეანი`,undefined:`undefined`,bigint:`bigint`,symbol:`symbol`,function:`ფუნქცია`}[t]??t},id=()=>{let e={string:{unit:`სიმბოლო`,verb:`უნდა შეიცავდეს`},file:{unit:`ბაიტი`,verb:`უნდა შეიცავდეს`},array:{unit:`ელემენტი`,verb:`უნდა შეიცავდეს`},set:{unit:`ელემენტი`,verb:`უნდა შეიცავდეს`}};function t(t){return e[t]??null}let n={regex:`შეყვანა`,email:`ელ-ფოსტის მისამართი`,url:`URL`,emoji:`ემოჯი`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`თარიღი-დრო`,date:`თარიღი`,time:`დრო`,duration:`ხანგრძლივობა`,ipv4:`IPv4 მისამართი`,ipv6:`IPv6 მისამართი`,cidrv4:`IPv4 დიაპაზონი`,cidrv6:`IPv6 დიაპაზონი`,base64:`base64-კოდირებული სტრინგი`,base64url:`base64url-კოდირებული სტრინგი`,json_string:`JSON სტრინგი`,e164:`E.164 ნომერი`,jwt:`JWT`,template_literal:`შეყვანა`};return e=>{switch(e.code){case`invalid_type`:return`არასწორი შეყვანა: მოსალოდნელი ${e.expected}, მიღებული ${rd(e.input)}`;case`invalid_value`:return e.values.length===1?`არასწორი შეყვანა: მოსალოდნელი ${W(e.values[0])}`:`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${V(e.values,`|`)}-დან`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ზედმეტად დიდი: მოსალოდნელი ${e.origin??`მნიშვნელობა`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit}`:`ზედმეტად დიდი: მოსალოდნელი ${e.origin??`მნიშვნელობა`} იყოს ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`ზედმეტად პატარა: მოსალოდნელი ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`ზედმეტად პატარა: მოსალოდნელი ${e.origin} იყოს ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`არასწორი სტრინგი: უნდა იწყებოდეს "${t.prefix}"-ით`:t.format===`ends_with`?`არასწორი სტრინგი: უნდა მთავრდებოდეს "${t.suffix}"-ით`:t.format===`includes`?`არასწორი სტრინგი: უნდა შეიცავდეს "${t.includes}"-ს`:t.format===`regex`?`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${t.pattern}`:`არასწორი ${n[t.format]??e.format}`}case`not_multiple_of`:return`არასწორი რიცხვი: უნდა იყოს ${e.divisor}-ის ჯერადი`;case`unrecognized_keys`:return`უცნობი გასაღებ${e.keys.length>1?`ები`:`ი`}: ${V(e.keys,`, `)}`;case`invalid_key`:return`არასწორი გასაღები ${e.origin}-ში`;case`invalid_union`:return`არასწორი შეყვანა`;case`invalid_element`:return`არასწორი მნიშვნელობა ${e.origin}-ში`;default:return`არასწორი შეყვანა`}}};function ad(){return{localeError:id()}}const od=()=>{let e={string:{unit:`តួអក្សរ`,verb:`គួរមាន`},file:{unit:`បៃ`,verb:`គួរមាន`},array:{unit:`ធាតុ`,verb:`គួរមាន`},set:{unit:`ធាតុ`,verb:`គួរមាន`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`មិនមែនជាលេខ (NaN)`:`លេខ`;case`object`:if(Array.isArray(e))return`អារេ (Array)`;if(e===null)return`គ្មានតម្លៃ (null)`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ទិន្នន័យបញ្ចូល`,email:`អាសយដ្ឋានអ៊ីមែល`,url:`URL`,emoji:`សញ្ញាអារម្មណ៍`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`កាលបរិច្ឆេទ និងម៉ោង ISO`,date:`កាលបរិច្ឆេទ ISO`,time:`ម៉ោង ISO`,duration:`រយៈពេល ISO`,ipv4:`អាសយដ្ឋាន IPv4`,ipv6:`អាសយដ្ឋាន IPv6`,cidrv4:`ដែនអាសយដ្ឋាន IPv4`,cidrv6:`ដែនអាសយដ្ឋាន IPv6`,base64:`ខ្សែអក្សរអ៊ិកូដ base64`,base64url:`ខ្សែអក្សរអ៊ិកូដ base64url`,json_string:`ខ្សែអក្សរ JSON`,e164:`លេខ E.164`,jwt:`JWT`,template_literal:`ទិន្នន័យបញ្ចូល`};return e=>{switch(e.code){case`invalid_type`:return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${e.expected} ប៉ុន្តែទទួលបាន ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${W(e.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${V(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ធំពេក៖ ត្រូវការ ${e.origin??`តម្លៃ`} ${n} ${e.maximum.toString()} ${r.unit??`ធាតុ`}`:`ធំពេក៖ ត្រូវការ ${e.origin??`តម្លៃ`} ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`តូចពេក៖ ត្រូវការ ${e.origin} ${n} ${e.minimum.toString()} ${r.unit}`:`តូចពេក៖ ត្រូវការ ${e.origin} ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${t.prefix}"`:t.format===`ends_with`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${t.suffix}"`:t.format===`includes`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${t.includes}"`:t.format===`regex`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${t.pattern}`:`មិនត្រឹមត្រូវ៖ ${r[t.format]??e.format}`}case`not_multiple_of`:return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${e.divisor}`;case`unrecognized_keys`:return`រកឃើញសោមិនស្គាល់៖ ${V(e.keys,`, `)}`;case`invalid_key`:return`សោមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`;case`invalid_union`:return`ទិន្នន័យមិនត្រឹមត្រូវ`;case`invalid_element`:return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`;default:return`ទិន្នន័យមិនត្រឹមត្រូវ`}}};function sd(){return{localeError:od()}}function cd(){return sd()}const ld=()=>{let e={string:{unit:`문자`,verb:`to have`},file:{unit:`바이트`,verb:`to have`},array:{unit:`개`,verb:`to have`},set:{unit:`개`,verb:`to have`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`입력`,email:`이메일 주소`,url:`URL`,emoji:`이모지`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO 날짜시간`,date:`ISO 날짜`,time:`ISO 시간`,duration:`ISO 기간`,ipv4:`IPv4 주소`,ipv6:`IPv6 주소`,cidrv4:`IPv4 범위`,cidrv6:`IPv6 범위`,base64:`base64 인코딩 문자열`,base64url:`base64url 인코딩 문자열`,json_string:`JSON 문자열`,e164:`E.164 번호`,jwt:`JWT`,template_literal:`입력`};return e=>{switch(e.code){case`invalid_type`:return`잘못된 입력: 예상 타입은 ${e.expected}, 받은 타입은 ${n(e.input)}입니다`;case`invalid_value`:return e.values.length===1?`잘못된 입력: 값은 ${W(e.values[0])} 이어야 합니다`:`잘못된 옵션: ${V(e.values,`또는 `)} 중 하나여야 합니다`;case`too_big`:{let n=e.inclusive?`이하`:`미만`,r=n===`미만`?`이어야 합니다`:`여야 합니다`,i=t(e.origin),a=i?.unit??`요소`;return i?`${e.origin??`값`}이 너무 큽니다: ${e.maximum.toString()}${a} ${n}${r}`:`${e.origin??`값`}이 너무 큽니다: ${e.maximum.toString()} ${n}${r}`}case`too_small`:{let n=e.inclusive?`이상`:`초과`,r=n===`이상`?`이어야 합니다`:`여야 합니다`,i=t(e.origin),a=i?.unit??`요소`;return i?`${e.origin??`값`}이 너무 작습니다: ${e.minimum.toString()}${a} ${n}${r}`:`${e.origin??`값`}이 너무 작습니다: ${e.minimum.toString()} ${n}${r}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`잘못된 문자열: "${t.prefix}"(으)로 시작해야 합니다`:t.format===`ends_with`?`잘못된 문자열: "${t.suffix}"(으)로 끝나야 합니다`:t.format===`includes`?`잘못된 문자열: "${t.includes}"을(를) 포함해야 합니다`:t.format===`regex`?`잘못된 문자열: 정규식 ${t.pattern} 패턴과 일치해야 합니다`:`잘못된 ${r[t.format]??e.format}`}case`not_multiple_of`:return`잘못된 숫자: ${e.divisor}의 배수여야 합니다`;case`unrecognized_keys`:return`인식할 수 없는 키: ${V(e.keys,`, `)}`;case`invalid_key`:return`잘못된 키: ${e.origin}`;case`invalid_union`:return`잘못된 입력`;case`invalid_element`:return`잘못된 값: ${e.origin}`;default:return`잘못된 입력`}}};function ud(){return{localeError:ld()}}const dd=e=>fd(typeof e,e),fd=(e,t=void 0)=>{switch(e){case`number`:return Number.isNaN(t)?`NaN`:`skaičius`;case`bigint`:return`sveikasis skaičius`;case`string`:return`eilutė`;case`boolean`:return`loginė reikšmė`;case`undefined`:case`void`:return`neapibrėžta reikšmė`;case`function`:return`funkcija`;case`symbol`:return`simbolis`;case`object`:return t===void 0?`nežinomas objektas`:t===null?`nulinė reikšmė`:Array.isArray(t)?`masyvas`:Object.getPrototypeOf(t)!==Object.prototype&&t.constructor?t.constructor.name:`objektas`;case`null`:return`nulinė reikšmė`}return e},pd=e=>e.charAt(0).toUpperCase()+e.slice(1);function md(e){let t=Math.abs(e),n=t%10,r=t%100;return r>=11&&r<=19||n===0?`many`:n===1?`one`:`few`}const hd=()=>{let e={string:{unit:{one:`simbolis`,few:`simboliai`,many:`simbolių`},verb:{smaller:{inclusive:`turi būti ne ilgesnė kaip`,notInclusive:`turi būti trumpesnė kaip`},bigger:{inclusive:`turi būti ne trumpesnė kaip`,notInclusive:`turi būti ilgesnė kaip`}}},file:{unit:{one:`baitas`,few:`baitai`,many:`baitų`},verb:{smaller:{inclusive:`turi būti ne didesnis kaip`,notInclusive:`turi būti mažesnis kaip`},bigger:{inclusive:`turi būti ne mažesnis kaip`,notInclusive:`turi būti didesnis kaip`}}},array:{unit:{one:`elementą`,few:`elementus`,many:`elementų`},verb:{smaller:{inclusive:`turi turėti ne daugiau kaip`,notInclusive:`turi turėti mažiau kaip`},bigger:{inclusive:`turi turėti ne mažiau kaip`,notInclusive:`turi turėti daugiau kaip`}}},set:{unit:{one:`elementą`,few:`elementus`,many:`elementų`},verb:{smaller:{inclusive:`turi turėti ne daugiau kaip`,notInclusive:`turi turėti mažiau kaip`},bigger:{inclusive:`turi turėti ne mažiau kaip`,notInclusive:`turi turėti daugiau kaip`}}}};function t(t,n,r,i){let a=e[t]??null;return a===null?a:{unit:a.unit[n],verb:a.verb[i][r?`inclusive`:`notInclusive`]}}let n={regex:`įvestis`,email:`el. pašto adresas`,url:`URL`,emoji:`jaustukas`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO data ir laikas`,date:`ISO data`,time:`ISO laikas`,duration:`ISO trukmė`,ipv4:`IPv4 adresas`,ipv6:`IPv6 adresas`,cidrv4:`IPv4 tinklo prefiksas (CIDR)`,cidrv6:`IPv6 tinklo prefiksas (CIDR)`,base64:`base64 užkoduota eilutė`,base64url:`base64url užkoduota eilutė`,json_string:`JSON eilutė`,e164:`E.164 numeris`,jwt:`JWT`,template_literal:`įvestis`};return e=>{switch(e.code){case`invalid_type`:return`Gautas tipas ${dd(e.input)}, o tikėtasi - ${fd(e.expected)}`;case`invalid_value`:return e.values.length===1?`Privalo būti ${W(e.values[0])}`:`Privalo būti vienas iš ${V(e.values,`|`)} pasirinkimų`;case`too_big`:{let n=fd(e.origin),r=t(e.origin,md(Number(e.maximum)),e.inclusive??!1,`smaller`);if(r?.verb)return`${pd(n??e.origin??`reikšmė`)} ${r.verb} ${e.maximum.toString()} ${r.unit??`elementų`}`;let i=e.inclusive?`ne didesnis kaip`:`mažesnis kaip`;return`${pd(n??e.origin??`reikšmė`)} turi būti ${i} ${e.maximum.toString()} ${r?.unit}`}case`too_small`:{let n=fd(e.origin),r=t(e.origin,md(Number(e.minimum)),e.inclusive??!1,`bigger`);if(r?.verb)return`${pd(n??e.origin??`reikšmė`)} ${r.verb} ${e.minimum.toString()} ${r.unit??`elementų`}`;let i=e.inclusive?`ne mažesnis kaip`:`didesnis kaip`;return`${pd(n??e.origin??`reikšmė`)} turi būti ${i} ${e.minimum.toString()} ${r?.unit}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Eilutė privalo prasidėti "${t.prefix}"`:t.format===`ends_with`?`Eilutė privalo pasibaigti "${t.suffix}"`:t.format===`includes`?`Eilutė privalo įtraukti "${t.includes}"`:t.format===`regex`?`Eilutė privalo atitikti ${t.pattern}`:`Neteisingas ${n[t.format]??e.format}`}case`not_multiple_of`:return`Skaičius privalo būti ${e.divisor} kartotinis.`;case`unrecognized_keys`:return`Neatpažint${e.keys.length>1?`i`:`as`} rakt${e.keys.length>1?`ai`:`as`}: ${V(e.keys,`, `)}`;case`invalid_key`:return`Rastas klaidingas raktas`;case`invalid_union`:return`Klaidinga įvestis`;case`invalid_element`:return`${pd(fd(e.origin)??e.origin??`reikšmė`)} turi klaidingą įvestį`;default:return`Klaidinga įvestis`}}};function gd(){return{localeError:hd()}}const _d=()=>{let e={string:{unit:`знаци`,verb:`да имаат`},file:{unit:`бајти`,verb:`да имаат`},array:{unit:`ставки`,verb:`да имаат`},set:{unit:`ставки`,verb:`да имаат`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`број`;case`object`:if(Array.isArray(e))return`низа`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`внес`,email:`адреса на е-пошта`,url:`URL`,emoji:`емоџи`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO датум и време`,date:`ISO датум`,time:`ISO време`,duration:`ISO времетраење`,ipv4:`IPv4 адреса`,ipv6:`IPv6 адреса`,cidrv4:`IPv4 опсег`,cidrv6:`IPv6 опсег`,base64:`base64-енкодирана низа`,base64url:`base64url-енкодирана низа`,json_string:`JSON низа`,e164:`E.164 број`,jwt:`JWT`,template_literal:`внес`};return e=>{switch(e.code){case`invalid_type`:return`Грешен внес: се очекува ${e.expected}, примено ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${W(e.values[0])}`:`Грешана опција: се очекува една ${V(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Премногу голем: се очекува ${e.origin??`вредноста`} да има ${n}${e.maximum.toString()} ${r.unit??`елементи`}`:`Премногу голем: се очекува ${e.origin??`вредноста`} да биде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Премногу мал: се очекува ${e.origin} да има ${n}${e.minimum.toString()} ${r.unit}`:`Премногу мал: се очекува ${e.origin} да биде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неважечка низа: мора да започнува со "${t.prefix}"`:t.format===`ends_with`?`Неважечка низа: мора да завршува со "${t.suffix}"`:t.format===`includes`?`Неважечка низа: мора да вклучува "${t.includes}"`:t.format===`regex`?`Неважечка низа: мора да одгоара на патернот ${t.pattern}`:`Invalid ${r[t.format]??e.format}`}case`not_multiple_of`:return`Грешен број: мора да биде делив со ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Непрепознаени клучеви`:`Непрепознаен клуч`}: ${V(e.keys,`, `)}`;case`invalid_key`:return`Грешен клуч во ${e.origin}`;case`invalid_union`:return`Грешен внес`;case`invalid_element`:return`Грешна вредност во ${e.origin}`;default:return`Грешен внес`}}};function vd(){return{localeError:_d()}}const yd=()=>{let e={string:{unit:`aksara`,verb:`mempunyai`},file:{unit:`bait`,verb:`mempunyai`},array:{unit:`elemen`,verb:`mempunyai`},set:{unit:`elemen`,verb:`mempunyai`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`nombor`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`input`,email:`alamat e-mel`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`tarikh masa ISO`,date:`tarikh ISO`,time:`masa ISO`,duration:`tempoh ISO`,ipv4:`alamat IPv4`,ipv6:`alamat IPv6`,cidrv4:`julat IPv4`,cidrv6:`julat IPv6`,base64:`string dikodkan base64`,base64url:`string dikodkan base64url`,json_string:`string JSON`,e164:`nombor E.164`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`Input tidak sah: dijangka ${e.expected}, diterima ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Input tidak sah: dijangka ${W(e.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${V(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Terlalu besar: dijangka ${e.origin??`nilai`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`elemen`}`:`Terlalu besar: dijangka ${e.origin??`nilai`} adalah ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Terlalu kecil: dijangka ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Terlalu kecil: dijangka ${e.origin} adalah ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`String tidak sah: mesti bermula dengan "${t.prefix}"`:t.format===`ends_with`?`String tidak sah: mesti berakhir dengan "${t.suffix}"`:t.format===`includes`?`String tidak sah: mesti mengandungi "${t.includes}"`:t.format===`regex`?`String tidak sah: mesti sepadan dengan corak ${t.pattern}`:`${r[t.format]??e.format} tidak sah`}case`not_multiple_of`:return`Nombor tidak sah: perlu gandaan ${e.divisor}`;case`unrecognized_keys`:return`Kunci tidak dikenali: ${V(e.keys,`, `)}`;case`invalid_key`:return`Kunci tidak sah dalam ${e.origin}`;case`invalid_union`:return`Input tidak sah`;case`invalid_element`:return`Nilai tidak sah dalam ${e.origin}`;default:return`Input tidak sah`}}};function bd(){return{localeError:yd()}}const xd=()=>{let e={string:{unit:`tekens`},file:{unit:`bytes`},array:{unit:`elementen`},set:{unit:`elementen`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`getal`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`invoer`,email:`emailadres`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datum en tijd`,date:`ISO datum`,time:`ISO tijd`,duration:`ISO duur`,ipv4:`IPv4-adres`,ipv6:`IPv6-adres`,cidrv4:`IPv4-bereik`,cidrv6:`IPv6-bereik`,base64:`base64-gecodeerde tekst`,base64url:`base64 URL-gecodeerde tekst`,json_string:`JSON string`,e164:`E.164-nummer`,jwt:`JWT`,template_literal:`invoer`};return e=>{switch(e.code){case`invalid_type`:return`Ongeldige invoer: verwacht ${e.expected}, ontving ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Ongeldige invoer: verwacht ${W(e.values[0])}`:`Ongeldige optie: verwacht één van ${V(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Te lang: verwacht dat ${e.origin??`waarde`} ${n}${e.maximum.toString()} ${r.unit??`elementen`} bevat`:`Te lang: verwacht dat ${e.origin??`waarde`} ${n}${e.maximum.toString()} is`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Te kort: verwacht dat ${e.origin} ${n}${e.minimum.toString()} ${r.unit} bevat`:`Te kort: verwacht dat ${e.origin} ${n}${e.minimum.toString()} is`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ongeldige tekst: moet met "${t.prefix}" beginnen`:t.format===`ends_with`?`Ongeldige tekst: moet op "${t.suffix}" eindigen`:t.format===`includes`?`Ongeldige tekst: moet "${t.includes}" bevatten`:t.format===`regex`?`Ongeldige tekst: moet overeenkomen met patroon ${t.pattern}`:`Ongeldig: ${r[t.format]??e.format}`}case`not_multiple_of`:return`Ongeldig getal: moet een veelvoud van ${e.divisor} zijn`;case`unrecognized_keys`:return`Onbekende key${e.keys.length>1?`s`:``}: ${V(e.keys,`, `)}`;case`invalid_key`:return`Ongeldige key in ${e.origin}`;case`invalid_union`:return`Ongeldige invoer`;case`invalid_element`:return`Ongeldige waarde in ${e.origin}`;default:return`Ongeldige invoer`}}};function Sd(){return{localeError:xd()}}const Cd=()=>{let e={string:{unit:`tegn`,verb:`å ha`},file:{unit:`bytes`,verb:`å ha`},array:{unit:`elementer`,verb:`å inneholde`},set:{unit:`elementer`,verb:`å inneholde`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`tall`;case`object`:if(Array.isArray(e))return`liste`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`input`,email:`e-postadresse`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO dato- og klokkeslett`,date:`ISO-dato`,time:`ISO-klokkeslett`,duration:`ISO-varighet`,ipv4:`IPv4-område`,ipv6:`IPv6-område`,cidrv4:`IPv4-spekter`,cidrv6:`IPv6-spekter`,base64:`base64-enkodet streng`,base64url:`base64url-enkodet streng`,json_string:`JSON-streng`,e164:`E.164-nummer`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`Ugyldig input: forventet ${e.expected}, fikk ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Ugyldig verdi: forventet ${W(e.values[0])}`:`Ugyldig valg: forventet en av ${V(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`For stor(t): forventet ${e.origin??`value`} til å ha ${n}${e.maximum.toString()} ${r.unit??`elementer`}`:`For stor(t): forventet ${e.origin??`value`} til å ha ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`For lite(n): forventet ${e.origin} til å ha ${n}${e.minimum.toString()} ${r.unit}`:`For lite(n): forventet ${e.origin} til å ha ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ugyldig streng: må starte med "${t.prefix}"`:t.format===`ends_with`?`Ugyldig streng: må ende med "${t.suffix}"`:t.format===`includes`?`Ugyldig streng: må inneholde "${t.includes}"`:t.format===`regex`?`Ugyldig streng: må matche mønsteret ${t.pattern}`:`Ugyldig ${r[t.format]??e.format}`}case`not_multiple_of`:return`Ugyldig tall: må være et multiplum av ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Ukjente nøkler`:`Ukjent nøkkel`}: ${V(e.keys,`, `)}`;case`invalid_key`:return`Ugyldig nøkkel i ${e.origin}`;case`invalid_union`:return`Ugyldig input`;case`invalid_element`:return`Ugyldig verdi i ${e.origin}`;default:return`Ugyldig input`}}};function wd(){return{localeError:Cd()}}const Td=()=>{let e={string:{unit:`harf`,verb:`olmalıdır`},file:{unit:`bayt`,verb:`olmalıdır`},array:{unit:`unsur`,verb:`olmalıdır`},set:{unit:`unsur`,verb:`olmalıdır`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`numara`;case`object`:if(Array.isArray(e))return`saf`;if(e===null)return`gayb`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`giren`,email:`epostagâh`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO hengâmı`,date:`ISO tarihi`,time:`ISO zamanı`,duration:`ISO müddeti`,ipv4:`IPv4 nişânı`,ipv6:`IPv6 nişânı`,cidrv4:`IPv4 menzili`,cidrv6:`IPv6 menzili`,base64:`base64-şifreli metin`,base64url:`base64url-şifreli metin`,json_string:`JSON metin`,e164:`E.164 sayısı`,jwt:`JWT`,template_literal:`giren`};return e=>{switch(e.code){case`invalid_type`:return`Fâsit giren: umulan ${e.expected}, alınan ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Fâsit giren: umulan ${W(e.values[0])}`:`Fâsit tercih: mûteberler ${V(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Fazla büyük: ${e.origin??`value`}, ${n}${e.maximum.toString()} ${r.unit??`elements`} sahip olmalıydı.`:`Fazla büyük: ${e.origin??`value`}, ${n}${e.maximum.toString()} olmalıydı.`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Fazla küçük: ${e.origin}, ${n}${e.minimum.toString()} ${r.unit} sahip olmalıydı.`:`Fazla küçük: ${e.origin}, ${n}${e.minimum.toString()} olmalıydı.`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Fâsit metin: "${t.prefix}" ile başlamalı.`:t.format===`ends_with`?`Fâsit metin: "${t.suffix}" ile bitmeli.`:t.format===`includes`?`Fâsit metin: "${t.includes}" ihtivâ etmeli.`:t.format===`regex`?`Fâsit metin: ${t.pattern} nakşına uymalı.`:`Fâsit ${r[t.format]??e.format}`}case`not_multiple_of`:return`Fâsit sayı: ${e.divisor} katı olmalıydı.`;case`unrecognized_keys`:return`Tanınmayan anahtar ${e.keys.length>1?`s`:``}: ${V(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} için tanınmayan anahtar var.`;case`invalid_union`:return`Giren tanınamadı.`;case`invalid_element`:return`${e.origin} için tanınmayan kıymet var.`;default:return`Kıymet tanınamadı.`}}};function Ed(){return{localeError:Td()}}const Dd=()=>{let e={string:{unit:`توکي`,verb:`ولري`},file:{unit:`بایټس`,verb:`ولري`},array:{unit:`توکي`,verb:`ولري`},set:{unit:`توکي`,verb:`ولري`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`عدد`;case`object`:if(Array.isArray(e))return`ارې`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ورودي`,email:`بریښنالیک`,url:`یو آر ال`,emoji:`ایموجي`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`نیټه او وخت`,date:`نېټه`,time:`وخت`,duration:`موده`,ipv4:`د IPv4 پته`,ipv6:`د IPv6 پته`,cidrv4:`د IPv4 ساحه`,cidrv6:`د IPv6 ساحه`,base64:`base64-encoded متن`,base64url:`base64url-encoded متن`,json_string:`JSON متن`,e164:`د E.164 شمېره`,jwt:`JWT`,template_literal:`ورودي`};return e=>{switch(e.code){case`invalid_type`:return`ناسم ورودي: باید ${e.expected} وای, مګر ${n(e.input)} ترلاسه شو`;case`invalid_value`:return e.values.length===1?`ناسم ورودي: باید ${W(e.values[0])} وای`:`ناسم انتخاب: باید یو له ${V(e.values,`|`)} څخه وای`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ډیر لوی: ${e.origin??`ارزښت`} باید ${n}${e.maximum.toString()} ${r.unit??`عنصرونه`} ولري`:`ډیر لوی: ${e.origin??`ارزښت`} باید ${n}${e.maximum.toString()} وي`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`ډیر کوچنی: ${e.origin} باید ${n}${e.minimum.toString()} ${r.unit} ولري`:`ډیر کوچنی: ${e.origin} باید ${n}${e.minimum.toString()} وي`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`ناسم متن: باید د "${t.prefix}" سره پیل شي`:t.format===`ends_with`?`ناسم متن: باید د "${t.suffix}" سره پای ته ورسيږي`:t.format===`includes`?`ناسم متن: باید "${t.includes}" ولري`:t.format===`regex`?`ناسم متن: باید د ${t.pattern} سره مطابقت ولري`:`${r[t.format]??e.format} ناسم دی`}case`not_multiple_of`:return`ناسم عدد: باید د ${e.divisor} مضرب وي`;case`unrecognized_keys`:return`ناسم ${e.keys.length>1?`کلیډونه`:`کلیډ`}: ${V(e.keys,`, `)}`;case`invalid_key`:return`ناسم کلیډ په ${e.origin} کې`;case`invalid_union`:return`ناسمه ورودي`;case`invalid_element`:return`ناسم عنصر په ${e.origin} کې`;default:return`ناسمه ورودي`}}};function Od(){return{localeError:Dd()}}const kd=()=>{let e={string:{unit:`znaków`,verb:`mieć`},file:{unit:`bajtów`,verb:`mieć`},array:{unit:`elementów`,verb:`mieć`},set:{unit:`elementów`,verb:`mieć`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`liczba`;case`object`:if(Array.isArray(e))return`tablica`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`wyrażenie`,email:`adres email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data i godzina w formacie ISO`,date:`data w formacie ISO`,time:`godzina w formacie ISO`,duration:`czas trwania ISO`,ipv4:`adres IPv4`,ipv6:`adres IPv6`,cidrv4:`zakres IPv4`,cidrv6:`zakres IPv6`,base64:`ciąg znaków zakodowany w formacie base64`,base64url:`ciąg znaków zakodowany w formacie base64url`,json_string:`ciąg znaków w formacie JSON`,e164:`liczba E.164`,jwt:`JWT`,template_literal:`wejście`};return e=>{switch(e.code){case`invalid_type`:return`Nieprawidłowe dane wejściowe: oczekiwano ${e.expected}, otrzymano ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${W(e.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${V(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Za duża wartość: oczekiwano, że ${e.origin??`wartość`} będzie mieć ${n}${e.maximum.toString()} ${r.unit??`elementów`}`:`Zbyt duż(y/a/e): oczekiwano, że ${e.origin??`wartość`} będzie wynosić ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Za mała wartość: oczekiwano, że ${e.origin??`wartość`} będzie mieć ${n}${e.minimum.toString()} ${r.unit??`elementów`}`:`Zbyt mał(y/a/e): oczekiwano, że ${e.origin??`wartość`} będzie wynosić ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Nieprawidłowy ciąg znaków: musi zaczynać się od "${t.prefix}"`:t.format===`ends_with`?`Nieprawidłowy ciąg znaków: musi kończyć się na "${t.suffix}"`:t.format===`includes`?`Nieprawidłowy ciąg znaków: musi zawierać "${t.includes}"`:t.format===`regex`?`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${t.pattern}`:`Nieprawidłow(y/a/e) ${r[t.format]??e.format}`}case`not_multiple_of`:return`Nieprawidłowa liczba: musi być wielokrotnością ${e.divisor}`;case`unrecognized_keys`:return`Nierozpoznane klucze${e.keys.length>1?`s`:``}: ${V(e.keys,`, `)}`;case`invalid_key`:return`Nieprawidłowy klucz w ${e.origin}`;case`invalid_union`:return`Nieprawidłowe dane wejściowe`;case`invalid_element`:return`Nieprawidłowa wartość w ${e.origin}`;default:return`Nieprawidłowe dane wejściowe`}}};function Ad(){return{localeError:kd()}}const jd=()=>{let e={string:{unit:`caracteres`,verb:`ter`},file:{unit:`bytes`,verb:`ter`},array:{unit:`itens`,verb:`ter`},set:{unit:`itens`,verb:`ter`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`número`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`nulo`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`padrão`,email:`endereço de e-mail`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data e hora ISO`,date:`data ISO`,time:`hora ISO`,duration:`duração ISO`,ipv4:`endereço IPv4`,ipv6:`endereço IPv6`,cidrv4:`faixa de IPv4`,cidrv6:`faixa de IPv6`,base64:`texto codificado em base64`,base64url:`URL codificada em base64`,json_string:`texto JSON`,e164:`número E.164`,jwt:`JWT`,template_literal:`entrada`};return e=>{switch(e.code){case`invalid_type`:return`Tipo inválido: esperado ${e.expected}, recebido ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Entrada inválida: esperado ${W(e.values[0])}`:`Opção inválida: esperada uma das ${V(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Muito grande: esperado que ${e.origin??`valor`} tivesse ${n}${e.maximum.toString()} ${r.unit??`elementos`}`:`Muito grande: esperado que ${e.origin??`valor`} fosse ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Muito pequeno: esperado que ${e.origin} tivesse ${n}${e.minimum.toString()} ${r.unit}`:`Muito pequeno: esperado que ${e.origin} fosse ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Texto inválido: deve começar com "${t.prefix}"`:t.format===`ends_with`?`Texto inválido: deve terminar com "${t.suffix}"`:t.format===`includes`?`Texto inválido: deve incluir "${t.includes}"`:t.format===`regex`?`Texto inválido: deve corresponder ao padrão ${t.pattern}`:`${r[t.format]??e.format} inválido`}case`not_multiple_of`:return`Número inválido: deve ser múltiplo de ${e.divisor}`;case`unrecognized_keys`:return`Chave${e.keys.length>1?`s`:``} desconhecida${e.keys.length>1?`s`:``}: ${V(e.keys,`, `)}`;case`invalid_key`:return`Chave inválida em ${e.origin}`;case`invalid_union`:return`Entrada inválida`;case`invalid_element`:return`Valor inválido em ${e.origin}`;default:return`Campo inválido`}}};function Md(){return{localeError:jd()}}function Nd(e,t,n,r){let i=Math.abs(e),a=i%10,o=i%100;return o>=11&&o<=19?r:a===1?t:a>=2&&a<=4?n:r}const Pd=()=>{let e={string:{unit:{one:`символ`,few:`символа`,many:`символов`},verb:`иметь`},file:{unit:{one:`байт`,few:`байта`,many:`байт`},verb:`иметь`},array:{unit:{one:`элемент`,few:`элемента`,many:`элементов`},verb:`иметь`},set:{unit:{one:`элемент`,few:`элемента`,many:`элементов`},verb:`иметь`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`число`;case`object`:if(Array.isArray(e))return`массив`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ввод`,email:`email адрес`,url:`URL`,emoji:`эмодзи`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO дата и время`,date:`ISO дата`,time:`ISO время`,duration:`ISO длительность`,ipv4:`IPv4 адрес`,ipv6:`IPv6 адрес`,cidrv4:`IPv4 диапазон`,cidrv6:`IPv6 диапазон`,base64:`строка в формате base64`,base64url:`строка в формате base64url`,json_string:`JSON строка`,e164:`номер E.164`,jwt:`JWT`,template_literal:`ввод`};return e=>{switch(e.code){case`invalid_type`:return`Неверный ввод: ожидалось ${e.expected}, получено ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Неверный ввод: ожидалось ${W(e.values[0])}`:`Неверный вариант: ожидалось одно из ${V(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=Nd(Number(e.maximum),r.unit.one,r.unit.few,r.unit.many);return`Слишком большое значение: ожидалось, что ${e.origin??`значение`} будет иметь ${n}${e.maximum.toString()} ${t}`}return`Слишком большое значение: ожидалось, что ${e.origin??`значение`} будет ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=Nd(Number(e.minimum),r.unit.one,r.unit.few,r.unit.many);return`Слишком маленькое значение: ожидалось, что ${e.origin} будет иметь ${n}${e.minimum.toString()} ${t}`}return`Слишком маленькое значение: ожидалось, что ${e.origin} будет ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неверная строка: должна начинаться с "${t.prefix}"`:t.format===`ends_with`?`Неверная строка: должна заканчиваться на "${t.suffix}"`:t.format===`includes`?`Неверная строка: должна содержать "${t.includes}"`:t.format===`regex`?`Неверная строка: должна соответствовать шаблону ${t.pattern}`:`Неверный ${r[t.format]??e.format}`}case`not_multiple_of`:return`Неверное число: должно быть кратным ${e.divisor}`;case`unrecognized_keys`:return`Нераспознанн${e.keys.length>1?`ые`:`ый`} ключ${e.keys.length>1?`и`:``}: ${V(e.keys,`, `)}`;case`invalid_key`:return`Неверный ключ в ${e.origin}`;case`invalid_union`:return`Неверные входные данные`;case`invalid_element`:return`Неверное значение в ${e.origin}`;default:return`Неверные входные данные`}}};function Fd(){return{localeError:Pd()}}const Id=()=>{let e={string:{unit:`znakov`,verb:`imeti`},file:{unit:`bajtov`,verb:`imeti`},array:{unit:`elementov`,verb:`imeti`},set:{unit:`elementov`,verb:`imeti`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`število`;case`object`:if(Array.isArray(e))return`tabela`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`vnos`,email:`e-poštni naslov`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datum in čas`,date:`ISO datum`,time:`ISO čas`,duration:`ISO trajanje`,ipv4:`IPv4 naslov`,ipv6:`IPv6 naslov`,cidrv4:`obseg IPv4`,cidrv6:`obseg IPv6`,base64:`base64 kodiran niz`,base64url:`base64url kodiran niz`,json_string:`JSON niz`,e164:`E.164 številka`,jwt:`JWT`,template_literal:`vnos`};return e=>{switch(e.code){case`invalid_type`:return`Neveljaven vnos: pričakovano ${e.expected}, prejeto ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Neveljaven vnos: pričakovano ${W(e.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${V(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Preveliko: pričakovano, da bo ${e.origin??`vrednost`} imelo ${n}${e.maximum.toString()} ${r.unit??`elementov`}`:`Preveliko: pričakovano, da bo ${e.origin??`vrednost`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Premajhno: pričakovano, da bo ${e.origin} imelo ${n}${e.minimum.toString()} ${r.unit}`:`Premajhno: pričakovano, da bo ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neveljaven niz: mora se začeti z "${t.prefix}"`:t.format===`ends_with`?`Neveljaven niz: mora se končati z "${t.suffix}"`:t.format===`includes`?`Neveljaven niz: mora vsebovati "${t.includes}"`:t.format===`regex`?`Neveljaven niz: mora ustrezati vzorcu ${t.pattern}`:`Neveljaven ${r[t.format]??e.format}`}case`not_multiple_of`:return`Neveljavno število: mora biti večkratnik ${e.divisor}`;case`unrecognized_keys`:return`Neprepoznan${e.keys.length>1?`i ključi`:` ključ`}: ${V(e.keys,`, `)}`;case`invalid_key`:return`Neveljaven ključ v ${e.origin}`;case`invalid_union`:return`Neveljaven vnos`;case`invalid_element`:return`Neveljavna vrednost v ${e.origin}`;default:return`Neveljaven vnos`}}};function Ld(){return{localeError:Id()}}const Rd=()=>{let e={string:{unit:`tecken`,verb:`att ha`},file:{unit:`bytes`,verb:`att ha`},array:{unit:`objekt`,verb:`att innehålla`},set:{unit:`objekt`,verb:`att innehålla`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`antal`;case`object`:if(Array.isArray(e))return`lista`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`reguljärt uttryck`,email:`e-postadress`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-datum och tid`,date:`ISO-datum`,time:`ISO-tid`,duration:`ISO-varaktighet`,ipv4:`IPv4-intervall`,ipv6:`IPv6-intervall`,cidrv4:`IPv4-spektrum`,cidrv6:`IPv6-spektrum`,base64:`base64-kodad sträng`,base64url:`base64url-kodad sträng`,json_string:`JSON-sträng`,e164:`E.164-nummer`,jwt:`JWT`,template_literal:`mall-literal`};return e=>{switch(e.code){case`invalid_type`:return`Ogiltig inmatning: förväntat ${e.expected}, fick ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Ogiltig inmatning: förväntat ${W(e.values[0])}`:`Ogiltigt val: förväntade en av ${V(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`För stor(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.maximum.toString()} ${r.unit??`element`}`:`För stor(t): förväntat ${e.origin??`värdet`} att ha ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`För lite(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.minimum.toString()} ${r.unit}`:`För lite(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ogiltig sträng: måste börja med "${t.prefix}"`:t.format===`ends_with`?`Ogiltig sträng: måste sluta med "${t.suffix}"`:t.format===`includes`?`Ogiltig sträng: måste innehålla "${t.includes}"`:t.format===`regex`?`Ogiltig sträng: måste matcha mönstret "${t.pattern}"`:`Ogiltig(t) ${r[t.format]??e.format}`}case`not_multiple_of`:return`Ogiltigt tal: måste vara en multipel av ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Okända nycklar`:`Okänd nyckel`}: ${V(e.keys,`, `)}`;case`invalid_key`:return`Ogiltig nyckel i ${e.origin??`värdet`}`;case`invalid_union`:return`Ogiltig input`;case`invalid_element`:return`Ogiltigt värde i ${e.origin??`värdet`}`;default:return`Ogiltig input`}}};function zd(){return{localeError:Rd()}}const Bd=()=>{let e={string:{unit:`எழுத்துக்கள்`,verb:`கொண்டிருக்க வேண்டும்`},file:{unit:`பைட்டுகள்`,verb:`கொண்டிருக்க வேண்டும்`},array:{unit:`உறுப்புகள்`,verb:`கொண்டிருக்க வேண்டும்`},set:{unit:`உறுப்புகள்`,verb:`கொண்டிருக்க வேண்டும்`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`எண் அல்லாதது`:`எண்`;case`object`:if(Array.isArray(e))return`அணி`;if(e===null)return`வெறுமை`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`உள்ளீடு`,email:`மின்னஞ்சல் முகவரி`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO தேதி நேரம்`,date:`ISO தேதி`,time:`ISO நேரம்`,duration:`ISO கால அளவு`,ipv4:`IPv4 முகவரி`,ipv6:`IPv6 முகவரி`,cidrv4:`IPv4 வரம்பு`,cidrv6:`IPv6 வரம்பு`,base64:`base64-encoded சரம்`,base64url:`base64url-encoded சரம்`,json_string:`JSON சரம்`,e164:`E.164 எண்`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${e.expected}, பெறப்பட்டது ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${W(e.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${V(e.values,`|`)} இல் ஒன்று`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${e.origin??`மதிப்பு`} ${n}${e.maximum.toString()} ${r.unit??`உறுப்புகள்`} ஆக இருக்க வேண்டும்`:`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${e.origin??`மதிப்பு`} ${n}${e.maximum.toString()} ஆக இருக்க வேண்டும்`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ஆக இருக்க வேண்டும்`:`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${e.origin} ${n}${e.minimum.toString()} ஆக இருக்க வேண்டும்`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`தவறான சரம்: "${t.prefix}" இல் தொடங்க வேண்டும்`:t.format===`ends_with`?`தவறான சரம்: "${t.suffix}" இல் முடிவடைய வேண்டும்`:t.format===`includes`?`தவறான சரம்: "${t.includes}" ஐ உள்ளடக்க வேண்டும்`:t.format===`regex`?`தவறான சரம்: ${t.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${r[t.format]??e.format}`}case`not_multiple_of`:return`தவறான எண்: ${e.divisor} இன் பலமாக இருக்க வேண்டும்`;case`unrecognized_keys`:return`அடையாளம் தெரியாத விசை${e.keys.length>1?`கள்`:``}: ${V(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} இல் தவறான விசை`;case`invalid_union`:return`தவறான உள்ளீடு`;case`invalid_element`:return`${e.origin} இல் தவறான மதிப்பு`;default:return`தவறான உள்ளீடு`}}};function Vd(){return{localeError:Bd()}}const Hd=()=>{let e={string:{unit:`ตัวอักษร`,verb:`ควรมี`},file:{unit:`ไบต์`,verb:`ควรมี`},array:{unit:`รายการ`,verb:`ควรมี`},set:{unit:`รายการ`,verb:`ควรมี`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`ไม่ใช่ตัวเลข (NaN)`:`ตัวเลข`;case`object`:if(Array.isArray(e))return`อาร์เรย์ (Array)`;if(e===null)return`ไม่มีค่า (null)`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ข้อมูลที่ป้อน`,email:`ที่อยู่อีเมล`,url:`URL`,emoji:`อิโมจิ`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`วันที่เวลาแบบ ISO`,date:`วันที่แบบ ISO`,time:`เวลาแบบ ISO`,duration:`ช่วงเวลาแบบ ISO`,ipv4:`ที่อยู่ IPv4`,ipv6:`ที่อยู่ IPv6`,cidrv4:`ช่วง IP แบบ IPv4`,cidrv6:`ช่วง IP แบบ IPv6`,base64:`ข้อความแบบ Base64`,base64url:`ข้อความแบบ Base64 สำหรับ URL`,json_string:`ข้อความแบบ JSON`,e164:`เบอร์โทรศัพท์ระหว่างประเทศ (E.164)`,jwt:`โทเคน JWT`,template_literal:`ข้อมูลที่ป้อน`};return e=>{switch(e.code){case`invalid_type`:return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${e.expected} แต่ได้รับ ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${W(e.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${V(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`ไม่เกิน`:`น้อยกว่า`,r=t(e.origin);return r?`เกินกำหนด: ${e.origin??`ค่า`} ควรมี${n} ${e.maximum.toString()} ${r.unit??`รายการ`}`:`เกินกำหนด: ${e.origin??`ค่า`} ควรมี${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`อย่างน้อย`:`มากกว่า`,r=t(e.origin);return r?`น้อยกว่ากำหนด: ${e.origin} ควรมี${n} ${e.minimum.toString()} ${r.unit}`:`น้อยกว่ากำหนด: ${e.origin} ควรมี${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${t.prefix}"`:t.format===`ends_with`?`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${t.suffix}"`:t.format===`includes`?`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${t.includes}" อยู่ในข้อความ`:t.format===`regex`?`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${t.pattern}`:`รูปแบบไม่ถูกต้อง: ${r[t.format]??e.format}`}case`not_multiple_of`:return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${e.divisor} ได้ลงตัว`;case`unrecognized_keys`:return`พบคีย์ที่ไม่รู้จัก: ${V(e.keys,`, `)}`;case`invalid_key`:return`คีย์ไม่ถูกต้องใน ${e.origin}`;case`invalid_union`:return`ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้`;case`invalid_element`:return`ข้อมูลไม่ถูกต้องใน ${e.origin}`;default:return`ข้อมูลไม่ถูกต้อง`}}};function Ud(){return{localeError:Hd()}}const Wd=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},Gd=()=>{let e={string:{unit:`karakter`,verb:`olmalı`},file:{unit:`bayt`,verb:`olmalı`},array:{unit:`öğe`,verb:`olmalı`},set:{unit:`öğe`,verb:`olmalı`}};function t(t){return e[t]??null}let n={regex:`girdi`,email:`e-posta adresi`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO tarih ve saat`,date:`ISO tarih`,time:`ISO saat`,duration:`ISO süre`,ipv4:`IPv4 adresi`,ipv6:`IPv6 adresi`,cidrv4:`IPv4 aralığı`,cidrv6:`IPv6 aralığı`,base64:`base64 ile şifrelenmiş metin`,base64url:`base64url ile şifrelenmiş metin`,json_string:`JSON dizesi`,e164:`E.164 sayısı`,jwt:`JWT`,template_literal:`Şablon dizesi`};return e=>{switch(e.code){case`invalid_type`:return`Geçersiz değer: beklenen ${e.expected}, alınan ${Wd(e.input)}`;case`invalid_value`:return e.values.length===1?`Geçersiz değer: beklenen ${W(e.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${V(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Çok büyük: beklenen ${e.origin??`değer`} ${n}${e.maximum.toString()} ${r.unit??`öğe`}`:`Çok büyük: beklenen ${e.origin??`değer`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Çok küçük: beklenen ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`Çok küçük: beklenen ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Geçersiz metin: "${t.prefix}" ile başlamalı`:t.format===`ends_with`?`Geçersiz metin: "${t.suffix}" ile bitmeli`:t.format===`includes`?`Geçersiz metin: "${t.includes}" içermeli`:t.format===`regex`?`Geçersiz metin: ${t.pattern} desenine uymalı`:`Geçersiz ${n[t.format]??e.format}`}case`not_multiple_of`:return`Geçersiz sayı: ${e.divisor} ile tam bölünebilmeli`;case`unrecognized_keys`:return`Tanınmayan anahtar${e.keys.length>1?`lar`:``}: ${V(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} içinde geçersiz anahtar`;case`invalid_union`:return`Geçersiz değer`;case`invalid_element`:return`${e.origin} içinde geçersiz değer`;default:return`Geçersiz değer`}}};function Kd(){return{localeError:Gd()}}const qd=()=>{let e={string:{unit:`символів`,verb:`матиме`},file:{unit:`байтів`,verb:`матиме`},array:{unit:`елементів`,verb:`матиме`},set:{unit:`елементів`,verb:`матиме`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`число`;case`object`:if(Array.isArray(e))return`масив`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`вхідні дані`,email:`адреса електронної пошти`,url:`URL`,emoji:`емодзі`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`дата та час ISO`,date:`дата ISO`,time:`час ISO`,duration:`тривалість ISO`,ipv4:`адреса IPv4`,ipv6:`адреса IPv6`,cidrv4:`діапазон IPv4`,cidrv6:`діапазон IPv6`,base64:`рядок у кодуванні base64`,base64url:`рядок у кодуванні base64url`,json_string:`рядок JSON`,e164:`номер E.164`,jwt:`JWT`,template_literal:`вхідні дані`};return e=>{switch(e.code){case`invalid_type`:return`Неправильні вхідні дані: очікується ${e.expected}, отримано ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Неправильні вхідні дані: очікується ${W(e.values[0])}`:`Неправильна опція: очікується одне з ${V(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Занадто велике: очікується, що ${e.origin??`значення`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`елементів`}`:`Занадто велике: очікується, що ${e.origin??`значення`} буде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Занадто мале: очікується, що ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Занадто мале: очікується, що ${e.origin} буде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неправильний рядок: повинен починатися з "${t.prefix}"`:t.format===`ends_with`?`Неправильний рядок: повинен закінчуватися на "${t.suffix}"`:t.format===`includes`?`Неправильний рядок: повинен містити "${t.includes}"`:t.format===`regex`?`Неправильний рядок: повинен відповідати шаблону ${t.pattern}`:`Неправильний ${r[t.format]??e.format}`}case`not_multiple_of`:return`Неправильне число: повинно бути кратним ${e.divisor}`;case`unrecognized_keys`:return`Нерозпізнаний ключ${e.keys.length>1?`і`:``}: ${V(e.keys,`, `)}`;case`invalid_key`:return`Неправильний ключ у ${e.origin}`;case`invalid_union`:return`Неправильні вхідні дані`;case`invalid_element`:return`Неправильне значення у ${e.origin}`;default:return`Неправильні вхідні дані`}}};function Jd(){return{localeError:qd()}}function Yd(){return Jd()}const Xd=()=>{let e={string:{unit:`حروف`,verb:`ہونا`},file:{unit:`بائٹس`,verb:`ہونا`},array:{unit:`آئٹمز`,verb:`ہونا`},set:{unit:`آئٹمز`,verb:`ہونا`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`نمبر`;case`object`:if(Array.isArray(e))return`آرے`;if(e===null)return`نل`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ان پٹ`,email:`ای میل ایڈریس`,url:`یو آر ایل`,emoji:`ایموجی`,uuid:`یو یو آئی ڈی`,uuidv4:`یو یو آئی ڈی وی 4`,uuidv6:`یو یو آئی ڈی وی 6`,nanoid:`نینو آئی ڈی`,guid:`جی یو آئی ڈی`,cuid:`سی یو آئی ڈی`,cuid2:`سی یو آئی ڈی 2`,ulid:`یو ایل آئی ڈی`,xid:`ایکس آئی ڈی`,ksuid:`کے ایس یو آئی ڈی`,datetime:`آئی ایس او ڈیٹ ٹائم`,date:`آئی ایس او تاریخ`,time:`آئی ایس او وقت`,duration:`آئی ایس او مدت`,ipv4:`آئی پی وی 4 ایڈریس`,ipv6:`آئی پی وی 6 ایڈریس`,cidrv4:`آئی پی وی 4 رینج`,cidrv6:`آئی پی وی 6 رینج`,base64:`بیس 64 ان کوڈڈ سٹرنگ`,base64url:`بیس 64 یو آر ایل ان کوڈڈ سٹرنگ`,json_string:`جے ایس او این سٹرنگ`,e164:`ای 164 نمبر`,jwt:`جے ڈبلیو ٹی`,template_literal:`ان پٹ`};return e=>{switch(e.code){case`invalid_type`:return`غلط ان پٹ: ${e.expected} متوقع تھا، ${n(e.input)} موصول ہوا`;case`invalid_value`:return e.values.length===1?`غلط ان پٹ: ${W(e.values[0])} متوقع تھا`:`غلط آپشن: ${V(e.values,`|`)} میں سے ایک متوقع تھا`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`بہت بڑا: ${e.origin??`ویلیو`} کے ${n}${e.maximum.toString()} ${r.unit??`عناصر`} ہونے متوقع تھے`:`بہت بڑا: ${e.origin??`ویلیو`} کا ${n}${e.maximum.toString()} ہونا متوقع تھا`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`بہت چھوٹا: ${e.origin} کے ${n}${e.minimum.toString()} ${r.unit} ہونے متوقع تھے`:`بہت چھوٹا: ${e.origin} کا ${n}${e.minimum.toString()} ہونا متوقع تھا`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`غلط سٹرنگ: "${t.prefix}" سے شروع ہونا چاہیے`:t.format===`ends_with`?`غلط سٹرنگ: "${t.suffix}" پر ختم ہونا چاہیے`:t.format===`includes`?`غلط سٹرنگ: "${t.includes}" شامل ہونا چاہیے`:t.format===`regex`?`غلط سٹرنگ: پیٹرن ${t.pattern} سے میچ ہونا چاہیے`:`غلط ${r[t.format]??e.format}`}case`not_multiple_of`:return`غلط نمبر: ${e.divisor} کا مضاعف ہونا چاہیے`;case`unrecognized_keys`:return`غیر تسلیم شدہ کی${e.keys.length>1?`ز`:``}: ${V(e.keys,`، `)}`;case`invalid_key`:return`${e.origin} میں غلط کی`;case`invalid_union`:return`غلط ان پٹ`;case`invalid_element`:return`${e.origin} میں غلط ویلیو`;default:return`غلط ان پٹ`}}};function Zd(){return{localeError:Xd()}}const Qd=()=>{let e={string:{unit:`ký tự`,verb:`có`},file:{unit:`byte`,verb:`có`},array:{unit:`phần tử`,verb:`có`},set:{unit:`phần tử`,verb:`có`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`số`;case`object`:if(Array.isArray(e))return`mảng`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`đầu vào`,email:`địa chỉ email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ngày giờ ISO`,date:`ngày ISO`,time:`giờ ISO`,duration:`khoảng thời gian ISO`,ipv4:`địa chỉ IPv4`,ipv6:`địa chỉ IPv6`,cidrv4:`dải IPv4`,cidrv6:`dải IPv6`,base64:`chuỗi mã hóa base64`,base64url:`chuỗi mã hóa base64url`,json_string:`chuỗi JSON`,e164:`số E.164`,jwt:`JWT`,template_literal:`đầu vào`};return e=>{switch(e.code){case`invalid_type`:return`Đầu vào không hợp lệ: mong đợi ${e.expected}, nhận được ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Đầu vào không hợp lệ: mong đợi ${W(e.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${V(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Quá lớn: mong đợi ${e.origin??`giá trị`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`phần tử`}`:`Quá lớn: mong đợi ${e.origin??`giá trị`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Quá nhỏ: mong đợi ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Quá nhỏ: mong đợi ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chuỗi không hợp lệ: phải bắt đầu bằng "${t.prefix}"`:t.format===`ends_with`?`Chuỗi không hợp lệ: phải kết thúc bằng "${t.suffix}"`:t.format===`includes`?`Chuỗi không hợp lệ: phải bao gồm "${t.includes}"`:t.format===`regex`?`Chuỗi không hợp lệ: phải khớp với mẫu ${t.pattern}`:`${r[t.format]??e.format} không hợp lệ`}case`not_multiple_of`:return`Số không hợp lệ: phải là bội số của ${e.divisor}`;case`unrecognized_keys`:return`Khóa không được nhận dạng: ${V(e.keys,`, `)}`;case`invalid_key`:return`Khóa không hợp lệ trong ${e.origin}`;case`invalid_union`:return`Đầu vào không hợp lệ`;case`invalid_element`:return`Giá trị không hợp lệ trong ${e.origin}`;default:return`Đầu vào không hợp lệ`}}};function $d(){return{localeError:Qd()}}const ef=()=>{let e={string:{unit:`字符`,verb:`包含`},file:{unit:`字节`,verb:`包含`},array:{unit:`项`,verb:`包含`},set:{unit:`项`,verb:`包含`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`非数字(NaN)`:`数字`;case`object`:if(Array.isArray(e))return`数组`;if(e===null)return`空值(null)`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`输入`,email:`电子邮件`,url:`URL`,emoji:`表情符号`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO日期时间`,date:`ISO日期`,time:`ISO时间`,duration:`ISO时长`,ipv4:`IPv4地址`,ipv6:`IPv6地址`,cidrv4:`IPv4网段`,cidrv6:`IPv6网段`,base64:`base64编码字符串`,base64url:`base64url编码字符串`,json_string:`JSON字符串`,e164:`E.164号码`,jwt:`JWT`,template_literal:`输入`};return e=>{switch(e.code){case`invalid_type`:return`无效输入:期望 ${e.expected},实际接收 ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`无效输入:期望 ${W(e.values[0])}`:`无效选项:期望以下之一 ${V(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`数值过大:期望 ${e.origin??`值`} ${n}${e.maximum.toString()} ${r.unit??`个元素`}`:`数值过大:期望 ${e.origin??`值`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`数值过小:期望 ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`数值过小:期望 ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`无效字符串:必须以 "${t.prefix}" 开头`:t.format===`ends_with`?`无效字符串:必须以 "${t.suffix}" 结尾`:t.format===`includes`?`无效字符串:必须包含 "${t.includes}"`:t.format===`regex`?`无效字符串:必须满足正则表达式 ${t.pattern}`:`无效${r[t.format]??e.format}`}case`not_multiple_of`:return`无效数字:必须是 ${e.divisor} 的倍数`;case`unrecognized_keys`:return`出现未知的键(key): ${V(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} 中的键(key)无效`;case`invalid_union`:return`无效输入`;case`invalid_element`:return`${e.origin} 中包含无效值(value)`;default:return`无效输入`}}};function tf(){return{localeError:ef()}}const nf=()=>{let e={string:{unit:`字元`,verb:`擁有`},file:{unit:`位元組`,verb:`擁有`},array:{unit:`項目`,verb:`擁有`},set:{unit:`項目`,verb:`擁有`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`輸入`,email:`郵件地址`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO 日期時間`,date:`ISO 日期`,time:`ISO 時間`,duration:`ISO 期間`,ipv4:`IPv4 位址`,ipv6:`IPv6 位址`,cidrv4:`IPv4 範圍`,cidrv6:`IPv6 範圍`,base64:`base64 編碼字串`,base64url:`base64url 編碼字串`,json_string:`JSON 字串`,e164:`E.164 數值`,jwt:`JWT`,template_literal:`輸入`};return e=>{switch(e.code){case`invalid_type`:return`無效的輸入值:預期為 ${e.expected},但收到 ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`無效的輸入值:預期為 ${W(e.values[0])}`:`無效的選項:預期為以下其中之一 ${V(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`數值過大:預期 ${e.origin??`值`} 應為 ${n}${e.maximum.toString()} ${r.unit??`個元素`}`:`數值過大:預期 ${e.origin??`值`} 應為 ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`數值過小:預期 ${e.origin} 應為 ${n}${e.minimum.toString()} ${r.unit}`:`數值過小:預期 ${e.origin} 應為 ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`無效的字串:必須以 "${t.prefix}" 開頭`:t.format===`ends_with`?`無效的字串:必須以 "${t.suffix}" 結尾`:t.format===`includes`?`無效的字串:必須包含 "${t.includes}"`:t.format===`regex`?`無效的字串:必須符合格式 ${t.pattern}`:`無效的 ${r[t.format]??e.format}`}case`not_multiple_of`:return`無效的數字:必須為 ${e.divisor} 的倍數`;case`unrecognized_keys`:return`無法識別的鍵值${e.keys.length>1?`們`:``}:${V(e.keys,`、`)}`;case`invalid_key`:return`${e.origin} 中有無效的鍵值`;case`invalid_union`:return`無效的輸入值`;case`invalid_element`:return`${e.origin} 中有無效的值`;default:return`無效的輸入值`}}};function rf(){return{localeError:nf()}}const af=()=>{let e={string:{unit:`àmi`,verb:`ní`},file:{unit:`bytes`,verb:`ní`},array:{unit:`nkan`,verb:`ní`},set:{unit:`nkan`,verb:`ní`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`nọ́mbà`;case`object`:if(Array.isArray(e))return`akopọ`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ẹ̀rọ ìbáwọlé`,email:`àdírẹ́sì ìmẹ́lì`,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:`àkókò ISO`,date:`ọjọ́ ISO`,time:`àkókò ISO`,duration:`àkókò tó pé ISO`,ipv4:`àdírẹ́sì IPv4`,ipv6:`àdírẹ́sì IPv6`,cidrv4:`àgbègbè IPv4`,cidrv6:`àgbègbè IPv6`,base64:`ọ̀rọ̀ tí a kọ́ ní base64`,base64url:`ọ̀rọ̀ base64url`,json_string:`ọ̀rọ̀ JSON`,e164:`nọ́mbà E.164`,jwt:`JWT`,template_literal:`ẹ̀rọ ìbáwọlé`};return e=>{switch(e.code){case`invalid_type`:return`Ìbáwọlé aṣìṣe: a ní láti fi ${e.expected}, àmọ̀ a rí ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Ìbáwọlé aṣìṣe: a ní láti fi ${W(e.values[0])}`:`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${V(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Tó pọ̀ jù: a ní láti jẹ́ pé ${e.origin??`iye`} ${r.verb} ${n}${e.maximum} ${r.unit}`:`Tó pọ̀ jù: a ní láti jẹ́ ${n}${e.maximum}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Kéré ju: a ní láti jẹ́ pé ${e.origin} ${r.verb} ${n}${e.minimum} ${r.unit}`:`Kéré ju: a ní láti jẹ́ ${n}${e.minimum}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${t.prefix}"`:t.format===`ends_with`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${t.suffix}"`:t.format===`includes`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${t.includes}"`:t.format===`regex`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${t.pattern}`:`Aṣìṣe: ${r[t.format]??e.format}`}case`not_multiple_of`:return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${e.divisor}`;case`unrecognized_keys`:return`Bọtìnì àìmọ̀: ${V(e.keys,`, `)}`;case`invalid_key`:return`Bọtìnì aṣìṣe nínú ${e.origin}`;case`invalid_union`:return`Ìbáwọlé aṣìṣe`;case`invalid_element`:return`Iye aṣìṣe nínú ${e.origin}`;default:return`Ìbáwọlé aṣìṣe`}}};function of(){return{localeError:af()}}var sf=e({ar:()=>du,az:()=>pu,be:()=>gu,bg:()=>yu,ca:()=>xu,cs:()=>Cu,da:()=>Tu,de:()=>Du,en:()=>Au,eo:()=>Nu,es:()=>Fu,fa:()=>Lu,fi:()=>zu,fr:()=>Vu,frCA:()=>Uu,he:()=>Gu,hu:()=>qu,id:()=>Yu,is:()=>Qu,it:()=>ed,ja:()=>nd,ka:()=>ad,kh:()=>cd,km:()=>sd,ko:()=>ud,lt:()=>gd,mk:()=>vd,ms:()=>bd,nl:()=>Sd,no:()=>wd,ota:()=>Ed,pl:()=>Ad,ps:()=>Od,pt:()=>Md,ru:()=>Fd,sl:()=>Ld,sv:()=>zd,ta:()=>Vd,th:()=>Ud,tr:()=>Kd,ua:()=>Yd,uk:()=>Jd,ur:()=>Zd,vi:()=>$d,yo:()=>of,zhCN:()=>tf,zhTW:()=>rf});const cf=Symbol(`ZodOutput`),lf=Symbol(`ZodInput`);var uf=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n==`object`&&`id`in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function df(){return new uf}const ff=df();function pf(e,t){return new e({type:`string`,...U(t)})}function mf(e,t){return new e({type:`string`,coerce:!0,...U(t)})}function hf(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...U(t)})}function gf(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...U(t)})}function _f(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...U(t)})}function vf(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...U(t)})}function yf(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...U(t)})}function bf(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...U(t)})}function xf(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...U(t)})}function Sf(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...U(t)})}function Cf(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...U(t)})}function wf(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...U(t)})}function Tf(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...U(t)})}function Ef(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...U(t)})}function Df(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...U(t)})}function Of(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...U(t)})}function kf(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...U(t)})}function Af(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...U(t)})}function jf(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...U(t)})}function Mf(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...U(t)})}function Nf(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...U(t)})}function Pf(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...U(t)})}function Ff(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...U(t)})}function If(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...U(t)})}const Lf={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Rf(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...U(t)})}function zf(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...U(t)})}function Bf(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...U(t)})}function Vf(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...U(t)})}function Hf(e,t){return new e({type:`number`,checks:[],...U(t)})}function Uf(e,t){return new e({type:`number`,coerce:!0,checks:[],...U(t)})}function Wf(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...U(t)})}function Gf(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`float32`,...U(t)})}function Kf(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`float64`,...U(t)})}function qf(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`int32`,...U(t)})}function Jf(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`uint32`,...U(t)})}function Yf(e,t){return new e({type:`boolean`,...U(t)})}function Xf(e,t){return new e({type:`boolean`,coerce:!0,...U(t)})}function Zf(e,t){return new e({type:`bigint`,...U(t)})}function Qf(e,t){return new e({type:`bigint`,coerce:!0,...U(t)})}function $f(e,t){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`int64`,...U(t)})}function ep(e,t){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`uint64`,...U(t)})}function tp(e,t){return new e({type:`symbol`,...U(t)})}function np(e,t){return new e({type:`undefined`,...U(t)})}function rp(e,t){return new e({type:`null`,...U(t)})}function ip(e){return new e({type:`any`})}function ap(e){return new e({type:`unknown`})}function op(e,t){return new e({type:`never`,...U(t)})}function sp(e,t){return new e({type:`void`,...U(t)})}function cp(e,t){return new e({type:`date`,...U(t)})}function lp(e,t){return new e({type:`date`,coerce:!0,...U(t)})}function up(e,t){return new e({type:`nan`,...U(t)})}function dp(e,t){return new ac({check:`less_than`,...U(t),value:e,inclusive:!1})}function fp(e,t){return new ac({check:`less_than`,...U(t),value:e,inclusive:!0})}function pp(e,t){return new oc({check:`greater_than`,...U(t),value:e,inclusive:!1})}function mp(e,t){return new oc({check:`greater_than`,...U(t),value:e,inclusive:!0})}function hp(e){return pp(0,e)}function gp(e){return dp(0,e)}function _p(e){return fp(0,e)}function vp(e){return mp(0,e)}function yp(e,t){return new sc({check:`multiple_of`,...U(t),value:e})}function bp(e,t){return new uc({check:`max_size`,...U(t),maximum:e})}function xp(e,t){return new dc({check:`min_size`,...U(t),minimum:e})}function Sp(e,t){return new fc({check:`size_equals`,...U(t),size:e})}function Cp(e,t){return new pc({check:`max_length`,...U(t),maximum:e})}function wp(e,t){return new mc({check:`min_length`,...U(t),minimum:e})}function Tp(e,t){return new hc({check:`length_equals`,...U(t),length:e})}function Ep(e,t){return new _c({check:`string_format`,format:`regex`,...U(t),pattern:e})}function Dp(e){return new vc({check:`string_format`,format:`lowercase`,...U(e)})}function Op(e){return new yc({check:`string_format`,format:`uppercase`,...U(e)})}function kp(e,t){return new bc({check:`string_format`,format:`includes`,...U(t),includes:e})}function Ap(e,t){return new xc({check:`string_format`,format:`starts_with`,...U(t),prefix:e})}function jp(e,t){return new Sc({check:`string_format`,format:`ends_with`,...U(t),suffix:e})}function Mp(e,t,n){return new wc({check:`property`,property:e,schema:t,...U(n)})}function Np(e,t){return new Tc({check:`mime_type`,mime:e,...U(t)})}function Pp(e){return new Ec({check:`overwrite`,tx:e})}function Fp(e){return Pp(t=>t.normalize(e))}function Ip(){return Pp(e=>e.trim())}function Lp(){return Pp(e=>e.toLowerCase())}function Rp(){return Pp(e=>e.toUpperCase())}function zp(e,t,n){return new e({type:`array`,element:t,...U(n)})}function Bp(e,t,n){return new e({type:`union`,options:t,...U(n)})}function Vp(e,t,n,r){return new e({type:`union`,options:n,discriminator:t,...U(r)})}function Hp(e,t,n){return new e({type:`intersection`,left:t,right:n})}function Up(e,t,n,r){let i=n instanceof G;return new e({type:`tuple`,items:t,rest:i?n:null,...U(i?r:n)})}function Wp(e,t,n,r){return new e({type:`record`,keyType:t,valueType:n,...U(r)})}function Gp(e,t,n,r){return new e({type:`map`,keyType:t,valueType:n,...U(r)})}function Kp(e,t,n){return new e({type:`set`,valueType:t,...U(n)})}function qp(e,t,n){return new e({type:`enum`,entries:Array.isArray(t)?Object.fromEntries(t.map(e=>[e,e])):t,...U(n)})}function Jp(e,t,n){return new e({type:`enum`,entries:t,...U(n)})}function Yp(e,t,n){return new e({type:`literal`,values:Array.isArray(t)?t:[t],...U(n)})}function Xp(e,t){return new e({type:`file`,...U(t)})}function Zp(e,t){return new e({type:`transform`,transform:t})}function Qp(e,t){return new e({type:`optional`,innerType:t})}function $p(e,t){return new e({type:`nullable`,innerType:t})}function em(e,t,n){return new e({type:`default`,innerType:t,get defaultValue(){return typeof n==`function`?n():La(n)}})}function tm(e,t,n){return new e({type:`nonoptional`,innerType:t,...U(n)})}function nm(e,t){return new e({type:`success`,innerType:t})}function rm(e,t,n){return new e({type:`catch`,innerType:t,catchValue:typeof n==`function`?n:()=>n})}function im(e,t,n){return new e({type:`pipe`,in:t,out:n})}function am(e,t){return new e({type:`readonly`,innerType:t})}function om(e,t,n){return new e({type:`template_literal`,parts:t,...U(n)})}function sm(e,t){return new e({type:`lazy`,getter:t})}function cm(e,t){return new e({type:`promise`,innerType:t})}function lm(e,t,n){let r=U(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function um(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...U(n)})}function dm(e){let t=fm(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(so(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(so(r))}},e(n.value,n)));return t}function fm(e,t){let n=new rc({check:`custom`,...U(t)});return n._zod.check=e,n}function pm(e,t){let n=U(t),r=n.truthy??[`true`,`1`,`yes`,`on`,`y`,`enabled`],i=n.falsy??[`false`,`0`,`no`,`off`,`n`,`disabled`];n.case!==`sensitive`&&(r=r.map(e=>typeof e==`string`?e.toLowerCase():e),i=i.map(e=>typeof e==`string`?e.toLowerCase():e));let a=new Set(r),o=new Set(i),s=e.Codec??$l,c=e.Boolean??al,l=new s({type:`pipe`,in:new(e.String??kc)({type:`string`,error:n.error}),out:new c({type:`boolean`,error:n.error}),transform:((e,t)=>{let r=e;return n.case!==`sensitive`&&(r=r.toLowerCase()),a.has(r)?!0:o.has(r)?!1:(t.issues.push({code:`invalid_value`,expected:`stringbool`,values:[...a,...o],input:t.value,inst:l,continue:!1}),{})}),reverseTransform:((e,t)=>e===!0?r[0]||`true`:i[0]||`false`),error:n.error});return l}function mm(e,t,n,r={}){let i=U(r),a={...U(r),check:`string_format`,type:`string`,format:t,fn:typeof n==`function`?n:e=>n.test(e),...i};return n instanceof RegExp&&(a.pattern=n),new e(a)}var hm=class{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??ff,this.target=e?.target??`draft-2020-12`,this.unrepresentable=e?.unrepresentable??`throw`,this.override=e?.override??(()=>{}),this.io=e?.io??`output`,this.seen=new Map}process(e,t={path:[],schemaPath:[]}){var n;let r=e._zod.def,i={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},a=this.seen.get(e);if(a)return a.count++,t.schemaPath.includes(e)&&(a.cycle=t.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:t.path};this.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let n={...t,schemaPath:[...t.schemaPath,e],path:t.path},a=e._zod.parent;if(a)o.ref=a,this.process(a,n),this.seen.get(a).isParent=!0;else{let t=o.schema;switch(r.type){case`string`:{let n=t;n.type=`string`;let{minimum:r,maximum:a,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof r==`number`&&(n.minLength=r),typeof a==`number`&&(n.maxLength=a),s&&(n.format=i[s]??s,n.format===``&&delete n.format),l&&(n.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?n.pattern=e[0].source:e.length>1&&(o.schema.allOf=[...e.map(e=>({...this.target===`draft-7`||this.target===`draft-4`||this.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}break}case`number`:{let n=t,{minimum:r,maximum:i,format:a,multipleOf:o,exclusiveMaximum:s,exclusiveMinimum:c}=e._zod.bag;typeof a==`string`&&a.includes(`int`)?n.type=`integer`:n.type=`number`,typeof c==`number`&&(this.target===`draft-4`||this.target===`openapi-3.0`?(n.minimum=c,n.exclusiveMinimum=!0):n.exclusiveMinimum=c),typeof r==`number`&&(n.minimum=r,typeof c==`number`&&this.target!==`draft-4`&&(c>=r?delete n.minimum:delete n.exclusiveMinimum)),typeof s==`number`&&(this.target===`draft-4`||this.target===`openapi-3.0`?(n.maximum=s,n.exclusiveMaximum=!0):n.exclusiveMaximum=s),typeof i==`number`&&(n.maximum=i,typeof s==`number`&&this.target!==`draft-4`&&(s<=i?delete n.maximum:delete n.exclusiveMaximum)),typeof o==`number`&&(n.multipleOf=o);break}case`boolean`:{let e=t;e.type=`boolean`;break}case`bigint`:if(this.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`);break;case`symbol`:if(this.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`);break;case`null`:this.target===`openapi-3.0`?(t.type=`string`,t.nullable=!0,t.enum=[null]):t.type=`null`;break;case`any`:break;case`unknown`:break;case`undefined`:if(this.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`);break;case`void`:if(this.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`);break;case`never`:t.not={};break;case`date`:if(this.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`);break;case`array`:{let i=t,{minimum:a,maximum:o}=e._zod.bag;typeof a==`number`&&(i.minItems=a),typeof o==`number`&&(i.maxItems=o),i.type=`array`,i.items=this.process(r.element,{...n,path:[...n.path,`items`]});break}case`object`:{let e=t;e.type=`object`,e.properties={};let i=r.shape;for(let t in i)e.properties[t]=this.process(i[t],{...n,path:[...n.path,`properties`,t]});let a=new Set(Object.keys(i)),o=new Set([...a].filter(e=>{let t=r.shape[e]._zod;return this.io===`input`?t.optin===void 0:t.optout===void 0}));o.size>0&&(e.required=Array.from(o)),r.catchall?._zod.def.type===`never`?e.additionalProperties=!1:r.catchall?r.catchall&&(e.additionalProperties=this.process(r.catchall,{...n,path:[...n.path,`additionalProperties`]})):this.io===`output`&&(e.additionalProperties=!1);break}case`union`:{let e=t;e.anyOf=r.options.map((e,t)=>this.process(e,{...n,path:[...n.path,`anyOf`,t]}));break}case`intersection`:{let e=t,i=this.process(r.left,{...n,path:[...n.path,`allOf`,0]}),a=this.process(r.right,{...n,path:[...n.path,`allOf`,1]}),o=e=>`allOf`in e&&Object.keys(e).length===1;e.allOf=[...o(i)?i.allOf:[i],...o(a)?a.allOf:[a]];break}case`tuple`:{let i=t;i.type=`array`;let a=this.target===`draft-2020-12`?`prefixItems`:`items`,o=this.target===`draft-2020-12`||this.target===`openapi-3.0`?`items`:`additionalItems`,s=r.items.map((e,t)=>this.process(e,{...n,path:[...n.path,a,t]})),c=r.rest?this.process(r.rest,{...n,path:[...n.path,o,...this.target===`openapi-3.0`?[r.items.length]:[]]}):null;this.target===`draft-2020-12`?(i.prefixItems=s,c&&(i.items=c)):this.target===`openapi-3.0`?(i.items={anyOf:s},c&&i.items.anyOf.push(c),i.minItems=s.length,c||(i.maxItems=s.length)):(i.items=s,c&&(i.additionalItems=c));let{minimum:l,maximum:u}=e._zod.bag;typeof l==`number`&&(i.minItems=l),typeof u==`number`&&(i.maxItems=u);break}case`record`:{let e=t;e.type=`object`,(this.target===`draft-7`||this.target===`draft-2020-12`)&&(e.propertyNames=this.process(r.keyType,{...n,path:[...n.path,`propertyNames`]})),e.additionalProperties=this.process(r.valueType,{...n,path:[...n.path,`additionalProperties`]});break}case`map`:if(this.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`);break;case`set`:if(this.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`);break;case`enum`:{let e=t,n=va(r.entries);n.every(e=>typeof e==`number`)&&(e.type=`number`),n.every(e=>typeof e==`string`)&&(e.type=`string`),e.enum=n;break}case`literal`:{let e=t,n=[];for(let e of r.values)if(e===void 0){if(this.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(this.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);n.push(Number(e))}else n.push(e);if(n.length!==0)if(n.length===1){let t=n[0];e.type=t===null?`null`:typeof t,this.target===`draft-4`||this.target===`openapi-3.0`?e.enum=[t]:e.const=t}else n.every(e=>typeof e==`number`)&&(e.type=`number`),n.every(e=>typeof e==`string`)&&(e.type=`string`),n.every(e=>typeof e==`boolean`)&&(e.type=`string`),n.every(e=>e===null)&&(e.type=`null`),e.enum=n;break}case`file`:{let n=t,r={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:i,maximum:a,mime:o}=e._zod.bag;i!==void 0&&(r.minLength=i),a!==void 0&&(r.maxLength=a),o?o.length===1?(r.contentMediaType=o[0],Object.assign(n,r)):n.anyOf=o.map(e=>({...r,contentMediaType:e})):Object.assign(n,r);break}case`transform`:if(this.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`);break;case`nullable`:{let e=this.process(r.innerType,n);this.target===`openapi-3.0`?(o.ref=r.innerType,t.nullable=!0):t.anyOf=[e,{type:`null`}];break}case`nonoptional`:this.process(r.innerType,n),o.ref=r.innerType;break;case`success`:{let e=t;e.type=`boolean`;break}case`default`:this.process(r.innerType,n),o.ref=r.innerType,t.default=JSON.parse(JSON.stringify(r.defaultValue));break;case`prefault`:this.process(r.innerType,n),o.ref=r.innerType,this.io===`input`&&(t._prefault=JSON.parse(JSON.stringify(r.defaultValue)));break;case`catch`:{this.process(r.innerType,n),o.ref=r.innerType;let e;try{e=r.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}t.default=e;break}case`nan`:if(this.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`);break;case`template_literal`:{let n=t,r=e._zod.pattern;if(!r)throw Error(`Pattern not found in template literal`);n.type=`string`,n.pattern=r.source;break}case`pipe`:{let e=this.io===`input`?r.in._zod.def.type===`transform`?r.out:r.in:r.out;this.process(e,n),o.ref=e;break}case`readonly`:this.process(r.innerType,n),o.ref=r.innerType,t.readOnly=!0;break;case`promise`:this.process(r.innerType,n),o.ref=r.innerType;break;case`optional`:this.process(r.innerType,n),o.ref=r.innerType;break;case`lazy`:{let t=e._zod.innerType;this.process(t,n),o.ref=t;break}case`custom`:if(this.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`);break;case`function`:if(this.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`);break;default:}}}let c=this.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),this.io===`input`&&_m(e)&&(delete o.schema.examples,delete o.schema.default),this.io===`input`&&o.schema._prefault&&((n=o.schema).default??(n.default=o.schema._prefault)),delete o.schema._prefault,this.seen.get(e).schema}emit(e,t){let n={cycles:t?.cycles??`ref`,reused:t?.reused??`inline`,external:t?.external??void 0},r=this.seen.get(e);if(!r)throw Error(`Unprocessed schema. This is a bug in Zod.`);let i=e=>{let t=this.target===`draft-2020-12`?`$defs`:`definitions`;if(n.external){let r=n.external.registry.get(e[0])?.id,i=n.external.uri??(e=>e);if(r)return{ref:i(r)};let a=e[1].defId??e[1].schema.id??`schema${this.counter++}`;return e[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${t}/${a}`}}if(e[1]===r)return{ref:`#`};let i=`#/${t}/`,a=e[1].schema.id??`__schema${this.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(n.cycles===`throw`)for(let e of this.seen.entries()){let t=e[1];if(t.cycle)throw Error(`Cycle detected: #/${t.cycle?.join(`/`)}/<root>
82
+
83
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let t of this.seen.entries()){let r=t[1];if(e===t[0]){a(t);continue}if(n.external){let r=n.external.registry.get(t[0])?.id;if(e!==t[0]&&r){a(t);continue}}if(this.metadataRegistry.get(t[0])?.id){a(t);continue}if(r.cycle){a(t);continue}if(r.count>1&&n.reused===`ref`){a(t);continue}}let o=(e,t)=>{let n=this.seen.get(e),r=n.def??n.schema,i={...r};if(n.ref===null)return;let a=n.ref;if(n.ref=null,a){o(a,t);let e=this.seen.get(a).schema;e.$ref&&(t.target===`draft-7`||t.target===`draft-4`||t.target===`openapi-3.0`)?(r.allOf=r.allOf??[],r.allOf.push(e)):(Object.assign(r,e),Object.assign(r,i))}n.isParent||this.override({zodSchema:e,jsonSchema:r,path:n.path??[]})};for(let e of[...this.seen.entries()].reverse())o(e[0],{target:this.target});let s={};if(this.target===`draft-2020-12`?s.$schema=`https://json-schema.org/draft/2020-12/schema`:this.target===`draft-7`?s.$schema=`http://json-schema.org/draft-07/schema#`:this.target===`draft-4`?s.$schema=`http://json-schema.org/draft-04/schema#`:this.target===`openapi-3.0`||console.warn(`Invalid target: ${this.target}`),n.external?.uri){let t=n.external.registry.get(e)?.id;if(!t)throw Error("Schema is missing an `id` property");s.$id=n.external.uri(t)}Object.assign(s,r.def);let c=n.external?.defs??{};for(let e of this.seen.entries()){let t=e[1];t.def&&t.defId&&(c[t.defId]=t.def)}n.external||Object.keys(c).length>0&&(this.target===`draft-2020-12`?s.$defs=c:s.definitions=c);try{return JSON.parse(JSON.stringify(s))}catch{throw Error(`Error converting schema to JSON.`)}}};function gm(e,t){if(e instanceof uf){let n=new hm(t),r={};for(let t of e._idmap.entries()){let[e,r]=t;n.process(r)}let i={},a={registry:e,uri:t?.uri,defs:r};for(let r of e._idmap.entries()){let[e,o]=r;i[e]=n.emit(o,{...t,external:a})}return Object.keys(r).length>0&&(i.__shared={[n.target===`draft-2020-12`?`$defs`:`definitions`]:r}),{schemas:i}}let n=new hm(t);return n.process(e),n.emit(e,t)}function _m(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;switch(r.type){case`string`:case`number`:case`bigint`:case`boolean`:case`date`:case`symbol`:case`undefined`:case`null`:case`any`:case`unknown`:case`never`:case`void`:case`literal`:case`enum`:case`nan`:case`file`:case`template_literal`:return!1;case`array`:return _m(r.element,n);case`object`:for(let e in r.shape)if(_m(r.shape[e],n))return!0;return!1;case`union`:for(let e of r.options)if(_m(e,n))return!0;return!1;case`intersection`:return _m(r.left,n)||_m(r.right,n);case`tuple`:for(let e of r.items)if(_m(e,n))return!0;return!!(r.rest&&_m(r.rest,n));case`record`:return _m(r.keyType,n)||_m(r.valueType,n);case`map`:return _m(r.keyType,n)||_m(r.valueType,n);case`set`:return _m(r.valueType,n);case`promise`:case`optional`:case`nonoptional`:case`nullable`:case`readonly`:return _m(r.innerType,n);case`lazy`:return _m(r.getter(),n);case`default`:return _m(r.innerType,n);case`prefault`:return _m(r.innerType,n);case`custom`:return!1;case`transform`:return!0;case`pipe`:return _m(r.in,n)||_m(r.out,n);case`success`:return!1;case`catch`:return!1;case`function`:return!1;default:}throw Error(`Unknown schema type: ${r.type}`)}var vm={},ym=e({$ZodAny:()=>dl,$ZodArray:()=>_l,$ZodAsyncError:()=>ca,$ZodBase64:()=>Xc,$ZodBase64URL:()=>Qc,$ZodBigInt:()=>ol,$ZodBigIntFormat:()=>sl,$ZodBoolean:()=>al,$ZodCIDRv4:()=>qc,$ZodCIDRv6:()=>Jc,$ZodCUID:()=>Ic,$ZodCUID2:()=>Lc,$ZodCatch:()=>Yl,$ZodCheck:()=>rc,$ZodCheckBigIntFormat:()=>lc,$ZodCheckEndsWith:()=>Sc,$ZodCheckGreaterThan:()=>oc,$ZodCheckIncludes:()=>bc,$ZodCheckLengthEquals:()=>hc,$ZodCheckLessThan:()=>ac,$ZodCheckLowerCase:()=>vc,$ZodCheckMaxLength:()=>pc,$ZodCheckMaxSize:()=>uc,$ZodCheckMimeType:()=>Tc,$ZodCheckMinLength:()=>mc,$ZodCheckMinSize:()=>dc,$ZodCheckMultipleOf:()=>sc,$ZodCheckNumberFormat:()=>cc,$ZodCheckOverwrite:()=>Ec,$ZodCheckProperty:()=>wc,$ZodCheckRegex:()=>_c,$ZodCheckSizeEquals:()=>fc,$ZodCheckStartsWith:()=>xc,$ZodCheckStringFormat:()=>gc,$ZodCheckUpperCase:()=>yc,$ZodCodec:()=>$l,$ZodCustom:()=>cu,$ZodCustomStringFormat:()=>nl,$ZodDate:()=>hl,$ZodDefault:()=>Ul,$ZodDiscriminatedUnion:()=>Tl,$ZodE164:()=>$c,$ZodEmail:()=>Mc,$ZodEmoji:()=>Pc,$ZodEncodeError:()=>la,$ZodEnum:()=>Il,$ZodError:()=>vo,$ZodFile:()=>Rl,$ZodFunction:()=>au,$ZodGUID:()=>Ac,$ZodIPv4:()=>Gc,$ZodIPv6:()=>Kc,$ZodISODate:()=>Hc,$ZodISODateTime:()=>Vc,$ZodISODuration:()=>Wc,$ZodISOTime:()=>Uc,$ZodIntersection:()=>El,$ZodJWT:()=>tl,$ZodKSUID:()=>Bc,$ZodLazy:()=>su,$ZodLiteral:()=>Ll,$ZodMap:()=>Ml,$ZodNaN:()=>Xl,$ZodNanoID:()=>Fc,$ZodNever:()=>pl,$ZodNonOptional:()=>Kl,$ZodNull:()=>ul,$ZodNullable:()=>Hl,$ZodNumber:()=>rl,$ZodNumberFormat:()=>il,$ZodObject:()=>xl,$ZodObjectJIT:()=>Sl,$ZodOptional:()=>Vl,$ZodPipe:()=>Zl,$ZodPrefault:()=>Gl,$ZodPromise:()=>ou,$ZodReadonly:()=>nu,$ZodRealError:()=>yo,$ZodRecord:()=>jl,$ZodRegistry:()=>uf,$ZodSet:()=>Pl,$ZodString:()=>kc,$ZodStringFormat:()=>K,$ZodSuccess:()=>Jl,$ZodSymbol:()=>cl,$ZodTemplateLiteral:()=>iu,$ZodTransform:()=>zl,$ZodTuple:()=>kl,$ZodType:()=>G,$ZodULID:()=>Rc,$ZodURL:()=>Nc,$ZodUUID:()=>jc,$ZodUndefined:()=>ll,$ZodUnion:()=>wl,$ZodUnknown:()=>fl,$ZodVoid:()=>ml,$ZodXID:()=>zc,$brand:()=>sa,$constructor:()=>B,$input:()=>lf,$output:()=>cf,Doc:()=>Dc,JSONSchema:()=>vm,JSONSchemaGenerator:()=>hm,NEVER:()=>oa,TimePrecision:()=>Lf,_any:()=>ip,_array:()=>zp,_base64:()=>Nf,_base64url:()=>Pf,_bigint:()=>Zf,_boolean:()=>Yf,_catch:()=>rm,_check:()=>fm,_cidrv4:()=>jf,_cidrv6:()=>Mf,_coercedBigint:()=>Qf,_coercedBoolean:()=>Xf,_coercedDate:()=>lp,_coercedNumber:()=>Uf,_coercedString:()=>mf,_cuid:()=>wf,_cuid2:()=>Tf,_custom:()=>lm,_date:()=>cp,_decode:()=>Fo,_decodeAsync:()=>zo,_default:()=>em,_discriminatedUnion:()=>Vp,_e164:()=>Ff,_email:()=>hf,_emoji:()=>Sf,_encode:()=>No,_encodeAsync:()=>Lo,_endsWith:()=>jp,_enum:()=>qp,_file:()=>Xp,_float32:()=>Gf,_float64:()=>Kf,_gt:()=>pp,_gte:()=>mp,_guid:()=>gf,_includes:()=>kp,_int:()=>Wf,_int32:()=>qf,_int64:()=>$f,_intersection:()=>Hp,_ipv4:()=>kf,_ipv6:()=>Af,_isoDate:()=>zf,_isoDateTime:()=>Rf,_isoDuration:()=>Vf,_isoTime:()=>Bf,_jwt:()=>If,_ksuid:()=>Of,_lazy:()=>sm,_length:()=>Tp,_literal:()=>Yp,_lowercase:()=>Dp,_lt:()=>dp,_lte:()=>fp,_map:()=>Gp,_max:()=>fp,_maxLength:()=>Cp,_maxSize:()=>bp,_mime:()=>Np,_min:()=>mp,_minLength:()=>wp,_minSize:()=>xp,_multipleOf:()=>yp,_nan:()=>up,_nanoid:()=>Cf,_nativeEnum:()=>Jp,_negative:()=>gp,_never:()=>op,_nonnegative:()=>vp,_nonoptional:()=>tm,_nonpositive:()=>_p,_normalize:()=>Fp,_null:()=>rp,_nullable:()=>$p,_number:()=>Hf,_optional:()=>Qp,_overwrite:()=>Pp,_parse:()=>To,_parseAsync:()=>Do,_pipe:()=>im,_positive:()=>hp,_promise:()=>cm,_property:()=>Mp,_readonly:()=>am,_record:()=>Wp,_refine:()=>um,_regex:()=>Ep,_safeDecode:()=>Uo,_safeDecodeAsync:()=>qo,_safeEncode:()=>Vo,_safeEncodeAsync:()=>Go,_safeParse:()=>ko,_safeParseAsync:()=>jo,_set:()=>Kp,_size:()=>Sp,_startsWith:()=>Ap,_string:()=>pf,_stringFormat:()=>mm,_stringbool:()=>pm,_success:()=>nm,_superRefine:()=>dm,_symbol:()=>tp,_templateLiteral:()=>om,_toLowerCase:()=>Lp,_toUpperCase:()=>Rp,_transform:()=>Zp,_trim:()=>Ip,_tuple:()=>Up,_uint32:()=>Jf,_uint64:()=>ep,_ulid:()=>Ef,_undefined:()=>np,_union:()=>Bp,_unknown:()=>ap,_uppercase:()=>Op,_url:()=>xf,_uuid:()=>_f,_uuidv4:()=>vf,_uuidv6:()=>yf,_uuidv7:()=>bf,_void:()=>sp,_xid:()=>Df,clone:()=>Ua,config:()=>da,decode:()=>Io,decodeAsync:()=>Bo,encode:()=>Po,encodeAsync:()=>Ro,flattenError:()=>bo,formatError:()=>xo,globalConfig:()=>ua,globalRegistry:()=>ff,isValidBase64:()=>Yc,isValidBase64URL:()=>Zc,isValidJWT:()=>el,locales:()=>sf,parse:()=>Eo,parseAsync:()=>Oo,prettifyError:()=>wo,regexes:()=>Yo,registry:()=>df,safeDecode:()=>Wo,safeDecodeAsync:()=>Jo,safeEncode:()=>Ho,safeEncodeAsync:()=>Ko,safeParse:()=>Ao,safeParseAsync:()=>Mo,toDotPath:()=>Co,toJSONSchema:()=>gm,treeifyError:()=>So,util:()=>fa,version:()=>Oc}),bm=e({ZodISODate:()=>Cm,ZodISODateTime:()=>xm,ZodISODuration:()=>Dm,ZodISOTime:()=>Tm,date:()=>wm,datetime:()=>Sm,duration:()=>Om,time:()=>Em});const xm=B(`ZodISODateTime`,(e,t)=>{Vc.init(e,t),J.init(e,t)});function Sm(e){return Rf(xm,e)}const Cm=B(`ZodISODate`,(e,t)=>{Hc.init(e,t),J.init(e,t)});function wm(e){return zf(Cm,e)}const Tm=B(`ZodISOTime`,(e,t)=>{Uc.init(e,t),J.init(e,t)});function Em(e){return Bf(Tm,e)}const Dm=B(`ZodISODuration`,(e,t)=>{Wc.init(e,t),J.init(e,t)});function Om(e){return Vf(Dm,e)}const km=(e,t)=>{vo.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>xo(e,t)},flatten:{value:t=>bo(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,ya,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ya,2)}},isEmpty:{get(){return e.issues.length===0}}})},Am=B(`ZodError`,km),jm=B(`ZodError`,km,{Parent:Error}),Mm=To(jm),Nm=Do(jm),Pm=ko(jm),Fm=jo(jm),Im=No(jm),Lm=Fo(jm),Rm=Lo(jm),zm=zo(jm),Bm=Vo(jm),Vm=Uo(jm),Hm=Go(jm),Um=qo(jm),q=B(`ZodType`,(e,t)=>(G.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone(Da(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]})),e.clone=(t,n)=>Ua(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>Mm(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Pm(e,t,n),e.parseAsync=async(t,n)=>Nm(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Fm(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Im(e,t,n),e.decode=(t,n)=>Lm(e,t,n),e.encodeAsync=async(t,n)=>Rm(e,t,n),e.decodeAsync=async(t,n)=>zm(e,t,n),e.safeEncode=(t,n)=>Bm(e,t,n),e.safeDecode=(t,n)=>Vm(e,t,n),e.safeEncodeAsync=async(t,n)=>Hm(e,t,n),e.safeDecodeAsync=async(t,n)=>Um(e,t,n),e.refine=(t,n)=>e.check(O_(t,n)),e.superRefine=t=>e.check(k_(t)),e.overwrite=t=>e.check(Pp(t)),e.optional=()=>Yg(e),e.nullable=()=>Zg(e),e.nullish=()=>Yg(Zg(e)),e.nonoptional=t=>i_(e,t),e.array=()=>vg(e),e.or=t=>Tg([e,t]),e.and=t=>kg(e,t),e.transform=t=>f_(e,qg(t)),e.default=t=>e_(e,t),e.prefault=t=>n_(e,t),e.catch=t=>c_(e,t),e.pipe=t=>f_(e,t),e.readonly=()=>g_(e),e.describe=t=>{let n=e.clone();return ff.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return ff.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return ff.get(e);let n=e.clone();return ff.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Wm=B(`_ZodString`,(e,t)=>{kc.init(e,t),q.init(e,t);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(Ep(...t)),e.includes=(...t)=>e.check(kp(...t)),e.startsWith=(...t)=>e.check(Ap(...t)),e.endsWith=(...t)=>e.check(jp(...t)),e.min=(...t)=>e.check(wp(...t)),e.max=(...t)=>e.check(Cp(...t)),e.length=(...t)=>e.check(Tp(...t)),e.nonempty=(...t)=>e.check(wp(1,...t)),e.lowercase=t=>e.check(Dp(t)),e.uppercase=t=>e.check(Op(t)),e.trim=()=>e.check(Ip()),e.normalize=(...t)=>e.check(Fp(...t)),e.toLowerCase=()=>e.check(Lp()),e.toUpperCase=()=>e.check(Rp())}),Gm=B(`ZodString`,(e,t)=>{kc.init(e,t),Wm.init(e,t),e.email=t=>e.check(hf(qm,t)),e.url=t=>e.check(xf(nh,t)),e.jwt=t=>e.check(If(Nh,t)),e.emoji=t=>e.check(Sf(ah,t)),e.guid=t=>e.check(gf(Ym,t)),e.uuid=t=>e.check(_f(Zm,t)),e.uuidv4=t=>e.check(vf(Zm,t)),e.uuidv6=t=>e.check(yf(Zm,t)),e.uuidv7=t=>e.check(bf(Zm,t)),e.nanoid=t=>e.check(Cf(sh,t)),e.guid=t=>e.check(gf(Ym,t)),e.cuid=t=>e.check(wf(lh,t)),e.cuid2=t=>e.check(Tf(dh,t)),e.ulid=t=>e.check(Ef(ph,t)),e.base64=t=>e.check(Nf(Dh,t)),e.base64url=t=>e.check(Pf(kh,t)),e.xid=t=>e.check(Df(hh,t)),e.ksuid=t=>e.check(Of(_h,t)),e.ipv4=t=>e.check(kf(yh,t)),e.ipv6=t=>e.check(Af(xh,t)),e.cidrv4=t=>e.check(jf(Ch,t)),e.cidrv6=t=>e.check(Mf(Th,t)),e.e164=t=>e.check(Ff(jh,t)),e.datetime=t=>e.check(Sm(t)),e.date=t=>e.check(wm(t)),e.time=t=>e.check(Em(t)),e.duration=t=>e.check(Om(t))});function Km(e){return pf(Gm,e)}const J=B(`ZodStringFormat`,(e,t)=>{K.init(e,t),Wm.init(e,t)}),qm=B(`ZodEmail`,(e,t)=>{Mc.init(e,t),J.init(e,t)});function Jm(e){return hf(qm,e)}const Ym=B(`ZodGUID`,(e,t)=>{Ac.init(e,t),J.init(e,t)});function Xm(e){return gf(Ym,e)}const Zm=B(`ZodUUID`,(e,t)=>{jc.init(e,t),J.init(e,t)});function Qm(e){return _f(Zm,e)}function $m(e){return vf(Zm,e)}function eh(e){return yf(Zm,e)}function th(e){return bf(Zm,e)}const nh=B(`ZodURL`,(e,t)=>{Nc.init(e,t),J.init(e,t)});function rh(e){return xf(nh,e)}function ih(e){return xf(nh,{protocol:/^https?$/,hostname:Cs,...U(e)})}const ah=B(`ZodEmoji`,(e,t)=>{Pc.init(e,t),J.init(e,t)});function oh(e){return Sf(ah,e)}const sh=B(`ZodNanoID`,(e,t)=>{Fc.init(e,t),J.init(e,t)});function ch(e){return Cf(sh,e)}const lh=B(`ZodCUID`,(e,t)=>{Ic.init(e,t),J.init(e,t)});function uh(e){return wf(lh,e)}const dh=B(`ZodCUID2`,(e,t)=>{Lc.init(e,t),J.init(e,t)});function fh(e){return Tf(dh,e)}const ph=B(`ZodULID`,(e,t)=>{Rc.init(e,t),J.init(e,t)});function mh(e){return Ef(ph,e)}const hh=B(`ZodXID`,(e,t)=>{zc.init(e,t),J.init(e,t)});function gh(e){return Df(hh,e)}const _h=B(`ZodKSUID`,(e,t)=>{Bc.init(e,t),J.init(e,t)});function vh(e){return Of(_h,e)}const yh=B(`ZodIPv4`,(e,t)=>{Gc.init(e,t),J.init(e,t)});function bh(e){return kf(yh,e)}const xh=B(`ZodIPv6`,(e,t)=>{Kc.init(e,t),J.init(e,t)});function Sh(e){return Af(xh,e)}const Ch=B(`ZodCIDRv4`,(e,t)=>{qc.init(e,t),J.init(e,t)});function wh(e){return jf(Ch,e)}const Th=B(`ZodCIDRv6`,(e,t)=>{Jc.init(e,t),J.init(e,t)});function Eh(e){return Mf(Th,e)}const Dh=B(`ZodBase64`,(e,t)=>{Xc.init(e,t),J.init(e,t)});function Oh(e){return Nf(Dh,e)}const kh=B(`ZodBase64URL`,(e,t)=>{Qc.init(e,t),J.init(e,t)});function Ah(e){return Pf(kh,e)}const jh=B(`ZodE164`,(e,t)=>{$c.init(e,t),J.init(e,t)});function Mh(e){return Ff(jh,e)}const Nh=B(`ZodJWT`,(e,t)=>{tl.init(e,t),J.init(e,t)});function Ph(e){return If(Nh,e)}const Fh=B(`ZodCustomStringFormat`,(e,t)=>{nl.init(e,t),J.init(e,t)});function Ih(e,t,n={}){return mm(Fh,e,t,n)}function Lh(e){return mm(Fh,`hostname`,Ss,e)}function Rh(e){return mm(Fh,`hex`,zs,e)}function zh(e,t){let n=`${e}_${t?.enc??`hex`}`,r=Yo[n];if(!r)throw Error(`Unrecognized hash format: ${n}`);return mm(Fh,n,r,t)}const Bh=B(`ZodNumber`,(e,t)=>{rl.init(e,t),q.init(e,t),e.gt=(t,n)=>e.check(pp(t,n)),e.gte=(t,n)=>e.check(mp(t,n)),e.min=(t,n)=>e.check(mp(t,n)),e.lt=(t,n)=>e.check(dp(t,n)),e.lte=(t,n)=>e.check(fp(t,n)),e.max=(t,n)=>e.check(fp(t,n)),e.int=t=>e.check(Uh(t)),e.safe=t=>e.check(Uh(t)),e.positive=t=>e.check(pp(0,t)),e.nonnegative=t=>e.check(mp(0,t)),e.negative=t=>e.check(dp(0,t)),e.nonpositive=t=>e.check(fp(0,t)),e.multipleOf=(t,n)=>e.check(yp(t,n)),e.step=(t,n)=>e.check(yp(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Vh(e){return Hf(Bh,e)}const Hh=B(`ZodNumberFormat`,(e,t)=>{il.init(e,t),Bh.init(e,t)});function Uh(e){return Wf(Hh,e)}function Wh(e){return Gf(Hh,e)}function Gh(e){return Kf(Hh,e)}function Kh(e){return qf(Hh,e)}function qh(e){return Jf(Hh,e)}const Jh=B(`ZodBoolean`,(e,t)=>{al.init(e,t),q.init(e,t)});function Yh(e){return Yf(Jh,e)}const Xh=B(`ZodBigInt`,(e,t)=>{ol.init(e,t),q.init(e,t),e.gte=(t,n)=>e.check(mp(t,n)),e.min=(t,n)=>e.check(mp(t,n)),e.gt=(t,n)=>e.check(pp(t,n)),e.gte=(t,n)=>e.check(mp(t,n)),e.min=(t,n)=>e.check(mp(t,n)),e.lt=(t,n)=>e.check(dp(t,n)),e.lte=(t,n)=>e.check(fp(t,n)),e.max=(t,n)=>e.check(fp(t,n)),e.positive=t=>e.check(pp(BigInt(0),t)),e.negative=t=>e.check(dp(BigInt(0),t)),e.nonpositive=t=>e.check(fp(BigInt(0),t)),e.nonnegative=t=>e.check(mp(BigInt(0),t)),e.multipleOf=(t,n)=>e.check(yp(t,n));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function Zh(e){return Zf(Xh,e)}const Qh=B(`ZodBigIntFormat`,(e,t)=>{sl.init(e,t),Xh.init(e,t)});function $h(e){return $f(Qh,e)}function eg(e){return ep(Qh,e)}const tg=B(`ZodSymbol`,(e,t)=>{cl.init(e,t),q.init(e,t)});function ng(e){return tp(tg,e)}const rg=B(`ZodUndefined`,(e,t)=>{ll.init(e,t),q.init(e,t)});function ig(e){return np(rg,e)}const ag=B(`ZodNull`,(e,t)=>{ul.init(e,t),q.init(e,t)});function og(e){return rp(ag,e)}const sg=B(`ZodAny`,(e,t)=>{dl.init(e,t),q.init(e,t)});function cg(){return ip(sg)}const lg=B(`ZodUnknown`,(e,t)=>{fl.init(e,t),q.init(e,t)});function ug(){return ap(lg)}const dg=B(`ZodNever`,(e,t)=>{pl.init(e,t),q.init(e,t)});function fg(e){return op(dg,e)}const pg=B(`ZodVoid`,(e,t)=>{ml.init(e,t),q.init(e,t)});function mg(e){return sp(pg,e)}const hg=B(`ZodDate`,(e,t)=>{hl.init(e,t),q.init(e,t),e.min=(t,n)=>e.check(mp(t,n)),e.max=(t,n)=>e.check(fp(t,n));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function gg(e){return cp(hg,e)}const _g=B(`ZodArray`,(e,t)=>{_l.init(e,t),q.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(wp(t,n)),e.nonempty=t=>e.check(wp(1,t)),e.max=(t,n)=>e.check(Cp(t,n)),e.length=(t,n)=>e.check(Tp(t,n)),e.unwrap=()=>e.element});function vg(e,t){return zp(_g,e,t)}function yg(e){let t=e._zod.def.shape;return Bg(Object.keys(t))}const bg=B(`ZodObject`,(e,t)=>{Sl.init(e,t),q.init(e,t),H(e,`shape`,()=>t.shape),e.keyof=()=>Bg(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ug()}),e.loose=()=>e.clone({...e._zod.def,catchall:ug()}),e.strict=()=>e.clone({...e._zod.def,catchall:fg()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>Xa(e,t),e.safeExtend=t=>Za(e,t),e.merge=t=>Qa(e,t),e.pick=t=>Ja(e,t),e.omit=t=>Ya(e,t),e.partial=(...t)=>$a(Jg,e,t[0]),e.required=(...t)=>eo(r_,e,t[0])});function xg(e,t){return new bg({type:`object`,shape:e??{},...U(t)})}function Sg(e,t){return new bg({type:`object`,shape:e,catchall:fg(),...U(t)})}function Cg(e,t){return new bg({type:`object`,shape:e,catchall:ug(),...U(t)})}const wg=B(`ZodUnion`,(e,t)=>{wl.init(e,t),q.init(e,t),e.options=t.options});function Tg(e,t){return new wg({type:`union`,options:e,...U(t)})}const Eg=B(`ZodDiscriminatedUnion`,(e,t)=>{wg.init(e,t),Tl.init(e,t)});function Dg(e,t,n){return new Eg({type:`union`,options:t,discriminator:e,...U(n)})}const Og=B(`ZodIntersection`,(e,t)=>{El.init(e,t),q.init(e,t)});function kg(e,t){return new Og({type:`intersection`,left:e,right:t})}const Ag=B(`ZodTuple`,(e,t)=>{kl.init(e,t),q.init(e,t),e.rest=t=>e.clone({...e._zod.def,rest:t})});function jg(e,t,n){let r=t instanceof G;return new Ag({type:`tuple`,items:e,rest:r?t:null,...U(r?n:t)})}const Mg=B(`ZodRecord`,(e,t)=>{jl.init(e,t),q.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Ng(e,t,n){return new Mg({type:`record`,keyType:e,valueType:t,...U(n)})}function Pg(e,t,n){let r=Ua(e);return r._zod.values=void 0,new Mg({type:`record`,keyType:r,valueType:t,...U(n)})}const Fg=B(`ZodMap`,(e,t)=>{Ml.init(e,t),q.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Ig(e,t,n){return new Fg({type:`map`,keyType:e,valueType:t,...U(n)})}const Lg=B(`ZodSet`,(e,t)=>{Pl.init(e,t),q.init(e,t),e.min=(...t)=>e.check(xp(...t)),e.nonempty=t=>e.check(xp(1,t)),e.max=(...t)=>e.check(bp(...t)),e.size=(...t)=>e.check(Sp(...t))});function Rg(e,t){return new Lg({type:`set`,valueType:e,...U(t)})}const zg=B(`ZodEnum`,(e,t)=>{Il.init(e,t),q.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new zg({...t,checks:[],...U(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new zg({...t,checks:[],...U(r),entries:i})}});function Bg(e,t){return new zg({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...U(t)})}function Vg(e,t){return new zg({type:`enum`,entries:e,...U(t)})}const Hg=B(`ZodLiteral`,(e,t)=>{Ll.init(e,t),q.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,`value`,{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Ug(e,t){return new Hg({type:`literal`,values:Array.isArray(e)?e:[e],...U(t)})}const Wg=B(`ZodFile`,(e,t)=>{Rl.init(e,t),q.init(e,t),e.min=(t,n)=>e.check(xp(t,n)),e.max=(t,n)=>e.check(bp(t,n)),e.mime=(t,n)=>e.check(Np(Array.isArray(t)?t:[t],n))});function Gg(e){return Xp(Wg,e)}const Kg=B(`ZodTransform`,(e,t)=>{zl.init(e,t),q.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new la(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(so(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(so(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function qg(e){return new Kg({type:`transform`,transform:e})}const Jg=B(`ZodOptional`,(e,t)=>{Vl.init(e,t),q.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Yg(e){return new Jg({type:`optional`,innerType:e})}const Xg=B(`ZodNullable`,(e,t)=>{Hl.init(e,t),q.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Zg(e){return new Xg({type:`nullable`,innerType:e})}function Qg(e){return Yg(Zg(e))}const $g=B(`ZodDefault`,(e,t)=>{Ul.init(e,t),q.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function e_(e,t){return new $g({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():La(t)}})}const t_=B(`ZodPrefault`,(e,t)=>{Gl.init(e,t),q.init(e,t),e.unwrap=()=>e._zod.def.innerType});function n_(e,t){return new t_({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():La(t)}})}const r_=B(`ZodNonOptional`,(e,t)=>{Kl.init(e,t),q.init(e,t),e.unwrap=()=>e._zod.def.innerType});function i_(e,t){return new r_({type:`nonoptional`,innerType:e,...U(t)})}const a_=B(`ZodSuccess`,(e,t)=>{Jl.init(e,t),q.init(e,t),e.unwrap=()=>e._zod.def.innerType});function o_(e){return new a_({type:`success`,innerType:e})}const s_=B(`ZodCatch`,(e,t)=>{Yl.init(e,t),q.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function c_(e,t){return new s_({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}const l_=B(`ZodNaN`,(e,t)=>{Xl.init(e,t),q.init(e,t)});function u_(e){return up(l_,e)}const d_=B(`ZodPipe`,(e,t)=>{Zl.init(e,t),q.init(e,t),e.in=t.in,e.out=t.out});function f_(e,t){return new d_({type:`pipe`,in:e,out:t})}const p_=B(`ZodCodec`,(e,t)=>{d_.init(e,t),$l.init(e,t)});function m_(e,t,n){return new p_({type:`pipe`,in:e,out:t,transform:n.decode,reverseTransform:n.encode})}const h_=B(`ZodReadonly`,(e,t)=>{nu.init(e,t),q.init(e,t),e.unwrap=()=>e._zod.def.innerType});function g_(e){return new h_({type:`readonly`,innerType:e})}const __=B(`ZodTemplateLiteral`,(e,t)=>{iu.init(e,t),q.init(e,t)});function v_(e,t){return new __({type:`template_literal`,parts:e,...U(t)})}const y_=B(`ZodLazy`,(e,t)=>{su.init(e,t),q.init(e,t),e.unwrap=()=>e._zod.def.getter()});function b_(e){return new y_({type:`lazy`,getter:e})}const x_=B(`ZodPromise`,(e,t)=>{ou.init(e,t),q.init(e,t),e.unwrap=()=>e._zod.def.innerType});function S_(e){return new x_({type:`promise`,innerType:e})}const C_=B(`ZodFunction`,(e,t)=>{au.init(e,t),q.init(e,t)});function w_(e){return new C_({type:`function`,input:Array.isArray(e?.input)?jg(e?.input):e?.input??vg(ug()),output:e?.output??ug()})}const T_=B(`ZodCustom`,(e,t)=>{cu.init(e,t),q.init(e,t)});function E_(e){let t=new rc({check:`custom`});return t._zod.check=e,t}function D_(e,t){return lm(T_,e??(()=>!0),t)}function O_(e,t={}){return um(T_,e,t)}function k_(e){return dm(e)}function A_(e,t={error:`Input not instance of ${e.name}`}){let n=new T_({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...U(t)});return n._zod.bag.Class=e,n}const j_=(...e)=>pm({Codec:p_,Boolean:Jh,String:Gm},...e);function M_(e){let t=b_(()=>Tg([Km(e),Vh(),Yh(),og(),vg(t),Ng(Km(),t)]));return t}function N_(e,t){return f_(qg(e),t)}const P_={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`};function F_(e){da({customError:e})}function I_(){return da().customError}var L_;(function(e){})(L_||={});var R_=e({bigint:()=>H_,boolean:()=>V_,date:()=>U_,number:()=>B_,string:()=>z_});function z_(e){return mf(Gm,e)}function B_(e){return Uf(Bh,e)}function V_(e){return Xf(Jh,e)}function H_(e){return Qf(Xh,e)}function U_(e){return lp(hg,e)}var W_=e({$brand:()=>sa,$input:()=>lf,$output:()=>cf,NEVER:()=>oa,TimePrecision:()=>Lf,ZodAny:()=>sg,ZodArray:()=>_g,ZodBase64:()=>Dh,ZodBase64URL:()=>kh,ZodBigInt:()=>Xh,ZodBigIntFormat:()=>Qh,ZodBoolean:()=>Jh,ZodCIDRv4:()=>Ch,ZodCIDRv6:()=>Th,ZodCUID:()=>lh,ZodCUID2:()=>dh,ZodCatch:()=>s_,ZodCodec:()=>p_,ZodCustom:()=>T_,ZodCustomStringFormat:()=>Fh,ZodDate:()=>hg,ZodDefault:()=>$g,ZodDiscriminatedUnion:()=>Eg,ZodE164:()=>jh,ZodEmail:()=>qm,ZodEmoji:()=>ah,ZodEnum:()=>zg,ZodError:()=>Am,ZodFile:()=>Wg,ZodFirstPartyTypeKind:()=>L_,ZodFunction:()=>C_,ZodGUID:()=>Ym,ZodIPv4:()=>yh,ZodIPv6:()=>xh,ZodISODate:()=>Cm,ZodISODateTime:()=>xm,ZodISODuration:()=>Dm,ZodISOTime:()=>Tm,ZodIntersection:()=>Og,ZodIssueCode:()=>P_,ZodJWT:()=>Nh,ZodKSUID:()=>_h,ZodLazy:()=>y_,ZodLiteral:()=>Hg,ZodMap:()=>Fg,ZodNaN:()=>l_,ZodNanoID:()=>sh,ZodNever:()=>dg,ZodNonOptional:()=>r_,ZodNull:()=>ag,ZodNullable:()=>Xg,ZodNumber:()=>Bh,ZodNumberFormat:()=>Hh,ZodObject:()=>bg,ZodOptional:()=>Jg,ZodPipe:()=>d_,ZodPrefault:()=>t_,ZodPromise:()=>x_,ZodReadonly:()=>h_,ZodRealError:()=>jm,ZodRecord:()=>Mg,ZodSet:()=>Lg,ZodString:()=>Gm,ZodStringFormat:()=>J,ZodSuccess:()=>a_,ZodSymbol:()=>tg,ZodTemplateLiteral:()=>__,ZodTransform:()=>Kg,ZodTuple:()=>Ag,ZodType:()=>q,ZodULID:()=>ph,ZodURL:()=>nh,ZodUUID:()=>Zm,ZodUndefined:()=>rg,ZodUnion:()=>wg,ZodUnknown:()=>lg,ZodVoid:()=>pg,ZodXID:()=>hh,_ZodString:()=>Wm,_default:()=>e_,_function:()=>w_,any:()=>cg,array:()=>vg,base64:()=>Oh,base64url:()=>Ah,bigint:()=>Zh,boolean:()=>Yh,catch:()=>c_,check:()=>E_,cidrv4:()=>wh,cidrv6:()=>Eh,clone:()=>Ua,codec:()=>m_,coerce:()=>R_,config:()=>da,core:()=>ym,cuid:()=>uh,cuid2:()=>fh,custom:()=>D_,date:()=>gg,decode:()=>Lm,decodeAsync:()=>zm,discriminatedUnion:()=>Dg,e164:()=>Mh,email:()=>Jm,emoji:()=>oh,encode:()=>Im,encodeAsync:()=>Rm,endsWith:()=>jp,enum:()=>Bg,file:()=>Gg,flattenError:()=>bo,float32:()=>Wh,float64:()=>Gh,formatError:()=>xo,function:()=>w_,getErrorMap:()=>I_,globalRegistry:()=>ff,gt:()=>pp,gte:()=>mp,guid:()=>Xm,hash:()=>zh,hex:()=>Rh,hostname:()=>Lh,httpUrl:()=>ih,includes:()=>kp,instanceof:()=>A_,int:()=>Uh,int32:()=>Kh,int64:()=>$h,intersection:()=>kg,ipv4:()=>bh,ipv6:()=>Sh,iso:()=>bm,json:()=>M_,jwt:()=>Ph,keyof:()=>yg,ksuid:()=>vh,lazy:()=>b_,length:()=>Tp,literal:()=>Ug,locales:()=>sf,looseObject:()=>Cg,lowercase:()=>Dp,lt:()=>dp,lte:()=>fp,map:()=>Ig,maxLength:()=>Cp,maxSize:()=>bp,mime:()=>Np,minLength:()=>wp,minSize:()=>xp,multipleOf:()=>yp,nan:()=>u_,nanoid:()=>ch,nativeEnum:()=>Vg,negative:()=>gp,never:()=>fg,nonnegative:()=>vp,nonoptional:()=>i_,nonpositive:()=>_p,normalize:()=>Fp,null:()=>og,nullable:()=>Zg,nullish:()=>Qg,number:()=>Vh,object:()=>xg,optional:()=>Yg,overwrite:()=>Pp,parse:()=>Mm,parseAsync:()=>Nm,partialRecord:()=>Pg,pipe:()=>f_,positive:()=>hp,prefault:()=>n_,preprocess:()=>N_,prettifyError:()=>wo,promise:()=>S_,property:()=>Mp,readonly:()=>g_,record:()=>Ng,refine:()=>O_,regex:()=>Ep,regexes:()=>Yo,registry:()=>df,safeDecode:()=>Vm,safeDecodeAsync:()=>Um,safeEncode:()=>Bm,safeEncodeAsync:()=>Hm,safeParse:()=>Pm,safeParseAsync:()=>Fm,set:()=>Rg,setErrorMap:()=>F_,size:()=>Sp,startsWith:()=>Ap,strictObject:()=>Sg,string:()=>Km,stringFormat:()=>Ih,stringbool:()=>j_,success:()=>o_,superRefine:()=>k_,symbol:()=>ng,templateLiteral:()=>v_,toJSONSchema:()=>gm,toLowerCase:()=>Lp,toUpperCase:()=>Rp,transform:()=>qg,treeifyError:()=>So,trim:()=>Ip,tuple:()=>jg,uint32:()=>qh,uint64:()=>eg,ulid:()=>mh,undefined:()=>ig,union:()=>Tg,unknown:()=>ug,uppercase:()=>Op,url:()=>rh,util:()=>fa,uuid:()=>Qm,uuidv4:()=>$m,uuidv6:()=>eh,uuidv7:()=>th,void:()=>mg,xid:()=>gh});da(Au());var G_=W_;const{get:K_,set:q_}=Lt(()=>null);async function J_(e,t,n){let r=e.body?.callbackURL||e.context.options.baseURL;if(!r)throw new on(`BAD_REQUEST`,{message:`callbackURL is required`});let i=Ct(128),a=Ct(32),o=e.context.oauthConfig?.storeStateStrategy||`cookie`,s={...n||{},callbackURL:r,codeVerifier:i,errorURL:e.body?.errorCallbackURL,newUserURL:e.body?.newUserCallbackURL,link:t,expiresAt:Date.now()+600*1e3,requestSignUp:e.body?.requestSignUp};if(await q_(s),o===`cookie`){let t=await wt({key:e.context.secret,data:JSON.stringify(s)}),n=e.context.createAuthCookie(`oauth_state`,{maxAge:600*1e3});return e.setCookie(n.name,t,n.attributes),{state:a,codeVerifier:i}}let c=e.context.createAuthCookie(`state`,{maxAge:300*1e3});await e.setSignedCookie(c.name,a,e.context.secret,c.attributes);let l=new Date;l.setMinutes(l.getMinutes()+10);let u=await e.context.internalAdapter.createVerificationValue({value:JSON.stringify(s),identifier:a,expiresAt:l});if(!u)throw e.context.logger.error(`Unable to create verification. Make sure the database adapter is properly working and there is a verification table in the database`),new on(`INTERNAL_SERVER_ERROR`,{message:`Unable to create verification`});return{state:u.identifier,codeVerifier:i}}async function Y_(e){let t=e.query.state||e.body.state,n=e.context.oauthConfig.storeStateStrategy||`cookie`,r=xg({callbackURL:Km(),codeVerifier:Km(),errorURL:Km().optional(),newUserURL:Km().optional(),expiresAt:Vh(),link:xg({email:Km(),userId:z_()}).optional(),requestSignUp:Yh().optional()}).passthrough(),i;if(n===`cookie`){let n=e.context.createAuthCookie(`oauth_state`),a=e.getCookie(n.name);if(!a){e.context.logger.error(`State Mismatch. OAuth state cookie not found`,{state:t});let n=e.context.options.onAPIError?.errorURL||`${e.context.baseURL}/error`;throw e.redirect(`${n}?error=please_restart_the_process`)}try{let t=await Tt({key:e.context.secret,data:a});i=r.parse(JSON.parse(t))}catch(t){e.context.logger.error(`Failed to decrypt or parse OAuth state cookie`,{error:t});let n=e.context.options.onAPIError?.errorURL||`${e.context.baseURL}/error`;throw e.redirect(`${n}?error=please_restart_the_process`)}e.setCookie(n.name,``,{maxAge:0})}else{let n=await e.context.internalAdapter.findVerificationValue(t);if(!n){e.context.logger.error(`State Mismatch. Verification not found`,{state:t});let n=e.context.options.onAPIError?.errorURL||`${e.context.baseURL}/error`;throw e.redirect(`${n}?error=please_restart_the_process`)}i=r.parse(JSON.parse(n.value));let a=e.context.createAuthCookie(`state`),o=await e.getSignedCookie(a.name,e.context.secret);if(!e.context.oauthConfig?.skipStateCookieCheck&&(!o||o!==t)){let t=e.context.options.onAPIError?.errorURL||`${e.context.baseURL}/error`;throw e.redirect(`${t}?error=state_mismatch`)}e.setCookie(a.name,``,{maxAge:0}),await e.context.internalAdapter.deleteVerificationValue(n.id)}if(i.errorURL||=e.context.options.onAPIError?.errorURL||`${e.context.baseURL}/error`,i.expiresAt<Date.now()){let t=e.context.options.onAPIError?.errorURL||`${e.context.baseURL}/error`;throw e.redirect(`${t}?error=please_restart_the_process`)}return i&&await q_(i),i}const X_={isAction:!1},Z_=e=>_t(`a-z`,`A-Z`,`0-9`)(e||32),Q_=Object.create(null),$_=e=>globalThis.process?.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(e?Q_:globalThis),ev=new Proxy(Q_,{get(e,t){return $_()[t]??Q_[t]},has(e,t){return t in $_()||t in Q_},set(e,t,n){let r=$_(!0);return r[t]=n,!0},deleteProperty(e,t){if(!t)return!1;let n=$_(!0);return delete n[t],!0},ownKeys(){let e=$_(!0);return Object.keys(e)}});function tv(e){return e?e!==`false`:!1}const nv=typeof process<`u`&&process.env&&process.env.NODE_ENV||``,rv=nv===`production`,iv=()=>nv===`dev`||nv===`development`,av=()=>nv===`test`||tv(ev.TEST);function Y(e,t){return typeof process<`u`&&process.env?process.env[e]??t:typeof Deno<`u`?Deno.env.get(e)??t:typeof Bun<`u`?Bun.env[e]??t:t}function ov(e,t=!0){let n=Y(e);return n?n!==`0`&&n.toLowerCase()!==`false`&&n!==``:t}const sv=Object.freeze({get BETTER_AUTH_SECRET(){return Y(`BETTER_AUTH_SECRET`)},get AUTH_SECRET(){return Y(`AUTH_SECRET`)},get BETTER_AUTH_TELEMETRY(){return Y(`BETTER_AUTH_TELEMETRY`)},get BETTER_AUTH_TELEMETRY_ID(){return Y(`BETTER_AUTH_TELEMETRY_ID`)},get NODE_ENV(){return Y(`NODE_ENV`,`development`)},get PACKAGE_VERSION(){return Y(`PACKAGE_VERSION`,`0.0.0`)},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return Y(`BETTER_AUTH_TELEMETRY_ENDPOINT`,`https://telemetry.better-auth.com/v1/track`)}}),cv={eterm:4,cons25:4,console:4,cygwin:4,dtterm:4,gnome:4,hurd:4,jfbterm:4,konsole:4,kterm:4,mlterm:4,mosh:24,putty:4,st:4,"rxvt-unicode-24bit":24,terminator:24,"xterm-kitty":24},lv=new Map(Object.entries({APPVEYOR:8,BUILDKITE:8,CIRCLECI:24,DRONE:8,GITEA_ACTIONS:24,GITHUB_ACTIONS:24,GITLAB_CI:8,TRAVIS:8})),uv=[/ansi/,/color/,/linux/,/direct/,/^con[0-9]*x[0-9]/,/^rxvt/,/^screen/,/^xterm/,/^vt100/,/^vt220/];function dv(){if(Y(`FORCE_COLOR`)!==void 0)switch(Y(`FORCE_COLOR`)){case``:case`1`:case`true`:return 4;case`2`:return 8;case`3`:return 24;default:return 1}if(Y(`NODE_DISABLE_COLORS`)!==void 0&&Y(`NODE_DISABLE_COLORS`)!==``||Y(`NO_COLOR`)!==void 0&&Y(`NO_COLOR`)!==``||Y(`TERM`)===`dumb`)return 1;if(Y(`TMUX`))return 24;if(`TF_BUILD`in ev&&`AGENT_NAME`in ev)return 4;if(`CI`in ev){for(let{0:e,1:t}of lv)if(e in ev)return t;return Y(`CI_NAME`)===`codeship`?8:1}if(`TEAMCITY_VERSION`in ev)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.exec(Y(`TEAMCITY_VERSION`))===null?1:4;switch(Y(`TERM_PROGRAM`)){case`iTerm.app`:return!Y(`TERM_PROGRAM_VERSION`)||/^[0-2]\./.exec(Y(`TERM_PROGRAM_VERSION`))!==null?8:24;case`HyperTerm`:case`MacTerm`:return 24;case`Apple_Terminal`:return 8}if(Y(`COLORTERM`)===`truecolor`||Y(`COLORTERM`)===`24bit`)return 24;if(Y(`TERM`)){if(/truecolor/.exec(Y(`TERM`))!==null)return 24;if(/^xterm-256/.exec(Y(`TERM`))!==null)return 8;let e=Y(`TERM`).toLowerCase();if(cv[e])return cv[e];if(uv.some(t=>t.exec(e)!==null))return 4}return Y(`COLORTERM`)?4:1}const fv={reset:`\x1B[0m`,bright:`\x1B[1m`,dim:`\x1B[2m`,undim:`\x1B[22m`,underscore:`\x1B[4m`,blink:`\x1B[5m`,reverse:`\x1B[7m`,hidden:`\x1B[8m`,fg:{black:`\x1B[30m`,red:`\x1B[31m`,green:`\x1B[32m`,yellow:`\x1B[33m`,blue:`\x1B[34m`,magenta:`\x1B[35m`,cyan:`\x1B[36m`,white:`\x1B[37m`},bg:{black:`\x1B[40m`,red:`\x1B[41m`,green:`\x1B[42m`,yellow:`\x1B[43m`,blue:`\x1B[44m`,magenta:`\x1B[45m`,cyan:`\x1B[46m`,white:`\x1B[47m`}},pv=[`info`,`success`,`warn`,`error`,`debug`];function mv(e,t){return pv.indexOf(t)<=pv.indexOf(e)}const hv={info:fv.fg.blue,success:fv.fg.green,warn:fv.fg.yellow,error:fv.fg.red,debug:fv.fg.magenta},gv=(e,t,n)=>{let r=new Date().toISOString();return n?`${fv.dim}${r}${fv.reset} ${hv[e]}${e.toUpperCase()}${fv.reset} ${fv.bright}[Better Auth]:${fv.reset} ${t}`:`${r} ${e.toUpperCase()} [Better Auth]: ${t}`},_v=e=>{let t=e?.disabled!==!0,n=e?.level??`error`,r=e?.disableColors===void 0?dv()!==1:!e.disableColors,i=(i,a,o=[])=>{if(!t||!mv(n,i))return;let s=gv(i,a,r);if(!e||typeof e.log!=`function`){i===`error`?console.error(s,...o):i===`warn`?console.warn(s,...o):console.log(s,...o);return}e.log(i===`success`?`info`:i,a,...o)};return{...Object.fromEntries(pv.map(e=>[e,(...[t,...n])=>i(e,t,n)])),get level(){return n}}},vv=_v();function yv(e){function t(e,t){if(typeof t==`string`&&/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/.test(t)){let e=new Date(t);if(!isNaN(e.getTime()))return e}return t}try{return typeof e==`string`?JSON.parse(e,t):e}catch(e){return vv.error(`Error parsing JSON`,{error:e}),null}}function bv(e,t,n){return ke(e),n===void 0&&(n=new Uint8Array(e.outputLen)),Qe(e,n,t)}const xv=Uint8Array.of(0),Sv=Uint8Array.of();function Cv(e,t,n,r=32){ke(e),De(r,`length`);let i=e.outputLen;if(r>255*i)throw Error(`Length must be <= 255*HashLen`);let a=Math.ceil(r/i);n===void 0?n=Sv:Oe(n,void 0,`info`);let o=new Uint8Array(a*i),s=Qe.create(e,t),c=s._cloneInto(),l=new Uint8Array(s.outputLen);for(let e=0;e<a;e++)xv[0]=e+1,c.update(e===0?Sv:l).update(n).update(xv).digestInto(l),o.set(l,i*e),s._cloneInto(c);return s.destroy(),c.destroy(),Ne(l,xv),o.slice(0,r)}const wv=(e,t,n,r,i)=>Cv(e,bv(e,t,n),r,i),Tv=new TextEncoder,Ev=new TextDecoder,Dv=2**32;function Ov(...e){let t=e.reduce((e,{length:t})=>e+t,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function kv(e,t,n){if(t<0||t>=Dv)throw RangeError(`value must be >= 0 and <= ${Dv-1}. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,t&255],n)}function Av(e){let t=Math.floor(e/Dv),n=e%Dv,r=new Uint8Array(8);return kv(r,t,0),kv(r,n,4),r}function jv(e){let t=new Uint8Array(4);return kv(t,e),t}function Mv(e){if(Uint8Array.prototype.toBase64)return e.toBase64();let t=32768,n=[];for(let r=0;r<e.length;r+=t)n.push(String.fromCharCode.apply(null,e.subarray(r,r+t)));return btoa(n.join(``))}function Nv(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function Pv(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(typeof e==`string`?e:Ev.decode(e),{alphabet:`base64url`});let t=e;t instanceof Uint8Array&&(t=Ev.decode(t)),t=t.replace(/-/g,`+`).replace(/_/g,`/`).replace(/\s/g,``);try{return Nv(t)}catch{throw TypeError(`The input to be decoded is not correctly encoded.`)}}function Fv(e){let t=e;return typeof t==`string`&&(t=Tv.encode(t)),Uint8Array.prototype.toBase64?t.toBase64({alphabet:`base64url`,omitPadding:!0}):Mv(t).replace(/=/g,``).replace(/\+/g,`-`).replace(/\//g,`_`)}var Iv=class extends Error{static code=`ERR_JOSE_GENERIC`;code=`ERR_JOSE_GENERIC`;constructor(e,t){super(e,t),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},Lv=class extends Iv{static code=`ERR_JWT_CLAIM_VALIDATION_FAILED`;code=`ERR_JWT_CLAIM_VALIDATION_FAILED`;claim;reason;payload;constructor(e,t,n=`unspecified`,r=`unspecified`){super(e,{cause:{claim:n,reason:r,payload:t}}),this.claim=n,this.reason=r,this.payload=t}},Rv=class extends Iv{static code=`ERR_JWT_EXPIRED`;code=`ERR_JWT_EXPIRED`;claim;reason;payload;constructor(e,t,n=`unspecified`,r=`unspecified`){super(e,{cause:{claim:n,reason:r,payload:t}}),this.claim=n,this.reason=r,this.payload=t}},zv=class extends Iv{static code=`ERR_JOSE_ALG_NOT_ALLOWED`;code=`ERR_JOSE_ALG_NOT_ALLOWED`},Bv=class extends Iv{static code=`ERR_JOSE_NOT_SUPPORTED`;code=`ERR_JOSE_NOT_SUPPORTED`},Vv=class extends Iv{static code=`ERR_JWE_DECRYPTION_FAILED`;code=`ERR_JWE_DECRYPTION_FAILED`;constructor(e=`decryption operation failed`,t){super(e,t)}},X=class extends Iv{static code=`ERR_JWE_INVALID`;code=`ERR_JWE_INVALID`},Hv=class extends Iv{static code=`ERR_JWS_INVALID`;code=`ERR_JWS_INVALID`},Uv=class extends Iv{static code=`ERR_JWT_INVALID`;code=`ERR_JWT_INVALID`},Wv=class extends Iv{static code=`ERR_JWK_INVALID`;code=`ERR_JWK_INVALID`},Gv=class extends Iv{static code=`ERR_JWKS_INVALID`;code=`ERR_JWKS_INVALID`},Kv=class extends Iv{static code=`ERR_JWKS_NO_MATCHING_KEY`;code=`ERR_JWKS_NO_MATCHING_KEY`;constructor(e=`no applicable key found in the JSON Web Key Set`,t){super(e,t)}},qv=class extends Iv{[Symbol.asyncIterator];static code=`ERR_JWKS_MULTIPLE_MATCHING_KEYS`;code=`ERR_JWKS_MULTIPLE_MATCHING_KEYS`;constructor(e=`multiple matching keys found in the JSON Web Key Set`,t){super(e,t)}},Jv=class extends Iv{static code=`ERR_JWKS_TIMEOUT`;code=`ERR_JWKS_TIMEOUT`;constructor(e=`request timed out`,t){super(e,t)}},Yv=class extends Iv{static code=`ERR_JWS_SIGNATURE_VERIFICATION_FAILED`;code=`ERR_JWS_SIGNATURE_VERIFICATION_FAILED`;constructor(e=`signature verification failed`,t){super(e,t)}};function Xv(e){switch(e){case`A128GCM`:case`A128GCMKW`:case`A192GCM`:case`A192GCMKW`:case`A256GCM`:case`A256GCMKW`:return 96;case`A128CBC-HS256`:case`A192CBC-HS384`:case`A256CBC-HS512`:return 128;default:throw new Bv(`Unsupported JWE Algorithm: ${e}`)}}var Zv=e=>crypto.getRandomValues(new Uint8Array(Xv(e)>>3)),Qv=(e,t)=>{if(t.length<<3!==Xv(e))throw new X(`Invalid Initialization Vector length`)},$v=(e,t)=>{let n=e.byteLength<<3;if(n!==t)throw new X(`Invalid Content Encryption Key length. Expected ${t} bits, got ${n} bits`)};function ey(e,t=`algorithm.name`){return TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function ty(e,t){return e.name===t}function ny(e){return parseInt(e.name.slice(4),10)}function ry(e){switch(e){case`ES256`:return`P-256`;case`ES384`:return`P-384`;case`ES512`:return`P-521`;default:throw Error(`unreachable`)}}function iy(e,t){if(t&&!e.usages.includes(t))throw TypeError(`CryptoKey does not support this operation, its usages must include ${t}.`)}function ay(e,t,n){switch(t){case`HS256`:case`HS384`:case`HS512`:{if(!ty(e.algorithm,`HMAC`))throw ey(`HMAC`);let n=parseInt(t.slice(2),10);if(ny(e.algorithm.hash)!==n)throw ey(`SHA-${n}`,`algorithm.hash`);break}case`RS256`:case`RS384`:case`RS512`:{if(!ty(e.algorithm,`RSASSA-PKCS1-v1_5`))throw ey(`RSASSA-PKCS1-v1_5`);let n=parseInt(t.slice(2),10);if(ny(e.algorithm.hash)!==n)throw ey(`SHA-${n}`,`algorithm.hash`);break}case`PS256`:case`PS384`:case`PS512`:{if(!ty(e.algorithm,`RSA-PSS`))throw ey(`RSA-PSS`);let n=parseInt(t.slice(2),10);if(ny(e.algorithm.hash)!==n)throw ey(`SHA-${n}`,`algorithm.hash`);break}case`Ed25519`:case`EdDSA`:if(!ty(e.algorithm,`Ed25519`))throw ey(`Ed25519`);break;case`ML-DSA-44`:case`ML-DSA-65`:case`ML-DSA-87`:if(!ty(e.algorithm,t))throw ey(t);break;case`ES256`:case`ES384`:case`ES512`:{if(!ty(e.algorithm,`ECDSA`))throw ey(`ECDSA`);let n=ry(t);if(e.algorithm.namedCurve!==n)throw ey(n,`algorithm.namedCurve`);break}default:throw TypeError(`CryptoKey does not support this operation`)}iy(e,n)}function oy(e,t,n){switch(t){case`A128GCM`:case`A192GCM`:case`A256GCM`:{if(!ty(e.algorithm,`AES-GCM`))throw ey(`AES-GCM`);let n=parseInt(t.slice(1,4),10);if(e.algorithm.length!==n)throw ey(n,`algorithm.length`);break}case`A128KW`:case`A192KW`:case`A256KW`:{if(!ty(e.algorithm,`AES-KW`))throw ey(`AES-KW`);let n=parseInt(t.slice(1,4),10);if(e.algorithm.length!==n)throw ey(n,`algorithm.length`);break}case`ECDH`:switch(e.algorithm.name){case`ECDH`:case`X25519`:break;default:throw ey(`ECDH or X25519`)}break;case`PBES2-HS256+A128KW`:case`PBES2-HS384+A192KW`:case`PBES2-HS512+A256KW`:if(!ty(e.algorithm,`PBKDF2`))throw ey(`PBKDF2`);break;case`RSA-OAEP`:case`RSA-OAEP-256`:case`RSA-OAEP-384`:case`RSA-OAEP-512`:{if(!ty(e.algorithm,`RSA-OAEP`))throw ey(`RSA-OAEP`);let n=parseInt(t.slice(9),10)||1;if(ny(e.algorithm.hash)!==n)throw ey(`SHA-${n}`,`algorithm.hash`);break}default:throw TypeError(`CryptoKey does not support this operation`)}iy(e,n)}function sy(e,t,...n){if(n=n.filter(Boolean),n.length>2){let t=n.pop();e+=`one of type ${n.join(`, `)}, or ${t}.`}else n.length===2?e+=`one of type ${n[0]} or ${n[1]}.`:e+=`of type ${n[0]}.`;return t==null?e+=` Received ${t}`:typeof t==`function`&&t.name?e+=` Received function ${t.name}`:typeof t==`object`&&t&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}var cy=(e,...t)=>sy(`Key must be `,e,...t);function ly(e,t,...n){return sy(`Key for the ${e} algorithm must be `,t,...n)}function uy(e){if(!dy(e))throw Error(`CryptoKey instance expected`)}function dy(e){return e?.[Symbol.toStringTag]===`CryptoKey`}function fy(e){return e?.[Symbol.toStringTag]===`KeyObject`}var py=e=>dy(e)||fy(e);async function my(e,t){if(!(e instanceof Uint8Array))throw TypeError(`First argument must be a buffer`);if(!(t instanceof Uint8Array))throw TypeError(`Second argument must be a buffer`);let n={name:`HMAC`,hash:`SHA-256`},r=await crypto.subtle.generateKey(n,!1,[`sign`]),i=new Uint8Array(await crypto.subtle.sign(n,r,e)),a=new Uint8Array(await crypto.subtle.sign(n,r,t)),o=0,s=-1;for(;++s<32;)o|=i[s]^a[s];return o===0}async function hy(e,t,n,r,i,a){if(!(t instanceof Uint8Array))throw TypeError(cy(t,`Uint8Array`));let o=parseInt(e.slice(1,4),10),s=await crypto.subtle.importKey(`raw`,t.subarray(o>>3),`AES-CBC`,!1,[`decrypt`]),c=await crypto.subtle.importKey(`raw`,t.subarray(0,o>>3),{hash:`SHA-${o<<1}`,name:`HMAC`},!1,[`sign`]),l=Ov(a,r,n,Av(a.length<<3)),u=new Uint8Array((await crypto.subtle.sign(`HMAC`,c,l)).slice(0,o>>3)),d;try{d=await my(i,u)}catch{}if(!d)throw new Vv;let f;try{f=new Uint8Array(await crypto.subtle.decrypt({iv:r,name:`AES-CBC`},s,n))}catch{}if(!f)throw new Vv;return f}async function gy(e,t,n,r,i,a){let o;t instanceof Uint8Array?o=await crypto.subtle.importKey(`raw`,t,`AES-GCM`,!1,[`decrypt`]):(oy(t,e,`decrypt`),o=t);try{return new Uint8Array(await crypto.subtle.decrypt({additionalData:a,iv:r,name:`AES-GCM`,tagLength:128},o,Ov(n,i)))}catch{throw new Vv}}var _y=async(e,t,n,r,i,a)=>{if(!dy(t)&&!(t instanceof Uint8Array))throw TypeError(cy(t,`CryptoKey`,`KeyObject`,`Uint8Array`,`JSON Web Key`));if(!r)throw new X(`JWE Initialization Vector missing`);if(!i)throw new X(`JWE Authentication Tag missing`);switch(Qv(e,r),e){case`A128CBC-HS256`:case`A192CBC-HS384`:case`A256CBC-HS512`:return t instanceof Uint8Array&&$v(t,parseInt(e.slice(-3),10)),hy(e,t,n,r,i,a);case`A128GCM`:case`A192GCM`:case`A256GCM`:return t instanceof Uint8Array&&$v(t,parseInt(e.slice(1,4),10)),gy(e,t,n,r,i,a);default:throw new Bv(`Unsupported JWE Content Encryption Algorithm`)}},vy=(...e)=>{let t=e.filter(Boolean);if(t.length===0||t.length===1)return!0;let n;for(let e of t){let t=Object.keys(e);if(!n||n.size===0){n=new Set(t);continue}for(let e of t){if(n.has(e))return!1;n.add(e)}}return!0};function yy(e){return typeof e==`object`&&!!e}var by=e=>{if(!yy(e)||Object.prototype.toString.call(e)!==`[object Object]`)return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t};function xy(e,t){if(e.algorithm.length!==parseInt(t.slice(1,4),10))throw TypeError(`Invalid key size for alg: ${t}`)}function Sy(e,t,n){return e instanceof Uint8Array?crypto.subtle.importKey(`raw`,e,`AES-KW`,!0,[n]):(oy(e,t,n),e)}async function Cy(e,t,n){let r=await Sy(t,e,`wrapKey`);xy(r,e);let i=await crypto.subtle.importKey(`raw`,n,{hash:`SHA-256`,name:`HMAC`},!0,[`sign`]);return new Uint8Array(await crypto.subtle.wrapKey(`raw`,i,r,`AES-KW`))}async function wy(e,t,n){let r=await Sy(t,e,`unwrapKey`);xy(r,e);let i=await crypto.subtle.unwrapKey(`raw`,n,r,`AES-KW`,{hash:`SHA-256`,name:`HMAC`},!0,[`sign`]);return new Uint8Array(await crypto.subtle.exportKey(`raw`,i))}var Ty=async(e,t)=>{let n=`SHA-${e.slice(-3)}`;return new Uint8Array(await crypto.subtle.digest(n,t))};function Ey(e){return Ov(jv(e.length),e)}async function Dy(e,t,n){let r=t>>3,i=Math.ceil(r/32),a=new Uint8Array(i*32);for(let t=1;t<=i;t++){let r=new Uint8Array(4+e.length+n.length);r.set(jv(t),0),r.set(e,4),r.set(n,4+e.length);let i=await Ty(`sha256`,r);a.set(i,(t-1)*32)}return a.slice(0,r)}async function Oy(e,t,n,r,i=new Uint8Array,a=new Uint8Array){oy(e,`ECDH`),oy(t,`ECDH`,`deriveBits`);let o=Ov(Ey(Tv.encode(n)),Ey(i),Ey(a),jv(r),new Uint8Array);return Dy(new Uint8Array(await crypto.subtle.deriveBits({name:e.algorithm.name,public:e},t,ky(e))),r,o)}function ky(e){return e.algorithm.name===`X25519`?256:Math.ceil(parseInt(e.algorithm.namedCurve.slice(-3),10)/8)<<3}function Ay(e){switch(e.algorithm.namedCurve){case`P-256`:case`P-384`:case`P-521`:return!0;default:return e.algorithm.name===`X25519`}}function jy(e,t){return e instanceof Uint8Array?crypto.subtle.importKey(`raw`,e,`PBKDF2`,!1,[`deriveBits`]):(oy(e,t,`deriveBits`),e)}const My=(e,t)=>Ov(Tv.encode(e),new Uint8Array([0]),t);async function Ny(e,t,n,r){if(!(e instanceof Uint8Array)||e.length<8)throw new X(`PBES2 Salt Input must be 8 or more octets`);let i=My(t,e),a=parseInt(t.slice(13,16),10),o={hash:`SHA-${t.slice(8,11)}`,iterations:n,name:`PBKDF2`,salt:i},s=await jy(r,t);return new Uint8Array(await crypto.subtle.deriveBits(o,s,a))}async function Py(e,t,n,r=2048,i=crypto.getRandomValues(new Uint8Array(16))){let a=await Ny(i,e,r,t);return{encryptedKey:await Cy(e.slice(-6),a,n),p2c:r,p2s:Fv(i)}}async function Fy(e,t,n,r,i){let a=await Ny(i,e,r,t);return wy(e.slice(-6),a,n)}var Iy=(e,t)=>{if(e.startsWith(`RS`)||e.startsWith(`PS`)){let{modulusLength:n}=t.algorithm;if(typeof n!=`number`||n<2048)throw TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}};const Ly=e=>{switch(e){case`RSA-OAEP`:case`RSA-OAEP-256`:case`RSA-OAEP-384`:case`RSA-OAEP-512`:return`RSA-OAEP`;default:throw new Bv(`alg ${e} is not supported either by JOSE or your javascript runtime`)}};async function Ry(e,t,n){return oy(t,e,`encrypt`),Iy(e,t),new Uint8Array(await crypto.subtle.encrypt(Ly(e),t,n))}async function zy(e,t,n){return oy(t,e,`decrypt`),Iy(e,t),new Uint8Array(await crypto.subtle.decrypt(Ly(e),t,n))}function By(e){switch(e){case`A128GCM`:return 128;case`A192GCM`:return 192;case`A256GCM`:case`A128CBC-HS256`:return 256;case`A192CBC-HS384`:return 384;case`A256CBC-HS512`:return 512;default:throw new Bv(`Unsupported JWE Algorithm: ${e}`)}}var Vy=e=>crypto.getRandomValues(new Uint8Array(By(e)>>3));function Hy(e){let t,n;switch(e.kty){case`AKP`:switch(e.alg){case`ML-DSA-44`:case`ML-DSA-65`:case`ML-DSA-87`:t={name:e.alg},n=e.priv?[`sign`]:[`verify`];break;default:throw new Bv(`Invalid or unsupported JWK "alg" (Algorithm) Parameter value`)}break;case`RSA`:switch(e.alg){case`PS256`:case`PS384`:case`PS512`:t={name:`RSA-PSS`,hash:`SHA-${e.alg.slice(-3)}`},n=e.d?[`sign`]:[`verify`];break;case`RS256`:case`RS384`:case`RS512`:t={name:`RSASSA-PKCS1-v1_5`,hash:`SHA-${e.alg.slice(-3)}`},n=e.d?[`sign`]:[`verify`];break;case`RSA-OAEP`:case`RSA-OAEP-256`:case`RSA-OAEP-384`:case`RSA-OAEP-512`:t={name:`RSA-OAEP`,hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},n=e.d?[`decrypt`,`unwrapKey`]:[`encrypt`,`wrapKey`];break;default:throw new Bv(`Invalid or unsupported JWK "alg" (Algorithm) Parameter value`)}break;case`EC`:switch(e.alg){case`ES256`:t={name:`ECDSA`,namedCurve:`P-256`},n=e.d?[`sign`]:[`verify`];break;case`ES384`:t={name:`ECDSA`,namedCurve:`P-384`},n=e.d?[`sign`]:[`verify`];break;case`ES512`:t={name:`ECDSA`,namedCurve:`P-521`},n=e.d?[`sign`]:[`verify`];break;case`ECDH-ES`:case`ECDH-ES+A128KW`:case`ECDH-ES+A192KW`:case`ECDH-ES+A256KW`:t={name:`ECDH`,namedCurve:e.crv},n=e.d?[`deriveBits`]:[];break;default:throw new Bv(`Invalid or unsupported JWK "alg" (Algorithm) Parameter value`)}break;case`OKP`:switch(e.alg){case`Ed25519`:case`EdDSA`:t={name:`Ed25519`},n=e.d?[`sign`]:[`verify`];break;case`ECDH-ES`:case`ECDH-ES+A128KW`:case`ECDH-ES+A192KW`:case`ECDH-ES+A256KW`:t={name:e.crv},n=e.d?[`deriveBits`]:[];break;default:throw new Bv(`Invalid or unsupported JWK "alg" (Algorithm) Parameter value`)}break;default:throw new Bv(`Invalid or unsupported JWK "kty" (Key Type) Parameter value`)}return{algorithm:t,keyUsages:n}}var Uy=async e=>{if(!e.alg)throw TypeError(`"alg" argument is required when "jwk.alg" is not present`);let{algorithm:t,keyUsages:n}=Hy(e),r={...e};return r.kty!==`AKP`&&delete r.alg,delete r.use,crypto.subtle.importKey(`jwk`,r,t,e.ext??!(e.d||e.priv),e.key_ops??n)};async function Wy(e,t,n){if(!by(e))throw TypeError(`JWK must be an object`);let r;switch(t??=e.alg,r??=n?.extractable??e.ext,e.kty){case`oct`:if(typeof e.k!=`string`||!e.k)throw TypeError(`missing "k" (Key Value) Parameter value`);return Pv(e.k);case`RSA`:if(`oth`in e&&e.oth!==void 0)throw new Bv(`RSA JWK "oth" (Other Primes Info) Parameter value is not supported`);return Uy({...e,alg:t,ext:r});case`AKP`:if(typeof e.alg!=`string`||!e.alg)throw TypeError(`missing "alg" (Algorithm) Parameter value`);if(t!==void 0&&t!==e.alg)throw TypeError(`JWK alg and alg option value mismatch`);return Uy({...e,ext:r});case`EC`:case`OKP`:return Uy({...e,alg:t,ext:r});default:throw new Bv(`Unsupported "kty" (Key Type) Parameter value`)}}async function Gy(e,t,n,r,i){if(!(n instanceof Uint8Array))throw TypeError(cy(n,`Uint8Array`));let a=parseInt(e.slice(1,4),10),o=await crypto.subtle.importKey(`raw`,n.subarray(a>>3),`AES-CBC`,!1,[`encrypt`]),s=await crypto.subtle.importKey(`raw`,n.subarray(0,a>>3),{hash:`SHA-${a<<1}`,name:`HMAC`},!1,[`sign`]),c=new Uint8Array(await crypto.subtle.encrypt({iv:r,name:`AES-CBC`},o,t)),l=Ov(i,r,c,Av(i.length<<3));return{ciphertext:c,tag:new Uint8Array((await crypto.subtle.sign(`HMAC`,s,l)).slice(0,a>>3)),iv:r}}async function Ky(e,t,n,r,i){let a;n instanceof Uint8Array?a=await crypto.subtle.importKey(`raw`,n,`AES-GCM`,!1,[`encrypt`]):(oy(n,e,`encrypt`),a=n);let o=new Uint8Array(await crypto.subtle.encrypt({additionalData:i,iv:r,name:`AES-GCM`,tagLength:128},a,t)),s=o.slice(-16);return{ciphertext:o.slice(0,-16),tag:s,iv:r}}var qy=async(e,t,n,r,i)=>{if(!dy(n)&&!(n instanceof Uint8Array))throw TypeError(cy(n,`CryptoKey`,`KeyObject`,`Uint8Array`,`JSON Web Key`));switch(r?Qv(e,r):r=Zv(e),e){case`A128CBC-HS256`:case`A192CBC-HS384`:case`A256CBC-HS512`:return n instanceof Uint8Array&&$v(n,parseInt(e.slice(-3),10)),Gy(e,t,n,r,i);case`A128GCM`:case`A192GCM`:case`A256GCM`:return n instanceof Uint8Array&&$v(n,parseInt(e.slice(1,4),10)),Ky(e,t,n,r,i);default:throw new Bv(`Unsupported JWE Content Encryption Algorithm`)}};async function Jy(e,t,n,r){let i=await qy(e.slice(0,7),n,t,r,new Uint8Array);return{encryptedKey:i.ciphertext,iv:Fv(i.iv),tag:Fv(i.tag)}}async function Yy(e,t,n,r,i){return _y(e.slice(0,7),t,n,r,i,new Uint8Array)}var Xy=async(e,t,n,r,i)=>{switch(e){case`dir`:if(n!==void 0)throw new X(`Encountered unexpected JWE Encrypted Key`);return t;case`ECDH-ES`:if(n!==void 0)throw new X(`Encountered unexpected JWE Encrypted Key`);case`ECDH-ES+A128KW`:case`ECDH-ES+A192KW`:case`ECDH-ES+A256KW`:{if(!by(r.epk))throw new X(`JOSE Header "epk" (Ephemeral Public Key) missing or invalid`);if(uy(t),!Ay(t))throw new Bv(`ECDH with the provided key is not allowed or not supported by your javascript runtime`);let i=await Wy(r.epk,e);uy(i);let a,o;if(r.apu!==void 0){if(typeof r.apu!=`string`)throw new X(`JOSE Header "apu" (Agreement PartyUInfo) invalid`);try{a=Pv(r.apu)}catch{throw new X(`Failed to base64url decode the apu`)}}if(r.apv!==void 0){if(typeof r.apv!=`string`)throw new X(`JOSE Header "apv" (Agreement PartyVInfo) invalid`);try{o=Pv(r.apv)}catch{throw new X(`Failed to base64url decode the apv`)}}let s=await Oy(i,t,e===`ECDH-ES`?r.enc:e,e===`ECDH-ES`?By(r.enc):parseInt(e.slice(-5,-2),10),a,o);if(e===`ECDH-ES`)return s;if(n===void 0)throw new X(`JWE Encrypted Key missing`);return wy(e.slice(-6),s,n)}case`RSA-OAEP`:case`RSA-OAEP-256`:case`RSA-OAEP-384`:case`RSA-OAEP-512`:if(n===void 0)throw new X(`JWE Encrypted Key missing`);return uy(t),zy(e,t,n);case`PBES2-HS256+A128KW`:case`PBES2-HS384+A192KW`:case`PBES2-HS512+A256KW`:{if(n===void 0)throw new X(`JWE Encrypted Key missing`);if(typeof r.p2c!=`number`)throw new X(`JOSE Header "p2c" (PBES2 Count) missing or invalid`);let a=i?.maxPBES2Count||1e4;if(r.p2c>a)throw new X(`JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds`);if(typeof r.p2s!=`string`)throw new X(`JOSE Header "p2s" (PBES2 Salt) missing or invalid`);let o;try{o=Pv(r.p2s)}catch{throw new X(`Failed to base64url decode the p2s`)}return Fy(e,t,n,r.p2c,o)}case`A128KW`:case`A192KW`:case`A256KW`:if(n===void 0)throw new X(`JWE Encrypted Key missing`);return wy(e,t,n);case`A128GCMKW`:case`A192GCMKW`:case`A256GCMKW`:{if(n===void 0)throw new X(`JWE Encrypted Key missing`);if(typeof r.iv!=`string`)throw new X(`JOSE Header "iv" (Initialization Vector) missing or invalid`);if(typeof r.tag!=`string`)throw new X(`JOSE Header "tag" (Authentication Tag) missing or invalid`);let i;try{i=Pv(r.iv)}catch{throw new X(`Failed to base64url decode the iv`)}let a;try{a=Pv(r.tag)}catch{throw new X(`Failed to base64url decode the tag`)}return Yy(e,t,n,i,a)}default:throw new Bv(`Invalid or unsupported "alg" (JWE Algorithm) header value`)}},Zy=(e,t,n,r,i)=>{if(i.crit!==void 0&&r?.crit===void 0)throw new e(`"crit" (Critical) Header Parameter MUST be integrity protected`);if(!r||r.crit===void 0)return new Set;if(!Array.isArray(r.crit)||r.crit.length===0||r.crit.some(e=>typeof e!=`string`||e.length===0))throw new e(`"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present`);let a;a=n===void 0?t:new Map([...Object.entries(n),...t.entries()]);for(let t of r.crit){if(!a.has(t))throw new Bv(`Extension Header Parameter "${t}" is not recognized`);if(i[t]===void 0)throw new e(`Extension Header Parameter "${t}" is missing`);if(a.get(t)&&r[t]===void 0)throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return new Set(r.crit)},Qy=(e,t)=>{if(t!==void 0&&(!Array.isArray(t)||t.some(e=>typeof e!=`string`)))throw TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)};function $y(e){return by(e)&&typeof e.kty==`string`}function eb(e){return e.kty!==`oct`&&(e.kty===`AKP`&&typeof e.priv==`string`||typeof e.d==`string`)}function tb(e){return e.kty!==`oct`&&e.d===void 0&&e.priv===void 0}function nb(e){return e.kty===`oct`&&typeof e.k==`string`}let rb;const ib=async(e,t,n,r=!1)=>{rb||=new WeakMap;let i=rb.get(e);if(i?.[n])return i[n];let a=await Uy({...t,alg:n});return r&&Object.freeze(e),i?i[n]=a:rb.set(e,{[n]:a}),a},ab=(e,t)=>{rb||=new WeakMap;let n=rb.get(e);if(n?.[t])return n[t];let r=e.type===`public`,i=!!r,a;if(e.asymmetricKeyType===`x25519`){switch(t){case`ECDH-ES`:case`ECDH-ES+A128KW`:case`ECDH-ES+A192KW`:case`ECDH-ES+A256KW`:break;default:throw TypeError(`given KeyObject instance cannot be used for this algorithm`)}a=e.toCryptoKey(e.asymmetricKeyType,i,r?[]:[`deriveBits`])}if(e.asymmetricKeyType===`ed25519`){if(t!==`EdDSA`&&t!==`Ed25519`)throw TypeError(`given KeyObject instance cannot be used for this algorithm`);a=e.toCryptoKey(e.asymmetricKeyType,i,[r?`verify`:`sign`])}switch(e.asymmetricKeyType){case`ml-dsa-44`:case`ml-dsa-65`:case`ml-dsa-87`:if(t!==e.asymmetricKeyType.toUpperCase())throw TypeError(`given KeyObject instance cannot be used for this algorithm`);a=e.toCryptoKey(e.asymmetricKeyType,i,[r?`verify`:`sign`])}if(e.asymmetricKeyType===`rsa`){let n;switch(t){case`RSA-OAEP`:n=`SHA-1`;break;case`RS256`:case`PS256`:case`RSA-OAEP-256`:n=`SHA-256`;break;case`RS384`:case`PS384`:case`RSA-OAEP-384`:n=`SHA-384`;break;case`RS512`:case`PS512`:case`RSA-OAEP-512`:n=`SHA-512`;break;default:throw TypeError(`given KeyObject instance cannot be used for this algorithm`)}if(t.startsWith(`RSA-OAEP`))return e.toCryptoKey({name:`RSA-OAEP`,hash:n},i,r?[`encrypt`]:[`decrypt`]);a=e.toCryptoKey({name:t.startsWith(`PS`)?`RSA-PSS`:`RSASSA-PKCS1-v1_5`,hash:n},i,[r?`verify`:`sign`])}if(e.asymmetricKeyType===`ec`){let n=new Map([[`prime256v1`,`P-256`],[`secp384r1`,`P-384`],[`secp521r1`,`P-521`]]).get(e.asymmetricKeyDetails?.namedCurve);if(!n)throw TypeError(`given KeyObject instance cannot be used for this algorithm`);t===`ES256`&&n===`P-256`&&(a=e.toCryptoKey({name:`ECDSA`,namedCurve:n},i,[r?`verify`:`sign`])),t===`ES384`&&n===`P-384`&&(a=e.toCryptoKey({name:`ECDSA`,namedCurve:n},i,[r?`verify`:`sign`])),t===`ES512`&&n===`P-521`&&(a=e.toCryptoKey({name:`ECDSA`,namedCurve:n},i,[r?`verify`:`sign`])),t.startsWith(`ECDH-ES`)&&(a=e.toCryptoKey({name:`ECDH`,namedCurve:n},i,r?[]:[`deriveBits`]))}if(!a)throw TypeError(`given KeyObject instance cannot be used for this algorithm`);return n?n[t]=a:rb.set(e,{[t]:a}),a};var ob=async(e,t)=>{if(e instanceof Uint8Array||dy(e))return e;if(fy(e)){if(e.type===`secret`)return e.export();if(`toCryptoKey`in e&&typeof e.toCryptoKey==`function`)try{return ab(e,t)}catch(e){if(e instanceof TypeError)throw e}return ib(e,e.export({format:`jwk`}),t)}if($y(e))return e.k?Pv(e.k):ib(e,e,t,!0);throw Error(`unreachable`)};const sb=e=>e?.[Symbol.toStringTag],cb=(e,t,n)=>{if(t.use!==void 0){let e;switch(n){case`sign`:case`verify`:e=`sig`;break;case`encrypt`:case`decrypt`:e=`enc`;break}if(t.use!==e)throw TypeError(`Invalid key for this operation, its "use" must be "${e}" when present`)}if(t.alg!==void 0&&t.alg!==e)throw TypeError(`Invalid key for this operation, its "alg" must be "${e}" when present`);if(Array.isArray(t.key_ops)){let r;switch(!0){case n===`sign`||n===`verify`:case e===`dir`:case e.includes(`CBC-HS`):r=n;break;case e.startsWith(`PBES2`):r=`deriveBits`;break;case/^A\d{3}(?:GCM)?(?:KW)?$/.test(e):r=!e.includes(`GCM`)&&e.endsWith(`KW`)?n===`encrypt`?`wrapKey`:`unwrapKey`:n;break;case n===`encrypt`&&e.startsWith(`RSA`):r=`wrapKey`;break;case n===`decrypt`:r=e.startsWith(`RSA`)?`unwrapKey`:`deriveBits`;break}if(r&&t.key_ops?.includes?.(r)===!1)throw TypeError(`Invalid key for this operation, its "key_ops" must include "${r}" when present`)}return!0},lb=(e,t,n)=>{if(!(t instanceof Uint8Array)){if($y(t)){if(nb(t)&&cb(e,t,n))return;throw TypeError(`JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present`)}if(!py(t))throw TypeError(ly(e,t,`CryptoKey`,`KeyObject`,`JSON Web Key`,`Uint8Array`));if(t.type!==`secret`)throw TypeError(`${sb(t)} instances for symmetric algorithms must be of type "secret"`)}},ub=(e,t,n)=>{if($y(t))switch(n){case`decrypt`:case`sign`:if(eb(t)&&cb(e,t,n))return;throw TypeError(`JSON Web Key for this operation be a private JWK`);case`encrypt`:case`verify`:if(tb(t)&&cb(e,t,n))return;throw TypeError(`JSON Web Key for this operation be a public JWK`)}if(!py(t))throw TypeError(ly(e,t,`CryptoKey`,`KeyObject`,`JSON Web Key`));if(t.type===`secret`)throw TypeError(`${sb(t)} instances for asymmetric algorithms must not be of type "secret"`);if(t.type===`public`)switch(n){case`sign`:throw TypeError(`${sb(t)} instances for asymmetric algorithm signing must be of type "private"`);case`decrypt`:throw TypeError(`${sb(t)} instances for asymmetric algorithm decryption must be of type "private"`);default:break}if(t.type===`private`)switch(n){case`verify`:throw TypeError(`${sb(t)} instances for asymmetric algorithm verifying must be of type "public"`);case`encrypt`:throw TypeError(`${sb(t)} instances for asymmetric algorithm encryption must be of type "public"`);default:break}};var db=(e,t,n)=>{e.startsWith(`HS`)||e===`dir`||e.startsWith(`PBES2`)||/^A(?:128|192|256)(?:GCM)?(?:KW)?$/.test(e)||/^A(?:128|192|256)CBC-HS(?:256|384|512)$/.test(e)?lb(e,t,n):ub(e,t,n)};async function fb(e,t,n){if(!by(e))throw new X(`Flattened JWE must be an object`);if(e.protected===void 0&&e.header===void 0&&e.unprotected===void 0)throw new X(`JOSE Header missing`);if(e.iv!==void 0&&typeof e.iv!=`string`)throw new X(`JWE Initialization Vector incorrect type`);if(typeof e.ciphertext!=`string`)throw new X(`JWE Ciphertext missing or incorrect type`);if(e.tag!==void 0&&typeof e.tag!=`string`)throw new X(`JWE Authentication Tag incorrect type`);if(e.protected!==void 0&&typeof e.protected!=`string`)throw new X(`JWE Protected Header incorrect type`);if(e.encrypted_key!==void 0&&typeof e.encrypted_key!=`string`)throw new X(`JWE Encrypted Key incorrect type`);if(e.aad!==void 0&&typeof e.aad!=`string`)throw new X(`JWE AAD incorrect type`);if(e.header!==void 0&&!by(e.header))throw new X(`JWE Shared Unprotected Header incorrect type`);if(e.unprotected!==void 0&&!by(e.unprotected))throw new X(`JWE Per-Recipient Unprotected Header incorrect type`);let r;if(e.protected)try{let t=Pv(e.protected);r=JSON.parse(Ev.decode(t))}catch{throw new X(`JWE Protected Header is invalid`)}if(!vy(r,e.header,e.unprotected))throw new X(`JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint`);let i={...r,...e.header,...e.unprotected};if(Zy(X,new Map,n?.crit,r,i),i.zip!==void 0)throw new Bv(`JWE "zip" (Compression Algorithm) Header Parameter is not supported.`);let{alg:a,enc:o}=i;if(typeof a!=`string`||!a)throw new X(`missing JWE Algorithm (alg) in JWE Header`);if(typeof o!=`string`||!o)throw new X(`missing JWE Encryption Algorithm (enc) in JWE Header`);let s=n&&Qy(`keyManagementAlgorithms`,n.keyManagementAlgorithms),c=n&&Qy(`contentEncryptionAlgorithms`,n.contentEncryptionAlgorithms);if(s&&!s.has(a)||!s&&a.startsWith(`PBES2`))throw new zv(`"alg" (Algorithm) Header Parameter value not allowed`);if(c&&!c.has(o))throw new zv(`"enc" (Encryption Algorithm) Header Parameter value not allowed`);let l;if(e.encrypted_key!==void 0)try{l=Pv(e.encrypted_key)}catch{throw new X(`Failed to base64url decode the encrypted_key`)}let u=!1;typeof t==`function`&&(t=await t(r,e),u=!0),db(a===`dir`?o:a,t,`decrypt`);let d=await ob(t,a),f;try{f=await Xy(a,d,l,i,n)}catch(e){if(e instanceof TypeError||e instanceof X||e instanceof Bv)throw e;f=Vy(o)}let p,m;if(e.iv!==void 0)try{p=Pv(e.iv)}catch{throw new X(`Failed to base64url decode the iv`)}if(e.tag!==void 0)try{m=Pv(e.tag)}catch{throw new X(`Failed to base64url decode the tag`)}let h=Tv.encode(e.protected??``),g;g=e.aad===void 0?h:Ov(h,Tv.encode(`.`),Tv.encode(e.aad));let _;try{_=Pv(e.ciphertext)}catch{throw new X(`Failed to base64url decode the ciphertext`)}let v={plaintext:await _y(o,f,_,p,m,g)};if(e.protected!==void 0&&(v.protectedHeader=r),e.aad!==void 0)try{v.additionalAuthenticatedData=Pv(e.aad)}catch{throw new X(`Failed to base64url decode the aad`)}return e.unprotected!==void 0&&(v.sharedUnprotectedHeader=e.unprotected),e.header!==void 0&&(v.unprotectedHeader=e.header),u?{...v,key:d}:v}async function pb(e,t,n){if(e instanceof Uint8Array&&(e=Ev.decode(e)),typeof e!=`string`)throw new X(`Compact JWE must be a string or Uint8Array`);let{0:r,1:i,2:a,3:o,4:s,length:c}=e.split(`.`);if(c!==5)throw new X(`Invalid Compact JWE`);let l=await fb({ciphertext:o,iv:a||void 0,protected:r,tag:s||void 0,encrypted_key:i||void 0},t,n),u={plaintext:l.plaintext,protectedHeader:l.protectedHeader};return typeof t==`function`?{...u,key:l.key}:u}const mb=Symbol();async function hb(e){if(fy(e))if(e.type===`secret`)e=e.export();else return e.export({format:`jwk`});if(e instanceof Uint8Array)return{kty:`oct`,k:Fv(e)};if(!dy(e))throw TypeError(cy(e,`CryptoKey`,`KeyObject`,`Uint8Array`));if(!e.extractable)throw TypeError(`non-extractable CryptoKey cannot be exported as a JWK`);let{ext:t,key_ops:n,alg:r,use:i,...a}=await crypto.subtle.exportKey(`jwk`,e);return a.kty===`AKP`&&(a.alg=r),a}async function gb(e){return hb(e)}var _b=async(e,t,n,r,i={})=>{let a,o,s;switch(e){case`dir`:s=n;break;case`ECDH-ES`:case`ECDH-ES+A128KW`:case`ECDH-ES+A192KW`:case`ECDH-ES+A256KW`:{if(uy(n),!Ay(n))throw new Bv(`ECDH with the provided key is not allowed or not supported by your javascript runtime`);let{apu:c,apv:l}=i,u;u=i.epk?await ob(i.epk,e):(await crypto.subtle.generateKey(n.algorithm,!0,[`deriveBits`])).privateKey;let{x:d,y:f,crv:p,kty:m}=await gb(u),h=await Oy(n,u,e===`ECDH-ES`?t:e,e===`ECDH-ES`?By(t):parseInt(e.slice(-5,-2),10),c,l);if(o={epk:{x:d,crv:p,kty:m}},m===`EC`&&(o.epk.y=f),c&&(o.apu=Fv(c)),l&&(o.apv=Fv(l)),e===`ECDH-ES`){s=h;break}s=r||Vy(t),a=await Cy(e.slice(-6),h,s);break}case`RSA-OAEP`:case`RSA-OAEP-256`:case`RSA-OAEP-384`:case`RSA-OAEP-512`:s=r||Vy(t),uy(n),a=await Ry(e,n,s);break;case`PBES2-HS256+A128KW`:case`PBES2-HS384+A192KW`:case`PBES2-HS512+A256KW`:{s=r||Vy(t);let{p2c:c,p2s:l}=i;({encryptedKey:a,...o}=await Py(e,n,s,c,l));break}case`A128KW`:case`A192KW`:case`A256KW`:s=r||Vy(t),a=await Cy(e,n,s);break;case`A128GCMKW`:case`A192GCMKW`:case`A256GCMKW`:{s=r||Vy(t);let{iv:c}=i;({encryptedKey:a,...o}=await Jy(e,n,s,c));break}default:throw new Bv(`Invalid or unsupported "alg" (JWE Algorithm) header value`)}return{cek:s,encryptedKey:a,parameters:o}},vb=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){if(!(e instanceof Uint8Array))throw TypeError(`plaintext must be an instance of Uint8Array`);this.#e=e}setKeyManagementParameters(e){if(this.#s)throw TypeError(`setKeyManagementParameters can only be called once`);return this.#s=e,this}setProtectedHeader(e){if(this.#t)throw TypeError(`setProtectedHeader can only be called once`);return this.#t=e,this}setSharedUnprotectedHeader(e){if(this.#n)throw TypeError(`setSharedUnprotectedHeader can only be called once`);return this.#n=e,this}setUnprotectedHeader(e){if(this.#r)throw TypeError(`setUnprotectedHeader can only be called once`);return this.#r=e,this}setAdditionalAuthenticatedData(e){return this.#i=e,this}setContentEncryptionKey(e){if(this.#a)throw TypeError(`setContentEncryptionKey can only be called once`);return this.#a=e,this}setInitializationVector(e){if(this.#o)throw TypeError(`setInitializationVector can only be called once`);return this.#o=e,this}async encrypt(e,t){if(!this.#t&&!this.#r&&!this.#n)throw new X(`either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()`);if(!vy(this.#t,this.#r,this.#n))throw new X(`JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint`);let n={...this.#t,...this.#r,...this.#n};if(Zy(X,new Map,t?.crit,this.#t,n),n.zip!==void 0)throw new Bv(`JWE "zip" (Compression Algorithm) Header Parameter is not supported.`);let{alg:r,enc:i}=n;if(typeof r!=`string`||!r)throw new X(`JWE "alg" (Algorithm) Header Parameter missing or invalid`);if(typeof i!=`string`||!i)throw new X(`JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid`);let a;if(this.#a&&(r===`dir`||r===`ECDH-ES`))throw TypeError(`setContentEncryptionKey cannot be called with JWE "alg" (Algorithm) Header ${r}`);db(r===`dir`?i:r,e,`encrypt`);let o;{let n,s=await ob(e,r);({cek:o,encryptedKey:a,parameters:n}=await _b(r,i,s,this.#a,this.#s)),n&&(t&&mb in t?this.#r?this.#r={...this.#r,...n}:this.setUnprotectedHeader(n):this.#t?this.#t={...this.#t,...n}:this.setProtectedHeader(n))}let s,c,l;c=this.#t?Tv.encode(Fv(JSON.stringify(this.#t))):Tv.encode(``),this.#i?(l=Fv(this.#i),s=Ov(c,Tv.encode(`.`),Tv.encode(l))):s=c;let{ciphertext:u,tag:d,iv:f}=await qy(i,this.#e,o,this.#o,s),p={ciphertext:Fv(u)};return f&&(p.iv=Fv(f)),d&&(p.tag=Fv(d)),a&&(p.encrypted_key=Fv(a)),l&&(p.aad=l),this.#t&&(p.protected=Ev.decode(c)),this.#n&&(p.unprotected=this.#n),this.#r&&(p.header=this.#r),p}},yb=(e,t)=>{let n=`SHA-${e.slice(-3)}`;switch(e){case`HS256`:case`HS384`:case`HS512`:return{hash:n,name:`HMAC`};case`PS256`:case`PS384`:case`PS512`:return{hash:n,name:`RSA-PSS`,saltLength:parseInt(e.slice(-3),10)>>3};case`RS256`:case`RS384`:case`RS512`:return{hash:n,name:`RSASSA-PKCS1-v1_5`};case`ES256`:case`ES384`:case`ES512`:return{hash:n,name:`ECDSA`,namedCurve:t.namedCurve};case`Ed25519`:case`EdDSA`:return{name:`Ed25519`};case`ML-DSA-44`:case`ML-DSA-65`:case`ML-DSA-87`:return{name:e};default:throw new Bv(`alg ${e} is not supported either by JOSE or your javascript runtime`)}},bb=async(e,t,n)=>{if(t instanceof Uint8Array){if(!e.startsWith(`HS`))throw TypeError(cy(t,`CryptoKey`,`KeyObject`,`JSON Web Key`));return crypto.subtle.importKey(`raw`,t,{hash:`SHA-${e.slice(-3)}`,name:`HMAC`},!1,[n])}return ay(t,e,n),t},xb=async(e,t,n,r)=>{let i=await bb(e,t,`verify`);Iy(e,i);let a=yb(e,i.algorithm);try{return await crypto.subtle.verify(a,i,n,r)}catch{return!1}};async function Sb(e,t,n){if(!by(e))throw new Hv(`Flattened JWS must be an object`);if(e.protected===void 0&&e.header===void 0)throw new Hv(`Flattened JWS must have either of the "protected" or "header" members`);if(e.protected!==void 0&&typeof e.protected!=`string`)throw new Hv(`JWS Protected Header incorrect type`);if(e.payload===void 0)throw new Hv(`JWS Payload missing`);if(typeof e.signature!=`string`)throw new Hv(`JWS Signature missing or incorrect type`);if(e.header!==void 0&&!by(e.header))throw new Hv(`JWS Unprotected Header incorrect type`);let r={};if(e.protected)try{let t=Pv(e.protected);r=JSON.parse(Ev.decode(t))}catch{throw new Hv(`JWS Protected Header is invalid`)}if(!vy(r,e.header))throw new Hv(`JWS Protected and JWS Unprotected Header Parameter names must be disjoint`);let i={...r,...e.header},a=Zy(Hv,new Map([[`b64`,!0]]),n?.crit,r,i),o=!0;if(a.has(`b64`)&&(o=r.b64,typeof o!=`boolean`))throw new Hv(`The "b64" (base64url-encode payload) Header Parameter must be a boolean`);let{alg:s}=i;if(typeof s!=`string`||!s)throw new Hv(`JWS "alg" (Algorithm) Header Parameter missing or invalid`);let c=n&&Qy(`algorithms`,n.algorithms);if(c&&!c.has(s))throw new zv(`"alg" (Algorithm) Header Parameter value not allowed`);if(o){if(typeof e.payload!=`string`)throw new Hv(`JWS Payload must be a string`)}else if(typeof e.payload!=`string`&&!(e.payload instanceof Uint8Array))throw new Hv(`JWS Payload must be a string or an Uint8Array instance`);let l=!1;typeof t==`function`&&(t=await t(r,e),l=!0),db(s,t,`verify`);let u=Ov(Tv.encode(e.protected??``),Tv.encode(`.`),typeof e.payload==`string`?Tv.encode(e.payload):e.payload),d;try{d=Pv(e.signature)}catch{throw new Hv(`Failed to base64url decode the signature`)}let f=await ob(t,s);if(!await xb(s,f,d,u))throw new Yv;let p;if(o)try{p=Pv(e.payload)}catch{throw new Hv(`Failed to base64url decode the payload`)}else p=typeof e.payload==`string`?Tv.encode(e.payload):e.payload;let m={payload:p};return e.protected!==void 0&&(m.protectedHeader=r),e.header!==void 0&&(m.unprotectedHeader=e.header),l?{...m,key:f}:m}async function Cb(e,t,n){if(e instanceof Uint8Array&&(e=Ev.decode(e)),typeof e!=`string`)throw new Hv(`Compact JWS must be a string or Uint8Array`);let{0:r,1:i,2:a,length:o}=e.split(`.`);if(o!==3)throw new Hv(`Invalid Compact JWS`);let s=await Sb({payload:i,protected:r,signature:a},t,n),c={payload:s.payload,protectedHeader:s.protectedHeader};return typeof t==`function`?{...c,key:s.key}:c}var wb=e=>Math.floor(e.getTime()/1e3);const Tb=3600,Eb=Tb*24;Eb*7,Eb*365.25;const Db=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;var Ob=e=>{let t=Db.exec(e);if(!t||t[4]&&t[1])throw TypeError(`Invalid time period format`);let n=parseFloat(t[2]),r=t[3].toLowerCase(),i;switch(r){case`sec`:case`secs`:case`second`:case`seconds`:case`s`:i=Math.round(n);break;case`minute`:case`minutes`:case`min`:case`mins`:case`m`:i=Math.round(n*60);break;case`hour`:case`hours`:case`hr`:case`hrs`:case`h`:i=Math.round(n*Tb);break;case`day`:case`days`:case`d`:i=Math.round(n*Eb);break;case`week`:case`weeks`:case`w`:i=Math.round(n*604800);break;default:i=Math.round(n*31557600);break}return t[1]===`-`||t[4]===`ago`?-i:i};function kb(e,t){if(!Number.isFinite(t))throw TypeError(`Invalid ${e} input`);return t}const Ab=e=>e.includes(`/`)?e.toLowerCase():`application/${e.toLowerCase()}`,jb=(e,t)=>typeof e==`string`?t.includes(e):Array.isArray(e)?t.some(Set.prototype.has.bind(new Set(e))):!1;function Mb(e,t,n={}){let r;try{r=JSON.parse(Ev.decode(t))}catch{}if(!by(r))throw new Uv(`JWT Claims Set must be a top-level JSON object`);let{typ:i}=n;if(i&&(typeof e.typ!=`string`||Ab(e.typ)!==Ab(i)))throw new Lv(`unexpected "typ" JWT header value`,r,`typ`,`check_failed`);let{requiredClaims:a=[],issuer:o,subject:s,audience:c,maxTokenAge:l}=n,u=[...a];l!==void 0&&u.push(`iat`),c!==void 0&&u.push(`aud`),s!==void 0&&u.push(`sub`),o!==void 0&&u.push(`iss`);for(let e of new Set(u.reverse()))if(!(e in r))throw new Lv(`missing required "${e}" claim`,r,e,`missing`);if(o&&!(Array.isArray(o)?o:[o]).includes(r.iss))throw new Lv(`unexpected "iss" claim value`,r,`iss`,`check_failed`);if(s&&r.sub!==s)throw new Lv(`unexpected "sub" claim value`,r,`sub`,`check_failed`);if(c&&!jb(r.aud,typeof c==`string`?[c]:c))throw new Lv(`unexpected "aud" claim value`,r,`aud`,`check_failed`);let d;switch(typeof n.clockTolerance){case`string`:d=Ob(n.clockTolerance);break;case`number`:d=n.clockTolerance;break;case`undefined`:d=0;break;default:throw TypeError(`Invalid clockTolerance option type`)}let{currentDate:f}=n,p=wb(f||new Date);if((r.iat!==void 0||l)&&typeof r.iat!=`number`)throw new Lv(`"iat" claim must be a number`,r,`iat`,`invalid`);if(r.nbf!==void 0){if(typeof r.nbf!=`number`)throw new Lv(`"nbf" claim must be a number`,r,`nbf`,`invalid`);if(r.nbf>p+d)throw new Lv(`"nbf" claim timestamp check failed`,r,`nbf`,`check_failed`)}if(r.exp!==void 0){if(typeof r.exp!=`number`)throw new Lv(`"exp" claim must be a number`,r,`exp`,`invalid`);if(r.exp<=p-d)throw new Rv(`"exp" claim timestamp check failed`,r,`exp`,`check_failed`)}if(l){let e=p-r.iat,t=typeof l==`number`?l:Ob(l);if(e-d>t)throw new Rv(`"iat" claim timestamp check failed (too far in the past)`,r,`iat`,`check_failed`);if(e<0-d)throw new Lv(`"iat" claim timestamp check failed (it should be in the past)`,r,`iat`,`check_failed`)}return r}var Nb=class{#e;constructor(e){if(!by(e))throw TypeError(`JWT Claims Set MUST be an object`);this.#e=structuredClone(e)}data(){return Tv.encode(JSON.stringify(this.#e))}get iss(){return this.#e.iss}set iss(e){this.#e.iss=e}get sub(){return this.#e.sub}set sub(e){this.#e.sub=e}get aud(){return this.#e.aud}set aud(e){this.#e.aud=e}set jti(e){this.#e.jti=e}set nbf(e){typeof e==`number`?this.#e.nbf=kb(`setNotBefore`,e):e instanceof Date?this.#e.nbf=kb(`setNotBefore`,wb(e)):this.#e.nbf=wb(new Date)+Ob(e)}set exp(e){typeof e==`number`?this.#e.exp=kb(`setExpirationTime`,e):e instanceof Date?this.#e.exp=kb(`setExpirationTime`,wb(e)):this.#e.exp=wb(new Date)+Ob(e)}set iat(e){e===void 0?this.#e.iat=wb(new Date):e instanceof Date?this.#e.iat=kb(`setIssuedAt`,wb(e)):typeof e==`string`?this.#e.iat=kb(`setIssuedAt`,wb(new Date)+Ob(e)):this.#e.iat=kb(`setIssuedAt`,e)}};async function Pb(e,t,n){let r=await Cb(e,t,n);if(r.protectedHeader.crit?.includes(`b64`)&&r.protectedHeader.b64===!1)throw new Uv(`JWTs MUST NOT use unencoded payload`);let i={payload:Mb(r.protectedHeader,r.payload,n),protectedHeader:r.protectedHeader};return typeof t==`function`?{...i,key:r.key}:i}async function Fb(e,t,n){let r=await pb(e,t,n),i=Mb(r.protectedHeader,r.plaintext,n),{protectedHeader:a}=r;if(a.iss!==void 0&&a.iss!==i.iss)throw new Lv(`replicated "iss" claim header parameter mismatch`,i,`iss`,`mismatch`);if(a.sub!==void 0&&a.sub!==i.sub)throw new Lv(`replicated "sub" claim header parameter mismatch`,i,`sub`,`mismatch`);if(a.aud!==void 0&&JSON.stringify(a.aud)!==JSON.stringify(i.aud))throw new Lv(`replicated "aud" claim header parameter mismatch`,i,`aud`,`mismatch`);let o={payload:i,protectedHeader:a};return typeof t==`function`?{...o,key:r.key}:o}var Ib=class{#e;constructor(e){this.#e=new vb(e)}setContentEncryptionKey(e){return this.#e.setContentEncryptionKey(e),this}setInitializationVector(e){return this.#e.setInitializationVector(e),this}setProtectedHeader(e){return this.#e.setProtectedHeader(e),this}setKeyManagementParameters(e){return this.#e.setKeyManagementParameters(e),this}async encrypt(e,t){let n=await this.#e.encrypt(e,t);return[n.protected,n.encrypted_key,n.iv,n.ciphertext,n.tag].join(`.`)}},Lb=async(e,t,n)=>{let r=await bb(e,t,`sign`);Iy(e,r);let i=await crypto.subtle.sign(yb(e,r.algorithm),r,n);return new Uint8Array(i)},Rb=class{#e;#t;#n;constructor(e){if(!(e instanceof Uint8Array))throw TypeError(`payload must be an instance of Uint8Array`);this.#e=e}setProtectedHeader(e){if(this.#t)throw TypeError(`setProtectedHeader can only be called once`);return this.#t=e,this}setUnprotectedHeader(e){if(this.#n)throw TypeError(`setUnprotectedHeader can only be called once`);return this.#n=e,this}async sign(e,t){if(!this.#t&&!this.#n)throw new Hv(`either setProtectedHeader or setUnprotectedHeader must be called before #sign()`);if(!vy(this.#t,this.#n))throw new Hv(`JWS Protected and JWS Unprotected Header Parameter names must be disjoint`);let n={...this.#t,...this.#n},r=Zy(Hv,new Map([[`b64`,!0]]),t?.crit,this.#t,n),i=!0;if(r.has(`b64`)&&(i=this.#t.b64,typeof i!=`boolean`))throw new Hv(`The "b64" (base64url-encode payload) Header Parameter must be a boolean`);let{alg:a}=n;if(typeof a!=`string`||!a)throw new Hv(`JWS "alg" (Algorithm) Header Parameter missing or invalid`);db(a,e,`sign`);let o=this.#e;i&&(o=Tv.encode(Fv(o)));let s;s=this.#t?Tv.encode(Fv(JSON.stringify(this.#t))):Tv.encode(``);let c=Ov(s,Tv.encode(`.`),o),l={signature:Fv(await Lb(a,await ob(e,a),c)),payload:``};return i&&(l.payload=Ev.decode(o)),this.#n&&(l.header=this.#n),this.#t&&(l.protected=Ev.decode(s)),l}},zb=class{#e;constructor(e){this.#e=new Rb(e)}setProtectedHeader(e){return this.#e.setProtectedHeader(e),this}async sign(e,t){let n=await this.#e.sign(e,t);if(n.payload===void 0)throw TypeError(`use the flattened module for creating JWS with b64: false`);return`${n.protected}.${n.payload}.${n.signature}`}},Bb=class{#e;#t;constructor(e={}){this.#t=new Nb(e)}setIssuer(e){return this.#t.iss=e,this}setSubject(e){return this.#t.sub=e,this}setAudience(e){return this.#t.aud=e,this}setJti(e){return this.#t.jti=e,this}setNotBefore(e){return this.#t.nbf=e,this}setExpirationTime(e){return this.#t.exp=e,this}setIssuedAt(e){return this.#t.iat=e,this}setProtectedHeader(e){return this.#e=e,this}async sign(e,t){let n=new zb(this.#t.data());if(n.setProtectedHeader(this.#e),Array.isArray(this.#e?.crit)&&this.#e.crit.includes(`b64`)&&this.#e.b64===!1)throw new Uv(`JWTs MUST NOT use unencoded payload`);return n.sign(e,t)}},Vb=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#s=new Nb(e)}setIssuer(e){return this.#s.iss=e,this}setSubject(e){return this.#s.sub=e,this}setAudience(e){return this.#s.aud=e,this}setJti(e){return this.#s.jti=e,this}setNotBefore(e){return this.#s.nbf=e,this}setExpirationTime(e){return this.#s.exp=e,this}setIssuedAt(e){return this.#s.iat=e,this}setProtectedHeader(e){if(this.#r)throw TypeError(`setProtectedHeader can only be called once`);return this.#r=e,this}setKeyManagementParameters(e){if(this.#n)throw TypeError(`setKeyManagementParameters can only be called once`);return this.#n=e,this}setContentEncryptionKey(e){if(this.#e)throw TypeError(`setContentEncryptionKey can only be called once`);return this.#e=e,this}setInitializationVector(e){if(this.#t)throw TypeError(`setInitializationVector can only be called once`);return this.#t=e,this}replicateIssuerAsHeader(){return this.#i=!0,this}replicateSubjectAsHeader(){return this.#a=!0,this}replicateAudienceAsHeader(){return this.#o=!0,this}async encrypt(e,t){let n=new Ib(this.#s.data());return this.#r&&(this.#i||this.#a||this.#o)&&(this.#r={...this.#r,iss:this.#i?this.#s.iss:void 0,sub:this.#a?this.#s.sub:void 0,aud:this.#o?this.#s.aud:void 0}),n.setProtectedHeader(this.#r),this.#t&&n.setInitializationVector(this.#t),this.#e&&n.setContentEncryptionKey(this.#e),this.#n&&n.setKeyManagementParameters(this.#n),n.encrypt(e,t)}};const Hb=(e,t)=>{if(typeof e!=`string`||!e)throw new Wv(`${t} missing or invalid`)};async function Ub(e,t){let n;if($y(e))n=e;else if(py(e))n=await gb(e);else throw TypeError(cy(e,`CryptoKey`,`KeyObject`,`JSON Web Key`));if(t??=`sha256`,t!==`sha256`&&t!==`sha384`&&t!==`sha512`)throw TypeError(`digestAlgorithm must one of "sha256", "sha384", or "sha512"`);let r;switch(n.kty){case`AKP`:Hb(n.alg,`"alg" (Algorithm) Parameter`),Hb(n.pub,`"pub" (Public key) Parameter`),r={alg:n.alg,kty:n.kty,pub:n.pub};break;case`EC`:Hb(n.crv,`"crv" (Curve) Parameter`),Hb(n.x,`"x" (X Coordinate) Parameter`),Hb(n.y,`"y" (Y Coordinate) Parameter`),r={crv:n.crv,kty:n.kty,x:n.x,y:n.y};break;case`OKP`:Hb(n.crv,`"crv" (Subtype of Key Pair) Parameter`),Hb(n.x,`"x" (Public Key) Parameter`),r={crv:n.crv,kty:n.kty,x:n.x};break;case`RSA`:Hb(n.e,`"e" (Exponent) Parameter`),Hb(n.n,`"n" (Modulus) Parameter`),r={e:n.e,kty:n.kty,n:n.n};break;case`oct`:Hb(n.k,`"k" (Key Value) Parameter`),r={k:n.k,kty:n.kty};break;default:throw new Bv(`"kty" (Key Type) Parameter missing or unsupported`)}let i=Tv.encode(JSON.stringify(r));return Fv(await Ty(t,i))}async function Wb(e,t,n=3600){return await new Bb(e).setProtectedHeader({alg:`HS256`}).setIssuedAt().setExpirationTime(Math.floor(Date.now()/1e3)+n).sign(new TextEncoder().encode(t))}async function Gb(e,t){try{return(await Pb(e,new TextEncoder().encode(t))).payload}catch{return null}}const Kb=new Uint8Array([66,101,116,116,101,114,65,117,116,104,46,106,115,32,71,101,110,101,114,97,116,101,100,32,69,110,99,114,121,112,116,105,111,110,32,75,101,121]),qb=()=>Date.now()/1e3|0,Jb=`A256CBC-HS512`;async function Yb(e,t,n,r=3600){let i=wv(ut,new TextEncoder().encode(t),new TextEncoder().encode(n),Kb,64),a=await Ub({kty:`oct`,k:Fv(i)},`sha256`);return await new Vb(e).setProtectedHeader({alg:`dir`,enc:Jb,kid:a}).setIssuedAt().setExpirationTime(qb()+r).setJti(crypto.randomUUID()).encrypt(i)}async function Xb(e,t,n){if(!e)return null;try{let{payload:r}=await Fb(e,async({kid:e})=>{let r=wv(ut,new TextEncoder().encode(t),new TextEncoder().encode(n),Kb,64);if(e===void 0||e===await Ub({kty:`oct`,k:Fv(r)},`sha256`))return r;throw Error(`no matching decryption secret`)},{clockTolerance:15,keyManagementAlgorithms:[`dir`],contentEncryptionAlgorithms:[Jb,`A256GCM`]});return r}catch{return null}}function Zb(e,t,n){return n===`update`?e===void 0&&t.onUpdate!==void 0?typeof t.onUpdate==`function`?t.onUpdate():t.onUpdate:e:n===`create`&&(e===void 0||t.required===!0&&e===null)&&t.defaultValue!==void 0?typeof t.defaultValue==`function`?t.defaultValue():t.defaultValue:e}let Qb=[],$b=-1;const ex=e=>t=>t(e),tx=({adapter:e,config:n})=>r=>{let a=Math.random().toString(36).substring(2,15),o={...n,supportsBooleans:n.supportsBooleans??!0,supportsDates:n.supportsDates??!0,supportsJSON:n.supportsJSON??!1,adapterName:n.adapterName??n.adapterId,supportsNumericIds:n.supportsNumericIds??!0,supportsUUIDs:n.supportsUUIDs??!1,transaction:n.transaction??!1,disableTransformInput:n.disableTransformInput??!1,disableTransformOutput:n.disableTransformOutput??!1};if((r.advanced?.database?.useNumberId===!0||r.advanced?.database?.generateId===`serial`)&&o.supportsNumericIds===!1)throw new i(`[${o.adapterName}] Your database or database adapter does not support numeric ids. Please disable "useNumberId" in your config.`);let s=t(r),c=({field:e,model:t})=>{if(e===`id`||e===`_id`)return`id`;let n=l(t),r=s[n]?.fields[e];if(!r){let t=Object.entries(s[n].fields).find(([t,n])=>n.fieldName===e);t&&(r=t[1],e=t[0])}if(!r)throw f(`Field ${e} not found in model ${n}`),f(`Schema:`,s),new i(`Field ${e} not found in model ${n}`);return e},l=e=>{if(o.usePlural&&e.charAt(e.length-1)===`s`){let t=e.slice(0,-1),n=s[t]?t:void 0;if(n||=Object.entries(s).find(([e,n])=>n.modelName===t)?.[0],n)return n}let t=s[e]?e:void 0;if(t||=Object.entries(s).find(([t,n])=>n.modelName===e)?.[0],!t)throw f(`Model "${e}" not found in schema`),f(`Schema:`,s),new i(`Model "${e}" not found in schema`);return t},u=e=>{let t=l(e),n=o&&o.usePlural;return s&&s[t]&&s[t].modelName!==e?n?`${s[t].modelName}s`:s[t].modelName:n?`${e}s`:e};function d({model:e,field:t}){let n=l(e),r=c({model:n,field:t});return s[n]?.fields[r]?.fieldName||r}let f=(...e)=>{if(o.debugLogs===!0||typeof o.debugLogs==`object`){if(typeof o.debugLogs==`object`&&`isRunningAdapterTests`in o.debugLogs){o.debugLogs.isRunningAdapterTests&&(e.shift(),Qb.push({instance:a,args:e}));return}if(typeof o.debugLogs==`object`&&o.debugLogs.logCondition&&!o.debugLogs.logCondition?.())return;if(typeof e[0]==`object`&&`method`in e[0]){let t=e.shift().method;if(typeof o.debugLogs==`object`&&(t===`create`&&!o.debugLogs.create||t===`update`&&!o.debugLogs.update||t===`updateMany`&&!o.debugLogs.updateMany||t===`findOne`&&!o.debugLogs.findOne||t===`findMany`&&!o.debugLogs.findMany||t===`delete`&&!o.debugLogs.delete||t===`deleteMany`&&!o.debugLogs.deleteMany||t===`count`&&!o.debugLogs.count))return;vv.info(`[${o.adapterName}]`,...e)}else vv.info(`[${o.adapterName}]`,...e)}},p=({customModelName:e,forceAllowId:t})=>{let n=r.advanced?.database?.useNumberId||r.advanced?.database?.generateId===`serial`,i=r.advanced?.database?.generateId===`uuid`,a=(()=>o.disableIdGeneration||n&&!t?!1:(i&&o.supportsUUIDs,!0))(),s=l(e??`id`);return{type:n?`number`:`string`,required:!!a,...a?{defaultValue(){if(o.disableIdGeneration)return;let e=r.advanced?.database?.generateId;if(r.advanced?.generateId!==void 0&&(vv.warn(`Your Better Auth config includes advanced.generateId which is deprecated. Please use advanced.database.generateId instead. This will be removed in future releases.`),e=r.advanced?.generateId),!(e===!1||n))return typeof e==`function`?e({model:s}):o.customIdGenerator?o.customIdGenerator({model:s}):e===`uuid`?crypto.randomUUID():Z_()}}:{},transform:{input:e=>{if(e){if(n){let t=Number(e);return isNaN(t)?void 0:t}if(i){if(a&&!t)return e;if(o.disableIdGeneration||o.supportsUUIDs)return;if(t&&typeof e==`string`){if(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e))return e;{let e=Error().stack?.split(`
84
+ `).filter((e,t)=>t!==1).join(`
85
+ `).replace(`Error:`,``);vv.warn("[Adapter Factory] - Invalid UUID value for field `id` provided when `forceAllowId` is true. Generating a new UUID.",e)}}return typeof e!=`string`&&!o.supportsUUIDs?crypto.randomUUID():void 0}return e}},output:e=>{if(e)return String(e)}}}},m=({model:e,field:t})=>{let n=l(e),r=c({field:t,model:n}),a=s[n].fields;a.id=p({customModelName:n});let o=a[r];if(!o)throw new i(`Field ${t} not found in model ${e}`);return o},h=async(e,t,n,i)=>{let a={},c=s[t].fields,l=o.mapKeysTransformInput??{},d=r.advanced?.database?.useNumberId||r.advanced?.database?.generateId===`serial`;for(let f in c.id=p({customModelName:t,forceAllowId:i&&`id`in e}),c){let i=e[f],p=c[f],m=l[f]||c[f].fieldName||f;if(i===void 0&&(p.defaultValue===void 0&&!p.transform?.input&&!(n===`update`&&p.onUpdate)||n===`update`&&!p.onUpdate))continue;if(p&&p.type===`date`&&!(i instanceof Date)&&typeof i==`string`)try{i=new Date(i)}catch{vv.error(`[Adapter Factory] Failed to convert string to date`,{value:i,field:f})}let h=Zb(i,p,n);p.transform?.input&&(h=await p.transform.input(h)),p.references?.field===`id`&&d?h=Array.isArray(h)?h.map(e=>e===null?null:Number(e)):h===null?null:Number(h):o.supportsJSON===!1&&typeof h==`object`&&p.type===`json`?h=JSON.stringify(h):o.supportsDates===!1&&h instanceof Date&&p.type===`date`?h=h.toISOString():o.supportsBooleans===!1&&typeof h==`boolean`&&(h=h?1:0),o.customTransformInput&&(h=o.customTransformInput({data:h,action:n,field:m,fieldAttributes:p,model:u(t),schema:s,options:r})),h!==void 0&&(a[m]=h)}return a},g=async(e,t,n=[])=>{if(!e)return null;let i=o.mapKeysTransformOutput??{},a={},c=s[t].fields,l=Object.entries(i).find(([e,t])=>t===`id`)?.[0];for(let d in c[l??`id`]={type:r.advanced?.database?.useNumberId||r.advanced?.database?.generateId===`serial`?`number`:`string`},c){if(n.length&&!n.includes(d))continue;let l=c[d];if(l){let c=l.fieldName||d,f=e[Object.entries(i).find(([e,t])=>t===c)?.[0]||c];l.transform?.output&&(f=await l.transform.output(f));let p=i[d]||d;c===`id`||l.references?.field===`id`?f!=null&&(f=String(f)):o.supportsJSON===!1&&typeof f==`string`&&l.type===`json`?f=yv(f):o.supportsDates===!1&&typeof f==`string`&&l.type===`date`?f=new Date(f):o.supportsBooleans===!1&&typeof f==`number`&&l.type===`boolean`&&(f=f===1),o.customTransformOutput&&(f=o.customTransformOutput({data:f,field:p,fieldAttributes:l,select:n,model:u(t),schema:s,options:r})),a[p]=f}}return a},_=({model:e,where:t})=>{if(!t)return;let n=o.mapKeysTransformInput??{};return t.map(t=>{let{field:a,value:s,operator:u=`eq`,connector:f=`AND`}=t;if(u===`in`&&!Array.isArray(s))throw new i(`Value must be an array`);let p=s,h=l(e),g=c({field:a,model:e}),_=n[g]||d({field:g,model:h}),v=m({field:g,model:h}),y=r.advanced?.database?.useNumberId||r.advanced?.database?.generateId===`serial`;if((g===`id`||v.references?.field===`id`)&&y&&(p=Array.isArray(s)?s.map(Number):Number(s)),v.type===`date`&&s instanceof Date&&!o.supportsDates&&(p=s.toISOString()),v.type===`boolean`&&typeof s==`boolean`&&!o.supportsBooleans&&(p=s?1:0),v.type===`json`&&typeof s==`object`&&!o.supportsJSON)try{p=JSON.stringify(s)}catch(e){throw Error(`Failed to stringify JSON value for field ${_}`,{cause:e})}return{operator:u,connector:f,field:_,value:p}})},v=e({options:r,schema:s,debugLog:f,getFieldName:d,getModelName:u,getDefaultModelName:l,getDefaultFieldName:c,getFieldAttributes:m,transformInput:h,transformOutput:g,transformWhereClause:_}),y=null,ee={transaction:async e=>(y||(o.transaction?(vv.debug(`[${o.adapterName}] - Using provided transaction implementation.`),y=o.transaction):y=ex(ee)),y(e)),create:async({data:e,model:t,select:n,forceAllowId:r=!1})=>{$b++;let i=$b,a=u(t);if(t=l(t),`id`in e&&e.id!==void 0&&!r){vv.warn(`[${o.adapterName}] - You are trying to create a record with an id. This is not allowed as we handle id generation for you, unless you pass in the \`forceAllowId\` parameter. The id will be ignored.`);let t=Error().stack?.split(`
86
+ `).filter((e,t)=>t!==1).join(`
87
+ `).replace(`Error:`,"Create method with `id` being called at:");console.log(t),e.id=void 0}f({method:`create`},`${Z(i)} ${Q(1,4)}`,`${$(`create`)} ${nx(`Unsafe Input`)}:`,{model:a,data:e});let s=e;o.disableTransformInput||(s=await h(e,t,`create`,r)),f({method:`create`},`${Z(i)} ${Q(2,4)}`,`${$(`create`)} ${nx(`Parsed Input`)}:`,{model:a,data:s});let c=await v.create({data:s,model:a});f({method:`create`},`${Z(i)} ${Q(3,4)}`,`${$(`create`)} ${nx(`DB Result`)}:`,{model:a,res:c});let d=c;return o.disableTransformOutput||(d=await g(c,t,n)),f({method:`create`},`${Z(i)} ${Q(4,4)}`,`${$(`create`)} ${nx(`Parsed Result`)}:`,{model:a,data:d}),d},update:async({model:e,where:t,update:n})=>{$b++;let r=$b;e=l(e);let i=u(e),a=_({model:e,where:t});f({method:`update`},`${Z(r)} ${Q(1,4)}`,`${$(`update`)} ${nx(`Unsafe Input`)}:`,{model:i,data:n});let s=n;o.disableTransformInput||(s=await h(n,e,`update`)),f({method:`update`},`${Z(r)} ${Q(2,4)}`,`${$(`update`)} ${nx(`Parsed Input`)}:`,{model:i,data:s});let c=await v.update({model:i,where:a,update:s});f({method:`update`},`${Z(r)} ${Q(3,4)}`,`${$(`update`)} ${nx(`DB Result`)}:`,{model:i,data:c});let d=c;return o.disableTransformOutput||(d=await g(c,e)),f({method:`update`},`${Z(r)} ${Q(4,4)}`,`${$(`update`)} ${nx(`Parsed Result`)}:`,{model:i,data:d}),d},updateMany:async({model:e,where:t,update:n})=>{$b++;let r=$b,i=u(e),a=_({model:e,where:t});e=l(e),f({method:`updateMany`},`${Z(r)} ${Q(1,4)}`,`${$(`updateMany`)} ${nx(`Unsafe Input`)}:`,{model:i,data:n});let s=n;o.disableTransformInput||(s=await h(n,e,`update`)),f({method:`updateMany`},`${Z(r)} ${Q(2,4)}`,`${$(`updateMany`)} ${nx(`Parsed Input`)}:`,{model:i,data:s});let c=await v.updateMany({model:i,where:a,update:s});return f({method:`updateMany`},`${Z(r)} ${Q(3,4)}`,`${$(`updateMany`)} ${nx(`DB Result`)}:`,{model:i,data:c}),f({method:`updateMany`},`${Z(r)} ${Q(4,4)}`,`${$(`updateMany`)} ${nx(`Parsed Result`)}:`,{model:i,data:c}),c},findOne:async({model:e,where:t,select:n})=>{$b++;let r=$b,i=u(e),a=_({model:e,where:t});e=l(e),f({method:`findOne`},`${Z(r)} ${Q(1,3)}`,`${$(`findOne`)}:`,{model:i,where:a,select:n});let s=await v.findOne({model:i,where:a,select:n});f({method:`findOne`},`${Z(r)} ${Q(2,3)}`,`${$(`findOne`)} ${nx(`DB Result`)}:`,{model:i,data:s});let c=s;return o.disableTransformOutput||(c=await g(s,e,n)),f({method:`findOne`},`${Z(r)} ${Q(3,3)}`,`${$(`findOne`)} ${nx(`Parsed Result`)}:`,{model:i,data:c}),c},findMany:async({model:e,where:t,limit:n,sortBy:i,offset:a})=>{$b++;let s=$b,c=n??r.advanced?.database?.defaultFindManyLimit??100,d=u(e),p=_({model:e,where:t});e=l(e),f({method:`findMany`},`${Z(s)} ${Q(1,3)}`,`${$(`findMany`)}:`,{model:d,where:p,limit:c,sortBy:i,offset:a});let m=await v.findMany({model:d,where:p,limit:c,sortBy:i,offset:a});f({method:`findMany`},`${Z(s)} ${Q(2,3)}`,`${$(`findMany`)} ${nx(`DB Result`)}:`,{model:d,data:m});let h=m;return o.disableTransformOutput||(h=await Promise.all(m.map(async t=>await g(t,e)))),f({method:`findMany`},`${Z(s)} ${Q(3,3)}`,`${$(`findMany`)} ${nx(`Parsed Result`)}:`,{model:d,data:h}),h},delete:async({model:e,where:t})=>{$b++;let n=$b,r=u(e),i=_({model:e,where:t});e=l(e),f({method:`delete`},`${Z(n)} ${Q(1,2)}`,`${$(`delete`)}:`,{model:r,where:i}),await v.delete({model:r,where:i}),f({method:`delete`},`${Z(n)} ${Q(2,2)}`,`${$(`delete`)} ${nx(`DB Result`)}:`,{model:r})},deleteMany:async({model:e,where:t})=>{$b++;let n=$b,r=u(e),i=_({model:e,where:t});e=l(e),f({method:`deleteMany`},`${Z(n)} ${Q(1,2)}`,`${$(`deleteMany`)} ${nx(`DeleteMany`)}:`,{model:r,where:i});let a=await v.deleteMany({model:r,where:i});return f({method:`deleteMany`},`${Z(n)} ${Q(2,2)}`,`${$(`deleteMany`)} ${nx(`DB Result`)}:`,{model:r,data:a}),a},count:async({model:e,where:t})=>{$b++;let n=$b,r=u(e),i=_({model:e,where:t});e=l(e),f({method:`count`},`${Z(n)} ${Q(1,2)}`,`${$(`count`)}:`,{model:r,where:i});let a=await v.count({model:r,where:i});return f({method:`count`},`${Z(n)} ${Q(2,2)}`,`${$(`count`)}:`,{model:r,data:a}),a},createSchema:v.createSchema?async(e,n)=>{let i=t(r);return r.secondaryStorage&&!r.session?.storeSessionInDatabase&&delete i.session,r.rateLimit&&r.rateLimit.storage===`database`&&(r.rateLimit.enabled===void 0||r.rateLimit.enabled===!0)&&(i.ratelimit={modelName:r.rateLimit.modelName??`ratelimit`,fields:{key:{type:`string`,unique:!0,required:!0,fieldName:r.rateLimit.fields?.key??`key`},count:{type:`number`,required:!0,fieldName:r.rateLimit.fields?.count??`count`},lastRequest:{type:`number`,required:!0,bigint:!0,defaultValue:()=>Date.now(),fieldName:r.rateLimit.fields?.lastRequest??`lastRequest`}}}),v.createSchema({file:n,tables:i})}:void 0,options:{adapterConfig:o,...v.options??{}},id:o.adapterId,...o.debugLogs?.isRunningAdapterTests?{adapterTestDebugLogs:{resetDebugLogs(){Qb=Qb.filter(e=>e.instance!==a)},printDebugLogs(){let e=`─`.repeat(80),t=Qb.filter(e=>e.instance===a);if(t.length===0)return;let n=t.reverse().map(e=>(e.args[0]=`\n${e.args[0]}`,[...e.args,`
88
+ `])).reduce((e,t)=>[...t,...e],[`\n${e}`]);console.log(...n)}}}:{}};return ee};function Z(e){return dv()<8?`#${e}`:`${fv.fg.magenta}#${e}${fv.reset}`}function Q(e,t){return`${fv.bg.black}${fv.fg.yellow}[${e}/${t}]${fv.reset}`}function $(e){return`${fv.bright}${e}${fv.reset}`}function nx(e){return`${fv.dim}(${e})${fv.reset}`}export{xg as $,X_ as A,i as At,q as B,ov as C,_t as Ct,av as D,c as Dt,rv as E,u as Et,W_ as F,Yh as G,ig as H,V_ as I,Jm as J,D_ as K,z_ as L,J_ as M,t as Mt,Y_ as N,vv as O,l as Ot,G_ as P,Vh as Q,bg as R,ev as S,St,iv as T,d as Tt,cg as U,Bg as V,vg as W,Sh as X,bh as Y,M_ as Z,Pv as _,Ht as _t,Gb as a,on as at,sv as b,Tt as bt,by as c,aa as ct,Gv as d,Bt as dt,Yg as et,qv as f,At as ft,Uv as g,It as gt,Rv as h,jt as ht,Yb as i,ug as it,Z_ as j,n as jt,mv as k,r as kt,Iv as l,pn as lt,Jv as m,Vt as mt,Wb as n,Km as nt,Pb as o,Dn as ot,Kv as p,Pt as pt,gg as q,Xb as r,Tg as rt,Wy as s,On as st,tx as t,Ng as tt,Bv as u,Lt as ut,Ev as v,Ct as vt,Y as w,Te as wt,_v as x,wt as xt,yv as y,xt as yt,Jg as z};