1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[56813],{7766:(e,t,r)=>{function n(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function a(e){return parseInt(e,16)}function s(e){return"0x"+Array.from(new TextEncoder().encode(e),e=>e.toString(16).padStart(2,"0")).join("")}function i(e){var t;let{chainId:r,domain:a,expirationTime:s,issuedAt:i=new Date,nonce:o,notBefore:u,requestId:l,resources:c,scheme:d,uri:h,version:f}=e;if(!Number.isInteger(r))throw Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!a)throw Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(o&&o.length<8)throw Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${o}`);if(!h)throw Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if("1"!==f)throw Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${f}`);if(null==(t=e.statement)?void 0:t.includes("\n"))throw Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`);let p=n(e.address),w=d?`${d}://${a}`:a,y=e.statement?`${e.statement} 2`:"",g=`${w} wants you to sign in with your Ethereum account: 3${p} 4 5${y}`,m=`URI: ${h} 6Version: ${f} 7Chain ID: ${r}${o?` 8Nonce: ${o}`:""} 9Issued At: ${i.toISOString()}`;if(s&&(m+=` 10Expiration Time: ${s.toISOString()}`),u&&(m+=` 11Not Before: ${u.toISOString()}`),l&&(m+=` 12Request ID: ${l}`),c){let e="\nResources:";for(let t of c){if(!t||"string"!=typeof t)throw Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${t}`);e+=` 13- ${t}`}m+=e}return`${g} 14${m}`}r.d(t,{aD:()=>a,bv:()=>n,nj:()=>s,ob:()=>i})},8554:(e,t,r)=>{r.d(t,{$W:()=>p,AQ:()=>l,Bo:()=>h,CT:()=>i,Jj:()=>f,Rn:()=>c,YI:()=>s,a4:()=>a,eK:()=>o,nf:()=>u,sk:()=>d});var n=r(27255);let a=3e4,s=3,i=9e4,o=6e4,u="http://localhost:9999",l="supabase.auth.token",c={"X-Client-Info":`gotrue-js/${n.r}`},d="X-Supabase-Api-Version",h={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},f=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,p=6e5},19943:(e,t,r)=>{r.d(t,{Cl:()=>p,EY:()=>y,GC:()=>f,R_:()=>h,c2:()=>w,vE:()=>c,w4:()=>g});var n=r(46224),a=r(8554),s=r(62890),i=r(54238);let o=e=>{if("object"==typeof e&&null!==e){if("string"==typeof e.msg)return e.msg;if("string"==typeof e.message)return e.message;if("string"==typeof e.error_description)return e.error_description;if("string"==typeof e.error)return e.error}return JSON.stringify(e)},u=[500,501,502,503,504,520,521,522,523,524,525,526,527,528,529,530];async function l(e){var t;let r,n;if(!(0,s.pF)(e))throw new i.zh(o(e),0);if(u.includes(e.status))throw new i.zh(o(e),e.status);try{r=await e.json()}catch(e){throw new i.HU(o(e),e)}let l=(0,s.Rn)(e);if(l&&l.getTime()>=a.Bo["2024-01-01"].timestamp&&"object"==typeof r&&r&&"string"==typeof r.code?n=r.code:"object"==typeof r&&r&&"string"==typeof r.error_code&&(n=r.error_code),n){if("weak_password"===n)throw new i.OI(o(r),e.status,(null==(t=r.weak_password)?void 0:t.reasons)||[]);else if("session_not_found"===n)throw new i.jG}else if("object"==typeof r&&r&&"object"==typeof r.weak_password&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((e,t)=>e&&"string"==typeof t,!0))throw new i.OI(o(r),e.status,r.weak_password.reasons);throw new i.RC(o(r),e.status||500,n)}async function c(e,t,r,n){var s;let i=Object.assign({},null==n?void 0:n.headers);i[a.sk]||(i[a.sk]=a.Bo["2024-01-01"].name),(null==n?void 0:n.jwt)&&(i.Authorization=`Bearer ${n.jwt}`);let o=null!=(s=null==n?void 0:n.query)?s:{};(null==n?void 0:n.redirectTo)&&(o.redirect_to=n.redirectTo);let u=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",l=await d(e,t,r+u,{headers:i,noResolveJson:null==n?void 0:n.noResolveJson},{},null==n?void 0:n.body);return(null==n?void 0:n.xform)?null==n?void 0:n.xform(l):{data:Object.assign({},l),error:null}}async function d(e,t,r,n,a,s){let u,c,d=(c={method:t,headers:(null==n?void 0:n.headers)||{}},"GET"===t?c:(c.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},null==n?void 0:n.headers),c.body=JSON.stringify(s),Object.assign(Object.assign({},c),a)));try{u=await e(r,Object.assign({},d))}catch(e){throw console.error(e),new i.zh(o(e),0)}if(u.ok||await l(u),null==n?void 0:n.noResolveJson)return u;try{return await u.json()}catch(e){await l(e)}}function h(e){var t,r;let n=null;return(r=e).access_token&&r.refresh_token&&r.expires_in&&(n=Object.assign({},e),e.expires_at||(n.expires_at=(0,s.WJ)(e.expires_in))),{data:{session:n,user:null!=(t=e.user)?t:"string"==typeof(null==e?void 0:e.id)?e:null},error:null}}function f(e){let t=h(e);return!t.error&&e.weak_password&&"object"==typeof e.weak_password&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&"string"==typeof e.weak_password.message&&e.weak_password.reasons.reduce((e,t)=>
14e&&"string"==typeof t,!0)&&(t.data.weak_password=e.weak_password),t}function p(e){var t;return{data:{user:null!=(t=e.user)?t:e},error:null}}function w(e){return{data:e,error:null}}function y(e){let{action_link:t,email_otp:r,hashed_token:a,redirect_to:s,verification_type:i}=e;return{data:{properties:{action_link:t,email_otp:r,hashed_token:a,redirect_to:s,verification_type:i},user:Object.assign({},(0,n.Tt)(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]))},error:null}}function g(e){return e}},27255:(e,t,r)=>{r.d(t,{r:()=>n});let n="2.108.2"},31863:(e,t,r)=>{r.d(t,{A:()=>u});var n=r(46224),a=r(19943),s=r(62890);let i=["global","local","others"];var o=r(54238);class u{constructor({url:e="",headers:t={},fetch:r,experimental:n}){this.url=e,this.headers=t,this.fetch=(0,s.lA)(r),this.experimental=null!=n?n:{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}async signOut(e,t=i[0]){if(0>i.indexOf(t))throw Error(`@supabase/auth-js: Parameter scope must be one of ${i.join(", ")}`);try{return await (0,a.vE)(this.fetch,"POST",`${this.url}/logout?scope=${t}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(e){if((0,o.HY)(e))return{data:null,error:e};throw e}}async inviteUserByEmail(e,t={}){try{return await (0,a.vE)(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:t.data},headers:this.headers,redirectTo:t.redirectTo,xform:a.Cl})}catch(e){if((0,o.HY)(e))return{data:{user:null},error:e};throw e}}async generateLink(e){try{let{options:t}=e,r=(0,n.Tt)(e,["options"]),s=Object.assign(Object.assign({},r),t);return"newEmail"in r&&(s.new_email=null==r?void 0:r.newEmail,delete s.newEmail),await (0,a.vE)(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:a.EY,redirectTo:null==t?void 0:t.redirectTo})}catch(e){if((0,o.HY)(e))return{data:{properties:null,user:null},error:e};throw e}}async createUser(e){try{return await (0,a.vE)(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:a.Cl})}catch(e){if((0,o.HY)(e))return{data:{user:null},error:e};throw e}}async listUsers(e){var t,r,n,s,i,u,l;try{let o={nextPage:null,lastPage:0,total:0},c=await (0,a.vE)(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:null!=(r=null==(t=null==e?void 0:e.page)?void 0:t.toString())?r:"",per_page:null!=(s=null==(n=null==e?void 0:e.perPage)?void 0:n.toString())?s:""},xform:a.w4});if(c.error)throw c.error;let d=await c.json(),h=null!=(i=c.headers.get("x-total-count"))?i:0,f=null!=(l=null==(u=c.headers.get("link"))?void 0:u.split(","))?l:[];return f.length>0&&(f.forEach(e=>{let t=parseInt(e.split(";")[0].split("=")[1].substring(0,1)),r=JSON.parse(e.split(";")[1].split("=")[1]);o[`${r}Page`]=t}),o.total=parseInt(h)),{data:Object.assign(Object.assign({},d),o),error:null}}catch(e){if((0,o.HY)(e))return{data:{users:[]},error:e};throw e}}async getUserById(e){(0,s.W0)(e);try{return await (0,a.vE)(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:a.Cl})}catch(e){if((0,o.HY)(e))return{data:{user:null},error:e};throw e}}async updateUserById(e,t){(0,s.W0)(e);try{return await (0,a.vE)(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:a.Cl})}catch(e){if((0,o.HY)(e))return{data:{user:null},error:e};throw e}}async deleteUser(e,t=!1){(0,s.W0)(e);
14try{return await (0,a.vE)(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:a.Cl})}catch(e){if((0,o.HY)(e))return{data:{user:null},error:e};throw e}}async _listFactors(e){(0,s.W0)(e.userId);try{let{data:t,error:r}=await (0,a.vE)(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:e=>({data:{factors:e},error:null})});return{data:t,error:r}}catch(e){if((0,o.HY)(e))return{data:null,error:e};throw e}}async _deleteFactor(e){(0,s.W0)(e.userId),(0,s.W0)(e.id);try{return{data:await (0,a.vE)(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(e){if((0,o.HY)(e))return{data:null,error:e};throw e}}async _listOAuthClients(e){var t,r,n,s,i,u,l;try{let o={nextPage:null,lastPage:0,total:0},c=await (0,a.vE)(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:null!=(r=null==(t=null==e?void 0:e.page)?void 0:t.toString())?r:"",per_page:null!=(s=null==(n=null==e?void 0:e.perPage)?void 0:n.toString())?s:""},xform:a.w4});if(c.error)throw c.error;let d=await c.json(),h=null!=(i=c.headers.get("x-total-count"))?i:0,f=null!=(l=null==(u=c.headers.get("link"))?void 0:u.split(","))?l:[];return f.length>0&&(f.forEach(e=>{let t=parseInt(e.split(";")[0].split("=")[1].substring(0,1)),r=JSON.parse(e.split(";")[1].split("=")[1]);o[`${r}Page`]=t}),o.total=parseInt(h)),{data:Object.assign(Object.assign({},d),o),error:null}}catch(e){if((0,o.HY)(e))return{data:{clients:[]},error:e};throw e}}async _createOAuthClient(e){try{return await (0,a.vE)(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if((0,o.HY)(e))return{data:null,error:e};throw e}}async _getOAuthClient(e){try{return await (0,a.vE)(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if((0,o.HY)(e))return{data:null,error:e};throw e}}async _updateOAuthClient(e,t){try{return await (0,a.vE)(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${e}`,{body:t,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if((0,o.HY)(e))return{data:null,error:e};throw e}}async _deleteOAuthClient(e){try{return await (0,a.vE)(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if((0,o.HY)(e))return{data:null,error:e};throw e}}async _regenerateOAuthClientSecret(e){try{return await (0,a.vE)(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if((0,o.HY)(e))return{data:null,error:e};throw e}}async _listCustomProviders(e){try{let t={};return(null==e?void 0:e.type)&&(t.type=e.type),await (0,a.vE)(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:t,xform:e=>{var t;return{data:{providers:null!=(t=null==e?void 0:e.providers)?t:[]},error:null}}})}catch(e){if((0,o.HY)(e))return{data:{providers:[]},error:e};throw e}}async _createCustomProvider(e){try{return await (0,a.vE)(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if((0,o.HY)(e))return{data:null,error:e};throw e}}async _getCustomProvider(e){try{return await (0,a.vE)(this.fetch,"GET",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if((0,o.HY)(e))return{data:null,error:e};throw e}}async _updateCustomProvider(e,t){try{return await (0,a.vE)(this.fetch,"PUT",`${this.url}/admin/custom-providers/${e}`,{body:t,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if((0,o.HY)(e))return{data:null,error:e};throw e}}async _deleteCustomProvider(e){try{return await (0,a.vE)(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if((0,o.HY)(e))return{data:null,error:e};throw e}}async _adminListPasskeys(e){(0,s.aA)(this.experimental),(0,s.W0)(e.userId);try{return await (0,a.vE)(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/passkeys`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if((0,o.HY)(e))return{data:null,error:e};throw e}}async _adminDeletePasskey(e){(0,s.aA)(this.experimental),(0,s.W0)(e.userId),(0,s.W0)(e.passkeyId);
14try{return await (0,a.vE)(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/passkeys/${e.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if((0,o.HY)(e))return{data:null,error:e};throw e}}}},54238:(e,t,r)=>{r.d(t,{FE:()=>b,Fw:()=>m,HU:()=>o,HY:()=>a,MJ:()=>p,MR:()=>f,NA:()=>i,OI:()=>v,Ox:()=>d,RC:()=>s,Ru:()=>E,U_:()=>h,Uw:()=>w,jG:()=>l,lR:()=>n,lh:()=>y,xL:()=>_,zh:()=>g,zq:()=>c});class n extends Error{constructor(e,t,r){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=t,this.code=r}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function a(e){return"object"==typeof e&&null!==e&&"__isAuthError"in e}class s extends n{constructor(e,t,r){super(e,t,r),this.name="AuthApiError",this.status=t,this.code=r}}function i(e){return a(e)&&"AuthApiError"===e.name}class o extends n{constructor(e,t){super(e),this.name="AuthUnknownError",this.originalError=t}}class u extends n{constructor(e,t,r,n){super(e,r,n),this.name=t,this.status=r}}class l extends u{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function c(e){return a(e)&&"AuthSessionMissingError"===e.name}class d extends u{constructor(){super("Auth session or user missing","AuthInvalidToken
14ResponseError",500,void 0)}}class h extends u{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class f extends u{constructor(e,t=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function p(e){return a(e)&&"AuthImplicitGrantRedirectError"===e.name}class w extends u{constructor(e,t=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class y extends u{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class g extends u{constructor(e,t){super(e,"AuthRetryableFetchError",t,void 0)}}function m(e){return a(e)&&"AuthRetryableFetchError"===e.name}class b extends u{constructor(e="Refresh result discarded: session state changed mid-flight (e.g., concurrent signOut)"){super(e,"AuthRefreshDiscardedError",409,void 0)}}function E(e){return a(e)&&"AuthRefreshDiscardedError"===e.name}class v extends u{constructor(e,t,r){super(e,"AuthWeakPasswordError",t,"weak_password"),this.reasons=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class _ extends u{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}},55239:(e,t,r)=>{r.d(t,{nb:()=>a});var n=r(62890);globalThis&&(0,n.LJ)()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug");class a extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}},62890:(e,t,r)=>{r.d(t,{Bd:()=>u,Cq:()=>m,Gb:()=>y,Go:()=>U,K8:()=>C,KY:()=>o,LJ:()=>c,Oi:()=>p,PB:()=>E,QE:()=>$,Rn:()=>S,U9:()=>w,W0:()=>T,WJ:()=>i,XR:()=>d,aA:()=>j,c2:()=>I,cY:()=>g,dS:()=>A,lA:()=>h,pF:()=>f,uO:()=>x,yy:()=>b});var n=r(8554),a=r(54238),s=r(81031);function i(e){return Math.round(Date.now()/1e3)+e}function o(){return Symbol("auth-callback")}let u=()=>"u">typeof window&&"u">typeof document,l={tested:!1,writable:!1},c=()=>{if(!u())return!1;try{if("object"!=typeof globalThis.localStorage)return!1}catch(e){return!1}if(l.tested)return l.writable;let e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),l.tested=!0,l.writable=!0}catch(e){l.tested=!0,l.writable=!1}return l.writable};function d(e){let t={},r=new URL(e);if(r.hash&&"#"===r.hash[0])try{new URLSearchParams(r.hash.substring(1)).forEach((e,r)=>{t[r]=e})}catch(e){}return r.searchParams.forEach((e,r)=>{t[r]=e}),t}let h=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),f=e=>"object"==typeof e&&null!==e&&"status"in e&&"ok"in e&&"json"in e&&"function"==typeof e.json,p=async(e,t,r)=>{await e.setItem(t,JSON.stringify(r))},w=async(e,t)=>{let r=await e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch(e){return null}},y=async(e,t)=>{await e.removeItem(t)};class g{constructor(){this.promise=new g.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}}function m(e){let t=e.split(".");if(3!==t.length)throw new a.xL("Invalid JWT structure");for(let e=0;e<t.length;e++)if(!n.Jj.test(t[e]))throw new a.xL("JWT not in base64url format");return{header:JSON.parse((0,s.uE)(t[0])),payload:JSON.parse((0,s.uE)(t[1])),signature:(0,s.xf)(t[2]),raw:{header:t[0],payload:t[1]}}}async function b(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function E(e,t){return new Promise((r,n)=>{(async()=>{for(let a=0;a<1/0;a++)try{let n=await e(a);if(!t(a,null,n))return void r(n)}catch(e){if(!t(a,e))return void n(e)}})()})}function v(e){return("0"+e.toString(16)).substr(-2)}async function _(e){let t=new TextEncoder().encode(e);return Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256",t))).map(e=>String.fromCharCode(e)).join("")}async function R(e){return"u">typeof crypto&&void 0!==crypto.subtle&&"u">typeof TextEncoder?btoa(await _(e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""):(console.warn("WebCrypto API is not supported. Code
14challenge method will default to use plain instead of sha256."),e)}async function A(e,t,r=!1){let n=function(){let e=new Uint32Array(56);if("u"<typeof crypto){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",t=e.length,r="";for(let n=0;n<56;n++)r+=e.charAt(Math.floor(Math.random()*t));return r}return crypto.getRandomValues(e),Array.from(e,v).join("")}(),a=n;r&&(a+="/recovery"),await p(e,`${t}-code-verifier`,a);let s=await R(n),i=n===s?"plain":"s256";return[s,i]}g.promiseConstructor=Promise;let O=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function S(e){let t=e.headers.get(n.sk);if(!t||!t.match(O))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch(e){return null}}function I(e){if(!e)throw Error("Missing exp claim");if(e<=Math.floor(Date.now()/1e3))throw Error("JWT has expired")}function C(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw Error("Invalid alg claim")}}let P=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function T(e){if(!P.test(e))throw Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function j(e){if(!e.passkey)throw Error("@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).")}function $(){return new Proxy({},{get:(e,t)=>{if("__isUserNotAvailableProxy"===t)return!0;if("symbol"==typeof t){let e=t.toString();if("Symbol(Symbol.toPrimitive)"===e||"Symbol(Symbol.toStringTag)"===e||"Symbol(util.inspect.custom)"===e)return}throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${t}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,t)=>{throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,t)=>{throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function x(e,t){return new Proxy(e,{get:(e,r,n)=>{if("__isInsecureUserWarningProxy"===r)return!0;if("symbol"==typeof r){let t=r.toString();if("Symbol(Symbol.toPrimitive)"===t||"Symbol(Symbol.toStringTag)"===t||"Symbol(util.inspect.custom)"===t||"Symbol(nodejs.util.inspect.custom)"===t)return Reflect.get(e,r,n)}return t.value||"string"!=typeof r||(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),t.value=!0),Reflect.get(e,r,n)}})}function U(e){return JSON.parse(JSON.stringify(e))}},69265:(e,t,r)=>{r.d(t,{Y5:()=>n.A}),r(31863);var n=r(85400);r(54238),r(55239)},74197:(e,t,r)=>{r.d(t,{H1:()=>_,zZ:()=>y,GO:()=>g,sC:()=>d,KE:()=>h,w_:()=>m,Ll:()=>w,sy:()=>f,CP:()=>p,uL:()=>c});var n=r(46224),a=r(81031),s=r(54238),i=r(62890);class o extends Error{constructor({message:e,code:t,cause:r,name:n}){var a;super(e,{cause:r}),this.__isWebAuthnError=!0,this.name=null!=(a=null!=n?n:r instanceof Error?r.name:void 0)?a:"Unknown Error",this.code=t}toJSON(){return{name:this.name,message:this.message,code:this.code}}}class u extends o{constructor(e,t){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t,message:e}),this.name="WebAuthnUnknownError",this.originalError=t}}class l{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}}}let c=new l;function d(e){if(!e)throw Error("Credential creation options are required");if("u">typeof PublicKeyCredential&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&"function"==typeof PublicKeyCredential.parseCreationOptionsFromJSON)return PublicKeyCredential.parseCreationOptionsFromJSON(e);let{challenge:t,user:r,excludeCredentials:s}=e,i=(0,n.Tt)(e,["challenge","user","excludeCredentials"]),o=(0,a.xf)(t).buffer,u=Object.assign(Object.assign({},r),{id:(0,a.xf)(r.id).buffer}),l=Object.assign(Object.assign({},i),{challenge:o,user:u});if(s&&s.length>0){l.excludeCredentials=Array(s.length);for(let e=0;e<s.length;e++){let t=s[e];l.excludeCredentials[e]=Object.assign(Object.assign({},t),{id:(0,a.xf)(t.id).buffer,type:t.type||"public-key",transports:t.transports})}}return l}function h(e){if(!e)throw Error("Credential request options are required");if("u">typeof PublicKeyCredential&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&"function"==typeof PublicKeyCredential.parseRequestOptionsFromJSON)return PublicKeyCredential.parseRequestOptionsFromJSON(e);let{challenge:t,allowCredentials:r}=e,s=(0,n.Tt)(e,["challenge","allowCredentials"]),i=(0,a.xf)(t).buffer,o=Object.assign(Object.assign({}
14,s),{challenge:i});if(r&&r.length>0){o.allowCredentials=Array(r.length);for(let e=0;e<r.length;e++){let t=r[e];o.allowCredentials[e]=Object.assign(Object.assign({},t),{id:(0,a.xf)(t.id).buffer,type:t.type||"public-key",transports:t.transports})}}return o}function f(e){var t;return"toJSON"in e&&"function"==typeof e.toJSON?e.toJSON():{id:e.id,rawId:e.id,response:{attestationObject:(0,a.no)(new Uint8Array(e.response.attestationObject)),clientDataJSON:(0,a.no)(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:null!=(t=e.authenticatorAttachment)?t:void 0}}function p(e){var t;if("toJSON"in e&&"function"==typeof e.toJSON)return e.toJSON();let r=e.getClientExtensionResults(),n=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:(0,a.no)(new Uint8Array(n.authenticatorData)),clientDataJSON:(0,a.no)(new Uint8Array(n.clientDataJSON)),signature:(0,a.no)(new Uint8Array(n.signature)),userHandle:n.userHandle?(0,a.no)(new Uint8Array(n.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:null!=(t=e.authenticatorAttachment)?t:void 0}}function w(e){return"localhost"===e||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function y(){var e,t;return!!((0,i.Bd)()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&"function"==typeof(null==(e=null==navigator?void 0:navigator.credentials)?void 0:e.create)&&"function"==typeof(null==(t=null==navigator?void 0:navigator.credentials)?void 0:t.get))}async function g(e){try{let t=await navigator.credentials.create(e);if(!t)return{data:null,error:new u("Empty credential response",t)};if(!(t instanceof PublicKeyCredential))return{data:null,error:new u("Browser returned unexpected credential type",t)};return{data:t,error:null}}catch(t){return{data:null,error:function({error:e,options:t}){var r,n,a;let{publicKey:s}=t;if(!s)throw Error("options was missing required publicKey property");if("AbortError"===e.name){if(t.signal instanceof AbortSignal)return new o({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if("ConstraintError"===e.name){if((null==(r=s.authenticatorSelection)?void 0:r.requireResidentKey)===!0)return new o({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});else if("conditional"===t.mediation&&(null==(n=s.authenticatorSelection)?void 0:n.userVerification)==="required")return new o({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});else if((null==(a=s.authenticatorSelection)?void 0:a.userVerification)==="required")return new o({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else if("InvalidStateError"===e.name)return new o({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});else if("NotAllowedError"===e.name)return new o({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});else if("NotSupportedError"===e.name)return new o(0===s.pubKeyCredParams.filter(e=>"public-key"===e.type).length?{message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}:{message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});else if("SecurityError"===e.name){let t=window.location.hostname;if(!w(t))return new o({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e});if(s.rp.id!==t)return new o({message:`The RP ID "${s.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else if("TypeError"===e.name){if(s.user.id.byteLength<1||s.user.id.byteLength>64)return new o({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if("UnknownError"===e.name)return new o({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ER
14ROR",cause:e});return new o({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}({error:t,options:e})}}}async function m(e){try{let t=await navigator.credentials.get(e);if(!t)return{data:null,error:new u("Empty credential response",t)};if(!(t instanceof PublicKeyCredential))return{data:null,error:new u("Browser returned unexpected credential type",t)};return{data:t,error:null}}catch(t){return{data:null,error:function({error:e,options:t}){let{publicKey:r}=t;if(!r)throw Error("options was missing required publicKey property");if("AbortError"===e.name){if(t.signal instanceof AbortSignal)return new o({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if("NotAllowedError"===e.name)return new o({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});else if("SecurityError"===e.name){let t=window.location.hostname;if(!w(t))return new o({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e});if(r.rpId!==t)return new o({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else if("UnknownError"===e.name)return new o({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e});return new o({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}({error:t,options:e})}}}let b={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},E={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function v(...e){let t=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),r=e=>e instanceof ArrayBuffer||ArrayBuffer.isView(e),n={};for(let a of e)if(a)for(let e in a){let s=a[e];if(void 0!==s)if(Array.isArray(s))n[e]=s;else if(r(s))n[e]=s;else if(t(s)){let r=n[e];t(r)?n[e]=v(r,s):n[e]=v(s)}else n[e]=s}return n}class _{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:"webauthn"}))}async _challenge({factorId:e,webauthn:t,friendlyName:r,signal:n},a){var i,o,u,l,d;try{let{data:s,error:h}=await this.client.mfa.challenge({factorId:e,webauthn:t});if(!s)return{data:null,error:h};let f=null!=n?n:c.createNewAbortSignal();if("create"===s.webauthn.type){let{user:e}=s.webauthn.credential_options.publicKey;if(!e.name)if(r)e.name=`${e.id}:${r}`;else{let t=(await this.client.getUser()).data.user,r=(null==(i=null==t?void 0:t.user_metadata)?void 0:i.name)||(null==t?void 0:t.email)||(null==t?void 0:t.id)||"User";e.name=`${e.id}:${r}`}e.displayName||(e.displayName=e.name)}switch(s.webauthn.type){case"create":{let t=(o=s.webauthn.credential_options.publicKey,u=null==a?void 0:a.create,v(b,o,u||{})),{data:r,error:n}=await g({publicKey:t,signal:f});if(r)return{data:{factorId:e,challengeId:s.id,webauthn:{type:s.webauthn.type,credential_response:r}},error:null};return{data:null,error:n}}case"request":{let t=(l=s.webauthn.credential_options.publicKey,d=null==a?void 0:a.request,v(E,l,d||{})),{data:r,error:n}=await m(Object.assign(Object.assign({},s.webauthn.credential_options),{publicKey:t,signal:f}));if(r)return{data:{factorId:e,challengeId:s.id,webauthn:{type:s.webauthn.type,credential_response:r}},error:null};return{data:null,error:n}}}}catch(e){if((0,s.HY)(e))return{data:null,error:e};return{data:null,error:new s.HU("Unexpected error in challenge",e)}}}async _verify({challengeId:e,factorId:t,webauthn:r}){return this.client.mfa.verify({factorId:t,challengeId:e,webauthn:r})}async _authenticate({factorId:e,webauthn:{rpId:t="u">typeof window?window.location.hostname:void 0,rpOrigins:r="u">typeof window?[window.location.origin]:void 0,signal:n}={}},a){if(!t)return{data:null,error:new s.lR("rpId is required for WebAuthn authentication")};try{if(!y())return{data:null,error:new s.HU("Browser does not support WebAuthn",null)};let{data:i,error:o}=await this.challenge({factorId:e,webauthn:{rpId:t,rpOrigins:r},signal:n},{request:a});if(!i)return{data:null,error:o};let{webauthn:u}=i;return this._verify({factorId:e,challengeId:i.challengeId,webauthn:{type:u.type,rpId:t,rpOrigins:r,credential_response:u.credential_response}})}catch(e){if((0,s.HY)(e))return{data:null,error:e};return{data:null,error:new s.HU("Unexpected error in authenticate",e)}}}async _register({friendlyName:e,webauthn:{rpId:t="u">typeof window?window.location.hostname:void 0,rpOrigins:r="u">typeof window?[window.location.origin]:void 0,signal:n}={}},a){if(!t)return{data:null,error:new s.lR("rpId is required for WebAuthn registration")};try{if(!y())return{data:null,error:new s.HU("Browser does not support WebAuthn",null)};let{data:i,error:o}=await this._enroll({friendlyName:e});if(!i)return await this.client.mfa.listFactors().then(t=>{var r;return null==(r=t.data)?void 0:r.all.find(t=>"webauthn"===t.factor_type&&t.friendly_name===e&&"unverified"!==t.status)}).then(e=>e?this.client.mfa.unenroll({factorId:null==e?void 0:e.id}):void 0),{data:null,error:o};let{data:u,error:l}=await this._challenge({factorId:i.id,friendlyName:i.friendly_name,webauthn:{rpId:t,rpOrigins:r},signal:n},{create:a});if(!u)return{data:null,error:l};return this._verify({factorId:i.id,challengeId:u.challengeId,webauthn:{rpId:t,rpOrigins:r,type:u.webauthn.type,credential_response:u.webauthn.credential_response}})}catch(e){if((0,s.HY)(e))return{data:null,error:e};return{data:null,error:new s.HU("Unexpected error in register",e)}}}}},81031:(e,t,r)=>{r.d(t,{Al:()=>c,no:()=>d,uE:()=>u,xf:()=>l});let n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),a=" \n\r=".split(""),s=(()=>{let e=Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<a.length;t+=1)e[a[t].charCodeAt(0)]=-2;for(let t=0;t<n.length;t+=1)e[n[t].charCodeAt(0)]=t;return e})();function i(e,t,r){if(null!==e)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;)r(n[t.queue>>t.queuedBits-6&63]),t.queuedBits-=6;else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;)r(n[t.queue>>t.queuedBits-6&63]),t.queuedBits-=6}function o(e,t,r){let n=s[e];if(n>-1)for(t.queue=t.queue<<6|n,t.queuedBits+=6;t.queuedBits>=8;)r(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else if(-2===n)return;else throw Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}function u(e){let t=[],r=e=>{t.push(String.fromCodePoint(e))},n={utf8seq:0,codepoint:0},a={queue:0,queuedBits:0},s=e=>{!function(e,t,r){if(0===t.utf8seq){if(e<=127)return r(e);for(let r=1;r<6;r+=1)if((e>>7-r&1)==0){t.utf8seq=r;break}if(2===t.utf8seq)t.codepoint=31&e;else if(3===t.utf8seq)t.codepoint=15&e;else if(4===t.utf8seq)t.codepoint=7&e;else throw Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|63&e,t.utf8seq-=1,0===t.utf8seq&&r(t.codepoint)}}(e,n,r)};for(let t=0;t<e.length;t+=1)o(e.charCodeAt(t),a,s);return t.join("")}function l(e){let t=[],r={queue:0,queuedBits:0},n=e=>{t.push(e)};for(let t=0;t<e.length;t+=1)o(e.charCodeAt(t),r,n);return new Uint8Array(t)}function c(e){let t=[];return!function(e,t){for(let r=0;r<e.length;r+=1){let n=e.charCodeAt(r);if(n>55295&&n<=56319){let t=(n-55296)*1024&65535;n=(e.charCodeAt(r+1)-56320&65535|t)+65536,r+=1}!function(e,t){if(e<=127)return t(e);if(e<=2047){t(192|e>>6),t(128|63&e);return}if(e<=65535){t(224|e>>12),t(128|e>>
146&63),t(128|63&e);return}if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|63&e);return}throw Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}(n,t)}}(e,e=>t.push(e)),new Uint8Array(t)}function d(e){let t=[],r={queue:0,queuedBits:0},n=e=>{t.push(e)};return e.forEach(e=>i(e,r,n)),i(null,r,n),t.join("")}},83551:(e,t,r)=>{r.d(t,{V:()=>n});function n(){if("object"!=typeof globalThis)try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch(e){"u">typeof self&&(self.globalThis=self)}}},84304:(e,t,r)=>{r.d(t,{r:()=>n});function n(e={}){return{getItem:t=>e[t]||null,setItem:(t,r)=>{e[t]=r},removeItem:t=>{delete e[t]}}}}}]);
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.