PageSourceSearch

https://chinabrush.art/_next/static/chunks/3735-166ab3de3eb2527a.js

js chinabrush.art collected 2026-10-07 15:11:29 UTC 109,231 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3735],{1475:(e,t,r)=>{"use strict";r.d(t,{g:()=>n});let n=(e,t="ms")=>new Date(Date.now()+("sec"===t?1e3*e:e))},2174:(e,t,r)=>{"use strict";r.d(t,{FD:()=>m,MY:()=>s,PJ:()=>i,Wl:()=>c,XP:()=>d,_x:()=>o,bL:()=>f,po:()=>l,ql:()=>u,wO:()=>a,yL:()=>w});var n=r(55036);function o(e){return("object"==typeof e?null==e.host&&null==e.hostname:!/^[a-z]+:/i.test(e))&&!function(e){let t="object"==typeof e?e.pathname:e;return null!=t&&!t.startsWith("/")}(e)}function s(e,t){return e.replace(RegExp(`^${t}`),"")||"/"}function i(e,t){let r=e;return/^\/(\?.*)?$/.test(t)&&(t=t.slice(1)),r+=t}function a(e,t){return t===e||t.startsWith(`${e}/`)}function c(e,t,r){return"string"==typeof e?e:e[t]||r}function l(e){let t=function(){try{return"true"===n.env._next_intl_trailing_slash}catch{return!1}}(),[r,...o]=e.split("#"),s=o.join("#"),i=r;if("/"!==i){let e=i.endsWith("/");t&&!e?i+="/":!t&&e&&(i=i.slice(0,-1))}return s&&(i+="#"+s),i}function u(e,t){let r=l(e),n=l(t);return(function(e){let t=e.replace(/\[\[(\.\.\.[^\]]+)\]\]/g,"?(.*)").replace(/\[(\.\.\.[^\]]+)\]/g,"(.+)").replace(/\[([^\]]+)\]/g,"([^/]+)");return RegExp(`^${t}$`)})(r).test(n)}function d(e,t){return"never"!==t.mode&&t.prefixes?.[e]||f(e)}function f(e){return"/"+e}function p(e){return e.includes("[[...")}function h(e){return e.includes("[...")}function y(e){return e.includes("[")}function g(e,t){let r=e.split("/"),n=t.split("/"),o=Math.max(r.length,n.length);for(let e=0;e<o;e++){let t=r[e],o=n[e];if(!t&&o)return -1;if(t&&!o)return 1;if(t||o){if(!y(t)&&y(o))return -1;if(y(t)&&!y(o))return 1;if(!h(t)&&h(o))return -1;if(h(t)&&!h(o))return 1;if(!p(t)&&p(o))return -1;if(p(t)&&!p(o))return 1}}return 0}function m(e){return e.sort(g)}function w(e){return"function"==typeof e.then}},9400:(e,t,r)=>{"use strict";r.d(t,{D:()=>o,l:()=>s});var n=r(48673);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,"/");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 s(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,"_")}},10709:(e,t,r)=>{"use strict";r.d(t,{$4:()=>f,BT:()=>d,Dm:()=>u,Dp:()=>l,Rb:()=>i,T0:()=>a,Ye:()=>c,h2:()=>h,i4:()=>n,ie:()=>o,n:()=>s,xb:()=>p});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 s 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 a extends n{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"}class c extends n{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"}class l 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 f 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 p 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)}}},11889:(e,t,r)=>{"use strict";r.d(t,{cE:()=>f,k6:()=>d});var n=r(10709),o=r(48673),s=r(88969);let i=e=>Math.floor(e.getTime()/1e3),a=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;function c(e){let t,r=a.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}function l(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 a,l;let f,p;try{f=JSON.parse(o.D0.decode(t))}catch{}if(!(0,s.G)(f))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',f,"typ","check_failed");let{requiredClaims:y=[],issuer:g,subject:m,audience:w,maxTokenAge:b}=r,E=[...y];for(let e of(void 0!==b&&E.push("iat"),void 0!==w&&E.push("aud"),void 0!==m&&E.push("sub"),void 0!==g&&E.push("iss"),new Set(E.reverse())))if(!(e in f))throw new n.ie(`missing required "${e}" claim`,f,e,"missing");if(g&&!(Array.isArray(g)?g:[g]).includes(f.iss))throw new n.ie('unexpected "iss" claim value',f,"iss","check_failed");if(m&&f.sub!==m)throw new n.ie('unexpected "sub" claim value',f,"sub","check_failed");if(w&&(a=f.aud,l="string"==typeof w?[w]:w,"string"==typeof a?!l.includes(a):!(Array.isArray(a)&&l.some(Set.prototype.has.bind(new Set(a))))))throw new n.ie('unexpected "aud" claim value',f,"aud","check_failed");switch(typeof r.clockTolerance){case"string":p=c(r.clockTolerance);break;case"number":p=r.clockTolerance;break;case"undefined":p=0;break;default:throw TypeError("Invalid clockTolerance option type")}let{currentDate:A}=r,S=i(A||new Date);if((void 0!==f.iat||b)&&"number"!=typeof f.iat)throw new n.ie('"iat" claim must be a number',f,"iat","invalid");if(void 0!==f.nbf){if("number"!=typeof f.nbf)throw new n.ie('"nbf" claim must be a number',f,"nbf","invalid");if(f.nbf>S+p)throw new n.ie('"nbf" claim timestamp check failed',f,"nbf","check_failed")}if(void 0!==f.exp){if("number"!=typeof f.exp)throw new n.ie('"exp" claim must be a number',f,"exp","invalid");if(f.exp<=S-p)throw new n.n('"exp" claim timestamp check failed',f,"exp","check_failed")}if(b){let e=S-f.iat;if(e-p>("number"==typeof b?b:c(b)))throw new n.n('"iat" claim timestamp check failed (too far in the past)',f,"iat","check_failed");if(e<0-p)throw new n.ie('"iat" claim timestamp check failed (it should be in the past)',f,"iat","check_failed")}return f}class f{#e;constructor(e){if(!(0,s.G)(e))throw TypeError("JWT Claims Set MUST be an object");this.#e=structuredClone(e)}data(){return o.Rd.encode(JSON.stringify(this.#e))}get iss(){return this.#e.iss}set iss(e){this.#e.iss=e}get sub(){return this.#e.sub}set sub(e){this.#e.sub=e}get aud(){return this.#e.aud}set aud(e){this.#e.aud=e}set jti(e){this.#e.jti=e}set nbf(e){"number"==typeof e?this.#e.nbf=l("setNotBefore",e):e instanceof Date?this.#e.nbf=l("setNotBefore",i(e)):this.#e.nbf=i(new Date)+c(e)}set exp(e){"number"==typeof e?this.#e.exp=l("setExpirationTime",e):e instanceof Date?this.#e.exp=l("setExpirationTime",i(e)):this.#e.exp=i(new Date)+c(e)}set iat(e){void 0===e?this.#e.iat=i(new Date):e instanceof Date?this.#e.iat=l("setIssuedAt",i(e)):"string"==typeof e?this.#e.iat=l("setIssuedAt",i(new Date)+c(e)):this.#e.iat=l("setIssuedAt",e)}}},12810:(e,t,r)=>{"use strict";r.d(t,{i:()=>a});var n=r(9400),o=r(48673),s=r(88969),i=r(10709);function a(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:a,length:c}=e.split(".");if(5===c)throw new i.Dp("Only JWTs using Compact JWS serialization can be decoded");
1if(3!==c)throw new i.Dp("Invalid JWT");if(!a)throw new i.Dp("JWTs must contain a payload");try{t=(0,n.D)(a)}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,s.G)(r))throw new i.Dp("Invalid JWT Claims Set");return r}},13059:(e,t,r)=>{"use strict";r.d(t,{DT:()=>c,FP:()=>i,TK:()=>o,Zn:()=>s,aM:()=>a,x3:()=>l});var n=r(2174);function o(e){return"string"==typeof e?{pathname:e}:e}function s(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e))Array.isArray(n)?n.forEach(e=>{t.append(r,String(e))}):t.set(r,String(n));return"?"+t.toString()}function i({pathname:e,locale:t,params:r,pathnames:o,query:i}){function a(e){let a,c=o[e];return c?(a=(0,n.Wl)(c,t,e),r&&Object.entries(r).forEach(([e,t])=>{let r,n;Array.isArray(t)?(r=`(\\[)?\\[...${e}\\](\\])?`,n=t.map(e=>String(e)).join("/")):(r=`\\[${e}\\]`,n=String(t)),a=a.replace(RegExp(r,"g"),n)}),a=(a=a.replace(/\[\[\.\.\..+\]\]/g,"")).split("/").map(e=>encodeURIComponent(e)).join("/")):a=e,a=(0,n.po)(a),i&&(a+=s(i)),a}if("string"==typeof e)return a(e);{let{pathname:t,...r}=e;return{...r,pathname:a(t)}}}function a(e,t,r){let o=(0,n.FD)(Object.keys(r)),s=decodeURI(t);for(let t of o){let o=r[t];if("string"==typeof o){if((0,n.ql)(o,s))return t}else if((0,n.ql)((0,n.Wl)(o,e,t),s))return t}return t}function c(e,t=window.location.pathname){return"/"===e?t:t.replace(e,"")}function l(e,t,r,o){let s,{mode:i}=r.localePrefix;return void 0!==o?s=o:(0,n._x)(e)&&("always"===i?s=!0:"as-needed"===i&&(s=r.domains?!r.domains.some(e=>e.defaultLocale===t):t!==r.defaultLocale)),s?(0,n.PJ)((0,n.XP)(t,r.localePrefix),e):e}},14763:(e,t,r)=>{"use strict";r.d(t,{Hy:()=>O,zZ:()=>R});var n=Object.defineProperty,o=Object.defineProperties,s=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable,l=(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={}))a.call(t,r)&&l(e,r,t[r]);if(i)for(var r of i(t))c.call(t,r)&&l(e,r,t[r]);return e},d=(e,t)=>o(e,s(t)),f=class extends Error{constructor(e,t,r){super(t||e.toString(),{cause:r}),this.status=e,this.statusText=t,this.error=r}},p=async(e,t)=>{var r,n,o,s,i,a;let c=t||{},l={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:c,hooks:l};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));c=n.options||c,e=n.url}l.onRequest.push(null==(n=u.hooks)?void 0:n.onRequest),l.onResponse.push(null==(o=u.hooks)?void 0:o.onResponse),l.onSuccess.push(null==(s=u.hooks)?void 0:s.onSuccess),l.onError.push(null==(i=u.hooks)?void 0:i.onError),l.onRetry.push(null==(a=u.hooks)?void 0:a.onRetry)}return{url:e,options:c,hooks:l}},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}},y=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)}},g=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},m=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function w(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 E(e){return"function"==typeof e}async function A(e){let t=new Headers(null==e?void 0:e.headers);for(let[r,n]of Object.entries(await g(e)||{}))t.set(r,n);if(!t.has("content-type")){let r=w(null==e?void 0:e.body)?"application/json":null;r&&t.set("content-type",r)}return t}
1var S=class e extends Error{constructor(t,r){super(r||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function v(e,t){let r=await e["~standard"].validate(t);if(r.issues)throw new S(r.issues);return r.value}var T=["get","post","put","patch","delete"],O=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,s,i;let a=(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(a){let r=e;(null==(s=a.config)?void 0:s.prefix)&&r.startsWith(a.config.prefix)&&(r=r.replace(a.config.prefix,""),a.config.baseURL&&(e=e.replace(a.config.prefix,a.config.baseURL))),(null==(i=a.config)?void 0:i.baseURL)&&r.startsWith(a.config.baseURL)&&(r=r.replace(a.config.baseURL,""));let n=a.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 v(n.input,null==t?void 0:t.body):null==t?void 0:t.body,params:n.params?await v(n.params,null==t?void 0:t.params):null==t?void 0:t.params,query:n.query?await v(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 R(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 R(t,o)},R=async(e,t)=>{var r,n,o,s,i,a,c,l;let{hooks:g,url:S,options:O}=await p(e,t),_=function(e){if(null==e?void 0:e.customFetchImpl)return e.customFetchImpl;if("undefined"!=typeof globalThis&&E(globalThis.fetch))return globalThis.fetch;if("undefined"!=typeof window&&E(window.fetch))return window.fetch;throw Error("No fetch implementation found")}(O),x=new AbortController,k=null!=(r=O.signal)?r:x.signal,P=function(e,t){let{baseURL:r,params:n,query:o}=t||{query:{},params:{},baseURL:""},s=e.startsWith("http")?e.split("/").slice(0,3).join("/"):r||"";if(e.startsWith("@")){let t=e.toString().split("@")[1].split("/")[0];T.includes(t)&&(e=e.replace(`@${t}/`,"/"))}s.endsWith("/")||(s+="/");let[i,a]=e.replace(s,"").split("?"),c=new URLSearchParams(a);for(let[e,t]of Object.entries(o||{}))null!=t&&c.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 l=c.toString();return(l=l.length>0?`?${l}`.replace(/\+/g,"%20"):"",s.startsWith("http"))?new URL(`${i}${l}`,s):`${s}${i}${l}`}(S,O),D=function(e){if(!(null==e?void 0:e.body))return null;let t=new Headers(null==e?void 0:e.headers);if(w(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}(O),I=await A(O),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 T.includes(n)?n.toUpperCase():(null==t?void 0:t.body)?"POST":"GET"}return(null==t?void 0:t.body)?"POST":"GET"}(S,O),C=d(u({},O),{url:P,headers:I,body:D,method:j,signal:k});for(let e of g.onRequest)if(e){let t=await e(C);t instanceof Object&&(C=t)}("pipeTo"in C&&"function"==typeof C.pipeTo||"function"==typeof(null==(n=null==t?void 0:t.body)?void 0:n.pipe))&&!("duplex"in C)&&(C.duplex="half");let{clearTimeout:U}=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)}}}(O,x),N=await _(C.url,C);U();let L={response:N,request:C};for(let e of g.onResponse)if(e){let r=await e(d(u({},L),{response:(null==(o=null==t?void 0:t.hookOptions)?void 0:o.cloneResponse)?N.clone():N}));r instanceof Response?N=r:r instanceof Object&&(N=r.response)}if(N.ok){if("HEAD"===C.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 m.test(n)?"json":r.has(n)||n.startsWith("text/")?"text":"blob"}(N),r={data:"",response:N,request:C};if("json"===e||"text"===e){let e=await N.text(),t=null!=(s=C.jsonParser)?s:b;r.data=await t(e)}else r.data=await N[e]();for(let e of((null==C?void 0:C.output)&&C.output&&!C.disableValidation&&(r.data=await v(C.output,r.data)),g.onSuccess))e&&await e(d(u({},r),{response:(null==(i=null==t?void 0:t.hookOptions)?void 0:i.cloneResponse)?N.clone():N}));return(null==t?void 0:t.throw)?r.data:{data:r.data,error:null}}let H=null!=(a=null==t?void 0:t.jsonParser)?a:b,K=await N.text(),W=function(e){try{return JSON.parse(e),!0}catch(e){return!1}}(K),$=W?await H(K):null,M={response:N,responseText:K,request:C,error:d(u({},$),{status:N.status,statusText:N.statusText})};for(let e of g.onError)e&&await e(d(u({},M),{response:(null==(c=null==t?void 0:t.hookOptions)?void 0:c.cloneResponse)?N.clone():N}));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 y(e);default:throw Error("Invalid retry strategy")}}(t.retry),n=null!=(l=t.retryAttempt)?l:0;if(await r.shouldAttemptRetry(n,N)){for(let e of g.onRetry)e&&await e(L);let o=r.getDelay(n);return await new Promise(e=>setTimeout(e,o)),await R(e,d(u({},t),{retryAttempt:n+1}))}}if(null==t?void 0:t.throw)throw new f(N.status,N.statusText,W?$:K);return{data:null,error:d(u({},$),{status:N.status,statusText:N.statusText})}}},16355:(e,t,r)=>{"use strict";var n=r(88175);r(60974);let o=n.Ikc({id:n.YjP(),createdAt:n.p6U().default(()=>new Date),updatedAt:n.p6U().default(()=>new Date)});o.extend({providerId:n.YjP(),accountId:n.YjP(),userId:n.auy.string(),accessToken:n.YjP().nullish(),refreshToken:n.YjP().nullish(),idToken:n.YjP().nullish(),accessTokenExpiresAt:n.p6U().nullish(),refreshTokenExpiresAt:n.p6U().nullish(),scope:n.YjP().nullish(),password:n.YjP
1().nullish()}),o.extend({email:n.YjP().transform(e=>e.toLowerCase()),emailVerified:n.zMY().default(!1),name:n.YjP(),image:n.YjP().nullish()}),o.extend({userId:n.auy.string(),expiresAt:n.p6U(),token:n.YjP(),ipAddress:n.YjP().nullish(),userAgent:n.YjP().nullish()}),o.extend({value:n.YjP(),expiresAt:n.p6U(),identifier:n.YjP()})},16383:(e,t,r)=>{"use strict";r.d(t,{default:()=>l});var n=r(56366),o=r(22531),s=r(68786),i=r(51367),a=r(58889),c=r(58682),l=(0,s.forwardRef)(function({href:e,locale:t,localeCookie:r,onClick:s,prefetch:l,...u},d){let f=(0,i.Ym)(),p=null!=t&&t!==f,h=(0,o.usePathname)();return p&&(l=!1),(0,c.jsx)(n,{ref:d,href:e,hrefLang:p?t:void 0,onClick:function(e){(0,a.A)(r,h,f,t),s&&s(e)},prefetch:l,...u})})},17967:(e,t,r)=>{"use strict";r.d(t,{V:()=>w});var n=r(9400),o=r(48503),s=r(19736),i=r(81293);async function a(e,t,r,n){let a=await (0,i.j)(e,t,"verify");(0,s.O)(e,a);let c=(0,o.B)(e,a.algorithm);try{return await crypto.subtle.verify(c,a,r,n)}catch{return!1}}var c=r(10709),l=r(48673),u=r(44570),d=r(88969),f=r(56940),p=r(78384),h=r(67216);async function y(e,t,r){let o,s;if(!(0,d.G)(e))throw new c.Ye("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new c.Ye('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new c.Ye("JWS Protected Header incorrect type");if(void 0===e.payload)throw new c.Ye("JWS Payload missing");if("string"!=typeof e.signature)throw new c.Ye("JWS Signature missing or incorrect type");if(void 0!==e.header&&!(0,d.G)(e.header))throw new c.Ye("JWS Unprotected Header incorrect type");let i={};if(e.protected)try{let t=(0,n.D)(e.protected);i=JSON.parse(l.D0.decode(t))}catch{throw new c.Ye("JWS Protected Header is invalid")}if(!(0,u.f)(i,e.header))throw new c.Ye("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let y={...i,...e.header},g=(0,p.n)(c.Ye,new Map([["b64",!0]]),r?.crit,i,y),m=!0;if(g.has("b64")&&"boolean"!=typeof(m=i.b64))throw new c.Ye('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:w}=y;if("string"!=typeof w||!w)throw new c.Ye('JWS "alg" (Algorithm) Header Parameter missing or invalid');let b=r&&function(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(w))throw new c.Rb('"alg" (Algorithm) Header Parameter value not allowed');if(m){if("string"!=typeof e.payload)throw new c.Ye("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new c.Ye("JWS Payload must be a string or an Uint8Array instance");let E=!1;"function"==typeof t&&(t=await t(i,e),E=!0),(0,f.y)(w,t,"verify");let A=(0,l.xW)(void 0!==e.protected?(0,l.lF)(e.protected):new Uint8Array,(0,l.lF)("."),"string"==typeof e.payload?m?(0,l.lF)(e.payload):l.Rd.encode(e.payload):e.payload);try{o=(0,n.D)(e.signature)}catch{throw new c.Ye("Failed to base64url decode the signature")}let S=await (0,h.l)(t,w);if(!await a(w,S,o,A))throw new c.h2;if(m)try{s=(0,n.D)(e.payload)}catch{throw new c.Ye("Failed to base64url decode the payload")}else s="string"==typeof e.payload?l.Rd.encode(e.payload):e.payload;let v={payload:s};return(void 0!==e.protected&&(v.protectedHeader=i),void 0!==e.header&&(v.unprotectedHeader=e.header),E)?{...v,key:S}:v}async function g(e,t,r){if(e instanceof Uint8Array&&(e=l.D0.decode(e)),"string"!=typeof e)throw new c.Ye("Compact JWS must be a string or Uint8Array");let{0:n,1:o,2:s,length:i}=e.split(".");if(3!==i)throw new c.Ye("Invalid Compact JWS");let a=await y({payload:o,protected:n,signature:s},t,r),u={payload:a.payload,protectedHeader:a.protectedHeader};return"function"==typeof t?{...u,key:a.key}:u}var m=r(11889);async function w(e,t,r){let n=await g(e,t,r);if(n.protectedHeader.crit?.includes("b64")&&!1===n.protectedHeader.b64)throw new c.Dp("JWTs MUST NOT use unencoded payload");let o={payload:(0,m.k6)(n.protectedHeader,n.payload,r),protectedHeader:n.protectedHeader};return"function"==typeof t?{...o,key:n.key}:o}},19736:(e,t,r)=>{"use strict";function n(e,t){if(e.startsWith("RS")||e.startsWith("PS")){let{modulusLength:r}=t.algorithm;if("number"!=typeof r||r<2048)throw TypeError(`${e}
1 requires key modulusLength to be 2048 bits or larger`)}}r.d(t,{O:()=>n})},21597:(e,t,r)=>{"use strict";r.d(t,{B:()=>h,a:()=>p,c:()=>f,f:()=>w,g:()=>g,s:()=>m});var n=r(60974),o=r(1475),s=r(38892),i=r(88175),a=r(27716),c=r(69870),l=r(85986),u=r(61600);let d=(0,n.Ny)(async()=>({})),f=n.Ny.create({use:[d,(0,n.Ny)(async()=>({}))]}),p=n.UD.create({use:[d]}),h={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.lqM(i.Ikc({disableCookieCache:i.auy.boolean().meta({description:"Disable cookie cache and fetch session from database"}).optional(),disableRefresh:i.auy.boolean().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 p("/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,a.s)(u.a.decode(l.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}),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 d=await e.context.internalAdapter.findSession(t);if(e.context.session=d,!d||d.session.expiresAt<new Date)return(0,s.d)(e),d&&await e.context.internalAdapter.deleteSession(d.session.token),e.json(null);if(i||e.query?.disableRefresh)return e.json(d);let f=e.context.sessionConfig.expiresIn,p=e.context.sessionConfig.updateAge;if(d.session.expiresAt.valueOf()-1e3*f+1e3*p<=Date.now()&&(!e.query?.disableRefresh||!e.context.options.session?.disableSessionRefresh)){let t=await e.context.internalAdapter.updateSession(d.session.token,{expiresAt:(0,o.g)(e.context.sessionConfig.expiresIn,"sec"),updatedAt:new Date});if(!t)return(0,s.d)(e),e.json(null,{status:401});let r=(t.expiresAt.valueOf()-Date.now())/1e3;return await (0,s.s)(e,{session:t,user:d.user},!1,{maxAge:r}),e.json({session:t,user:d.user})}return await (0,s.b)(e,d),e.json(d)}catch(t){throw e.context.logger.error("INTERNAL_SERVER_ERROR",t),new n.LG("INTERNAL_SERVER_ERROR",{message:h.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},m=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 w=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}});p("/revoke-session",{method:"POST",body:i.Ikc({token:i.YjP().meta({description:"The token to revoke"})}),use:[m],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=>
1{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})}),p("/revoke-sessions",{method:"POST",use:[m],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})}),p("/revoke-other-sessions",{method:"POST",requireHeaders:!0,use:[m],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");let 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})})},27716:(e,t,r)=>{"use strict";r.d(t,{s:()=>o});var n=r(39880);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}}},27799:(e,t,r)=>{"use strict";r.d(t,{n:()=>s});var n=r(75938),o=r(85986);function s(e,t){return{digest:async r=>{let s=new TextEncoder,i="string"==typeof r?s.encode(r):r,a=await n.aK.digest(e,i);return"hex"===t?Array.from(new Uint8Array(a)).map(e=>e.toString(16).padStart(2,"0")).join(""):"base64"===t||"base64url"===t||"base64urlnopad"===t?t.includes("url")?o.z.encode(a,{padding:"base64urlnopad"!==t}):o.K.encode(a):a}}}},29018:(e,t,r)=>{"use strict";r.d(t,{M3:()=>i,W2:()=>s,ll:()=>o,t9:()=>a});var n=r(88969);let o=e=>(0,n.G)(e)&&"string"==typeof e.kty,s=e=>"oct"!==e.kty&&("AKP"===e.kty&&"string"==typeof e.priv||"string"==typeof e.d),i=e=>"oct"!==e.kty&&void 0===e.d&&void 0===e.priv,a=e=>"oct"===e.kty&&"string"==typeof e.k},30870:(e,t,r)=>{"use strict";r.d(t,{a:()=>i,b:()=>l,c:()=>c,g:()=>a});var n=r(89241),o=r(57808);function s(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 s(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 s(i,t);let c=r?.headers.get("x-forwarded-host"),l=r?.headers.get("x-forwarded-proto");if(c&&l)return s(`${l}://${c}`,t);if(r){let e=a(r.url);if(!e)throw new o.B("Could not get origin from request. Please provide a valid base URL.");return s(e,t)}if("undefined"!=typeof window&&window.location)return s(window.location.origin,t)}function a(e){try{return new URL(e).origin}catch(e){return null}}function c(e){try{return new URL(e).protocol}catch(e){return null}}function l(e){try{return new URL(e).host}catch(t){return e}}},32665:(e,t,r)=>{"use strict";r.d(t,{ll:()=>l}),r(14763),r(89241),r(61417);var n=r(57808);function o(e){return{newRole:e=>{var t;return{authorize(e,r="AND"){let o=!1;for(let[s,i]of Object.entries(e)){let e=t[s];if(!e)return{success:!1,error:`You are not allowed to access resource: ${s}`};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");
1if(o&&"OR"===r)return{success:o};if(!o&&"AND"===r)return{success:!1,error:`unauthorized to access resource "${s}"`}}return o?{success:o}:{success:!1,error:"Not authorized"}},statements:t=e}},statements:e}}let s=o({organization:["update","delete"],member:["create","update","delete"],invitation:["create","cancel"],team:["create","update","delete"],ac:["create","read","update","delete"]});s.newRole({organization:["update"],invitation:["create","cancel"],member:["create","update","delete"],team:["create","update","delete"],ac:["create","read","update","delete"]}),s.newRole({organization:["update","delete"],member:["create","update","delete"],invitation:["create","cancel"],team:["create","update","delete"],ac:["create","read","update","delete"]}),s.newRole({organization:[],member:[],invitation:[],team:[],ac:["read"]}),r(88175),r(60974),r(23193),r(21597),r(85986),r(69870),r(39880),r(61600),r(16355);class i{constructor(){Object.defineProperty(this,"controller",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}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}}}new i;let a=o({user:["create","list","set-role","ban","impersonate","delete","set-password","get","update"],session:["list","revoke","delete"]});a.newRole({user:["create","list","set-role","ban","impersonate","delete","set-password","get","update"],session:["list","revoke","delete"]}),a.newRole({user:[],session:[]}),r(27799),r(64489),r(48960),r(69328),r(30870),r(38892),r(27716),r(90658);let c=!1,l=e=>({id:"one-tap",getActions:(t,r)=>({oneTap:async(r,n)=>{if(c)return void console.warn("A Google One Tap request is already in progress. Please wait.");c=!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:s,context:i}=r??{},a=i??e.context??"signin";await u(),await new Promise((i,c)=>{let l=!1,u=e.promptOptions?.baseDelay??1e3,d=e.promptOptions?.maxAttempts??5;window.google?.accounts.id.initialize({client_id:e.clientId,callback:async e=>{l=!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),c(e)}}
1,auto_select:o,cancel_on_tap_outside:s,context:a,...e.additionalOptions});let f=e=>{l||window.google?.accounts.id.prompt(t=>{if(!l){if(t.isDismissedMoment&&t.isDismissedMoment())if(e<d){let t=Math.pow(2,e)*u;setTimeout(()=>f(e+1),t)}else r?.onPromptNotification?.(t);else if(t.isSkippedMoment&&t.isSkippedMoment())if(e<d){let t=Math.pow(2,e)*u;setTimeout(()=>f(e+1),t)}else r?.onPromptNotification?.(t)}})};f(0)})}catch(e){throw console.error("Error during Google One Tap flow:",e),e}finally{c=!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)})},34269:(e,t,r)=>{"use strict";function n(e){return e}r.d(t,{A:()=>n})},38409:(e,t,r)=>{"use strict";var n,o;e.exports=(null==(n=r.g.process)?void 0:n.env)&&"object"==typeof(null==(o=r.g.process)?void 0:o.env)?r.g.process:r(63638)},38892:(e,t,r)=>{"use strict";r.d(t,{b:()=>a,d:()=>l,s:()=>c});var n=r(57808),o=r(1475);r(89241);var s=r(85986),i=r(69870);async function a(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},a=(0,o.g)(e.context.authCookies.sessionData.options.maxAge||60,"sec").getTime(),c=s.z.encode(JSON.stringify({session:r,expiresAt:a,signature:await (0,i.s)("SHA-256","base64urlnopad").sign(e.context.secret,JSON.stringify({...r,expiresAt:a}))}),{padding:!1});if(c.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,c,e.context.authCookies.sessionData.options)}}async function c(e,t,r,n){let o=await e.getSignedCookie(e.context.authCookies.dontRememberToken.name,e.context.secret);r=void 0!==r?r:!!o;let s=e.context.authCookies.sessionToken.options,i=r?void 0:e.context.sessionConfig.expiresIn;await e.setSignedCookie(e.context.authCookies.sessionToken.name,t.session.token,e.context.secret,{...s,maxAge:i,...n}),r&&await e.setSignedCookie(e.context.authCookies.dontRememberToken.name,"true",e.context.secret,e.context.authCookies.dontRememberToken.options),await a(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 l(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(27716),r(30870),r(61600)},39880:(e,t,r)=>{"use strict";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"}},s={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,(...[a,...c])=>((i,a,c=[])=>{if(!t||!(n.indexOf(i)<=n.indexOf(r)))return;let l=((e,t)=>{let r=new Date().toISOString();return`${o.dim}${r}${o.reset} ${s[e]}${e.toUpperCase()}${o.reset} ${o.bright}[Better Auth]:${o.reset} ${t}`})(i,a);if(!e||"function"!=typeof e.log)return void("error"===i?console.error(l,...c):"warn"===i?console.warn(l,...c):console.log(l,...c));e.log("success"===i?"info":i,a,...c)})(i,a,c)])),get level(){return r}}})()},44570:(e,t,r)=>{"use strict";function 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}r.d(t,{f:()=>n})},48503:(e,t,r)=>{"use strict";r.d(t,{B:()=>o});var n=r(10709);function o(e,t){let r=`SHA-${e.slice(-3)}`;
1switch(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};case"Ed25519":case"EdDSA":return{name:"Ed25519"};case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return{name:e};default:throw new n.T0(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}},48673:(e,t,r)=>{"use strict";r.d(t,{D0:()=>o,Rd:()=>n,lF:()=>i,xW:()=>s});let n=new TextEncoder,o=new TextDecoder;function s(...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}function i(e){let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);if(n>127)throw TypeError("non-ASCII string encountered in encode()");t[r]=n}return t}},48960:(e,t,r)=>{"use strict";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)}}},49587:(e,t,r)=>{"use strict";let n;r.d(t,{RD:()=>y});var o=r(10709),s=r(60168),i=r(88969);function a(e){return(0,i.G)(e)}class c{#t;#r=new WeakMap;constructor(e){if(!function(e){return e&&"object"==typeof e&&Array.isArray(e.keys)&&e.keys.every(a)}(e))throw new o.Dm("JSON Web Key Set malformed");this.#t=structuredClone(e)}jwks(){return this.#t}async getKey(e,t){let{alg:r,kid:n}={...e,...t?.header},s=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.#t.keys.filter(e=>{let t=s===e.kty;if(t&&"string"==typeof n&&(t=n===e.kid),t&&("string"==typeof e.alg||"AKP"===s)&&(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;
1case"Ed25519":case"EdDSA":t="Ed25519"===e.crv}return t}),{0:a,length:c}=i;if(0===c)throw new o.BT;if(1!==c){let e=new o.$4,t=this.#r;throw e[Symbol.asyncIterator]=async function*(){for(let e of i)try{yield await l(t,e,r)}catch{}},e}return l(this.#r,a,r)}}async function l(e,t,r){let n=e.get(t)||e.set(t,{}).get(t);if(void 0===n[r]){let e=await (0,s.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 c(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.3");let d=Symbol();async function f(e,t,r,n=fetch){let s=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!==s.status)throw new o.i4("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await s.json()}catch{throw new o.i4("Failed to parse the JSON Web Key Set HTTP response as JSON")}}let p=Symbol();class h{#n;#o;#s;#i;#a;#c;#l;#u;#d;#f;constructor(e,t){if(!(e instanceof URL))throw TypeError("url must be an instance of URL");this.#n=new URL(e.href),this.#o="number"==typeof t?.timeoutDuration?t?.timeoutDuration:5e3,this.#s="number"==typeof t?.cooldownDuration?t?.cooldownDuration:3e4,this.#i="number"==typeof t?.cacheMaxAge?t?.cacheMaxAge:6e5,this.#l=new Headers(t?.headers),n&&!this.#l.has("User-Agent")&&this.#l.set("User-Agent",n),this.#l.has("accept")||(this.#l.set("accept","application/json"),this.#l.append("accept","application/jwk-set+json")),this.#u=t?.[d],t?.[p]!==void 0&&(this.#f=t?.[p],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.G)(e.jwks)&&!!Array.isArray(e.jwks.keys)&&!!Array.prototype.every.call(e.jwks.keys,i.G)}(t?.[p],this.#i)&&(this.#a=this.#f.uat,this.#d=u(this.#f.jwks)))}pendingFetch(){return!!this.#c}coolingDown(){return"number"==typeof this.#a&&Date.now()<this.#a+this.#s}fresh(){return"number"==typeof this.#a&&Date.now()<this.#a+this.#i}jwks(){return this.#d?.jwks()}async getKey(e,t){this.#d&&this.fresh()||await this.reload();try{return await this.#d(e,t)}catch(r){if(r instanceof o.BT&&!1===this.coolingDown())return await this.reload(),this.#d(e,t);throw r}}async reload(){this.#c&&("undefined"!=typeof WebSocketPair||"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"undefined"!=typeof EdgeRuntime&&"vercel"===EdgeRuntime)&&(this.#c=void 0),this.#c||=f(this.#n.href,this.#l,AbortSignal.timeout(this.#o),this.#u).then(e=>{this.#d=u(e),this.#f&&(this.#f.uat=Date.now(),this.#f.jwks=e),this.#a=Date.now(),this.#c=void 0}).catch(e=>{throw this.#c=void 0,e}),await this.#c}}function y(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}},49836:(e,t,r)=>{"use strict";r.d(t,{g:()=>o});var n=r(76442);let o=e=>(0,n.q)("a-z","A-Z","0-9")(e||32)},55141:(e,t,r)=>{"use strict";r.d(t,{x:()=>o});var n=r(10709);async function o(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)}},56276:(e,t,r)=>{"use strict";r.d(t,{MB:()=>p});var n=r(14763),o=r(30870),s=r(67257),i=r(61417);let a={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*:/},c=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,l={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 f=r(68786);function p(e){var t,r;let{pluginPathMethods:p,pluginsActions:h,pluginsAtoms:y,$fetch:g,$store:m,atomListeners:w}=(e=>{let t="credentials"in Request.prototype,r=(0,o.a)(e?.baseURL,e?.basePath),f=e?.plugins?.flatMap(e=>e.fetchPlugins).filter(e=>void 0!==e)||[],p={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:y,onRequest:g,onResponse:m,...w}=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:s=!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 l)return l[d];if(!c.test(i)){if(r)throw SyntaxError("[better-json] Invalid JSON");return e}if(Object.entries(a).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(s&&"string"==typeof t){let e=function(e){let t=u.exec(e);if(!t)return null;let[,r,n,o,s,i,a,c,l,d,f]=t,p=new Date(Date.UTC(parseInt(r,10),parseInt(n,10)-1,parseInt(o,10),parseInt(s,10),parseInt(i,10),parseInt(a,10),c?parseInt(c.padEnd(3,"0"),10):0));if(l){let e=(60*parseInt(d,10)+parseInt(f,10))*("+"===l?-1:1);p.setUTCMinutes(p.getUTCMinutes()+e)}
1return p instanceof Date&&!isNaN(p.getTime())?p: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,...w,plugins:[p,...w.plugins||[],...e?.disableDefaultFetchPlugins?[]:[d],...f]}),{$sessionSignal:E,session:A}=function(e){let t=(0,s.e)(!1);return{session:(0,i.u)(t,"/get-session",e,{method:"GET"}),$sessionSignal:t}}(b),S=e?.plugins||[],v={},T={$sessionSignal:E,session:A},O={"/sign-out":"POST","/revoke-sessions":"POST","/revoke-other-sessions":"POST","/delete-user":"POST"},R=[{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 S)e.getAtoms&&Object.assign(T,e.getAtoms?.(b)),e.pathMethods&&Object.assign(O,e.pathMethods),e.atomListeners&&R.push(...e.atomListeners);let _={notify:e=>{T[e].set(!T[e].get())},listen:(e,t)=>{T[e].subscribe(t)},atoms:T};for(let t of S)t.getActions&&Object.assign(v,t.getActions?.(b,_,e));return{pluginsActions:v,pluginsAtoms:T,pluginPathMethods:O,atomListeners:R,$fetch:b,$store:_}})(e),b={};for(let[e,t]of Object.entries(y)){b[`use${(r=e).charAt(0).toUpperCase()+r.slice(1)}`]=()=>(function(e,t={}){let r=(0,f.useRef)(e.get()),{keys:n,deps:o=[e,n]}=t,s=(0,f.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,f.useSyncExternalStore)(s,i,i)})(t)}return t={...h,...b,$fetch:g,$store:m},function e(r=[]){return new Proxy(function(){},{get(n,o){var s;if("then"===o||"catch"===o||"finally"===o)return;let i=[...r,o],a=t;for(let e of i)if(a&&"object"==typeof a&&e in a)a=a[e];else{a=void 0;break}return"function"==typeof a?a:"object"==typeof(s=a)&&null!==s&&"get"in s&&"function"==typeof s.get&&"lc"in s&&"number"==typeof s.lc?a:e(i)},apply:async(e,t,n)=>{let o="/"+r.map(e=>e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)).join("/"),s=n[0]||{},i=n[1]||{},{query:a,fetchOptions:c,...l}=s,u={...i,...c},d=function(e,t,r){let n=t[e],{fetchOptions:o,query:s,...i}=r||{};return n||(o?.method?o.method:i&&Object.keys(i).length>0?"POST":"GET")}(o,p,s);return await g(o,{...u,body:"GET"===d?void 0:{...l,...u?.body||{}},query:a||u?.query,method:d,async onSuccess(e){await u?.onSuccess?.(e);let t=w?.find(e=>e.matcher(o));if(!t)return;let r=y[t.signal];if(!r)return;let n=r.get();setTimeout(()=>{r.set(!n)},10)}})}})}()}r(89241),r(57808)},56940:(e,t,r)=>{"use strict";r.d(t,{y:()=>c});var n=r(92103),o=r(74517),s=r(29018);let i=e=>e?.[Symbol.toStringTag],a=(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};function c(e,t,r){switch(e.substring(0,2)){case"A1":case"A2":case"di":case"HS":case"PB":((e,t,r)=>{if(!(t instanceof Uint8Array)){if(s.ll(t)){if(s.t9(t)&&a(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.P2)(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);break;default:((e,t,r)=>{if(s.ll(t))switch(r){case"decrypt":case"sign":if(s.W2(t)&&a(e,t,r))return;throw TypeError("JSON Web Key for this operation must be a private JWK");case"encrypt":case"verify":if(s.M3(t)&&a(e,t,r))return;throw TypeError("JSON Web Key for this operation must be a public JWK")}if(!(0,o.P2)(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)}}},57808:(e,t,r)=>{"use strict";r.d(t,{B:()=>n});
1class n extends Error{constructor(e,t){super(e),this.name="BetterAuthError",this.message=e,this.cause=t,this.stack=""}}},58889:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(13059);function o(e,t,r,o){if(!e||o===r||null==o||!t)return;let s=(0,n.DT)(t),{name:i,...a}=e;a.path||(a.path=""!==s?s:"/");let c=`${i}=${o};`;for(let[e,t]of Object.entries(a))c+=`${"maxAge"===e?"max-age":e}`,"boolean"!=typeof t&&(c+="="+t),c+=";";document.cookie=c}},60168:(e,t,r)=>{"use strict";r.d(t,{Og:()=>a});var n=r(9400),o=r(55141),s=r(10709),i=r(88969);async function a(e,t,r){let a;if(!(0,i.G)(e))throw TypeError("JWK must be an object");switch(t??=e.alg,a??=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 s.T0('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');return(0,o.x)({...e,alg:t,ext:a});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.x)({...e,ext:a});case"EC":case"OKP":return(0,o.x)({...e,alg:t,ext:a});default:throw new s.T0('Unsupported "kty" (Key Type) Parameter value')}}},60974:(e,t,r)=>{"use strict";r.d(t,{LG:()=>i,Ny:()=>b,UD:()=>E});var n=r(75938),o=Object.defineProperty,s={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{#p;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.#p=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.#p}}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:s[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 a(e){return e instanceof i||e?.name==="APIError"}async function c(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:l(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:l(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 l(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"])},f=async(e,t,r)=>{try{let o=atob(e),s=new Uint8Array(o.length);for(let e=0,t=o.length;e<t;
1e++)s[e]=o.charCodeAt(e);return await n.aK.verify(u,r,s,new TextEncoder().encode(t))}catch(e){return!1}},p=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 p(e,t);return encodeURIComponent(e=`${e}.${r}`)},y=(e,t)=>{let r=e;if(t)if("secure"===t)r="__Secure-"+e;else{if("host"!==t)return;r="__Host-"+e}return r},g=(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},m=async(e,t,r,n)=>g(e,t=await h(t,r),n),w=async(e,{options:t,path:r})=>{let n=new Headers,{data:o,error:s}=await c(t,e);if(s)throw new i(400,{message:s.message,code:"VALIDATION_ERROR"});let a="headers"in e?e.headers instanceof Headers?e.headers:new Headers(e.headers):"request"in e&&e.request instanceof Request?e.request.headers:null,l=a?.get("cookie"),u=l?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 s=e.slice(r,n).trim();if(!t.has(s)){let r=e.slice(n+1,o).trim();34===r.codePointAt(0)&&(r=r.slice(1,-1)),t.set(s,function(e){try{return e.includes("%")?decodeURIComponent(e):e}catch{return e}}(r))}r=o+1}return t}(l):void 0,p={...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=>a?a.get(e):null,getCookie:(e,t)=>{let r=y(e,t);return r&&u?.get(r)||null},getSignedCookie:async(e,t,r)=>{let n=y(e,r);if(!n)return null;let o=u?.get(n);if(!o)return null;let s=o.lastIndexOf(".");if(s<1)return null;let i=o.substring(0,s),a=o.substring(s+1);if(44!==a.length||!a.endsWith("="))return null;let c=await d(t);return!!await f(a,i,c)&&i},setCookie:(e,t,r)=>{let o=((e,t,r)=>g(e,t=encodeURIComponent(t),r))(e,t,r);return n.append("set-cookie",o),o},setSignedCookie:async(e,t,r,o)=>{let s=await m(e,t,r,o);return n.append("set-cookie",s),s},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({...p,returnHeaders:!0,asResponse:!1});t.response&&Object.assign(p.context,t.response),t.headers&&t.headers.forEach((e,t)=>{p.responseHeaders.set(t,e)})}return p};function b(e,t){let r=async r=>{let n="function"==typeof e?e:t,o=await w(r,{options:"function"==typeof e?{}:e,path:"/"});if(!n)throw Error("handler must be defined");let s=await n(o),i=o.responseHeaders;return r.returnHeaders?{headers:i,response:s}:s};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 E=(e,t,r)=>{let n=async(...n)=>{let o=n[0]||{},s=await w(o,{options:t,path:e}),i=await r(s).catch(async e=>{if(a(e)){let r=t.onAPIError;if(r&&await r(e),o.asResponse)return e}throw e}),c=s.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(a(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:c}):o.returnHeaders?{headers:c,response:i}:i};return n.options=t,n.path=e,n};function A(e,t,r){function n(r,n){var o;for(let s 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)s in r||Object.defineProperty(r,s,{value:i.prototype[s].bind(r)});r._zod.constr=i,r._zod.def=n}
1let o=r?.Parent??Object;class s extends o{}function i(e){var t;let o=r?.Parent?new s:this;for(let r of(n(o,e),(t=o._zod).deferred??(t.deferred=[]),o._zod.deferred))r();return o}return Object.defineProperty(s,"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 S(e){return e}function v(e){return e}function T(e){}function O(e){throw Error()}function R(e){}function _(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 x(e,t="|"){return e.map(e=>X(e)).join(t)}function k(e,t){return"bigint"==typeof t?t.toString():t}function P(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function D(e){return null==e}function I(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 C(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 U(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function N(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function L(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 H(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function K(e){return JSON.stringify(e)}E.create=e=>(t,r,n)=>E(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:()=>eg,NUMBER_FORMAT_RANGES:()=>ee,aborted:()=>ec,allowsEval:()=>M,assert:()=>R,assertEqual:()=>S,assertIs:()=>T,assertNever:()=>O,assertNotEqual:()=>v,assignProp:()=>U,cached:()=>P,captureStackTrace:()=>W,cleanEnum:()=>ey,cleanRegex:()=>I,clone:()=>G,createTransparentProxy:()=>Z,defineLazy:()=>C,esc:()=>K,escapeRegex:()=>Y,extend:()=>eo,finalizeIssue:()=>ed,floatSafeRemainder:()=>j,getElementAtPath:()=>N,getEnumValues:()=>_,getLengthableOrigin:()=>ep,getParsedType:()=>q,getSizableOrigin:()=>ef,isObject:()=>$,isPlainObject:()=>J,issue:()=>eh,joinValues:()=>x,jsonStringifyReplacer:()=>k,merge:()=>es,normalizeParams:()=>V,nullish:()=>D,numKeys:()=>F,omit:()=>en,optionalKeys:()=>Q,partial:()=>ei,pick:()=>er,prefixIssues:()=>el,primitiveTypes:()=>B,promiseAllObject:()=>L,propertyKeyTypes:()=>z,randomString:()=>H,required:()=>ea,stringifyPrimitive:()=>X,unwrapMessage:()=>eu});var W=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function $(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}var M=P(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function J(e){if(!1===$(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!1!==$(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function F(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var q=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}`)}},z=new Set(["string","number","symbol"]),B=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Y(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function G(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function V(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 Z(e){let t;return new Proxy({},{get:(r,n,o)=>(t??(t=e()),Reflect.get(t,n,o)),set:(r,n,o,s)=>(t??(t=e()),Reflect.set(t,n,o,s)),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 X(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}function Q(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 G(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 G(e,{...e._zod.def,shape:r,checks:[]})}function eo(e,t){if(!J(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 U(this,"shape",r),r},checks:[]};return G(e,r)}function es(e,t){return G(e,{...e._zod.def,get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return U(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 G(t,{...t._zod.def,shape:o,checks:[]})}function ea(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 G(t,{...t._zod.def,shape:o,checks:[]})}function ec(e,t=0){for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function el(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 ef(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function ep(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 ey(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}var eg=class{constructor(...e){}},em=(e,t)=>
1{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,k,2),enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ew=A("$ZodError",em);A("$ZodError",em,{Parent:Error}),Symbol("ZodOutput"),Symbol("ZodInput");var eb=(e,t)=>{ew.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});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})(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}})};A("ZodError",eb),A("ZodError",eb,{Parent:Error})},61417:(e,t,r)=>{"use strict";r.d(t,{u:()=>i});var n=r(67257);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}}),s="undefined"==typeof window,i=(e,t,r,i)=>{let a=(0,n.e)({data:null,error:null,isPending:!0,isRefetching:!1,refetch:e=>c(e)}),c=e=>{let n="function"==typeof i?i({data:a.get().data,error:a.get().error,isPending:a.get().isPending}):i;r(t,{...n,query:{...n?.query,...e?.query},async onSuccess(e){a.set({data:e.data,error:null,isPending:!1,isRefetching:!1,refetch:a.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||(a.set({error:e.error,data:null,isPending:!1,isRefetching:!1,refetch:a.value.refetch}),await n?.onError?.(e))},async onRequest(e){let t=a.get();a.set({isPending:null===t.data,data:t.data,error:null,isRefetching:!0,refetch:a.value.refetch}),await n?.onRequest?.(e)}}).catch(e=>{a.set({error:e,data:null,isPending:!1,isRefetching:!1,refetch:a.value.refetch})})};e=Array.isArray(e)?e:[e];let l=!1;for(let t of e)t.subscribe(()=>{s||(l?c():o(a,()=>(setTimeout(()=>{c()},0),l=!0,()=>{a.off(),t.off()})))});return a}},61600:(e,t,r)=>{"use strict";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}},63638:e=>{!function(){var t={229:function(e){var t,r,n,o=e.exports={};function s(){throw Error("setTimeout has not been defined")}function i(){throw Error("clearTimeout has not been defined")}try{t="function"==typeof setTimeout?setTimeout:s}catch(e){t=s}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===s||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}var c=[],l=!1,u=-1;function d(){l&&n&&(l=!1,n.length?c=n.concat(c):u=-1,c.length&&f())}function f(){if(!l){var e=a(d);l=!0;for(var t=c.length;t;){for(n=c,c=[];++u<t;)n&&n[u].run();u=-1,t=c.length}n=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function h(){}o.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new p(e,t)),1!==c.length||l||a(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=h,o.addListener=h,o.once=h,o.off=h,o.removeListener=h,o.removeAllListeners=h,o.emit=h,o.prependListener=h,o.prependOnceListener=h,o.listeners=function(e){return[]},o.binding=function(e){throw Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw Error("process.chdir is not supported")},o.umask=function(){return 0}}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var s=r[e]={exports:{}},i=!0;try{t[e](s,s.exports,n),i=!1}finally{i&&delete r[e]}return s.exports}n.ab="//",e.exports=n(229)}()},64489:(e,t,r)=>{"use strict";r.d(t,{FA:()=>er,zp:()=>eo,vX:()=>en});var n=r(27799);function o(e){if("boolean"!=typeof e)throw Error(`boolean expected, not ${e}`)}function s(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,s=void 0!==t;if(!n||s&&o!==t)throw Error((r&&`"${r}" `)+"expected Uint8Array"+(s?` of length ${t}`:"")+", got "+(n?`length=${o}`:`type=${typeof e}`));return e}function a(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 c(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function l(...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,f=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0")),p={_0:48,_9:57,A:65,F:70,a:97,f:102};function h(e){return e>=p._0&&e<=p._9?e-p._0:e>=p.A&&e<=p.F?e-(p.A-10):e>=p.a&&e<=p.f?e-(p.a-10):void 0}function y(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 g(e){return Uint8Array.from(e)}function m(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 w(e,t=m){let{nonceLength:r}=e;s(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,...s)=>({encrypt(a){i(a);
1let c=t(r),l=e(o,c,...s).encrypt(a);return l instanceof Promise?l.then(e=>n(c,e)):n(c,l)},decrypt(t){i(t);let n=t.subarray(0,r),a=t.subarray(r);return e(o,n,...s).decrypt(a)}})}let b=e=>Uint8Array.from(e.split(""),e=>e.charCodeAt(0)),E=b("expand 16-byte k"),A=b("expand 32-byte k"),S=c(E),v=c(A);function T(e,t){return e<<t|e>>>32-t}function O(e){return e.byteOffset%4==0}let R=0x100000000-1,_=Uint32Array.of();function x(e,t){let{allowShortKeys:r,extendNonceFn:n,counterLength:a,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 s(a),s(d),o(u),o(r),(t,o,f,p,h=0)=>{let y,m;i(t,void 0,"key"),i(o,void 0,"nonce"),i(f,void 0,"data");let w=f.length;if(void 0===p&&(p=new Uint8Array(w)),i(p,void 0,"output"),s(h),h<0||h>=R)throw Error("arx: counter overflow");if(p.length<w)throw Error(`arx: output (${p.length}) is shorter than data (${w})`);let b=[],E=t.length;if(32===E)b.push(y=g(t)),m=v;else if(16===E&&r)(y=new Uint8Array(32)).set(t),y.set(t,16),m=S,b.push(y);else throw i(t,32,"arx key"),Error("invalid key size");O(o)||b.push(o=g(o));let A=c(y);if(n){if(24!==o.length)throw Error("arx: extended nonce must be 24 bytes");n(m,A,c(o.subarray(0,16)),A),o=o.subarray(16)}let T=16-a;if(T!==o.length)throw Error(`arx: nonce must be ${T} or 16 bytes`);if(12!==T){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,s,i,a){let l=o.length,u=new Uint8Array(64),d=c(u),f=O(o)&&O(s),p=f?c(o):_,h=f?c(s):_;for(let c=0;c<l;i++){if(e(t,r,n,d,i,a),i>=R)throw Error("arx: counter overflow");let y=Math.min(64,l-c);if(f&&64===y){let e=c/4;if(c%4!=0)throw Error("arx: invalid block position");for(let t=0,r;t<16;t++)h[r=e+t]=p[r]^d[t];c+=64;continue}for(let e=0,t;e<y;e++)s[t=c+e]=o[t]^u[e];c+=y}}(e,m,A,c(o),f,p,h,d),l(...b),p}}function k(e,t){return 255&e[t++]|(255&e[t++])<<8}class P{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=k(e=g(i(e,32,"key")),0),r=k(e,2),n=k(e,4),o=k(e,6),s=k(e,8),a=k(e,10),c=k(e,12),l=k(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|s<<12)&255,this.r[5]=s>>>1&8190,this.r[6]=(s>>>14|a<<2)&8191,this.r[7]=(a>>>11|c<<5)&8065,this.r[8]=(c>>>8|l<<8)&8191,this.r[9]=l>>>5&127;for(let t=0;t<8;t++)this.pad[t]=k(e,16+2*t)}process(e,t,r=!1){let{h:n,r:o}=this,s=o[0],i=o[1],a=o[2],c=o[3],l=o[4],u=o[5],d=o[6],f=o[7],p=o[8],h=o[9],y=k(e,t+0),g=k(e,t+2),m=k(e,t+4),w=k(e,t+6),b=k(e,t+8),E=k(e,t+10),A=k(e,t+12),S=k(e,t+14),v=n[0]+(8191&y),T=n[1]+((y>>>13|g<<3)&8191),O=n[2]+((g>>>10|m<<6)&8191),R=n[3]+((m>>>7|w<<9)&8191),_=n[4]+((w>>>4|b<<12)&8191),x=n[5]+(b>>>1&8191),P=n[6]+((b>>>14|E<<2)&8191),D=n[7]+((E>>>11|A<<5)&8191),I=n[8]+((A>>>8|S<<8)&8191),j=n[9]+(S>>>5|2048*!r),C=0,U=0+v*s+5*h*T+5*p*O+5*f*R+5*d*_;C=U>>>13,U&=8191,U+=5*u*x+5*l*P+5*c*D+5*a*I+5*i*j,C+=U>>>13,U&=8191;let N=C+v*i+T*s+5*h*O+5*p*R+5*f*_;C=N>>>13,N&=8191,N+=5*d*x+5*u*P+5*l*D+5*c*I+5*a*j,C+=N>>>13,N&=8191;let L=C+v*a+T*i+O*s+5*h*R+5*p*_;C=L>>>13,L&=8191,L+=5*f*x+5*d*P+5*u*D+5*l*I+5*c*j,C+=L>>>13,L&=8191;let H=C+v*c+T*a+O*i+R*s+5*h*_;C=H>>>13,H&=8191,H+=5*p*x+5*f*P+5*d*D+5*u*I+5*l*j,C+=H>>>13,H&=8191;let K=C+v*l+T*c+O*a+R*i+_*s;C=K>>>13,K&=8191,K+=5*h*x+5*p*P+5*f*D+5*d*I+5*u*j,C+=K>>>13,K&=8191;let W=C+v*u+T*l+O*c+R*a+_*i;C=W>>>13,W&=8191,W+=x*s+5*h*P+5*p*D+5*f*I+5*d*j,C+=W>>>13,W&=8191;let $=C+v*d+T*u+O*l+R*c+_*a;C=$>>>13,$&=8191,$+=x*i+P*s+5*h*D+5*p*I+5*f*j,C+=$>>>13,$&=8191;let M=C+v*f+T*d+O*u+R*l+_*c;C=M>>>13,M&=8191,M+=x*a+P*i+D*s+5*h*I+5*p*j,C+=M>>>13,M&=8191;let J=C+v*p+T*f+O*d+R*u+_*l;C=J>>>13,J&=8191,J+=x*c+P*a+D*i+I*s+5*h*j,C+=J>>>13,J&=8191;let F=C+v*h+T*p+O*f+R*d+_*u;C=F>>>13,F&=8191,F+=x*l+P*c+D*a+I*i+j*s,C+=F>>>13,F&=8191,U=8191&(C=(C=(C<<2)+C|0)+U|0),C>>>=13,N+=C,n[0]=U,n[1]=N,n[2]=L,n[3]=H,n[4]=K,n[5]=W,n[6]=$,n[7]=M,n[8]=J,n[9]=F}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 s=e[0]+t[0];e[0]=65535&s;for(let r=1;r<8;r++)s=(e[r]+t[r]|0)+(s>>>16)|0,e[r]=65535&s;l(r)}update(e){a(this),i(e);let{buffer:t,blockLen:r}=this,n=(e=g(e)).length;for(let o=0;o<n;){let s=Math.min(r-this.pos,n-o);if(s===r){for(;r<=n-o;o+=r)this.process(e,o);continue}t.set(e.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===r&&(this.process(t,0,!1),this.pos=0)}return this}destroy(){l(this.h,this.r,this.buffer,this.pad)}digestInto(e){a(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 s=0;for(let t=0;t<8;t++)e[s++]=n[t]>>>0,e[s++]=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 D=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 P(e));function I(e,t,r,n,o,s=20){let i=e[0],a=e[1],c=e[2],l=e[3],u=t[0],d=t[1],f=t[2],p=t[3],h=t[4],y=t[5],g=t[6],m=t[7],w=r[0],b=r[1],E=r[2],A=i,S=a,v=c,O=l,R=u,_=d,x=f,k=p,P=h,D=y,j=g,C=m,U=o,N=w,L=b,H=E;for(let e=0;e<s;e+=2)P=P+(U=T(U^(A=A+R|0),16))|0,A=A+(R=T(R^P,12))|0,P=P+(U=T(U^A,8))|0,R=T(R^P,7),D=D+(N=T(N^(S=S+_|0),16))|0,S=S+(_=T(_^D,12))|0,D=D+(N=T(N^S,8))|0,_=T(_^D,7),j=j+(L=T(L^(v=v+x|0),16))|0,v=v+(x=T(x^j,12))|0,j=j+(L=T(L^v,8))|0,x=T(x^j,7),C=C+(H=T(H^(O=O+k|0),16))|0,O=O+(k=T(k^C,12))|0,C=C+(H=T(H^O,8))|0,k=T(k^C,7),j=j+(H=T(H^(A=A+_|0),16))|0,A=A+(_=T(_^j,12))|0,j=j+(H=T(H^A,8))|0,_=T(_^j,7),C=C+(U=T(U^(S=S+x|0),16))|0,S=S+(x=T(x^C,12))|0,C=C+(U=T(U^S,8))|0,x=T(x^C,7),P=P+(N=T(N^(v=v+k|0),16))|0,v=v+(k=T(k^P,12))|0,P=P+(N=T(N^v,8))|0,k=T(k^P,7),D=D+(L=T(L^(O=O+R|0),16))|0,O=O+(R=T(R^D,12))|0,D=D+(L=T(L^O,8))|0,R=T(R^D,7);let K=0;n[K++]=i+A|0,n[K++]=a+S|0,n[K++]=c+v|0,n[K++]=l+O|0,n[K++]=u+R|0,n[K++]=d+_|0,n[K++]=f+x|0,n[K++]=p+k|0,n[K++]=h+P|0,n[K++]=y+D|0,n[K++]=g+j|0,n[K++]=m+C|0,n[K++]=o+U|0,n[K++]=w+N|0,n[K++]=b+L|0,n[K++]=E+H|0}let j=x(I,{counterRight:!1,counterLength:4,allowShortKeys:!1}),C=x(I,{counterRight:!1,counterLength:8,extendNonceFn:function(e,t,r,n){let o=e[0],s=e[1],i=e[2],a=e[3],c=t[0],l=t[1],u=t[2],d=t[3],f=t[4],p=t[5],h=t[6],y=t[7],g=r[0],m=r[1],w=r[2],b=r[3];for(let e=0;e<20;e+=2)f=f+(g=T(g^(o=o+c|0),16))|0,o=o+(c=T(c^f,12))|0,f=f+(g=T(g^o,8))|0,c=T(c^f,7),p=p+(m=T(m^(s=s+l|0),16))|0,s=s+(l=T(l^p,12))|0,p=p+(m=T(m^s,8))|0,l=T(l^p,7),h=h+(w=T(w^(i=i+u|0),16))|0,i=i+(u=T(u^h,12))|0,h=h+(w=T(w^i,8))|0,u=T(u^h,7),y=y+(b=T(b^(a=a+d|0),16))|0,a=a+(d=T(d^y,12))|0,y=y+(b=T(b^a,8))|0,d=T(d^y,7),h=h+(b=T(b^(o=o+l|0),16))|0,o=o+(l=T(l^h,12))|0,h=h+(b=T(b^o,8))|0,l=T(l^h,7),y=y+(g=T(g^(s=s+u|0),16))|0,s=s+(u=T(u^y,12))|0,y=y+(g=T(g^s,8))|0,u=T(u^y,7),f=f+(m=T(m^(i=i+d|0),16))|0,i=i+(d=T(d^f,12))|0,f=f+(m=T(m^i,8))|0,d=T(d^f,7),p=p+(w=T(w^(a=a+c|0),16))|0,a=a+(c=T(c^p,12))|0,p=p+(w=T(w^a,8))|0,c=T(c^p,7);let E=0;n[E++]=o,n[E++]=s,n[E++]=i,n[E++]=a,n[E++]=g,n[E++]=m,n[E++]=w,n[E++]=b},allowShortKeys:!1}),U=new Uint8Array(16),N=(e,t)=>{e.update(t);let r=t.length%16;r&&e.update(U.subarray(r))},L=new Uint8Array(32);function H(e,t,r,n,s){void 0!==s&&i(s,void 0,"AAD");let a=e(t,r,L),c=function(e,t,r){o(r);let n=new Uint8Array(16),s=new DataView(n.buffer,n.byteOffset,n.byteLength);return s.setBigUint64(0,BigInt(t),r),s.setBigUint64(8,BigInt(e),r),n}(n.length,s?s.length:0,!0),u=D.create(a);s&&N(u,s),N(u,n),u.update(c);let d=u.digest();return l(a,c),d}let K=e=>(t,r,n)=>({encrypt(o,s){let i=o.length;(s=y(i+16,s,!1)).set(o);let a=s.subarray(0,-16);e(t,r,a,a,1);let c=H(e,t,r,a,n);return s.set(c,i),l(c),s},decrypt(o,s){s=y(o.length-16,s,!1);let i=o.subarray(0,-16),a=o.subarray(-16),c=H(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}(a,c))throw Error("invalid tag");return s.set(o.subarray(0,-16)),e(t,r,s,s,1),l(c),s}});K(j);let W=((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 s=e.tagLength;s&&void 0!==o[1]&&i(o[1],void 0,"AAD");let a=t(n,...o),c=(e,t)=>{if(void 0!==t){if(2!==e)throw Error("cipher output not supported");i(t,void 0,"output")}},l=!1;return{encrypt(e,t){if(l)throw Error("cannot encrypt() twice with same key + nonce");return l=!0,i(e),c(a.encrypt.length,t),a.encrypt(e,t)},decrypt(e,t){if(i(e),s&&e.length<s)throw Error('"ciphertext" expected length bigger than tagLength='+s);return c(a.decrypt.length,t),a.decrypt(e,t)}}}return Object.assign(r,e),r})({blockSize:64,nonceLength:24,tagLength:16},K(C));r(85986);var $=r(9400),M=r(48503),J=r(19736),F=r(81293);async function q(e,t,r){let n=await (0,F.j)(e,t,"sign");return(0,J.O)(e,n),new Uint8Array(await crypto.subtle.sign((0,M.B)(e,n.algorithm),n,r))}var z=r(44570),B=r(10709),Y=r(48673),G=r(56940),V=r(78384),Z=r(67216);class X{#e;#h;#y;constructor(e){if(!(e instanceof Uint8Array))throw TypeError("payload must be an instance of Uint8Array");this.#e=e}setProtectedHeader(e){if(this.#h)throw TypeError("setProtectedHeader can only be called once");return this.#h=e,this}setUnprotectedHeader(e){if(this.#y)throw TypeError("setUnprotectedHeader can only be called once");return this.#y=e,this}async sign(e,t){let r,n,o,s;if(!this.#h&&!this.#y)throw new B.Ye("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!(0,z.f)(this.#h,this.#y))throw new B.Ye("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let i={...this.#h,...this.#y},a=(0,V.n)(B.Ye,new Map([["b64",!0]]),t?.crit,this.#h,i),c=!0;if(a.has("b64")&&"boolean"!=typeof(c=this.#h.b64))throw new B.Ye('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:l}=i;if("string"!=typeof l||!l)throw new B.Ye('JWS "alg" (Algorithm) Header Parameter missing or invalid');(0,G.y)(l,e,"sign"),c?(r=(0,$.l)(this.#e),n=(0,Y.lF)(r)):(n=this.#e,r=""),this.#h?(o=(0,$.l)(JSON.stringify(this.#h)),s=(0,Y.lF)(o)):(o="",s=new Uint8Array);let u=(0,Y.xW)(s,(0,Y.lF)("."),n),d=await (0,Z.l)(e,l),f=await q(l,d,u),p={signature:(0,$.l)(f),payload:r};return this.#y&&(p.header=this.#y),this.#h&&(p.protected=o),p}}class Q{#g;constructor(e){this.#g=new X(e)}setProtectedHeader(e){return this.#g.setProtectedHeader(e),this}async sign(e,t){let r=await this.#g.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(11889);class et{#h;#m;constructor(e={}){this.#m=new ee.cE(e)}setIssuer(e){return this.#m.iss=e,this}setSubject(e){return this.#m.sub=e,this}setAudience(e){return this.#m.aud=e,this}setJti(e){return this.#m.jti=e,this}setNotBefore(e){return this.#m.nbf=e,this}setExpirationTime(e){return this.#m.exp=e,this}setIssuedAt(e){return this.#m.iat=e,this}setProtectedHeader(e){return this.#h=e,this}async sign(e,t){let r=new Q(this.#m.data());if(r.setProtectedHeader(this.#h),Array.isArray(this.#h?.crit)&&this.#h.crit.includes("b64")&&!1===this.#h.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(48960),r(57808),r(69328);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+=f[e[r]];return t}
1(w(W)(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)),s=h(e.charCodeAt(o+1));if(void 0===r||void 0===s)throw Error('hex string expected, got non-hex character "'+(e[o]+e[o+1])+'" at index '+o);n[t]=16*r+s}return n}(t),s=w(W)(new Uint8Array(r));return new TextDecoder().decode(s.decrypt(o))}},67216:(e,t,r)=>{"use strict";let n;r.d(t,{l:()=>l});var o=r(29018),s=r(9400),i=r(55141),a=r(74517);let c=async(e,t,r,o=!1)=>{let s=(n||=new WeakMap).get(e);if(s?.[r])return s[r];let a=await (0,i.x)({...t,alg:r});return o&&Object.freeze(e),s?s[r]=a:n.set(e,{[r]:a}),a};async function l(e,t){if(e instanceof Uint8Array||(0,a.R7)(e))return e;if((0,a.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 s="public"===e.type,i=!!s;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,s?[]:["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,[s?"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,[s?"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,s?["encrypt"]:["decrypt"]);r=e.toCryptoKey({name:t.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:n},i,[s?"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,[s?"verify":"sign"])),"ES384"===t&&"P-384"===n&&(r=e.toCryptoKey({name:"ECDSA",namedCurve:n},i,[s?"verify":"sign"])),"ES512"===t&&"P-521"===n&&(r=e.toCryptoKey({name:"ECDSA",namedCurve:n},i,[s?"verify":"sign"])),t.startsWith("ECDH-ES")&&(r=e.toCryptoKey({name:"ECDH",namedCurve:n},i,s?[]:["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 c(e,r,t)}if((0,o.ll)(e))return e.k?(0,s.D)(e.k):c(e,e,t,!0);throw Error("unreachable")}},67257:(e,t,r)=>{"use strict";r.d(t,{e:()=>i});let n=[],o=0,s=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 s=t.indexOf(e);~s&&(t.splice(s,1),--r.lc||r.off())}),notify(e,i){s++;let a=!n.length;for(let o of t)n.push(o,r.value,e,i);if(a){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}},69328:(e,t,r)=>{"use strict";r.d(t,{g:()=>n});let n=(0,r(76442).q)("a-z","0-9","A-Z","-_")},69870:(e,t,r)=>{"use strict";r.d(t,{s:()=>i});var n=r(75938),o=r(48960),s=r(85986);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 a=await n.aK.sign("HMAC",e,"string"==typeof i?new TextEncoder().encode(i):i);return"hex"===t?o.u.encode(a):"base64"===t||"base64url"===t||"base64urlnopad"===t?s.z.encode(a,{padding:"base64urlnopad"!==t}):a},verify:async(e,i,a)=>
1("string"==typeof e&&(e=await r.importKey(e,"verify")),"hex"===t&&(a=o.u.decode(a)),("base64"===t||"base64url"===t||"base64urlnopad"===t)&&(a=await s.K.decode(a)),n.aK.verify("HMAC",e,"string"==typeof a?new TextEncoder().encode(a):a,"string"==typeof i?new TextEncoder().encode(i):i))};return r}},74517:(e,t,r)=>{"use strict";r.d(t,{D2:()=>o,P2:()=>s,R7:()=>n});let n=e=>{if(e?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return e instanceof CryptoKey}catch{return!1}},o=e=>e?.[Symbol.toStringTag]==="KeyObject",s=e=>n(e)||o(e)},75303:(e,t,r)=>{"use strict";r.d(t,{_:()=>i});var n=r(9400),o=r(48673),s=r(88969);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,s.G)(e))throw Error();return e}catch{throw TypeError("Invalid Token or Protected Header formatting")}}},75938:(e,t,r)=>{"use strict";r.d(t,{UY:()=>s,aK:()=>o});let n=globalThis.crypto,o=n.subtle,s=e=>n.getRandomValues(e)},76442:(e,t,r)=>{"use strict";r.d(t,{q:()=>s});var n=r(75938);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 s(...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,...s)=>{let i;if(e<=0)throw Error("Length must be a positive integer.");let a=t,c=r;s.length>0&&(c=(a=s.map(o).join("")).length);let l=Math.floor(256/c)*c,u=new Uint8Array(2*e),d=u.length,f="",p=d;for(;f.length<e;)p>=d&&((0,n.UY)(u),p=0),(i=u[p++])<l&&(f+=a[i%c]);return f}}},78384:(e,t,r)=>{"use strict";r.d(t,{n:()=>o});var n=r(10709);function o(e,t,r,o,s){let i;if(void 0!==s.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 a of(i=void 0!==r?new Map([...Object.entries(r),...t.entries()]):t,o.crit)){if(!i.has(a))throw new n.T0(`Extension Header Parameter "${a}" is not recognized`);if(void 0===s[a])throw new e(`Extension Header Parameter "${a}" is missing`);if(i.get(a)&&void 0===o[a])throw new e(`Extension Header Parameter "${a}" MUST be integrity protected`)}return new Set(o.crit)}},80672:(e,t,r)=>{"use strict";r.d(t,{A:()=>p});var n=r(22531),o=r(68786),s=r.t(o,2),i=r(51367),a=s["use".trim()],c=r(2174),l=r(16383),u=r(13059),d=r(58682),f=r(58889);function p(e){let{Link:t,config:r,getPathname:s,...p}=function(e,t){var r,s,i;let f={...r=t||{},localePrefix:"object"==typeof(i=r.localePrefix)?i:{mode:i||"always"},localeCookie:!!((s=r.localeCookie)??1)&&{name:"NEXT_LOCALE",sameSite:"lax",..."object"==typeof s&&s},localeDetection:r.localeDetection??!0,alternateLinks:r.alternateLinks??!0},p=f.pathnames,h=(0,o.forwardRef)(function({href:t,locale:r,...n},o){let s,i;"object"==typeof t?(s=t.pathname,i=t.params):s=t;let u=(0,c._x)(t),h=e(),g=(0,c.yL)(h)?a(h):h,m=u?y({locale:r||g,href:null==p?s:{pathname:s,params:i},forcePrefix:null!=r||void 0}):s;return(0,d.jsx)(l.default,{ref:o,href:"object"==typeof t?{...t,pathname:m}:m,locale:r,localeCookie:f.localeCookie,...n})});function y(e){let t,{forcePrefix:r,href:n,locale:o}=e;return null==p?"object"==typeof n?(t=n.pathname,n.query&&(t+=(0,u.Zn)(n.query))):t=n:t=(0,u.FP)({locale:o,...(0,u.TK)(n),pathnames:f.pathnames}),(0,u.x3)(t,o,f,r)}function g(e){return function(t,...r){return e(y(t),...r)}}return{config:f,Link:h,redirect:g(n.redirect),permanentRedirect:g(n.permanentRedirect),getPathname:y}}(i.Ym,e);return{...p,Link:t,usePathname:function(){let e=function(e){let t=(0,n.usePathname)(),r=(0,i.Ym)();return(0,o.useMemo)(()=>{if(!t)return t;let n=t,o=(0,c.XP)(r,e.localePrefix);if((0,c.wO)(o,t))n=(0,c.MY)(t,o);else if("as-needed"===e.localePrefix.mode&&e.localePrefix.prefixes){let e=(0,c.bL)(r);(0,c.wO)(e,t)&&(n=(0,c.MY)(t,e))}return n},[e.localePrefix,r,t])}(r),t=(0,i.Ym)();return(0,o.useMemo)(()=>e&&r.pathnames?(0,u.aM)(t,e,r.pathnames):e,[t,e])},useRouter:function(){let e=(0,n.useRouter)(),t=(0,i.Ym)(),a=(0,n.usePathname)();return(0,o.useMemo)(()=>{function n(e){return function(n,o){let{locale:i,...c}=o||{},l=[s({href:n,locale:i||t})];Object.keys(c).length>0&&l.push(c),(0,f.A)(r.localeCookie,a,t,i),e(...l)}
1}return{...e,push:n(e.push),replace:n(e.replace),prefetch:n(e.prefetch)}},[t,a,e])},getPathname:s}}},81293:(e,t,r)=>{"use strict";r.d(t,{j:()=>i});let n=(e,t="algorithm.name")=>TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`);function o(e){return parseInt(e.name.slice(4),10)}var s=r(92103);async function i(e,t,r){if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw TypeError((0,s.X)(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("HMAC"!==e.algorithm.name)throw n("HMAC");let r=parseInt(t.slice(2),10);if(o(e.algorithm.hash)!==r)throw n(`SHA-${r}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if("RSASSA-PKCS1-v1_5"!==e.algorithm.name)throw n("RSASSA-PKCS1-v1_5");let r=parseInt(t.slice(2),10);if(o(e.algorithm.hash)!==r)throw n(`SHA-${r}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if("RSA-PSS"!==e.algorithm.name)throw n("RSA-PSS");let r=parseInt(t.slice(2),10);if(o(e.algorithm.hash)!==r)throw n(`SHA-${r}`,"algorithm.hash");break}
1case"Ed25519":case"EdDSA":if("Ed25519"!==e.algorithm.name)throw n("Ed25519");break;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":let s;if(s=e.algorithm,s.name!==t)throw n(t);break;case"ES256":case"ES384":case"ES512":{if("ECDSA"!==e.algorithm.name)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}},85986:(e,t,r)=>{"use strict";function n(e){return e?"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"}function o(e,t,r){let n="",o=0,s=0;for(let r of e)for(o=o<<8|r,s+=8;s>=6;)s-=6,n+=t[o>>s&63];if(s>0&&(n+=t[o<<6-s&63]),r){let e=(4-n.length%4)%4;n+="=".repeat(e)}return n}function s(e,t){let r=new Map;for(let e=0;e<t.length;e++)r.set(t[e],e);let n=[],o=0,s=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,(s+=6)>=8&&(s-=8,n.push(o>>s&255))}return Uint8Array.from(n)}r.d(t,{K:()=>i,z:()=>a});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 s(e,t)}},a={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 s(e,t)}}},88969:(e,t,r)=>{"use strict";function n(e){if("object"!=typeof e||null===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}r.d(t,{G:()=>n})},89241:(e,t,r)=>{"use strict";r.d(t,{b:()=>c,e:()=>i});var n=r(55036);let o=Object.create(null),s=e=>globalThis.process?.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(e?o:globalThis),i=new Proxy(o,{get:(e,t)=>s()[t]??o[t],has:(e,t)=>t in s()||t in o,set:(e,t,r)=>(s(!0)[t]=r,!0),deleteProperty(e,t){if(!t)return!1;let r=s(!0);return delete r[t],!0},ownKeys:()=>Object.keys(s(!0))}),a=void 0!==n&&n.env&&"production"||"",c="dev"===a||"development"===a},90658:(e,t,r)=>{"use strict";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=".",s){if(!n(r))return e(t,{},o,s);let i=Object.assign({},r);for(let r in t){if("__proto__"===r||"constructor"===r)continue;let a=t[r];null!=a&&(s&&s(i,r,a,o)||(Array.isArray(a)&&Array.isArray(i[r])?i[r]=[...a,...i[r]]:n(a)&&n(i[r])?i[r]=e(a,i[r],(o?`${o}.`:"")+r.toString(),s):i[r]=a))}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})},92103:(e,t,r)=>{"use strict";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,{X:()=>o,t:()=>s});let o=(e,...t)=>n("Key must be ",e,...t),s=(e,t,...r)=>n(`Key for the ${e} algorithm must be `,t,...r)}}]);

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.