PageSourceSearch

https://app.grok4.app/_next/static/chunks/3605-642f3d061704bb19.js

js grok4.app collected 2026-10-05 21:42:40 UTC 193,292 bytes, 16 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3605],{144:(e,t,r)=>{r.d(t,{_:()=>i});var n=r(79678),o=r(89262),a=r(66196);function i(e){let t;if("string"==typeof e){let r=e.split(".");(3===r.length||5===r.length)&&([t]=r)}else if("object"==typeof e&&e)if("protected"in e)t=e.protected;else throw TypeError("Token does not contain a Protected Header");try{if("string"!=typeof t||!t)throw Error();let e=JSON.parse(o.D0.decode((0,n.D)(t)));if(!(0,a.A)(e))throw Error();return e}catch{throw TypeError("Invalid Token or Protected Header formatting")}}},427:(e,t,r)=>{r.d(t,{A:()=>n});let n=(...e)=>{let t,r=e.filter(Boolean);if(0===r.length||1===r.length)return!0;for(let e of r){let r=Object.keys(e);if(!t||0===t.size){t=new Set(r);continue}for(let e of r){if(t.has(e))return!1;t.add(e)}}return!0}},3171:(e,t,r)=>{r.d(t,{A:()=>l});var n=r(37158),o=r(5540),a=r(13493);let i=e=>e?.[Symbol.toStringTag],s=(e,t,r)=>{if(void 0!==t.use){let e;switch(r){case"sign":case"verify":e="sig";break;case"encrypt":case"decrypt":e="enc"}if(t.use!==e)throw TypeError(`Invalid key for this operation, its "use" must be "${e}" when present`)}if(void 0!==t.alg&&t.alg!==e)throw TypeError(`Invalid key for this operation, its "alg" must be "${e}" when present`);if(Array.isArray(t.key_ops)){let n;switch(!0){case"sign"===r||"verify"===r:case"dir"===e:case e.includes("CBC-HS"):n=r;break;case e.startsWith("PBES2"):n="deriveBits";break;case/^A\d{3}(?:GCM)?(?:KW)?$/.test(e):n=!e.includes("GCM")&&e.endsWith("KW")?"encrypt"===r?"wrapKey":"unwrapKey":r;break;case"encrypt"===r&&e.startsWith("RSA"):n="wrapKey";break;case"decrypt"===r:n=e.startsWith("RSA")?"unwrapKey":"deriveBits"}if(n&&t.key_ops?.includes?.(n)===!1)throw TypeError(`Invalid key for this operation, its "key_ops" must include "${n}" when present`)}return!0},l=(e,t,r)=>{e.startsWith("HS")||"dir"===e||e.startsWith("PBES2")||/^A(?:128|192|256)(?:GCM)?(?:KW)?$/.test(e)||/^A(?:128|192|256)CBC-HS(?:256|384|512)$/.test(e)?((e,t,r)=>{if(!(t instanceof Uint8Array)){if(a.ll(t)){if(a.t9(t)&&s(e,t,r))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(!(0,o.Ay)(t))throw TypeError((0,n.t)(e,t,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if("secret"!==t.type)throw TypeError(`${i(t)} instances for symmetric algorithms must be of type "secret"`)}})(e,t,r):((e,t,r)=>{if(a.ll(t))switch(r){case"decrypt":case"sign":if(a.W2(t)&&s(e,t,r))return;throw TypeError("JSON Web Key for this operation be a private JWK");case"encrypt":case"verify":if(a.M3(t)&&s(e,t,r))return;throw TypeError("JSON Web Key for this operation be a public JWK")}if(!(0,o.Ay)(t))throw TypeError((0,n.t)(e,t,"CryptoKey","KeyObject","JSON Web Key"));if("secret"===t.type)throw TypeError(`${i(t)} instances for asymmetric algorithms must not be of type "secret"`);if("public"===t.type)switch(r){case"sign":throw TypeError(`${i(t)} instances for asymmetric algorithm signing must be of type "private"`);case"decrypt":throw TypeError(`${i(t)} instances for asymmetric algorithm decryption must be of type "private"`)}if("private"===t.type)switch(r){case"verify":throw TypeError(`${i(t)} instances for asymmetric algorithm verifying must be of type "public"`);case"encrypt":throw TypeError(`${i(t)} instances for asymmetric algorithm encryption must be of type "public"`)}})(e,t,r)}},3736:(e,t,r)=>{r.d(t,{s:()=>o});var n=r(40284);function o(e){try{if("string"!=typeof e)return e;return JSON.parse(e,function(e,t){if("string"==typeof t&&/^\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})}catch(e){return n.a.error("Error parsing JSON",{error:e}),null}}},5540:(e,t,r)=>{function n(e){return e?.[Symbol.toStringTag]==="CryptoKey"}function o(e){return e?.[Symbol.toStringTag]==="KeyObject"}r.d(t,{Ay:()=>a,D2:()=>o,R7:()=>n});let a=e=>n(e)||o(e)},6322:(e,t,r)=>{r.d(t,{$O:()=>E,$S:()=>X,Au:()=>M,Be:()=>c,Bj:()=>g,Ct:()=>v,Dl:()=>m,ER:()=>ee,Eb:()=>F,F7:()=>j,FO:()=>es,Fk:()=>q,Fn:()=>f,G1:()=>O,G8:()=>L,Hi:()=>J,Il:()=>eo,KB:()=>T,K_:()=>i,Kn:()=>z,LK:()=>D,MB:()=>ec,Mu:()=>s,Ny:()=>_,Pw:()=>
vendor: 4,526 bytes, line 1
1b,Rl:()=>a,Tx:()=>K,Uy:()=>x,WN:()=>en,YA:()=>Y,YY:()=>H,Zm:()=>Z,_L:()=>N,_z:()=>w,aC:()=>h,bS:()=>et,cU:()=>S,dN:()=>$,dR:()=>Q,dZ:()=>ei,db:()=>R,em:()=>U,f2:()=>P,fU:()=>el,fs:()=>y,gP:()=>A,hH:()=>G,jw:()=>C,lo:()=>er,m9:()=>B,nA:()=>u,pY:()=>d,qF:()=>V,qm:()=>W,rk:()=>I,rt:()=>k,tB:()=>l,wA:()=>p,xY:()=>ea});var n=r(63375),o=r(95414);function a(e,t){return new e({type:"string",...o.A2(t)})}function i(e,t){return new e({type:"string",coerce:!0,...o.A2(t)})}function s(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...o.A2(t)})}function l(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...o.A2(t)})}function c(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...o.A2(t)})}function u(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...o.A2(t)})}function d(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...o.A2(t)})}function p(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...o.A2(t)})}function f(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...o.A2(t)})}function h(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...o.A2(t)})}function m(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...o.A2(t)})}function y(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...o.A2(t)})}function g(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...o.A2(t)})}function v(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...o.A2(t)})}function b(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...o.A2(t)})}function w(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...o.A2(t)})}function _(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...o.A2(t)})}function E(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...o.A2(t)})}function x(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...o.A2(t)})}function A(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...o.A2(t)})}function k(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...o.A2(t)})}function S(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...o.A2(t)})}function T(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...o.A2(t)})}function I(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...o.A2(t)})}function O(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...o.A2(t)})}function R(e,t){return new e({type:"string",format:"date",check:"string_format",...o.A2(t)})}function z(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...o.A2(t)})}function P(e,t){return new e({type:"string",format:"duration",check:"string_format",...o.A2(t)})}function j(e,t){return new e({type:"number",checks:[],...o.A2(t)})}function D(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...o.A2(t)})}function N(e,t){return new e({type:"boolean",...o.A2(t)})}function $(e,t){return new e({type:"boolean",coerce:!0,...o.A2(t)})}function C(e,t){return new e({type:"null",...o.A2(t)})}function U(e){return new e({type:"unknown"})}function L(e,t){return new e({type:"never",...o.A2(t)})}function H(e,t){return new e({type:"date",...o.A2(t)})}function M(e,t){return new n.sm({check:"less_than",...o.A2(t),value:e,inclusive:!1})}function Z(e,t){return new n.sm({check:"less_than",...o.A2(t),value:e,inclusive:!0})}function K(e,t){return new n.J_({check:"greater_than",...o.A2(t),value:e,inclusive:!1})}function W(e,t){return new n.J_({check:"greater_than",...o.A2(t),value:e,inclusive:!0})}function J(e,t){return new n.Jk({check:"multiple_of",...o.A2(t),value:e})}function F(e,t){return new n.Yk({check:"max_length",...o.A2(t),maximum:e})}function B(e,t){return new n.Kk({check:"min_length",...o.A2(t),minimum:e})}function Y(e,t){return new n.RM({check:"length_equals",...o.A2(t),length:e})}function q(e,t){return new n.DG({check:"string_format",format:"regex",...o.A2(t),pattern:e})}function G(e){return new n.NI({check:"string_format",format:"lowercase",...o.A2(e)})}
1function V(e){return new n.kH({check:"string_format",format:"uppercase",...o.A2(e)})}function Q(e,t){return new n.Tt({check:"string_format",format:"includes",...o.A2(t),includes:e})}function X(e,t){return new n.J({check:"string_format",format:"starts_with",...o.A2(t),prefix:e})}function ee(e,t){return new n.E6({check:"string_format",format:"ends_with",...o.A2(t),suffix:e})}function et(e){return new n.v$({check:"overwrite",tx:e})}function er(e){return et(t=>t.normalize(e))}function en(){return et(e=>e.trim())}function eo(){return et(e=>e.toLowerCase())}function ea(){return et(e=>e.toUpperCase())}function ei(e,t,r){return new e({type:"array",element:t,...o.A2(r)})}function es(e,t,r){let n=o.A2(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function el(e,t,r){return new e({type:"custom",check:"custom",fn:t,...o.A2(r)})}function ec(e){let t=function(e,t){let r=new n.QP({check:"custom",...o.A2(void 0)});return r._zod.check=e,r}(r=>(r.addIssue=e=>{"string"==typeof e?r.issues.push(o.sn(e,r.value,t._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),e.input??(e.input=r.value),e.inst??(e.inst=t),e.continue??(e.continue=!t._zod.def.abort),r.issues.push(o.sn(e)))},e(r.value,r)));return t}},8230:(e,t,r)=>{r.d(t,{q:()=>a});var n=r(94454);function o(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 a(...e){let t=e.map(o).join("");if(0===t.length)throw Error("No valid characters provided for random string generation.");let r=t.length;return(e,...a)=>{let i;if(e<=0)throw Error("Length must be a positive integer.");let s=t,l=r;a.length>0&&(l=(s=a.map(o).join("")).length);let c=Math.floor(256/l)*l,u=new Uint8Array(2*e),d=u.length,p="",f=d;for(;p.length<e;)f>=d&&((0,n.UY)(u),f=0),(i=u[f++])<c&&(p+=s[i%l]);return p}}},11534:(e,t,r)=>{function n(e){if(null===e||"object"!=typeof e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.iterator in e)&&(!(Symbol.toStringTag in e)||"[object Module]"===Object.prototype.toString.call(e))}function o(e){return(...t)=>t.reduce((t,r)=>(function e(t,r,o=".",a){if(!n(r))return e(t,{},o,a);let i=Object.assign({},r);for(let r in t){if("__proto__"===r||"constructor"===r)continue;let s=t[r];null!=s&&(a&&a(i,r,s,o)||(Array.isArray(s)&&Array.isArray(i[r])?i[r]=[...s,...i[r]]:n(s)&&n(i[r])?i[r]=e(s,i[r],(o?`${o}.`:"")+r.toString(),a):i[r]=s))}return i})(t,r,"",e),{})}r.d(t,{zG:()=>o}),o(),o((e,t,r)=>{if(void 0!==e[t]&&"function"==typeof r)return e[t]=r(e[t]),!0}),o((e,t,r)=>{if(Array.isArray(e[t])&&"function"==typeof r)return e[t]=r(e[t]),!0})},11810:(e,t,r)=>{r.d(t,{s:()=>i});var n=r(94454),o=r(45708),a=r(47366);let i=(e="SHA-256",t="none")=>{let r={importKey:async(t,r)=>n.aK.importKey("raw","string"==typeof t?new TextEncoder().encode(t):t,{name:"HMAC",hash:{name:e}},!1,[r]),sign:async(e,i)=>{"string"==typeof e&&(e=await r.importKey(e,"sign"));let s=await n.aK.sign("HMAC",e,"string"==typeof i?new TextEncoder().encode(i):i);return"hex"===t?o.u.encode(s):"base64"===t||"base64url"===t||"base64urlnopad"===t?a.z.encode(s,{padding:"base64urlnopad"!==t}):s},verify:async(e,i,s)=>
1("string"==typeof e&&(e=await r.importKey(e,"verify")),"hex"===t&&(s=o.u.decode(s)),("base64"===t||"base64url"===t||"base64urlnopad"===t)&&(s=await a.K.decode(s)),n.aK.verify("HMAC",e,"string"==typeof s?new TextEncoder().encode(s):s,"string"==typeof i?new TextEncoder().encode(i):i))};return r}},12319:(e,t,r)=>{var n=r(82737),o=r(90114);r(19890);let a=n.Ik({id:n.Yj(),createdAt:n.p6().default(()=>new Date),updatedAt:n.p6().default(()=>new Date)});a.extend({providerId:n.Yj(),accountId:n.Yj(),userId:o.Yj(),accessToken:n.Yj().nullish(),refreshToken:n.Yj().nullish(),idToken:n.Yj().nullish(),accessTokenExpiresAt:n.p6().nullish(),refreshTokenExpiresAt:n.p6().nullish(),scope:n.Yj().nullish(),password:n.Yj().nullish()}),a.extend({email:n.Yj().transform(e=>e.toLowerCase()),emailVerified:n.zM().default(!1),name:n.Yj(),image:n.Yj().nullish()}),a.extend({userId:o.Yj(),expiresAt:n.p6(),token:n.Yj(),ipAddress:n.Yj().nullish(),userAgent:n.Yj().nullish()}),a.extend({value:n.Yj(),expiresAt:n.p6(),identifier:n.Yj()})},13236:(e,t,r)=>{r.d(t,{$4:()=>p,BT:()=>d,Dm:()=>u,Dp:()=>c,Rb:()=>i,T0:()=>s,Ye:()=>l,h2:()=>h,i4:()=>n,ie:()=>o,n:()=>a,xb:()=>f});class n 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)}}class o extends n{static code="ERR_JWT_CLAIM_VALIDATION_FAILED";code="ERR_JWT_CLAIM_VALIDATION_FAILED";claim;reason;payload;constructor(e,t,r="unspecified",n="unspecified"){super(e,{cause:{claim:r,reason:n,payload:t}}),this.claim=r,this.reason=n,this.payload=t}}class a extends n{static code="ERR_JWT_EXPIRED";code="ERR_JWT_EXPIRED";claim;reason;payload;constructor(e,t,r="unspecified",n="unspecified"){super(e,{cause:{claim:r,reason:n,payload:t}}),this.claim=r,this.reason=n,this.payload=t}}class i extends n{static code="ERR_JOSE_ALG_NOT_ALLOWED";code="ERR_JOSE_ALG_NOT_ALLOWED"}class s extends n{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"}class l extends n{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"}class c extends n{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"}class u extends n{static code="ERR_JWKS_INVALID";code="ERR_JWKS_INVALID"}class d extends n{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)}}class p extends n{[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)}}
1class f extends n{static code="ERR_JWKS_TIMEOUT";code="ERR_JWKS_TIMEOUT";constructor(e="request timed out",t){super(e,t)}}class h extends n{static code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";constructor(e="signature verification failed",t){super(e,t)}}},13493:(e,t,r)=>{r.d(t,{M3:()=>i,W2:()=>a,ll:()=>o,t9:()=>s});var n=r(66196);function o(e){return(0,n.A)(e)&&"string"==typeof e.kty}function a(e){return"oct"!==e.kty&&("AKP"===e.kty&&"string"==typeof e.priv||"string"==typeof e.d)}function i(e){return"oct"!==e.kty&&void 0===e.d&&void 0===e.priv}function s(e){return"oct"===e.kty&&"string"==typeof e.k}},15097:(e,t,r)=>{r.d(t,{EJ:()=>c,GW:()=>y,Mv:()=>h,Od:()=>u,R3:()=>_,Rb:()=>l,Tj:()=>i,VS:()=>b,bp:()=>f,e2:()=>m,or:()=>g,qg:()=>s,rh:()=>v,v_:()=>w,wG:()=>p,xL:()=>d});var n=r(48745),o=r(22889),a=r(95414);let i=e=>(t,r,o,i)=>{let s=o?Object.assign(o,{async:!1}):{async:!1},l=t._zod.run({value:r,issues:[]},s);if(l instanceof Promise)throw new n.GT;if(l.issues.length){let t=new(i?.Err??e)(l.issues.map(e=>a.iR(e,s,n.$W())));throw a.gx(t,i?.callee),t}return l.value},s=i(o.Kd),l=e=>async(t,r,o,i)=>{let s=o?Object.assign(o,{async:!0}):{async:!0},l=t._zod.run({value:r,issues:[]},s);if(l instanceof Promise&&(l=await l),l.issues.length){let t=new(i?.Err??e)(l.issues.map(e=>a.iR(e,s,n.$W())));throw a.gx(t,i?.callee),t}return l.value},c=l(o.Kd),u=e=>(t,r,i)=>{let s=i?{...i,async:!1}:{async:!1},l=t._zod.run({value:r,issues:[]},s);if(l instanceof Promise)throw new n.GT;return l.issues.length?{success:!1,error:new(e??o.a$)(l.issues.map(e=>a.iR(e,s,n.$W())))}:{success:!0,data:l.value}},d=u(o.Kd),p=e=>async(t,r,o)=>{let i=o?Object.assign(o,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(e=>a.iR(e,i,n.$W())))}:{success:!0,data:s.value}},f=p(o.Kd),h=e=>(t,r,n)=>{let o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return i(e)(t,r,o)};o.Kd;let m=e=>(t,r,n)=>i(e)(t,r,n);o.Kd;let y=e=>async(t,r,n)=>{let o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return l(e)(t,r,o)};o.Kd;let g=e=>async(t,r,n)=>l(e)(t,r,n);o.Kd;let v=e=>(t,r,n)=>{let o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return u(e)(t,r,o)};o.Kd;let b=e=>(t,r,n)=>u(e)(t,r,n);o.Kd;let w=e=>async(t,r,n)=>{let o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return p(e)(t,r,o)};o.Kd;let _=e=>async(t,r,n)=>p(e)(t,r,n);o.Kd},17418:(e,t,r)=>{function n(e,t="algorithm.name"){return TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function o(e,t){return e.name===t}function a(e){return parseInt(e.name.slice(4),10)}r.d(t,{A:()=>s});var i=r(37158);let s=async(e,t,r)=>{if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw TypeError((0,i.A)(t,"CryptoKey","KeyObject","JSON Web Key"));return crypto.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[r])}return!function(e,t,r){switch(t){case"HS256":case"HS384":case"HS512":{if(!o(e.algorithm,"HMAC"))throw n("HMAC");let r=parseInt(t.slice(2),10);if(a(e.algorithm.hash)!==r)throw n(`SHA-${r}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!o(e.algorithm,"RSASSA-PKCS1-v1_5"))throw n("RSASSA-PKCS1-v1_5");let r=parseInt(t.slice(2),10);if(a(e.algorithm.hash)!==r)throw n(`SHA-${r}`,"algorithm.hash");break}
1case"PS256":case"PS384":case"PS512":{if(!o(e.algorithm,"RSA-PSS"))throw n("RSA-PSS");let r=parseInt(t.slice(2),10);if(a(e.algorithm.hash)!==r)throw n(`SHA-${r}`,"algorithm.hash");break}case"Ed25519":case"EdDSA":if(!o(e.algorithm,"Ed25519"))throw n("Ed25519");break;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":if(!o(e.algorithm,t))throw n(t);break;case"ES256":case"ES384":case"ES512":{if(!o(e.algorithm,"ECDSA"))throw n("ECDSA");let r=function(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw Error("unreachable")}}(t);if(e.algorithm.namedCurve!==r)throw n(r,"algorithm.namedCurve");break}default:throw TypeError("CryptoKey does not support this operation")}if(r&&!e.usages.includes(r))throw TypeError(`CryptoKey does not support this operation, its usages must include ${r}.`)}(t,e,r),t}},18792:(e,t,r)=>{r.d(t,{g:()=>o});var n=r(8230);let o=e=>(0,n.q)("a-z","A-Z","0-9")(e||32)},19890:(e,t,r)=>{r.d(t,{LG:()=>i,Ny:()=>b,UD:()=>w});var n=r(94454),o=Object.defineProperty,a={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},i=function(e,t){class r extends e{#e;constructor(...e){if(function(){let e=Object.getOwnPropertyDescriptor(Error,"stackTraceLimit");return void 0===e?Object.isExtensible(Error):Object.prototype.hasOwnProperty.call(e,"writable")?e.writable:void 0!==e.set}()){let t=Error.stackTraceLimit;Error.stackTraceLimit=0,super(...e),Error.stackTraceLimit=t}else super(...e);let t=Error().stack;t&&(this.#e=function(e){let t=e.split("\n    at ");return t.length<=1?e:(t.splice(1,1),t.join("\n    at "))}(t.replace(/^Error/,this.name)))}get errorStack(){return this.#e}}return Object.defineProperty(r.prototype,"constructor",{get:()=>t,enumerable:!1,configurable:!0}),r}(class extends Error{constructor(e="INTERNAL_SERVER_ERROR",t,r={},n="number"==typeof e?e:a[e]){super(t?.message,t?.cause?{cause:t.cause}:void 0),this.status=e,this.body=t,this.headers=r,this.statusCode=n,this.name="APIError",this.status=e,this.headers=r,this.statusCode=n,this.body=t?{code:t?.message?.toUpperCase().replace(/ /g,"_").replace(/[^A-Z0-9_]/g,""),...t}:void 0}},Error);function s(e){return e instanceof i||e?.name==="APIError"}async function l(e,t={}){let r={body:t.body,query:t.query};if(e.body){let n=await e.body["~standard"].validate(t.body);if(n.issues)return{data:null,error:c(n.issues,"body")};r.body=n.value}if(e.query){let n=await e.query["~standard"].validate(t.query);if(n.issues)return{data:null,error:c(n.issues,"query")};r.query=n.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:r,error:null}}function c(e,t){let r=[];for(let t of e){let e=t.message;r.push(e)}return{message:`Invalid ${t} parameters`}}var u={name:"HMAC",hash:"SHA-256"},d=async e=>{let t="string"==typeof e?new TextEncoder().encode(e):e;return await n.aK.importKey("raw",t,u,!1,["sign","verify"])},p=async(e,t,r)=>{try{let o=atob(e),a=new Uint8Array(o.length);for(let e=0,t=o.length;e<t;e++)a[e]=o.charCodeAt(e);return await n.aK.verify(u,r,a,new TextEncoder().encode(t))}catch(e){return!1}},f=async(e,t)=>{let r=await d(t);return btoa(String.fromCharCode(...new Uint8Array(await n.aK.sign(u.name,r,new TextEncoder().encode(e)))))},h=async(e,t)=>{let r=await f(e,t);return encodeURIComponent(e=`${e}.${r}`)},m=(e,t)=>
1{let r=e;if(t)if("secure"===t)r="__Secure-"+e;else{if("host"!==t)return;r="__Host-"+e}return r},y=(e,t,r={})=>{let n;if(n=r?.prefix==="secure"?`__Secure-${e}=${t}`:r?.prefix==="host"?`__Host-${e}=${t}`:`${e}=${t}`,e.startsWith("__Secure-")&&!r.secure&&(r.secure=!0),e.startsWith("__Host-")&&(r.secure||(r.secure=!0),"/"!==r.path&&(r.path="/"),r.domain&&(r.domain=void 0)),r&&"number"==typeof r.maxAge&&r.maxAge>=0){if(r.maxAge>3456e4)throw Error("Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration.");n+=`; Max-Age=${Math.floor(r.maxAge)}`}if(r.domain&&"host"!==r.prefix&&(n+=`; Domain=${r.domain}`),r.path&&(n+=`; Path=${r.path}`),r.expires){if(r.expires.getTime()-Date.now()>3456e7)throw Error("Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future.");n+=`; Expires=${r.expires.toUTCString()}`}return r.httpOnly&&(n+="; HttpOnly"),r.secure&&(n+="; Secure"),r.sameSite&&(n+=`; SameSite=${r.sameSite.charAt(0).toUpperCase()+r.sameSite.slice(1)}`),r.partitioned&&(r.secure||(r.secure=!0),n+="; Partitioned"),n},g=async(e,t,r,n)=>y(e,t=await h(t,r),n),v=async(e,{options:t,path:r})=>{let n=new Headers,{data:o,error:a}=await l(t,e);if(a)throw new i(400,{message:a.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"),u=c?function(e){if("string"!=typeof e)throw TypeError("argument str must be a string");let t=new Map,r=0;for(;r<e.length;){let n=e.indexOf("=",r);
1if(-1===n)break;let o=e.indexOf(";",r);if(-1===o)o=e.length;else if(o<n){r=e.lastIndexOf(";",n-1)+1;continue}let a=e.slice(r,n).trim();if(!t.has(a)){let r=e.slice(n+1,o).trim();34===r.codePointAt(0)&&(r=r.slice(1,-1)),t.set(a,function(e){try{return e.includes("%")?decodeURIComponent(e):e}catch{return e}}(r))}r=o+1}return t}(c):void 0,f={...e,body:o.body,query:o.query,path:e.path||r,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)=>{n.set(e,t)},getHeader:e=>s?s.get(e):null,getCookie:(e,t)=>{let r=m(e,t);return r&&u?.get(r)||null},getSignedCookie:async(e,t,r)=>{let n=m(e,r);if(!n)return null;let o=u?.get(n);if(!o)return null;let a=o.lastIndexOf(".");if(a<1)return null;let i=o.substring(0,a),s=o.substring(a+1);if(44!==s.length||!s.endsWith("="))return null;let l=await d(t);return!!await p(s,i,l)&&i},setCookie:(e,t,r)=>{let o=((e,t,r)=>y(e,t=encodeURIComponent(t),r))(e,t,r);return n.append("set-cookie",o),o},setSignedCookie:async(e,t,r,o)=>{let a=await g(e,t,r,o);return n.append("set-cookie",a),a},redirect:e=>(n.set("location",e),new i("FOUND",void 0,n)),error:(e,t,r)=>new i(e,t,r),json:(t,r)=>e.asResponse?{body:r?.body||t,routerResponse:r,_flag:"json"}:t,responseHeaders:n};for(let e of t.use||[]){let t=await e({...f,returnHeaders:!0,asResponse:!1});t.response&&Object.assign(f.context,t.response),t.headers&&t.headers.forEach((e,t)=>{f.responseHeaders.set(t,e)})}return f};function b(e,t){let r=async r=>{let n="function"==typeof e?e:t,o=await v(r,{options:"function"==typeof e?{}:e,path:"/"});if(!n)throw Error("handler must be defined");let a=await n(o),i=o.responseHeaders;return r.returnHeaders?{headers:i,response:a}:a};return r.options="function"==typeof e?{}:e,r}b.create=e=>function(t,r){if("function"==typeof t)return b({use:e?.use},t);if(!r)throw Error("Middleware handler is required");return b({...t,method:"*",use:[...e?.use||[],...t.use||[]]},r)};var w=(e,t,r)=>{let n=async(...n)=>{let o=n[0]||{},a=await v(o,{options:t,path:e}),i=await r(a).catch(async e=>{if(s(e)){let r=t.onAPIError;if(r&&await r(e),o.asResponse)return e}throw e}),l=a.responseHeaders;return o.asResponse?function e(t,r){if(t instanceof Response)return r?.headers instanceof Headers&&r.headers.forEach((e,r)=>{t.headers.set(r,e)}),t;if(t&&"object"==typeof t&&"_flag"in t&&"json"===t._flag){let e=t.body,n=t.routerResponse;if(n instanceof Response)return n;let o=new Headers({...n?.headers,...t.headers,...r?.headers,"Content-Type":"application/json"});return new Response(JSON.stringify(e),{...n,headers:o,status:t.status??r?.status??n?.status,statusText:r?.statusText??n?.statusText})}if(s(t))return e(t.body,{status:r?.status??t.statusCode,statusText:t.status.toString(),headers:r?.headers||t.headers});let n=t,o=new Headers(r?.headers);return t?"string"==typeof t?(n=t,o.set("Content-Type","text/plain")):t instanceof ArrayBuffer||ArrayBuffer.isView(t)?(n=t,o.set("Content-Type","application/octet-stream")):t instanceof Blob?(n=t,o.set("Content-Type",t.type||"application/octet-stream")):t instanceof FormData?n=t:t instanceof URLSearchParams?(n=t,o.set("Content-Type","application/x-www-form-urlencoded")):t instanceof ReadableStream?(n=t,o.set("Content-Type","application/octet-stream")):function(e){if(void 0===e)return!1;let t=typeof e;return"string"===t||"number"===t||"boolean"===t||null===t||"object"===t&&(!!Array.isArray(e)||!e.buffer&&(e.constructor&&"Object"===e.constructor.name||"function"==typeof e.toJSON))}(t)&&(n=function(e,t,r){let n=0,o=new WeakMap;return JSON.stringify(e,(e,t)=>{if("bigint"==typeof t)return t.toString();if("object"==typeof t&&null!==t){if(o.has(t))return`[Circular ref-${o.get(t)}]`;o.set(t,n++)}return t},void 0)}(t),o.set("Content-Type","application/json")):(null===t&&(n=JSON.stringify(null)),o.set("content-type","application/json")),new Response(n,{...r,headers:o})}(i,{headers:l}):o.returnHeaders?{headers:l,response:i}:i};return n.options=t,n.path=e,n};function _(e,t,r){function n(r,n){var o;for(let a in Object.defineProperty(r,"_zod",{value:r._zod??{},enumerable:!1}),(o=r._zod).traits??(o.traits=new Set),r._zod.traits.add(e),t(r,n),i.prototype)a in r||Object.defineProperty(r,a,{value:i.prototype[a].bind(r)});r._zod.constr=i,r._zod.def=n}
1let o=r?.Parent??Object;class a extends o{}function i(e){var t;let o=r?.Parent?new a:this;for(let r of(n(o,e),(t=o._zod).deferred??(t.deferred=[]),o._zod.deferred))r();return o}return Object.defineProperty(a,"name",{value:e}),Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:t=>!!r?.Parent&&t instanceof r.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}function E(e){return e}function x(e){return e}function A(e){}function k(e){throw Error()}function S(e){}function T(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function I(e,t="|"){return e.map(e=>Q(e)).join(t)}function O(e,t){return"bigint"==typeof t?t.toString():t}function R(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function z(e){return null==e}function P(e){let t=+!!e.startsWith("^"),r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function j(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n;return Number.parseInt(e.toFixed(o).replace(".",""))%Number.parseInt(t.toFixed(o).replace(".",""))/10**o}function D(e,t,r){Object.defineProperty(e,t,{get(){{let n=r();return e[t]=n,n}},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function N(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function $(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function C(e){let t=Object.keys(e);return Promise.all(t.map(t=>e[t])).then(e=>{let r={};for(let n=0;n<t.length;n++)r[t[n]]=e[n];return r})}function U(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function L(e){return JSON.stringify(e)}w.create=e=>(t,r,n)=>w(t,{...r,use:[...r?.use||[],...e?.use||[]]},n),Object.freeze({status:"aborted"}),Symbol("zod_brand"),((e,t)=>{for(var r in t)o(e,r,{get:t[r],enumerable:!0})})({},{BIGINT_FORMAT_RANGES:()=>et,Class:()=>ey,NUMBER_FORMAT_RANGES:()=>ee,aborted:()=>el,allowsEval:()=>Z,assert:()=>S,assertEqual:()=>E,assertIs:()=>A,assertNever:()=>k,assertNotEqual:()=>x,assignProp:()=>N,cached:()=>R,captureStackTrace:()=>H,cleanEnum:()=>em,cleanRegex:()=>P,clone:()=>q,createTransparentProxy:()=>V,defineLazy:()=>D,esc:()=>L,escapeRegex:()=>Y,extend:()=>eo,finalizeIssue:()=>ed,floatSafeRemainder:()=>j,getElementAtPath:()=>$,getEnumValues:()=>T,getLengthableOrigin:()=>ef,getParsedType:()=>J,getSizableOrigin:()=>ep,isObject:()=>M,isPlainObject:()=>K,issue:()=>eh,joinValues:()=>I,jsonStringifyReplacer:()=>O,merge:()=>ea,normalizeParams:()=>G,nullish:()=>z,numKeys:()=>W,omit:()=>en,optionalKeys:()=>X,partial:()=>ei,pick:()=>er,prefixIssues:()=>ec,primitiveTypes:()=>B,promiseAllObject:()=>C,propertyKeyTypes:()=>F,randomString:()=>U,required:()=>es,stringifyPrimitive:()=>Q,unwrapMessage:()=>eu});var H=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function M(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}var Z=R(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function K(e){if(!1===M(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!1!==M(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function W(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var J=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":if(Array.isArray(e))return"array";if(null===e)return"null";if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return"promise";if("undefined"!=typeof Map&&e instanceof Map)return"map";if("undefined"!=typeof Set&&e instanceof Set)return"set";if("undefined"!=typeof Date&&e instanceof Date)return"date";if("undefined"!=typeof File&&e instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${t}`)}},F=new Set(["string","number","symbol"]),B=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Y(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function q(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function G(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}function V(e){let t;return new Proxy({},{get:(r,n,o)=>(t??(t=e()),Reflect.get(t,n,o)),set:(r,n,o,a)=>(t??(t=e()),Reflect.set(t,n,o,a)),has:(r,n)=>(t??(t=e()),Reflect.has(t,n)),deleteProperty:(r,n)=>(t??(t=e()),Reflect.deleteProperty(t,n)),ownKeys:r=>(t??(t=e()),Reflect.ownKeys(t)),getOwnPropertyDescriptor:(r,n)=>(t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)),defineProperty:(r,n,o)=>(t??(t=e()),Reflect.defineProperty(t,n,o))})}function Q(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}function X(e){return Object.keys(e).filter(t=>"optional"===e[t]._zod.optin&&"optional"===e[t]._zod.optout)}var ee={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},et={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function er(e,t){let r={},n=e._zod.def;for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&(r[e]=n.shape[e])}return q(e,{...e._zod.def,shape:r,checks:[]})}function en(e,t){let r={...e._zod.def.shape},n=e._zod.def;for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return q(e,{...e._zod.def,shape:r,checks:[]})}function eo(e,t){if(!K(t))throw Error("Invalid input to extend: expected a plain object");let r={...e._zod.def,get shape(){let r={...e._zod.def.shape,...t};return N(this,"shape",r),r},checks:[]};return q(e,r)}function ea(e,t){return q(e,{...e._zod.def,get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return N(this,"shape",r),r},catchall:t._zod.def.catchall,checks:[]})}function ei(e,t,r){let n=t._zod.def.shape,o={...n};if(r)for(let t in r){if(!(t in n))throw Error(`Unrecognized key: "${t}"`);r[t]&&(o[t]=e?new e({type:"optional",innerType:n[t]}):n[t])}else for(let t in n)o[t]=e?new e({type:"optional",innerType:n[t]}):n[t];return q(t,{...t._zod.def,shape:o,checks:[]})}function es(e,t,r){let n=t._zod.def.shape,o={...n};if(r)for(let t in r){if(!(t in o))throw Error(`Unrecognized key: "${t}"`);r[t]&&(o[t]=new e({type:"nonoptional",innerType:n[t]}))}else for(let t in n)o[t]=new e({type:"nonoptional",innerType:n[t]});return q(t,{...t._zod.def,shape:o,checks:[]})}function el(e,t=0){for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function ec(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function eu(e){return"string"==typeof e?e:e?.message}function ed(e,t,r){let n={...e,path:e.path??[]};return e.message||(n.message=eu(e.inst?._zod.def?.error?.(e))??eu(t?.error?.(e))??eu(r.customError?.(e))??eu(r.localeError?.(e))??"Invalid input"),delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function ep(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function ef(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function eh(...e){let[t,r,n]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:n}:{...t}}function em(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}var ey=class{constructor(...e){}},eg=(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:()=>JSON.stringify(t,O,2),enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ev=_("$ZodError",eg);_("$ZodError",eg,{Parent:Error}),Symbol("ZodOutput"),Symbol("ZodInput");var eb=(e,t)=>{ev.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>(function(e,t){let r=t||function(e){return e.message},n={_errors:[]},o=e=>{for(let t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map(e=>o({issues:e}));else if("invalid_key"===t.code)o({issues:t.issues});else if("invalid_element"===t.code)o({issues:t.issues});
1else if(0===t.path.length)n._errors.push(r(t));else{let e=n,o=0;for(;o<t.path.length;){let n=t.path[o];o===t.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(r(t))):e[n]=e[n]||{_errors:[]},e=e[n],o++}}};return o(e),n})(e,t)},flatten:{value:t=>(function(e,t=e=>e.message){let r={},n=[];for(let o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):n.push(t(o));return{formErrors:n,fieldErrors:r}})(e,t)},addIssue:{value:t=>e.issues.push(t)},addIssues:{value:t=>e.issues.push(...t)},isEmpty:{get:()=>0===e.issues.length}})};_("ZodError",eb),_("ZodError",eb,{Parent:Error})},22889:(e,t,r)=>{r.d(t,{JM:()=>l,Kd:()=>s,Wk:()=>c,a$:()=>i});var n=r(48745),o=r(95414);let a=(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,o.k8,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},i=(0,n.xI)("$ZodError",a),s=(0,n.xI)("$ZodError",a,{Parent:Error});function l(e,t=e=>e.message){let r={},n=[];for(let o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):n.push(t(o));return{formErrors:n,fieldErrors:r}}function c(e,t){let r=t||function(e){return e.message},n={_errors:[]},o=e=>{for(let t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map(e=>o({issues:e}));else if("invalid_key"===t.code)o({issues:t.issues});else if("invalid_element"===t.code)o({issues:t.issues});else if(0===t.path.length)n._errors.push(r(t));else{let e=n,o=0;for(;o<t.path.length;){let n=t.path[o];o===t.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(r(t))):e[n]=e[n]||{_errors:[]},e=e[n],o++}}};return o(e),n}},23994:(e,t,r)=>{r.d(t,{a:()=>i,b:()=>c,c:()=>l,g:()=>s});var n=r(36677),o=r(40196);function a(e,t="/api/auth"){return!function(e){try{let t=new URL(e);return"/"!==t.pathname}catch(t){throw new o.B(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}(e)?(t=t.startsWith("/")?t:`/${t}`,`${e.replace(/\/+$/,"")}${t}`):e}function i(e,t,r){if(e)return a(e,t);let i=n.e.BETTER_AUTH_URL||n.e.NEXT_PUBLIC_BETTER_AUTH_URL||n.e.PUBLIC_BETTER_AUTH_URL||n.e.NUXT_PUBLIC_BETTER_AUTH_URL||n.e.NUXT_PUBLIC_AUTH_URL||("/"!==n.e.BASE_URL?n.e.BASE_URL:void 0);if(i)return a(i,t);let l=r?.headers.get("x-forwarded-host"),c=r?.headers.get("x-forwarded-proto");if(l&&c)return a(`${c}://${l}`,t);if(r){let e=s(r.url);if(!e)throw new o.B("Could not get origin from request. Please provide a valid base URL.");return a(e,t)}if("undefined"!=typeof window&&window.location)return a(window.location.origin,t)}function s(e){try{return new URL(e).origin}catch(e){return null}}function l(e){try{return new URL(e).protocol}catch(e){return null}}function c(e){try{return new URL(e).host}catch(t){return e}}},24784:(e,t,r)=>{r.d(t,{MB:()=>f});var n=r(66631),o=r(23994),a=r(87421),i=r(77745);let s={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},l=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,c={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},u=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/,d={id:"redirect",name:"Redirect",hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&"undefined"!=typeof window&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}};var p=r(71500);function f(e){var t,r;let{pluginPathMethods:f,pluginsActions:h,pluginsAtoms:m,$fetch:y,$store:g,atomListeners:v}=(e=>{let t="credentials"in Request.prototype,r=(0,o.a)(e?.baseURL,e?.basePath),p=e?.plugins?.flatMap(e=>e.fetchPlugins).filter(e=>void 0!==e)||[],f={id:"lifecycle-hooks",name:"lifecycle-hooks",hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:h,onError:m,onRequest:y,onResponse:g,...v}=e?.fetchOptions||{},b=(0,n.Hy)({baseURL:r,...t?{credentials:"include"}:{},method:"GET",jsonParser:e=>e?function(e,t={strict:!0}){return function(e,t={}){let{strict:r=!1,warnings:n=!1,reviver:o,parseDates:a=!0}=t;if("string"!=typeof e)return e;let i=e.trim();if('"'===i[0]&&i.endsWith('"')&&!i.slice(1,-1).includes('"'))return i.slice(1,-1);let d=i.toLowerCase();if(d.length<=9&&d in c)return c[d];
1if(!l.test(i)){if(r)throw SyntaxError("[better-json] Invalid JSON");return e}if(Object.entries(s).some(([e,t])=>{let r=t.test(i);return r&&n&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${e} pattern`),r})&&r)throw Error("[better-json] Potential prototype pollution attempt detected");try{return JSON.parse(i,(e,t)=>{if("__proto__"===e||"constructor"===e&&t&&"object"==typeof t&&"prototype"in t){n&&console.warn(`[better-json] Dropping "${e}" key to prevent prototype pollution`);return}if(a&&"string"==typeof t){let e=function(e){let t=u.exec(e);if(!t)return null;let[,r,n,o,a,i,s,l,c,d,p]=t,f=new Date(Date.UTC(parseInt(r,10),parseInt(n,10)-1,parseInt(o,10),parseInt(a,10),parseInt(i,10),parseInt(s,10),l?parseInt(l.padEnd(3,"0"),10):0));if(c){let e=(60*parseInt(d,10)+parseInt(p,10))*("+"===c?-1:1);f.setUTCMinutes(f.getUTCMinutes()+e)}return f instanceof Date&&!isNaN(f.getTime())?f:null}(t);if(e)return e}return o?o(e,t):t})}catch(t){if(r)throw t;return e}}(e,t)}(e,{strict:!1}):null,customFetchImpl:fetch,...v,plugins:[f,...v.plugins||[],...e?.disableDefaultFetchPlugins?[]:[d],...p]}),{$sessionSignal:w,session:_}=function(e){let t=(0,a.e)(!1);return{session:(0,i.u)(t,"/get-session",e,{method:"GET"}),$sessionSignal:t}}(b),E=e?.plugins||[],x={},A={$sessionSignal:w,session:_},k={"/sign-out":"POST","/revoke-sessions":"POST","/revoke-other-sessions":"POST","/delete-user":"POST"},S=[{signal:"$sessionSignal",matcher:e=>"/sign-out"===e||"/update-user"===e||e.startsWith("/sign-in")||e.startsWith("/sign-up")||"/delete-user"===e||"/verify-email"===e}];for(let e of E)e.getAtoms&&Object.assign(A,e.getAtoms?.(b)),e.pathMethods&&Object.assign(k,e.pathMethods),e.atomListeners&&S.push(...e.atomListeners);let T={notify:e=>{A[e].set(!A[e].get())},listen:(e,t)=>{A[e].subscribe(t)},atoms:A};for(let t of E)t.getActions&&Object.assign(x,t.getActions?.(b,T,e));return{pluginsActions:x,pluginsAtoms:A,pluginPathMethods:k,atomListeners:S,$fetch:b,$store:T}})(e),b={};for(let[e,t]of Object.entries(m)){b[`use${(r=e).charAt(0).toUpperCase()+r.slice(1)}`]=()=>(function(e,t={}){let r=(0,p.useRef)(e.get()),{keys:n,deps:o=[e,n]}=t,a=(0,p.useCallback)(t=>{let o=e=>{r.current!==e&&(r.current=e,t())};if(o(e.value),n?.length){let t;return t=new Set(n).add(void 0),e.listen((e,r,n)=>{t.has(n)&&o(e,r,n)})}return e.listen(o)},o),i=()=>r.current;return(0,p.useSyncExternalStore)(a,i,i)})(t)}return t={...h,...b,$fetch:y,$store:g},function e(r=[]){return new Proxy(function(){},{get(n,o){var a;if("then"===o||"catch"===o||"finally"===o)return;let i=[...r,o],s=t;for(let e of i)if(s&&"object"==typeof s&&e in s)s=s[e];else{s=void 0;break}return"function"==typeof s?s:"object"==typeof(a=s)&&null!==a&&"get"in a&&"function"==typeof a.get&&"lc"in a&&"number"==typeof a.lc?s:e(i)},apply:async(e,t,n)=>{let o="/"+r.map(e=>e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)).join("/"),a=n[0]||{},i=n[1]||{},{query:s,fetchOptions:l,...c}=a,u={...i,...l},d=function(e,t,r){let n=t[e],{fetchOptions:o,query:a,...i}=r||{};return n||(o?.method?o.method:i&&Object.keys(i).length>0?"POST":"GET")}(o,f,a);return await y(o,{...u,body:"GET"===d?void 0:{...c,...u?.body||{}},query:s||u?.query,method:d,async onSuccess(e){await u?.onSuccess?.(e);let t=v?.find(e=>e.matcher(o));if(!t)return;let r=m[t.signal];if(!r)return;let n=r.get();setTimeout(()=>{r.set(!n)},10)}})}})}()}r(36677),r(40196)},28100:(e,t,r)=>{r.d(t,{A:()=>o});var n=r(13236);let o=(e,t)=>{let r=`SHA-${e.slice(-3)}`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:r,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:r,name:"RSA-PSS",saltLength:parseInt(e.slice(-3),10)>>3};case"RS256":case"RS384":case"RS512":return{hash:r,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:r,name:"ECDSA",namedCurve:t.namedCurve};
1case"Ed25519":case"EdDSA":return{name:"Ed25519"};case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return{name:e};default:throw new n.T0(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}},31963:(e,t,r)=>{r.d(t,{l$:()=>_,oR:()=>y});var n=r(71500),o=r(81117);let a=Array(12).fill(0),i=e=>{let{visible:t,className:r}=e;return n.createElement("div",{className:["sonner-loading-wrapper",r].filter(Boolean).join(" "),"data-visible":t},n.createElement("div",{className:"sonner-spinner"},a.map((e,t)=>n.createElement("div",{className:"sonner-loading-bar",key:"spinner-bar-".concat(t)}))))},s=n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},n.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),l=n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},n.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),c=n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},n.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),u=n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},n.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),d=n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),p=1;class f{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,o="number"==typeof(null==e?void 0:e.id)||(null==(t=e.id)?void 0:t.length)>0?e.id:p++,a=this.toasts.find(e=>e.id===o),i=void 0===e.dismissible||e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),a?this.toasts=this.toasts.map(t=>t.id===o?(this.publish({...t,...e,id:o,title:r}),{...t,...e,id:o,dismissible:i,title:r}):t):this.addToast({title:r,...n,dismissible:i,id:o}),o},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>
1this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{let r,o;if(!t)return;void 0!==t.loading&&(o=this.create({...t,promise:e,type:"loading",message:t.loading,description:"function"!=typeof t.description?t.description:void 0}));let a=Promise.resolve(e instanceof Function?e():e),i=void 0!==o,s=a.then(async e=>{if(r=["resolve",e],n.isValidElement(e))i=!1,this.create({id:o,type:"default",message:e});else if(m(e)&&!e.ok){i=!1;let r="function"==typeof t.error?await t.error("HTTP error! status: ".concat(e.status)):t.error,a="function"==typeof t.description?await t.description("HTTP error! status: ".concat(e.status)):t.description,s="object"!=typeof r||n.isValidElement(r)?{message:r}:r;this.create({id:o,type:"error",description:a,...s})}else if(e instanceof Error){i=!1;let r="function"==typeof t.error?await t.error(e):t.error,a="function"==typeof t.description?await t.description(e):t.description,s="object"!=typeof r||n.isValidElement(r)?{message:r}:r;this.create({id:o,type:"error",description:a,...s})}else if(void 0!==t.success){i=!1;let r="function"==typeof t.success?await t.success(e):t.success,a="function"==typeof t.description?await t.description(e):t.description,s="object"!=typeof r||n.isValidElement(r)?{message:r}:r;this.create({id:o,type:"success",description:a,...s})}}).catch(async e=>{if(r=["reject",e],void 0!==t.error){i=!1;let r="function"==typeof t.error?await t.error(e):t.error,a="function"==typeof t.description?await t.description(e):t.description,s="object"!=typeof r||n.isValidElement(r)?{message:r}:r;this.create({id:o,type:"error",description:a,...s})}}).finally(()=>{i&&(this.dismiss(o),o=void 0),null==t.finally||t.finally.call(t)}),l=()=>new Promise((e,t)=>s.then(()=>"reject"===r[0]?t(r[1]):e(r[1])).catch(t));return"string"!=typeof o&&"number"!=typeof o?{unwrap:l}:Object.assign(o,{unwrap:l})},this.custom=(e,t)=>{let r=(null==t?void 0:t.id)||p++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}let h=new f,m=e=>e&&"object"==typeof e&&"ok"in e&&"boolean"==typeof e.ok&&"status"in e&&"number"==typeof e.status,y=Object.assign((e,t)=>{let r=(null==t?void 0:t.id)||p++;return h.addToast({title:e,...t,id:r}),r},{success:h.success,info:h.info,warning:h.warning,error:h.error,custom:h.custom,message:h.message,promise:h.promise,dismiss:h.dismiss,loading:h.loading},{getHistory:()=>h.toasts,getToasts:()=>h.getActiveToasts()});function g(e){return void 0!==e.label}function v(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter(Boolean).join(" ")}!function(e){if(!e||"undefined"==typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}
vendor: 14,864 bytes, line 1
1("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");
1let b=e=>{var t,r,o,a,p,f,h,m,y,b,w;let{invert:_,toast:E,unstyled:x,interacting:A,setHeights:k,visibleToasts:S,heights:T,index:I,toasts:O,expanded:R,removeToast:z,defaultRichColors:P,closeButton:j,style:D,cancelButtonStyle:N,actionButtonStyle:$,className:C="",descriptionClassName:U="",duration:L,position:H,gap:M,expandByDefault:Z,classNames:K,icons:W,closeButtonAriaLabel:J="Close toast"}=e,[F,B]=n.useState(null),[Y,q]=n.useState(null),[G,V]=n.useState(!1),[Q,X]=n.useState(!1),[ee,et]=n.useState(!1),[er,en]=n.useState(!1),[eo,ea]=n.useState(!1),[ei,es]=n.useState(0),[el,ec]=n.useState(0),eu=n.useRef(E.duration||L||4e3),ed=n.useRef(null),ep=n.useRef(null),ef=0===I,eh=I+1<=S,em=E.type,ey=!1!==E.dismissible,eg=E.className||"",ev=E.descriptionClassName||"",eb=n.useMemo(()=>T.findIndex(e=>e.toastId===E.id)||0,[T,E.id]),ew=n.useMemo(()=>{var e;return null!=(e=E.closeButton)?e:j},[E.closeButton,j]),e_=n.useMemo(()=>E.duration||L||4e3,[E.duration,L]),eE=n.useRef(0),ex=n.useRef(0),eA=n.useRef(0),ek=n.useRef(null),[eS,eT]=H.split("-"),eI=n.useMemo(()=>T.reduce((e,t,r)=>r>=eb?e:e+t.height,0),[T,eb]),eO=(()=>{let[e,t]=n.useState(document.hidden);return n.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",e),()=>window.removeEventListener("visibilitychange",e)},[]),e})(),eR=E.invert||_,ez="loading"===em;ex.current=n.useMemo(()=>eb*M+eI,[eb,eI]),n.useEffect(()=>{eu.current=e_},[e_]),n.useEffect(()=>{V(!0)},[]),n.useEffect(()=>{let e=ep.current;if(e){let t=e.getBoundingClientRect().height;return ec(t),k(e=>[{toastId:E.id,height:t,position:E.position},...e]),()=>k(e=>e.filter(e=>e.toastId!==E.id))}},[k,E.id]),n.useLayoutEffect(()=>{if(!G)return;let e=ep.current,t=e.style.height;e.style.height="auto";let r=e.getBoundingClientRect().height;e.style.height=t,ec(r),k(e=>e.find(e=>e.toastId===E.id)?e.map(e=>e.toastId===E.id?{...e,height:r}:e):[{toastId:E.id,height:r,position:E.position},...e])},[G,E.title,E.description,k,E.id,E.jsx,E.action,E.cancel]);let eP=n.useCallback(()=>{X(!0),es(ex.current),k(e=>e.filter(e=>e.toastId!==E.id)),setTimeout(()=>{z(E)},200)},[E,z,k,ex]);n.useEffect(()=>{let e;if((!E.promise||"loading"!==em)&&E.duration!==1/0&&"loading"!==E.type)return R||A||eO?(()=>{if(eA.current<eE.current){let e=new Date().getTime()-eE.current;eu.current=eu.current-e}eA.current=new Date().getTime()})():eu.current!==1/0&&(eE.current=new Date().getTime(),e=setTimeout(()=>{null==E.onAutoClose||E.onAutoClose.call(E,E),eP()},eu.current)),()=>clearTimeout(e)},[R,A,E,em,eO,eP]),n.useEffect(()=>{E.delete&&(eP(),null==E.onDismiss||E.onDismiss.call(E,E))},[eP,E.delete]);let ej=E.icon||(null==W?void 0:W[em])||(e=>{switch(e){case"success":return s;case"info":return c;case"warning":return l;case"error":return u;default:return null}})(em);return n.createElement("li",{tabIndex:0,ref:ep,className:v(C,eg,null==K?void 0:K.toast,null==E||null==(t=E.classNames)?void 0:t.toast,null==K?void 0:K.default,null==K?void 0:K[em],null==E||null==(r=E.classNames)?void 0:r[em]),"data-sonner-toast":"","data-rich-colors":null!=(b=E.richColors)?b:P,"data-styled":!(E.jsx||E.unstyled||x),"data-mounted":G,"data-promise":!!E.promise,"data-swiped":eo,"data-removed":Q,"data-visible":eh,"data-y-position":eS,"data-x-position":eT,"data-index":I,"data-front":ef,"data-swiping":ee,"data-dismissible":ey,"data-type":em,"data-invert":eR,"data-swipe-out":er,"data-swipe-direction":Y,"data-expanded":!!(R||Z&&G),"data-testid":E.testId,style:{"--index":I,"--toasts-before":I,"--z-index":O.length-I,"--offset":"".concat(Q?ei:ex.current,"px"),"--initial-height":Z?"auto":"".concat(el,"px"),...D,...E.style},onDragEnd:()=>{et(!1),B(null),ek.current=null},onPointerDown:e=>{2!==e.button&&!ez&&ey&&(ed.current=new Date,es(ex.current),e.target.setPointerCapture(e.pointerId),"BUTTON"!==e.target.tagName&&(et(!0),ek.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{var e,t,r,n,o;if(er||!ey)return;ek.current=null;let a=Number((null==(e=ep.current)?void 0:e.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),i=Number((null==(t=ep.current)?void 0:t.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),s=new Date().getTime()-(null==(r=ed.current)?void 0:r.getTime()),l="x"===F?a:i,c=Math.abs(l)/s;if(Math.abs(l)>=45||c>.11){es(ex.current),null==E.onDismiss||E.onDismiss.call(E,E),"x"===F?q(a>0?"right":"left"):q(i>0?"down":"up"),eP(),en(!0);return}null==(n=ep.current)||n.style.setProperty("--swipe-amount-x","0px"),null==(o=ep.current)||o.style.setProperty("--swipe-amount-y","0px"),ea(!1),et(!1),B(null)},onPointerMove:t=>{var r,n,o,a;if(!ek.current||!ey||(null==(r=window.getSelection())?void 0:r.toString().length)>0)return;let i=t.clientY-ek.current.y,s=t.clientX-ek.current.x,l=null!=(a=e.swipeDirections)?a:function(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}(H);!F&&(Math.abs(s)>1||Math.abs(i)>1)&&B(Math.abs(s)>Math.abs(i)?"x":"y");let c={x:0,y:0},u=e=>1/(1.5+Math.abs(e)/20);if("y"===F){if(l.includes("top")||l.includes("bottom"))if(l.includes("top")&&i<0||l.includes("bottom")&&i>0)c.y=i;else{let e=i*u(i);c.y=Math.abs(e)<Math.abs(i)?e:i}}else if("x"===F&&(l.includes("left")||l.includes("right")))if(l.includes("left")&&s<0||l.includes("right")&&s>0)c.x=s;else{let e=s*u(s);c.x=Math.abs(e)<Math.abs(s)?e:s}(Math.abs(c.x)>0||Math.abs(c.y)>0)&&ea(!0),null==(n=ep.current)||n.style.setProperty("--swipe-amount-x","".concat(c.x,"px")),null==(o=ep.current)||o.style.setProperty("--swipe-amount-y","".concat(c.y,"px"))}},ew&&!E.jsx&&"loading"!==em?n.createElement("button",{"aria-label":J,"data-disabled":ez,"data-close-button":!0,onClick:ez||!ey?()=>{}:()=>{eP(),null==E.onDismiss||E.onDismiss.call(E,E)},className:v(null==K?void 0:K.closeButton,null==E||null==(o=E.classNames)?void 0:o.closeButton)},null!=(w=null==W?void 0:W.close)?w:d):null,(em||E.icon||E.promise)&&null!==E.icon&&((null==W?void 0:W[em])!==null||E.icon)?n.createElement("div",{"data-icon":"",className:v(null==K?void 0:K.icon,null==E||null==(a=E.classNames)?void 0:a.icon)},E.promise||"loading"===E.type&&!E.icon?E.icon||function(){var e,t;return(null==W?void 0:W.loading)?n.createElement("div",{className:v(null==K?void 0:K.loader,null==E||null==(t=E.classNames)?void 0:t.loader,"sonner-loader"),"data-visible":"loading"===em},W.loading):n.createElement(i,{className:v(null==K?void 0:K.loader,null==E||null==(e=E.classNames)?void 0:e.loader),visible:"loading"===em})}():null,"loading"!==E.type?ej:null):null,n.createElement("div",{"data-content":"",className:v(null==K?void 0:K.content,null==E||null==(p=E.classNames)?void 0:p.content)},n.createElement("div",{"data-title":"",className:v(null==K?void 0:K.title,null==E||null==(f=E.classNames)?void 0:f.title)},E.jsx?E.jsx:"function"==typeof E.title?E.title():E.title),E.description?n.createElement("div",{"data-description":"",className:v(U,ev,null==K?void 0:K.description,null==E||null==(h=E.classNames)?void 0:h.description)},"function"==typeof E.description?E.description():E.description):null),n.isValidElement(E.cancel)?E.cancel:E.cancel&&g(E.cancel)?n.createElement("button",{"data-button":!0,"data-cancel":!0,style:E.cancelButtonStyle||N,onClick:e=>{g(E.cancel)&&ey&&(null==E.cancel.onClick||E.cancel.onClick.call(E.cancel,e),eP())}
1,className:v(null==K?void 0:K.cancelButton,null==E||null==(m=E.classNames)?void 0:m.cancelButton)},E.cancel.label):null,n.isValidElement(E.action)?E.action:E.action&&g(E.action)?n.createElement("button",{"data-button":!0,"data-action":!0,style:E.actionButtonStyle||$,onClick:e=>{g(E.action)&&(null==E.action.onClick||E.action.onClick.call(E.action,e),e.defaultPrevented||eP())},className:v(null==K?void 0:K.actionButton,null==E||null==(y=E.classNames)?void 0:y.actionButton)},E.action.label):null)};function w(){if("undefined"==typeof window||"undefined"==typeof document)return"ltr";let e=document.documentElement.getAttribute("dir");return"auto"!==e&&e?e:window.getComputedStyle(document.documentElement).direction}let _=n.forwardRef(function(e,t){let{id:r,invert:a,position:i="bottom-right",hotkey:s=["altKey","KeyT"],expand:l,closeButton:c,className:u,offset:d,mobileOffset:p,theme:f="light",richColors:m,duration:y,style:g,visibleToasts:v=3,toastOptions:_,dir:E=w(),gap:x=14,icons:A,containerAriaLabel:k="Notifications"}=e,[S,T]=n.useState([]),I=n.useMemo(()=>r?S.filter(e=>e.toasterId===r):S.filter(e=>!e.toasterId),[S,r]),O=n.useMemo(()=>Array.from(new Set([i].concat(I.filter(e=>e.position).map(e=>e.position)))),[I,i]),[R,z]=n.useState([]),[P,j]=n.useState(!1),[D,N]=n.useState(!1),[$,C]=n.useState("system"!==f?f:"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),U=n.useRef(null),L=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),H=n.useRef(null),M=n.useRef(!1),Z=n.useCallback(e=>{T(t=>{var r;return(null==(r=t.find(t=>t.id===e.id))?void 0:r.delete)||h.dismiss(e.id),t.filter(t=>{let{id:r}=t;return r!==e.id})})},[]);return n.useEffect(()=>h.subscribe(e=>{if(e.dismiss)return void requestAnimationFrame(()=>{T(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});setTimeout(()=>{o.flushSync(()=>{T(t=>{let r=t.findIndex(t=>t.id===e.id);return -1!==r?[...t.slice(0,r),{...t[r],...e},...t.slice(r+1)]:[e,...t]})})})}),[S]),n.useEffect(()=>{if("system"!==f)return void C(f);if("system"===f&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?C("dark"):C("light")),"undefined"==typeof window)return;let e=window.matchMedia("(prefers-color-scheme: dark)");try{e.addEventListener("change",e=>{let{matches:t}=e;t?C("dark"):C("light")})}catch(t){e.addListener(e=>{let{matches:t}=e;try{t?C("dark"):C("light")}catch(e){console.error(e)}})}},[f]),n.useEffect(()=>{S.length<=1&&j(!1)},[S]),n.useEffect(()=>{let e=e=>{var t,r;s.every(t=>e[t]||e.code===t)&&(j(!0),null==(r=U.current)||r.focus()),"Escape"===e.code&&(document.activeElement===U.current||(null==(t=U.current)?void 0:t.contains(document.activeElement)))&&j(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[s]),n.useEffect(()=>{if(U.current)return()=>{H.current&&(H.current.focus({preventScroll:!0}),H.current=null,M.current=!1)}},[U.current]),n.createElement("section",{ref:t,"aria-label":"".concat(k," ").concat(L),tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},O.map((t,r)=>{var o;let[i,s]=t.split("-");return I.length?n.createElement("ol",{key:t,dir:"auto"===E?w():E,tabIndex:-1,ref:U,className:u,"data-sonner-toaster":!0,"data-sonner-theme":$,"data-y-position":i,"data-x-position":s,style:{"--front-toast-height":"".concat((null==(o=R[0])?void 0:o.height)||0,"px"),"--width":"".concat(356,"px"),"--gap":"".concat(x,"px"),...g,...function(e,t){let r={};return[e,t].forEach((e,t)=>{let n=1===t,o=n?"--mobile-offset":"--offset",a=n?"16px":"24px";function i(e){["top","right","bottom","left"].forEach(t=>{r["".concat(o,"-").concat(t)]="number"==typeof e?"".concat(e,"px"):e})}"number"==typeof e||"string"==typeof e?i(e):"object"==typeof e?["top","right","bottom","left"].forEach(t=>{void 0===e[t]?r["".concat(o,"-").concat(t)]=a:r["".concat(o,"-").concat(t)]="number"==typeof e[t]?"".concat(e[t],"px"):e[t]}):i(a)}),r}(d,p)},onBlur:e=>{M.current&&!e.currentTarget.contains(e.relatedTarget)&&(M.current=!1,H.current&&(H.current.focus({preventScroll:!0}),H.current=null))},onFocus:e=>{!(e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible)&&(M.current||(M.current=!0,H.current=e.relatedTarget))},onMouseEnter:()=>j(!0),onMouseMove:()=>j(!0),onMouseLeave:()=>{D||j(!1)},onDragEnd:()=>j(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||N(!0)},onPointerUp:()=>N(!1)},I.filter(e=>!e.position&&0===r||e.position===t).map((r,o)=>{var i,s;
1return n.createElement(b,{key:r.id,icons:A,index:o,toast:r,defaultRichColors:m,duration:null!=(i=null==_?void 0:_.duration)?i:y,className:null==_?void 0:_.className,descriptionClassName:null==_?void 0:_.descriptionClassName,invert:a,visibleToasts:v,closeButton:null!=(s=null==_?void 0:_.closeButton)?s:c,interacting:D,position:t,style:null==_?void 0:_.style,unstyled:null==_?void 0:_.unstyled,classNames:null==_?void 0:_.classNames,cancelButtonStyle:null==_?void 0:_.cancelButtonStyle,actionButtonStyle:null==_?void 0:_.actionButtonStyle,closeButtonAriaLabel:null==_?void 0:_.closeButtonAriaLabel,removeToast:Z,toasts:I.filter(e=>e.position==r.position),heights:R.filter(e=>e.position==r.position),setHeights:z,expandByDefault:l,gap:x,expanded:P,swipeDirections:e.swipeDirections})})):null}))})},35986:(e,t,r)=>{r.d(t,{c:()=>p,k:()=>d});var n=r(13236),o=r(89262);let a=e=>Math.floor(e.getTime()/1e3),i=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,s=e=>{let t,r=i.exec(e);if(!r||r[4]&&r[1])throw TypeError("Invalid time period format");let n=parseFloat(r[2]);switch(r[3].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":t=Math.round(n);break;case"minute":case"minutes":case"min":case"mins":case"m":t=Math.round(60*n);break;case"hour":case"hours":case"hr":case"hrs":case"h":t=Math.round(3600*n);break;case"day":case"days":case"d":t=Math.round(86400*n);break;case"week":case"weeks":case"w":t=Math.round(604800*n);break;default:t=Math.round(0x1e187e0*n)}return"-"===r[1]||"ago"===r[4]?-t:t};var l=r(66196);function c(e,t){if(!Number.isFinite(t))throw TypeError(`Invalid ${e} input`);return t}let u=e=>e.includes("/")?e.toLowerCase():`application/${e.toLowerCase()}`;function d(e,t,r={}){var i,c;let p,f;try{p=JSON.parse(o.D0.decode(t))}catch{}if(!(0,l.A)(p))throw new n.Dp("JWT Claims Set must be a top-level JSON object");let{typ:h}=r;if(h&&("string"!=typeof e.typ||u(e.typ)!==u(h)))throw new n.ie('unexpected "typ" JWT header value',p,"typ","check_failed");let{requiredClaims:m=[],issuer:y,subject:g,audience:v,maxTokenAge:b}=r,w=[...m];for(let e of(void 0!==b&&w.push("iat"),void 0!==v&&w.push("aud"),void 0!==g&&w.push("sub"),void 0!==y&&w.push("iss"),new Set(w.reverse())))if(!(e in p))throw new n.ie(`missing required "${e}" claim`,p,e,"missing");if(y&&!(Array.isArray(y)?y:[y]).includes(p.iss))throw new n.ie('unexpected "iss" claim value',p,"iss","check_failed");if(g&&p.sub!==g)throw new n.ie('unexpected "sub" claim value',p,"sub","check_failed");if(v&&(i=p.aud,c="string"==typeof v?[v]:v,"string"==typeof i?!c.includes(i):!(Array.isArray(i)&&c.some(Set.prototype.has.bind(new Set(i))))))throw new n.ie('unexpected "aud" claim value',p,"aud","check_failed");switch(typeof r.clockTolerance){case"string":f=s(r.clockTolerance);break;case"number":f=r.clockTolerance;break;case"undefined":f=0;break;default:throw TypeError("Invalid clockTolerance option type")}let{currentDate:_}=r,E=a(_||new Date);if((void 0!==p.iat||b)&&"number"!=typeof p.iat)throw new n.ie('"iat" claim must be a number',p,"iat","invalid");if(void 0!==p.nbf){if("number"!=typeof p.nbf)throw new n.ie('"nbf" claim must be a number',p,"nbf","invalid");if(p.nbf>E+f)throw new n.ie('"nbf" claim timestamp check failed',p,"nbf","check_failed")}if(void 0!==p.exp){if("number"!=typeof p.exp)throw new n.ie('"exp" claim must be a number',p,"exp","invalid");if(p.exp<=E-f)throw new n.n('"exp" claim timestamp check failed',p,"exp","check_failed")}if(b){let e=E-p.iat;if(e-f>("number"==typeof b?b:s(b)))throw new n.n('"iat" claim timestamp check failed (too far in the past)',p,"iat","check_failed");if(e<0-f)throw new n.ie('"iat" claim timestamp check failed (it should be in the past)',p,"iat","check_failed")}return p}class p{#t;constructor(e){if(!(0,l.A)(e))throw TypeError("JWT Claims Set MUST be an object");this.#t=structuredClone(e)}data(){return o.Rd.encode(JSON.stringify(this.#t))}get iss(){return this.#t.iss}set iss(e){this.#t.iss=e}get sub(){return this.#t.sub}set sub(e){this.#t.sub=e}get aud(){return this.#t.aud}set aud(e){this.#t.aud=e}set jti(e){this.#t.jti=e}set nbf(e){"number"==typeof e?this.#t.nbf=c("setNotBefore",e):e instanceof Date?this.#t.nbf=c("setNotBefore",a(e)):this.#t.nbf=a(new Date)+s(e)}set exp(e){"number"==typeof e?this.#t.exp=c("setExpirationTime",e):e instanceof Date?this.#t.exp=c("setExpirationTime",a(e)):this.#t.exp=a(new Date)+s(e)}
1set iat(e){void 0===e?this.#t.iat=a(new Date):e instanceof Date?this.#t.iat=c("setIssuedAt",a(e)):"string"==typeof e?this.#t.iat=c("setIssuedAt",a(new Date)+s(e)):this.#t.iat=c("setIssuedAt",e)}}},36099:(e,t,r)=>{r.d(t,{n:()=>a});var n=r(94454),o=r(47366);function a(e,t){return{digest:async r=>{let a=new TextEncoder,i="string"==typeof r?a.encode(r):r,s=await n.aK.digest(e,i);return"hex"===t?Array.from(new Uint8Array(s)).map(e=>e.toString(16).padStart(2,"0")).join(""):"base64"===t||"base64url"===t||"base64urlnopad"===t?t.includes("url")?o.z.encode(s,{padding:"base64urlnopad"!==t}):o.K.encode(s):s}}}},36677:(e,t,r)=>{r.d(t,{b:()=>l,e:()=>i});var n=r(55036);let o=Object.create(null),a=e=>globalThis.process?.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(e?o:globalThis),i=new Proxy(o,{get:(e,t)=>a()[t]??o[t],has:(e,t)=>t in a()||t in o,set:(e,t,r)=>(a(!0)[t]=r,!0),deleteProperty(e,t){if(!t)return!1;let r=a(!0);return delete r[t],!0},ownKeys:()=>Object.keys(a(!0))}),s=void 0!==n&&n.env&&"production"||"",l="dev"===s||"development"===s},37158:(e,t,r)=>{function n(e,t,...r){if((r=r.filter(Boolean)).length>2){let t=r.pop();e+=`one of type ${r.join(", ")}, or ${t}.`}else 2===r.length?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}r.d(t,{A:()=>o,t:()=>a});let o=(e,...t)=>n("Key must be ",e,...t);function a(e,t,...r){return n(`Key for the ${e} algorithm must be `,t,...r)}},38295:(e,t,r)=>{r.d(t,{Og:()=>s});var n=r(79678),o=r(62822),a=r(13236),i=r(66196);async function s(e,t,r){let s;if(!(0,i.A)(e))throw TypeError("JWK must be an object");switch(t??=e.alg,s??=r?.extractable??e.ext,e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw TypeError('missing "k" (Key Value) Parameter value');return(0,n.D)(e.k);case"RSA":if("oth"in e&&void 0!==e.oth)throw new a.T0('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');return(0,o.A)({...e,alg:t,ext:s});case"AKP":if("string"!=typeof e.alg||!e.alg)throw TypeError('missing "alg" (Algorithm) Parameter value');if(void 0!==t&&t!==e.alg)throw TypeError("JWK alg and alg option value mismatch");return(0,o.A)({...e,ext:s});case"EC":case"OKP":return(0,o.A)({...e,alg:t,ext:s});default:throw new a.T0('Unsupported "kty" (Key Type) Parameter value')}}},40196:(e,t,r)=>{r.d(t,{B:()=>n});class n extends Error{constructor(e,t){super(e),this.name="BetterAuthError",this.message=e,this.cause=t,this.stack=""}}},40284:(e,t,r)=>{r.d(t,{a:()=>i});let n=["info","success","warn","error","debug"],o={reset:"\x1b[0m",bright:"\x1b[1m",dim:"\x1b[2m",fg:{red:"\x1b[31m",green:"\x1b[32m",yellow:"\x1b[33m",blue:"\x1b[34m",magenta:"\x1b[35m"}},a={info:o.fg.blue,success:o.fg.green,warn:o.fg.yellow,error:o.fg.red,debug:o.fg.magenta},i=(e=>{let t=e?.disabled!==!0,r=e?.level??"error";return{...Object.fromEntries(n.map(i=>[i,(...[s,...l])=>((i,s,l=[])=>{if(!t||!(n.indexOf(i)<=n.indexOf(r)))return;let c=((e,t)=>{let r=new Date().toISOString();return`${o.dim}${r}${o.reset} ${a[e]}${e.toUpperCase()}${o.reset} ${o.bright}[Better Auth]:${o.reset} ${t}`})(i,s);if(!e||"function"!=typeof e.log)return void("error"===i?console.error(c,...l):"warn"===i?console.warn(c,...l):console.log(c,...l));e.log("success"===i?"info":i,s,...l)})(i,s,l)])),get level(){return r}}})()},42099:(e,t,r)=>{r.d(t,{i:()=>s});var n=r(79678),o=r(89262),a=r(66196),i=r(13236);function s(e){let t,r;if("string"!=typeof e)throw new i.Dp("JWTs must use Compact JWS serialization, JWT must be a string");let{1:s,length:l}=e.split(".");if(5===l)throw new i.Dp("Only JWTs using Compact JWS serialization can be decoded");if(3!==l)throw new i.Dp("Invalid JWT");if(!s)throw new i.Dp("JWTs must contain a payload");try{t=(0,n.D)(s)}catch{throw new i.Dp("Failed to base64url decode the payload")}try{r=JSON.parse(o.D0.decode(t))}catch{throw new i.Dp("Failed to parse the decoded payload as JSON")}if(!(0,a.A)(r))throw new i.Dp("Invalid JWT Claims Set");return r}},45708:(e,t,r)=>{r.d(t,{u:()=>n});let n={encode:e=>{if("string"==typeof e&&(e=new TextEncoder().encode(e)),0===e.byteLength)return"";let t=new Uint8Array(e),r="";for(let e of t)r+=e.toString(16).padStart(2,"0");return r},decode:e=>{if(!e)return"";if("string"==typeof e){if(e.length%2!=0||!RegExp("^[0123456789abcdef]+$").test(e))throw Error("Invalid hexadecimal string");let t=new Uint8Array(e.length/2);for(let r=0;r<e.length;r+=2)t[r/2]=parseInt(e.slice(r,r+2),16);return new TextDecoder().decode(t)}return new TextDecoder().decode(e)}}},47366:(e,t,r)=>{function n(e){return e?"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
1+/"}function o(e,t,r){let n="",o=0,a=0;for(let r of e)for(o=o<<8|r,a+=8;a>=6;)a-=6,n+=t[o>>a&63];if(a>0&&(n+=t[o<<6-a&63]),r){let e=(4-n.length%4)%4;n+="=".repeat(e)}return n}function a(e,t){let r=new Map;for(let e=0;e<t.length;e++)r.set(t[e],e);let n=[],o=0,a=0;for(let t of e){if("="===t)break;let e=r.get(t);if(void 0===e)throw Error(`Invalid Base64 character: ${t}`);o=o<<6|e,(a+=6)>=8&&(a-=8,n.push(o>>a&255))}return Uint8Array.from(n)}r.d(t,{K:()=>i,z:()=>s});let i={encode(e,t={}){let r=n(!1);return o("string"==typeof e?new TextEncoder().encode(e):new Uint8Array(e),r,t.padding??!0)},decode(e){"string"!=typeof e&&(e=new TextDecoder().decode(e));let t=n(e.includes("-")||e.includes("_"));return a(e,t)}},s={encode(e,t={}){let r=n(!0);return o("string"==typeof e?new TextEncoder().encode(e):new Uint8Array(e),r,t.padding??!0)},decode(e){let t=n(e.includes("-")||e.includes("_"));return a(e,t)}}},48745:(e,t,r)=>{function n(e,t,r){function n(r,n){var o;for(let a in Object.defineProperty(r,"_zod",{value:r._zod??{},enumerable:!1}),(o=r._zod).traits??(o.traits=new Set),r._zod.traits.add(e),t(r,n),i.prototype)a in r||Object.defineProperty(r,a,{value:i.prototype[a].bind(r)});r._zod.constr=i,r._zod.def=n}let o=r?.Parent??Object;class a extends o{}function i(e){var t;let o=r?.Parent?new a:this;for(let r of(n(o,e),(t=o._zod).deferred??(t.deferred=[]),o._zod.deferred))r();return o}return Object.defineProperty(a,"name",{value:e}),Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:t=>!!r?.Parent&&t instanceof r.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}r.d(t,{$W:()=>s,GT:()=>o,cV:()=>a,cr:()=>i,xI:()=>n}),Object.freeze({status:"aborted"}),Symbol("zod_brand");class o extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class a extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}let i={};function s(e){return e&&Object.assign(i,e),i}},50380:(e,t,r)=>{r.d(t,{g:()=>n});let n=(0,r(8230).q)("a-z","0-9","A-Z","-_")},53465:(e,t,r)=>{r.d(t,{AC:()=>P,Ak:()=>l,Gl:()=>o,K3:()=>v,OI:()=>w,Os:()=>u,Rp:()=>p,Yj:()=>T,Z0:()=>a,Zg:()=>f,Zv:()=>j,ai:()=>O,ch:()=>z,fO:()=>s,gF:()=>n,hQ:()=>_,kB:()=>k,kM:()=>i,l7:()=>g,nd:()=>I,p0:()=>c,p6:()=>x,r0:()=>b,uR:()=>d,uX:()=>h,ug:()=>m,w$:()=>S,zM:()=>R,zr:()=>y});let n=/^[cC][^\s-]{8,}$/,o=/^[0-9a-z]+$/,a=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,i=/^[0-9a-vA-V]{20}$/,s=/^[A-Za-z0-9]{27}$/,l=/^[a-zA-Z0-9_-]{21}$/,c=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,u=/^([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})$/,d=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)$/,p=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function f(){return RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}let h=/^(?:(?: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])$/,m=/^(([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})$/,y=/^((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])$/,g=/^(([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])$/,v=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,b=/^[A-Za-z0-9_-]*$/,w=/^(?=.{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])?)*\.?$/,_=/^\+(?:[0-9]){6,14}[0-9]$/,E="(?:(?:\\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])))",x=RegExp(`^${E}$`);function A(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function k(e){return RegExp(`^${A(e)}$`)}function S(e){let t=A({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${t}(?:${r.join("|")})`;return RegExp(`^${E}T(?:${n})$`)}let T=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return RegExp(`^${t}$`)},I=/^\d+$/,O=/^-?\d+(?:\.\d+)?/i,R=/true|false/i,z=/null/i,P=/^[^A-Z]*$/,j=/^[^a-z]*$/},55071:(e,t,r)=>{r.d(t,{g:()=>n});let n=(e,t="ms")=>new Date(Date.now()+("sec"===t?1e3*e:e))},62822:(e,t,r)=>{r.d(t,{A:()=>
1o});var n=r(13236);let o=async e=>{if(!e.alg)throw TypeError('"alg" argument is required when "jwk.alg" is not present');let{algorithm:t,keyUsages:r}=function(e){let t,r;switch(e.kty){case"AKP":switch(e.alg){case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":t={name:e.alg},r=e.priv?["sign"]:["verify"];break;default:throw new n.T0('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)}`},r=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},r=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}`},r=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new n.T0('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},r=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},r=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},r=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},r=e.d?["deriveBits"]:[];break;default:throw new n.T0('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;
1case"OKP":switch(e.alg){case"Ed25519":case"EdDSA":t={name:"Ed25519"},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new n.T0('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new n.T0('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:r}}(e),o={...e};return"AKP"!==o.kty&&delete o.alg,delete o.use,crypto.subtle.importKey("jwk",o,t,e.ext??(!e.d&&!e.priv),e.key_ops??r)}},63375:(e,t,r)=>{r.d(t,{DG:()=>y,E6:()=>_,J:()=>w,J_:()=>c,Jk:()=>u,KH:()=>d,Kk:()=>f,NI:()=>g,QP:()=>i,RM:()=>h,Tt:()=>b,Yk:()=>p,kH:()=>v,ql:()=>m,sm:()=>l,v$:()=>E});var n=r(48745),o=r(53465),a=r(95414);let i=n.xI("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),s={number:"number",bigint:"bigint",object:"date"},l=n.xI("$ZodCheckLessThan",(e,t)=>{i.init(e,t);let r=s[typeof t.value];e._zod.onattach.push(e=>{let r=e._zod.bag,n=(t.inclusive?r.maximum:r.exclusiveMaximum)??1/0;t.value<n&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),c=n.xI("$ZodCheckGreaterThan",(e,t)=>{i.init(e,t);let r=s[typeof t.value];e._zod.onattach.push(e=>{let r=e._zod.bag,n=(t.inclusive?r.minimum:r.exclusiveMinimum)??-1/0;t.value>n&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),u=n.xI("$ZodCheckMultipleOf",(e,t)=>{i.init(e,t),e._zod.onattach.push(e=>{var r;(r=e._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof r.value?r.value%t.value===BigInt(0):0===a.LG(r.value,t.value))||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),d=n.xI("$ZodCheckNumberFormat",(e,t)=>{i.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[s,l]=a.zH[t.format];e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,n.minimum=s,n.maximum=l,r&&(n.pattern=o.nd)}),e._zod.check=o=>{let a=o.value;if(r){if(!Number.isInteger(a))return void o.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?o.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort}):o.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort}))}a<s&&o.issues.push({origin:"number",input:a,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),a>l&&o.issues.push({origin:"number",input:a,code:"too_big",maximum:l,inst:e})}}),p=n.xI("$ZodCheckMaxLength",(e,t)=>{var r;i.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!a.cl(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.maximum??1/0;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let n=r.value;if(n.length<=t.maximum)return;let o=a.Rc(n);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),f=n.xI("$ZodCheckMinLength",(e,t)=>{var r;i.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!a.cl(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.minimum??-1/0;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let n=r.value;if(n.length>=t.minimum)return;let o=a.Rc(n);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),h=n.xI("$ZodCheckLengthEquals",(e,t)=>{var r;i.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!a.cl(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=r=>{let n=r.value,o=n.length;if(o===t.length)return;let i=a.Rc(n),s=o>t.length;r.issues.push({origin:i,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),m=n.xI("$ZodCheckStringFormat",(e,t)=>{var r,n;i.init(e,t),e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),y=n.xI("$ZodCheckRegex",(e,t)=>{m.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),g=n.xI("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=o.AC),m.init(e,t)}),v=n.xI("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=o.Zv),m.init(e,t)}),b=n.xI("$ZodCheckIncludes",(e,t)=>{i.init(e,t);let r=a.$f(t.includes),n=new RegExp("number"==typeof t.position?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input
1:r.value,inst:e,continue:!t.abort})}}),w=n.xI("$ZodCheckStartsWith",(e,t)=>{i.init(e,t);let r=RegExp(`^${a.$f(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),_=n.xI("$ZodCheckEndsWith",(e,t)=>{i.init(e,t);let r=RegExp(`.*${a.$f(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),E=n.xI("$ZodCheckOverwrite",(e,t)=>{i.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}})},66196:(e,t,r)=>{r.d(t,{A:()=>n});let n=e=>{if(!function(e){return"object"==typeof e&&null!==e}(e)||"[object Object]"!==Object.prototype.toString.call(e))return!1;if(null===Object.getPrototypeOf(e))return!0;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}},66631:(e,t,r)=>{r.d(t,{Hy:()=>k,zZ:()=>S});var n=Object.defineProperty,o=Object.defineProperties,a=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,c=(e,t,r)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,u=(e,t)=>{for(var r in t||(t={}))s.call(t,r)&&c(e,r,t[r]);if(i)for(var r of i(t))l.call(t,r)&&c(e,r,t[r]);return e},d=(e,t)=>o(e,a(t)),p=class extends Error{constructor(e,t,r){super(t||e.toString(),{cause:r}),this.status=e,this.statusText=t,this.error=r}},f=async(e,t)=>{var r,n,o,a,i,s;let l=t||{},c={onRequest:[null==t?void 0:t.onRequest],onResponse:[null==t?void 0:t.onResponse],onSuccess:[null==t?void 0:t.onSuccess],onError:[null==t?void 0:t.onError],onRetry:[null==t?void 0:t.onRetry]};if(!t||!(null==t?void 0:t.plugins))return{url:e,options:l,hooks:c};for(let u of(null==t?void 0:t.plugins)||[]){if(u.init){let n=await (null==(r=u.init)?void 0:r.call(u,e.toString(),t));l=n.options||l,e=n.url}c.onRequest.push(null==(n=u.hooks)?void 0:n.onRequest),c.onResponse.push(null==(o=u.hooks)?void 0:o.onResponse),c.onSuccess.push(null==(a=u.hooks)?void 0:a.onSuccess),c.onError.push(null==(i=u.hooks)?void 0:i.onError),c.onRetry.push(null==(s=u.hooks)?void 0:s.onRetry)}return{url:e,options:l,hooks:c}},h=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},m=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}},y=async e=>{let t={},r=async e=>"function"==typeof e?await e():e;if(null==e?void 0:e.auth){if("Bearer"===e.auth.type){let n=await r(e.auth.token);if(!n)return t;t.authorization=`Bearer ${n}`}else if("Basic"===e.auth.type){let n=r(e.auth.username),o=r(e.auth.password);if(!n||!o)return t;t.authorization=`Basic ${btoa(`${n}:${o}`)}`}else if("Custom"===e.auth.type){let n=r(e.auth.value);if(!n)return t;t.authorization=`${r(e.auth.prefix)} ${n}`}}return t},g=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function v(e){if(void 0===e)return!1;let t=typeof e;return"string"===t||"number"===t||"boolean"===t||null===t||"object"===t&&(!!Array.isArray(e)||!e.buffer&&(e.constructor&&"Object"===e.constructor.name||"function"==typeof e.toJSON))}function b(e){try{return JSON.parse(e)}catch(t){return e}}function w(e){return"function"==typeof e}async function _(e){let t=new Headers(null==e?void 0:e.headers);for(let[r,n]of Object.entries(await y(e)||{}))t.set(r,n);if(!t.has("content-type")){let r=v(null==e?void 0:e.body)?"application/json":null;r&&t.set("content-type",r)}return t}
1var E=class e extends Error{constructor(t,r){super(r||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function x(e,t){let r=await e["~standard"].validate(t);if(r.issues)throw new E(r.issues);return r.value}var A=["get","post","put","patch","delete"],k=e=>async function(t,r){let n,o=d(u(u({},e),r),{plugins:[...(null==e?void 0:e.plugins)||[],(n=e||{},{id:"apply-schema",name:"Apply Schema",version:"1.0.0",async init(e,t){var r,o,a,i;let s=(null==(o=null==(r=n.plugins)?void 0:r.find(t=>{var r;return null!=(r=t.schema)&&!!r.config&&(e.startsWith(t.schema.config.baseURL||"")||e.startsWith(t.schema.config.prefix||""))}))?void 0:o.schema)||n.schema;if(s){let r=e;(null==(a=s.config)?void 0:a.prefix)&&r.startsWith(s.config.prefix)&&(r=r.replace(s.config.prefix,""),s.config.baseURL&&(e=e.replace(s.config.prefix,s.config.baseURL))),(null==(i=s.config)?void 0:i.baseURL)&&r.startsWith(s.config.baseURL)&&(r=r.replace(s.config.baseURL,""));let n=s.schema[r];if(n){let r=d(u({},t),{method:n.method,output:n.output});return(null==t?void 0:t.disableValidation)||(r=d(u({},r),{body:n.input?await x(n.input,null==t?void 0:t.body):null==t?void 0:t.body,params:n.params?await x(n.params,null==t?void 0:t.params):null==t?void 0:t.params,query:n.query?await x(n.query,null==t?void 0:t.query):null==t?void 0:t.query})),{url:e,options:r}}}return{url:e,options:t}}})]});if(null==e?void 0:e.catchAllError)try{return await S(t,o)}catch(e){return{data:null,error:{status:500,statusText:"Fetch Error",message:"Fetch related error. Captured by catchAllError option. See error property for more details.",error:e}}}return await S(t,o)},S=async(e,t)=>{var r,n,o,a,i,s,l,c;let{hooks:y,url:E,options:k}=await f(e,t),T=function(e){if(null==e?void 0:e.customFetchImpl)return e.customFetchImpl;if("undefined"!=typeof globalThis&&w(globalThis.fetch))return globalThis.fetch;if("undefined"!=typeof window&&w(window.fetch))return window.fetch;throw Error("No fetch implementation found")}(k),I=new AbortController,O=null!=(r=k.signal)?r:I.signal,R=function(e,t){let{baseURL:r,params:n,query:o}=t||{query:{},params:{},baseURL:""},a=e.startsWith("http")?e.split("/").slice(0,3).join("/"):r||"";if(e.startsWith("@")){let t=e.toString().split("@")[1].split("/")[0];A.includes(t)&&(e=e.replace(`@${t}/`,"/"))}a.endsWith("/")||(a+="/");let[i,s]=e.replace(a,"").split("?"),l=new URLSearchParams(s);for(let[e,t]of Object.entries(o||{}))null!=t&&l.set(e,String(t));if(n)if(Array.isArray(n))for(let[e,t]of i.split("/").filter(e=>e.startsWith(":")).entries()){let r=n[e];i=i.replace(t,r)}else for(let[e,t]of Object.entries(n))i=i.replace(`:${e}`,String(t));(i=i.split("/").map(encodeURIComponent).join("/")).startsWith("/")&&(i=i.slice(1));let c=l.toString();return(c=c.length>0?`?${c}`.replace(/\+/g,"%20"):"",a.startsWith("http"))?new URL(`${i}${c}`,a):`${a}${i}${c}`}(E,k),z=function(e){if(!(null==e?void 0:e.body))return null;let t=new Headers(null==e?void 0:e.headers);if(v(e.body)&&!t.has("content-type")){for(let[t,r]of Object.entries(null==e?void 0:e.body))r instanceof Date&&(e.body[t]=r.toISOString());return JSON.stringify(e.body)}return e.body}(k),P=await _(k),j=function(e,t){var r;if(null==t?void 0:t.method)return t.method.toUpperCase();if(e.startsWith("@")){let n=null==(r=e.split("@")[1])?void 0:r.split("/")[0];return A.includes(n)?n.toUpperCase():(null==t?void 0:t.body)?"POST":"GET"}return(null==t?void 0:t.body)?"POST":"GET"}(E,k),D=d(u({},k),{url:R,headers:P,body:z,method:j,signal:O});for(let e of y.onRequest)if(e){let t=await e(D);t instanceof Object&&(D=t)}("pipeTo"in D&&"function"==typeof D.pipeTo||"function"==typeof(null==(n=null==t?void 0:t.body)?void 0:n.pipe))&&!("duplex"in D)&&(D.duplex="half");let{clearTimeout:N}=function(e,t){let r;return!(null==e?void 0:e.signal)&&(null==e?void 0:e.timeout)&&(r=setTimeout(()=>null==t?void 0:t.abort(),null==e?void 0:e.timeout)),{abortTimeout:r,clearTimeout:()=>{r&&clearTimeout(r)}}}(k,I),$=await T(D.url,D);N();let C={response:$,request:D};for(let e of y.onResponse)if(e){let r=await e(d(u({},C),{response:(null==(o=null==t?void 0:t.hookOptions)?void 0:o.cloneResponse)?$.clone():$}));r instanceof Response?$=r:r instanceof Object&&($=r.response)}if($.ok){if("HEAD"===D.method)return{data:"",error:null};let e=function(e){let t=e.headers.get("content-type"),r=new Set(["image/svg","application/xml","application/xhtml","application/html"]);if(!t)return"json";let n=t.split(";").shift()||"";return g.test(n)?"json":r.has(n)||n.startsWith("text/")?"text":"blob"}($),r={data:"",response:$,request:D};if("json"===e||"text"===e){let e=await $.text(),t=null!=(a=D.jsonParser)?a:b;r.data=await t(e)}else r.data=await $[e]();for(let e of((null==D?void 0:D.output)&&D.output&&!D.disableValidation&&(r.data=await x(D.output,r.data)),y.onSuccess))e&&await e(d(u({},r),{response:(null==(i=null==t?void 0:t.hookOptions)?void 0:i.cloneResponse)?$.clone():$}));return(null==t?void 0:t.throw)?r.data:{data:r.data,error:null}}let U=null!=(s=null==t?void 0:t.jsonParser)?s:b,L=await $.text(),H=function(e){try{return JSON.parse(e),!0}catch(e){return!1}}(L),M=H?await U(L):null,Z={response:$,responseText:L,request:D,error:d(u({},M),{status:$.status,statusText:$.statusText})};for(let e of y.onError)e&&await e(d(u({},Z),{response:(null==(l=null==t?void 0:t.hookOptions)?void 0:l.cloneResponse)?$.clone():$}));if(null==t?void 0:t.retry){let r=function(e){if("number"==typeof e)return new h({type:"linear",attempts:e,delay:1e3});switch(e.type){case"linear":return new h(e);case"exponential":return new m(e);default:throw Error("Invalid retry strategy")}}(t.retry),n=null!=(c=t.retryAttempt)?c:0;if(await r.shouldAttemptRetry(n,$)){for(let e of y.onRetry)e&&await e(C);let o=r.getDelay(n);return await new Promise(e=>setTimeout(e,o)),await S(e,d(u({},t),{retryAttempt:n+1}))}}if(null==t?void 0:t.throw)throw new p($.status,$.statusText,H?M:L);return{data:null,error:d(u({},M),{status:$.status,statusText:$.statusText})}}},67642:(e,t,r)=>{r.d(t,{FA:()=>er,zp:()=>eo,vX:()=>en});var n=r(36099);function o(e){if("boolean"!=typeof e)throw Error(`boolean expected, not ${e}`)}function a(e){if(!Number.isSafeInteger(e)||e<0)throw Error("positive integer expected, got "+e)}function i(e,t,r=""){let n=e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name,o=e?.length,a=void 0!==t;if(!n||a&&o!==t)throw Error((r&&`"${r}" `)+"expected Uint8Array"+(a?` of length ${t}`:"")+", got "+(n?`length=${o}`:`type=${typeof e}`));return e}function s(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 l(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function c(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}let u=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0],d="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,p=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0")),f={_0:48,_9:57,A:65,F:70,a:97,f:102};function h(e){return e>=f._0&&e<=f._9?e-f._0:e>=f.A&&e<=f.F?e-(f.A-10):e>=f.a&&e<=f.f?e-(f.a-10):void 0}function m(e,t,r=!0){if(void 0===t)return new Uint8Array(e);if(t.length!==e)throw Error('"output" expected Uint8Array of length '+e+", got: "+t.length);if(r&&t.byteOffset%4!=0)throw Error("invalid output, must be aligned");return t}function y(e){return Uint8Array.from(e)}function g(e=32){let t="object"==typeof globalThis?globalThis.crypto:null;if("function"!=typeof t?.getRandomValues)throw Error("crypto.getRandomValues must be defined");return t.getRandomValues(new Uint8Array(e))}function v(e,t=g){let{nonceLength:r}=e;a(r);let n=(e,t)=>{let r=function(...e){let t=0;for(let r=0;r<e.length;r++){let n=e[r];i(n),t+=n.length}let r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){let o=e[t];r.set(o,n),n+=o.length}return r}(e,t);return t.fill(0),r};return(o,...a)=>({encrypt(s){i(s);
1let l=t(r),c=e(o,l,...a).encrypt(s);return c instanceof Promise?c.then(e=>n(l,e)):n(l,c)},decrypt(t){i(t);let n=t.subarray(0,r),s=t.subarray(r);return e(o,n,...a).decrypt(s)}})}let b=e=>Uint8Array.from(e.split(""),e=>e.charCodeAt(0)),w=b("expand 16-byte k"),_=b("expand 32-byte k"),E=l(w),x=l(_);function A(e,t){return e<<t|e>>>32-t}function k(e){return e.byteOffset%4==0}let S=0x100000000-1,T=Uint32Array.of();function I(e,t){let{allowShortKeys:r,extendNonceFn:n,counterLength:s,counterRight:u,rounds:d}=function(e,t){if(null==t||"object"!=typeof t)throw Error("options must be defined");return Object.assign(e,t)}({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},t);if("function"!=typeof e)throw Error("core must be a function");return a(s),a(d),o(u),o(r),(t,o,p,f,h=0)=>{let m,g;i(t,void 0,"key"),i(o,void 0,"nonce"),i(p,void 0,"data");let v=p.length;if(void 0===f&&(f=new Uint8Array(v)),i(f,void 0,"output"),a(h),h<0||h>=S)throw Error("arx: counter overflow");if(f.length<v)throw Error(`arx: output (${f.length}) is shorter than data (${v})`);let b=[],w=t.length;if(32===w)b.push(m=y(t)),g=x;else if(16===w&&r)(m=new Uint8Array(32)).set(t),m.set(t,16),g=E,b.push(m);else throw i(t,32,"arx key"),Error("invalid key size");k(o)||b.push(o=y(o));let _=l(m);if(n){if(24!==o.length)throw Error("arx: extended nonce must be 24 bytes");n(g,_,l(o.subarray(0,16)),_),o=o.subarray(16)}let A=16-s;if(A!==o.length)throw Error(`arx: nonce must be ${A} or 16 bytes`);if(12!==A){let e=new Uint8Array(12);e.set(o,u?0:12-o.length),o=e,b.push(o)}return!function(e,t,r,n,o,a,i,s){let c=o.length,u=new Uint8Array(64),d=l(u),p=k(o)&&k(a),f=p?l(o):T,h=p?l(a):T;for(let l=0;l<c;i++){if(e(t,r,n,d,i,s),i>=S)throw Error("arx: counter overflow");let m=Math.min(64,c-l);if(p&&64===m){let e=l/4;if(l%4!=0)throw Error("arx: invalid block position");for(let t=0,r;t<16;t++)h[r=e+t]=f[r]^d[t];l+=64;continue}for(let e=0,t;e<m;e++)a[t=l+e]=o[t]^u[e];l+=m}}(e,g,_,l(o),p,f,h,d),c(...b),f}}function O(e,t){return 255&e[t++]|(255&e[t++])<<8}class R{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){let t=O(e=y(i(e,32,"key")),0),r=O(e,2),n=O(e,4),o=O(e,6),a=O(e,8),s=O(e,10),l=O(e,12),c=O(e,14);this.r[0]=8191&t,this.r[1]=(t>>>13|r<<3)&8191,this.r[2]=(r>>>10|n<<6)&7939,this.r[3]=(n>>>7|o<<9)&8191,this.r[4]=(o>>>4|a<<12)&255,this.r[5]=a>>>1&8190,this.r[6]=(a>>>14|s<<2)&8191,this.r[7]=(s>>>11|l<<5)&8065,this.r[8]=(l>>>8|c<<8)&8191,this.r[9]=c>>>5&127;for(let t=0;t<8;t++)this.pad[t]=O(e,16+2*t)}process(e,t,r=!1){let{h:n,r:o}=this,a=o[0],i=o[1],s=o[2],l=o[3],c=o[4],u=o[5],d=o[6],p=o[7],f=o[8],h=o[9],m=O(e,t+0),y=O(e,t+2),g=O(e,t+4),v=O(e,t+6),b=O(e,t+8),w=O(e,t+10),_=O(e,t+12),E=O(e,t+14),x=n[0]+(8191&m),A=n[1]+((m>>>13|y<<3)&8191),k=n[2]+((y>>>10|g<<6)&8191),S=n[3]+((g>>>7|v<<9)&8191),T=n[4]+((v>>>4|b<<12)&8191),I=n[5]+(b>>>1&8191),R=n[6]+((b>>>14|w<<2)&8191),z=n[7]+((w>>>11|_<<5)&8191),P=n[8]+((_>>>8|E<<8)&8191),j=n[9]+(E>>>5|2048*!r),D=0,N=0+x*a+5*h*A+5*f*k+5*p*S+5*d*T;D=N>>>13,N&=8191,N+=5*u*I+5*c*R+5*l*z+5*s*P+5*i*j,D+=N>>>13,N&=8191;let $=D+x*i+A*a+5*h*k+5*f*S+5*p*T;D=$>>>13,$&=8191,$+=5*d*I+5*u*R+5*c*z+5*l*P+5*s*j,D+=$>>>13,$&=8191;let C=D+x*s+A*i+k*a+5*h*S+5*f*T;D=C>>>13,C&=8191,C+=5*p*I+5*d*R+5*u*z+5*c*P+5*l*j,D+=C>>>13,C&=8191;let U=D+x*l+A*s+k*i+S*a+5*h*T;D=U>>>13,U&=8191,U+=5*f*I+5*p*R+5*d*z+5*u*P+5*c*j,D+=U>>>13,U&=8191;let L=D+x*c+A*l+k*s+S*i+T*a;D=L>>>13,L&=8191,L+=5*h*I+5*f*R+5*p*z+5*d*P+5*u*j,D+=L>>>13,L&=8191;let H=D+x*u+A*c+k*l+S*s+T*i;D=H>>>13,H&=8191,H+=I*a+5*h*R+5*f*z+5*p*P+5*d*j,D+=H>>>13,H&=8191;let M=D+x*d+A*u+k*c+S*l+T*s;D=M>>>13,M&=8191,M+=I*i+R*a+5*h*z+5*f*P+5*p*j,D+=M>>>13,M&=8191;let Z=D+x*p+A*d+k*u+S*c+T*l;D=Z>>>13,Z&=8191,Z+=I*s+R*i+z*a+5*h*P+5*f*j,D+=Z>>>13,Z&=8191;let K=D+x*f+A*p+k*d+S*u+T*c;D=K>>>13,K&=8191,K+=I*l+R*s+z*i+P*a+5*h*j,D+=K>>>13,K&=8191;let W=D+x*h+A*f+k*p+S*d+T*u;D=W>>>13,W&=8191,W+=I*c+R*l+z*s+P*i+j*a,D+=W>>>13,W&=8191,N=8191&(D=(D=(D<<2)+D|0)+N|0),D>>>=13,$+=D,n[0]=N,n[1]=$,n[2]=C,n[3]=U,n[4]=L,n[5]=H,n[6]=M,n[7]=Z,n[8]=K,n[9]=W}finalize(){let{h:e,pad:t}=this,r=new Uint16Array(10),n=e[1]>>>13;e[1]&=8191;for(let t=2;t<10;t++)e[t]+=n,n=e[t]>>>13,e[t]&=8191;e[0]+=5*n,n=e[0]>>>13,e[0]&=8191,e[1]+=n,n=e[1]>>>13,e[1]&=8191,e[2]+=n,r[0]=e[0]+5,n=r[0]>>>13,r[0]&=8191;for(let t=1;t<10;t++)r[t]=e[t]+n,n=r[t]>>>13,r[t]&=8191;r[9]-=8192;let o=(1^n)-1;for(let e=0;e<10;e++)r[e]&=o;o=~o;for(let t=0;t<10;t++)e[t]=e[t]&o|r[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]=65535&a;for(let r=1;r<8;r++)a=(e[r]+t[r]|0)+(a>>>16)|0,e[r]=65535&a;c(r)}update(e){s(this),i(e);let{buffer:t,blockLen:r}=this,n=(e=y(e)).length;for(let o=0;o<n;){let a=Math.min(r-this.pos,n-o);if(a===r){for(;r<=n-o;o+=r)this.process(e,o);continue}t.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===r&&(this.process(t,0,!1),this.pos=0)}return this}destroy(){c(this.h,this.r,this.buffer,this.pad)}digestInto(e){s(this);i(e,void 0,"output");let t=this.outputLen;if(e.length<t)throw Error("digestInto() expects output buffer of length at least "+t);this.finished=!0;let{buffer:r,h:n}=this,{pos:o}=this;if(o){for(r[o++]=1;o<16;o++)r[o]=0;this.process(r,0,!0)}this.finalize();let a=0;for(let t=0;t<8;t++)e[a++]=n[t]>>>0,e[a++]=n[t]>>>8;return e}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}}let z=function(e){let t=(t,r)=>e(r).update(t).digest(),r=e(new Uint8Array(32));return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}(e=>
1new R(e));function P(e,t,r,n,o,a=20){let i=e[0],s=e[1],l=e[2],c=e[3],u=t[0],d=t[1],p=t[2],f=t[3],h=t[4],m=t[5],y=t[6],g=t[7],v=r[0],b=r[1],w=r[2],_=i,E=s,x=l,k=c,S=u,T=d,I=p,O=f,R=h,z=m,j=y,D=g,N=o,$=v,C=b,U=w;for(let e=0;e<a;e+=2)R=R+(N=A(N^(_=_+S|0),16))|0,_=_+(S=A(S^R,12))|0,R=R+(N=A(N^_,8))|0,S=A(S^R,7),z=z+($=A($^(E=E+T|0),16))|0,E=E+(T=A(T^z,12))|0,z=z+($=A($^E,8))|0,T=A(T^z,7),j=j+(C=A(C^(x=x+I|0),16))|0,x=x+(I=A(I^j,12))|0,j=j+(C=A(C^x,8))|0,I=A(I^j,7),D=D+(U=A(U^(k=k+O|0),16))|0,k=k+(O=A(O^D,12))|0,D=D+(U=A(U^k,8))|0,O=A(O^D,7),j=j+(U=A(U^(_=_+T|0),16))|0,_=_+(T=A(T^j,12))|0,j=j+(U=A(U^_,8))|0,T=A(T^j,7),D=D+(N=A(N^(E=E+I|0),16))|0,E=E+(I=A(I^D,12))|0,D=D+(N=A(N^E,8))|0,I=A(I^D,7),R=R+($=A($^(x=x+O|0),16))|0,x=x+(O=A(O^R,12))|0,R=R+($=A($^x,8))|0,O=A(O^R,7),z=z+(C=A(C^(k=k+S|0),16))|0,k=k+(S=A(S^z,12))|0,z=z+(C=A(C^k,8))|0,S=A(S^z,7);let L=0;n[L++]=i+_|0,n[L++]=s+E|0,n[L++]=l+x|0,n[L++]=c+k|0,n[L++]=u+S|0,n[L++]=d+T|0,n[L++]=p+I|0,n[L++]=f+O|0,n[L++]=h+R|0,n[L++]=m+z|0,n[L++]=y+j|0,n[L++]=g+D|0,n[L++]=o+N|0,n[L++]=v+$|0,n[L++]=b+C|0,n[L++]=w+U|0}let j=I(P,{counterRight:!1,counterLength:4,allowShortKeys:!1}),D=I(P,{counterRight:!1,counterLength:8,extendNonceFn:function(e,t,r,n){let o=e[0],a=e[1],i=e[2],s=e[3],l=t[0],c=t[1],u=t[2],d=t[3],p=t[4],f=t[5],h=t[6],m=t[7],y=r[0],g=r[1],v=r[2],b=r[3];for(let e=0;e<20;e+=2)p=p+(y=A(y^(o=o+l|0),16))|0,o=o+(l=A(l^p,12))|0,p=p+(y=A(y^o,8))|0,l=A(l^p,7),f=f+(g=A(g^(a=a+c|0),16))|0,a=a+(c=A(c^f,12))|0,f=f+(g=A(g^a,8))|0,c=A(c^f,7),h=h+(v=A(v^(i=i+u|0),16))|0,i=i+(u=A(u^h,12))|0,h=h+(v=A(v^i,8))|0,u=A(u^h,7),m=m+(b=A(b^(s=s+d|0),16))|0,s=s+(d=A(d^m,12))|0,m=m+(b=A(b^s,8))|0,d=A(d^m,7),h=h+(b=A(b^(o=o+c|0),16))|0,o=o+(c=A(c^h,12))|0,h=h+(b=A(b^o,8))|0,c=A(c^h,7),m=m+(y=A(y^(a=a+u|0),16))|0,a=a+(u=A(u^m,12))|0,m=m+(y=A(y^a,8))|0,u=A(u^m,7),p=p+(g=A(g^(i=i+d|0),16))|0,i=i+(d=A(d^p,12))|0,p=p+(g=A(g^i,8))|0,d=A(d^p,7),f=f+(v=A(v^(s=s+l|0),16))|0,s=s+(l=A(l^f,12))|0,f=f+(v=A(v^s,8))|0,l=A(l^f,7);let w=0;n[w++]=o,n[w++]=a,n[w++]=i,n[w++]=s,n[w++]=y,n[w++]=g,n[w++]=v,n[w++]=b},allowShortKeys:!1}),N=new Uint8Array(16),$=(e,t)=>{e.update(t);let r=t.length%16;r&&e.update(N.subarray(r))},C=new Uint8Array(32);function U(e,t,r,n,a){void 0!==a&&i(a,void 0,"AAD");let s=e(t,r,C),l=function(e,t,r){o(r);let n=new Uint8Array(16),a=new DataView(n.buffer,n.byteOffset,n.byteLength);return a.setBigUint64(0,BigInt(t),r),a.setBigUint64(8,BigInt(e),r),n}(n.length,a?a.length:0,!0),u=z.create(s);a&&$(u,a),$(u,n),u.update(l);let d=u.digest();return c(s,l),d}let L=e=>(t,r,n)=>({encrypt(o,a){let i=o.length;(a=m(i+16,a,!1)).set(o);let s=a.subarray(0,-16);e(t,r,s,s,1);let l=U(e,t,r,s,n);return a.set(l,i),c(l),a},decrypt(o,a){a=m(o.length-16,a,!1);let i=o.subarray(0,-16),s=o.subarray(-16),l=U(e,t,r,i,n);if(!function(e,t){if(e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e[n]^t[n];return 0===r}(s,l))throw Error("invalid tag");return a.set(o.subarray(0,-16)),e(t,r,a,a,1),c(l),a}});L(j);let H=((e,t)=>{function r(n,...o){if(i(n,void 0,"key"),!u)throw Error("Non little-endian hardware is not yet supported");void 0!==e.nonceLength&&i(o[0],e.varSizeNonce?void 0:e.nonceLength,"nonce");let a=e.tagLength;a&&void 0!==o[1]&&i(o[1],void 0,"AAD");let s=t(n,...o),l=(e,t)=>{if(void 0!==t){if(2!==e)throw Error("cipher output not supported");i(t,void 0,"output")}},c=!1;return{encrypt(e,t){if(c)throw Error("cannot encrypt() twice with same key + nonce");return c=!0,i(e),l(s.encrypt.length,t),s.encrypt(e,t)},decrypt(e,t){if(i(e),a&&e.length<a)throw Error('"ciphertext" expected length bigger than tagLength='+a);return l(s.decrypt.length,t),s.decrypt(e,t)}}}return Object.assign(r,e),r})({blockSize:64,nonceLength:24,tagLength:16},L(D));r(47366);var M=r(79678),Z=r(28100),K=r(82355),W=r(17418);let J=async(e,t,r)=>{let n=await (0,W.A)(e,t,"sign");return(0,K.A)(e,n),new Uint8Array(await crypto.subtle.sign((0,Z.A)(e,n.algorithm),n,r))};var F=r(427),B=r(13236),Y=r(89262),q=r(3171),G=r(78737),V=r(88313);class Q{#t;#r;#n;constructor(e){if(!(e instanceof Uint8Array))throw TypeError("payload must be an instance of Uint8Array");this.#t=e}setProtectedHeader(e){if(this.#r)throw TypeError("setProtectedHeader can only be called once");return this.#r=e,this}setUnprotectedHeader(e){if(this.#n)throw TypeError("setUnprotectedHeader can only be called once");return this.#n=e,this}async sign(e,t){let r;if(!this.#r&&!this.#n)throw new B.Ye("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!(0,F.A)(this.#r,this.#n))throw new B.Ye("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let n={...this.#r,...this.#n},o=(0,G.A)(B.Ye,new Map([["b64",!0]]),t?.crit,this.#r,n),a=!0;if(o.has("b64")&&"boolean"!=typeof(a=this.#r.b64))throw new B.Ye('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:i}=n;if("string"!=typeof i||!i)throw new B.Ye('JWS "alg" (Algorithm) Header Parameter missing or invalid');
1(0,q.A)(i,e,"sign");let s=this.#t;a&&(s=Y.Rd.encode((0,M.l)(s))),r=this.#r?Y.Rd.encode((0,M.l)(JSON.stringify(this.#r))):Y.Rd.encode("");let l=(0,Y.xW)(r,Y.Rd.encode("."),s),c=await (0,V.A)(e,i),u=await J(i,c,l),d={signature:(0,M.l)(u),payload:""};return a&&(d.payload=Y.D0.decode(s)),this.#n&&(d.header=this.#n),this.#r&&(d.protected=Y.D0.decode(r)),d}}class X{#o;constructor(e){this.#o=new Q(e)}setProtectedHeader(e){return this.#o.setProtectedHeader(e),this}async sign(e,t){let r=await this.#o.sign(e,t);if(void 0===r.payload)throw TypeError("use the flattened module for creating JWS with b64: false");return`${r.protected}.${r.payload}.${r.signature}`}}var ee=r(35986);class et{#r;#a;constructor(e={}){this.#a=new ee.c(e)}setIssuer(e){return this.#a.iss=e,this}setSubject(e){return this.#a.sub=e,this}setAudience(e){return this.#a.aud=e,this}setJti(e){return this.#a.jti=e,this}setNotBefore(e){return this.#a.nbf=e,this}setExpirationTime(e){return this.#a.exp=e,this}setIssuedAt(e){return this.#a.iat=e,this}setProtectedHeader(e){return this.#r=e,this}async sign(e,t){let r=new X(this.#a.data());if(r.setProtectedHeader(this.#r),Array.isArray(this.#r?.crit)&&this.#r.crit.includes("b64")&&!1===this.#r.b64)throw new B.Dp("JWTs MUST NOT use unencoded payload");return r.sign(e,t)}}async function er(e,t,r=3600){return await new et(e).setProtectedHeader({alg:"HS256"}).setIssuedAt().setExpirationTime(Math.floor(Date.now()/1e3)+r).sign(new TextEncoder().encode(t))}r(45708),r(40196),r(50380);let en=async({key:e,data:t})=>{let r=await (0,n.n)("SHA-256").digest(e),o=function(e){if("string"!=typeof e)throw Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}(t);return function(e){if(i(e),d)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=p[e[r]];return t}(v(H)(new Uint8Array(r)).encrypt(o))},eo=async({key:e,data:t})=>{let r=await (0,n.n)("SHA-256").digest(e),o=function(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);if(d)return Uint8Array.fromHex(e);let t=e.length,r=t/2;if(t%2)throw Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let t=0,o=0;t<r;t++,o+=2){let r=h(e.charCodeAt(o)),a=h(e.charCodeAt(o+1));if(void 0===r||void 0===a)throw Error('hex string expected, got non-hex character "'+(e[o]+e[o+1])+'" at index '+o);n[t]=16*r+a}return n}(t),a=v(H)(new Uint8Array(r));return new TextDecoder().decode(a.decrypt(o))}},74980:(e,t,r)=>{r.d(t,{a:()=>o});let n=new Map,o={decode:(e,t="utf-8")=>(n.has(t)||n.set(t,new TextDecoder(t)),n.get(t).decode(e)),encode:new TextEncoder().encode}},77745:(e,t,r)=>{r.d(t,{u:()=>i});var n=r(87421);let o=(e,t)=>((e,t,r,n)=>(e.events=e.events||{},e.events[r+10]||(e.events[r+10]=n(t=>{e.events[r].reduceRight((e,t)=>(t(e),e),{shared:{},...t})})),e.events[r]=e.events[r]||[],e.events[r].push(t),()=>{let n=e.events[r],o=n.indexOf(t);n.splice(o,1),n.length||(delete e.events[r],e.events[r+10](),delete e.events[r+10])}))(e,r=>{let n=t(r);n&&e.events[6].push(n)},5,t=>{let r=e.listen;e.listen=(...n)=>(e.lc||e.active||(e.active=!0,t()),r(...n));let n=e.off;return e.events[6]=[],e.off=()=>{n(),setTimeout(()=>{if(e.active&&!e.lc){for(let t of(e.active=!1,e.events[6]))t();e.events[6]=[]}},1e3)},()=>{e.listen=r,e.off=n}}),a="undefined"==typeof window,i=(e,t,r,i)=>{let s=(0,n.e)({data:null,error:null,isPending:!0,isRefetching:!1,refetch:e=>l(e)}),l=e=>{let n="function"==typeof i?i({data:s.get().data,error:s.get().error,isPending:s.get().isPending}):i;r(t,{...n,query:{...n?.query,...e?.query},async onSuccess(e){s.set({data:e.data,error:null,isPending:!1,isRefetching:!1,refetch:s.value.refetch}),await n?.onSuccess?.(e)},async onError(e){let{request:t}=e,r="number"==typeof t.retry?t.retry:t.retry?.attempts,o=t.retryAttempt||0;r&&o<r||(s.set({error:e.error,data:null,isPending:!1,isRefetching:!1,refetch:s.value.refetch}),await n?.onError?.(e))},async onRequest(e){let t=s.get();s.set({isPending:null===t.data,data:t.data,error:null,isRefetching:!0,refetch:s.value.refetch}),await n?.onRequest?.(e)}}).catch(e=>{s.set({error:e,data:null,isPending:!1,isRefetching:!1,refetch:s.value.refetch})})};e=Array.isArray(e)?e:[e];let c=!1;for(let t of e)t.subscribe(()=>{a||(c?l():o(s,()=>(setTimeout(()=>{l()},0),c=!0,()=>{s.off(),t.off()})))});return s}},78737:(e,t,r)=>{r.d(t,{A:()=>
1o});var n=r(13236);let o=(e,t,r,o,a)=>{let i;if(void 0!==a.crit&&o?.crit===void 0)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!o||void 0===o.crit)return new Set;if(!Array.isArray(o.crit)||0===o.crit.length||o.crit.some(e=>"string"!=typeof e||0===e.length))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');for(let s of(i=void 0!==r?new Map([...Object.entries(r),...t.entries()]):t,o.crit)){if(!i.has(s))throw new n.T0(`Extension Header Parameter "${s}" is not recognized`);if(void 0===a[s])throw new e(`Extension Header Parameter "${s}" is missing`);if(i.get(s)&&void 0===o[s])throw new e(`Extension Header Parameter "${s}" MUST be integrity protected`)}return new Set(o.crit)}},79678:(e,t,r)=>{r.d(t,{D:()=>o,l:()=>a});var n=r(89262);function o(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64("string"==typeof e?e:n.D0.decode(e),{alphabet:"base64url"});let t=e;t instanceof Uint8Array&&(t=n.D0.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{var r=t;if(Uint8Array.fromBase64)return Uint8Array.fromBase64(r);let e=atob(r),n=new Uint8Array(e.length);for(let t=0;t<e.length;t++)n[t]=e.charCodeAt(t);return n}catch{throw TypeError("The input to be decoded is not correctly encoded.")}}function a(e){let t=e;return("string"==typeof t&&(t=n.Rd.encode(t)),Uint8Array.prototype.toBase64)?t.toBase64({alphabet:"base64url",omitPadding:!0}):(function(e){if(Uint8Array.prototype.toBase64)return e.toBase64();let t=[];for(let r=0;r<e.length;r+=32768)t.push(String.fromCharCode.apply(null,e.subarray(r,r+32768)));return btoa(t.join(""))})(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}},82355:(e,t,r)=>{r.d(t,{A:()=>n});let n=(e,t)=>{if(e.startsWith("RS")||e.startsWith("PS")){let{modulusLength:r}=t.algorithm;if("number"!=typeof r||r<2048)throw TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}}},82551:(e,t,r)=>{r.d(t,{ll:()=>c}),r(66631),r(36677),r(77745);var n=r(40196);function o(e){return{newRole:e=>{var t;return{authorize(e,r="AND"){let o=!1;for(let[a,i]of Object.entries(e)){let e=t[a];if(!e)return{success:!1,error:`You are not allowed to access resource: ${a}`};if(Array.isArray(i))o=i.every(t=>e.includes(t));else if("object"==typeof i)o="OR"===i.connector?i.actions.some(t=>e.includes(t)):i.actions.every(t=>e.includes(t));else throw new n.B("Invalid access control request");if(o&&"OR"===r)return{success:o};if(!o&&"AND"===r)return{success:!1,error:`unauthorized to access resource "${a}"`}}return o?{success:o}:{success:!1,error:"Not authorized"}},statements:t=e}},statements:e}}let a=o({organization:["update","delete"],member:["create","update","delete"],invitation:["create","cancel"],team:["create","update","delete"],ac:["create","read","update","delete"]});a.newRole({organization:["update"],invitation:["create","cancel"],member:["create","update","delete"],team:["create","update","delete"],ac:["create","read","update","delete"]}),a.newRole({organization:["update","delete"],member:["create","update","delete"],invitation:["create","cancel"],team:["create","update","delete"],ac:["create","read","update","delete"]}),a.newRole({organization:[],member:[],invitation:[],team:[],ac:["read"]}),r(19890),r(58429),r(98009),r(47366),r(11810),r(40284),r(74980),r(12319);class i{createNewAbortSignal(){if(this.controller){let e=Error("Cancelling existing WebAuthn API call for new one");e.name="AbortError",this.controller.abort(e)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}constructor(){Object.defineProperty(this,"controller",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}}new i;let s=o({user:["create","list","set-role","ban","impersonate","delete","set-password","get","update"],session:["list","revoke","delete"]});s.newRole({user:["create","list","set-role","ban","impersonate","delete","set-password","get","update"],session:["list","revoke","delete"]}),s.newRole({user:[],session:[]}),r(36099),r(67642),r(45708),r(50380),r(23994),r(95832),r(3736),r(11534);let l=!1,c=e=>({id:"one-tap",getActions:(t,r)=>({oneTap:async(r,n)=>{if(l)return void console.warn("A Google One Tap request is already in progress. Please wait.");l=!0;try{if("undefined"==typeof window||!window.document)return void console.warn("Google One Tap is only available in browser environments");let{autoSelect:o,cancelOnTapOutside:a,context:i}=r??{},s=i??e.context??"signin";await u(),await new Promise((i,l)=>{let c=!1,u=e.promptOptions?.baseDelay??1e3,d=e.promptOptions?.maxAttempts??5;window.google?.accounts.id.initialize({client_id:e.clientId,callback:async e=>{c=!0;try{await t("/one-tap/callback",{method:"POST",body:{idToken:e.credential},...r?.fetchOptions,...n}),(!r?.fetchOptions&&!n||r?.callbackURL)&&(window.location.href=r?.callbackURL??"/"),i()}catch(e){console.error("Error during One Tap callback:",e),l(e)}}
1,auto_select:o,cancel_on_tap_outside:a,context:s,...e.additionalOptions});let p=e=>{c||window.google?.accounts.id.prompt(t=>{if(!c){if(t.isDismissedMoment&&t.isDismissedMoment())if(e<d){let t=Math.pow(2,e)*u;setTimeout(()=>p(e+1),t)}else r?.onPromptNotification?.(t);else if(t.isSkippedMoment&&t.isSkippedMoment())if(e<d){let t=Math.pow(2,e)*u;setTimeout(()=>p(e+1),t)}else r?.onPromptNotification?.(t)}})};p(0)})}catch(e){throw console.error("Error during Google One Tap flow:",e),e}finally{l=!1}}}),getAtoms:e=>({})}),u=()=>new Promise(e=>{if(window.googleScriptInitialized)return void e();let t=document.createElement("script");t.src="https://accounts.google.com/gsi/client",t.async=!0,t.defer=!0,t.onload=()=>{window.googleScriptInitialized=!0,e()},document.head.appendChild(t)})},82737:(e,t,r)=>{r.d(t,{WF:()=>e4,ND:()=>ez,EB:()=>ej,YO:()=>ta,K3:()=>eV,zM:()=>e6,Ie:()=>t$,p6:()=>tn,gM:()=>tf,Rp:()=>eN,k5:()=>tv,Nl:()=>tC,RZ:()=>tD,eu:()=>tw,_H:()=>tc,Zm:()=>tt,ch:()=>e3,ai:()=>e2,Ik:()=>ts,lq:()=>tx,g1:()=>ty,re:()=>tl,Yj:()=>eP,KC:()=>td,L5:()=>e7});var n=r(48745),o=r(63375);class a{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),r=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(r)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){return Function(...this?.args,[...(this?.content??[""]).map(e=>`  ${e}`)].join("\n"))}}var i=r(15097),s=r(53465),l=r(95414);let c={major:4,minor:1,patch:5},u=n.xI("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=c;let o=[...e._zod.def.checks??[]];for(let t of(e._zod.traits.has("$ZodCheck")&&o.unshift(e),o))for(let r of t._zod.onattach)r(e);if(0===o.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,r)=>{let o,a=l.QH(e);for(let i of t){if(i._zod.def.when){if(!i._zod.def.when(e))continue}else if(a)continue;let t=e.issues.length,s=i._zod.check(e);if(s instanceof Promise&&r?.async===!1)throw new n.GT;if(o||s instanceof Promise)o=(o??Promise.resolve()).then(async()=>{await s,e.issues.length!==t&&(a||(a=l.QH(e,t)))});else{if(e.issues.length===t)continue;a||(a=l.QH(e,t))}}return o?o.then(()=>e):e},r=(r,a,i)=>{if(l.QH(r))return r.aborted=!0,r;let s=t(a,o,i);if(s instanceof Promise){if(!1===i.async)throw new n.GT;return s.then(t=>e._zod.parse(t,i))}return e._zod.parse(s,i)};e._zod.run=(a,i)=>{if(i.skipChecks)return e._zod.parse(a,i);if("backward"===i.direction){let t=e._zod.parse({value:a.value,issues:[]},{...i,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,a,i)):r(t,a,i)}let s=e._zod.parse(a,i);if(s instanceof Promise){if(!1===i.async)throw new n.GT;return s.then(e=>t(e,o,i))}return t(s,o,i)}}e["~standard"]={validate:t=>{try{let r=(0,i.xL)(e,t);return r.success?{value:r.data}:{issues:r.error?.issues}}catch(r){return(0,i.bp)(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}}),d=n.xI("$ZodString",(e,t)=>{u.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??s.Yj(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch(e){}return"string"==typeof r.value||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),p=n.xI("$ZodStringFormat",(e,t)=>{o.ql.init(e,t),d.init(e,t)}),f=n.xI("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=s.Os),p.init(e,t)}),h=n.xI("$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(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=s.uR(e))}else t.pattern??(t.pattern=s.uR());p.init(e,t)}),m=n.xI("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=s.Rp),p.init(e,t)}),y=n.xI("$ZodURL",(e,t)=>{p.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),o=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:s.OI.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",n
1ote:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=o.href:r.value=n;return}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),g=n.xI("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=s.Zg()),p.init(e,t)}),v=n.xI("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=s.Ak),p.init(e,t)}),b=n.xI("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=s.gF),p.init(e,t)}),w=n.xI("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=s.Gl),p.init(e,t)}),_=n.xI("$ZodULID",(e,t)=>{t.pattern??(t.pattern=s.Z0),p.init(e,t)}),E=n.xI("$ZodXID",(e,t)=>{t.pattern??(t.pattern=s.kM),p.init(e,t)}),x=n.xI("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=s.fO),p.init(e,t)}),A=n.xI("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=s.w$(t)),p.init(e,t)}),k=n.xI("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=s.p6),p.init(e,t)}),S=n.xI("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=s.kB(t)),p.init(e,t)}),T=n.xI("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=s.p0),p.init(e,t)}),I=n.xI("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=s.uX),p.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv4"})}),O=n.xI("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=s.ug),p.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv6"}),e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),R=n.xI("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=s.zr),p.init(e,t)}),z=n.xI("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=s.l7),p.init(e,t),e._zod.check=r=>{let[n,o]=r.value.split("/");try{if(!o)throw Error();let e=Number(o);if(`${e}`!==o||e<0||e>128)throw Error();new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function P(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let j=n.xI("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=s.K3),p.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64"}),e._zod.check=r=>{P(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),D=n.xI("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=s.r0),p.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64url"}),e._zod.check=r=>{!function(e){if(!s.r0.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return P(t.padEnd(4*Math.ceil(t.length/4),"="))}(r.value)&&r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),N=n.xI("$ZodE164",(e,t)=>{t.pattern??(t.pattern=s.hQ),p.init(e,t)}),$=n.xI("$ZodJWT",(e,t)=>{p.init(e,t),e._zod.check=r=>{!function(e,t=null){try{let r=e.split(".");if(3!==r.length)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));if("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))return!1;return!0}catch{return!1}}(r.value,t.alg)&&r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),C=n.xI("$ZodNumber",(e,t)=>{u.init(e,t),e._zod.pattern=e._zod.bag.pattern??s.ai,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch(e){}let o=r.value;if("number"==typeof o&&!Number.isNaN(o)&&Number.isFinite(o))return r;let a="number"==typeof o?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...a?{received:a}:{}}),r}}),U=n.xI("$ZodNumber",(e,t)=>{o.KH.init(e,t),C.init(e,t)}),L=n.xI("$ZodBoolean",(e,t)=>{u.init(e,t),e._zod.pattern=s.zM,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch(e){}let o=r.value;return"boolean"==typeof o||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),H=n.xI("$ZodNull",(e,t)=>{u.init(e,t),e._zod.pattern=s.ch,e._zod.values=new Set([null]),e._zod.parse=(t,r)=>{let n=t.value;return null===n||t.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),t}}),M=n.xI("$ZodUnknown",(e,t)=>{u.init(e,t),e._zod.parse=e=>e}),Z=n.xI("$ZodNever",(e,t)=>{u.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)}),K=n.xI("$ZodDate",(e,t)=>{u.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch(e){}let o=r.value,a=o instanceof Date;return a&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...a?{received:"Invalid Date"}:{},inst:e}),r}});function W(e,t,r){e.issues.length&&t.issues.push(...l.lQ(r,e.issues)),t.value[r]=e.value}let J=n.xI("$ZodArray",(e,t)=>{u.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);let a=[];for(let e=0;e<o.length;e++){let i=o[e],s=t.element._zod.run({value:i,issues:[]},n);s instanceof Promise?a.push(s.then(t=>W(t,r,e))):W(s,r,e)}return a.length?Promise.all(a).then(()=>r):r}});function F(e,t,r,n){e.issues.length&&t.issues.push(...l.lQ(r,e.issues)),void 0===e.value?r in n&&
1(t.value[r]=void 0):t.value[r]=e.value}function B(e){let t=Object.keys(e.shape);for(let r of t)if(!e.shape[r]._zod.traits.has("$ZodType"))throw Error(`Invalid element at key "${r}": expected a Zod schema`);let r=l.NM(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function Y(e,t,r,n,o,a){let i=[],s=o.keySet,l=o.catchall._zod,c=l.def.type;for(let o of Object.keys(t)){if(s.has(o))continue;if("never"===c){i.push(o);continue}let a=l.run({value:t[o],issues:[]},n);a instanceof Promise?e.push(a.then(e=>F(e,r,o,t))):F(a,r,o,t)}return(i.length&&r.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:a}),e.length)?Promise.all(e).then(()=>r):r}let q=n.xI("$ZodObject",(e,t)=>{let r;u.init(e,t);let n=l.PO(()=>B(t));l.gJ(e._zod,"propValues",()=>{let e=t.shape,r={};for(let t in e){let n=e[t]._zod;if(n.values)for(let e of(r[t]??(r[t]=new Set),n.values))r[t].add(e)}return r});let o=l.Gv,a=t.catchall;e._zod.parse=(t,i)=>{r??(r=n.value);let s=t.value;if(!o(s))return t.issues.push({expected:"object",code:"invalid_type",input:s,inst:e}),t;t.value={};let l=[],c=r.shape;for(let e of r.keys){let r=c[e]._zod.run({value:s[e],issues:[]},i);r instanceof Promise?l.push(r.then(r=>F(r,t,e,s))):F(r,t,e,s)}return a?Y(l,s,t,i,n.value,e):l.length?Promise.all(l).then(()=>t):t}}),G=n.xI("$ZodObjectJIT",(e,t)=>{let r,o;q.init(e,t);let i=e._zod.parse,s=l.PO(()=>B(t)),c=l.Gv,u=!n.cr.jitless,d=l.hI,p=u&&d.value,f=t.catchall;e._zod.parse=(n,d)=>{o??(o=s.value);let h=n.value;return c(h)?u&&p&&d?.async===!1&&!0!==d.jitless?(r||(r=(e=>{let t=new a(["shape","payload","ctx"]),r=s.value,n=e=>{let t=l.UQ(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");let o=Object.create(null),i=0;for(let e of r.keys)o[e]=`key_${i++}`;for(let e of(t.write("const newResult = {}"),r.keys)){let r=o[e],a=l.UQ(e);t.write(`const ${r} = ${n(e)};`),t.write(`
2        if (${r}.issues.length) {
3          payload.issues = payload.issues.concat(${r}.issues.map(iss => ({
4            ...iss,
5            path: iss.path ? [${a}, ...iss.path] : [${a}]
6          })));
7        }
8        
9        if (${r}.value === undefined) {
10          if (${a} in input) {
11            newResult[${a}] = undefined;
12          }
13        } else {
14          newResult[${a}] = ${r}.value;
15        }
16      `)}t.write("payload.value = newResult;"),t.write("return payload;");let c=t.compile();return(t,r)=>c(e,t,r)})(t.shape)),n=r(n,d),f)?Y([],h,n,d,o,e):n:i(n,d):(n.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),n)}});function V(e,t,r,o){for(let r of e)if(0===r.issues.length)return t.value=r.value,t;let a=e.filter(e=>!l.QH(e));return 1===a.length?(t.value=a[0].value,a[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>l.iR(e,o,n.$W())))}),t)}let Q=n.xI("$ZodUnion",(e,t)=>{u.init(e,t),l.gJ(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),l.gJ(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),l.gJ(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),l.gJ(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=>l.p6(e.source)).join("|")})$`)}});let r=1===t.options.length,n=t.options[0]._zod.run;e._zod.parse=(o,a)=>{if(r)return n(o,a);let i=!1,s=[];for(let e of t.options){let t=e._zod.run({value:o.value,issues:[]},a);if(t instanceof Promise)s.push(t),i=!0;else{if(0===t.issues.length)return t;s.push(t)}}return i?Promise.all(s).then(t=>V(t,o,e,a)):V(s,o,e,a)}}),X=n.xI("$ZodDiscriminatedUnion",(e,t)=>{Q.init(e,t);let r=e._zod.parse;l.gJ(e._zod,"propValues",()=>{let e={};for(let r of t.options){let n=r._zod.propValues;if(!n||0===Object.keys(n).length)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let[t,r]of Object.entries(n))for(let n of(e[t]||(e[t]=new Set),r))e[t].add(n)}return e});let n=l.PO(()=>{let e=t.options,r=new Map;for(let n of e){let e=n._zod.propValues?.[t.discriminator];if(!e||0===e.size)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let t of e){if(r.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);r.set(t,n)}}return r});e._zod.parse=(o,a)=>{let i=o.value;if(!l.Gv(i))return o.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),o;let s=n.value.get(i?.[t.discriminator]);return s?s._zod.run(o,a):t.unionFallback?r(o,a):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:i,path:[t.discriminator],inst:e}),o)}}),ee=n.xI("$ZodIntersection",(e,t)=>{u.init(e,t),e._zod.parse=(e,r)=>{let n=e.value,o=t.left._zod.run({value:n,issues:[]},r),a=t.right._zod.run({value:n,issues:[]},r);return o instanceof Promise||a instanceof Promise?Promise.all([o,a]).then(([t,r])=>et(e,t,r)):et(e,o,a)}});function et(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),l.QH(e))return e;let n=function e(t,r){if(t===r||t instanceof Date&&r instanceof Date&&+t==+r)return{valid:!0,data:t};if(l.Qd(t)&&l.Qd(r)){let n=Object.keys(r),o=Object.keys(t).filter(e=>-1!==n.indexOf(e)),a={...t,...r};for(let n of o){let o=e(t[n],r[n]);
16if(!o.valid)return{valid:!1,mergeErrorPath:[n,...o.mergeErrorPath]};a[n]=o.data}return{valid:!0,data:a}}if(Array.isArray(t)&&Array.isArray(r)){if(t.length!==r.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let o=0;o<t.length;o++){let a=e(t[o],r[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}(t.value,r.value);if(!n.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}let er=n.xI("$ZodRecord",(e,t)=>{u.init(e,t),e._zod.parse=(r,o)=>{let a=r.value;if(!l.Qd(a))return r.issues.push({expected:"record",code:"invalid_type",input:a,inst:e}),r;let i=[];if(t.keyType._zod.values){let n,s=t.keyType._zod.values;for(let e of(r.value={},s))if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){let n=t.valueType._zod.run({value:a[e],issues:[]},o);n instanceof Promise?i.push(n.then(t=>{t.issues.length&&r.issues.push(...l.lQ(e,t.issues)),r.value[e]=t.value})):(n.issues.length&&r.issues.push(...l.lQ(e,n.issues)),r.value[e]=n.value)}for(let e in a)s.has(e)||(n=n??[]).push(e);n&&n.length>0&&r.issues.push({code:"unrecognized_keys",input:a,inst:e,keys:n})}else for(let s of(r.value={},Reflect.ownKeys(a))){if("__proto__"===s)continue;let c=t.keyType._zod.run({value:s,issues:[]},o);if(c instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(c.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(e=>l.iR(e,o,n.$W())),input:s,path:[s],inst:e}),r.value[c.value]=c.value;continue}let u=t.valueType._zod.run({value:a[s],issues:[]},o);u instanceof Promise?i.push(u.then(e=>{e.issues.length&&r.issues.push(...l.lQ(s,e.issues)),r.value[c.value]=e.value})):(u.issues.length&&r.issues.push(...l.lQ(s,u.issues)),r.value[c.value]=u.value)}return i.length?Promise.all(i).then(()=>r):r}}),en=n.xI("$ZodEnum",(e,t)=>{u.init(e,t);let r=l.w5(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=RegExp(`^(${r.filter(e=>l.qQ.has(typeof e)).map(e=>"string"==typeof e?l.$f(e):e.toString()).join("|")})$`),e._zod.parse=(t,o)=>{let a=t.value;return n.has(a)||t.issues.push({code:"invalid_value",values:r,input:a,inst:e}),t}}),eo=n.xI("$ZodLiteral",(e,t)=>{if(u.init(e,t),0===t.values.length)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=>"string"==typeof e?l.$f(e):e?l.$f(e.toString()):String(e)).join("|")})$`),e._zod.parse=(r,n)=>{let o=r.value;return e._zod.values.has(o)||r.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),r}}),ea=n.xI("$ZodTransform",(e,t)=>{u.init(e,t),e._zod.parse=(r,o)=>{if("backward"===o.direction)throw new n.cV(e.constructor.name);let a=t.transform(r.value,r);if(o.async)return(a instanceof Promise?a:Promise.resolve(a)).then(e=>(r.value=e,r));if(a instanceof Promise)throw new n.GT;return r.value=a,r}});function ei(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}let es=n.xI("$ZodOptional",(e,t)=>{u.init(e,t),e._zod.optin="optional",e._zod.optout="optional",l.gJ(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),l.gJ(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${l.p6(e.source)})?$`):void 0}),e._zod.parse=(e,r)=>{if("optional"===t.innerType._zod.optin){let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(t=>ei(t,e.value)):ei(n,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,r)}}),el=n.xI("$ZodNullable",(e,t)=>{u.init(e,t),l.gJ(e._zod,"optin",()=>t.innerType._zod.optin),l.gJ(e._zod,"optout",()=>t.innerType._zod.optout),l.gJ(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${l.p6(e.source)}|null)$`):void 0}),l.gJ(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,r)=>null===e.value?e:t.innerType._zod.run(e,r)}),ec=n.xI("$ZodDefault",(e,t)=>{u.init(e,t),e._zod.optin="optional",l.gJ(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);if(void 0===e.value)return e.value=t.defaultValue,e;let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(e=>
16eu(e,t)):eu(n,t)}});function eu(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let ed=n.xI("$ZodPrefault",(e,t)=>{u.init(e,t),e._zod.optin="optional",l.gJ(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>("backward"===r.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,r))}),ep=n.xI("$ZodNonOptional",(e,t)=>{u.init(e,t),l.gJ(e._zod,"values",()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(t=>ef(t,e)):ef(o,e)}});function ef(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}let eh=n.xI("$ZodCatch",(e,t)=>{u.init(e,t),l.gJ(e._zod,"optin",()=>t.innerType._zod.optin),l.gJ(e._zod,"optout",()=>t.innerType._zod.optout),l.gJ(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);let o=t.innerType._zod.run(e,r);return o instanceof Promise?o.then(o=>(e.value=o.value,o.issues.length&&(e.value=t.catchValue({...e,error:{issues:o.issues.map(e=>l.iR(e,r,n.$W()))},input:e.value}),e.issues=[]),e)):(e.value=o.value,o.issues.length&&(e.value=t.catchValue({...e,error:{issues:o.issues.map(e=>l.iR(e,r,n.$W()))},input:e.value}),e.issues=[]),e)}}),em=n.xI("$ZodPipe",(e,t)=>{u.init(e,t),l.gJ(e._zod,"values",()=>t.in._zod.values),l.gJ(e._zod,"optin",()=>t.in._zod.optin),l.gJ(e._zod,"optout",()=>t.out._zod.optout),l.gJ(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,r)=>{if("backward"===r.direction){let n=t.out._zod.run(e,r);return n instanceof Promise?n.then(e=>ey(e,t.in,r)):ey(n,t.in,r)}let n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>ey(e,t.out,r)):ey(n,t.out,r)}});function ey(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}let eg=n.xI("$ZodReadonly",(e,t)=>{u.init(e,t),l.gJ(e._zod,"propValues",()=>t.innerType._zod.propValues),l.gJ(e._zod,"values",()=>t.innerType._zod.values),l.gJ(e._zod,"optin",()=>t.innerType._zod.optin),l.gJ(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(ev):ev(n)}});function ev(e){return e.value=Object.freeze(e.value),e}let eb=n.xI("$ZodLazy",(e,t)=>{u.init(e,t),l.gJ(e._zod,"innerType",()=>t.getter()),l.gJ(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),l.gJ(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),l.gJ(e._zod,"optin",()=>e._zod.innerType._zod.optin??void 0),l.gJ(e._zod,"optout",()=>e._zod.innerType._zod.optout??void 0),e._zod.parse=(t,r)=>e._zod.innerType._zod.run(t,r)}),ew=n.xI("$ZodCustom",(e,t)=>{o.QP.init(e,t),u.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(t=>e_(t,r,n,e));e_(o,r,n,e)}});function e_(e,t,r,n){if(!e){let e={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(e.params=n._zod.def.params),t.issues.push(l.sn(e))}}var eE=r(97193),ex=r(6322);let eA=n.xI("ZodISODateTime",(e,t)=>{A.init(e,t),ej.init(e,t)}),ek=n.xI("ZodISODate",(e,t)=>{k.init(e,t),ej.init(e,t)}),eS=n.xI("ZodISOTime",(e,t)=>{S.init(e,t),ej.init(e,t)}),eT=n.xI("ZodISODuration",(e,t)=>{T.init(e,t),ej.init(e,t)});var eI=r(91414);let eO=n.xI("ZodType",(e,t)=>(u.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),e.clone=(t,r)=>l.o8(e,t,r),e.brand=()=>e,e.register=(t,r)=>(t.add(e,r),e),e.parse=(t,r)=>eI.qg(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>eI.xL(e,t,r),e.parseAsync=async(t,r)=>eI.EJ(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>eI.bp(e,t,r),e.spa=e.safeParseAsync,e.encode=(t,r)=>eI.lF(e,t,r),e.decode=(t,r)=>eI.D4(e,t,r),e.encodeAsync=async(t,r)=>eI.X$(e,t,r),e.decodeAsync=async(t,r)=>eI.Re(e,t,r),e.safeEncode=(t,r)=>eI.wy(e,t,r),e.safeDecode=(t,r)=>eI.ex(e,t,r),e.safeEncodeAsync=async(t,r)=>eI.EM(e,t,r),e.safeDecodeAsync=async(t,r)=>eI.yR(e,t,r),e.refine=(t,r)=>e.check(function(e,t={}){return ex.fU(tN,e,t)}(t,r)),e.superRefine=t=>{var r;return e.check((r=t,ex.MB(r)))},e.overwrite=t=>
16e.check(ex.bS(t)),e.optional=()=>tx(e),e.nullable=()=>tk(e),e.nullish=()=>tx(tk(e)),e.nonoptional=t=>{var r,n;return r=e,n=t,new tI({type:"nonoptional",innerType:r,...l.A2(n)})},e.array=()=>ta(e),e.or=t=>td([e,t]),e.and=t=>new th({type:"intersection",left:e,right:t}),e.transform=t=>tz(e,new t_({type:"transform",transform:t})),e.default=t=>(function(e,t){return new tS({type:"default",innerType:e,get defaultValue(){return"function"==typeof t?t():l.yG(t)}})})(e,t),e.prefault=t=>(function(e,t){return new tT({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof t?t():l.yG(t)}})})(e,t),e.catch=t=>(function(e,t){return new tO({type:"catch",innerType:e,catchValue:"function"==typeof t?t:()=>t})})(e,t),e.pipe=t=>tz(e,t),e.readonly=()=>new tP({type:"readonly",innerType:e}),e.describe=t=>{let r=e.clone();return eE.fd.add(r,{description:t}),r},Object.defineProperty(e,"description",{get:()=>eE.fd.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return eE.fd.get(e);let r=e.clone();return eE.fd.add(r,t[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),eR=n.xI("_ZodString",(e,t)=>{d.init(e,t),eO.init(e,t);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...t)=>e.check(ex.Fk(...t)),e.includes=(...t)=>e.check(ex.dR(...t)),e.startsWith=(...t)=>e.check(ex.$S(...t)),e.endsWith=(...t)=>e.check(ex.ER(...t)),e.min=(...t)=>e.check(ex.m9(...t)),e.max=(...t)=>e.check(ex.Eb(...t)),e.length=(...t)=>e.check(ex.YA(...t)),e.nonempty=(...t)=>e.check(ex.m9(1,...t)),e.lowercase=t=>e.check(ex.hH(t)),e.uppercase=t=>e.check(ex.qF(t)),e.trim=()=>e.check(ex.WN()),e.normalize=(...t)=>e.check(ex.lo(...t)),e.toLowerCase=()=>e.check(ex.Il()),e.toUpperCase=()=>e.check(ex.xY())}),ez=n.xI("ZodString",(e,t)=>{d.init(e,t),eR.init(e,t),e.email=t=>e.check(ex.Mu(eD,t)),e.url=t=>e.check(ex.Fn(eU,t)),e.jwt=t=>e.check(ex.rk(e0,t)),e.emoji=t=>e.check(ex.aC(eL,t)),e.guid=t=>e.check(ex.tB(e$,t)),e.uuid=t=>e.check(ex.Be(eC,t)),e.uuidv4=t=>e.check(ex.nA(eC,t)),e.uuidv6=t=>e.check(ex.pY(eC,t)),e.uuidv7=t=>e.check(ex.wA(eC,t)),e.nanoid=t=>e.check(ex.Dl(eH,t)),e.guid=t=>e.check(ex.tB(e$,t)),e.cuid=t=>e.check(ex.fs(eM,t)),e.cuid2=t=>e.check(ex.Bj(eZ,t)),e.ulid=t=>e.check(ex.Ct(eK,t)),e.base64=t=>e.check(ex.rt(eG,t)),e.base64url=t=>e.check(ex.cU(eQ,t)),e.xid=t=>e.check(ex.Pw(eW,t)),e.ksuid=t=>e.check(ex._z(eJ,t)),e.ipv4=t=>e.check(ex.Ny(eF,t)),e.ipv6=t=>e.check(ex.$O(eB,t)),e.cidrv4=t=>e.check(ex.Uy(eY,t)),e.cidrv6=t=>e.check(ex.gP(eq,t)),e.e164=t=>e.check(ex.KB(eX,t)),e.datetime=t=>e.check(ex.G1(eA,t)),e.date=t=>e.check(ex.db(ek,t)),e.time=t=>e.check(ex.Kn(eS,t)),e.duration=t=>e.check(ex.f2(eT,t))});function eP(e){return ex.Rl(ez,e)}let ej=n.xI("ZodStringFormat",(e,t)=>{p.init(e,t),eR.init(e,t)}),eD=n.xI("ZodEmail",(e,t)=>{m.init(e,t),ej.init(e,t)});function eN(e){return ex.Mu(eD,e)}let e$=n.xI("ZodGUID",(e,t)=>{f.init(e,t),ej.init(e,t)}),eC=n.xI("ZodUUID",(e,t)=>{h.init(e,t),ej.init(e,t)}),eU=n.xI("ZodURL",(e,t)=>{y.init(e,t),ej.init(e,t)}),eL=n.xI("ZodEmoji",(e,t)=>{g.init(e,t),ej.init(e,t)}),eH=n.xI("ZodNanoID",(e,t)=>{v.init(e,t),ej.init(e,t)}),eM=n.xI("ZodCUID",(e,t)=>{b.init(e,t),ej.init(e,t)}),eZ=n.xI("ZodCUID2",(e,t)=>{w.init(e,t),ej.init(e,t)}),eK=n.xI("ZodULID",(e,t)=>{_.init(e,t),ej.init(e,t)}),eW=n.xI("ZodXID",(e,t)=>{E.init(e,t),ej.init(e,t)}),eJ=n.xI("ZodKSUID",(e,t)=>{x.init(e,t),ej.init(e,t)}),eF=n.xI("ZodIPv4",(e,t)=>{I.init(e,t),ej.init(e,t)}),eB=n.xI("ZodIPv6",(e,t)=>{O.init(e,t),ej.init(e,t)}),eY=n.xI("ZodCIDRv4",(e,t)=>{R.init(e,t),ej.init(e,t)}),eq=n.xI("ZodCIDRv6",(e,t)=>{z.init(e,t),ej.init(e,t)}),eG=n.xI("ZodBase64",(e,t)=>{j.init(e,t),ej.init(e,t)});function eV(e){return ex.rt(eG,e)}let eQ=n.xI("ZodBase64URL",(e,t)=>{D.init(e,t),ej.init(e,t)}),eX=n.xI("ZodE164",(e,t)=>{N.init(e,t),ej.init(e,t)}),e0=n.xI("ZodJWT",(e,t)=>{$.init(e,t),ej.init(e,t)}),e1=n.xI("ZodNumber",(e,t)=>{C.init(e,t),eO.init(e,t),e.gt=(t,r)=>e.check(ex.Tx(t,r)),e.gte=(t,r)=>e.check(ex.qm(t,r)),e.min=(t,r)=>e.check(ex.qm(t,r)),e.lt=(t,r)=>e.check(ex.Au(t,r)),e.lte=(t,r)=>e.check(ex.Zm(t,r)),e.max=(t,r)=>e.check(ex.Zm(t,r)),e.int=t=>{var r;return e.check((r=t,ex.LK(e5,r)))},e.safe=t=>{var r;return e.check((r=t,ex.LK(e5,r)))},e.positive=t=>e.check(ex.Tx(0,t)),e.nonnegative=t=>e.check(ex.qm(0,t)),e.negative=t=>e.check(ex.Au(0,t)),e.nonpositive=t=>e.check(ex.Zm(0,t)),e.multipleOf=(t,r)=>e.check(ex.Hi(t,r)),e.step=(t,r)=>e.check(ex.Hi(t,r)),e.finite=()=>e;let r=e._zod.bag;e.minValue=Math.max(r.minimum??-1/0,r.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(r.maximum??1/0,r.exclusiveMaximum??1/0)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function e2(e){return ex.F7(e1,e)}let e5=n.xI("ZodNumberFormat",(e,t)=>{U.init(e,t),e1.init(e,t)}),e4=n.xI("ZodBoolean",(e,t)=>{L.init(e,t),eO.init(e,t)});function e6(e){return ex._L(e4,e)}let e8=n.xI("ZodNull",(e,t)=>{H.init(e,t),eO.init(e,t)});function e3(e){return ex.jw(e8,e)}let e9=n.xI("ZodUnknown",(e,t)=>{M.init(e,t),eO.init(e,t)});function e7(){return ex.em(e9)}let te=n.xI("ZodNever",(e,t)=>{Z.init(e,t),eO.init(e,t)});function tt(e){return ex.G8(te,e)}let tr=n.xI("ZodDate",(e,t)=>{K.init(e,t),eO.init(e,t),e.min=(t,r)=>e.check(ex.qm(t,r)),e.max=(t,r)=>e.check(ex.Zm(t,r));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function tn(e){return ex.YY(tr,e)}let to=n.xI("ZodArray",(e,t)=>{J.init(e,t),eO.init(e,t),e.element=t.element,e.min=(t,r)=>e.check(ex.m9(t,r)),e.nonempty=t=>e.check(ex.m9(1,t)),e.max=(t,r)=>e.check(ex.Eb(t,r)),e.length=(t,r)=>e.check(ex.YA(t,r)),e.unwrap=()=>e.element});function ta(e,t){return ex.dZ(to,e,t)}let ti=n.xI("ZodObject",(e,t)=>{G.init(e,t),eO.init(e,t),l.gJ(e,"shape",()=>t.shape),e.keyof=()=>tv(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:e7()}),e.loose=()=>e.clone({...e._zod.def,catchall:e7()}),e.strict=()=>e.clone({...e._zod.def,catchall:tt()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>l.X$(e,t),e.safeExtend=t=>l.W0(e,t),e.merge=t=>l.h1(e,t),e.pick=t=>l.Up(e,t),e.omit=t=>l.cJ(e,t),e.partial=(...t)=>l.OH(tE,e,t[0]),e.required=(...t)=>l.mw(tI,e,t[0])});function ts(e,t){return new ti({type:"object",get shape(){return l.Vy(this,"shape",e?l.ZV(e):{}),this.shape},...l.A2(t)})}function tl(e,t){return new ti({type:"object",get shape(){return l.Vy(this,"shape",l.ZV(e)),this.shape},catchall:tt(),...l.A2(t)})}function tc(e,t){return new ti({type:"object",get shape(){return l.Vy(this,"shape",l.ZV(e)),this.shape},catchall:e7(),...l.A2(t)})}let tu=n.xI("ZodUnion",(e,t)=>{Q.init(e,t),eO.init(e,t),e.options=t.options});function td(e,t){return new tu({type:"union",options:e,...l.A2(t)})}let tp=n.xI("ZodDiscriminatedUnion",(e,t)=>{tu.init(e,t),X.init(e,t)});function tf(e,t,r){return new tp({type:"union",options:t,discriminator:e,...l.A2(r)})}let th=n.xI("ZodIntersection",(e,t)=>{ee.init(e,t),eO.init(e,t)}),tm=n.xI("ZodRecord",(e,t)=>{er.init(e,t),eO.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function ty(e,t,r){return new tm({type:"record",keyType:e,valueType:t,...l.A2(r)})}let tg=n.xI("ZodEnum",(e,t)=>{en.init(e,t),eO.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(e,n)=>{let o={};for(let n of e)if(r.has(n))o[n]=t.entries[n];else throw Error(`Key ${n} not found in enum`);
16return new tg({...t,checks:[],...l.A2(n),entries:o})},e.exclude=(e,n)=>{let o={...t.entries};for(let t of e)if(r.has(t))delete o[t];else throw Error(`Key ${t} not found in enum`);return new tg({...t,checks:[],...l.A2(n),entries:o})}});function tv(e,t){return new tg({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...l.A2(t)})}let tb=n.xI("ZodLiteral",(e,t)=>{eo.init(e,t),eO.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 tw(e,t){return new tb({type:"literal",values:Array.isArray(e)?e:[e],...l.A2(t)})}let t_=n.xI("ZodTransform",(e,t)=>{ea.init(e,t),eO.init(e,t),e._zod.parse=(r,o)=>{if("backward"===o.direction)throw new n.cV(e.constructor.name);r.addIssue=n=>{"string"==typeof n?r.issues.push(l.sn(n,r.value,t)):(n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=r.value),n.inst??(n.inst=e),r.issues.push(l.sn(n)))};let a=t.transform(r.value,r);return a instanceof Promise?a.then(e=>(r.value=e,r)):(r.value=a,r)}}),tE=n.xI("ZodOptional",(e,t)=>{es.init(e,t),eO.init(e,t),e.unwrap=()=>e._zod.def.innerType});function tx(e){return new tE({type:"optional",innerType:e})}let tA=n.xI("ZodNullable",(e,t)=>{el.init(e,t),eO.init(e,t),e.unwrap=()=>e._zod.def.innerType});function tk(e){return new tA({type:"nullable",innerType:e})}let tS=n.xI("ZodDefault",(e,t)=>{ec.init(e,t),eO.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),tT=n.xI("ZodPrefault",(e,t)=>{ed.init(e,t),eO.init(e,t),e.unwrap=()=>e._zod.def.innerType}),tI=n.xI("ZodNonOptional",(e,t)=>{ep.init(e,t),eO.init(e,t),e.unwrap=()=>e._zod.def.innerType}),tO=n.xI("ZodCatch",(e,t)=>{eh.init(e,t),eO.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),tR=n.xI("ZodPipe",(e,t)=>{em.init(e,t),eO.init(e,t),e.in=t.in,e.out=t.out});function tz(e,t){return new tR({type:"pipe",in:e,out:t})}let tP=n.xI("ZodReadonly",(e,t)=>{eg.init(e,t),eO.init(e,t),e.unwrap=()=>e._zod.def.innerType}),tj=n.xI("ZodLazy",(e,t)=>{eb.init(e,t),eO.init(e,t),e.unwrap=()=>e._zod.def.getter()});function tD(e){return new tj({type:"lazy",getter:e})}let tN=n.xI("ZodCustom",(e,t)=>{ew.init(e,t),eO.init(e,t)});function t$(e,t){return ex.FO(tN,e??(()=>!0),t)}function tC(e,t={error:`Input not instance of ${e.name}`}){let r=new tN({type:"custom",check:"custom",fn:t=>t instanceof e,abort:!0,...l.A2(t)});return r._zod.bag.Class=e,r}},84597:(e,t,r)=>{let n;r.d(t,{RD:()=>m});var o=r(13236),a=r(38295),i=r(66196);function s(e){return(0,i.A)(e)}class l{#i;#s=new WeakMap;constructor(e){if(!function(e){return e&&"object"==typeof e&&Array.isArray(e.keys)&&e.keys.every(s)}(e))throw new o.Dm("JSON Web Key Set malformed");this.#i=structuredClone(e)}jwks(){return this.#i}async getKey(e,t){let{alg:r,kid:n}={...e,...t?.header},a=function(e){switch("string"==typeof e&&e.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";case"ML":return"AKP";default:throw new o.T0('Unsupported "alg" value for a JSON Web Key Set')}}(r),i=this.#i.keys.filter(e=>{let t=a===e.kty;if(t&&"string"==typeof n&&(t=n===e.kid),t&&("string"==typeof e.alg||"AKP"===a)&&(t=r===e.alg),t&&"string"==typeof e.use&&(t="sig"===e.use),t&&Array.isArray(e.key_ops)&&(t=e.key_ops.includes("verify")),t)switch(r){case"ES256":t="P-256"===e.crv;break;case"ES384":t="P-384"===e.crv;break;case"ES512":t="P-521"===e.crv;break;
16case"Ed25519":case"EdDSA":t="Ed25519"===e.crv}return t}),{0:s,length:l}=i;if(0===l)throw new o.BT;if(1!==l){let e=new o.$4,t=this.#s;throw e[Symbol.asyncIterator]=async function*(){for(let e of i)try{yield await c(t,e,r)}catch{}},e}return c(this.#s,s,r)}}async function c(e,t,r){let n=e.get(t)||e.set(t,{}).get(t);if(void 0===n[r]){let e=await (0,a.Og)({...t,ext:!0},r);if(e instanceof Uint8Array||"public"!==e.type)throw new o.Dm("JSON Web Key Set members must be public keys");n[r]=e}return n[r]}function u(e){let t=new l(e),r=async(e,r)=>t.getKey(e,r);return Object.defineProperties(r,{jwks:{value:()=>structuredClone(t.jwks()),enumerable:!1,configurable:!1,writable:!1}}),r}"undefined"!=typeof navigator&&navigator.userAgent?.startsWith?.("Mozilla/5.0 ")||(n="jose/v6.1.0");let d=Symbol();async function p(e,t,r,n=fetch){let a=await n(e,{method:"GET",signal:r,redirect:"manual",headers:t}).catch(e=>{if("TimeoutError"===e.name)throw new o.xb;throw e});if(200!==a.status)throw new o.i4("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await a.json()}catch{throw new o.i4("Failed to parse the JSON Web Key Set HTTP response as JSON")}}let f=Symbol();class h{#l;#c;#u;#d;#p;#f;#h;#m;#y;#g;constructor(e,t){if(!(e instanceof URL))throw TypeError("url must be an instance of URL");this.#l=new URL(e.href),this.#c="number"==typeof t?.timeoutDuration?t?.timeoutDuration:5e3,this.#u="number"==typeof t?.cooldownDuration?t?.cooldownDuration:3e4,this.#d="number"==typeof t?.cacheMaxAge?t?.cacheMaxAge:6e5,this.#h=new Headers(t?.headers),n&&!this.#h.has("User-Agent")&&this.#h.set("User-Agent",n),this.#h.has("accept")||(this.#h.set("accept","application/json"),this.#h.append("accept","application/jwk-set+json")),this.#m=t?.[d],t?.[f]!==void 0&&(this.#g=t?.[f],function(e,t){return!("object"!=typeof e||null===e||!("uat"in e)||"number"!=typeof e.uat||Date.now()-e.uat>=t)&&"jwks"in e&&!!(0,i.A)(e.jwks)&&!!Array.isArray(e.jwks.keys)&&!!Array.prototype.every.call(e.jwks.keys,i.A)}(t?.[f],this.#d)&&(this.#p=this.#g.uat,this.#y=u(this.#g.jwks)))}pendingFetch(){return!!this.#f}coolingDown(){return"number"==typeof this.#p&&Date.now()<this.#p+this.#u}fresh(){return"number"==typeof this.#p&&Date.now()<this.#p+this.#d}jwks(){return this.#y?.jwks()}async getKey(e,t){this.#y&&this.fresh()||await this.reload();try{return await this.#y(e,t)}catch(r){if(r instanceof o.BT&&!1===this.coolingDown())return await this.reload(),this.#y(e,t);throw r}}async reload(){this.#f&&("undefined"!=typeof WebSocketPair||"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"undefined"!=typeof EdgeRuntime&&"vercel"===EdgeRuntime)&&(this.#f=void 0),this.#f||=p(this.#l.href,this.#h,AbortSignal.timeout(this.#c),this.#m).then(e=>{this.#y=u(e),this.#g&&(this.#g.uat=Date.now(),this.#g.jwks=e),this.#p=Date.now(),this.#f=void 0}).catch(e=>{throw this.#f=void 0,e}),await this.#f}}function m(e,t){let r=new h(e,t),n=async(e,t)=>r.getKey(e,t);return Object.defineProperties(n,{coolingDown:{get:()=>r.coolingDown(),enumerable:!0,configurable:!1},fresh:{get:()=>r.fresh(),enumerable:!0,configurable:!1},reload:{value:()=>r.reload(),enumerable:!0,configurable:!1,writable:!1},reloading:{get:()=>r.pendingFetch(),enumerable:!0,configurable:!1},jwks:{value:()=>r.jwks(),enumerable:!0,configurable:!1,writable:!1}}),n}},87421:(e,t,r)=>{r.d(t,{e:()=>i});let n=[],o=0,a=0,i=e=>{let t=[],r={get:()=>(r.lc||r.listen(()=>{})(),r.value),lc:0,listen:e=>(r.lc=t.push(e),()=>{for(let t=o+4;t<n.length;)n[t]===e?n.splice(t,4):t+=4;let a=t.indexOf(e);~a&&(t.splice(a,1),--r.lc||r.off())}),notify(e,i){a++;let s=!n.length;for(let o of t)n.push(o,r.value,e,i);if(s){for(o=0;o<n.length;o+=4)n[o](n[o+1],n[o+2],n[o+3]);n.length=0}},off(){},set(e){let t=r.value;t!==e&&(r.value=e,r.notify(t))},subscribe(e){let t=r.listen(e);return e(r.value),t},value:e};return r}},88313:(e,t,r)=>{let n;r.d(t,{A:()=>c});var o=r(13493),a=r(79678),i=r(62822),s=r(5540);let l=async(e,t,r,o=!1)=>{let a=(n||=new WeakMap).get(e);if(a?.[r])return a[r];let s=await (0,i.A)({...t,alg:r});return o&&Object.freeze(e),a?a[r]=s:n.set(e,{[r]:s}),s},c=async(e,t)=>{if(e instanceof Uint8Array||(0,s.R7)(e))return e;
16if((0,s.D2)(e)){if("secret"===e.type)return e.export();if("toCryptoKey"in e&&"function"==typeof e.toCryptoKey)try{return((e,t)=>{let r,o=(n||=new WeakMap).get(e);if(o?.[t])return o[t];let a="public"===e.type,i=!!a;if("x25519"===e.asymmetricKeyType){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")}r=e.toCryptoKey(e.asymmetricKeyType,i,a?[]:["deriveBits"])}if("ed25519"===e.asymmetricKeyType){if("EdDSA"!==t&&"Ed25519"!==t)throw TypeError("given KeyObject instance cannot be used for this algorithm");r=e.toCryptoKey(e.asymmetricKeyType,i,[a?"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");r=e.toCryptoKey(e.asymmetricKeyType,i,[a?"verify":"sign"])}if("rsa"===e.asymmetricKeyType){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,a?["encrypt"]:["decrypt"]);r=e.toCryptoKey({name:t.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:n},i,[a?"verify":"sign"])}if("ec"===e.asymmetricKeyType){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");"ES256"===t&&"P-256"===n&&(r=e.toCryptoKey({name:"ECDSA",namedCurve:n},i,[a?"verify":"sign"])),"ES384"===t&&"P-384"===n&&(r=e.toCryptoKey({name:"ECDSA",namedCurve:n},i,[a?"verify":"sign"])),"ES512"===t&&"P-521"===n&&(r=e.toCryptoKey({name:"ECDSA",namedCurve:n},i,[a?"verify":"sign"])),t.startsWith("ECDH-ES")&&(r=e.toCryptoKey({name:"ECDH",namedCurve:n},i,a?[]:["deriveBits"]))}if(!r)throw TypeError("given KeyObject instance cannot be used for this algorithm");return o?o[t]=r:n.set(e,{[t]:r}),r})(e,t)}catch(e){if(e instanceof TypeError)throw e}let r=e.export({format:"jwk"});return l(e,r,t)}if((0,o.ll)(e))return e.k?(0,a.D)(e.k):l(e,e,t,!0);throw Error("unreachable")}},89262:(e,t,r)=>{r.d(t,{D0:()=>o,Rd:()=>n,xW:()=>a});let n=new TextEncoder,o=new TextDecoder;function a(...e){let t=new Uint8Array(e.reduce((e,{length:t})=>e+t,0)),r=0;for(let n of e)t.set(n,r),r+=n.length;return t}},90114:(e,t,r)=>{r.d(t,{Yj:()=>a,zM:()=>i});var n=r(6322),o=r(82737);function a(e){return n.K_(o.ND,e)}function i(e){return n.dN(o.WF,e)}},91414:(e,t,r)=>{r.d(t,{D4:()=>h,Re:()=>y,lF:()=>f,X$:()=>m,qg:()=>c,EJ:()=>u,ex:()=>v,yR:()=>w,wy:()=>g,EM:()=>b,xL:()=>d,bp:()=>p});var n=r(15097),o=r(22889),a=r(48745),i=r(95414);let s=(e,t)=>{o.a$.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>o.Wk(e,t)},flatten:{value:t=>o.JM(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,i.k8,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,i.k8,2)}},isEmpty:{get:()=>0===e.issues.length}})};a.xI("ZodError",s);let l=a.xI("ZodError",s,{Parent:Error}),c=n.Tj(l),u=n.Rb(l),d=n.Od(l),p=n.wG(l),f=n.Mv(l),h=n.e2(l),m=n.GW(l),y=n.or(l),g=n.rh(l),v=n.VS(l),b=n.v_(l),w=n.R3(l)},93834:(e,t,r)=>{r.d(t,{V:()=>v});var n=r(79678),o=r(28100),a=r(82355),i=r(17418);let s=async(e,t,r,n)=>{let s=await (0,i.A)(e,t,"verify");(0,a.A)(e,s);let l=(0,o.A)(e,s.algorithm);try{return await crypto.subtle.verify(l,s,r,n)}catch{return!1}};var l=r(13236),c=r(89262),u=r(427),d=r(66196),p=r(3171),f=r(78737),h=r(88313);async function m(e,t,r){let o,a;if(!(0,d.A)(e))throw new l.Ye("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new l.Ye('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new l.Ye("JWS Protected Header incorrect type");if(void 0===e.payload)throw new l.Ye("JWS Payload missing");if("string"!=typeof e.signature)throw new l.Ye("JWS Signature missing or incorrect type");if(void 0!==e.header&&!(0,d.A)(e.header))throw new l.Ye("JWS Unprotected Header incorrect type");let i={};if(e.protected)try{let t=(0,n.D)(e.protected);i=JSON.parse(c.D0.decode(t))}
16catch{throw new l.Ye("JWS Protected Header is invalid")}if(!(0,u.A)(i,e.header))throw new l.Ye("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let m={...i,...e.header},y=(0,f.A)(l.Ye,new Map([["b64",!0]]),r?.crit,i,m),g=!0;if(y.has("b64")&&"boolean"!=typeof(g=i.b64))throw new l.Ye('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:v}=m;if("string"!=typeof v||!v)throw new l.Ye('JWS "alg" (Algorithm) Header Parameter missing or invalid');let b=r&&((e,t)=>{if(void 0!==t&&(!Array.isArray(t)||t.some(e=>"string"!=typeof e)))throw TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)})("algorithms",r.algorithms);if(b&&!b.has(v))throw new l.Rb('"alg" (Algorithm) Header Parameter value not allowed');if(g){if("string"!=typeof e.payload)throw new l.Ye("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new l.Ye("JWS Payload must be a string or an Uint8Array instance");let w=!1;"function"==typeof t&&(t=await t(i,e),w=!0),(0,p.A)(v,t,"verify");let _=(0,c.xW)(c.Rd.encode(e.protected??""),c.Rd.encode("."),"string"==typeof e.payload?c.Rd.encode(e.payload):e.payload);try{o=(0,n.D)(e.signature)}catch{throw new l.Ye("Failed to base64url decode the signature")}let E=await (0,h.A)(t,v);if(!await s(v,E,o,_))throw new l.h2;if(g)try{a=(0,n.D)(e.payload)}catch{throw new l.Ye("Failed to base64url decode the payload")}else a="string"==typeof e.payload?c.Rd.encode(e.payload):e.payload;let x={payload:a};return(void 0!==e.protected&&(x.protectedHeader=i),void 0!==e.header&&(x.unprotectedHeader=e.header),w)?{...x,key:E}:x}async function y(e,t,r){if(e instanceof Uint8Array&&(e=c.D0.decode(e)),"string"!=typeof e)throw new l.Ye("Compact JWS must be a string or Uint8Array");let{0:n,1:o,2:a,length:i}=e.split(".");if(3!==i)throw new l.Ye("Invalid Compact JWS");let s=await m({payload:o,protected:n,signature:a},t,r),u={payload:s.payload,protectedHeader:s.protectedHeader};return"function"==typeof t?{...u,key:s.key}:u}var g=r(35986);async function v(e,t,r){let n=await y(e,t,r);if(n.protectedHeader.crit?.includes("b64")&&!1===n.protectedHeader.b64)throw new l.Dp("JWTs MUST NOT use unencoded payload");let o={payload:(0,g.k)(n.protectedHeader,n.payload,r),protectedHeader:n.protectedHeader};return"function"==typeof t?{...o,key:n.key}:o}},94454:(e,t,r)=>{r.d(t,{UY:()=>a,aK:()=>o});let n=globalThis.crypto,o=n.subtle,a=e=>n.getRandomValues(e)},95414:(e,t,r)=>{function n(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function o(e,t){return"bigint"==typeof t?t.toString():t}function a(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function i(e){return null==e}function s(e){let t=+!!e.startsWith("^"),r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function l(e,t){let r=(e.toString().split(".")[1]||"").length,n=t.toString(),o=(n.split(".")[1]||"").length;if(0===o&&/\d?e-\d?/.test(n)){let e=n.match(/\d?e-(\d?)/);e?.[1]&&(o=Number.parseInt(e[1]))}let a=r>o?r:o;return Number.parseInt(e.toFixed(a).replace(".",""))%Number.parseInt(t.toFixed(a).replace(".",""))/10**a}r.d(t,{$f:()=>_,A2:()=>x,Gv:()=>y,LG:()=>l,NM:()=>A,OH:()=>z,PO:()=>a,QH:()=>j,Qd:()=>v,Rc:()=>C,UQ:()=>h,Up:()=>S,Vy:()=>p,W0:()=>O,X$:()=>I,ZV:()=>d,cJ:()=>T,cl:()=>i,gJ:()=>u,gx:()=>m,h1:()=>R,hI:()=>g,iR:()=>$,k8:()=>o,lQ:()=>D,mw:()=>P,o8:()=>E,p6:()=>s,qQ:()=>w,sn:()=>U,w5:()=>n,yG:()=>b,zH:()=>k});let c=Symbol("evaluating");function u(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==c)return void 0===n&&(n=c,n=r()),n},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function d(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function p(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function f(...e){let t={};for(let r of e)Object.assign(t,Object.getOwnPropertyDescriptors(r));return Object.defineProperties({},t)}function h(e){return JSON.stringify(e)}let m="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function y(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let g=a(()=>
16{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function v(e){if(!1===y(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!1!==y(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function b(e){return v(e)?{...e}:e}let w=new Set(["string","number","symbol"]);function _(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function E(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function x(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}function A(e){return Object.keys(e).filter(t=>"optional"===e[t]._zod.optin&&"optional"===e[t]._zod.optout)}let k={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function S(e,t){let r=e._zod.def,n=f(e._zod.def,{get shape(){let e={};for(let n in t){if(!(n in r.shape))throw Error(`Unrecognized key: "${n}"`);t[n]&&(e[n]=r.shape[n])}return p(this,"shape",e),e},checks:[]});return E(e,n)}function T(e,t){let r=e._zod.def,n=f(e._zod.def,{get shape(){let n={...e._zod.def.shape};for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete n[e]}return p(this,"shape",n),n},checks:[]});return E(e,n)}function I(e,t){if(!v(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0)throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let n=f(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return p(this,"shape",r),r},checks:[]});return E(e,n)}function O(e,t){if(!v(t))throw Error("Invalid input to safeExtend: expected a plain object");let r={...e._zod.def,get shape(){let r={...e._zod.def.shape,...t};return p(this,"shape",r),r},checks:e._zod.def.checks};return E(e,r)}function R(e,t){let r=f(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return p(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return E(e,r)}function z(e,t,r){let n=f(t._zod.def,{get shape(){let n=t._zod.def.shape,o={...n};if(r)for(let t in r){if(!(t in n))throw Error(`Unrecognized key: "${t}"`);r[t]&&(o[t]=e?new e({type:"optional",innerType:n[t]}):n[t])}else for(let t in n)o[t]=e?new e({type:"optional",innerType:n[t]}):n[t];return p(this,"shape",o),o},checks:[]});return E(t,n)}function P(e,t,r){let n=f(t._zod.def,{get shape(){let n=t._zod.def.shape,o={...n};if(r)for(let t in r){if(!(t in o))throw Error(`Unrecognized key: "${t}"`);r[t]&&(o[t]=new e({type:"nonoptional",innerType:n[t]}))}else for(let t in n)o[t]=new e({type:"nonoptional",innerType:n[t]});return p(this,"shape",o),o},checks:[]});return E(t,n)}function j(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function D(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function N(e){return"string"==typeof e?e:e?.message}function $(e,t,r){let n={...e,path:e.path??[]};return e.message||(n.message=N(e.inst?._zod.def?.error?.(e))??N(t?.error?.(e))??N(r.customError?.(e))??N(r.localeError?.(e))??"Invalid input"),delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function C(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function U(...e){let[t,r,n]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:n}:{...t}}},95832:(e,t,r)=>{r.d(t,{b:()=>s,d:()=>c,s:()=>l});var n=r(40196),o=r(55071);r(36677);var a=r(47366),i=r(11810);async function s(e,t){if(e.context.options.session?.cookieCache?.enabled){let r={session:Object.entries(t.session).reduce((t,[r,n])=>{let o=e.context.options.session?.additionalFields?.[r];return o&&!1===o.returned||(t[r]=n),t},{}),user:t.user},s=(0,o.g)(e.context.authCookies.sessionData.options.maxAge||60,"sec").getTime(),l=a.z.encode(JSON.stringify({session:r,expiresAt:s,signature:await (0,i.s)("SHA-256","base64urlnopad").sign(e.context.secret,JSON.stringify({...r,expiresAt:s}))}),{padding:!1});if(l.length>4093)throw new n.B("Session data is too large to store in the cookie. Please disable session cookie caching or reduce the size of the session data");e.setCookie(e.context.authCookies.sessionData.name,l,e.context.authCookies.sessionData.options)}}async function l(e,t,r,n){let o=await e.getSignedCookie(e.context.authCookies.dontRememberToken.name,e.context.secret);r=void 0!==r?r:!!o;let a=e.context.authCookies.sessionToken.options,i=r?void 0:e.context.sessionConfig.expires
16In;await e.setSignedCookie(e.context.authCookies.sessionToken.name,t.session.token,e.context.secret,{...a,maxAge:i,...n}),r&&await e.setSignedCookie(e.context.authCookies.dontRememberToken.name,"true",e.context.secret,e.context.authCookies.dontRememberToken.options),await s(e,t),e.context.setNewSession(t),e.context.options.secondaryStorage&&await e.context.secondaryStorage?.set(t.session.token,JSON.stringify({user:t.user,session:t.session}),Math.floor((new Date(t.session.expiresAt).getTime()-Date.now())/1e3))}function c(e,t){e.setCookie(e.context.authCookies.sessionToken.name,"",{...e.context.authCookies.sessionToken.options,maxAge:0}),e.setCookie(e.context.authCookies.sessionData.name,"",{...e.context.authCookies.sessionData.options,maxAge:0}),t||e.setCookie(e.context.authCookies.dontRememberToken.name,"",{...e.context.authCookies.dontRememberToken.options,maxAge:0})}r(3736),r(23994),r(74980)},97193:(e,t,r)=>{r.d(t,{fd:()=>o,rs:()=>n}),Symbol("ZodOutput"),Symbol("ZodInput");class n{constructor(){this._map=new Map,this._idmap=new Map}add(e,...t){let r=t[0];if(this._map.set(e,r),r&&"object"==typeof r&&"id"in r){if(this._idmap.has(r.id))throw Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.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&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}let o=new n},98009:(e,t,r)=>{r.d(t,{B:()=>m,a:()=>h,c:()=>f,f:()=>b,g:()=>g,s:()=>v});var n=r(19890),o=r(55071),a=r(95832),i=r(82737),s=r(90114),l=r(3736),c=r(11810),u=r(47366),d=r(74980);let p=(0,n.Ny)(async()=>({})),f=n.Ny.create({use:[p,(0,n.Ny)(async()=>({}))]}),h=n.UD.create({use:[p]}),m={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. 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."},y=i.lq(i.Ik({disableCookieCache:s.zM().meta({description:"Disable cookie cache and fetch session from database"}).optional(),disableRefresh:s.zM().meta({description:"Disable session refresh. Useful for checking session status, without updating the session"}).optional()})),g=async(e,t)=>{if(e.context.session)return e.context.session;let r=await h("/get-session",{method:"GET",query:y,requireHeaders:!0,metadata:{openapi:{description:"Get the current session",responses:{200:{description:"Success",content:{"application/json":{schema:{type:"object",properties:{session:{$ref:"#/components/schemas/Session"},user:{$ref:"#/components/schemas/User"}},required:["session","user"]}}}}}}}},async e=>{try{let t=await e.getSignedCookie(e.context.authCookies.sessionToken.name,e.context.secret);if(!t)return null;let r=e.getCookie(e.context.authCookies.sessionData.name),n=r?(0,l.s)(d.a.decode(u.z.decode(r))):null;if(n&&!await (0,c.s)("SHA-256","base64urlnopad").verify(e.context.secret,JSON.stringify({...n.session,expiresAt:n.expiresAt}),n.signature)){let t=e.context.authCookies.sessionData.name;return e.setCookie(t,"",{maxAge:0}
16),e.json(null)}let i=await e.getSignedCookie(e.context.authCookies.dontRememberToken.name,e.context.secret);if(n?.session&&e.context.options.session?.cookieCache?.enabled&&!e.query?.disableCookieCache){let t=n.session;if(!(n.expiresAt<Date.now()||t.session.expiresAt<new Date))return e.context.session=t,e.json(t);{let t=e.context.authCookies.sessionData.name;e.setCookie(t,"",{maxAge:0})}}let s=await e.context.internalAdapter.findSession(t);if(e.context.session=s,!s||s.session.expiresAt<new Date)return(0,a.d)(e),s&&await e.context.internalAdapter.deleteSession(s.session.token),e.json(null);if(i||e.query?.disableRefresh)return e.json(s);let p=e.context.sessionConfig.expiresIn,f=e.context.sessionConfig.updateAge;if(s.session.expiresAt.valueOf()-1e3*p+1e3*f<=Date.now()&&(!e.query?.disableRefresh||!e.context.options.session?.disableSessionRefresh)){let t=await e.context.internalAdapter.updateSession(s.session.token,{expiresAt:(0,o.g)(e.context.sessionConfig.expiresIn,"sec"),updatedAt:new Date});if(!t)return(0,a.d)(e),e.json(null,{status:401});let r=(t.expiresAt.valueOf()-Date.now())/1e3;return await (0,a.s)(e,{session:t,user:s.user},!1,{maxAge:r}),e.json({session:t,user:s.user})}return await (0,a.b)(e,s),e.json(s)}catch(t){throw e.context.logger.error("INTERNAL_SERVER_ERROR",t),new n.LG("INTERNAL_SERVER_ERROR",{message:m.FAILED_TO_GET_SESSION})}})({...e,asResponse:!1,headers:e.headers,returnHeaders:!1,query:{...t,...e.query}}).catch(e=>null);return e.context.session=r,r},v=f(async e=>{let t=await g(e);if(!t?.session)throw new n.LG("UNAUTHORIZED");return{session:t}});f(async e=>{let t=await g(e);if(!t?.session&&(e.request||e.headers))throw new n.LG("UNAUTHORIZED");return{session:t}});let b=f(async e=>{let t=await g(e);if(!t?.session)throw new n.LG("UNAUTHORIZED");if(0===e.context.sessionConfig.freshAge)return{session:t};let r=e.context.sessionConfig.freshAge,o=t.session.updatedAt?.valueOf()||t.session.createdAt.valueOf();if(!(Date.now()-o<1e3*r))throw new n.LG("FORBIDDEN",{message:"Session is not fresh"});return{session:t}});h("/revoke-session",{method:"POST",body:i.Ik({token:i.Yj().meta({description:"The token to revoke"})}),use:[v],requireHeaders:!0,metadata:{openapi:{description:"Revoke a single session",requestBody:{content:{"application/json":{schema:{type:"object",properties:{token:{type:"string",description:"The token to revoke"}},required:["token"]}}}},responses:{200:{description:"Success",content:{"application/json":{schema:{type:"object",properties:{status:{type:"boolean",description:"Indicates if the session was revoked successfully"}},required:["status"]}}}}}}}},async e=>{let t=e.body.token,r=await e.context.internalAdapter.findSession(t);if(!r)throw new n.LG("BAD_REQUEST",{message:"Session not found"});if(r.session.userId!==e.context.session.user.id)throw new n.LG("UNAUTHORIZED");try{await e.context.internalAdapter.deleteSession(t)}catch(t){throw e.context.logger.error(t&&"object"==typeof t&&"name"in t?t.name:"",t),new n.LG("INTERNAL_SERVER_ERROR")}return e.json({status:!0})}),h("/revoke-sessions",{method:"POST",use:[v],requireHeaders:!0,metadata:{openapi:{description:"Revoke all sessions for the user",responses:{200:{description:"Success",content:{"application/json":{schema:{type:"object",properties:{status:{type:"boolean",description:"Indicates if all sessions were revoked successfully"}},required:["status"]}}}}}}}},async e=>{try{await e.context.internalAdapter.deleteSessions(e.context.session.user.id)}catch(t){throw e.context.logger.error(t&&"object"==typeof t&&"name"in t?t.name:"",t),new n.LG("INTERNAL_SERVER_ERROR")}return e.json({status:!0})}),h("/revoke-other-sessions",{method:"POST",requireHeaders:!0,use:[v],metadata:{openapi:{description:"Revoke all other sessions for the user except the current one",responses:{200:{description:"Success",content:{"application/json":{schema:{type:"object",properties:{status:{type:"boolean",description:"Indicates if all other sessions were revoked successfully"}},required:["status"]}}}}}}}},async e=>{let t=e.context.session;if(!t.user)throw new n.LG("UNAUTHORIZED");
16let r=(await e.context.internalAdapter.listSessions(t.user.id)).filter(e=>e.expiresAt>new Date).filter(t=>t.token!==e.context.session.session.token);return await Promise.all(r.map(t=>e.context.internalAdapter.deleteSession(t.token))),e.json({status:!0})})}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.