1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[624],{269:function(e,t,r){"use strict";r.r(t),r.d(t,{AuthAdminApi:function(){return eF},AuthApiError:function(){return h},AuthClient:function(){return eV},AuthError:function(){return u},AuthImplicitGrantRedirectError:function(){return b},AuthInvalidCredentialsError:function(){return v},AuthInvalidJwtError:function(){return k},AuthInvalidTokenResponseError:function(){return y},AuthPKCEGrantCodeExchangeError:function(){return x},AuthRetryableFetchError:function(){return _},AuthSessionMissingError:function(){return m},AuthUnknownError:function(){return f},AuthWeakPasswordError:function(){return T},CustomAuthError:function(){return p},GoTrueAdminApi:function(){return ep},GoTrueClient:function(){return eB},NavigatorLockAcquireTimeoutError:function(){return ev},SIGN_OUT_SCOPES:function(){return ef},isAuthApiError:function(){return d},isAuthError:function(){return c},isAuthImplicitGrantRedirectError:function(){return w},isAuthRetryableFetchError:function(){return E},isAuthSessionMissingError:function(){return g},isAuthWeakPasswordError:function(){return S},lockInternals:function(){return eg},navigatorLock:function(){return ew},processLock:function(){return e_}});var n=r(6200);let i="2.87.1",s={"X-Client-Info":`gotrue-js/${i}`},o="X-Supabase-Api-Version",a={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},l=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i;class u extends Error{constructor(e,t,r){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=t,this.code=r}}function c(e){return"object"==typeof e&&null!==e&&"__isAuthError"in e}class h extends u{constructor(e,t,r){super(e,t,r),this.name="AuthApiError",this.status=t,this.code=r}}function d(e){return c(e)&&"AuthApiError"===e.name}class f extends u{constructor(e,t){super(e),this.name="AuthUnknownError",this.originalError=t}}class p extends u{constructor(e,t,r,n){super(e,r,n),this.name=t,this.status=r}}class m extends p{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function g(e){return c(e)&&"AuthSessionMissingError"===e.name}class y extends p{constructor(){super("Auth session or user missing","AuthInvalidToken
1ResponseError",500,void 0)}}class v extends p{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class b extends p{constructor(e,t=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function w(e){return c(e)&&"AuthImplicitGrantRedirectError"===e.name}class x extends p{constructor(e,t=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class _ extends p{constructor(e,t){super(e,"AuthRetryableFetchError",t,void 0)}}function E(e){return c(e)&&"AuthRetryableFetchError"===e.name}class T extends p{constructor(e,t,r){super(e,"AuthWeakPasswordError",t,"weak_password"),this.reasons=r}}function S(e){return c(e)&&"AuthWeakPasswordError"===e.name}class k extends p{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}let A="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),P=" \n\r=".split(""),O=(()=>{let e=Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<P.length;t+=1)e[P[t].charCodeAt(0)]=-2;for(let t=0;t<A.length;t+=1)e[A[t].charCodeAt(0)]=t;return e})();function R(e,t,r){if(null!==e)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;)r(A[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(A[t.queue>>t.queuedBits-6&63]),t.queuedBits-=6}function C(e,t,r){let n=O[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 j(e){let t=[],r=e=>{t.push(String.fromCodePoint(e))},n={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},s=e=>{!function(e,t,r){if(0===t.utf8seq){if(e<=127){r(e);return}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)C(e.charCodeAt(t),i,s);return t.join("")}function I(e){let t=[],r={queue:0,queuedBits:0},n=e=>{t.push(e)};for(let t=0;t<e.length;t+=1)C(e.charCodeAt(t),r,n);return new Uint8Array(t)}function D(e){let t=[],r={queue:0,queuedBits:0},n=e=>{t.push(e)};return e.forEach(e=>R(e,r,n)),R(null,r,n),t.join("")}let N=()=>"undefined"!=typeof window&&"undefined"!=typeof document,M={tested:!1,writable:!1},L=()=>{if(!N())return!1;try{if("object"!=typeof globalThis.localStorage)return!1}catch(e){return!1}if(M.tested)return M.writable;let e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),M.tested=!0,M.writable=!0}catch(e){M.tested=!0,M.writable=!1}return M.writable},$=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),U=e=>"object"==typeof e&&null!==e&&"status"in e&&"ok"in e&&"json"in e&&"function"==typeof e.json,B=async(e,t,r)=>{await e.setItem(t,JSON.stringify(r))},F=async(e,t)=>{let r=await e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch(e){return r}},V=async(e,t)=>{await e.removeItem(t)};class q{constructor(){this.promise=new q.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}}function W(e){let t=e.split(".");if(3!==t.length)throw new k("Invalid JWT structure");for(let e=0;e<t.length;e++)if(!l.test(t[e]))throw new k("JWT not in base64url format");return{header:JSON.parse(j(t[0])),payload:JSON.parse(j(t[1])),signature:I(t[2]),raw:{header:t[0],payload:t[1]}}}async function z(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function H(e){return("0"+e.toString(16)).substr(-2)}async function K(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 G(e){return"undefined"!=typeof crypto&&void 0!==crypto.subtle&&"undefined"!=typeof TextEncoder?btoa(await K(e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""):(console.warn("WebCrypto API is not supported. Code
1challenge method will default to use plain instead of sha256."),e)}async function J(e,t,r=!1){let n=function(){let e=new Uint32Array(56);if("undefined"==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,H).join("")}(),i=n;r&&(i+="/PASSWORD_RECOVERY"),await B(e,`${t}-code-verifier`,i);let s=await G(n),o=n===s?"plain":"s256";return[s,o]}q.promiseConstructor=Promise;let Y=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i,X=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Q(e){if(!X.test(e))throw Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Z(){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 ee(e){return JSON.parse(JSON.stringify(e))}let et=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),er=[502,503,504];async function en(e){var t;let r,n;if(!U(e))throw new _(et(e),0);if(er.includes(e.status))throw new _(et(e),e.status);try{r=await e.json()}catch(e){throw new f(et(e),e)}let i=function(e){let t=e.headers.get(o);if(!t||!t.match(Y))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch(e){return null}}(e);if(i&&i.getTime()>=a["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 T(et(r),e.status,(null===(t=r.weak_password)||void 0===t?void 0:t.reasons)||[]);if("session_not_found"===n)throw new m}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 T(et(r),e.status,r.weak_password.reasons);throw new h(et(r),e.status||500,n)}let ei=(e,t,r,n)=>{let i={method:e,headers:(null==t?void 0:t.headers)||{}};return"GET"===e?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},null==t?void 0:t.headers),i.body=JSON.stringify(n),Object.assign(Object.assign({},i),r))};async function es(e,t,r,n){var i;let s=Object.assign({},null==n?void 0:n.headers);s[o]||(s[o]=a["2024-01-01"].name),(null==n?void 0:n.jwt)&&(s.Authorization=`Bearer ${n.jwt}`);let l=null!==(i=null==n?void 0:n.query)&&void 0!==i?i:{};(null==n?void 0:n.redirectTo)&&(l.redirect_to=n.redirectTo);let u=Object.keys(l).length?"?"+new URLSearchParams(l).toString():"",c=await eo(e,t,r+u,{headers:s,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(c):{data:Object.assign({},c),error:null}}async function eo(e,t,r,n,i,s){let o;let a=ei(t,n,i,s);try{o=await e(r,Object.assign({},a))}catch(e){throw console.error(e),new _(et(e),0)}if(o.ok||await en(o),null==n?void 0:n.noResolveJson)return o;try{return await o.json()}catch(e){await en(e)}}function ea(e){var t,r;let n=null;return e.access_token&&e.refresh_token&&e.expires_in&&(n=Object.assign({},e),!e.expires_at)&&(n.expires_at=(r=e.expires_in,Math.round(Date.now()/1e3)+r)),{data:{session:n,user:null!==(t=e.user)&&void 0!==t?t:e},error:null}}function el(e){let t=ea(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)=>
1e&&"string"==typeof t,!0)&&(t.data.weak_password=e.weak_password),t}function eu(e){var t;return{data:{user:null!==(t=e.user)&&void 0!==t?t:e},error:null}}function ec(e){return{data:e,error:null}}function eh(e){let{action_link:t,email_otp:r,hashed_token:i,redirect_to:s,verification_type:o}=e;return{data:{properties:{action_link:t,email_otp:r,hashed_token:i,redirect_to:s,verification_type:o},user:Object.assign({},(0,n.__rest)(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]))},error:null}}function ed(e){return e}let ef=["global","local","others"];class ep{constructor({url:e="",headers:t={},fetch:r}){this.url=e,this.headers=t,this.fetch=$(r),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)}}async signOut(e,t=ef[0]){if(0>ef.indexOf(t))throw Error(`@supabase/auth-js: Parameter scope must be one of ${ef.join(", ")}`);try{return await es(this.fetch,"POST",`${this.url}/logout?scope=${t}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(e){if(c(e))return{data:null,error:e};throw e}}async inviteUserByEmail(e,t={}){try{return await es(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:t.data},headers:this.headers,redirectTo:t.redirectTo,xform:eu})}catch(e){if(c(e))return{data:{user:null},error:e};throw e}}async generateLink(e){try{let{options:t}=e,r=(0,n.__rest)(e,["options"]),i=Object.assign(Object.assign({},r),t);return"newEmail"in r&&(i.new_email=null==r?void 0:r.newEmail,delete i.newEmail),await es(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:eh,redirectTo:null==t?void 0:t.redirectTo})}catch(e){if(c(e))return{data:{properties:null,user:null},error:e};throw e}}async createUser(e){try{return await es(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:eu})}catch(e){if(c(e))return{data:{user:null},error:e};throw e}}async listUsers(e){var t,r,n,i,s,o,a;try{let l={nextPage:null,lastPage:0,total:0},u=await es(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?void 0:t.toString())&&void 0!==r?r:"",per_page:null!==(i=null===(n=null==e?void 0:e.perPage)||void 0===n?void 0:n.toString())&&void 0!==i?i:""},xform:ed});if(u.error)throw u.error;let c=await u.json(),h=null!==(s=u.headers.get("x-total-count"))&&void 0!==s?s:0,d=null!==(a=null===(o=u.headers.get("link"))||void 0===o?void 0:o.split(","))&&void 0!==a?a:[];return d.length>0&&(d.forEach(e=>{let t=parseInt(e.split(";")[0].split("=")[1].substring(0,1)),r=JSON.parse(e.split(";")[1].split("=")[1]);l[`${r}Page`]=t}),l.total=parseInt(h)),{data:Object.assign(Object.assign({},c),l),error:null}}catch(e){if(c(e))return{data:{users:[]},error:e};throw e}}async getUserById(e){Q(e);try{return await es(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:eu})}catch(e){if(c(e))return{data:{user:null},error:e};throw e}}async updateUserById(e,t){Q(e);try{return await es(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:eu})}catch(e){if(c(e))return{data:{user:null},error:e};throw e}}async deleteUser(e,t=!1){Q(e);try{return await es(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:eu})}catch(e){if(c(e))return{data:{user:null},error:e};throw e}}async _listFactors(e){Q(e.userId);try{let{data:t,error:r}=await es(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(c(e))return{data:null,error:e};throw e}}async _deleteFactor(e){Q(e.userId),Q(e.id);try{return{data:await es(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(e){if(c(e))return{data:null,error:e};throw e}}async _listOAuthClients(e){var t,r,n,i,s,o,a;try{let l={nextPage:null,lastPage:0,total:0},u=await es(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?void 0:t.toString())&&void 0!==r?r:"",per_page:null!==(i=null===(n=null==e?void 0:e.perPage)||void 0===n?void 0:n.toString())&&void 0!==i?i:""},xform:ed});if(u.error)throw u.error;let c=await u.json(),h=null!==(s=u.headers.get("x-total-count"))&&void 0!==s?s:0,d=null!==(a=null===(o=u.headers.get("link"))||void 0===o?void 0:o.split(","))&&void 0!==a?a:[];return d.length>
10&&(d.forEach(e=>{let t=parseInt(e.split(";")[0].split("=")[1].substring(0,1)),r=JSON.parse(e.split(";")[1].split("=")[1]);l[`${r}Page`]=t}),l.total=parseInt(h)),{data:Object.assign(Object.assign({},c),l),error:null}}catch(e){if(c(e))return{data:{clients:[]},error:e};throw e}}async _createOAuthClient(e){try{return await es(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(c(e))return{data:null,error:e};throw e}}async _getOAuthClient(e){try{return await es(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(c(e))return{data:null,error:e};throw e}}async _updateOAuthClient(e,t){try{return await es(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${e}`,{body:t,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(c(e))return{data:null,error:e};throw e}}async _deleteOAuthClient(e){try{return await es(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(c(e))return{data:null,error:e};throw e}}async _regenerateOAuthClientSecret(e){try{return await es(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(c(e))return{data:null,error:e};throw e}}}function em(e={}){return{getItem:t=>e[t]||null,setItem:(t,r)=>{e[t]=r},removeItem:t=>{delete e[t]}}}let eg={debug:!!(globalThis&&L()&&globalThis.localStorage&&"true"===globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug"))};class ey extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class ev extends ey{}class eb extends ey{}async function ew(e,t,r){eg.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);let n=new globalThis.AbortController;return t>0&&setTimeout(()=>{n.abort(),eg.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,0===t?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async n=>{if(n){eg.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,n.name);try{return await r()}finally{eg.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,n.name)}}else{if(0===t)throw eg.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new ev(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(eg.debug)try{let e=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(e,null," "))}catch(e){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",e)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await r()}}))}let ex={};async function e_(e,t,r){var n;let i=null!==(n=ex[e])&&void 0!==n?n:Promise.resolve(),s=Promise.race([i.catch(()=>null),t>=0?new Promise((r,n)=>{setTimeout(()=>{n(new eb(`Acquring process lock with name "${e}" timed out`))},t)}):null].filter(e=>e)).catch(e=>{if(e&&e.isAcquireTimeout)throw e;return null}).then(async()=>await r());return ex[e]=s.catch(async e=>{if(e&&e.isAcquireTimeout)return await i,null;throw e}),await s}function eE(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}class eT extends Error{constructor({message:e,code:t,cause:r,name:n}){var i;super(e,{cause:r}),this.__isWebAuthnError=!0,this.name=null!==(i=null!=n?n:r instanceof Error?r.name:void 0)&&void 0!==i?i:"Unknown Error",this.code=t}}class eS extends eT{constructor(e,t){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t,message:e}),this.name="WebAuthnUnknownError",this.originalError=t}}class ek{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 eA=new ek;function eP(e){return"localhost"===e||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function eO(){var e,t;return!!(N()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&"function"==typeof(null===(e=null==navigator?void 0:navigator.credentials)||void 0===e?void 0:e.create)&&"function"==typeof(null===(t=null==navigator?void 0:navigator.credentials)||void 0===t?void 0:t.get))}async function eR(e){try{let t=await navigator.credentials.create(e);if(!t)return{data:null,error:new eS("Empty credential response",t)};if(!(t instanceof PublicKeyCredential))return{data:null,error:new eS("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,i;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 eT({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?void 0:r.requireResidentKey)===!0)return new eT({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if("conditional"===t.mediation&&(null===(n=s.authenticatorSelection)||void 0===n?void 0:n.userVerification)==="required")return new eT({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if((null===(i=s.authenticatorSelection)||void 0===i?void 0:i.userVerification)==="required")return new eT({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 eT({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});else if("NotAllowedError"===e.name)return new eT({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});else if("NotSupportedError"===e.name)return new eT(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(!eP(t))return new eT({message:`${window.location.hostname}
1 is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e});if(s.rp.id!==t)return new eT({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 eT({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 eT({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e});return new eT({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}({error:t,options:e})}}}async function eC(e){try{let t=await navigator.credentials.get(e);if(!t)return{data:null,error:new eS("Empty credential response",t)};if(!(t instanceof PublicKeyCredential))return{data:null,error:new eS("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 eT({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if("NotAllowedError"===e.name)return new eT({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});else if("SecurityError"===e.name){let t=window.location.hostname;if(!eP(t))return new eT({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e});if(r.rpId!==t)return new eT({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 eT({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 eT({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}({error:t,options:e})}}}let ej={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},eI={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function eD(...e){let t=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),r=e=>e instanceof ArrayBuffer||ArrayBuffer.isView(e),n={};for(let i of e)if(i)for(let e in i){let s=i[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]=eD(r,s):n[e]=eD(s)}else n[e]=s}}return n}class eN{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},i){try{var s,o,a,l;let{data:u,error:c}=await this.client.mfa.challenge({factorId:e,webauthn:t});if(!u)return{data:null,error:c};let h=null!=n?n:eA.createNewAbortSignal();if("create"===u.webauthn.type){let{user:e}=u.webauthn.credential_options.publicKey;e.name||(e.name=`${e.id}:${r}`),e.displayName||(e.displayName=e.name)}switch(u.webauthn.type){case"create":{let t=(s=u.webauthn.credential_options.publicKey,o=null==i?void 0:i.create,eD(ej,s,o||{})),{data:r,error:n}=await eR({publicKey:t,signal:h});if(r)return{data:{factorId:e,challengeId:u.id,webauthn:{type:u.webauthn.type,credential_response:r}},error:null};return{data:null,error:n}}case"request":{let t=(a=u.webauthn.credential_options.publicKey,l=null==i?void 0:i.request,eD(eI,a,l||{})),{data:r,error:n}=await eC(Object.assign(Object.assign({},u.webauthn.credential_options),{publicKey:t,signal:h}));if(r)return{data:{factorId:e,challengeId:u.id,webauthn:{type:u.webauthn.type,credential_response:r}},error:null};return{data:null,error:n}}}}catch(e){if(c(e))return{data:null,error:e};return{data:null,error:new f("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="undefined"!=typeof window?window.location.hostname:void 0,rpOrigins:r="undefined"!=typeof window?[window.location.origin]:void 0,signal:n}={}},i){if(!t)return{data:null,error:new u("rpId is required for WebAuthn authentication")};try{if(!eO())return{data:null,error:new f("Browser does not support WebAuthn",null)};let{data:s,error:o}=await this.challenge({factorId:e,webauthn:{rpId:t,rpOrigins:r},signal:n},{request:i});if(!s)return{data:null,error:o};let{webauthn:a}=s;return this._verify({factorId:e,challengeId:s.challengeId,webauthn:{type:a.type,rpId:t,rpOrigins:r,credential_response:a.credential_response}})}catch(e){if(c(e))return{data:null,error:e};return{data:null,error:new f("Unexpected error in authenticate",e)}}}async _register({friendlyName:e,webauthn:{rpId:t="undefined"!=typeof window?window.location.hostname:void 0,rpOrigins:r="undefined"!=typeof window?[window.location.origin]:void 0,signal:n}={}},i){if(!t)return{data:null,error:new u("rpId is required for WebAuthn registration")};try{if(!eO())return{data:null,error:new f("Browser does not support WebAuthn",null)};let{data:s,error:o}=await this._enroll({friendlyName:e});if(!s)return await this.client.mfa.listFactors().then(t=>{var r;return null===(r=t.data)||void 0===r?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:a,error:l}=await this._challenge({factorId:s.id,friendlyName:s.friendly_name,webauthn:{rpId:t,rpOrigins:r},signal:n},{create:i});if(!a)return{data:null,error:l};return this._verify({factorId:s.id,challengeId:a.challengeId,webauthn:{rpId:t,rpOrigins:r,type:a.webauthn.type,credential_response:a.webauthn.credential_response}})}catch(e){if(c(e))return{data:null,error:e};return{data:null,error:new f("Unexpected error in register",e)}}}}!function(){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){"undefined"!=typeof self&&(self.globalThis=self)}}();let eM={url:"http://localhost:9999",storageKey:"supabase.auth.token",autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:s,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1};async function eL(e,t,r){return await r()}let e$={};class eU{get jwks(){var e,t;return null!==(t=null===(e=e$[this.storageKey])||void 0===e?void 0:e.jwks)&&void 0!==t?t:{keys:[]}}set jwks(e){e$[this.storageKey]=Object.assign(Object.assign({},e$[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,t;return null!==(t=null===(e=e$[this.storageKey])||void 0===e?void 0:e.cachedAt)&&void 0!==t?t:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){e$[this.storageKey]=Object.assign(Object.assign({},e$[this.storageKey]),{cachedAt:e})}constructor(e){var t,r,n;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;let i=Object.assign(Object.assign({},eM),e);if(this.storageKey=i.storageKey,this.instanceID=null!==(t=eU.nextInstanceID[this.storageKey])&&void 0!==t?t:0,eU.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!i.debug,"function"==typeof i.debug&&(this.logger=i.debug),this.instanceID>0&&N()){let e=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(e),this.logDebugMessages&&console.trace(e)}if(this.persistSession=i.persistSession,this.autoRefreshToken=i.autoRefreshToken,this.admin=new ep({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=$(i.fetch),this.lock=i.lock||eL,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,this.throwOnError=i.throwOnError,i.lock?this.lock=i.lock:this.persistSession&&N()&&(null===(r=null==globalThis?void 0:globalThis.navigator)||void 0===r?void 0:r.locks)?this.lock=ew:this.lock=eL,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new eN(this)}
1,this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(i.storage?this.storage=i.storage:L()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=em(this.memoryStorage)),i.userStorage&&(this.userStorage=i.userStorage)):(this.memoryStorage={},this.storage=em(this.memoryStorage)),N()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(e){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",e)}null===(n=this.broadcastChannel)||void 0===n||n.addEventListener("message",async e=>{this._debug("received broadcast notification from other tab or client",e),await this._notifyAllSubscribers(e.data.event,e.data.session,!1)})}this.initialize()}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${i}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){return this.initializePromise||(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))()),await this.initializePromise}async _initialize(){var e;try{let t={},r="none";if(N()&&(t=function(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}(window.location.href),this._isImplicitGrantCallback(t)?r="implicit":await this._isPKCECallback(t)&&(r="pkce")),N()&&this.detectSessionInUrl&&"none"!==r){let{data:n,error:i}=await this._getSessionFromURL(t,r);if(i){if(this._debug("#_initialize()","error detecting session from URL",i),w(i)){let t=null===(e=i.details)||void 0===e?void 0:e.code;if("identity_already_exists"===t||"identity_not_found"===t||"single_identity_not_deletable"===t)return{error:i}}return await this._removeSession(),{error:i}}let{session:s,redirectType:o}=n;return this._debug("#_initialize()","detected session in URL",s,"redirect type",o),await this._saveSession(s),setTimeout(async()=>{"recovery"===o?await this._notifyAllSubscribers("PASSWORD_RECOVERY",s):await this._notifyAllSubscribers("SIGNED_IN",s)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(e){if(c(e))return this._returnResult({error:e});return this._returnResult({error:new f("Unexpected error during initialization",e)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var t,r,n;try{let{data:i,error:s}=await es(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:null!==(r=null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.data)&&void 0!==r?r:{},gotrue_meta_security:{captcha_token:null===(n=null==e?void 0:e.options)||void 0===n?void 0:n.captchaToken}},xform:ea});if(s||!i)return this._returnResult({data:{user:null,session:null},error:s});let o=i.session,a=i.user;return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",o)),this._returnResult({data:{user:a,session:o},error:null})}catch(e){if(c(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signUp(e){var t,r,n;try{let i;if("email"in e){let{email:r,password:n,options:s}=e,o=null,a=null;"pkce"===this.flowType&&([o,a]=await J(this.storage,this.storageKey)),i=await es(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:null==s?void 0:s.emailRedirectTo,body:{email:r,password:n,data:null!==(t=null==s?void 0:s.data)&&void 0!==t?t:{},gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken},code_challenge:o,code_challenge_method:a},xform:ea})}else if("phone"in e){let{phone:t,password:s,options:o}=e;i=await es(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:t,password:s,data:null!==(r=null==o?void 0:o.data)&&void 0!==r?r:{},channel:null!==(n=null==o?void 0:o.channel)&&void 0!==n?n:"sms",gotrue_meta_security:{captcha_token:null==o?void 0:o.captchaToken}},xform:ea})}else throw new v("You must provide either an email or phone number and a password");let{data:s,error:o}=i;if(o||!s)return await V(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:o});let a=s.session,l=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",a)),this._returnResult({data:{user:l,session:a},error:null})}catch(e){if(await V(this.storage,`${this.storageKey}-code-verifier`),c(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithPassword(e){try{let t;if("email"in e){let{email:r,password:n,options:i}=e;t=await es(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:r,password:n,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}},xform:el})}else if("phone"in e){let{phone:r,password:n,options:i}=e;t=await es(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:r,password:n,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}},xform:el})}else throw new v("You must provide either an email or phone number and a password");let{data:r,error:n}=t;if(n)return this._returnResult({data:{user:null,session:null},error:n});if(!r||!r.session||!r.user){let e=new y;return this._returnResult({data:{user:null,session:null},error:e})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:n})}catch(e){if(c(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithOAuth(e){var t,r,n,i;return await this._handleProviderSignIn(e.provider,{redirectTo:null===(t=e.options)||void 0===t?void 0:t.redirectTo,scopes:null===(r=e.options)||void 0===r?void 0:r.scopes,queryParams:null===(n=e.options)||void 0===n?void 0:n.queryParams,skipBrowserRedirect:null===(i=e.options)||void 0===i?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){let{chain:t}=e;switch(t){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw Error(`@supabase/auth-js: Unsupported chain "${t}"`)}}async signInWithEthereum(e){var t,r,n,i,s,o,a,l,u,h,d,f;let p,m;if("message"in e)p=e.message,m=e.signature;else{let c;let{chain:h,wallet:d,statement:g,options:y}=e;
1if(N()){if("object"==typeof d)c=d;else{let e=window;if("ethereum"in e&&"object"==typeof e.ethereum&&"request"in e.ethereum&&"function"==typeof e.ethereum.request)c=e.ethereum;else throw Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}}else{if("object"!=typeof d||!(null==y?void 0:y.url))throw Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");c=d}let v=new URL(null!==(t=null==y?void 0:y.url)&&void 0!==t?t:window.location.href),b=await c.request({method:"eth_requestAccounts"}).then(e=>e).catch(()=>{throw Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!b||0===b.length)throw Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");let w=eE(b[0]),x=null===(r=null==y?void 0:y.signInWithEthereum)||void 0===r?void 0:r.chainId;x||(x=parseInt(await c.request({method:"eth_chainId"}),16)),p=function(e){var t;let{chainId:r,domain:n,expirationTime:i,issuedAt:s=new Date,nonce:o,notBefore:a,requestId:l,resources:u,scheme:c,uri:h,version:d}=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(!n)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"!==d)throw Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${d}`);if(null===(t=e.statement)||void 0===t?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 f=eE(e.address),p=c?`${c}://${n}`:n,m=e.statement?`${e.statement} 2`:"",g=`${p} wants you to sign in with your Ethereum account: 3${f} 4 5${m}`,y=`URI: ${h} 6Version: ${d} 7Chain ID: ${r}${o?` 8Nonce: ${o}`:""} 9Issued At: ${s.toISOString()}`;if(i&&(y+=` 10Expiration Time: ${i.toISOString()}`),a&&(y+=` 11Not Before: ${a.toISOString()}`),l&&(y+=` 12Request ID: ${l}`),u){let e="\nResources:";for(let t of u){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}`}y+=e}return`${g} 14${y}`}({domain:v.host,address:w,statement:g,uri:v.href,version:"1",chainId:x,nonce:null===(n=null==y?void 0:y.signInWithEthereum)||void 0===n?void 0:n.nonce,issuedAt:null!==(s=null===(i=null==y?void 0:y.signInWithEthereum)||void 0===i?void 0:i.issuedAt)&&void 0!==s?s:new Date,expirationTime:null===(o=null==y?void 0:y.signInWithEthereum)||void 0===o?void 0:o.expirationTime,notBefore:null===(a=null==y?void 0:y.signInWithEthereum)||void 0===a?void 0:a.notBefore,requestId:null===(l=null==y?void 0:y.signInWithEthereum)||void 0===l?void 0:l.requestId,resources:null===(u=null==y?void 0:y.signInWithEthereum)||void 0===u?void 0:u.resources}),m=await c.request({method:"personal_sign",params:[(f=p,"0x"+Array.from(new TextEncoder().encode(f),e=>e.toString(16).padStart(2,"0")).join("")),w]})}try{let{data:t,error:r}=await es(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:p,signature:m},(null===(h=e.options)||void 0===h?void 0:h.captchaToken)?{gotrue_meta_security:{captcha_token:null===(d=e.options)||void 0===d?void 0:d.captchaToken}}:null),xform:ea});if(r)throw r;if(!t||!t.session||!t.user){let e=new y;return this._returnResult({data:{user:null,session:null},error:e})}return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers("SIGNED_IN",t.session)),this._returnResult({data:Object.assign({},t),error:r})}catch(e){if(c(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithSolana(e){var t,r,n,i,s,o,a,l,u,h,d,f;let p,m;if("message"in e)p=e.message,m=e.signature;else{let c;let{chain:d,wallet:f,statement:g,options:y}=e;
14if(N()){if("object"==typeof f)c=f;else{let e=window;if("solana"in e&&"object"==typeof e.solana&&("signIn"in e.solana&&"function"==typeof e.solana.signIn||"signMessage"in e.solana&&"function"==typeof e.solana.signMessage))c=e.solana;else throw Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}}else{if("object"!=typeof f||!(null==y?void 0:y.url))throw Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");c=f}let v=new URL(null!==(t=null==y?void 0:y.url)&&void 0!==t?t:window.location.href);if("signIn"in c&&c.signIn){let e;let t=await c.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},null==y?void 0:y.signInWithSolana),{version:"1",domain:v.host,uri:v.href}),g?{statement:g}:null));if(Array.isArray(t)&&t[0]&&"object"==typeof t[0])e=t[0];else if(t&&"object"==typeof t&&"signedMessage"in t&&"signature"in t)e=t;else throw Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in e&&"signature"in e&&("string"==typeof e.signedMessage||e.signedMessage instanceof Uint8Array)&&e.signature instanceof Uint8Array)p="string"==typeof e.signedMessage?e.signedMessage:new TextDecoder().decode(e.signedMessage),m=e.signature;else throw Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in c)||"function"!=typeof c.signMessage||!("publicKey"in c)||"object"!=typeof c||!c.publicKey||!("toBase58"in c.publicKey)||"function"!=typeof c.publicKey.toBase58)throw Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");p=[`${v.host} wants you to sign in with your Solana account:`,c.publicKey.toBase58(),...g?["",g,""]:[""],"Version: 1",`URI: ${v.href}`,`Issued At: ${null!==(n=null===(r=null==y?void 0:y.signInWithSolana)||void 0===r?void 0:r.issuedAt)&&void 0!==n?n:new Date().toISOString()}`,...(null===(i=null==y?void 0:y.signInWithSolana)||void 0===i?void 0:i.notBefore)?[`Not Before: ${y.signInWithSolana.notBefore}`]:[],...(null===(s=null==y?void 0:y.signInWithSolana)||void 0===s?void 0:s.expirationTime)?[`Expiration Time: ${y.signInWithSolana.expirationTime}`]:[],...(null===(o=null==y?void 0:y.signInWithSolana)||void 0===o?void 0:o.chainId)?[`Chain ID: ${y.signInWithSolana.chainId}`]:[],...(null===(a=null==y?void 0:y.signInWithSolana)||void 0===a?void 0:a.nonce)?[`Nonce: ${y.signInWithSolana.nonce}`]:[],...(null===(l=null==y?void 0:y.signInWithSolana)||void 0===l?void 0:l.requestId)?[`Request ID: ${y.signInWithSolana.requestId}`]:[],...(null===(h=null===(u=null==y?void 0:y.signInWithSolana)||void 0===u?void 0:u.resources)||void 0===h?void 0:h.length)?["Resources",...y.signInWithSolana.resources.map(e=>`- ${e}`)]:[]].join("\n");let e=await c.signMessage(new TextEncoder().encode(p),"utf8");if(!e||!(e instanceof Uint8Array))throw Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");m=e}}try{let{data:t,error:r}=await es(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:p,signature:D(m)},(null===(d=e.options)||void 0===d?void 0:d.captchaToken)?{gotrue_meta_security:{captcha_token:null===(f=e.options)||void 0===f?void 0:f.captchaToken}}:null),xform:ea});if(r)throw r;if(!t||!t.session||!t.user){let e=new y;return this._returnResult({data:{user:null,session:null},error:e})}return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers("SIGNED_IN",t.session)),this._returnResult({data:Object.assign({},t),error:r})}catch(e){if(c(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async _exchangeCodeForSession(e){let t=await F(this.storage,`${this.storageKey}-code-verifier`),[r,n]=(null!=t?t:"").split("/");try{let{data:t,error:i}=await es(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:r},xform:ea});if(await V(this.storage,`${this.storageKey}-code-verifier`),i)throw i;if(!t||!t.session||!t.user){let e=new y;return this._returnResult({data:{user:null,session:null,redirectType:null},error:e})}return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers("SIGNED_IN",t.session)),this._returnResult({data:Object.assign(Object.assign({},t),{redirectType:null!=n?n:null}),error:i})}catch(e){if(await V(this.storage,`${this.storageKey}-code-verifier`),c(e))return this._returnResult({data:{user:null,session:null,redirectType:null},error:e});throw e}}async signInWithIdToken(e){try{let{options:t,provider:r,token:n,access_token:i,nonce:s}=e,{data:o,error:a}=await es(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:n,access_token:i,nonce:s,gotrue_meta_security:{captcha_token:null==t?void 0:t.captchaToken}},xform:ea});if(a)return this._returnResult({data:{user:null,session:null},error:a});if(!o||!o.session||!o.user){let e=new y;return this._returnResult({data:{user:null,session:null},error:e})}return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",o.session)),this._returnResult({data:o,error:a})}catch(e){if(c(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithOtp(e){var t,r,n,i,s;try{if("email"in e){let{email:n,options:i}=e,s=null,o=null;"pkce"===this.flowType&&([s,o]=await J(this.storage,this.storageKey));let{error:a}=await es(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:n,data:null!==(t=null==i?void 0:i.data)&&void 0!==t?t:{}
14,create_user:null===(r=null==i?void 0:i.shouldCreateUser)||void 0===r||r,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken},code_challenge:s,code_challenge_method:o},redirectTo:null==i?void 0:i.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:a})}if("phone"in e){let{phone:t,options:r}=e,{data:o,error:a}=await es(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:t,data:null!==(n=null==r?void 0:r.data)&&void 0!==n?n:{},create_user:null===(i=null==r?void 0:r.shouldCreateUser)||void 0===i||i,gotrue_meta_security:{captcha_token:null==r?void 0:r.captchaToken},channel:null!==(s=null==r?void 0:r.channel)&&void 0!==s?s:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:null==o?void 0:o.message_id},error:a})}throw new v("You must provide either an email or phone number.")}catch(e){if(await V(this.storage,`${this.storageKey}-code-verifier`),c(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async verifyOtp(e){var t,r;try{let n,i;"options"in e&&(n=null===(t=e.options)||void 0===t?void 0:t.redirectTo,i=null===(r=e.options)||void 0===r?void 0:r.captchaToken);let{data:s,error:o}=await es(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:i}}),redirectTo:n,xform:ea});if(o)throw o;if(!s)throw Error("An error occurred on token verification.");let a=s.session,l=s.user;return(null==a?void 0:a.access_token)&&(await this._saveSession(a),await this._notifyAllSubscribers("recovery"==e.type?"PASSWORD_RECOVERY":"SIGNED_IN",a)),this._returnResult({data:{user:l,session:a},error:null})}catch(e){if(c(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithSSO(e){var t,r,n,i,s;try{let o=null,a=null;"pkce"===this.flowType&&([o,a]=await J(this.storage,this.storageKey));let l=await es(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:null!==(r=null===(t=e.options)||void 0===t?void 0:t.redirectTo)&&void 0!==r?r:void 0}),(null===(n=null==e?void 0:e.options)||void 0===n?void 0:n.captchaToken)?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:o,code_challenge_method:a}),headers:this.headers,xform:ec});return(null===(i=l.data)||void 0===i?void 0:i.url)&&N()&&!(null===(s=e.options)||void 0===s?void 0:s.skipBrowserRedirect)&&window.location.assign(l.data.url),this._returnResult(l)}catch(e){if(await V(this.storage,`${this.storageKey}-code-verifier`),c(e))return this._returnResult({data:null,error:e});throw e}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{let{data:{session:t},error:r}=e;if(r)throw r;if(!t)throw new m;let{error:n}=await es(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return this._returnResult({data:{user:null,session:null},error:n})})}catch(e){if(c(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{let t=`${this.url}/resend`;if("email"in e){let{email:r,type:n,options:i}=e,{error:s}=await es(this.fetch,"POST",t,{headers:this.headers,body:{email:r,type:n,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}},redirectTo:null==i?void 0:i.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:s})}if("phone"in e){let{phone:r,type:n,options:i}=e,{data:s,error:o}=await es(this.fetch,"POST",t,{headers:this.headers,body:{phone:r,type:n,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:null==s?void 0:s.message_id},error:o})}throw new v("You must provide either an email or phone number and a type")}catch(e){if(c(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async e=>e))}async _acquireLock(e,t){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){let e=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),r=(async()=>(await e,await t()))();return this.pendingInLock.push((async()=>{try{await r}catch(e){}})()),r}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;let e=t();for(this.pendingInLock.push((async()=>{try{await e}catch(e){}})()),await e;this.pendingInLock.length;){let e=[...this.pendingInLock];await Promise.all(e),this.pendingInLock.splice(0,e.length)}return await e}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{let t=await this.__loadSession();return await e(t)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",Error().stack);try{let t=null,r=await F(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),null!==r&&(this._isValidSession(r)?t=r:(this._debug("#getSession()","session from storage is not val
14id"),await this._removeSession())),!t)return{data:{session:null},error:null};let n=!!t.expires_at&&1e3*t.expires_at-Date.now()<9e4;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",t.expires_at),!n){if(this.userStorage){let e=await F(this.userStorage,this.storageKey+"-user");(null==e?void 0:e.user)?t.user=e.user:t.user=Z()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){var e;let r={value:this.suppressGetSessionWarning};t.user=(e=t.user,new Proxy(e,{get:(e,t,n)=>{if("__isInsecureUserWarningProxy"===t)return!0;if("symbol"==typeof t){let r=t.toString();if("Symbol(Symbol.toPrimitive)"===r||"Symbol(Symbol.toStringTag)"===r||"Symbol(util.inspect.custom)"===r||"Symbol(nodejs.util.inspect.custom)"===r)return Reflect.get(e,t,n)}return r.value||"string"!=typeof t||(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."),r.value=!0),Reflect.get(e,t,n)}})),r.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}let{data:i,error:s}=await this._callRefreshToken(t.refresh_token);if(s)return this._returnResult({data:{session:null},error:s});return this._returnResult({data:{session:i},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;let t=await this._acquireLock(-1,async()=>await this._getUser());return t.data.user&&(this.suppressGetSessionWarning=!0),t}async _getUser(e){try{if(e)return await es(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:eu});return await this._useSession(async e=>{var t,r,n;let{data:i,error:s}=e;if(s)throw s;return(null===(t=i.session)||void 0===t?void 0:t.access_token)||this.hasCustomAuthorizationHeader?await es(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:null!==(n=null===(r=i.session)||void 0===r?void 0:r.access_token)&&void 0!==n?n:void 0,xform:eu}):{data:{user:null},error:new m}})}catch(e){if(c(e))return g(e)&&(await this._removeSession(),await V(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:e});throw e}}async updateUser(e,t={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(e,t))}async _updateUser(e,t={}){try{return await this._useSession(async r=>{let{data:n,error:i}=r;if(i)throw i;if(!n.session)throw new m;let s=n.session,o=null,a=null;"pkce"===this.flowType&&null!=e.email&&([o,a]=await J(this.storage,this.storageKey));let{data:l,error:u}=await es(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:null==t?void 0:t.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:o,code_challenge_method:a}),jwt:s.access_token,xform:eu});if(u)throw u;return s.user=l.user,await this._saveSession(s),await this._notifyAllSubscribers("USER_UPDATED",s),this._returnResult({data:{user:s.user},error:null})})}catch(e){if(await V(this.storage,`${this.storageKey}-code-verifier`),c(e))return this._returnResult({data:{user:null},error:e});throw e}}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new m;let t=Date.now()/1e3,r=t,n=!0,i=null,{payload:s}=W(e.access_token);if(s.exp&&(n=(r=s.exp)<=t),n){let{data:t,error:r}=await this._callRefreshToken(e.refresh_token);if(r)return this._returnResult({data:{user:null,session:null},error:r});if(!t)return{data:{user:null,session:null},error:null};i=t}else{let{data:n,error:s}=await this._getUser(e.access_token);if(s)throw s;i={access_token:e.access_token,refresh_token:e.refresh_token,user:n.user,token_type:"bearer",expires_in:r-t,expires_at:r},await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return this._returnResult({data:{user:i.user,session:i},error:null})}catch(e){if(c(e))return this._returnResult({data:{session:null,user:null},error:e});throw e}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async t=>{var r;if(!e){let{data:n,error:i}=t;if(i)throw i;e=null!==(r=n.session)&&void 0!==r?r:void 0}if(!(null==e?void 0:e.refresh_token))throw new m;let{data:n,error:i}=await this._callRefreshToken(e.refresh_token);return i?this._returnResult({data:{user:null,session:null},error:i}):n?this._returnResult({data:{user:n.user,session:n},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(e){if(c(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async _getSessionFromURL(e,t){try{if(!N())throw new b("No browser detected.");
14if(e.error||e.error_description||e.error_code)throw new b(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(t){case"implicit":if("pkce"===this.flowType)throw new x("Not a valid PKCE flow url.");break;case"pkce":if("implicit"===this.flowType)throw new b("Not a valid implicit grant flow url.")}if("pkce"===t){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new x("No code detected.");let{data:t,error:r}=await this._exchangeCodeForSession(e.code);if(r)throw r;let n=new URL(window.location.href);return n.searchParams.delete("code"),window.history.replaceState(window.history.state,"",n.toString()),{data:{session:t.session,redirectType:null},error:null}}let{provider_token:r,provider_refresh_token:n,access_token:i,refresh_token:s,expires_in:o,expires_at:a,token_type:l}=e;if(!i||!o||!s||!l)throw new b("No session defined in URL");let u=Math.round(Date.now()/1e3),c=parseInt(o),h=u+c;a&&(h=parseInt(a));let d=h-u;1e3*d<=3e4&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${d}s, should have been closer to ${c}s`);let f=h-c;u-f>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",f,h,u):u-f<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",f,h,u);let{data:p,error:m}=await this._getUser(i);if(m)throw m;let g={provider_token:r,provider_refresh_token:n,access_token:i,expires_in:c,expires_at:h,refresh_token:s,token_type:l,user:p.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:g,redirectType:e.type},error:null})}catch(e){if(c(e))return this._returnResult({data:{session:null,redirectType:null},error:e});throw e}}_isImplicitGrantCallback(e){return!!(e.access_token||e.error_description)}async _isPKCECallback(e){let t=await F(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&t)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async t=>{var r;let{data:n,error:i}=t;if(i)return this._returnResult({error:i});let s=null===(r=n.session)||void 0===r?void 0:r.access_token;if(s){let{error:t}=await this.admin.signOut(s,e);if(t&&!(d(t)&&(404===t.status||401===t.status||403===t.status)))return this._returnResult({error:t})}return"others"!==e&&(await this._removeSession(),await V(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){let t=Symbol("auth-callback"),r={id:t,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",t),this.stateChangeEmitters.delete(t)}};return this._debug("#onAuthStateChange()","registered callback with id",t),this.stateChangeEmitters.set(t,r),(async()=>{await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(t)})})(),{data:{subscription:r}}}async _emitInitialSession(e){return await this._useSession(async t=>{var r,n;try{let{data:{session:n},error:i}=t;if(i)throw i;await (null===(r=this.stateChangeEmitters.get(e))||void 0===r?void 0:r.callback("INITIAL_SESSION",n)),this._debug("INITIAL_SESSION","callback id",e,"session",n)}catch(t){await (null===(n=this.stateChangeEmitters.get(e))||void 0===n?void 0:n.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",t),console.error(t)}})}async resetPasswordForEmail(e,t={}){let r=null,n=null;"pkce"===this.flowType&&([r,n]=await J(this.storage,this.storageKey,!0));try{return await es(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:r,code_challenge_method:n,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:t.redirectTo})}catch(e){if(await V(this.storage,`${this.storageKey}-code-verifier`),c(e))return this._returnResult({data:null,error:e});throw e}}async getUserIdentities(){var e;try{let{data:t,error:r}=await this.getUser();if(r)throw r;return this._returnResult({data:{identities:null!==(e=t.user.identities)&&void 0!==e?e:[]},error:null})}catch(e){if(c(e))return this._returnResult({data:null,error:e});throw e}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){var t;try{let{data:r,error:n}=await this._useSession(async t=>{var r,n,i,s,o;let{data:a,error:l}=t;if(l)throw l;let u=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:null===(r=e.options)||void 0===r?void 0:r.redirectTo,scopes:null===(n=e.options)||void 0===n?void 0:n.scopes,queryParams:null===(i=e.options)||void 0===i?void 0:i.queryParams,skipBrowserRedirect:!0});return await es(this.fetch,"GET",u,{headers:this.headers,jwt:null!==(o=null===(s=a.session)||void 0===s?void 0:s.access_token)&&void 0!==o?o:void 0})});if(n)throw n;return!N()||(null===(t=e.options)||void 0===t?void 0:t.skipBrowserRedirect)||window.location.assign(null==r?void 0:r.url),this._returnResult({data:{provider:e.provider,url:null==r?void 0:r.url},error:null})}catch(t){if(c(t))return this._returnResult({data:{provider:e.provider,url:null},error:t});throw t}}async linkIdentityIdToken(e){return await this._useSession(async t=>{var r;try{let{error:n,data:{session:i}}=t;if(n)throw n;let{options:s,provider:o,token:a,access_token:l,nonce:u}=e,{data:c,error:h}=await es(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:null!==(r=null==i?void 0:i.access_token)&&void 0!==r?r:void 0,body:{provider:o,id_token:a,access_token:l,nonce:u,link_identity:!0,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken}},xform:ea});if(h)return this._returnResult({data:{user:null,session:null},error:h});if(!c||!c.session||!c.user)return this._returnResult({data:{user:null,session:null},error:new y});return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("USER_UPDATED",c.session)),this._returnResult({data:c,error:h})}catch(e){if(await V(this.storage,`${this.storageKey}-code-verifier`),c(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}})}async unlinkIdentity(e){try{return await this._useSession(async t=>{var r,n;let{data:i,error:s}=t;if(s)throw s;
14return await es(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:null!==(n=null===(r=i.session)||void 0===r?void 0:r.access_token)&&void 0!==n?n:void 0})})}catch(e){if(c(e))return this._returnResult({data:null,error:e});throw e}}async _refreshAccessToken(e){let t=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(t,"begin");try{var r,n;let i=Date.now();return await (r=async r=>(r>0&&await z(200*Math.pow(2,r-1)),this._debug(t,"refreshing attempt",r),await es(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:ea})),n=(e,t)=>t&&E(t)&&Date.now()+200*Math.pow(2,e)-i<3e4,new Promise((e,t)=>{(async()=>{for(let i=0;i<1/0;i++)try{let t=await r(i);if(!n(i,null,t)){e(t);return}}catch(e){if(!n(i,e)){t(e);return}}})()}))}catch(e){if(this._debug(t,"error",e),c(e))return this._returnResult({data:{session:null,user:null},error:e});throw e}finally{this._debug(t,"end")}}_isValidSession(e){return"object"==typeof e&&null!==e&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,t){let r=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:t.redirectTo,scopes:t.scopes,queryParams:t.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",t,"url",r),N()&&!t.skipBrowserRedirect&&window.location.assign(r),{data:{provider:e,url:r},error:null}}async _recoverAndRefresh(){var e,t;let r="#_recoverAndRefresh()";this._debug(r,"begin");try{let n=await F(this.storage,this.storageKey);if(n&&this.userStorage){let t=await F(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!t&&(t={user:n.user},await B(this.userStorage,this.storageKey+"-user",t)),n.user=null!==(e=null==t?void 0:t.user)&&void 0!==e?e:Z()}else if(n&&!n.user&&!n.user){let e=await F(this.storage,this.storageKey+"-user");e&&(null==e?void 0:e.user)?(n.user=e.user,await V(this.storage,this.storageKey+"-user"),await B(this.storage,this.storageKey,n)):n.user=Z()}if(this._debug(r,"session from storage",n),!this._isValidSession(n)){this._debug(r,"session is not valid"),null!==n&&await this._removeSession();return}let i=(null!==(t=n.expires_at)&&void 0!==t?t:1/0)*1e3-Date.now()<9e4;if(this._debug(r,`session has${i?"":" not"} expired with margin of 90000s`),i){if(this.autoRefreshToken&&n.refresh_token){let{error:e}=await this._callRefreshToken(n.refresh_token);e&&(console.error(e),E(e)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",e),await this._removeSession()))}}else if(n.user&&!0===n.user.__isUserNotAvailableProxy)try{let{data:e,error:t}=await this._getUser(n.access_token);!t&&(null==e?void 0:e.user)?(n.user=e.user,await this._saveSession(n),await this._notifyAllSubscribers("SIGNED_IN",n)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(e){console.error("Error getting user data:",e),this._debug(r,"error getting user data, skipping SIGNED_IN notification",e)}else await this._notifyAllSubscribers("SIGNED_IN",n)}catch(e){this._debug(r,"error",e),console.error(e);return}finally{this._debug(r,"end")}}async _callRefreshToken(e){var t,r;if(!e)throw new m;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let n=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(n,"begin");try{this.refreshingDeferred=new q;let{data:t,error:r}=await this._refreshAccessToken(e);if(r)throw r;if(!t.session)throw new m;await this._saveSession(t.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",t.session);let n={data:t.session,error:null};return this.refreshingDeferred.resolve(n),n}catch(e){if(this._debug(n,"error",e),c(e)){let r={data:null,error:e};return E(e)||await this._removeSession(),null===(t=this.refreshingDeferred)||void 0===t||t.resolve(r),r}throw null===(r=this.refreshingDeferred)||void 0===r||r.reject(e),e}finally{this.refreshingDeferred=null,this._debug(n,"end")}}async _notifyAllSubscribers(e,t,r=!0){let n=`#_notifyAllSubscribers(${e})`;this._debug(n,"begin",t,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:e,session:t});let n=[],i=Array.from(this.stateChangeEmitters.values()).map(async r=>{try{await r.callback(e,t)}catch(e){n.push(e)}});if(await Promise.all(i),n.length>0){for(let e=0;e<n.length;e+=1)console.error(n[e]);throw n[0]}}finally{this._debug(n,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await V(this.storage,`${this.storageKey}-code-verifier`);let t=Object.assign({},e),r=t.user&&!0===t.user.__isUserNotAvailableProxy;if(this.userStorage){!r&&t.user&&await B(this.userStorage,this.storageKey+"-user",{user:t.user});let e=Object.assign({},t);delete e.user;let n=ee(e);await B(this.storage,this.storageKey,n)}else{let e=ee(t);await B(this.storage,this.storageKey,e)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await V(this.storage,this.storageKey),await V(this.storage,this.storageKey+"-code-verifier"),await V(this.storage,this.storageKey+"-user"),this.userStorage&&await V(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&N()&&(null==window?void 0:window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}
14catch(e){console.error("removing visibilitychange callback failed",e)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");let e=setInterval(()=>this._autoRefreshTokenTick(),3e4);this.autoRefreshTicker=e,e&&"object"==typeof e&&"function"==typeof e.unref?e.unref():"undefined"!=typeof Deno&&"function"==typeof Deno.unrefTimer&&Deno.unrefTimer(e),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");let e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{let e=Date.now();try{return await this._useSession(async t=>{let{data:{session:r}}=t;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}let n=Math.floor((1e3*r.expires_at-e)/3e4);this._debug("#_autoRefreshTokenTick()",`access token expires in ${n} ticks, a tick lasts 30000ms, refresh threshold is 3 ticks`),n<=3&&await this._callRefreshToken(r.refresh_token)})}catch(e){console.error("Auto refresh tick failed with error. This is likely a transient error.",e)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof ey)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!N()||!(null==window?void 0:window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),null==window||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){let t=`#_onVisibilityChanged(${e})`;this._debug(t,"visibilityState",document.visibilityState),"visible"===document.visibilityState?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(-1,async()=>{if("visible"!==document.visibilityState){this._debug(t,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):"hidden"===document.visibilityState&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t,r){let n=[`provider=${encodeURIComponent(t)}`];if((null==r?void 0:r.redirectTo)&&n.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),(null==r?void 0:r.scopes)&&n.push(`scopes=${encodeURIComponent(r.scopes)}`),"pkce"===this.flowType){let[e,t]=await J(this.storage,this.storageKey),r=new URLSearchParams({code_challenge:`${encodeURIComponent(e)}`,code_challenge_method:`${encodeURIComponent(t)}`});n.push(r.toString())}if(null==r?void 0:r.queryParams){let e=new URLSearchParams(r.queryParams);n.push(e.toString())}return(null==r?void 0:r.skipBrowserRedirect)&&n.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${e}?${n.join("&")}`}async _unenroll(e){try{return await this._useSession(async t=>{var r;let{data:n,error:i}=t;return i?this._returnResult({data:null,error:i}):await es(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:null===(r=null==n?void 0:n.session)||void 0===r?void 0:r.access_token})})}catch(e){if(c(e))return this._returnResult({data:null,error:e});throw e}}async _enroll(e){try{return await this._useSession(async t=>{var r,n;let{data:i,error:s}=t;if(s)return this._returnResult({data:null,error:s});let o=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},"phone"===e.factorType?{phone:e.phone}:"totp"===e.factorType?{issuer:e.issuer}:{}),{data:a,error:l}=await es(this.fetch,"POST",`${this.url}/factors`,{body:o,headers:this.headers,jwt:null===(r=null==i?void 0:i.session)||void 0===r?void 0:r.access_token});return l?this._returnResult({data:null,error:l}):("totp"===e.factorType&&"totp"===a.type&&(null===(n=null==a?void 0:a.totp)||void 0===n?void 0:n.qr_code)&&(a.totp.qr_code=`data:image/svg+xml;utf-8,${a.totp.qr_code}`),this._returnResult({data:a,error:null}))})}catch(e){if(c(e))return this._returnResult({data:null,error:e});throw e}}async _verify(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async t=>{var r,n,i;let{data:s,error:o}=t;if(o)return this._returnResult({data:null,error:o});let a=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:"create"===e.webauthn.type?(n=e.webauthn.credential_response,"toJSON"in n&&"function"==typeof n.toJSON?n.toJSON():{id:n.id,rawId:n.id,response:{attestationObject:D(new Uint8Array(n.response.attestationObject)),clientDataJSON:D(new Uint8Array(n.response.clientDataJSON))},type:"public-key",clientExtensionResults:n.getClientExtensionResults(),authenticatorAttachment:null!==(i=n.authenticatorAttachment)&&void 0!==i?i:void 0}):function(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:D(new Uint8Array(n.authenticatorData)),clientDataJSON:D(new Uint8Array(n.clientDataJSON)),signature:D(new Uint8Array(n.signature)),userHandle:n.userHandle?D(new Uint8Array(n.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:null!==(t=e.authenticatorAttachment)&&void 0!==t?t:void 0}}(e.webauthn.credential_response)})}:{code:e.code}),{data:l,error:u}=await es(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:a,headers:this.headers,jwt:null===(r=null==s?void 0:s.session)||void 0===r?void 0:r.access_token});return u?this._returnResult({data:null,error:u}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+l.expires_in},l)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",l),this._returnResult({data:l,error:u}))})}catch(e){if(c(e))return this._returnResult({data:null,error:e});throw e}})}async _challenge(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async t=>{var r;let{data:i,error:s}=t;if(s)return this._returnResult({data:null,error:s});let o=await es(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:null===(r=null==i?void 0:i.session)||void 0===r?void 0:r.access_token});if(o.error)return o;let{data:a}=o;if("webauthn"!==a.type)return{data:a,error:null};switch(a.webauthn.type){case"create":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:function(e){if(!e)throw Error("Credential creation options are required");if("undefined"!=typeof PublicKeyCredential&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&"function"==typeof PublicKeyCredential.parseCreationOptionsFromJSON)return PublicKeyCredential.parseCreationOptionsFromJSON(e);let{challenge:t,user:r,excludeCredentials:i}=e,s=(0,n.__rest)(e,["challenge","user","excludeCredentials"]),o=I(t).buffer,a=Object.assign(Object.assign({},r),{id:I(r.id).buffer}),l=Object.assign(Object.assign({}
14,s),{challenge:o,user:a});if(i&&i.length>0){l.excludeCredentials=Array(i.length);for(let e=0;e<i.length;e++){let t=i[e];l.excludeCredentials[e]=Object.assign(Object.assign({},t),{id:I(t.id).buffer,type:t.type||"public-key",transports:t.transports})}}return l}(a.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:function(e){if(!e)throw Error("Credential request options are required");if("undefined"!=typeof PublicKeyCredential&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&"function"==typeof PublicKeyCredential.parseRequestOptionsFromJSON)return PublicKeyCredential.parseRequestOptionsFromJSON(e);let{challenge:t,allowCredentials:r}=e,i=(0,n.__rest)(e,["challenge","allowCredentials"]),s=I(t).buffer,o=Object.assign(Object.assign({},i),{challenge:s});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:I(t.id).buffer,type:t.type||"public-key",transports:t.transports})}}return o}(a.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(e){if(c(e))return this._returnResult({data:null,error:e});throw e}})}async _challengeAndVerify(e){let{data:t,error:r}=await this._challenge({factorId:e.factorId});return r?this._returnResult({data:null,error:r}):await this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})}async _listFactors(){var e;let{data:{user:t},error:r}=await this.getUser();if(r)return{data:null,error:r};let n={all:[],phone:[],totp:[],webauthn:[]};for(let r of null!==(e=null==t?void 0:t.factors)&&void 0!==e?e:[])n.all.push(r),"verified"===r.status&&n[r.factor_type].push(r);return{data:n,error:null}}async _getAuthenticatorAssuranceLevel(){var e,t;let{data:{session:r},error:n}
14=await this.getSession();if(n)return this._returnResult({data:null,error:n});if(!r)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let{payload:i}=W(r.access_token),s=null;i.aal&&(s=i.aal);let o=s;return(null!==(t=null===(e=r.user.factors)||void 0===e?void 0:e.filter(e=>"verified"===e.status))&&void 0!==t?t:[]).length>0&&(o="aal2"),{data:{currentLevel:s,nextLevel:o,currentAuthenticationMethods:i.amr||[]},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async t=>{let{data:{session:r},error:n}=t;return n?this._returnResult({data:null,error:n}):r?await es(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:r.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new m})})}catch(e){if(c(e))return this._returnResult({data:null,error:e});throw e}}async _approveAuthorization(e,t){try{return await this._useSession(async r=>{let{data:{session:n},error:i}=r;if(i)return this._returnResult({data:null,error:i});if(!n)return this._returnResult({data:null,error:new m});let s=await es(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:n.access_token,body:{action:"approve"},xform:e=>({data:e,error:null})});return s.data&&s.data.redirect_url&&N()&&!(null==t?void 0:t.skipBrowserRedirect)&&window.location.assign(s.data.redirect_url),s})}catch(e){if(c(e))return this._returnResult({data:null,error:e});throw e}}async _denyAuthorization(e,t){try{return await this._useSession(async r=>{let{data:{session:n},error:i}=r;if(i)return this._returnResult({data:null,error:i});if(!n)return this._returnResult({data:null,error:new m});let s=await es(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:n.access_token,body:{action:"deny"},xform:e=>({data:e,error:null})});return s.data&&s.data.redirect_url&&N()&&!(null==t?void 0:t.skipBrowserRedirect)&&window.location.assign(s.data.redirect_url),s})}catch(e){if(c(e))return this._returnResult({data:null,error:e});throw e}}async _listOAuthGrants(){try{return await this._useSession(async e=>{let{data:{session:t},error:r}=e;return r?this._returnResult({data:null,error:r}):t?await es(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:t.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new m})})}catch(e){if(c(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async t=>{let{data:{session:r},error:n}=t;return n?this._returnResult({data:null,error:n}):r?(await es(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new m})})}catch(e){if(c(e))return this._returnResult({data:null,error:e});throw e}}async fetchJwk(e,t={keys:[]}){let r=t.keys.find(t=>t.kid===e);if(r)return r;let n=Date.now();if((r=this.jwks.keys.find(t=>t.kid===e))&&this.jwks_cached_at+6e5>n)return r;let{data:i,error:s}=await es(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(s)throw s;return i.keys&&0!==i.keys.length&&(this.jwks=i,this.jwks_cached_at=n,r=i.keys.find(t=>t.kid===e))?r:null}async getClaims(e,t={}){try{let r=e;if(!r){let{data:e,error:t}
14=await this.getSession();if(t||!e.session)return this._returnResult({data:null,error:t});r=e.session.access_token}let{header:n,payload:i,signature:s,raw:{header:o,payload:a}}=W(r);(null==t?void 0:t.allowExpired)||function(e){if(!e)throw Error("Missing exp claim");if(e<=Math.floor(Date.now()/1e3))throw Error("JWT has expired")}(i.exp);let l=!n.alg||n.alg.startsWith("HS")||!n.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(n.kid,(null==t?void 0:t.keys)?{keys:t.keys}:null==t?void 0:t.jwks);if(!l){let{error:e}=await this.getUser(r);if(e)throw e;return{data:{claims:i,header:n,signature:s},error:null}}let u=function(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")}}(n.alg),c=await crypto.subtle.importKey("jwk",l,u,!0,["verify"]);if(!await crypto.subtle.verify(u,c,s,function(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){t(e);return}if(e<=2047){t(192|e>>6),t(128|63&e);return}if(e<=65535){t(224|e>>12),t(128|e>>6&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)}(`${o}.${a}`)))throw new k("Invalid JWT signature");return{data:{claims:i,header:n,signature:s},error:null}}catch(e){if(c(e))return this._returnResult({data:null,error:e});throw e}}}eU.nextInstanceID={};var eB=eU,eF=ep,eV=eB},629:function(e,t,r){"use strict";r.r(t),r.d(t,{FunctionRegion:function(){return i},FunctionsClient:function(){return h},FunctionsError:function(){return a},FunctionsFetchError:function(){return l},FunctionsHttpError:function(){return c},FunctionsRelayError:function(){return u}});var n,i,s=r(6200);let o=e=>e?(...t)=>e(...t):(...e)=>fetch(...e);class a extends Error{constructor(e,t="FunctionsError",r){super(e),this.name=t,this.context=r}}class l extends a{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class u extends a{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class c extends a{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}(n=i||(i={})).Any="any",n.ApNortheast1="ap-northeast-1",n.ApNortheast2="ap-northeast-2",n.ApSouth1="ap-south-1",n.ApSoutheast1="ap-southeast-1",n.ApSoutheast2="ap-southeast-2",n.CaCentral1="ca-central-1",n.EuCentral1="eu-central-1",n.EuWest1="eu-west-1",n.EuWest2="eu-west-2",n.EuWest3="eu-west-3",n.SaEast1="sa-east-1",n.UsEast1="us-east-1",n.UsWest1="us-west-1",n.UsWest2="us-west-2";class h{constructor(e,{headers:t={},customFetch:r,region:n=i.Any}={}){this.url=e,this.headers=t,this.region=n,this.fetch=o(r)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return(0,s.__awaiter)(this,arguments,void 0,function*(e,t={}){var r;let n,i;try{let s;let{headers:o,method:a,body:h,signal:d,timeout:f}=t,p={},{region:m}=t;m||(m=this.region);let g=new URL(`${this.url}/${e}`);m&&"any"!==m&&(p["x-region"]=m,g.searchParams.set("forceFunctionRegion",m)),h&&(o&&!Object.prototype.hasOwnProperty.call(o,"Content-Type")||!o)?"undefined"!=typeof Blob&&h instanceof Blob||h instanceof ArrayBuffer?(p["Content-Type"]="application/octet-stream",s=h):"string"==typeof h?(p["Content-Type"]="text/plain",s=h):"undefined"!=typeof FormData&&h instanceof FormData?s=h:(p["Content-Type"]="application/json",s=JSON.stringify(h)):s=h;let y=d;f&&(i=new AbortController,n=setTimeout(()=>i.abort(),f),d?(y=i.signal,d.addEventListener("abort",()=>i.abort())):y=i.signal);let v=yield this.fetch(g.toString(),{method:a||"POST",headers:Object.assign(Object.assign(Object.assign({},p),this.headers),o),body:s,signal:y}).catch(e=>{throw new l(e)}),b=v.headers.get("x-relay-error");if(b&&"true"===b)throw new u(v);if(!v.ok)throw new c(v);let w=(null!==(r=v.headers.get("Content-Type"))&&void 0!==r?r:"text/plain").split(";")[0].trim();return{data:"application/json"===w?yield v.json():"application/octet-stream"
14===w||"application/pdf"===w?yield v.blob():"text/event-stream"===w?v:"multipart/form-data"===w?yield v.formData():yield v.text(),error:null,response:v}}catch(e){return{data:null,error:e,response:e instanceof c||e instanceof u?e.context:void 0}}finally{n&&clearTimeout(n)}})}}},5257:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(6200).__importDefault(r(3038));class i{constructor(e){var t,r;this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=null!==(t=e.shouldThrowOnError)&&void 0!==t&&t,this.signal=e.signal,this.isMaybeSingle=null!==(r=e.isMaybeSingle)&&void 0!==r&&r,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}then(e,t){void 0===this.schema||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),"GET"!==this.method&&"HEAD"!==this.method&&this.headers.set("Content-Type","application/json");let r=(0,this.fetch)(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async e=>{var t,r,i,s;let o=null,a=null,l=null,u=e.status,c=e.statusText;if(e.ok){if("HEAD"!==this.method){let r=await e.text();""===r||(a="text/csv"===this.headers.get("Accept")?r:this.headers.get("Accept")&&(null===(t=this.headers.get("Accept"))||void 0===t?void 0:t.includes("application/vnd.pgrst.plan+text"))?r:JSON.parse(r))}let n=null===(r=this.headers.get("Prefer"))||void 0===r?void 0:r.match(/count=(exact|planned|estimated)/),s=null===(i=e.headers.get("content-range"))||void 0===i?void 0:i.split("/");n&&s&&s.length>1&&(l=parseInt(s[1])),this.isMaybeSingle&&"GET"===this.method&&Array.isArray(a)&&(a.length>1?(o={code:"PGRST116",details:`Results contain ${a.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},a=null,l=null,u=406,c="Not Acceptable"):a=1===a.length?a[0]:null)}else{let t=await e.text();try{o=JSON.parse(t),Array.isArray(o)&&404===e.status&&(a=[],o=null,u=200,c="OK")}catch(r){404===e.status&&""===t?(u=204,c="No Content"):o={message:t}}if(o&&this.isMaybeSingle&&(null===(s=null==o?void 0:o.details)||void 0===s?void 0:s.includes("0 rows"))&&(o=null,u=200,c="OK"),o&&this.shouldThrowOnError)throw new n.default(o)}return{error:o,data:a,count:l,status:u,statusText:c}});return this.shouldThrowOnError||(r=r.catch(e=>{var t,r,n,i,s,o;let a="",l=null==e?void 0:e.cause;if(l){let s=null!==(t=null==l?void 0:l.message)&&void 0!==t?t:"",o=null!==(r=null==l?void 0:l.code)&&void 0!==r?r:"";a=`${null!==(n=null==e?void 0:e.name)&&void 0!==n?n:"FetchError"}: ${null==e?void 0:e.message} 15 16Caused by: ${null!==(i=null==l?void 0:l.name)&&void 0!==i?i:"Error"}: ${s}`,o&&(a+=` (${o})`),(null==l?void 0:l.stack)&&(a+=` 17${l.stack}`)}else a=null!==(s=null==e?void 0:e.stack)&&void 0!==s?s:"";return{error:{message:`${null!==(o=null==e?void 0:e.name)&&void 0!==o?o:"FetchError"}: ${null==e?void 0:e.message}`,details:a,hint:"",code:""},data:null,count:null,status:0,statusText:""}})),r.then(e,t)}returns(){return this}overrideTypes(){return this}}t.default=i},9590:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(6200),i=n.__importDefault(r(9824)),s=n.__importDefault(r(2495));class o{constructor(e,{headers:t={},schema:r,fetch:n}={}){this.url=e,this.headers=new Headers(t),this.schemaName=r,this.fetch=n}from(e){if(!e||"string"!=typeof e||""===e.trim())throw Error("Invalid relation name: relation must be a non-empty string.");let t=new URL(`${this.url}/${e}`);return new i.default(t,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(e){return new o(this.url,{headers:this.headers,schema:e,fetch:this.fetch})}rpc(e,t={},{head:r=!1,get:n=!1,count:i}={}){var o;let a,l;let u=new URL(`${this.url}/rpc/${e}`);r||n?(a=r?"HEAD":"GET",Object.entries(t).filter(([e,t])=>void 0!==t).map(([e,t])=>[e,Array.isArray(t)?`{${t.join(",")}}`:`${t}
17`]).forEach(([e,t])=>{u.searchParams.append(e,t)})):(a="POST",l=t);let c=new Headers(this.headers);return i&&c.set("Prefer",`count=${i}`),new s.default({method:a,url:u,headers:c,schema:this.schemaName,body:l,fetch:null!==(o=this.fetch)&&void 0!==o?o:fetch})}}t.default=o},3038:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}}t.default=r},2495:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(6200).__importDefault(r(3377)),i=RegExp("[,()]");class s extends n.default{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){let r=Array.from(new Set(t)).map(e=>"string"==typeof e&&i.test(e)?`"${e}"`:`${e}`).join(",");return this.url.searchParams.append(e,`in.(${r})`),this}contains(e,t){return"string"==typeof t?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return"string"==typeof t?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return"string"==typeof t?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:r,type:n}={}){let i="";"plain"===n?i="pl":"phrase"===n?i="ph":"websearch"===n&&(i="w");let s=void 0===r?"":`(${r})`;return this.url.searchParams.append(e,`${i}fts${s}.${t}`),this}match(e){return Object.entries(e).forEach(([e,t])=>{this.url.searchParams.append(e,`eq.${t}`)}),this}not(e,t,r){return this.url.searchParams.append(e,`not.${t}.${r}`),this}or(e,{foreignTable:t,referencedTable:r=t}={}){let n=r?`${r}.or`:"or";return this.url.searchParams.append(n,`(${e})`),this}filter(e,t,r){return this.url.searchParams.append(e,`${t}.${r}`),this}}t.default=s},9824:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(6200).__importDefault(r(2495));class i{constructor(e,{headers:t={},schema:r,fetch:n}){this.url=e,this.headers=new Headers(t),this.schema=r,this.fetch=n}select(e,t){let{head:r=!1,count:i}=null!=t?t:{},s=!1,o=(null!=e?e:"*").split("").map(e=>/\s/.test(e)&&!s?"":('"'===e&&(s=!s),e)).join("");return this.url.searchParams.set("select",o),i&&this.headers.append("Prefer",`count=${i}`),new n.default({method:r?"HEAD":"GET",url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(e,{count:t,defaultToNull:r=!0}={}){var i;if(t&&this.headers.append("Prefer",`count=${t}`),r||this.headers.append("Prefer","missing=default"),Array.isArray(e)){let t=e.reduce((e,t)=>
17e.concat(Object.keys(t)),[]);if(t.length>0){let e=[...new Set(t)].map(e=>`"${e}"`);this.url.searchParams.set("columns",e.join(","))}}return new n.default({method:"POST",url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:null!==(i=this.fetch)&&void 0!==i?i:fetch})}upsert(e,{onConflict:t,ignoreDuplicates:r=!1,count:i,defaultToNull:s=!0}={}){var o;if(this.headers.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),void 0!==t&&this.url.searchParams.set("on_conflict",t),i&&this.headers.append("Prefer",`count=${i}`),s||this.headers.append("Prefer","missing=default"),Array.isArray(e)){let t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){let e=[...new Set(t)].map(e=>`"${e}"`);this.url.searchParams.set("columns",e.join(","))}}return new n.default({method:"POST",url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:null!==(o=this.fetch)&&void 0!==o?o:fetch})}update(e,{count:t}={}){var r;return t&&this.headers.append("Prefer",`count=${t}`),new n.default({method:"PATCH",url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:null!==(r=this.fetch)&&void 0!==r?r:fetch})}delete({count:e}={}){var t;return e&&this.headers.append("Prefer",`count=${e}`),new n.default({method:"DELETE",url:this.url,headers:this.headers,schema:this.schema,fetch:null!==(t=this.fetch)&&void 0!==t?t:fetch})}}t.default=i},3377:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(6200).__importDefault(r(5257));class i extends n.default{select(e){let t=!1,r=(null!=e?e:"*").split("").map(e=>/\s/.test(e)&&!t?"":('"'===e&&(t=!t),e)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:r,foreignTable:n,referencedTable:i=n}={}){let s=i?`${i}.order`:"order",o=this.url.searchParams.get(s);return this.url.searchParams.set(s,`${o?`${o},`:""}${e}.${t?"asc":"desc"}${void 0===r?"":r?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:r=t}={}){let n=void 0===r?"limit":`${r}.limit`;return this.url.searchParams.set(n,`${e}`),this}range(e,t,{foreignTable:r,referencedTable:n=r}={}){let i=void 0===n?"offset":`${n}.offset`,s=void 0===n?"limit":`${n}.limit`;return this.url.searchParams.set(i,`${e}`),this.url.searchParams.set(s,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return"GET"===this.method?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:e=!1,verbose:t=!1,settings:r=!1,buffers:n=!1,wal:i=!1,format:s="text"}={}){var o;let a=[e?"analyze":null,t?"verbose":null,r?"settings":null,n?"buffers":null,i?"wal":null].filter(Boolean).join("|"),l=null!==(o=this.headers.get("Accept"))&&void 0!==o?o:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${s}; for="${l}"; options=${a};`),this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}}t.default=i},9640:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PostgrestError=t.PostgrestBuilder=t.PostgrestTransformBuilder=t.PostgrestFilterBuilder=t.PostgrestQueryBuilder=t.PostgrestClient=void 0;let n=r(6200),i=n.__importDefault(r(9590));t.PostgrestClient=i.default;let s=n.__importDefault(r(9824));t.PostgrestQueryBuilder=s.default;let o=n.__importDefault(r(2495));t.PostgrestFilterBuilder=o.default;let a=n.__importDefault(r(3377));t.PostgrestTransformBuilder=a.default;let l=n.__importDefault(r(5257));t.PostgrestBuilder=l.default;let u=n.__importDefault(r(3038));t.PostgrestError=u.default,t.default={PostgrestClient:i.default,PostgrestQueryBuilder:s.default,PostgrestFilterBuilder:o.default,PostgrestTransformBuilder:
17a.default,PostgrestBuilder:l.default,PostgrestError:u.default}},9287:function(e,t,r){"use strict";r.r(t),r.d(t,{REALTIME_CHANNEL_STATES:function(){return B},REALTIME_LISTEN_TYPES:function(){return w},REALTIME_POSTGRES_CHANGES_LISTEN_EVENT:function(){return b},REALTIME_PRESENCE_LISTEN_EVENTS:function(){return v},REALTIME_SUBSCRIBE_STATES:function(){return x},RealtimeChannel:function(){return F},RealtimeClient:function(){return H},RealtimePresence:function(){return U},WebSocketFactory:function(){return T}});var n,i,s,o,a,l,u,c,h,d,f,p,m,g,y,v,b,w,x,_=r(257);class E{constructor(){}static detectEnvironment(){var e;if("undefined"!=typeof WebSocket)return{type:"native",constructor:WebSocket};if("undefined"!=typeof globalThis&&void 0!==globalThis.WebSocket)return{type:"native",constructor:globalThis.WebSocket};if(void 0!==r.g&&void 0!==r.g.WebSocket)return{type:"native",constructor:r.g.WebSocket};if("undefined"!=typeof globalThis&&void 0!==globalThis.WebSocketPair&&void 0===globalThis.WebSocket)return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if("undefined"!=typeof globalThis&&globalThis.EdgeRuntime||"undefined"!=typeof navigator&&(null===(e=navigator.userAgent)||void 0===e?void 0:e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};if(void 0!==_){let e=_.versions;if(e&&e.node){let t=parseInt(e.node.replace(/^v/,"").split(".")[0]);return t>=22?void 0!==globalThis.WebSocket?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${t} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${t} detected without native WebSocket support.`,workaround:'For Node.js < 22, install "ws" package and provide it via the transport option:\nimport ws from "ws"\nnew RealtimeClient(url, { transport: ws })'}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){let e=this.detectEnvironment();if(e.constructor)return e.constructor;let t=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(t+=` 18 19Suggested solution: ${e.workaround}`),Error(t)}static createWebSocket(e,t){return new(this.getWebSocketConstructor())(e,t)}static isWebSocketSupported(){try{let e=this.detectEnvironment();return"native"===e.type||"ws"===e.type}catch(e){return!1}}}var T=E;let S="1.0.0";(n=d||(d={}))[n.connecting=0]="connecting",n[n.open=1]="open",n[n.closing=2]="closing",n[n.closed=3]="closed",(i=f||(f={})).closed="closed",i.errored="errored",i.joined="joined",i.joining="joining",i.leaving="leaving",(s=p||(p={})).close="phx_close",s.error="phx_error",s.join="phx_join",s.reply="phx_reply",s.leave="phx_leave",s.access_token="access_token",(m||(m={})).websocket="websocket",(o=g||(g={})).Connecting="connecting",o.Open="open",o.Closing="closing",o.Closed="closed";class k{constructor(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=null!=e?e:[]}encode(e,t){return e.event!==this.BROADCAST_EVENT||e.payload instanceof ArrayBuffer||"string"!=typeof e.payload.event?t(JSON.stringify([e.join_ref,e.ref,e.topic,e.event,e.payload])):t(this._binaryEncodeUserBroadcastPush(e))}_binaryEncodeUserBroadcastPush(e){var t;return this._isArrayBuffer(null===(t=e.payload)||void 0===t?void 0:t.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var t,r;let n=null!==(r=null===(t=e.payload)||void 0===t?void 0:t.payload)&&void 0!==r?r:new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,n)}_encodeJsonUserBroadcastPush(e){var t,r;let n=null!==(r=null===(t=e.payload)||void 0===t?void 0:t.payload)&&void 0!==r?r:{},i=new TextEncoder().encode(JSON.stringify(n)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,i)}_encodeUserBroadcastPush(e,t,r){let n=e.topic,i=null!==(f=e.ref)&&void 0!==f?f:"",s=null!==(p=e.join_ref)&&void 0!==p?p:"",o=e.payload.event,a=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},l=0===Object.keys(a).length?"":JSON.stringify(a);if(s.length>255)throw Error(`joinRef length ${s.length} exceeds maximum of 255`);if(i.length>255)throw Error(`ref length ${i.length} exceeds maximum of 255`);if(n.length>255)throw Error(`topic length ${n.length} exceeds maximum of 255`);if(o.length>255)throw Error(`userEvent length ${o.length} exceeds maximum of 255`);if(l.length>255)throw Error(`metadata length ${l.length} exceeds maximum of 255`);let u=this.USER_BROADCAST_PUSH_META_LENGTH+s.length+i.length+n.length+o.length+l.length,c=new ArrayBuffer(this.HEADER_LENGTH+u),h=new DataView(c),d=0;h.setUint8(d++,this.KINDS.userBroadcastPush),h.setUint8(d++,s.length),h.setUint8(d++,i.length),h.setUint8(d++,n.length),h.setUint8(d++,o.length),h.setUint8(d++,l.length),h.setUint8(d++,t),Array.from(s,e=>h.setUint8(d++,e.charCodeAt(0))),Array.from(i,e=>h.setUint8(d++,e.charCodeAt(0))),Array.from(n,e=>h.setUint8(d++,e.charCodeAt(0))),Array.from(o,e=>h.setUint8(d++,e.charCodeAt(0))),Array.from(l,e=>h.setUint8(d++,e.charCodeAt(0)));var f,p,m=new Uint8Array(c.byteLength+r.byteLength);return m.set(new Uint8Array(c),0),m.set(new Uint8Array(r),c.byteLength),m.buffer}decode(e,t){if(this._isArrayBuffer(e))return t(this._binaryDecode(e));if("string"==typeof e){let[r,n,i,s,o]=JSON.parse(e);return t({join_ref:r,ref:n,topic:i,event:s,payload:o})}return t({})}_binaryDecode(e){let t=new DataView(e),r=t.getUint8(0),n=new TextDecoder;if(r===this.KINDS.userBroadcast)return this._decodeUserBroadcast(e,t,n)}_decodeUserBroadcast(e,t,r){let n=t.getUint8(1),i=t.getUint8(2),s=t.getUint8(3),o=t.getUint8(4),a=this.HEADER_LENGTH+4,l=r.decode(e.slice(a,a+n));a+=n;let u=r.decode(e.slice(a,a+i));a+=i;let c=r.decode(e.slice(a,a+s));a+=s;let h=e.slice(a,e.byteLength),d=o===this.JSON_ENCODING?JSON.parse(r.decode(h)):h,f={type:this.BROADCAST_EVENT,event:u,payload:d};return s>0&&(f.meta=JSON.parse(c)),{join_ref:null,ref:null,topic:l,event:this.BROADCAST_EVENT,payload:f}}_isArrayBuffer(e){var t;return e instanceof ArrayBuffer||(null===(t=null==e?void 0:e.constructor)||void 0===t?void 0:t.name)==="ArrayBuffer"}_pick(e,t){return e&&"object"==typeof e?Object.fromEntries(Object.entries(e).filter(([e])=>t.includes(e))):{}}}class A{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=t}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}(a=y||(y={})).abstime="abstime",a.bool="bool",a.date="date",a.daterange="daterange",a.float4="float4",a.float8="float8",a.int2="int2",a.int4="int4",a.int4range="int4range",a.int8="int8",a.int8range="int8range",a.json="json",a.jsonb="jsonb",a.money="money",a.numeric="numeric",a.oid="oid",a.reltime="reltime",a.text="text",a.time="time",a.timestamp="timestamp",a.timestamptz="timestamptz",a.timetz="timetz",a.tsrange="tsrange",a.tstzrange="tstzrange";let P=(e,t,r={})=>{var n;let i=null!==(n=r.skipTypes)&&void 0!==n?n:[];return t?Object.keys(t).reduce((r,n)=>(r[n]=O(n,e,t,i),r),{}):{}},O=(e,t,r,n)=>{let i=t.find(t=>t.name===e),s=null==i?void 0:i.type,o=r[e];return s&&!n.includes(s)?R(s,o):C(o)},R=(e,t)=>{if("_"===e.charAt(0))return N(t,e.slice(1,e.length));switch(e){case y.bool:return j(t);case y.float4:case y.float8:case y.int2:case y.int4:case y.int8:case y.numeric:case y.oid:return I(t);case y.json:case y.jsonb:return D(t);case y.timestamp:return M(t);case y.abstime:case y.date:case y.daterange:case y.int4range:case y.int8range:case y.money:case y.reltime:case y.text:case y.time:case y.timestamptz:case y.timetz:case y.tsrange:case y.tstzrange:default:return C(t)}},C=e=>e,j=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},I=e=>{if("string"==typeof e){let t=parseFloat(e);
19if(!Number.isNaN(t))return t}return e},D=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){console.log(`JSON parse error: ${e}`)}return e},N=(e,t)=>{if("string"!=typeof e)return e;let r=e.length-1,n=e[r];if("{"===e[0]&&"}"===n){let n;let i=e.slice(1,r);try{n=JSON.parse("["+i+"]")}catch(e){n=i?i.split(","):[]}return n.map(e=>R(t,e))}return e},M=e=>"string"==typeof e?e.replace(" ","T"):e,L=e=>{let t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),""===t.pathname||"/"===t.pathname?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};class ${constructor(e,t,r={},n=1e4){this.channel=e,this.event=t,this.payload=r,this.timeout=n,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,t){var r;return this._hasReceived(e)&&t(null===(r=this.receivedResp)||void 0===r?void 0:r.response),this.recHooks.push({status:e,callback:t}),this}startTimeout(){this.timeoutTimer||(this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref),this.channel._on(this.refEvent,{},e=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=e,this._matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout))}trigger(e,t){this.refEvent&&this.channel._trigger(this.refEvent,{status:e,response:t})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:t}){this.recHooks.filter(t=>t.status===e).forEach(e=>e.callback(t))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}}(l=v||(v={})).SYNC="sync",l.JOIN="join",l.LEAVE="leave";class U{constructor(e,t){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};let r=(null==t?void 0:t.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(r.state,{},e=>{let{onJoin:t,onLeave:r,onSync:n}=this.caller;this.joinRef=this.channel._joinRef(),this.state=U.syncState(this.state,e,t,r),this.pendingDiffs.forEach(e=>{this.state=U.syncDiff(this.state,e,t,r)}),this.pendingDiffs=[],n()}),this.channel._on(r.diff,{},e=>{let{onJoin:t,onLeave:r,onSync:n}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(e):(this.state=U.syncDiff(this.state,e,t,r),n())}),this.onJoin((e,t,r)=>{this.channel._trigger("presence",{event:"join",key:e,currentPresences:t,newPresences:r})}),this.onLeave((e,t,r)=>{this.channel._trigger("presence",{event:"leave",key:e,currentPresences:t,leftPresences:r})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,t,r,n){let i=this.cloneDeep(e),s=this.transformState(t),o={},a={};return this.map(i,(e,t)=>{s[e]||(a[e]=t)}),this.map(s,(e,t)=>{let r=i[e];if(r){let n=t.map(e=>e.presence_ref),i=r.map(e=>e.presence_ref),s=t.filter(e=>0>i.indexOf(e.presence_ref)),l=r.filter(e=>0>n.indexOf(e.presence_ref));s.length>0&&(o[e]=s),l.length>0&&(a[e]=l)}else o[e]=t}),this.syncDiff(i,{joins:o,leaves:a},r,n)}static syncDiff(e,t,r,n){let{joins:i,leaves:s}={joins:this.transformState(t.joins),leaves:this.transformState(t.leaves)};return r||(r=()=>{}),n||(n=()=>{}),this.map(i,(t,n)=>{var i;let s=null!==(i=e[t])&&void 0!==i?i:[];if(e[t]=this.cloneDeep(n),s.length>0){let r=e[t].map(e=>e.presence_ref),n=s.filter(e=>0>r.indexOf(e.presence_ref));e[t].unshift(...n)}r(t,s,n)}),this.map(s,(t,r)=>{let i=e[t];if(!i)return;let s=r.map(e=>e.presence_ref);i=i.filter(e=>0>s.indexOf(e.presence_ref)),e[t]=i,n(t,i,r),0===i.length&&delete e[t]}),e}static map(e,t){return Object.getOwnPropertyNames(e).map(r=>t(r,e[r]))}static transformState(e){return Object.getOwnPropertyNames(e=this.cloneDeep(e)).reduce((t,r)=>{let n=e[r];return"metas"in n?t[r]=n.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e)):t[r]=n,t},{})}static cloneDeep(e){return JSON.parse(JSON.stringify(e))}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}(u=b||(b={})).ALL="*",u.INSERT="INSERT",u.UPDATE="UPDATE",u.DELETE="DELETE",(c=w||(w={})).BROADCAST="broadcast",c.PRESENCE="presence",c.POSTGRES_CHANGES="postgres_changes",c.SYSTEM="system",(h=x||(x={})).SUBSCRIBED="SUBSCRIBED",h.TIMED_OUT="TIMED_OUT",h.CLOSED="CLOSED",h.CHANNEL_ERROR="CHANNEL_ERROR";let B=f;class F{constructor(e,t={config:{}},r){var n,i;if(this.topic=e,this.params=t,this.socket=r,this.bindings={},this.state=f.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},t.config),this.timeout=this.socket.timeout,this.joinPush=new $(this,p.join,this.params,this.timeout),this.rejoinTimer=new A(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=f.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(e
19=>e.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=f.closed,this.socket._remove(this)}),this._onError(e=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,e),this.state=f.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=f.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",e=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,e),this.state=f.errored,this.rejoinTimer.scheduleTimeout())}),this._on(p.reply,{},(e,t)=>{this._trigger(this._replyEventName(t),e)}),this.presence=new U(this),this.broadcastEndpointURL=L(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(null===(i=null===(n=this.params.config)||void 0===n?void 0:n.broadcast)||void 0===i?void 0:i.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(e,t=this.timeout){var r,n,i;if(this.socket.isConnected()||this.socket.connect(),this.state==f.closed){let{config:{broadcast:s,presence:o,private:a}}=this.params,l=null!==(n=null===(r=this.bindings.postgres_changes)||void 0===r?void 0:r.map(e=>e.filter))&&void 0!==n?n:[],u=!!this.bindings[w.PRESENCE]&&this.bindings[w.PRESENCE].length>0||(null===(i=this.params.config.presence)||void 0===i?void 0:i.enabled)===!0,c={},h={broadcast:s,presence:Object.assign(Object.assign({},o),{enabled:u}),postgres_changes:l,private:a};this.socket.accessTokenValue&&(c.access_token=this.socket.accessTokenValue),this._onError(t=>null==e?void 0:e(x.CHANNEL_ERROR,t)),this._onClose(()=>null==e?void 0:e(x.CLOSED)),this.updateJoinPayload(Object.assign({config:h},c)),this.joinedOnce=!0,this._rejoin(t),this.joinPush.receive("ok",async({postgres_changes:t})=>{var r;if(this.socket._isManualToken()||this.socket.setAuth(),void 0===t){null==e||e(x.SUBSCRIBED);return}{let n=this.bindings.postgres_changes,i=null!==(r=null==n?void 0:n.length)&&void 0!==r?r:0,s=[];for(let r=0;r<i;r++){let i=n[r],{filter:{event:o,schema:a,table:l,filter:u}}=i,c=t&&t[r];if(c&&c.event===o&&F.isFilterValueEqual(c.schema,a)&&F.isFilterValueEqual(c.table,l)&&F.isFilterValueEqual(c.filter,u))s.push(Object.assign(Object.assign({},i),{id:c.id}));else{this.unsubscribe(),this.state=f.errored,null==e||e(x.CHANNEL_ERROR,Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=s,e&&e(x.SUBSCRIBED);return}}).receive("error",t=>{this.state=f.errored,null==e||e(x.CHANNEL_ERROR,Error(JSON.stringify(Object.values(t).join(", ")||"error")))}).receive("timeout",()=>{null==e||e(x.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(e,t={}){return await this.send({type:"presence",event:"track",payload:e},t.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,t,r){return this.state===f.joined&&e===w.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(async()=>await this.subscribe())),this._on(e,t,r)}async httpSend(e,t,r={}){var n;let i=this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"";if(null==t)return Promise.reject("Payload is required for httpSend()");let s={method:"POST",headers:{Authorization:i,apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:e,payload:t,private:this.private}]})},o=await this._fetchWithTimeout(this.broadcastEndpointURL,s,null!==(n=r.timeout)&&void 0!==n?n:this.timeout);if(202===o.status)return{success:!0};let a=o.statusText;try{let e=await o.json();a=e.error||e.message||a}catch(e){}return Promise.reject(Error(a))}async send(e,t={}){var r,n;if(this._canPush()||"broadcast"!==e.type)return new Promise(r=>{var n,i,s;let o=this._push(e.type,e,t.timeout||this.timeout);"broadcast"!==e.type||(null===(s=null===(i=null===(n=this.params)||void 0===n?void 0:n.config)||void 0===i?void 0:i.broadcast)||void 0===s?void 0:s.ack)||r("ok"),o.receive("ok",()=>r("ok")),o.receive("error",()=>r("error")),o.receive("timeout",()=>r("timed out"))});{console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated
19in the future. Please use httpSend() explicitly for REST delivery.");let{event:i,payload:s}=e,o={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:s,private:this.private}]})};try{let e=await this._fetchWithTimeout(this.broadcastEndpointURL,o,null!==(r=t.timeout)&&void 0!==r?r:this.timeout);return await (null===(n=e.body)||void 0===n?void 0:n.cancel()),e.ok?"ok":"error"}catch(e){if("AbortError"===e.name)return"timed out";return"error"}}}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=f.leaving;let t=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(p.close,"leave",this._joinRef())};this.joinPush.destroy();let r=null;return new Promise(n=>{(r=new $(this,p.leave,{},e)).receive("ok",()=>{t(),n("ok")}).receive("timeout",()=>{t(),n("timed out")}).receive("error",()=>{n("error")}),r.send(),this._canPush()||r.trigger("ok",{})}).finally(()=>{null==r||r.destroy()})}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=f.closed,this.bindings={}}async _fetchWithTimeout(e,t,r){let n=new AbortController,i=setTimeout(()=>n.abort(),r),s=await this.socket.fetch(e,Object.assign(Object.assign({},t),{signal:n.signal}));return clearTimeout(i),s}_push(e,t,r=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let n=new $(this,e,t,r);return this._canPush()?n.send():this._addToPushBuffer(n),n}_addToPushBuffer(e){if(e.startTimeout(),this.pushBuffer.push(e),this.pushBuffer.length>100){let e=this.pushBuffer.shift();e&&(e.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${e.event}`,e.payload))}}_onMessage(e,t,r){return t}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,t,r){var n,i;let s=e.toLocaleLowerCase(),{close:o,error:a,leave:l,join:u}=p;if(r&&[o,a,l,u].indexOf(s)>=0&&r!==this._joinRef())return;let c=this._onMessage(s,t,r);if(t&&!c)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(s)?null===(n=this.bindings.postgres_changes)||void 0===n||n.filter(e=>{var t,r,n;return(null===(t=e.filter)||void 0===t?void 0:t.event)==="*"||(null===(n=null===(r=e.filter)||void 0===r?void 0:r.event)||void 0===n?void 0:n.toLocaleLowerCase())===s}).map(e=>e.callback(c,r)):null===(i=this.bindings[s])||void 0===i||i.filter(e=>{var r,n,i,o,a,l;if(!["broadcast","presence","postgres_changes"].includes(s))return e.type.toLocaleLowerCase()===s;if("id"in e){let s=e.id,o=null===(r=e.filter)||void 0===r?void 0:r.event;return s&&(null===(n=t.ids)||void 0===n?void 0:n.includes(s))&&("*"===o||(null==o?void 0:o.toLocaleLowerCase())===(null===(i=t.data)||void 0===i?void 0:i.type.toLocaleLowerCase()))}{let r=null===(a=null===(o=null==e?void 0:e.filter)||void 0===o?void 0:o.event)||void 0===a?void 0:a.toLocaleLowerCase();return"*"===r||r===(null===(l=null==t?void 0:t.event)||void 0===l?void 0:l.toLocaleLowerCase())}}).map(e=>{if("object"==typeof c&&"ids"in c){let e=c.data,{schema:t,table:r,commit_timestamp:n,type:i,errors:s}=e;c=Object.assign(Object.assign({},{schema:t,table:r,commit_timestamp:n,eventType:i,new:{},old:{},errors:s}),this._getPayloadRecords(e))}e.callback(c,r)})}_isClosed(){return this.state===f.closed}_isJoined(){return this.state===f.joined}_isJoining(){return this.state===f.joining}_isLeaving(){return this.state===f.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,t,r){let n=e.toLocaleLowerCase(),i={type:n,filter:t,callback:r};return this.bindings[n]?this.bindings[n].push(i):this.bindings[n]=[i],this}_off(e,t){let r=e.toLocaleLowerCase();return this.bindings[r]&&(this.bindings[r]=this.bindings[r].filter(e=>{var n;return!((null===(n=e.type)||void 0===n?void 0:n.toLocaleLowerCase())===r&&F.isEqual(e.filter,t))})),this}static isEqual(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e)if(e[r]!==t[r])return!1;return!0}static isFilterValueEqual(e,t){return(null!=e?e:void 0)===(null!=t?t:void 0)}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(p.close,{},e)}_onError(e){this._on(p.error,{},t=>e(t))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=f.joining,this.joinPush.resend(e))}_getPayloadRecords(e){let t={new:{},old:{}};return("INSERT"===e.type||"UPDATE"===e.type)&&(t.new=P(e.columns,e.record)),("UPDATE"===e.type||"DELET
19E"===e.type)&&(t.old=P(e.columns,e.old_record)),t}}let V=()=>{},q={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},W=[1e3,2e3,5e3,1e4],z=` 20 addEventListener("message", (e) => { 21 if (e.data.event === "start") { 22 setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); 23 } 24 });`;class H{constructor(e,t){var r;if(this.accessTokenValue=null,this.apiKey=null,this._manuallySetToken=!1,this.channels=[],this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=1e4,this.transport=null,this.heartbeatIntervalMs=q.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=V,this.ref=0,this.reconnectTimer=null,this.vsn=S,this.logger=V,this.conn=null,this.sendBuffer=[],this.serializer=new k,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._resolveFetch=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),!(null===(r=null==t?void 0:t.params)||void 0===r?void 0:r.apikey))throw Error("API key is required to connect to Realtime");this.apiKey=t.params.apikey,this.endPoint=`${e}/${m.websocket}`,this.httpEndpoint=L(e),this._initializeOptions(t),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(null==t?void 0:t.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||null!==this.conn&&this.isConnected())){if(this._setConnectionState("connecting"),this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=T.createWebSocket(this.endpointURL())}catch(t){this._setConnectionState("disconnected");let e=t.message;if(e.includes("Node.js"))throw Error(`${e} 25 26To use Realtime in Node.js, you need to provide a WebSocket implementation: 27 28Option 1: Use Node.js 22+ which has native WebSocket support 29Option 2: Install and provide the "ws" package: 30 31 npm install ws 32 33 import ws from "ws" 34 const client = new RealtimeClient(url, { 35 ...options, 36 transport: ws 37 })`);throw Error(`WebSocket not available: ${e}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:this.vsn}))}disconnect(e,t){if(!this.isDisconnecting()){if(this._setConnectionState("disconnecting",!0),this.conn){let r=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(r),this._setConnectionState("disconnected")},"function"==typeof this.conn.close&&(e?this.conn.close(e,null!=t?t:""):this.conn.close()),this._teardownConnection()}else this._setConnectionState("disconnected")}}getChannels(){return this.channels}async removeChannel(e){let t=await e.unsubscribe();return 0===this.channels.length&&this.disconnect(),t}async removeAllChannels(){let e=await Promise.all(this.channels.map(e=>e.unsubscribe()));return this.channels=[],this.disconnect(),e}log(e,t,r){this.logger(e,t,r)}connectionState(){switch(this.conn&&this.conn.readyState){case d.connecting:return g.Connecting;case d.open:return g.Open;case d.closing:return g.Closing;default:return g.Closed}}isConnected(){return this.connectionState()===g.Open}isConnecting(){return"connecting"===this._connectionState}isDisconnecting(){return"disconnecting"===this._connectionState}channel(e,t={config:{}}){let r=`realtime:${e}`,n=this.getChannels().find(e=>e.topic===r);if(n)return n;{let r=new F(`realtime:${e}`,t,this);return this.channels.push(r),r}}push(e){let{topic:t,event:r,payload:n,ref:i}=e,s=()=>{this.encode(e,e=>{var t;null===(t=this.conn)||void 0===t||t.send(e)})};this.log("push",`${t} ${r} (${i})`,n),this.isConnected()?s():this.sendBuffer.push(s)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){var e;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(e){this.log("error","error in heartbeat callback",e)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(e){this.log("error","error in heartbeat callback",e)}this._wasManualDisconnect=!1,null===(e=this.conn)||void 0===e||e.close(1e3,"heartbeat timeout"),setTimeout(()=>{var e;this.isConnected()||null===(e=this.reconnectTimer)||void 0===e||e.scheduleTimeout()},q.HEARTBEAT_TIMEOUT_FALLBACK);return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(e){this.log("error","error in heartbeat callback",e)}this._setAuthSafely("heartbeat")}onHeartbeat(e){this.heartbeatCallback=e}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>
370&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}_leaveOpenTopic(e){let t=this.channels.find(t=>t.topic===e&&(t._isJoined()||t._isJoining()));t&&(this.log("transport",`leaving duplicate topic "${e}"`),t.unsubscribe())}_remove(e){this.channels=this.channels.filter(t=>t.topic!==e.topic)}_onConnMessage(e){this.decode(e.data,e=>{if("phoenix"===e.topic&&"phx_reply"===e.event)try{this.heartbeatCallback("ok"===e.payload.status?"ok":"error")}catch(e){this.log("error","error in heartbeat callback",e)}e.ref&&e.ref===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null);let{topic:t,event:r,payload:n,ref:i}=e,s=i?`(${i})`:"",o=n.status||"";this.log("receive",`${o} ${t} ${r} ${s}`.trim(),n),this.channels.filter(e=>e._isMember(t)).forEach(e=>e._trigger(r,n,i)),this._triggerStateCallbacks("message",e)})}_clearTimer(e){var t;"heartbeat"===e&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):"reconnect"===e&&(null===(t=this.reconnectTimer)||void 0===t||t.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=e=>this._onConnError(e),this.conn.onmessage=e=>this._onConnMessage(e),this.conn.onclose=e=>this._onConnClose(e))}_teardownConnection(){if(this.conn){if(this.conn.readyState===d.open||this.conn.readyState===d.connecting)try{this.conn.close()}catch(e){this.log("error","Error closing connection",e)}this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null}this._clearAllTimers(),this.channels.forEach(e=>e.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).then(()=>{this.flushSendBuffer()}).catch(e=>{this.log("error","error waiting for auth on connect",e),this.flushSendBuffer()}),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");let e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=e=>{this.log("worker","worker error",e.message),this.workerRef.terminate()},this.workerRef.onmessage=e=>{"keepAlive"===e.data.event&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_onConnClose(e){var t;this._setConnectionState("disconnected"),this.log("transport","close",e),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||null===(t=this.reconnectTimer)||void 0===t||t.scheduleTimeout(),this._triggerStateCallbacks("close",e)}_onConnError(e){this._setConnectionState("disconnected"),this.log("transport",`${e}`),this._triggerChanError(),this._triggerStateCallbacks("error",e)}_triggerChanError(){this.channels.forEach(e=>e._trigger(p.error))}_appendParams(e,t){if(0===Object.keys(t).length)return e;let r=e.match(/\?/)?"&":"?",n=new URLSearchParams(t);return`${e}${r}${n}`}_workerObjectUrl(e){let t;if(e)t=e;else{let e=new Blob([z],{type:"application/javascript"});t=URL.createObjectURL(e)}return t}_setConnectionState(e,t=!1){this._connectionState=e,"connecting"===e?this._wasManualDisconnect=!1:"disconnecting"===e&&(this._wasManualDisconnect=t)}async _performAuth(e=null){let t;let r=!1;if(e)t=e,r=!0;else if(this.accessToken)try{t=await this.accessToken()}catch(e){this.log("error","Error fetching access token from callback",e),t=this.accessTokenValue}else t=this.accessTokenValue;r?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=t&&(this.accessTokenValue=t,this.channels.forEac
37h(e=>{let r={access_token:t,version:"realtime-js/2.87.1"};t&&e.updateJoinPayload(r),e.joinedOnce&&e._isJoined()&&e._push(p.access_token,{access_token:t})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this._isManualToken()||this.setAuth().catch(t=>{this.log("error",`Error setting auth in ${e}`,t)})}_triggerStateCallbacks(e,t){try{this.stateChangeCallbacks[e].forEach(r=>{try{r(t)}catch(t){this.log("error",`error in ${e} callback`,t)}})}catch(t){this.log("error",`error triggering ${e} callbacks`,t)}}_setupReconnectionTimer(){this.reconnectTimer=new A(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},q.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(e){var t,r,n,i,s,o,a,l,u,c,h,d;switch(this.transport=null!==(t=null==e?void 0:e.transport)&&void 0!==t?t:null,this.timeout=null!==(r=null==e?void 0:e.timeout)&&void 0!==r?r:1e4,this.heartbeatIntervalMs=null!==(n=null==e?void 0:e.heartbeatIntervalMs)&&void 0!==n?n:q.HEARTBEAT_INTERVAL,this.worker=null!==(i=null==e?void 0:e.worker)&&void 0!==i&&i,this.accessToken=null!==(s=null==e?void 0:e.accessToken)&&void 0!==s?s:null,this.heartbeatCallback=null!==(o=null==e?void 0:e.heartbeatCallback)&&void 0!==o?o:V,this.vsn=null!==(a=null==e?void 0:e.vsn)&&void 0!==a?a:S,
37(null==e?void 0:e.params)&&(this.params=e.params),(null==e?void 0:e.logger)&&(this.logger=e.logger),((null==e?void 0:e.logLevel)||(null==e?void 0:e.log_level))&&(this.logLevel=e.logLevel||e.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=null!==(l=null==e?void 0:e.reconnectAfterMs)&&void 0!==l?l:e=>W[e-1]||1e4,this.vsn){case S:this.encode=null!==(u=null==e?void 0:e.encode)&&void 0!==u?u:(e,t)=>t(JSON.stringify(e)),this.decode=null!==(c=null==e?void 0:e.decode)&&void 0!==c?c:(e,t)=>t(JSON.parse(e));break;case"2.0.0":this.encode=null!==(h=null==e?void 0:e.encode)&&void 0!==h?h:this.serializer.encode.bind(this.serializer),this.decode=null!==(d=null==e?void 0:e.decode)&&void 0!==d?d:this.serializer.decode.bind(this.serializer);break;default:throw Error(`Unsupported serializer version: ${this.vsn}`)}if(this.worker){if("undefined"!=typeof window&&!window.Worker)throw Error("Web Worker is not supported");this.workerUrl=null==e?void 0:e.workerUrl}}}},3874:function(e,t,r){"use strict";r.r(t),r.d(t,{StorageAnalyticsClient:function(){return B},StorageApiError:function(){return u},StorageClient:function(){return ea},StorageError:function(){return a},StorageUnknownError:function(){return c},StorageVectorsApiError:function(){return W},StorageVectorsClient:function(){return ei},StorageVectorsError:function(){return V},StorageVectorsErrorCode:function(){return s},StorageVectorsUnknownError:function(){return z},VectorBucketApi:function(){return en},VectorBucketScope:function(){return es},VectorDataApi:function(){return er},VectorIndexApi:function(){return et},VectorIndexScope:function(){return eo},isPlainObject:function(){return G},isStorageError:function(){return l},isStorageVectorsError:function(){return q},normalizeToFloat32:function(){return J},resolveFetch:function(){return H},resolveResponse:function(){return K},validateVectorDimension:function(){return Y}});var n,i,s,o=r(6200);class a extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}}function l(e){return"object"==typeof e&&null!==e&&"__isStorageError"in e}class u extends a{constructor(e,t,r){super(e),this.name="StorageApiError",this.status=t,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class c extends a{constructor(e,t){super(e),this.name="StorageUnknownError",this.originalError=t}}let h=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),d=()=>Response,f=e=>{if(Array.isArray(e))return e.map(e=>f(e));if("function"==typeof e||e!==Object(e))return e;let t={};return Object.entries(e).forEach(([e,r])=>{t[e.replace(/([-_][a-z])/gi,e=>e.toUpperCase().replace(/[-_]/g,""))]=f(r)}),t},p=e=>{if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},m=e=>!(!e||"string"!=typeof e||0===e.length||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\"))&&/^[\w!.\*'() &$@=;:+,?-]+$/.test(e),g=e=>{var t;return e.msg||e.message||e.error_description||("string"==typeof e.error?e.error:null===(t=e.error)||void 0===t?void 0:t.message)||JSON.stringify(e)},y=(e,t,r)=>(0,o.__awaiter)(void 0,void 0,void 0,function*(){e instanceof(yield d())&&!(null==r?void 0:r.noResolveJson)?e.json().then(r=>{let n=e.status||500,i=(null==r?void 0:r.statusCode)||n+"";t(new u(g(r),n,i))}).catch(e=>{t(new c(g(e),e))}):t(new c(g(e),e))}),v=(e,t,r,n)=>{let i={method:e,headers:(null==t?void 0:t.headers)||{}};return"GET"!==e&&n?(p(n)?(i.headers=Object.assign({"Content-Type":"application/json"},null==t?void 0:t.headers),i.body=JSON.stringify(n)):i.body=n,(null==t?void 0:t.duplex)&&(i.duplex=t.duplex),Object.assign(Object.assign({},i),r)):i};function b(e,t,r,n,i,s){return(0,o.__awaiter)(this,void 0,void 0,function*(){return new Promise((o,a)=>{e(r,v(t,n,i,s)).then(e=>{if(!e.ok)throw e;return(null==n?void 0:n.noResolveJson)?e:e.json()}).then(e=>o(e)).catch(e=>y(e,a,n))})})}function w(e,t,r,n){return(0,o.__awaiter)(this,void 0,void 0,function*(){return b(e,"GET",t,r,n)})}function x(e,t,r,n,i){return(0,o.__awaiter)(this,void 0,void 0,function*(){return b(e,"POST",t,n,i,r)})}function _(e,t,r,n,i){return(0,o.__awaiter)(this,void 0,void 0,function*(){return b(e,"PUT",t,n,i,r)})}function E(e,t,r,n,i){return(0,o.__awaiter)(this,void 0,void 0,function*(){return b(e,"DELETE",t,n,i,r)})}class T{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t}then(e,t){return this.execute().then(e,t)}execute(){return(0,o.__awaiter)(this,void 0,void 0,function*(){try{return{data:(yield this.downloadFn()).body,error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(l(e))return{data:null,error:e};throw e}})}}class S{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[i]="BlobDownloadBuilder",this.promise=null}asStream(){return new T(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}execute(){return(0,o.__awaiter)(this,void 0,void 0,function*(){try{let e=yield this.downloadFn();return{data:yield e.blob(),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(l(e))return{data:null,error:e};throw e}})}}i=Symbol.toStringTag;var k=r(6434).Buffer;let A={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},P={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class O{constructor(e,t={},r,n){this.shouldThrowOnError=!1,this.url=e,this.headers=t,this.bucketId=r,this.fetch=h(n)}throwOnError(){return this.shouldThrowOnError=!0,this}uploadOrUpdate(e,t,r,n){return(0,o.__awaiter)(this,void 0,void 0,function*(){try{let i;let s=Object.assign(Object.assign({},P),n),o=Object.assign(Object.assign({},this.headers),"POST"===e&&{"x-upsert":String(s.upsert)}),a=s.metadata;"undefined"!=typeof Blob&&r instanceof Blob?((i=new FormData).append("cacheControl",s.cacheControl),a&&i.append("metadata",this.encodeMetadata(a)),i.append("",r)):"undefined"!=typeof FormData&&r instanceof FormData?((i=r).has("cacheControl")||i.append("cacheControl",s.cacheControl),a&&!i.has("metadata")&&i.append("metadata",this.encodeMetadata(a))):(i=r,o["cache-control"]=`max-age=${s.cacheControl}`,o["content-type"]=s.contentType,a&&(o["x-metadata"]=this.toBase64(this.encodeMetadata(a))),("undefined"!=typeof ReadableStream&&i instanceof ReadableStream||i&&"object"==typeof i&&"pipe"in i&&"function"==typeof i.pipe)&&!s.duplex&&(s.duplex="half")),(null==n?void 0:n.headers)&&(o=Object.assign(Object.assign({},o),n.headers));let l=this._removeEmptyFolders(t),u=this._getFinalPath(l),c=yield("PUT"==e?_:x)(this.fetch,`${this.url}/object/${u}`,i,Object.assign({headers:o},(null==s?void 0:s.duplex)?{duplex:s.duplex}:{}));return{data:{path:l,id:c.Id,fullPath:c.Key},error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(l(e))return{data:null,error:e};throw e}})}upload(e,t,r){return(0,o.__awaiter)(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,t,r)})}uploadToSignedUrl(e,t,r,n){return(0,o.__awaiter)(this,void 0,void 0,function*(){let i=this._removeEmptyFolders(e),s=this._getFinalPath(i),o=new URL(this.url+`/object/upload/sign/${s}`);o.searchParams.set("token",t);try{let e;let t=Object.assign({upsert:P.upsert},n),s=Object.assign(Object.assign({},this.headers),{"x-upsert":String(t.upsert)});"undefined"!=typeof Blob&&r instanceof Blob?((e=new FormData).append("cacheControl",t.cacheControl),e.append("",r)):"undefined"!=typeof FormData&&r instanceof FormData?(e=r).append("cacheControl",t.cacheControl):(e=r,s["cache-control"]=`max-age=${t.cacheControl}`,s["content-type"]=t.contentType);let a=yield _(this.fetch,o.toString(),e,{headers:s});return{data:{path:i,fullPath:a.Key},error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(l(e))return{data:null,error:e};throw e}})}createSignedUploadUrl(e,t){return(0,o.__awaiter)(this,void 0,void 0,function*(){try{let r=this._getFinalPath(e),n=Object.assign({},this.headers);(null==t?void 0:t.upsert)&&(n["x-upsert"]="true");let i=yield x(this.fetch,`${this.url}/object/upload/sign/${r}`,{},{headers:n}),s=new URL(this.url+i.url),o=s.searchParams.get("token");if(!o)throw new a("No token returned by API");return{data:{signedUrl:s.toString(),path:e,token:o},error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(l(e))return{data:null,error:e};throw e}})}update(e,t,r){return(0,o.__awaiter)(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,t,r)})}move(e,t,r){return(0,o.__awaiter)(this,void 0,void 0,function*(){try{return{data:yield x(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t,de
37stinationBucket:null==r?void 0:r.destinationBucket},{headers:this.headers}),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(l(e))return{data:null,error:e};throw e}})}copy(e,t,r){return(0,o.__awaiter)(this,void 0,void 0,function*(){try{return{data:{path:(yield x(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t,destinationBucket:null==r?void 0:r.destinationBucket},{headers:this.headers})).Key},error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(l(e))return{data:null,error:e};throw e}})}createSignedUrl(e,t,r){return(0,o.__awaiter)(this,void 0,void 0,function*(){try{let n=this._getFinalPath(e),i=yield x(this.fetch,`${this.url}/object/sign/${n}`,Object.assign({expiresIn:t},(null==r?void 0:r.transform)?{transform:r.transform}:{}),{headers:this.headers}),s=(null==r?void 0:r.download)?`&download=${!0===r.download?"":r.download}`:"";return{data:i={signedUrl:encodeURI(`${this.url}${i.signedURL}${s}`)},error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(l(e))return{data:null,error:e};throw e}})}createSignedUrls(e,t,r){return(0,o.__awaiter)(this,void 0,void 0,function*(){try{let n=yield x(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:t,paths:e},{headers:this.headers}),i=(null==r?void 0:r.download)?`&download=${!0===r.download?"":r.download}`:"";return{data:n.map(e=>Object.assign(Object.assign({},e),{signedUrl:e.signedURL?encodeURI(`${this.url}${e.signedURL}${i}`):null})),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(l(e))return{data:null,error:e};throw e}})}download(e,t){let r=void 0!==(null==t?void 0:t.transform)?"render/image/authenticated":"object",n=this.transformOptsToQueryString((null==t?void 0:t.transform)||{}),i=n?`?${n}`:"",s=this._getFinalPath(e);return new S(()=>w(this.fetch,`${this.url}/${r}/${s}${i}`,{headers:this.headers,noResolveJson:!0}),this.shouldThrowOnError)}info(e){return(0,o.__awaiter)(this,void 0,void 0,function*(){let t=this._getFinalPath(e);try{let e=yield w(this.fetch,`${this.url}/object/info/${t}`,{headers:this.headers});return{data:f(e),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(l(e))return{data:null,error:e};throw e}})}exists(e){return(0,o.__awaiter)(this,void 0,void 0,function*(){let t=this._getFinalPath(e);try{return yield function(e,t,r,n){return(0,o.__awaiter)(this,void 0,void 0,function*(){return b(e,"HEAD",t,Object.assign(Object.assign({},r),{noResolveJson:!0}),void 0)})}(this.fetch,`${this.url}/object/${t}`,{headers:this.headers}),{data:!0,error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(l(e)&&e instanceof c){let t=e.originalError;if([400,404].includes(null==t?void 0:t.status))return{data:!1,error:e}}throw e}})}getPublicUrl(e,t){let r=this._getFinalPath(e),n=[],i=(null==t?void 0:t.download)?`download=${!0===t.download?"":t.download}`:"";""!==i&&n.push(i);let s=void 0!==(null==t?void 0:t.transform),o=this.transformOptsToQueryString((null==t?void 0:t.transform)||{});""!==o&&n.push(o);let a=n.join("&");return""!==a&&(a=`?${a}`),{data:{publicUrl:encodeURI(`${this.url}/${s?"render/image":"object"}/public/${r}${a}`)}}}remove(e){return(0,o.__awaiter)(this,void 0,void 0,function*(){try{return{data:yield E(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(l(e))return{data:null,error:e};throw e}})}list(e,t,r){return(0,o.__awaiter)(this,void 0,void 0,function*(){try{let n=Object.assign(Object.assign(Object.assign({},A),t),{prefix:e||""});return{data:yield x(this.fetch,`${this.url}/object/list/${this.bucketId}`,n,{headers:this.headers},r),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(l(e))return{data:null,error:e};throw e}})}listV2(e,t){return(0,o.__awaiter)(this,void 0,void 0,function*(){try{let r=Object.assign({},e);return{data:yield x(this.fetch,`${this.url}/object/list-v2/${this.bucketId}`,r,{headers:this.headers},t),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(l(e))return{data:null,error:e};throw e}})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return void 0!==k?k.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){let t=[];return e.width&&t.push(`width=${e.width}`),e.height&&t.push(`height=${e.height}`),e.resize&&t.push(`resize=${e.resize}`),e.format&&t.push(`format=${e.format}`),e.quality&&t.push(`quality=${e.quality}`),t.join("&")}}let R="2.87.1",C={"X-Client-Info":`storage-js/${R}`};class j{constructor(e,t={},r,n){this.shouldThrowOnError=!1;let i=new URL(e);(null==n?void 0:n.useNewHostname)&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes("storage.supabase.")&&(i.hostname=i.hostname.replace("supabase.","storage.supabase.")),this.url=i.href.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},C),t),this.fetch=h(r)}throwOnError(){return this.shouldThrowOnError=!0,this}listBuckets(e){return(0,o.__awaiter)(this,void 0,void 0,function*(){try{let t=this.listBucketOptionsToQueryString(e);return{data:yield w(this.fetch,`${this.url}/bucket${t}`,{headers:this.headers}),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(l(e))return{data:null,error:e};throw e}})}getBucket(e){return(0,o.__awaiter)(this,void 0,void 0,function*(){try{return{data:yield w(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(l(e))return{data:null,error:e};throw e}})}createBucket(e){return(0,o.__awaiter)(this,arguments,void 0,function*(e,t={public:!1}){try{return{data:yield x(this.fetch,`${this.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:this.headers}),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(l(e))return{data:null,error:e};throw e}})}updateBucket(e,t){return(0,o.__awaiter)(this,void 0,void 0,function*(){try{return{data:yield _(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:this.headers}),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(l(e))return{data:null,error:e};throw e}})}emptyBucket(e){return(0,o.__awaiter)(this,void 0,void 0,function*(){try{return{data:yield x(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(l(e))return{data:null,error:e};throw e}})}deleteBucket(e){return(0,o.__awaiter)(this,void 0,void 0,function*(){try{return{data:yield E(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(l(e))return{data:null,error:e};throw e}})}listBucketOptionsToQueryString(e){let t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}}
37var I=class extends Error{constructor(e,t){super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown="CommitStateUnknownException"===t.icebergType||[500,502,504].includes(t.status)&&t.icebergType?.includes("CommitState")===!0}isNotFound(){return 404===this.status}isConflict(){return 409===this.status}isAuthenticationTimeout(){return 419===this.status}};async function D(e){return e&&"none"!==e.type?"bearer"===e.type?{Authorization:`Bearer ${e.token}`}:"header"===e.type?{[e.name]:e.value}:"custom"===e.type?await e.getHeaders():{}:{}}function N(e){return e.join("\x1f")}var M=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){let t=e?{parent:N(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(e=>({namespace:e}))}async createNamespace(e,t){let r={namespace:e.namespace,properties:t?.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${N(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${N(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${N(e.namespace)}`}),!0}catch(e){if(e instanceof I&&404===e.status)return!1;throw e}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(e){if(e instanceof I&&409===e.status)return;throw e}}};function L(e){return e.join("\x1f")}var $=class{constructor(e,t="",r){this.client=e,this.prefix=t,this.accessDelegation=r}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${L(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){let r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${L(e.namespace)}/tables`,body:t,headers:r})).data.metadata}async updateTable(e,t){let r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${L(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${L(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String(t?.purge??!1)}})}async loadTable(e){let t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${L(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){let t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${L(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(e){if(e instanceof I&&404===e.status)return!1;throw e}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(r){if(r instanceof I&&409===r.status)return await this.loadTable({namespace:e.namespace,name:t.name});throw r}}},U=class{constructor(e){let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);let r=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=function(e){let t=e.fetchImpl??globalThis.fetch;return{async request({method:r,path:n,query:i,body:s,headers:o}){let a=function(e,t,r){let n=new URL(t,e);if(r)for(let[e,t]of Object.entries(r))void 0!==t&&n.searchParams.set(e,t);return n.toString()}(e.baseUrl,n,i),l=await D(e.auth),u=await t(a,{method:r,headers:{...s?{"Content-Type":"application/json"}:{},...l,...o},body:s?JSON.stringify(s):void 0}),c=await u.text(),h=(u.headers.get("content-type")||"").includes("application/json"),d=h&&c?JSON.parse(c):c;if(!u.ok){let e=h?d:void 0,t=e?.error;throw new I(t?.message??`Request failed with status ${u.status}`,{status:u.status,icebergType:t?.type,icebergCode:t?.code,details:e})}return{status:u.status,headers:u.headers,data:d}}}}({baseUrl:r,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=e.accessDelegation?.join(","),this.namespaceOps=new M(this.client,t),this.tableOps=new $(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}
37async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}};class B{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},C),t),this.fetch=h(r)}throwOnError(){return this.shouldThrowOnError=!0,this}createBucket(e){return(0,o.__awaiter)(this,void 0,void 0,function*(){try{return{data:yield x(this.fetch,`${this.url}/bucket`,{name:e},{headers:this.headers}),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(l(e))return{data:null,error:e};throw e}})}listBuckets(e){return(0,o.__awaiter)(this,void 0,void 0,function*(){try{let t=new URLSearchParams;(null==e?void 0:e.limit)!==void 0&&t.set("limit",e.limit.toString()),(null==e?void 0:e.offset)!==void 0&&t.set("offset",e.offset.toString()),(null==e?void 0:e.sortColumn)&&t.set("sortColumn",e.sortColumn),(null==e?void 0:e.sortOrder)&&t.set("sortOrder",e.sortOrder),(null==e?void 0:e.search)&&t.set("search",e.search);let r=t.toString(),n=r?`${this.url}/bucket?${r}`:`${this.url}/bucket`;return{data:yield w(this.fetch,n,{headers:this.headers}),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(l(e))return{data:null,error:e};throw e}})}deleteBucket(e){return(0,o.__awaiter)(this,void 0,void 0,function*(){try{return{data:yield E(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(l(e))return{data:null,error:e};throw e}})}from(e){if(!m(e))throw new a("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");let t=new U({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:()=>(0,o.__awaiter)(this,void 0,void 0,function*(){return this.headers})},fetch:this.fetch}),r=this.shouldThrowOnError;return new Proxy(t,{get(e,t){let n=e[t];return"function"!=typeof n?n:(...t)=>(0,o.__awaiter)(this,void 0,void 0,function*(){try{return{data:yield n.apply(e,t),error:null}}catch(e){if(r)throw e;return{data:null,error:e}}})}})}}let F={"X-Client-Info":`storage-js/${R}`,"Content-Type":"application/json"};class V extends Error{constructor(e){super(e),this.__isStorageVectorsError=!0,this.name="StorageVectorsError"}}function q(e){return"object"==typeof e&&null!==e&&"__isStorageVectorsError"in e}class W extends V{constructor(e,t,r){super(e),this.name="StorageVectorsApiError",this.status=t,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class z extends V{constructor(e,t){super(e),this.name="StorageVectorsUnknownError",this.originalError=t}}(n=s||(s={})).InternalError="InternalError",n.S3VectorConflictException="S3VectorConflictException",n.S3VectorNotFoundException="S3VectorNotFoundException",n.S3VectorBucketNotEmpty="S3VectorBucketNotEmpty",n.S3VectorMaxBucketsExceeded="S3VectorMaxBucketsExceeded",n.S3VectorMaxIndexesExceeded="S3VectorMaxIndexesExceeded";let H=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),K=()=>Response,G=e=>{if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},J=e=>Array.from(new Float32Array(e)),Y=(e,t)=>{if(void 0!==t&&e.float32.length!==t)throw Error(`Vector dimension mismatch: expected ${t}, got ${e.float32.length}`)},X=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),Q=(e,t,r)=>(0,o.__awaiter)(void 0,void 0,void 0,function*(){if(!(e&&"object"==typeof e&&"status"in e&&"ok"in e&&"number"==typeof e.status)||(null==r?void 0:r.noResolveJson))t(new z(X(e),e));else{let r=e.status||500;"function"==typeof e.json?e.json().then(e=>{let n=(null==e?void 0:e.statusCode)||(null==e?void 0:e.code)||r+"";t(new W(X(e),r,n))}).catch(()=>{t(new W(e.statusText||`HTTP ${r} error`,r,r+""))}):t(new W(e.statusText||`HTTP ${r} error`,r,r+""))}}),Z=(e,t,r,n)=>{let i={method:e,headers:(null==t?void 0:t.headers)||{}};return"GET"!==e&&n?(G(n)?(i.headers=Object.assign({"Content-Type":"application/json"},null==t?void 0:t.headers),i.body=JSON.stringify(n)):i.body=n,Object.assign(Object.assign({},i),r)):i};function ee(e,t,r,n,i){return(0,o.__awaiter)(this,void 0,void 0,function*(){return function(e,t,r,n,i,s){return(0,o.__awaiter)(this,void 0,void 0,function*(){return new Promise((o,a)=>
37{e(r,Z(t,n,i,s)).then(e=>{if(!e.ok)throw e;if(null==n?void 0:n.noResolveJson)return e;let t=e.headers.get("content-type");return t&&t.includes("application/json")?e.json():{}}).then(e=>o(e)).catch(e=>Q(e,a,n))})})}(e,"POST",t,n,i,r)})}class et{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},F),t),this.fetch=H(r)}throwOnError(){return this.shouldThrowOnError=!0,this}createIndex(e){return(0,o.__awaiter)(this,void 0,void 0,function*(){try{return{data:(yield ee(this.fetch,`${this.url}/CreateIndex`,e,{headers:this.headers}))||{},error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(q(e))return{data:null,error:e};throw e}})}getIndex(e,t){return(0,o.__awaiter)(this,void 0,void 0,function*(){try{return{data:yield ee(this.fetch,`${this.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:this.headers}),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(q(e))return{data:null,error:e};throw e}})}listIndexes(e){return(0,o.__awaiter)(this,void 0,void 0,function*(){try{return{data:yield ee(this.fetch,`${this.url}/ListIndexes`,e,{headers:this.headers}),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(q(e))return{data:null,error:e};throw e}})}deleteIndex(e,t){return(0,o.__awaiter)(this,void 0,void 0,function*(){try{return{data:(yield ee(this.fetch,`${this.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:this.headers}))||{},error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(q(e))return{data:null,error:e};throw e}})}}class er{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},F),t),this.fetch=H(r)}throwOnError(){return this.shouldThrowOnError=!0,this}putVectors(e){return(0,o.__awaiter)(this,void 0,void 0,function*(){try{if(e.vectors.length<1||e.vectors.length>500)throw Error("Vector batch size must be between 1 and 500 items");return{data:(yield ee(this.fetch,`${this.url}/PutVectors`,e,{headers:this.headers}))||{},error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(q(e))return{data:null,error:e};throw e}})}getVectors(e){return(0,o.__awaiter)(this,void 0,void 0,function*(){try{return{data:yield ee(this.fetch,`${this.url}/GetVectors`,e,{headers:this.headers}),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(q(e))return{data:null,error:e};throw e}})}listVectors(e){return(0,o.__awaiter)(this,void 0,void 0,function*(){try{if(void 0!==e.segmentCount){if(e.segmentCount<1||e.segmentCount>16)throw Error("segmentCount must be between 1 and 16");if(void 0!==e.segmentIndex&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return{data:yield ee(this.fetch,`${this.url}/ListVectors`,e,{headers:this.headers}),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(q(e))return{data:null,error:e};throw e}})}queryVectors(e){return(0,o.__awaiter)(this,void 0,void 0,function*(){try{return{data:yield ee(this.fetch,`${this.url}/QueryVectors`,e,{headers:this.headers}),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(q(e))return{data:null,error:e};throw e}})}deleteVectors(e){return(0,o.__awaiter)(this,void 0,void 0,function*(){try{if(e.keys.length<1||e.keys.length>500)throw Error("Keys batch size must be between 1 and 500 items");return{data:(yield ee(this.fetch,`${this.url}/DeleteVectors`,e,{headers:this.headers}))||{},error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(q(e))return{data:null,error:e};throw e}})}}class en{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},F),t),this.fetch=H(r)}throwOnError(){return this.shouldThrowOnError=!0,this}createBucket(e){return(0,o.__awaiter)(this,void 0,void 0,function*(){try{return{data:(yield ee(this.fetch,`${this.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:this.headers}))||{},error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(q(e))return{data:null,error:e};throw e}})}getBucket(e){return(0,o.__awaiter)(this,void 0,void 0,function*(){try{return{data:yield ee(this.fetch,`${this.url}/GetVectorBucket`,{vectorBucketName:e},{headers:this.headers}),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(q(e))return{data:null,error:e};throw e}})}listBuckets(){return(0,o.__awaiter)(this,arguments,void 0,function*(e={}){try{return{data:yield ee(this.fetch,`${this.url}/ListVectorBuckets`,e,{headers:this.headers}),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(q(e))return{data:null,error:e};throw e}})}deleteBucket(e){return(0,o.__awaiter)(this,void 0,void 0,function*(){try{return{data:(yield ee(this.fetch,`${this.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:this.headers}))||{},error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(q(e))return{data:null,error:e};throw e}})}}class ei extends en{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new es(this.url,this.headers,e,this.fetch)}createBucket(e){let t=Object.create(null,{createBucket:{get:()=>super.createBucket}});return(0,o.__awaiter)(this,void 0,void 0,function*(){return t.createBucket.call(this,e)})}getBucket(e){let t=Object.create(null,{getBucket:{get:()=>super.getBucket}});return(0,o.__awaiter)(this,void 0,void 0,function*(){return t.getBucket.call(this,e)})}listBuckets(){let e=Object.create(null,{listBuckets:{get:()=>super.listBuckets}});return(0,o.__awaiter)(this,arguments,void 0,function*(t={}
37){return e.listBuckets.call(this,t)})}deleteBucket(e){let t=Object.create(null,{deleteBucket:{get:()=>super.deleteBucket}});return(0,o.__awaiter)(this,void 0,void 0,function*(){return t.deleteBucket.call(this,e)})}}class es extends et{constructor(e,t,r,n){super(e,t,n),this.vectorBucketName=r}createIndex(e){let t=Object.create(null,{createIndex:{get:()=>super.createIndex}});return(0,o.__awaiter)(this,void 0,void 0,function*(){return t.createIndex.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName}))})}listIndexes(){let e=Object.create(null,{listIndexes:{get:()=>super.listIndexes}});return(0,o.__awaiter)(this,arguments,void 0,function*(t={}){return e.listIndexes.call(this,Object.assign(Object.assign({},t),{vectorBucketName:this.vectorBucketName}))})}getIndex(e){let t=Object.create(null,{getIndex:{get:()=>super.getIndex}});return(0,o.__awaiter)(this,void 0,void 0,function*(){return t.getIndex.call(this,this.vectorBucketName,e)})}deleteIndex(e){let t=Object.create(null,{deleteIndex:{get:()=>super.deleteIndex}});return(0,o.__awaiter)(this,void 0,void 0,function*(){return t.deleteIndex.call(this,this.vectorBucketName,e)})}index(e){return new eo(this.url,this.headers,this.vectorBucketName,e,this.fetch)}}class eo extends er{constructor(e,t,r,n,i){super(e,t,i),this.vectorBucketName=r,this.indexName=n}putVectors(e){let t=Object.create(null,{putVectors:{get:()=>super.putVectors}});return(0,o.__awaiter)(this,void 0,void 0,function*(){return t.putVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}getVectors(e){let t=Object.create(null,{getVectors:{get:()=>super.getVectors}});return(0,o.__awaiter)(this,void 0,void 0,function*(){return t.getVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}listVectors(){let e=Object.create(null,{listVectors:{get:()=>super.listVectors}});return(0,o.__awaiter)(this,arguments,void 0,function*(t={}){return e.listVectors.call(this,Object.assign(Object.assign({},t),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}queryVectors(e){let t=Object.create(null,{queryVectors:{get:()=>super.queryVectors}});return(0,o.__awaiter)(this,void 0,void 0,function*(){return t.queryVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}deleteVectors(e){let t=Object.create(null,{deleteVectors:{get:()=>super.deleteVectors}});return(0,o.__awaiter)(this,void 0,void 0,function*(){return t.deleteVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}}class ea extends j{constructor(e,t={},r,n){super(e,t,r,n)}from(e){return new O(this.url,this.headers,e,this.fetch)}get vectors(){return new ei(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new B(this.url+"/iceberg",this.headers,this.fetch)}}},9751:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(629),i=r(9640),s=r(9287),o=r(3874),a=r(1600),l=r(2331),u=r(4422),c=r(686);class h{constructor(e,t,r){var n,s,c;this.supabaseUrl=e,this.supabaseKey=t;let h=(0,u.validateSupabaseUrl)(e);if(!t)throw Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",h),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",h),this.storageUrl=new URL("storage/v1",h),this.functionsUrl=new URL("functions/v1",h);let d=`sb-${h.hostname.split(".")[0]}-auth-token`,f={db:a.DEFAULT_DB_OPTIONS,realtime:a.DEFAULT_REALTIME_OPTIONS,auth:Object.assign(Object.assign({},a.DEFAULT_AUTH_OPTIONS),{storageKey:d}),global:a.DEFAULT_GLOBAL_OPTIONS},p=(0,u.applySettingDefaults)(null!=r?r:{},f);this.storageKey=null!==(n=p.auth.storageKey)&&void 0!==n?n:"",this.headers=null!==(s=p.global.headers)&&void 0!==s?s:{},p.accessToken?(this.accessToken=p.accessToken,this.auth=new Proxy({},{get:(e,t)=>{throw Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(t)} is not possible`)}})):this.auth=this._initSupabaseAuthClient(null!==(c=p.auth)&&void 0!==c?c:{},this.headers,p.global.fetch),this.fetch=(0,l.fetchWithAuth)(t,this._getAccessToken.bind(this),p.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},p.realtime)),this.accessToken&&this.accessToken().then(e=>this.realtime.setAuth(e)).catch(e=>console.warn("Failed to set initial Realtime auth token:",e)),this.rest=new i.PostgrestClient(new URL("rest/v1",h).href,{headers:this.headers,schema:p.db.schema,fetch:this.fetch}),this.storage=new o.StorageClient(this.storageUrl.href,this.headers,this.fetch,null==r?void 0:r.storage),p.accessToken||this._listenForAuthEvents()}get functions(){return new n.FunctionsClient(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,r)}
37channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e,t;if(this.accessToken)return await this.accessToken();let{data:r}=await this.auth.getSession();return null!==(t=null===(e=r.session)||void 0===e?void 0:e.access_token)&&void 0!==t?t:this.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:i,storageKey:s,flowType:o,lock:a,debug:l,throwOnError:u},h,d){let f={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new c.SupabaseAuthClient({url:this.authUrl.href,headers:Object.assign(Object.assign({},f),h),storageKey:s,autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:i,flowType:o,lock:a,debug:l,throwOnError:u,fetch:d,hasCustomAuthorizationHeader:Object.keys(this.headers).some(e=>"authorization"===e.toLowerCase())})}_initRealtimeClient(e){return new s.RealtimeClient(this.realtimeUrl.href,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},null==e?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",null==t?void 0:t.access_token)})}_handleTokenChanged(e,t,r){("TOKEN_REFRESHED"===e||"SIGNED_IN"===e)&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):"SIGNED_OUT"===e&&(this.realtime.setAuth(),"STORAGE"==t&&this.auth.signOut(),this.changedAccessToken=void 0)}}t.default=h},7487:function(e,t,r){"use strict";var n=r(257),i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createClient=t.SupabaseClient=t.FunctionRegion=t.FunctionsError=t.FunctionsRelayError=t.FunctionsFetchError=t.FunctionsHttpError=t.PostgrestError=void 0;let a=o(r(9751));s(r(269),t);var l=r(9640);Object.defineProperty(t,"PostgrestError",{enumerable:!0,get:function(){return l.PostgrestError}});var u=r(629);Object.defineProperty(t,"FunctionsHttpError",{enumerable:!0,get:function(){return u.FunctionsHttpError}}),Object.defineProperty(t,"FunctionsFetchError",{enumerable:!0,get:function(){return u.FunctionsFetchError}}),Object.defineProperty(t,"FunctionsRelayError",{enumerable:!0,get:function(){return u.FunctionsRelayError}}),Object.defineProperty(t,"FunctionsError",{enumerable:!0,get:function(){return u.FunctionsError}}),Object.defineProperty(t,"FunctionRegion",{enumerable:!0,get:function(){return u.FunctionRegion}}),s(r(9287),t);var c=r(9751);Object.defineProperty(t,"SupabaseClient",{enumerable:!0,get:function(){return o(c).default}}),t.createClient=(e,t,r)=>new a.default(e,t,r),function(){if("undefined"!=typeof window||void 0===n)return!1;let e=n.version;if(null==e)return!1;let t=e.match(/^v(\d+)\./);return!!t&&18>=parseInt(t[1],10)}()&&console.warn(`â ï¸ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217`)},686:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SupabaseAuthClient=void 0;let n=r(269);class i extends n.AuthClient{constructor(e){super(e)}}t.SupabaseAuthClient=i},1600:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_REALTIME_OPTIONS=t.DEFAULT_AUTH_OPTIONS=t.DEFAULT_DB_OPTIONS=t.DEFAULT_GLOBAL_OPTIONS=t.DEFAULT_HEADERS=void 0;let n=r(5130),i="";"undefined"!=typeof Deno?i="deno":"undefined"!=typeof document?i="web":"undefined"!=typeof navigator&&"ReactNative"===navigator.product?i="react-native":i="node",t.DEFAULT_HEADERS={"X-Client-Info":`supabase-js-${i}/${n.version}`},t.DEFAULT_GLOBAL_OPTIONS={headers:t.DEFAULT_HEADERS},t.DEFAULT_DB_OPTIONS={schema:"public"},t.DEFAULT_AUTH_OPTIONS={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},t.DEFAULT_REALTIME_OPTIONS={}},2331:function(e,t){"use strict";
37Object.defineProperty(t,"__esModule",{value:!0}),t.fetchWithAuth=t.resolveHeadersConstructor=t.resolveFetch=void 0,t.resolveFetch=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),t.resolveHeadersConstructor=()=>Headers,t.fetchWithAuth=(e,r,n)=>{let i=(0,t.resolveFetch)(n),s=(0,t.resolveHeadersConstructor)();return async(t,n)=>{var o;let a=null!==(o=await r())&&void 0!==o?o:e,l=new s(null==n?void 0:n.headers);return l.has("apikey")||l.set("apikey",e),l.has("Authorization")||l.set("Authorization",`Bearer ${a}`),i(t,Object.assign(Object.assign({},n),{headers:l}))}}},4422:function(e,t){"use strict";function r(e){return e.endsWith("/")?e:e+"/"}Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowser=void 0,t.uuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})},t.ensureTrailingSlash=r,t.applySettingDefaults=function(e,t){var r,n;let{db:i,auth:s,realtime:o,global:a}=e,{db:l,auth:u,realtime:c,global:h}=t,d={db:Object.assign(Object.assign({},l),i),auth:Object.assign(Object.assign({},u),s),realtime:Object.assign(Object.assign({},c),o),storage:{},global:Object.assign(Object.assign(Object.assign({},h),a),{headers:Object.assign(Object.assign({},null!==(r=null==h?void 0:h.headers)&&void 0!==r?r:{}),null!==(n=null==a?void 0:a.headers)&&void 0!==n?n:{})}),accessToken:async()=>""};return e.accessToken?d.accessToken=e.accessToken:delete d.accessToken,d},t.validateSupabaseUrl=function(e){let t=null==e?void 0:e.trim();if(!t)throw Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(r(t))}catch(e){throw Error("Invalid supabaseUrl: Provided URL is malformed.")}},t.isBrowser=()=>"undefined"!=typeof window},5130:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.version=void 0,t.version="2.87.1"},1607:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});var n=r(2265);let i=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),s=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim()};var o={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let a=(0,n.forwardRef)((e,t)=>{let{color:r="currentColor",size:i=24,strokeWidth:a=2,absoluteStrokeWidth:l,className:u="",children:c,iconNode:h,...d}=e;return(0,n.createElement)("svg",{ref:t,...o,width:i,height:i,stroke:r,strokeWidth:l?24*Number(a)/Number(i):a,className:s("lucide",u),...d},[...h.map(e=>{let[t,r]=e;return(0,n.createElement)(t,r)}),...Array.isArray(c)?c:[c]])}),l=((e,t)=>{let r=(0,n.forwardRef)((r,o)=>{let{className:l,...u}=r;return(0,n.createElement)(a,{ref:o,iconNode:t,className:s("lucide-".concat(i(e)),l),...u})});return r.displayName="".concat(e),r})("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},257:function(e,t,r){"use strict";var n,i;e.exports=(null==(n=r.g.process)?void 0:n.env)&&"object"==typeof(null==(i=r.g.process)?void 0:i.env)?r.g.process:r(4227)},6434:function(e){!function(){var t={675:function(e,t){"use strict";t.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return(r+n)*3/4-n},t.toByteArray=function(e){var t,r,s=l(e),o=s[0],a=s[1],u=new i((o+a)*3/4-a),c=0,h=a>0?o-4:o;for(r=0;r<h;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===a&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[c++]=255&t),1===a&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,s=[],o=0,a=n-i;o<a;o+=16383)s.push(function(e,t,n){for(var i,s=[],o=t;o<n;o+=3)s.push(r[(i=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]))>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return s.join("")}(e,o,o+16383>a?a:o+16383));return 1===i?s.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&s.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),s.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
37+/",o=0,a=s.length;o<a;++o)r[o]=s[o],n[s.charCodeAt(o)]=o;function l(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},72:function(e,t,r){"use strict";var n=r(675),i=r(783),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function o(e){if(e>2147483647)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,a.prototype),t}function a(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return c(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!a.isEncoding(t))throw TypeError("Unknown encoding: "+t);var r=0|f(e,t),n=o(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return h(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(O(e,ArrayBuffer)||e&&O(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(O(e,SharedArrayBuffer)||e&&O(e.buffer,SharedArrayBuffer)))return function(e,t,r){var n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),a.prototype),n}(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return a.from(n,t,r);var i=function(e){if(a.isBuffer(e)){var t,r=0|d(e.length),n=o(r);return 0===n.length||e.copy(n,0,0,r),n}return void 0!==e.length?"number"!=typeof e.length||(t=e.length)!=t?o(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return a.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return u(e),o(e<0?0:0|d(e))}function h(e){for(var t=e.length<0?0:0|d(e.length),r=o(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e){if(e>=2147483647)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function f(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||O(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return S(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return A(e).length;default:if(i)return n?-1:S(e).length;t=(""+t).toLowerCase(),i=!0}}function p(e,t,r){var i,s,o=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",s=t;s<r;++s)i+=R[e[s]];return i}(this,t,r);case"utf8":case"utf-8":return v(this,t,r);case"ascii":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}(this,t,r);case"latin1":case"binary":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}(this,t,r);case"base64":return i=t,s=r,0===i&&s===this.length?n.fromByteArray(this):n.fromByteArray(this.slice(i,s));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){for(var n=e.slice(t,r),i="",s=0;s<n.length;s+=2)i+=String.fromCharCode(n[s]+256*n[s+1]);return i}(this,t,r);default:if(o)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}function m(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,i){var s;if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),(s=r=+r)!=s&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return -1;r=e.length-1}
37else if(r<0){if(!i)return -1;r=0}if("string"==typeof t&&(t=a.from(t,n)),a.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,i);if("number"==typeof t)return(t&=255,"function"==typeof Uint8Array.prototype.indexOf)?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,n,i);throw TypeError("val must be string, number or Buffer")}function y(e,t,r,n,i){var s,o=1,a=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;o=2,a/=2,l/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var c=-1;for(s=r;s<a;s++)if(u(e,s)===u(t,-1===c?0:s-c)){if(-1===c&&(c=s),s-c+1===l)return c*o}else -1!==c&&(s-=s-c),c=-1}else for(r+l>a&&(r=a-l),s=r;s>=0;s--){for(var h=!0,d=0;d<l;d++)if(u(e,s+d)!==u(t,d)){h=!1;break}if(h)return s}return -1}function v(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var s,o,a,l,u=e[i],c=null,h=u>239?4:u>223?3:u>191?2:1;if(i+h<=r)switch(h){case 1:u<128&&(c=u);break;case 2:(192&(s=e[i+1]))==128&&(l=(31&u)<<6|63&s)>127&&(c=l);break;case 3:s=e[i+1],o=e[i+2],(192&s)==128&&(192&o)==128&&(l=(15&u)<<12|(63&s)<<6|63&o)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:s=e[i+1],o=e[i+2],a=e[i+3],(192&s)==128&&(192&o)==128&&(192&a)==128&&(l=(15&u)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&l<1114112&&(c=l)}null===c?(c=65533,h=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=h}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}(n)}function b(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function w(e,t,r,n,i,s){if(!a.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function x(e,t,r,n,i,s){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function _(e,t,r,n,s){return t=+t,r>>>=0,s||x(e,t,r,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,r,n,23,4),r+4}function E(e,t,r,n,s){return t=+t,r>>>=0,s||x(e,t,r,8,17976931348623157e292,-17976931348623157e292),i.write(e,t,r,n,52,8),r+8}t.Buffer=a,t.SlowBuffer=function(e){return+e!=e&&(e=0),a.alloc(+e)},t.INSPECT_MAX_BYTES=50,t.kMaxLength=2147483647,a.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),a.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(e,t,r){return(u(e),e<=0)?o(e):void 0!==t?"string"==typeof r?o(e).fill(t,r):o(e).fill(t):o(e)},a.allocUnsafe=function(e){return c(e)},a.allocUnsafeSlow=function(e){return c(e)},a.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==a.prototype},a.compare=function(e,t){if(O(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),O(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,i=0,s=Math.min(r,n);i<s;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);if(void 0===t)for(r=0,t=0;r<e.length;++r)t+=e[r].length;var r,n=a.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var s=e[r];
vendor: 9,778 bytes, line 37
37if(O(s,Uint8Array)&&(s=a.from(s)),!a.isBuffer(s))throw TypeError('"list" argument must be an Array of Buffers');s.copy(n,i),i+=s.length}return n},a.byteLength=f,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},a.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},a.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},a.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?v(this,0,e):p.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(e){if(!a.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===a.compare(this,e)},a.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},s&&(a.prototype[s]=a.prototype.inspect),a.prototype.compare=function(e,t,r,n,i){if(O(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var s=i-n,o=r-t,l=Math.min(s,o),u=this.slice(n,i),c=e.slice(t,r),h=0;h<l;++h)if(u[h]!==c[h]){s=u[h],o=c[h];break}return s<o?-1:o<s?1:0},a.prototype.includes=function(e,t,r){return -1!==this.indexOf(e,t,r)},a.prototype.indexOf=function(e,t,r){return g(this,e,t,r,!0)},a.prototype.lastIndexOf=function(e,t,r){return g(this,e,t,r,!1)},a.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i,s,o,a,l,u,c,h,d,f,p,m,g=this.length-t;if((void 0===r||r>g)&&(r=g),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var y=!1;;)switch(n){case"hex":return function(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var s=t.length;n>s/2&&(n=s/2);for(var o=0;o<n;++o){var a=parseInt(t.substr(2*o,2),16);if(a!=a)break;e[r+o]=a}return o}(this,e,t,r);case"utf8":case"utf-8":return l=t,u=r,P(S(e,this.length-l),this,l,u);case"ascii":return c=t,h=r,P(k(e),this,c,h);case"latin1":case"binary":return i=this,s=e,o=t,a=r,P(k(s),i,o,a);case"base64":return d=t,f=r,P(A(e),this,d,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return p=t,m=r,P(function(e,t){for(var r,n,i=[],s=0;s<e.length&&!((t-=2)<0);++s)n=(r=e.charCodeAt(s))>>8,i.push(r%256),i.push(n);return i}(e,this.length-p),this,p,m);default:if(y)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),y=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},a.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,a.prototype),n},a.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);for(var n=this[e],i=1,s=0;++s<t&&(i*=256);)n+=this[e+s]*i;return n},a.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},a.prototype.readUInt8=function(e,t){return e>>>=0,t||b(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||b(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||b(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||b(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||b(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);for(var n=this[e],i=1,s=0;++s<t&&(i*=256);)n+=this[e+s]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},a.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);for(var n=t,i=1,s=this[e+--n];n>0&&(i*=256);)s+=this[e+--n]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*t)),s},a.prototype.readInt8=function(e,t){return(e>>>=0,t||b(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||b(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(e,t){e>>>=0,t||b(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||b(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||b(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return e>>>=0,t||b(e,4,this.length),i.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||b(e,4,this.length),i.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||b(e,8,this.length),i.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||b(e,8,this.length),i.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;w(this,e,t,r,i,0)}var s=1,o=0;for(this[t]=255&e;++o<r&&(s*=256);)this[t+o]=e/s&255;return t+r},a.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;w(this,e,t,r,i,0)}var s=r-1,o=1;for(this[t+s]=255&e;--s>=0&&(o*=256);)this[t+s]=e/o&255;return t+r},a.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);w(this,e,t,r,i-1,-i)}var s=0,o=1,a=0;for(this[t]=255&e;++s<r&&(o*=256);)e<0&&0===a&&0!==this[t+s-1]&&(a=1),this[t+s]=(e/o>>0)-a&255;return t+r},a.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);w(this,e,t,r,i-1,-i)}var s=r-1,o=1,a=0;for(this[t+s]=255&e;--s>=0&&(o*=256);)e<0&&0===a&&0!==this[t+s+1]&&(a=1),this[t+s]=(e/o>>0)-a&255;return t+r},a.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeFloatLE=function(e,t,r){return _(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return _(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){return E(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return E(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,n){if(!a.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,n);else if(this===e&&r<t&&t<n)for(var s=i-1;s>=0;--s)e[s+t]=this[s+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return i},a.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){var i,s=e.charCodeAt(0);("utf8"===n&&s<128||"latin1"===n)&&(e=s)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var o=a.isBuffer(e)?e:a.from(e,n),l=o.length;
37if(0===l)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%l]}return this};var T=/[^+/0-9A-Za-z-_]/g;function S(e,t){t=t||1/0;for(var r,n=e.length,i=null,s=[],o=0;o<n;++o){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){if(r>56319||o+1===n){(t-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return s}function k(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function A(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(T,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function P(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length)&&!(i>=e.length);++i)t[i+r]=e[i];return i}function O(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var R=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()},783:function(e,t){t.read=function(e,t,r,n,i){var s,o,a=8*i-n-1,l=(1<<a)-1,u=l>>1,c=-7,h=r?i-1:0,d=r?-1:1,f=e[t+h];for(h+=d,s=f&(1<<-c)-1,f>>=-c,c+=a;c>0;s=256*s+e[t+h],h+=d,c-=8);for(o=s&(1<<-c)-1,s>>=-c,c+=n;c>0;o=256*o+e[t+h],h+=d,c-=8);if(0===s)s=1-u;else{if(s===l)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),s-=u}return(f?-1:1)*o*Math.pow(2,s-n)},t.write=function(e,t,r,n,i,s){var o,a,l,u=8*s-i-1,c=(1<<u)-1,h=c>>1,d=23===i?5960464477539062e-23:0,f=n?0:s-1,p=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(isNaN(t=Math.abs(t))||t===1/0?(a=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+h>=1?t+=d/l:t+=d*Math.pow(2,1-h),t*l>=2&&(o++,l/=2),o+h>=c?(a=0,o=c):o+h>=1?(a=(t*l-1)*Math.pow(2,i),o+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;e[r+f]=255&a,f+=p,a/=256,i-=8);for(o=o<<i|a,u+=i;u>0;e[r+f]=255&o,f+=p,o/=256,u-=8);e[r+f-p]|=128*m}}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var s=r[e]={exports:{}},o=!0;try{t[e](s,s.exports,n),o=!1}finally{o&&delete r[e]}return s.exports}n.ab="//";var i=n(72);e.exports=i}()},4227:function(e){!function(){var t={229:function(e){var t,r,n,i=e.exports={};function s(){throw Error("setTimeout has not been defined")}function o(){throw Error("clearTimeout has not been defined")}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)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:s}catch(e){t=s}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var l=[],u=!1,c=-1;function h(){u&&n&&(u=!1,n.length?l=n.concat(l):c=-1,l.length&&d())}function d(){if(!u){var e=a(h);u=!0;for(var t=l.length;t;){for(n=l,l=[];++c<t;)n&&n[c].run();c=-1,t=l.length}n=null,u=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!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 f(e,t){this.fun=e,this.array=t}function p(){}i.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];l.push(new f(e,t)),1!==l.length||u||a(d)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(e){return[]},i.binding=function(e){throw Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw Error("process.chdir is not supported")},i.umask=function(){return 0}}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var s=r[e]={exports:{}},o=!0;try{t[e](s,s.exports,n),o=!1}finally{o&&delete r[e]}return s.exports}n.ab="//";var i=n(229);e.exports=i}()},8784:function(e,t,r){"use strict";r.d(t,{s0:function(){return g}});var n,i,s,o,a=r(2265),l=r(5983);function u(){return(u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];
37for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}let c=a.createContext(null),h=a.createContext(null),d=a.createContext(null),f=a.createContext({outlet:null,matches:[],isDataRoute:!1});function p(){return null!=a.useContext(d)}function m(e){a.useContext(h).static||a.useLayoutEffect(e)}function g(){let{isDataRoute:e}=a.useContext(f);return e?function(){var e;let t,r,n,i;let{router:s}=(y.UseNavigateStable,(t=a.useContext(c))||(0,l.J0)(!1),t),o=(e=v.UseNavigateStable,(i=(n=((r=a.useContext(f))||(0,l.J0)(!1),r)).matches[n.matches.length-1]).route.id||(0,l.J0)(!1),i.route.id),h=a.useRef(!1);return m(()=>{h.current=!0}),a.useCallback(function(e,t){void 0===t&&(t={}),h.current&&("number"==typeof e?s.navigate(e):s.navigate(e,u({fromRouteId:o},t)))},[s,o])}():function(){p()||(0,l.J0)(!1);let e=a.useContext(c),{basename:t,future:r,navigator:n}=a.useContext(h),{matches:i}=a.useContext(f),{pathname:s}=(p()||(0,l.J0)(!1),a.useContext(d).location),o=JSON.stringify((0,l.cm)(i,r.v7_relativeSplatPath)),u=a.useRef(!1);return m(()=>{u.current=!0}),a.useCallback(function(r,i){if(void 0===i&&(i={}),!u.current)return;if("number"==typeof r){n.go(r);return}let a=(0,l.pC)(r,JSON.parse(o),s,"path"===i.relative);null==e&&"/"!==t&&(a.pathname="/"===a.pathname?t:(0,l.RQ)([t,a.pathname])),(i.replace?n.replace:n.push)(a,i.state,i)},[t,n,o,s,e])}()}var y=((n=y||{}).UseBlocker="useBlocker",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n),v=((i=v||{}).UseBlocker="useBlocker",i.UseLoaderData="useLoaderData",i.UseActionData="useActionData",i.UseRouteError="useRouteError",i.UseNavigation="useNavigation",i.UseRouteLoaderData="useRouteLoaderData",i.UseMatches="useMatches",i.UseRevalidator="useRevalidator",i.UseNavigateStable="useNavigate",i.UseRouteId="useRouteId",i);(o||(o=r.t(a,2))).startTransition;var b=((s=b||{})[s.pending=0]="pending",s[s.success=1]="success",s[s.error=2]="error",s);new Promise(()=>{})},4264:function(e,t){"use strict";var r=Symbol.for("react.element"),n=(Symbol.for("react.portal"),Symbol.for("react.fragment"),Symbol.for("react.strict_mode"),Symbol.for("react.profiler"),Symbol.for("react.provider"),Symbol.for("react.context"),Symbol.for("react.forward_ref"),Symbol.for("react.suspense"),Symbol.for("react.memo"),Symbol.for("react.lazy"),{isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}}),i=Object.assign,s={};function o(e,t,r){this.props=e,this.context=t,this.refs=s,this.updater=r||n}function a(){}function l(e,t,r){this.props=e,this.context=t,this.refs=s,this.updater=r||n}o.prototype.isReactComponent={},o.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},o.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},a.prototype=o.prototype;var u=l.prototype=new a;u.constructor=l,i(u,o.prototype),u.isPureReactComponent=!0;var c=Object.prototype.hasOwnProperty,h={key:!0,ref:!0,__self:!0,__source:!0};t.createElement=function(e,t,n){var i,s={},o=null,a=null;if(null!=t)for(i in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(o=""+t.key),t)c.call(t,i)&&!h.hasOwnProperty(i)&&(s[i]=t[i]);var l=arguments.length-2;if(1===l)s.children=n;else if(1<l){for(var u=Array(l),d=0;d<l;d++)u[d]=arguments[d+2];s.children=u}if(e&&e.defaultProps)for(i in l=e.defaultProps)void 0===s[i]&&(s[i]=l[i]);return{$$typeof:r,type:e,key:o,ref:a,props:s,_owner:null}}},4746:function(e,t,r){"use strict";e.exports=r(4264)},6741:function(e,t,r){"use strict";function n(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}r.d(t,{M:function(){return n}})},8575:function(e,t,r){"use strict";r.d(t,{F:function(){return s},e:function(){return o}});var n=r(2265);function i(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function s(...e){return t=>{let r=!1,n=e.map(e=>{let n=i(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){let r=n[t];"function"==typeof r?r():i(e[t],null)}}}}function o(...e){return n.useCallback(s(...e),e)}},3966:function(e,t,r){"use strict";r.d(t,{b:function(){return s}});var n=r(2265),i=r(7437);function s(e,t=[]){let r=[],s=()=>{let t=r.map(e=>n.createContext(e));return function(r){let i=r?.[e]||t;return n.useMemo(()=>({[`__scope${e}`]:{...r,[e]:i}}),[r,i])}};return s.scopeName=e,[function(t,s){let o=n.createContext(s),a=r.length;r=[...r,s];let l=t=>{let{scope:r,children:s,...l}=t,u=r?.[e]?.[a]||o,c=n.useMemo(()=>l,Object.values(l));return(0,i.jsx)(u.Provider,{value:c,children:s})};return l.displayName=t+"Provider",[l,function(r,i){let l=i?.[e]?.[a]||o,u=n.useContext(l);if(u)return u;if(void 0!==s)return s;throw Error(`\`${r}\` must be used within \`${t}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let r=()=>{let r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let i=r.reduce((t,{useScope:r,scopeName:n})=>{let i=r(e)[`__scope${n}`];return{...t,...i}},{});return n.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}(s,...t)]}},5278:function(e,t,r){"use strict";r.d(t,{I0:function(){return y},XB:function(){return d},fC:function(){return g}});var n,i=r(2265),s=r(6741),o=r(6840),a=r(8575),l=r(6606),u=r(7437),c="dismissableLayer.update",h=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),d=i.forwardRef((e,t)=>
37{var r,d;let{disableOutsidePointerEvents:f=!1,onEscapeKeyDown:g,onPointerDownOutside:y,onFocusOutside:v,onInteractOutside:b,onDismiss:w,...x}=e,_=i.useContext(h),[E,T]=i.useState(null),S=null!==(d=null==E?void 0:E.ownerDocument)&&void 0!==d?d:null===(r=globalThis)||void 0===r?void 0:r.document,[,k]=i.useState({}),A=(0,a.e)(t,e=>T(e)),P=Array.from(_.layers),[O]=[..._.layersWithOutsidePointerEventsDisabled].slice(-1),R=P.indexOf(O),C=E?P.indexOf(E):-1,j=_.layersWithOutsidePointerEventsDisabled.size>0,I=C>=R,D=function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null===(t=globalThis)||void 0===t?void 0:t.document,n=(0,l.W)(e),s=i.useRef(!1),o=i.useRef(()=>{});return i.useEffect(()=>{let e=e=>{if(e.target&&!s.current){let t=function(){m("dismissableLayer.pointerDownOutside",n,i,{discrete:!0})},i={originalEvent:e};"touch"===e.pointerType?(r.removeEventListener("click",o.current),o.current=t,r.addEventListener("click",o.current,{once:!0})):t()}else r.removeEventListener("click",o.current);s.current=!1},t=window.setTimeout(()=>{r.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(t),r.removeEventListener("pointerdown",e),r.removeEventListener("click",o.current)}},[r,n]),{onPointerDownCapture:()=>s.current=!0}}(e=>{let t=e.target,r=[..._.branches].some(e=>e.contains(t));!I||r||(null==y||y(e),null==b||b(e),e.defaultPrevented||null==w||w())},S),N=function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null===(t=globalThis)||void 0===t?void 0:t.document,n=(0,l.W)(e),s=i.useRef(!1);return i.useEffect(()=>{let e=e=>{e.target&&!s.current&&m("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})};return r.addEventListener("focusin",e),()=>r.removeEventListener("focusin",e)},[r,n]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}(e=>{let t=e.target;[..._.branches].some(e=>e.contains(t))||(null==v||v(e),null==b||b(e),e.defaultPrevented||null==w||w())},S);return!function(e,t=globalThis?.document){let r=(0,l.W)(e);i.useEffect(()=>{let e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[r,t])}(e=>{C!==_.layers.size-1||(null==g||g(e),!e.defaultPrevented&&w&&(e.preventDefault(),w()))},S),i.useEffect(()=>{if(E)return f&&(0===_.layersWithOutsidePointerEventsDisabled.size&&(n=S.body.style.pointerEvents,S.body.style.pointerEvents="none"),_.layersWithOutsidePointerEventsDisabled.add(E)),_.layers.add(E),p(),()=>{f&&1===_.layersWithOutsidePointerEventsDisabled.size&&(S.body.style.pointerEvents=n)}},[E,S,f,_]),i.useEffect(()=>()=>{E&&(_.layers.delete(E),_.layersWithOutsidePointerEventsDisabled.delete(E),p())},[E,_]),i.useEffect(()=>{let e=()=>k({});return document.addEventListener(c,e),()=>document.removeEventListener(c,e)},[]),(0,u.jsx)(o.WV.div,{...x,ref:A,style:{pointerEvents:j?I?"auto":"none":void 0,...e.style},onFocusCapture:(0,s.M)(e.onFocusCapture,N.onFocusCapture),onBlurCapture:(0,s.M)(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:(0,s.M)(e.onPointerDownCapture,D.onPointerDownCapture)})});d.displayName="DismissableLayer";var f=i.forwardRef((e,t)=>{let r=i.useContext(h),n=i.useRef(null),s=(0,a.e)(t,n);return i.useEffect(()=>{let e=n.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),(0,u.jsx)(o.WV.div,{...e,ref:s})});function p(){let e=new CustomEvent(c);document.dispatchEvent(e)}function m(e,t,r,n){let{discrete:i}=n,s=r.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),i?(0,o.jH)(s,a):s.dispatchEvent(a)}f.displayName="DismissableLayerBranch";var g=d,y=f},3832:function(e,t,r){"use strict";r.d(t,{h:function(){return l}});var n=r(2265),i=r(4887),s=r(6840),o=r(1188),a=r(7437),l=n.forwardRef((e,t)=>{var r,l;let{container:u,...c}=e,[h,d]=n.useState(!1);(0,o.b)(()=>d(!0),[]);let f=u||h&&(null===(l=globalThis)||void 0===l?void 0:null===(r=l.document)||void 0===r?void 0:r.body);return f?i.createPortal((0,a.jsx)(s.WV.div,{...c,ref:t}),f):null});l.displayName="Portal"},1599:function(e,t,r){"use strict";r.d(t,{z:function(){return o}});var n=r(2265),i=r(8575),s=r(1188),o=e=>{var t,r;let o,l;let{present:u,children:c}=e,h=function(e){var t,r;let[i,o]=n.useState(),l=n.useRef(null),u=n.useRef(e),c=n.useRef("none"),[h,d]=(t=e?"mounted":"unmounted",r={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},n.useReducer((e,t)=>
37{let n=r[e][t];return null!=n?n:e},t));return n.useEffect(()=>{let e=a(l.current);c.current="mounted"===h?e:"none"},[h]),(0,s.b)(()=>{let t=l.current,r=u.current;if(r!==e){let n=c.current,i=a(t);e?d("MOUNT"):"none"===i||(null==t?void 0:t.display)==="none"?d("UNMOUNT"):r&&n!==i?d("ANIMATION_OUT"):d("UNMOUNT"),u.current=e}},[e,d]),(0,s.b)(()=>{if(i){var e;let t;let r=null!==(e=i.ownerDocument.defaultView)&&void 0!==e?e:window,n=e=>{let n=a(l.current).includes(e.animationName);if(e.target===i&&n&&(d("ANIMATION_END"),!u.current)){let e=i.style.animationFillMode;i.style.animationFillMode="forwards",t=r.setTimeout(()=>{"forwards"===i.style.animationFillMode&&(i.style.animationFillMode=e)})}},s=e=>{e.target===i&&(c.current=a(l.current))};return i.addEventListener("animationstart",s),i.addEventListener("animationcancel",n),i.addEventListener("animationend",n),()=>{r.clearTimeout(t),i.removeEventListener("animationstart",s),i.removeEventListener("animationcancel",n),i.removeEventListener("animationend",n)}}d("ANIMATION_END")},[i,d]),{isPresent:["mounted","unmountSuspended"].includes(h),ref:n.useCallback(e=>{l.current=e?getComputedStyle(e):null,o(e)},[])}}(u),d="function"==typeof c?c({present:h.isPresent}):n.Children.only(c),f=(0,i.e)(h.ref,(o=null===(t=Object.getOwnPropertyDescriptor(d.props,"ref"))||void 0===t?void 0:t.get)&&"isReactWarning"in o&&o.isReactWarning?d.ref:(o=null===(r=Object.getOwnPropertyDescriptor(d,"ref"))||void 0===r?void 0:r.get)&&"isReactWarning"in o&&o.isReactWarning?d.props.ref:d.props.ref||d.ref);return"function"==typeof c||h.isPresent?n.cloneElement(d,{ref:f}):null};function a(e){return(null==e?void 0:e.animationName)||"none"}o.displayName="Presence"},6840:function(e,t,r){"use strict";r.d(t,{WV:function(){return a},jH:function(){return l}});var n=r(2265),i=r(4887),s=r(7495),o=r(7437),a=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=(0,s.Z8)(`Primitive.${t}`),i=n.forwardRef((e,n)=>{let{asChild:i,...s}=e,a=i?r:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,o.jsx)(a,{...s,ref:n})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function l(e,t){e&&i.flushSync(()=>e.dispatchEvent(t))}},7495:function(e,t,r){"use strict";r.d(t,{Z8:function(){return o},sA:function(){return l}});var n=r(2265),i=r(8575),s=r(7437);function o(e){let t=function(e){let t=n.forwardRef((e,t)=>{let{children:r,...s}=e;if(n.isValidElement(r)){let e,o;let a=(e=Object.getOwnPropertyDescriptor(r.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning?r.ref:(e=Object.getOwnPropertyDescriptor(r,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning?r.props.ref:r.props.ref||r.ref,l=function(e,t){let r={...t};for(let n in t){let i=e[n],s=t[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...e)=>{let t=s(...e);return i(...e),t}:i&&(r[n]=i):"style"===n?r[n]={...i,...s}:"className"===n&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...e,...r}}(s,r.props);return r.type!==n.Fragment&&(l.ref=t?(0,i.F)(t,a):a),n.cloneElement(r,l)}return n.Children.count(r)>1?n.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}(e),r=n.forwardRef((e,r)=>{let{children:i,...o}=e,a=n.Children.toArray(i),l=a.find(u);if(l){let e=l.props.children,i=a.map(t=>t!==l?t:n.Children.count(e)>1?n.Children.only(null):n.isValidElement(e)?e.props.children:null);return(0,s.jsx)(t,{...o,ref:r,children:n.isValidElement(e)?n.cloneElement(e,void 0,i):null})}return(0,s.jsx)(t,{...o,ref:r,children:i})});return r.displayName=`${e}.Slot`,r}var a=Symbol("radix.slottable");function l(e){let t=({children:e})=>(0,s.jsx)(s.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=a,t}function u(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===a}},3374:function(e,t,r){"use strict";r.d(t,{aU:function(){return et},x8:function(){return er},dk:function(){return ee},zt:function(){return Y},fC:function(){return Q},Dx:function(){return Z},l_:function(){return X}});var n=r(2265),i=r(4887),s=r(6741),o=r(8575),a=r(3966),l=r(7495),u=r(7437),c=r(5278),h=r(3832),d=r
37(1599),f=r(6840),p=r(6606),m=r(886),g=r(1188),y=r(5098),v="ToastProvider",[b,w,x]=function(e){let t=e+"CollectionProvider",[r,i]=(0,a.b)(t),[s,c]=r(t,{collectionRef:{current:null},itemMap:new Map}),h=e=>{let{scope:t,children:r}=e,i=n.useRef(null),o=n.useRef(new Map).current;return(0,u.jsx)(s,{scope:t,itemMap:o,collectionRef:i,children:r})};h.displayName=t;let d=e+"CollectionSlot",f=(0,l.Z8)(d),p=n.forwardRef((e,t)=>{let{scope:r,children:n}=e,i=c(d,r),s=(0,o.e)(t,i.collectionRef);return(0,u.jsx)(f,{ref:s,children:n})});p.displayName=d;let m=e+"CollectionItemSlot",g="data-radix-collection-item",y=(0,l.Z8)(m),v=n.forwardRef((e,t)=>{let{scope:r,children:i,...s}=e,a=n.useRef(null),l=(0,o.e)(t,a),h=c(m,r);return n.useEffect(()=>(h.itemMap.set(a,{ref:a,...s}),()=>void h.itemMap.delete(a))),(0,u.jsx)(y,{[g]:"",ref:l,children:i})});return v.displayName=m,[{Provider:h,Slot:p,ItemSlot:v},function(t){let r=c(e+"CollectionConsumer",t);return n.useCallback(()=>{let e=r.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll("[".concat(g,"]")));return Array.from(r.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[r.collectionRef,r.itemMap])},i]}("Toast"),[_,E]=(0,a.b)("Toast",[x]),[T,S]=_(v),k=e=>{let{__scopeToast:t,label:r="Notification",duration:i=5e3,swipeDirection:s="right",swipeThreshold:o=50,children:a}=e,[l,c]=n.useState(null),[h,d]=n.useState(0),f=n.useRef(!1),p=n.useRef(!1);return r.trim()||console.error("Invalid prop `label` supplied to `".concat(v,"`. Expected non-empty `string`.")),(0,u.jsx)(b.Provider,{scope:t,children:(0,u.jsx)(T,{scope:t,label:r,duration:i,swipeDirection:s,swipeThreshold:o,toastCount:h,viewport:l,onViewportChange:c,onToastAdd:n.useCallback(()=>d(e=>e+1),[]),onToastRemove:n.useCallback(()=>d(e=>e-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:p,children:a})})};k.displayName=v;var A="ToastViewport",P=["F8"],O="toast.viewportPause",R="toast.viewportResume",C=n.forwardRef((e,t)=>{let{__scopeToast:r,hotkey:i=P,label:s="Notifications ({hotkey})",...a}=e,l=S(A,r),h=w(r),d=n.useRef(null),p=n.useRef(null),m=n.useRef(null),g=n.useRef(null),y=(0,o.e)(t,g,l.onViewportChange),v=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),x=l.toastCount>0;n.useEffect(()=>{let e=e=>{var t;0!==i.length&&i.every(t=>e[t]||e.code===t)&&(null===(t=g.current)||void 0===t||t.focus())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[i]),n.useEffect(()=>{let e=d.current,t=g.current;if(x&&e&&t){let r=()=>{if(!l.isClosePausedRef.current){let e=new CustomEvent(O);t.dispatchEvent(e),l.isClosePausedRef.current=!0}},n=()=>
37{if(l.isClosePausedRef.current){let e=new CustomEvent(R);t.dispatchEvent(e),l.isClosePausedRef.current=!1}},i=t=>{e.contains(t.relatedTarget)||n()},s=()=>{e.contains(document.activeElement)||n()};return e.addEventListener("focusin",r),e.addEventListener("focusout",i),e.addEventListener("pointermove",r),e.addEventListener("pointerleave",s),window.addEventListener("blur",r),window.addEventListener("focus",n),()=>{e.removeEventListener("focusin",r),e.removeEventListener("focusout",i),e.removeEventListener("pointermove",r),e.removeEventListener("pointerleave",s),window.removeEventListener("blur",r),window.removeEventListener("focus",n)}}},[x,l.isClosePausedRef]);let _=n.useCallback(e=>{let{tabbingDirection:t}=e,r=h().map(e=>{let r=e.ref.current,n=[r,...function(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}(r)];return"forwards"===t?n:n.reverse()});return("forwards"===t?r.reverse():r).flat()},[h]);return n.useEffect(()=>{let e=g.current;if(e){let t=t=>{let r=t.altKey||t.ctrlKey||t.metaKey;if("Tab"===t.key&&!r){var n,i,s;let r=document.activeElement,o=t.shiftKey;if(t.target===e&&o){null===(n=p.current)||void 0===n||n.focus();return}let a=_({tabbingDirection:o?"backwards":"forwards"}),l=a.findIndex(e=>e===r);J(a.slice(l+1))?t.preventDefault():o?null===(i=p.current)||void 0===i||i.focus():null===(s=m.current)||void 0===s||s.focus()}};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}},[h,_]),(0,u.jsxs)(c.I0,{ref:d,role:"region","aria-label":s.replace("{hotkey}",v),tabIndex:-1,style:{pointerEvents:x?void 0:"none"},children:[x&&(0,u.jsx)(I,{ref:p,onFocusFromOutsideViewport:()=>{J(_({tabbingDirection:"forwards"}))}}),(0,u.jsx)(b.Slot,{scope:r,children:(0,u.jsx)(f.WV.ol,{tabIndex:-1,...a,ref:y})}),x&&(0,u.jsx)(I,{ref:m,onFocusFromOutsideViewport:()=>{J(_({tabbingDirection:"backwards"}))}})]})});C.displayName=A;var j="ToastFocusProxy",I=n.forwardRef((e,t)=>{let{__scopeToast:r,onFocusFromOutsideViewport:n,...i}=e,s=S(j,r);return(0,u.jsx)(y.TX,{"aria-hidden":!0,tabIndex:0,...i,ref:t,style:{position:"fixed"},onFocus:e=>{var t;let r=e.relatedTarget;(null===(t=s.viewport)||void 0===t?void 0:t.contains(r))||n()}})});I.displayName=j;var D="Toast",N=n.forwardRef((e,t)=>{let{forceMount:r,open:n,defaultOpen:i,onOpenChange:o,...a}=e,[l,c]=(0,m.T)({prop:n,defaultProp:null==i||i,onChange:o,caller:D});return(0,u.jsx)(d.z,{present:r||l,children:(0,u.jsx)($,{open:l,...a,ref:t,onClose:()=>c(!1),onPause:(0,p.W)(e.onPause),onResume:(0,p.W)(e.onResume),onSwipeStart:(0,s.M)(e.onSwipeStart,e=>{e.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:(0,s.M)(e.onSwipeMove,e=>{let{x:t,y:r}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","move"),e.currentTarget.style.setProperty("--radix-toast-swipe-move-x","".concat(t,"px")),e.currentTarget.style.setProperty("--radix-toast-swipe-move-y","".concat(r,"px"))}),onSwipeCancel:(0,s.M)(e.onSwipeCancel,e=>{e.currentTarget.setAttribute("data-swipe","cancel"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:(0,s.M)(e.onSwipeEnd,e=>{let{x:t,y:r}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","end"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.setProperty("--radix-toast-swipe-end-x","".concat(t,"px")),e.currentTarget.style.setProperty("--radix-toast-swipe-end-y","".concat(r,"px")),c(!1)})})})});N.displayName=D;var[M,L]=_(D,{onClose(){}}),$=n.forwardRef((e,t)=>{let{__scopeToast:r,type:a="foreground",duration:l,open:h,onClose:d,onEscapeKeyDown:m,onPause:g,onResume:y,onSwipeStart:v,onSwipeMove:w,onSwipeCancel:x,onSwipeEnd:_,...E}=e,T=S(D,r),[k,A]=n.useState(null),P=(0,o.e)(t,e=>A(e)),C=n.useRef(null),j=n.useRef(null),I=l||T.duration,N=n.useRef(0),L=n.useRef(I),$=n.useRef(0),{onToastAdd:B,onToastRemove:F}=T,V=(0,p.W)(()=>{var e;(null==k?void 0:k.contains(document.activeElement))&&(null===(e=T.viewport)||void 0===e||e.focus()),d()}),q=n.useCallback(e=>
37{e&&e!==1/0&&(window.clearTimeout($.current),N.current=new Date().getTime(),$.current=window.setTimeout(V,e))},[V]);n.useEffect(()=>{let e=T.viewport;if(e){let t=()=>{q(L.current),null==y||y()},r=()=>{let e=new Date().getTime()-N.current;L.current=L.current-e,window.clearTimeout($.current),null==g||g()};return e.addEventListener(O,r),e.addEventListener(R,t),()=>{e.removeEventListener(O,r),e.removeEventListener(R,t)}}},[T.viewport,I,g,y,q]),n.useEffect(()=>{h&&!T.isClosePausedRef.current&&q(I)},[h,I,T.isClosePausedRef,q]),n.useEffect(()=>(B(),()=>F()),[B,F]);let W=n.useMemo(()=>k?function e(t){let r=[];return Array.from(t.childNodes).forEach(t=>{if(t.nodeType===t.TEXT_NODE&&t.textContent&&r.push(t.textContent),t.nodeType===t.ELEMENT_NODE){let n=t.ariaHidden||t.hidden||"none"===t.style.display,i=""===t.dataset.radixToastAnnounceExclude;if(!n){if(i){let e=t.dataset.radixToastAnnounceAlt;e&&r.push(e)}else r.push(...e(t))}}}),r}(k):null,[k]);return T.viewport?(0,u.jsxs)(u.Fragment,{children:[W&&(0,u.jsx)(U,{__scopeToast:r,role:"status","aria-live":"foreground"===a?"assertive":"polite","aria-atomic":!0,children:W}),(0,u.jsx)(M,{scope:r,onClose:V,children:i.createPortal((0,u.jsx)(b.ItemSlot,{scope:r,children:(0,u.jsx)(c.fC,{asChild:!0,onEscapeKeyDown:(0,s.M)(m,()=>{T.isFocusedToastEscapeKeyDownRef.current||V(),T.isFocusedToastEscapeKeyDownRef.current=!1}),children:(0,u.jsx)(f.WV.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":h?"open":"closed","data-swipe-direction":T.swipeDirection,...E,ref:P,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:(0,s.M)(e.onKeyDown,e=>{"Escape"!==e.key||(null==m||m(e.nativeEvent),e.nativeEvent.defaultPrevented||(T.isFocusedToastEscapeKeyDownRef.current=!0,V()))}),onPointerDown:(0,s.M)(e.onPointerDown,e=>{0===e.button&&(C.current={x:e.clientX,y:e.clientY})}),onPointerMove:(0,s.M)(e.onPointerMove,e=>{if(!C.current)return;let t=e.clientX-C.current.x,r=e.clientY-C.current.y,n=!!j.current,i=["left","right"].includes(T.swipeDirection),s=["left","up"].includes(T.swipeDirection)?Math.min:Math.max,o=i?s(0,t):0,a=i?0:s(0,r),l="touch"===e.pointerType?10:2,u={x:o,y:a},c={originalEvent:e,delta:u};n?(j.current=u,K("toast.swipeMove",w,c,{discrete:!1})):G(u,T.swipeDirection,l)?(j.current=u,K("toast.swipeStart",v,c,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>l||Math.abs(r)>l)&&(C.current=null)}),onPointerUp:(0,s.M)(e.onPointerUp,e=>{let t=j.current,r=e.target;if(r.hasPointerCapture(e.pointerId)&&r.releasePointerCapture(e.pointerId),j.current=null,C.current=null,t){let r=e.currentTarget,n={originalEvent:e,delta:t};G(t,T.swipeDirection,T.swipeThreshold)?K("toast.swipeEnd",_,n,{discrete:!0}):K("toast.swipeCancel",x,n,{discrete:!0}),r.addEventListener("click",e=>e.preventDefault(),{once:!0})}})})})}),T.viewport)})]}):null}),U=e=>{let{__scopeToast:t,children:r,...i}=e,s=S(D,t),[o,a]=n.useState(!1),[l,c]=n.useState(!1);return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>{},t=(0,p.W)(e);(0,g.b)(()=>{let e=0,r=0;return e=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(r)}},[t])}(()=>a(!0)),n.useEffect(()=>{let e=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(e)},[]),l?null:(0,u.jsx)(h.h,{asChild:!0,children:(0,u.jsx)(y.TX,{...i,children:o&&(0,u.jsxs)(u.Fragment,{children:[s.label," ",r]})})})},B=n.forwardRef((e,t)=>{let{__scopeToast:r,...n}=e;return(0,u.jsx)(f.WV.div,{...n,ref:t})});B.displayName="ToastTitle";var F=n.forwardRef((e,t)=>{let{__scopeToast:r,...n}=e;return(0,u.jsx)(f.WV.div,{...n,ref:t})});F.displayName="ToastDescription";var V="ToastAction",q=n.forwardRef((e,t)=>{let{altText:r,...n}=e;return r.trim()?(0,u.jsx)(H,{altText:r,asChild:!0,children:(0,u.jsx)(z,{...n,ref:t})}):(console.error("Invalid prop `altText` supplied to `".concat(V,"`. Expected non-empty `string`.")),null)});q.displayName=V;var W="ToastClose",z=n.forwardRef((e,t)=>{let{__scopeToast:r,...n}=e,i=L(W,r);return(0,u.jsx)(H,{asChild:!0,children:(0,u.jsx)(f.WV.button,{type:"button",...n,ref:t,onClick:(0,s.M)(e.onClick,i.onClose)})})});z.displayName=W;var H=n.forwardRef((e,t)=>
37{let{__scopeToast:r,altText:n,...i}=e;return(0,u.jsx)(f.WV.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...i,ref:t})});function K(e,t,r,n){let{discrete:i}=n,s=r.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),i?(0,f.jH)(s,o):s.dispatchEvent(o)}var G=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=Math.abs(e.x),i=Math.abs(e.y),s=n>i;return"left"===t||"right"===t?s&&n>r:!s&&i>r};function J(e){let t=document.activeElement;return e.some(e=>e===t||(e.focus(),document.activeElement!==t))}var Y=k,X=C,Q=N,Z=B,ee=F,et=q,er=z},1322:function(e,t,r){"use strict";r.d(t,{VY:function(){return tD},zt:function(){return tC},fC:function(){return tj},xz:function(){return tI}});var n=r(2265),i=r.t(n,2),s=r(6741),o=r(8575),a=r(3966),l=r(5278),u=r(1188),c=i[" useId ".trim().toString()]||(()=>void 0),h=0;let d=["top","right","bottom","left"],f=Math.min,p=Math.max,m=Math.round,g=Math.floor,y=e=>({x:e,y:e}),v={left:"right",right:"left",bottom:"top",top:"bottom"},b={start:"end",end:"start"};function w(e,t){return"function"==typeof e?e(t):e}function x(e){return e.split("-")[0]}function _(e){return e.split("-")[1]}function E(e){return"x"===e?"y":"x"}function T(e){return"y"===e?"height":"width"}let S=new Set(["top","bottom"]);function k(e){return S.has(x(e))?"y":"x"}function A(e){return e.replace(/start|end/g,e=>b[e])}let P=["left","right"],O=["right","left"],R=["top","bottom"],C=["bottom","top"];function j(e){return e.replace(/left|right|bottom|top/g,e=>v[e])}function I(e){return"number"!=typeof e?{top:0,right:0,bottom:0,left:0,...e}:{top:e,right:e,bottom:e,left:e}}function D(e){let{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function N(e,t,r){let n,{reference:i,floating:s}=e,o=k(t),a=E(k(t)),l=T(a),u=x(t),c="y"===o,h=i.x+i.width/2-s.width/2,d=i.y+i.height/2-s.height/2,f=i[l]/2-s[l]/2;switch(u){case"top":n={x:h,y:i.y-s.height};break;case"bottom":n={x:h,y:i.y+i.height};break;case"right":n={x:i.x+i.width,y:d};break;case"left":n={x:i.x-s.width,y:d};break;default:n={x:i.x,y:i.y}}switch(_(t)){case"start":n[a]-=f*(r&&c?-1:1);break;case"end":n[a]+=f*(r&&c?-1:1)}return n}let M=async(e,t,r)=>{let{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:o}=r,a=s.filter(Boolean),l=await (null==o.isRTL?void 0:o.isRTL(t)),u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:h}=N(u,n,l),d=n,f={},p=0;for(let r=0;r<a.length;r++){let{name:s,fn:m}=a[r],{x:g,y:y,data:v,reset:b}=await m({x:c,y:h,initialPlacement:n,placement:d,strategy:i,middlewareData:f,re
37cts:u,platform:o,elements:{reference:e,floating:t}});c=null!=g?g:c,h=null!=y?y:h,f={...f,[s]:{...f[s],...v}},b&&p<=50&&(p++,"object"==typeof b&&(b.placement&&(d=b.placement),b.rects&&(u=!0===b.rects?await o.getElementRects({reference:e,floating:t,strategy:i}):b.rects),{x:c,y:h}=N(u,d,l)),r=-1)}return{x:c,y:h,placement:d,strategy:i,middlewareData:f}};async function L(e,t){var r;void 0===t&&(t={});let{x:n,y:i,platform:s,rects:o,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:h="floating",altBoundary:d=!1,padding:f=0}=w(t,e),p=I(f),m=a[d?"floating"===h?"reference":"floating":h],g=D(await s.getClippingRect({element:null==(r=await (null==s.isElement?void 0:s.isElement(m)))||r?m:m.contextElement||await (null==s.getDocumentElement?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),y="floating"===h?{x:n,y:i,width:o.floating.width,height:o.floating.height}:o.reference,v=await (null==s.getOffsetParent?void 0:s.getOffsetParent(a.floating)),b=await (null==s.isElement?void 0:s.isElement(v))&&await (null==s.getScale?void 0:s.getScale(v))||{x:1,y:1},x=D(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:v,strategy:l}):y);return{top:(g.top-x.top+p.top)/b.y,bottom:(x.bottom-g.bottom+p.bottom)/b.y,left:(g.left-x.left+p.left)/b.x,right:(x.right-g.right+p.right)/b.x}}function $(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function U(e){return d.some(t=>e[t]>=0)}let B=new Set(["left","top"]);async function F(e,t){let{placement:r,platform:n,elements:i}=e,s=await (null==n.isRTL?void 0:n.isRTL(i.floating)),o=x(r),a=_(r),l="y"===k(r),u=B.has(o)?-1:1,c=s&&l?-1:1,h=w(t,e),{mainAxis:d,crossAxis:f,alignmentAxis:p}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&"number"==typeof p&&(f="end"===a?-1*p:p),l?{x:f*c,y:d*u}:{x:d*u,y:f*c}}function V(){return"undefined"!=typeof window}function q(e){return H(e)?(e.nodeName||"").toLowerCase():"#document"}function W(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function z(e){var t;return null==(t=(H(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function H(e){return!!V()&&(e instanceof Node||e instanceof W(e).Node)}function K(e){return!!V()&&(e instanceof Element||e instanceof W(e).Element)}function G(e){return!!V()&&(e instanceof HTMLElement||e instanceof W(e).HTMLElement)}function J(e){return!!V()&&"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof W(e).ShadowRoot)}let Y=new Set(["inline","contents"]);function X(e){let{overflow:t,overflowX:r,overflowY:n,display:i}=el(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Y.has(i)}let Q=new Set(["table","td","th"]),Z=[":popover-open",":modal"];function ee(e){return Z.some(t=>{try{return e.matches(t)}catch(e){return!1}})}let et=["transform","translate","scale","rotate","perspective"],er=["transform","translate","scale","rotate","perspective","filter"],en=["paint","layout","strict","content"];function ei(e){let t=es(),r=K(e)?el(e):e;return et.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||er.some(e=>(r.willChange||"").includes(e))||en.some(e=>(r.contain||"").includes(e))}function es(){return"undefined"!=typeof CSS&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")}let eo=new Set(["html","body","#document"]);function ea(e){return eo.has(q(e))}function el(e){return W(e).getComputedStyle(e)}function eu(e){return K(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ec(e){if("html"===q(e))return e;let t=e.assignedSlot||e.parentNode||J(e)&&e.host||z(e);return J(t)?t.host:t}function eh(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);let i=function e(t){let r=ec(t);return ea(r)?t.ownerDocument?t.ownerDocument.body:t.body:G(r)&&X(r)?r:e(r)}(e),s=i===(null==(n=e.ownerDocument)?void 0:n.body),o=W(i);if(s){let e=ed(o);
37return t.concat(o,o.visualViewport||[],X(i)?i:[],e&&r?eh(e):[])}return t.concat(i,eh(i,[],r))}function ed(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ef(e){let t=el(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,i=G(e),s=i?e.offsetWidth:r,o=i?e.offsetHeight:n,a=m(r)!==s||m(n)!==o;return a&&(r=s,n=o),{width:r,height:n,$:a}}function ep(e){return K(e)?e:e.contextElement}function em(e){let t=ep(e);if(!G(t))return y(1);let r=t.getBoundingClientRect(),{width:n,height:i,$:s}=ef(t),o=(s?m(r.width):r.width)/n,a=(s?m(r.height):r.height)/i;return o&&Number.isFinite(o)||(o=1),a&&Number.isFinite(a)||(a=1),{x:o,y:a}}let eg=y(0);function ey(e){let t=W(e);return es()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:eg}function ev(e,t,r,n){var i;void 0===t&&(t=!1),void 0===r&&(r=!1);let s=e.getBoundingClientRect(),o=ep(e),a=y(1);t&&(n?K(n)&&(a=em(n)):a=em(e));let l=(void 0===(i=r)&&(i=!1),n&&(!i||n===W(o))&&i)?ey(o):y(0),u=(s.left+l.x)/a.x,c=(s.top+l.y)/a.y,h=s.width/a.x,d=s.height/a.y;if(o){let e=W(o),t=n&&K(n)?W(n):n,r=e,i=ed(r);for(;i&&n&&t!==r;){let e=em(i),t=i.getBoundingClientRect(),n=el(i),s=t.left+(i.clientLeft+parseFloat(n.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(n.paddingTop))*e.y;u*=e.x,c*=e.y,h*=e.x,d*=e.y,u+=s,c+=o,i=ed(r=W(i))}}return D({width:h,height:d,x:u,y:c})}function eb(e,t){let r=eu(e).scrollLeft;return t?t.left+r:ev(z(e)).left+r}function ew(e,t,r){void 0===r&&(r=!1);let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-(r?0:eb(e,n)),y:n.top+t.scrollTop}}let ex=new Set(["absolute","fixed"]);function e_(e,t,r){let n;if("viewport"===t)n=function(e,t){let r=W(e),n=z(e),i=r.visualViewport,s=n.clientWidth,o=n.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;let e=es();(!e||e&&"fixed"===t)&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}(e,r);else if("document"===t)n=function(e){let t=z(e),r=eu(e),n=e.ownerDocument.body,i=p(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=p(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight),o=-r.scrollLeft+eb(e),a=-r.scrollTop;return"rtl"===el(n).direction&&(o+=p(t.clientWidth,n.clientWidth)-i),{width:i,height:s,x:o,y:a}}(z(e));else if(K(t))n=function(e,t){let r=ev(e,!0,"fixed"===t),n=r.top+e.clientTop,i=r.left+e.clientLeft,s=G(e)?em(e):y(1),o=e.clientWidth*s.x;return{width:o,height:e.clientHeight*s.y,x:i*s.x,y:n*s.y}}(t,r);else{let r=ey(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return D(n)}function eE(e){return"static"===el(e).position}function eT(e,t){if(!G(e)||"fixed"===el(e).position)return null;if(t)return t(e);let r=e.offsetParent;return z(e)===r&&(r=r.ownerDocument.body),r}function eS(e,t){var r;let n=W(e);if(ee(e))return n;if(!G(e)){let t=ec(e);for(;t&&!ea(t);){if(K(t)&&!eE(t))return t;t=ec(t)}return n}let i=eT(e,t);for(;i&&(r=i,Q.has(q(r)))&&eE(i);)i=eT(i,t);return i&&ea(i)&&eE(i)&&!ei(i)?n:i||function(e){let t=ec(e);for(;G(t)&&!ea(t);){if(ei(t))return t;if(ee(t))break;t=ec(t)}return null}(e)||n}let ek=async function(e){let t=this.getOffsetParent||eS,r=this.getDimensions,n=await r(e.floating);return{reference:function(e,t,r){let n=G(t),i=z(t),s="fixed"===r,o=ev(e,!0,s,t),a={scrollLeft:0,scrollTop:0},l=y(0);if(n||!n&&!s){if(("body"!==q(t)||X(i))&&(a=eu(t)),n){let e=ev(t,!0,s,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else i&&(l.x=eb(i))}s&&!n&&i&&(l.x=eb(i));let u=!i||n||s?y(0):ew(i,a);return{x:o.left+a.scrollLeft-l.x-u.x,y:o.top+a.scrollTop-l.y-u.y,width:o.width,height:o.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},eA={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e,s="fixed"===i,o=z(n),a=!!t&&ee(t.floating);if(n===o||a&&s)return r;let l={scrollLeft:0,scrollTop:0},u=y(1),c=y(0),h=G(n);if((h||!h&&!s)&&(("body"!==q(n)||X(o))&&(l=eu(n)),G(n))){let e=ev(n);u=em(n),c.x=e.x+n.clientLeft,c.y=e.y+n.clientTop}let d=!o||h||s?y(0):ew(o,l,!0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-l.scrollLeft*u.x+c.x+d.x,y:r.y*u.y-l.scrollTop*u.y+c.y+d.y}},getDocumentElement:z,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e,s=[..."clippingAncestors"===r?ee(t)?[]:function(e,t){let r=t.get(e);if(r)return r;let n=eh(e,[],!1).filter(e=>K(e)&&"body"!==q(e)),i=null,s="fixed"===el(e).position,o=s?ec(e):e;for(;K(o)&&!ea(o);){let t=el(o),r=ei(o);r||"fixed"!==t.position||(i=null),(s?!r&&!i:!r&&"static"===t.position&&!!i&&ex.has(i.position)||X(o)&&!r&&function e(t,r){let n=ec(t);return!(n===r||!K(n)||ea(n))&&("fixed"===el(n).position||e(n,r))}(e,o))?n=n.filter(e=>e!==o):i=t,o=ec(o)}return t.set(e,n),n}(t,this._c):[].concat(r),n],o=s[0],a=s.reduce((e,r)=>{let n=e_(t,r,i);return e.top=p(n.top,e.top),e.right=f(n.right,e.right),e.bottom=f(n.bottom,e.bottom),e.left=p(n.left,e.left),e},e_(t,o,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:eS,getElementRects:ek,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:r}=ef(e);return{width:t,height:r}},getScale:em,isElement:K,isRTL:function(e){return"rtl"===el(e).direction}};function eP(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}let eO=e=>({name:"arrow",options:e,async fn(t){let{x:r,y:n,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=t,{element:u,padding:c=0}=w(e,t)||{};if(null==u)return{};let h=I(c),d={x:r,y:n},m=E(k(i)),g=T(m),y=await o.getDimensions(u),v="y"===m,b=v?"clientHeight":"clientWidth",x=s.reference[g]+s.reference[m]-d[m]-s.floating[g],S=d[m]-s.reference[m],A=await (null==o.getOffsetParent?void 0:o.getOffsetParent(u)),P=A?A[b]:0;P&&await (null==o.isElement?void 0:o.isElement(A))||(P=a.floating[b]||s.floating[g]);let O=P/2-y[g]/2-1,R=f(h[v?"top":"left"],O),C=f(h[v?"bottom":"right"],O),j=P-y[g]-C,D=P/2-y[g]/2+(x/2-S/2),N=p(R,f(D,j)),M=!l.arrow&&null!=_(i)&&D!==N&&s.reference[g]/2-(D<R?R:C)-y[g]/2<0,L=M?D<R?D-R:D-j:0;return{[m]:d[m]+L,data:{[m]:N,centerOffset:D-N-L,...M&&{alignmentOffset:L}},reset:M}}}),eR=(e,t,r)=>{let n=new Map,i={platform:eA,...r},s={...i.platform,_c:n};return M(e,t,{...i,platform:s})};var eC=r(4887),ej="undefined"!=typeof document?n.useLayoutEffect:function(){};function eI(e,t){let r,n,i;if(e===t)return!0;
37if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((r=e.length)!==t.length)return!1;for(n=r;0!=n--;)if(!eI(e[n],t[n]))return!1;return!0}if((r=(i=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(n=r;0!=n--;)if(!({}).hasOwnProperty.call(t,i[n]))return!1;for(n=r;0!=n--;){let r=i[n];if(("_owner"!==r||!e.$$typeof)&&!eI(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function eD(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function eN(e,t){let r=eD(e);return Math.round(t*r)/r}function eM(e){let t=n.useRef(e);return ej(()=>{t.current=e}),t}let eL=e=>({name:"arrow",options:e,fn(t){let{element:r,padding:n}="function"==typeof e?e(t):e;return r&&({}).hasOwnProperty.call(r,"current")?null!=r.current?eO({element:r.current,padding:n}).fn(t):{}:r?eO({element:r,padding:n}).fn(t):{}}}),e$=(e,t)=>{var r;return{...(void 0===(r=e)&&(r=0),{name:"offset",options:r,async fn(e){var t,n;let{x:i,y:s,placement:o,middlewareData:a}=e,l=await F(e,r);return o===(null==(t=a.offset)?void 0:t.placement)&&null!=(n=a.arrow)&&n.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}),options:[e,t]}},eU=(e,t)=>{var r;return{...(void 0===(r=e)&&(r={}),{name:"shift",options:r,async fn(e){let{x:t,y:n,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=w(r,e),u={x:t,y:n},c=await L(e,l),h=k(x(i)),d=E(h),m=u[d],g=u[h];if(s){let e="y"===d?"top":"left",t="y"===d?"bottom":"right",r=m+c[e],n=m-c[t];m=p(r,f(m,n))}if(o){let e="y"===h?"top":"left",t="y"===h?"bottom":"right",r=g+c[e],n=g-c[t];g=p(r,f(g,n))}let y=a.fn({...e,[d]:m,[h]:g});return{...y,data:{x:y.x-t,y:y.y-n,enabled:{[d]:s,[h]:o}}}}}),options:[e,t]}},eB=(e,t)=>{var r;return{...(void 0===(r=e)&&(r={}),{options:r,fn(e){let{x:t,y:n,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=w(r,e),c={x:t,y:n},h=k(i),d=E(h),f=c[d],p=c[h],m=w(a,e),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){let e="y"===d?"height":"width",t=s.reference[d]-s.floating[e]+g.mainAxis,r=s.reference[d]+s.reference[e]-g.mainAxis;f<t?f=t:f>r&&(f=r)}if(u){var y,v;let e="y"===d?"width":"height",t=B.has(x(i)),r=s.reference[h]-s.floating[e]+(t&&(null==(y=o.offset)?void 0:y[h])||0)+(t?0:g.crossAxis),n=s.reference[h]+s.reference[e]+(t?0:(null==(v=o.offset)?void 0:v[h])||0)-(t?g.crossAxis:0);p<r?p=r:p>n&&(p=n)}return{[d]:f,[h]:p}}}),options:[e,t]}},eF=(e,t)=>{var r;return{...(void 0===(r=e)&&(r={}),{name:"flip",options:r,async fn(e){var t,n,i,s,o;let{placement:a,middlewareData:l,rects:u,initialPlacement:c,platform:h,elements:d}=e,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:v=!0,...b}=w(r,e);if(null!=(t=l.arrow)&&t.alignmentOffset)return{};let S=x(a),I=k(c),D=x(c)===c,N=await (null==h.isRTL?void 0:h.isRTL(d.floating)),M=m||(D||!v?[j(c)]:function(e){let t=j(e);return[A(e),t,A(t)]}(c)),$="none"!==y;!m&&$&&M.push(...function(e,t,r,n){let i=_(e),s=function(e,t,r){switch(e){case"top":case"bottom":if(r)return t?O:P;return t?P:O;case"left":case"right":return t?R:C;default:return[]}}(x(e),"start"===r,n);return i&&(s=s.map(e=>e+"-"+i),t&&(s=s.concat(s.map(A)))),s}(c,v,y,N));let U=[c,...M],B=await L(e,b),F=[],V=(null==(n=l.flip)?void 0:n.overflows)||[];if(f&&F.push(B[S]),p){let e=function(e,t,r){void 0===r&&(r=!1);let n=_(e),i=E(k(e)),s=T(i),o="x"===i?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=j(o)),[o,j(o)]}(a,u,N);F.push(B[e[0]],B[e[1]])}if(V=[...V,{placement:a,overflows:F}],!F.every(e=>e<=0)){let e=((null==(i=l.flip)?void 0:i.index)||0)+1,t=U[e];if(t&&(!("alignment"===p&&I!==k(t))||V.every(e=>e.overflows[0]>0&&k(e.placement)===I)))return{data:{index:e,overflows:V},reset:{placement:t}};let r=null==(s=V.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:s.placement;if(!r)switch(g){case"bestFit":{let e=null==(o=V.filter(e=>{if($){let t=k(e.placement);return t===I||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>
37e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:o[0];e&&(r=e);break}case"initialPlacement":r=c}if(a!==r)return{reset:{placement:r}}}return{}}}),options:[e,t]}},eV=(e,t)=>{var r;return{...(void 0===(r=e)&&(r={}),{name:"size",options:r,async fn(e){var t,n;let i,s;let{placement:o,rects:a,platform:l,elements:u}=e,{apply:c=()=>{},...h}=w(r,e),d=await L(e,h),m=x(o),g=_(o),y="y"===k(o),{width:v,height:b}=a.floating;"top"===m||"bottom"===m?(i=m,s=g===(await (null==l.isRTL?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(s=m,i="end"===g?"top":"bottom");let E=b-d.top-d.bottom,T=v-d.left-d.right,S=f(b-d[i],E),A=f(v-d[s],T),P=!e.middlewareData.shift,O=S,R=A;if(null!=(t=e.middlewareData.shift)&&t.enabled.x&&(R=T),null!=(n=e.middlewareData.shift)&&n.enabled.y&&(O=E),P&&!g){let e=p(d.left,0),t=p(d.right,0),r=p(d.top,0),n=p(d.bottom,0);y?R=v-2*(0!==e||0!==t?e+t:p(d.left,d.right)):O=b-2*(0!==r||0!==n?r+n:p(d.top,d.bottom))}await c({...e,availableWidth:R,availableHeight:O});let C=await l.getDimensions(u.floating);return v!==C.width||b!==C.height?{reset:{rects:!0}}:{}}}),options:[e,t]}},eq=(e,t)=>{var r;return{...(void 0===(r=e)&&(r={}),{name:"hide",options:r,async fn(e){let{rects:t}=e,{strategy:n="referenceHidden",...i}=w(r,e);switch(n){case"referenceHidden":{let r=$(await L(e,{...i,elementContext:"reference"}),t.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:U(r)}}}case"escaped":{let r=$(await L(e,{...i,altBoundary:!0}),t.floating);return{data:{escapedOffsets:r,escaped:U(r)}}}default:return{}}}}),options:[e,t]}},eW=(e,t)=>({...eL(e),options:[e,t]});var ez=r(6840),eH=r(7437),eK=n.forwardRef((e,t)=>{let{children:r,width:n=10,height:i=5,...s}=e;return(0,eH.jsx)(ez.WV.svg,{...s,ref:t,width:n,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:(0,eH.jsx)("polygon",{points:"0,0 30,0 15,10"})})});eK.displayName="Arrow";var eG=r(6606),eJ="Popper",[eY,eX]=(0,a.b)(eJ),[eQ,eZ]=eY(eJ),e0=e=>{let{__scopePopper:t,children:r}=e,[i,s]=n.useState(null);return(0,eH.jsx)(eQ,{scope:t,anchor:i,onAnchorChange:s,children:r})};e0.displayName=eJ;var e1="PopperAnchor",e2=n.forwardRef((e,t)=>{let{__scopePopper:r,virtualRef:i,...s}=e,a=eZ(e1,r),l=n.useRef(null),u=(0,o.e)(t,l);return n.useEffect(()=>{a.onAnchorChange((null==i?void 0:i.current)||l.current)}),i?null:(0,eH.jsx)(ez.WV.div,{...s,ref:u})});e2.displayName=e1;var e5="PopperContent",[e6,e3]=eY(e5),e8=n.forwardRef((e,t)=>{var r,i,s,a,l,c,h,d;let{__scopePopper:m,side:y="bottom",sideOffset:v=0,align:b="center",alignOffset:w=0,arrowPadding:x=0,avoidCollisions:_=!0,collisionBoundary:E=[],collisionPadding:T=0,sticky:S="partial",hideWhenDetached:k=!1,updatePositionStrategy:A="optimized",onPlaced:P,...O}=e,R=eZ(e5,m),[C,j]=n.useState(null),I=(0,o.e)(t,e=>j(e)),[D,N]=n.useState(null),M=function(e){let[t,r]=n.useState(void 0);return(0,u.b)(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let n,i;if(!Array.isArray(t)||!t.length)return;let s=t[0];if("borderBoxSize"in s){let e=s.borderBoxSize,t=Array.isArray(e)?e[0]:e;n=t.inlineSize,i=t.blockSize}else n=e.offsetWidth,i=e.offsetHeight;r({width:n,height:i})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}(D),L=null!==(h=null==M?void 0:M.width)&&void 0!==h?h:0,$=null!==(d=null==M?void 0:M.height)&&void 0!==d?d:0,U="number"==typeof T?T:{top:0,right:0,bottom:0,left:0,...T},B=Array.isArray(E)?E:[E],F=B.length>0,V={padding:U,boundary:B.filter(te),altBoundary:F},{refs:q,floatingStyles:W,placement:H,isPositioned:K,middlewareData:G}=function(e){void 0===e&&(e={});let{placement:t="bottom",strategy:r="absolute",middleware:i=[],platform:s,elements:{reference:o,floating:a}={},transform:l=!0,whileElementsMounted:u,open:c}=e,[h,d]=n.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=n.useState(i);eI(f,i)||p(i);let[m,g]=n.useState(null),[y,v]=n.useState(null),b=n.useCallback(e=>{e!==E.current&&(E.current=e,g(e))},[]),w=n.useCallback(e=>{e!==T.current&&(T.current=e,v(e))},[]),x=o||m,_=a||y,E=n.useRef(null),T=n.useRef(null),S=n.useRef(h),k=null!=u,A=eM(u),P=eM(s),O=eM(c),R=n.useCallback(()=>
37{if(!E.current||!T.current)return;let e={placement:t,strategy:r,middleware:f};P.current&&(e.platform=P.current),eR(E.current,T.current,e).then(e=>{let t={...e,isPositioned:!1!==O.current};C.current&&!eI(S.current,t)&&(S.current=t,eC.flushSync(()=>{d(t)}))})},[f,t,r,P,O]);ej(()=>{!1===c&&S.current.isPositioned&&(S.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[c]);let C=n.useRef(!1);ej(()=>(C.current=!0,()=>{C.current=!1}),[]),ej(()=>{if(x&&(E.current=x),_&&(T.current=_),x&&_){if(A.current)return A.current(x,_,R);R()}},[x,_,R,A,k]);let j=n.useMemo(()=>({reference:E,floating:T,setReference:b,setFloating:w}),[b,w]),I=n.useMemo(()=>({reference:x,floating:_}),[x,_]),D=n.useMemo(()=>{let e={position:r,left:0,top:0};if(!I.floating)return e;let t=eN(I.floating,h.x),n=eN(I.floating,h.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...eD(I.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,l,I.floating,h.x,h.y]);return n.useMemo(()=>({...h,update:R,refs:j,elements:I,floatingStyles:D}),[h,R,j,I,D])}({strategy:"fixed",placement:y+("center"!==b?"-"+b:""),whileElementsMounted:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e,t,r,n){let i;void 0===n&&(n={});let{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:u=!1}=n,c=ep(e),h=s||o?[...c?eh(c):[],...eh(t)]:[];h.forEach(e=>{s&&e.addEventListener("scroll",r,{passive:!0}),o&&e.addEventListener("resize",r)});let d=c&&l?function(e,t){let r,n=null,i=z(e);function s(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return!function o(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),s();let u=e.getBoundingClientRect(),{left:c,top:h,width:d,height:m}=u;if(a||t(),!d||!m)return;let y=g(h),v=g(i.clientWidth-(c+d)),b={rootMargin:-y+"px "+-v+"px "+-g(i.clientHeight-(h+m))+"px "+-g(c)+"px",threshold:p(0,f(1,l))||1},w=!0;function x(t){let n=t[0].intersectionRatio;if(n!==l){if(!w)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}1!==n||eP(u,e.getBoundingClientRect())||o(),w=!1}try{n=new IntersectionObserver(x,{...b,root:i.ownerDocument})}catch(e){n=new IntersectionObserver(x,b)}n.observe(e)}(!0),s}(c,r):null,m=-1,y=null;a&&(y=new ResizeObserver(e=>{let[n]=e;n&&n.target===c&&y&&(y.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var e;null==(e=y)||e.observe(t)})),r()}),c&&!u&&y.observe(c),y.observe(t));let v=u?ev(e):null;return u&&function t(){let n=ev(e);v&&!eP(v,n)&&r(),v=n,i=requestAnimationFrame(t)}(),r(),()=>{var e;h.forEach(e=>{s&&e.removeEventListener("scroll",r),o&&e.removeEventListener("resize",r)}),null==d||d(),null==(e=y)||e.disconnect(),y=null,u&&cancelAnimationFrame(i)}}(...t,{animationFrame:"always"===A})},elements:{reference:R.anchor},middleware:[e$({mainAxis:v+$,alignmentAxis:w}),_&&eU({mainAxis:!0,crossAxis:!1,limiter:"partial"===S?eB():void 0,...V}),_&&eF({...V}),eV({...V,apply:e=>{let{elements:t,rects:r,availableWidth:n,availableHeight:i}=e,{width:s,height:o}=r.reference,a=t.floating.style;a.setProperty("--radix-popper-available-width","".concat(n,"px")),a.setProperty("--radix-popper-available-height","".concat(i,"px")),a.setProperty("--radix-popper-anchor-width","".concat(s,"px")),a.setProperty("--radix-popper-anchor-height","".concat(o,"px"))}}),D&&eW({element:D,padding:x}),tt({arrowWidth:L,arrowHeight:$}),k&&eq({strategy:"referenceHidden",...V})]}),[J,Y]=tr(H),X=(0,eG.W)(P);(0,u.b)(()=>{K&&(null==X||X())},[K,X]);let Q=null===(r=G.arrow)||void 0===r?void 0:r.x,Z=null===(i=G.arrow)||void 0===i?void 0:i.y,ee=(null===(s=G.arrow)||void 0===s?void 0:s.centerOffset)!==0,[et,er]=n.useState();return(0,u.b)(()=>{C&&er(window.getComputedStyle(C).zIndex)},[C]),(0,eH.jsx)("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:K?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:et,"--radix-popper-transform-origin":[null===(a=G.transformOrigin)||void 0===a?void 0:a.x,null===(l=G.transformOrigin)||void 0===l?void 0:l.y].join(" "),...(null===(c=G.hide)||void 0===c?void 0:c.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,eH.jsx)(e6,{scope:m,placedSide:J,onArrowChange:N,arrowX:Q,arrowY:Z,shouldHideArrow:ee,children:(0,eH.jsx)(ez.WV.div,{"data-side":J,"data-align":Y,...O,ref:I,style:{...O.style,animation:K?void 0:"none"}})})})});e8.displayName=e5;var e4="PopperArrow",e9={top:"bottom",right:"left",bottom:"top",left:"r
37ight"},e7=n.forwardRef(function(e,t){let{__scopePopper:r,...n}=e,i=e3(e4,r),s=e9[i.placedSide];return(0,eH.jsx)("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:(0,eH.jsx)(eK,{...n,ref:t,style:{...n.style,display:"block"}})})});function te(e){return null!==e}e7.displayName=e4;var tt=e=>({name:"transformOrigin",options:e,fn(t){var r,n,i,s,o;let{placement:a,rects:l,middlewareData:u}=t,c=(null===(r=u.arrow)||void 0===r?void 0:r.centerOffset)!==0,h=c?0:e.arrowWidth,d=c?0:e.arrowHeight,[f,p]=tr(a),m={start:"0%",center:"50%",end:"100%"}[p],g=(null!==(s=null===(n=u.arrow)||void 0===n?void 0:n.x)&&void 0!==s?s:0)+h/2,y=(null!==(o=null===(i=u.arrow)||void 0===i?void 0:i.y)&&void 0!==o?o:0)+d/2,v="",b="";return"bottom"===f?(v=c?m:"".concat(g,"px"),b="".concat(-d,"px")):"top"===f?(v=c?m:"".concat(g,"px"),b="".concat(l.floating.height+d,"px")):"right"===f?(v="".concat(-d,"px"),b=c?m:"".concat(y,"px")):"left"===f&&(v="".concat(l.floating.width+d,"px"),b=c?m:"".concat(y,"px")),{data:{x:v,y:b}}}});function tr(e){let[t,r="center"]=e.split("-");return[t,r]}r(3832);var tn=r(1599),ti=r(7495),ts=r(886),to=r(5098),[ta,tl]=(0,a.b)("Tooltip",[eX]),tu=eX(),tc="TooltipProvider",th="tooltip.open",[td,tf]=ta(tc),tp=e=>{let{__scopeTooltip:t,delayDuration:r=700,skipDelayDuration:i=300,disableHoverableContent:s=!1,children:o}=e,a=n.useRef(!0),l=n.useRef(!1),u=n.useRef(0);return n.useEffect(()=>{let e=u.current;return()=>window.clearTimeout(e)},[]),(0,eH.jsx)(td,{scope:t,isOpenDelayedRef:a,delayDuration:r,onOpen:n.useCallback(()=>{window.clearTimeout(u.current),a.current=!1},[]),onClose:n.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>a.current=!0,i)},[i]),isPointerInTransitRef:l,onPointerInTransitChange:n.useCallback(e=>{l.current=e},[]),disableHoverableContent:s,children:o})};tp.displayName=tc;var tm="Tooltip",[tg,ty]=ta(tm),tv=e=>{let{__scopeTooltip:t,children:r,open:i,defaultOpen:s,onOpenChange:o,disableHoverableContent:a,delayDuration:l}=e,d=tf(tm,e.__scopeTooltip),f=tu(t),[p,m]=n.useState(null),g=function(e){let[t,r]=n.useState(c());return(0,u.b)(()=>{r(e=>e??String(h++))},[void 0]),t?`radix-${t}`:""}(),y=n.useRef(0),v=null!=a?a:d.disableHoverableContent,b=null!=l?l:d.delayDuration,w=n.useRef(!1),[x,_]=(0,ts.T)({prop:i,defaultProp:null!=s&&s,onChange:e=>{e?(d.onOpen(),document.dispatchEvent(new CustomEvent(th))):d.onClose(),null==o||o(e)},caller:tm}),E=n.useMemo(()=>x?w.current?"delayed-open":"instant-open":"closed",[x]),T=n.useCallback(()=>{window.clearTimeout(y.current),y.current=0,w.current=!1,_(!0)},[_]),S=n.useCallback(()=>{window.clearTimeout(y.current),y.current=0,_(!1)},[_]),k=n.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{w.current=!0,_(!0),y.current=0},b)},[b,_]);return n.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),(0,eH.jsx)(e0,{...f,children:(0,eH.jsx)(tg,{scope:t,contentId:g,open:x,stateAttribute:E,trigger:p,onTriggerChange:m,onTriggerEnter:n.useCallback(()=>{d.isOpenDelayedRef.current?k():T()},[d.isOpenDelayedRef,k,T]),onTriggerLeave:n.useCallback(()=>{v?S():(window.clearTimeout(y.current),y.current=0)},[S,v]),onOpen:T,onClose:S,disableHoverableContent:v,children:r})})};tv.displayName=tm;var tb="TooltipTrigger",tw=n.forwardRef((e,t)=>{let{__scopeTooltip:r,...i}=e,a=ty(tb,r),l=tf(tb,r),u=tu(r),c=n.useRef(null),h=(0,o.e)(t,c,a.onTriggerChange),d=n.useRef(!1),f=n.useRef(!1),p=n.useCallback(()=>d.current=!1,[]);return n.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),(0,eH.jsx)(e2,{asChild:!0,...u,children:(0,eH.jsx)(ez.WV.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...i,ref:h,onPointerMove:(0,s.M)(e.onPointerMove,e=>{"touch"===e.pointerType||f.current||l.isPointerInTransitRef.current||(a.onTriggerEnter(),f.current=!0)}),onPointerLeave:(0,s.M)(e.onPointerLeave,()=>{a.onTriggerLeave(),f.current=!1}),onPointerDown:(0,s.M)(e.onPointerDown,()=>{a.open&&a.onClose(),d.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:(0,s.M)(e.onFocus,()=>{d.current||a.onOpen()}),onBlur:(0,s.M)(e.onBlur,a.onClose),onClick:(0,s.M)(e.onClick,a.onClose)})})});tw.displayName=tb;var[tx,t_]=ta("TooltipPortal",{forceMount:void 0}),tE="TooltipContent",tT=n.forwardRef((e,t)=>
37{let r=t_(tE,e.__scopeTooltip),{forceMount:n=r.forceMount,side:i="top",...s}=e,o=ty(tE,e.__scopeTooltip);return(0,eH.jsx)(tn.z,{present:n||o.open,children:o.disableHoverableContent?(0,eH.jsx)(tO,{side:i,...s,ref:t}):(0,eH.jsx)(tS,{side:i,...s,ref:t})})}),tS=n.forwardRef((e,t)=>{let r=ty(tE,e.__scopeTooltip),i=tf(tE,e.__scopeTooltip),s=n.useRef(null),a=(0,o.e)(t,s),[l,u]=n.useState(null),{trigger:c,onClose:h}=r,d=s.current,{onPointerInTransitChange:f}=i,p=n.useCallback(()=>{u(null),f(!1)},[f]),m=n.useCallback((e,t)=>{let r=e.currentTarget,n={x:e.clientX,y:e.clientY},i=function(e,t){let r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(r,n,i,s)){case s:return"left";case i:return"right";case r:return"top";case n:return"bottom";default:throw Error("unreachable")}}(n,r.getBoundingClientRect());u(function(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),function(e){if(e.length<=1)return e.slice();let t=[];for(let r=0;r<e.length;r++){let n=e[r];for(;t.length>=2;){let e=t[t.length-1],r=t[t.length-2];if((e.x-r.x)*(n.y-r.y)>=(e.y-r.y)*(n.x-r.x))t.pop();else break}t.push(n)}t.pop();let r=[];for(let t=e.length-1;t>=0;t--){let n=e[t];for(;r.length>=2;){let e=r[r.length-1],t=r[r.length-2];if((e.x-t.x)*(n.y-t.y)>=(e.y-t.y)*(n.x-t.x))r.pop();else break}r.push(n)}return(r.pop(),1===t.length&&1===r.length&&t[0].x===r[0].x&&t[0].y===r[0].y)?t:t.concat(r)}(t)}([...function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5,n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r})}return n}(n,i),...function(e){let{top:t,right:r,bottom:n,left:i}=e;return[{x:i,y:t},{x:r,y:t},{x:r,y:n},{x:i,y:n}]}(t.getBoundingClientRect())])),f(!0)},[f]);return n.useEffect(()=>()=>p(),[p]),n.useEffect(()=>{if(c&&d){let e=e=>m(e,d),t=e=>m(e,c);return c.addEventListener("pointerleave",e),d.addEventListener("pointerleave",t),()=>{c.removeEventListener("pointerleave",e),d.removeEventListener("pointerleave",t)}}},[c,d,m,p]),n.useEffect(()=>{if(l){let e=e=>{let t=e.target,r={x:e.clientX,y:e.clientY},n=(null==c?void 0:c.contains(t))||(null==d?void 0:d.contains(t)),i=!function(e,t){let{x:r,y:n}=e,i=!1;for(let e=0,s=t.length-1;e<t.length;s=e++){let o=t[e],a=t[s],l=o.x,u=o.y,c=a.x,h=a.y;u>n!=h>n&&r<(c-l)*(n-u)/(h-u)+l&&(i=!i)}return i}(r,l);n?p():i&&(p(),h())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[c,d,l,h,p]),(0,eH.jsx)(tO,{...e,ref:a})}),[tk,tA]=ta(tm,{isInside:!1}),tP=(0,ti.sA)("TooltipContent"),tO=n.forwardRef((e,t)=>{let{__scopeTooltip:r,children:i,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:a,...u}=e,c=ty(tE,r),h=tu(r),{onClose:d}=c;return n.useEffect(()=>(document.addEventListener(th,d),()=>document.removeEventListener(th,d)),[d]),n.useEffect(()=>{if(c.trigger){let e=e=>{let t=e.target;(null==t?void 0:t.contains(c.trigger))&&d()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[c.trigger,d]),(0,eH.jsx)(l.XB,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,eH.jsxs)(e8,{"data-state":c.stateAttribute,...h,...u,ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[(0,eH.jsx)(tP,{children:i}),(0,eH.jsx)(tk,{scope:r,isInside:!0,children:(0,eH.jsx)(to.fC,{id:c.contentId,role:"tooltip",children:s||i})})]})})});tT.displayName=tE;var tR="TooltipArrow";n.forwardRef((e,t)=>{let{__scopeTooltip:r,...n}=e,i=tu(r);return tA(tR,r).isInside?null:(0,eH.jsx)(e7,{...i,...n,ref:t})}).displayName=tR;var tC=tp,tj=tv,tI=tw,tD=tT},6606:function(e,t,r){"use strict";r.d(t,{W:function(){return i}});var n=r(2265);function i(e){let t=n.useRef(e);return n.useEffect(()=>{t.current=e}),n.useMemo(()=>(...e)=>t.current?.(...e),[])}},886:function(e,t,r){"use strict";r.d(t,{T:function(){return a}});var n,i=r(2265),s=r(1188),o=(n||(n=r.t(i,2)))[" useInsertionEffect ".trim().toString()]||s.b;function a({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){let[s,a,l]=function({defaultProp:e,onChange:t}){let[r,n]=i.useState(e),s=i.useRef(r),a=i.useRef(t);return o(()=>{a.current=t},[t]),i.useEffect(()=>{s.current!==r&&(a.current?.(r),s.current=r)},[r,s]),[r,n,a]}({defaultProp:t,onChange:r}),u=void 0!==e,c=u?e:s;{let t=i.useRef(void 0!==e);i.useEffect(()=>{let e=t.current;if(e!==u){let t=u?"controlled":"uncontrolled";console.warn(`${n} is changing from ${e?"controlled":"uncontrolled"} to ${t}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=u},[u,n])}return[c,i.useCallback(t=>{if(u){let r="function"==typeof t?t(e):t;r!==e&&l.current?.(r)}else a(t)},[u,e,a,l])]}Symbol("RADIX:SYNC_STATE")},1188:function(e,t,r){"use strict";r.d(t,{b:function(){return i}});var n=r(2265),i=globalThis?.document?n.useLayoutEffect:()=>{}},5098:function(e,t,r){"use strict";r.d(t,{TX:function(){return a},fC:function(){return l}});var n=r(2265),i=r(6840),s=r(7437),o=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),a=n.forwardRef((e,t)=>
37(0,s.jsx)(i.WV.span,{...e,ref:t,style:{...o,...e.style}}));a.displayName="VisuallyHidden";var l=a},9066:function(e,t,r){"use strict";r.d(t,{eI:function(){return d}});var n,i=r(7487);let{PostgrestError:s,FunctionsHttpError:o,FunctionsFetchError:a,FunctionsRelayError:l,FunctionsError:u,FunctionRegion:c,SupabaseClient:h,createClient:d,GoTrueAdminApi:f,GoTrueClient:p,AuthAdminApi:m,AuthClient:g,navigatorLock:y,NavigatorLockAcquireTimeoutError:v,lockInternals:b,processLock:w,SIGN_OUT_SCOPES:x,AuthError:_,AuthApiError:E,AuthUnknownError:T,CustomAuthError:S,AuthSessionMissingError:k,AuthInvalidTokenResponseError:A,AuthInvalidCredentialsError:P,AuthImplicitGrantRedirectError:O,AuthPKCEGrantCodeExchangeError:R,AuthRetryableFetchError:C,AuthWeakPasswordError:j,AuthInvalidJwtError:I,isAuthError:D,isAuthApiError:N,isAuthSessionMissingError:M,isAuthImplicitGrantRedirectError:L,isAuthRetryableFetchError:$,isAuthWeakPasswordError:U,RealtimePresence:B,RealtimeChannel:F,RealtimeClient:V,REALTIME_LISTEN_TYPES:q,REALTIME_POSTGRES_CHANGES_LISTEN_EVENT:W,REALTIME_PRESENCE_LISTEN_EVENTS:z,REALTIME_SUBSCRIBE_STATES:H,REALTIME_CHANNEL_STATES:K}=i||n||(n=r.t(i,2));i||n||(n=r.t(i,2))},1800:function(e,t,r){"use strict";r.d(t,{S:function(){return M}});var n="undefined"==typeof window||"Deno"in globalThis;function i(){}function s(e,t){return"function"==typeof e?e(t):e}function o(e,t){let{type:r="all",exact:n,fetchStatus:i,predicate:s,queryKey:o,stale:a}=e;if(o){if(n){if(t.queryHash!==l(o,t.options))return!1}else if(!c(t.queryKey,o))return!1}if("all"!==r){let e=t.isActive();if("active"===r&&!e||"inactive"===r&&e)return!1}return("boolean"!=typeof a||t.isStale()===a)&&(!i||i===t.state.fetchStatus)&&(!s||!!s(t))}function a(e,t){let{exact:r,status:n,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(r){if(u(t.options.mutationKey)!==u(s))return!1}else if(!c(t.options.mutationKey,s))return!1}return(!n||t.state.status===n)&&(!i||!!i(t))}function l(e,t){return(t?.queryKeyHashFn||u)(e)}function u(e){return JSON.stringify(e,(e,t)=>d(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function c(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).every(r=>c(e[r],t[r]))}function h(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function d(e){if(!f(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!!(f(r)&&r.hasOwnProperty("isPrototypeOf"))&&Object.getPrototypeOf(e)===Object.prototype}function f(e){return"[object Object]"===Object.prototype.toString.call(e)}function p(e,t,r=0){let n=[...e,t];return r&&n.length>r?n.slice(1):n}function m(e,t,r=0){let n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var g=Symbol();function y(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==g?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))}var v=e=>setTimeout(e,0),b=function(){let e=[],t=0,r=e=>{e()},n=e=>{e()},i=v,s=n=>{t?e.push(n):i(()=>{r(n)})},o=()=>{let t=e;e=[],t.length&&i(()=>{n(()=>{t.forEach(e=>{r(e)})})})};return{batch:e=>{let r;t++;try{r=e()}finally{--t||o()}return r},batchCalls:e=>(...t)=>{s(()=>{e(...t)})},schedule:s,setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{n=e},setScheduler:e=>{i=e}}}(),w=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},x=new class extends w{#e;#t;#r;constructor(){super(),this.#r=e=>{if(!n&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();
37this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#e?this.#e:globalThis.document?.visibilityState!=="hidden"}},_=new class extends w{#n=!0;#t;#r;constructor(){super(),this.#r=e=>{if(!n&&window.addEventListener){let t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#n!==e&&(this.#n=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#n}};function E(e){return Math.min(1e3*2**e,3e4)}function T(e){return(e??"online")!=="online"||_.isOnline()}var S=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function k(e){return e instanceof S}function A(e){let t,r=!1,i=0,s=!1,o=function(){let e,t;let r=new Promise((r,n)=>{e=r,t=n});function n(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{n({status:"fulfilled",value:t}),e(t)},r.reject=e=>{n({status:"rejected",reason:e}),t(e)},r}(),a=()=>x.isFocused()&&("always"===e.networkMode||_.isOnline())&&e.canRun(),l=()=>T(e.networkMode)&&e.canRun(),u=r=>{s||(s=!0,e.onSuccess?.(r),t?.(),o.resolve(r))},c=r=>{s||(s=!0,e.onError?.(r),t?.(),o.reject(r))},h=()=>new Promise(r=>{t=e=>{(s||a())&&r(e)},e.onPause?.()}).then(()=>{t=void 0,s||e.onContinue?.()}),d=()=>{let t;if(s)return;let o=0===i?e.initialPromise:void 0;try{t=o??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(u).catch(t=>{if(s)return;let o=e.retry??(n?0:3),l=e.retryDelay??E,u="function"==typeof l?l(i,t):l,f=!0===o||"number"==typeof o&&i<o||"function"==typeof o&&o(i,t);if(r||!f){c(t);return}i++,e.onFail?.(i,t),new Promise(e=>{setTimeout(e,u)}).then(()=>a()?void 0:h()).then(()=>{r?c(t):d()})})};return{promise:o,cancel:t=>{s||(c(new S(t)),e.abort?.())},continue:()=>(t?.(),o),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:l,start:()=>(l()?d():h().then(d),o)}}var P=class{#i;destroy(){this.clearGcTimeout()}scheduleGc(){var e;this.clearGcTimeout(),"number"==typeof(e=this.gcTime)&&e>=0&&e!==1/0&&(this.#i=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(n?1/0:3e5))}clearGcTimeout(){this.#i&&(clearTimeout(this.#i),this.#i=void 0)}}
37,O=class extends P{#s;#o;#a;#l;#u;#c;#h;constructor(e){super(),this.#h=!1,this.#c=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#l=e.client,this.#a=this.#l.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#s=function(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,n=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}(this.options),this.state=e.state??this.#s,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#u?.promise}setOptions(e){this.options={...this.#c,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#a.remove(this)}setData(e,t){var r,n;let i=(r=this.state.data,"function"==typeof(n=this.options).structuralSharing?n.structuralSharing(r,e):!1!==n.structuralSharing?function e(t,r){if(t===r)return t;let n=h(t)&&h(r);if(n||d(t)&&d(r)){let i=n?t:Object.keys(t),s=i.length,o=n?r:Object.keys(r),a=o.length,l=n?[]:{},u=new Set(i),c=0;for(let i=0;i<a;i++){let s=n?i:o[i];(!n&&u.has(s)||n)&&void 0===t[s]&&void 0===r[s]?(l[s]=void 0,c++):(l[s]=e(t[s],r[s]),l[s]===t[s]&&void 0!==t[s]&&c++)}return s===a&&c===s?t:l}return r}(r,e):e);return this.#d({data:i,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),i}setState(e,t){this.#d({type:"setState",state:e,setStateOptions:t})}cancel(e){let t=this.#u?.promise;return this.#u?.cancel(e),t?t.then(i).catch(i):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#s)}isActive(){return this.observers.some(e=>{var t;return!1!==("function"==typeof(t=e.options.enabled)?t(this):t)})}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===g||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===s(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!Math.max(this.state.dataUpdatedAt+(e||0)-Date.now(),0))}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#u?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#u?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#a.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#u&&(this.#h?this.#u.cancel({revert:!0}):this.#u.cancelRetry()),this.scheduleGc()),this.#a.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#d({type:"invalidate"})}fetch(e,t){if("idle"!==this.state.fetchStatus){if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#u)return this.#u.continueRetry(),this.#u.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let r=new AbortController,n=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#h=!0,r.signal)})},i=()=>{let e=y(this.options,t),r=(()=>{let e={client:this.#l,queryKey:this.queryKey,meta:this.meta};return n(e),e})();return(this.#h=!1,this.options.persister)?this.options.persister(e,r,this):e(r)},s=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#l,state:this.state,fetchFn:i};return n(e),e})();this.options.behavior?.onFetch(s,this),this.#o=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==s.fetchOptions?.meta)&&this.#d({type:"fetch",meta:s.fetchOptions?.meta});let o=e=>{k(e)&&e.silent||this.#d({type:"error",error:e}),k(e)||(this.#a.config.onError?.(e,this),this.#a.config.onSettled?.(this.state.data,e,this)),this.scheduleGc()};return this.#u=A({initialPromise:t?.initialPromise,fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:e=>{if(void 0===e){o(Error(`${this.queryHash} data is undefined`));return}try{this.setData(e)}catch(e){o(e);return}this.#a.config.onSuccess?.(e,this),this.#a.config.onSettled?.(e,this.state.error,this),this.scheduleGc()},onError:o,onFail:(e,t)=>{this.#d({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#d({type:"pause"})},onContinue:()=>{this.#d({type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0}),this.#u.start()}#d(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":var r;return{...t,...(r=t.data,{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:T(this.options.networkMode)?"fetching":"paused",...void 0===r&&{error:null,status:"pending"}}),fetchMeta:e.meta??null};case"success":return this.#o=void 0,{...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":let n=e.error;if(k(n)&&n.revert&&this.#o)return{...this.#o,fetchStatus:"idle"};
37return{...t,error:n,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),b.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#a.notify({query:this,type:"updated",action:e})})}},R=class extends w{constructor(e={}){super(),this.config=e,this.#f=new Map}#f;build(e,t,r){let n=t.queryKey,i=t.queryHash??l(n,t),s=this.get(i);return s||(s=new O({client:e,queryKey:n,queryHash:i,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(n)}),this.add(s)),s}add(e){this.#f.has(e.queryHash)||(this.#f.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#f.get(e.queryHash);t&&(e.destroy(),t===e&&this.#f.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){b.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#f.get(e)}getAll(){return[...this.#f.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>o(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>o(e,t)):t}notify(e){b.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){b.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){b.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},C=class extends P{#p;#m;#u;constructor(e){super(),this.mutationId=e.mutationId,this.#m=e.mutationCache,this.#p=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#p.includes(e)||(this.#p.push(e),this.clearGcTimeout(),this.#m.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#p=this.#p.filter(t=>t!==e),this.scheduleGc(),this.#m.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#p.length||("pending"===this.state.status?this.scheduleGc():this.#m.remove(this))}continue(){return this.#u?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#d({type:"continue"})};this.#u=A({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#d({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#d({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#m.canRun(this)});let r="pending"===this.state.status,n=!this.#u.canStart();try{if(r)t();else{this.#d({type:"pending",variables:e,isPaused:n}),await this.#m.config.onMutate?.(e,this);let t=await this.options.onMutate?.(e);t!==this.state.context&&this.#d({type:"pending",context:t,variables:e,isPaused:n})}let i=await this.#u.start();return await this.#m.config.onSuccess?.(i,e,this.state.context,this),await this.options.onSuccess?.(i,e,this.state.context),await this.#m.config.onSettled?.(i,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(i,null,e,this.state.context),this.#d({type:"success",data:i}),i}catch(t){try{throw await this.#m.config.onError?.(t,e,this.state.context,this),await this.options.onError?.(t,e,this.state.context),await this.#m.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,t,e,this.state.context),t}finally{this.#d({type:"error",error:t})}}finally{this.#m.runNext(this)}}#d(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPau
37sed:!1,status:"error"}}})(this.state),b.batch(()=>{this.#p.forEach(t=>{t.onMutationUpdate(e)}),this.#m.notify({mutation:this,type:"updated",action:e})})}},j=class extends w{constructor(e={}){super(),this.config=e,this.#g=new Set,this.#y=new Map,this.#v=0}#g;#y;#v;build(e,t,r){let n=new C({mutationCache:this,mutationId:++this.#v,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#g.add(e);let t=I(e);if("string"==typeof t){let r=this.#y.get(t);r?r.push(e):this.#y.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#g.delete(e)){let t=I(e);if("string"==typeof t){let r=this.#y.get(t);if(r){if(r.length>1){let t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#y.delete(t)}}}this.notify({type:"removed",mutation:e})}canRun(e){let t=I(e);if("string"!=typeof t)return!0;{let r=this.#y.get(t),n=r?.find(e=>"pending"===e.state.status);return!n||n===e}}runNext(e){let t=I(e);if("string"!=typeof t)return Promise.resolve();{let r=this.#y.get(t)?.find(t=>t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}}clear(){b.batch(()=>{this.#g.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#g.clear(),this.#y.clear()})}getAll(){return Array.from(this.#g)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>a(t,e))}findAll(e={}){return this.getAll().filter(t=>a(e,t))}notify(e){b.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>
37e.state.isPaused);return b.batch(()=>Promise.all(e.map(e=>e.continue().catch(i))))}};function I(e){return e.options.scope?.id}function D(e){return{onFetch:(t,r)=>{let n=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,s=t.state.data?.pages||[],o=t.state.data?.pageParams||[],a={pages:[],pageParams:[]},l=0,u=async()=>{let r=!1,u=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(t.signal.aborted?r=!0:t.signal.addEventListener("abort",()=>{r=!0}),t.signal)})},c=y(t.options,t.fetchOptions),h=async(e,n,i)=>{if(r)return Promise.reject();if(null==n&&e.pages.length)return Promise.resolve(e);let s=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:n,direction:i?"backward":"forward",meta:t.options.meta};return u(e),e})(),o=await c(s),{maxPages:a}=t.options,l=i?m:p;return{pages:l(e.pages,o,a),pageParams:l(e.pageParams,n,a)}};if(i&&s.length){let e="backward"===i,t={pages:s,pageParams:o},r=(e?function(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}:N)(n,t);a=await h(t,r,e)}else{let t=e??s.length;do{let e=0===l?o[0]??n.initialPageParam:N(n,a);if(l>0&&null==e)break;a=await h(a,e),l++}while(l<t)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=u}}}function N(e,{pages:t,pageParams:r}){let n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}var M=class{#b;#m;#c;#w;#x;#_;#E;#T;constructor(e={}){this.#b=e.queryCache||new R,this.#m=e.mutationCache||new j,this.#c=e.defaultOptions||{},this.#w=new Map,this.#x=new Map,this.#_=0}mount(){this.#_++,1===this.#_&&(this.#E=x.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#b.onFocus())}),this.#T=_.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#b.onOnline())}))}unmount(){this.#_--,0===this.#_&&(this.#E?.(),this.#E=void 0,this.#T?.(),this.#T=void 0)}isFetching(e){return this.#b.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#m.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#b.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),r=this.#b.build(this,t),n=r.state.data;return void 0===n?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(s(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return this.#b.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,r){let n=this.defaultQueryOptions({queryKey:e}),i=this.#b.get(n.queryHash),s=i?.state.data,o="function"==typeof t?t(s):t;if(void 0!==o)return this.#b.build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return b.batch(()=>this.#b.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#b.get(t.queryHash)?.state}removeQueries(e){let t=this.#b;b.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let r=this.#b;return b.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let r={revert:!0,...t};return Promise.all(b.batch(()=>this.#b.findAll(e).map(e=>e.cancel(r)))).then(i).catch(i)}invalidateQueries(e,t={}){return b.batch(()=>(this.#b.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,t={}){let r={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(b.batch(()=>this.#b.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,r);return r.throwOnError||(t=t.catch(i)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(i)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let r=this.#b.build(this,t);return r.isStaleByTime(s(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(i).catch(i)}fetchInfiniteQuery(e){return e.behavior=D(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(i).catch(i)}ensureInfiniteQueryData(e){return e.behavior=D(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return _.isOnline()?this.#m.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#b}getMutationCache(){return this.#m}getDefaultOptions(){return this.#c}setDefaultOptions(e){this.#c=e}setQueryDefaults(e,t){this.#w.set(u(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#w.values()],r={};return t.forEach(t=>{c(e,t.queryKey)&&Object.assign(r,t.defaultOptions)}),r}setMutationDefaults(e,t){this.#x.set(u(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#x.values()],r={};return t.forEach(t=>{c(e,t.mutationKey)&&Object.assign(r,t.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#c.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=l(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===g&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#c.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#b.clear(),this.#m.clear()}}},9827:function(e,t,r){"use strict";r.d(t,{aH:function(){return o}});var n=r(2265),i=r(7437),s=n.createContext(void 0),o=e=>{let{client:t,children:r}=e;return n.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),(0,i.jsx)(s.Provider,{value:t,children:r})}},535:function(e,t,r){"use strict";r.d(t,{j:function(){return o}});var n=r(1994);let i=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,s=n.W,o=(e,t)=>r=>{var n;if((null==t?void 0:t.variants)==null)return s(e,null==r?void 0:r.class,null==r?void 0:r.className);let{variants:o,defaultVariants:a}=t,l=Object.keys(o).map(e=>{let t=null==r?void 0:r[e],n=null==a?void 0:a[e];if(null===t)return null;let s=i(t)||i(n);return o[e][s]}),u=r&&Object.entries(r).reduce((e,t)=>
37{let[r,n]=t;return void 0===n||(e[r]=n),e},{});return s(e,l,null==t?void 0:null===(n=t.compoundVariants)||void 0===n?void 0:n.reduce((e,t)=>{let{class:r,className:n,...i}=t;return Object.entries(i).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...a,...u}[t]):({...a,...u})[t]===r})?[...e,r,n]:e},[]),null==r?void 0:r.class,null==r?void 0:r.className)}},1994:function(e,t,r){"use strict";function n(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=function e(t){var r,n,i="";if("string"==typeof t||"number"==typeof t)i+=t;else if("object"==typeof t){if(Array.isArray(t)){var s=t.length;for(r=0;r<s;r++)t[r]&&(n=e(t[r]))&&(i&&(i+=" "),i+=n)}else for(n in t)t[n]&&(i&&(i+=" "),i+=n)}return i}(e))&&(n&&(n+=" "),n+=t);return n}r.d(t,{W:function(){return n}})},7586:function(e,t,r){"use strict";r.d(t,{M:function(){return b}});var n=r(7437),i=r(2265),s=r(8881),o=r(3576),a=r(1534),l=r(4252),u=r(3537),c=r(5750);function h(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}class d extends i.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){let e=t.offsetParent,r=(0,u.R)(e)&&e.offsetWidth||0,n=this.props.sizeRef.current;n.height=t.offsetHeight||0,n.width=t.offsetWidth||0,n.top=t.offsetTop,n.left=t.offsetLeft,n.right=r-n.width-n.left}return null}componentDidUpdate(){}render(){return this.props.children}}function f(e){let{children:t,isPresent:r,anchorX:s,root:o}=e,a=(0,i.useId)(),l=(0,i.useRef)(null),u=(0,i.useRef)({width:0,height:0,top:0,left:0,right:0}),{nonce:f}=(0,i.useContext)(c._),p=function(...e){return i.useCallback(function(...e){return t=>{let r=!1,n=e.map(e=>{let n=h(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){let r=n[t];"function"==typeof r?r():h(e[t],null)}}}}(...e),e)}(l,null==t?void 0:t.ref);return(0,i.useInsertionEffect)(()=>{let{width:e,height:t,top:n,left:i,right:c}=u.current;if(r||!l.current||!e||!t)return;l.current.dataset.motionPopId=a;let h=document.createElement("style");f&&(h.nonce=f);let d=null!=o?o:document.head;return d.appendChild(h),h.sheet&&h.sheet.insertRule('\n [data-motion-pop-id="'.concat(a,'"] {\n position: absolute !important;\n width: ').concat(e,"px !important;\n height: ").concat(t,"px !important;\n ").concat("left"===s?"left: ".concat(i):"right: ".concat(c),"px !important;\n top: ").concat(n,"px !important;\n }\n ")),()=>{d.contains(h)&&d.removeChild(h)}},[r]),(0,n.jsx)(d,{isPresent:r,childRef:l,sizeRef:u,children:i.cloneElement(t,{ref:p})})}let p=e=>{let{children:t,initial:r,isPresent:s,onExitComplete:a,custom:u,presenceAffectsLayout:c,mode:h,anchorX:d,root:p}=e,g=(0,o.h)(m),y=(0,i.useId)(),v=!0,b=(0,i.useMemo)(()=>(v=!1,{id:y,initial:r,isPresent:s,custom:u,onExitComplete:e=>{for(let t of(g.set(e,!0),g.values()))if(!t)return;a&&a()},register:e=>(g.set(e,!1),()=>g.delete(e))}),[s,g,a]);return c&&v&&(b={...b}),(0,i.useMemo)(()=>{g.forEach((e,t)=>g.set(t,!1))},[s]),i.useEffect(()=>{s||g.size||!a||a()},[s]),"popLayout"===h&&(t=(0,n.jsx)(f,{isPresent:s,anchorX:d,root:p,children:t})),(0,n.jsx)(l.O.Provider,{value:b,children:t})};function m(){return new Map}var g=r(9637);let y=e=>e.key||"";function v(e){let t=[];return i.Children.forEach(e,e=>{(0,i.isValidElement)(e)&&t.push(e)}),t}let b=e=>{let{children:t,custom:r,initial:l=!0,onExitComplete:u,presenceAffectsLayout:c=!0,mode:h="sync",propagate:d=!1,anchorX:f="left",root:m}=e,[b,w]=(0,g.oO)(d),x=(0,i.useMemo)(()=>v(t),[t]),_=d&&!b?[]:x.map(y),E=(0,i.useRef)(!0),T=(0,i.useRef)(x),S=(0,o.h)(()=>new Map),[k,A]=(0,i.useState)(x),[P,O]=(0,i.useState)(x);(0,a.L)(()=>{E.current=!1,T.current=x;for(let e=0;e<P.length;e++){let t=y(P[e]);_.includes(t)?S.delete(t):!0!==S.get(t)&&S.set(t,!1)}},[P,_.length,_.join("-")]);let R=[];if(x!==k){let e=[...x];for(let t=0;t<P.length;t++){let r=P[t],n=y(r);_.includes(n)||(e.splice(t,0,r),R.push(r))}return"wait"===h&&R.length&&(e=R),O(v(e)),A(x),null}let{forceRender:C}=(0,i.useContext)(s.p);return(0,n.jsx)(n.Fragment,{children:P.map(e=>{let t=y(e),i=(!d||!!b)&&(x===P||_.includes(t));return(0,n.jsx)(p,{isPresent:i,initial:(!E.current||!!l)&&void 0,custom:r,presenceAffectsLayout:c,mode:h,root:m,onExitComplete:i?void 0:()=>
37{if(!S.has(t))return;S.set(t,!0);let e=!0;S.forEach(t=>{t||(e=!1)}),e&&(null==C||C(),O(T.current),d&&(null==w||w()),u&&u())},anchorX:f,children:e},t)})})}},9637:function(e,t,r){"use strict";r.d(t,{oO:function(){return s}});var n=r(2265),i=r(4252);function s(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=(0,n.useContext)(i.O);if(null===t)return[!0,null];let{isPresent:r,onExitComplete:s,register:o}=t,a=(0,n.useId)();(0,n.useEffect)(()=>{if(e)return o(a)},[e]);let l=(0,n.useCallback)(()=>e&&s&&s(a),[a,s,e]);return!r&&s?[!1,l]:[!0]}},8881:function(e,t,r){"use strict";r.d(t,{p:function(){return n}});let n=(0,r(2265).createContext)({})},5750:function(e,t,r){"use strict";r.d(t,{_:function(){return n}});let n=(0,r(2265).createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"})},4252:function(e,t,r){"use strict";r.d(t,{O:function(){return n}});let n=(0,r(2265).createContext)(null)},8239:function(e,t,r){"use strict";let n;r.d(t,{E:function(){return sP}});var i,s=r(2265);let o=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],a=new Set(o),l=e=>180*e/Math.PI,u=e=>h(l(Math.atan2(e[1],e[0]))),c={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:u,rotateZ:u,skewX:e=>l(Math.atan(e[1])),skewY:e=>l(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},h=e=>((e%=360)<0&&(e+=360),e),d=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),f=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),p={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:d,scaleY:f,scale:e=>(d(e)+f(e))/2,rotateX:e=>h(l(Math.atan2(e[6],e[5]))),rotateY:e=>h(l(Math.atan2(-e[2],e[0]))),rotateZ:u,rotate:u,skewX:e=>l(Math.atan(e[4])),skewY:e=>l(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function m(e){return e.includes("scale")?1:0}function g(e,t){let r,n;if(!e||"none"===e)return m(t);let i=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);if(i)r=p,n=i;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=c,n=t}if(!n)return m(t);let s=r[t],o=n[1].split(",").map(v);return"function"==typeof s?s(o):o[s]}let y=(e,t)=>{let{transform:r="none"}=getComputedStyle(e);return g(r,t)};function v(e){return parseFloat(e.trim())}let b=e=>t=>"string"==typeof t&&t.startsWith(e),w=b("--"),x=b("var(--"),_=e=>!!x(e)&&E.test(e.split("/*")[0].trim()),E=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function T({top:e,left:t,right:r,bottom:n}){return{x:{min:t,max:r},y:{min:e,max:n}}}let S=(e,t,r)=>e+(t-e)*r;function k(e){return void 0===e||1===e}function A({scale:e,scaleX:t,scaleY:r}){return!k(e)||!k(t)||!k(r)}function P(e){return A(e)||O(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function O(e){var t,r;return(t=e.x)&&"0%"!==t||(r=e.y)&&"0%"!==r}function R(e,t,r,n,i){return void 0!==i&&(e=n+i*(e-n)),n+r*(e-n)+t}function C(e,t=0,r=1,n,i){e.min=R(e.min,t,r,n,i),e.max=R(e.max,t,r,n,i)}function j(e,{x:t,y:r}){C(e.x,t.translate,t.scale,t.originPoint),C(e.y,r.translate,r.scale,r.originPoint)}function I(e,t){e.min=e.min+t,e.max=e.max+t}function D(e,t,r,n,i=.5){let s=S(e.min,e.max,i);C(e,t,r,s,n)}function N(e,t){D(e.x,t.x,t.scaleX,t.scale,t.originX),D(e.y,t.y,t.scaleY,t.scale,t.originY)}function M(e,t){return T(function(e,t){if(!t)return e;let r=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}(e.getBoundingClientRect(),t))}let L=new Set(["width","height","top","left","right","bottom",...o]),$=(e,t,r)=>r>t?t:r<e?e:r,U={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},B={...U,transform:e=>$(0,1,e)},F={...U,default:1},V=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),q=V("deg"),W=V("%"),z=V("px"),H=V("vh"),K=V("vw"),G={...W,parse:e=>W.parse(e)/100,transform:e=>W.transform(100*e)},J=e=>t=>t.test(e),Y=[U,z,W,q,K,H,{test:e=>"auto"===e,parse:e=>e}],X=e=>Y.find(J(e)),Q=()=>{},Z=()=>{},ee=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),et=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u,er=e=>e===U||e===z,en=new Set(["x","y","z"]),ei=o.filter(e=>!en.has(e)),es={width:({x:e},{paddingLeft:t="0",paddingRight:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),height:({y:e},{paddingTop:t="0",paddingBottom:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>g(t,"x"),y:(e,{transform:t})=>g(t,"y")};es.translateX=es.x,es.translateY=es.y;let eo=e=>e,ea={},el=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],eu={value:null,addProjectionMetrics:null};function ec(e,t){let r=!1,n=!0,i={delta:0,timestamp:0,isProcessing:!1},s=()=>r=!0,o=el.reduce((e,r)=>(e[r]=function(e,t){let r=new Set,n=new Set,i=!1,s=!1,o=new WeakSet,a={delta:0,timestamp:0,isProcessing:!1},l=0;function u(t){o.has(t)&&(c.schedule(t),e()),l++,t(a)}let c={schedule:(e,t=!1,s=!1)=>{let a=s&&i?r:n;return t&&o.add(e),a.has(e)||a.add(e),e},cancel:e=>{n.delete(e),o.delete(e)},process:e=>{if(a=e,i){s=!0;return}i=!0,[r,n]=[n,r],r.forEach(u),t&&eu.value&&eu.value.frameloop[t].push(l),l=0,r.clear(),i=!1,s&&(s=!1,c.process(e))}};return c}(s,t?r:void 0),e),{}),{setup:a,read:l,resolveKeyframes:u,preUpdate:c,update:h,preRender:d,render:f,postRender:p}=o,m=()=>{let s=ea.useManualTiming?i.timestamp:performance.now();r=!1,ea.useManualTiming||(i.delta=n?1e3/60:Math.max(Math.min(s-i.timestamp,40),1)),i.timestamp=s,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),c.process(i),h.process(i),d.process(i),f.process(i),p.process(i),i.isProcessing=!1,r&&t&&(n=!1,e(m))},g=()=>{r=!0,n=!0,i.isProcessing||e(m)};return{schedule:el.reduce((e,t)=>
37{let n=o[t];return e[t]=(e,t=!1,i=!1)=>(r||g(),n.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<el.length;t++)o[el[t]].cancel(e)},state:i,steps:o}}let{schedule:eh,cancel:ed,state:ef,steps:ep}=ec("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:eo,!0),em=new Set,eg=!1,ey=!1,ev=!1;function eb(){if(ey){let e=Array.from(em).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),r=new Map;t.forEach(e=>{let t=function(e){let t=[];return ei.forEach(r=>{let n=e.getValue(r);void 0!==n&&(t.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),t}(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=r.get(e);t&&t.forEach(([t,r])=>{e.getValue(t)?.set(r)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)})}ey=!1,eg=!1,em.forEach(e=>e.complete(ev)),em.clear()}function ew(){em.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ey=!0)})}class ex{constructor(e,t,r,n,i,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=r,this.motionValue=n,this.element=i,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(em.add(this),eg||(eg=!0,eh.read(ew),eh.resolveKeyframes(eb))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:r,motionValue:n}=this;if(null===e[0]){let i=n?.get(),s=e[e.length-1];if(void 0!==i)e[0]=i;else if(r&&t){let n=r.readValue(t,s);null!=n&&(e[0]=n)}void 0===e[0]&&(e[0]=s),n&&void 0===i&&n.set(e[0])}!function(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),em.delete(this)}cancel(){"scheduled"===this.state&&(em.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}let e_=e=>/^0[^.\s]+$/u.test(e),eE=e=>Math.round(1e5*e)/1e5,eT=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,eS=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ek=(e,t)=>r=>!!("string"==typeof r&&eS.test(r)&&r.startsWith(e)||t&&null!=r&&Object.prototype.hasOwnProperty.call(r,t)),eA=(e,t,r)=>n=>{if("string"!=typeof n)return n;let[i,s,o,a]=n.match(eT);return{[e]:parseFloat(i),[t]:parseFloat(s),[r]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},eP=e=>$(0,255,e),eO={...U,transform:e=>Math.round(eP(e))},eR={test:ek("rgb","red"),parse:eA("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+eO.transform(e)+", "+eO.transform(t)+", "+eO.transform(r)+", "+eE(B.transform(n))+")"},eC={test:ek("#"),parse:function(e){let t="",r="",n="",i="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),n=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),n=e.substring(3,4),i=e.substring(4,5),t+=t,r+=r,n+=n,i+=i),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}},transform:eR.transform},ej={test:ek("hsl","hue"),parse:eA("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+W.transform(eE(t))+", "+W.transform(eE(r))+", "+eE(B.transform(n))+")"},eI={test:e=>eR.test(e)||eC.test(e)||ej.test(e),parse:e=>eR.test(e)?eR.parse(e):ej.test(e)?ej.parse(e):eC.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?eR.transform(e):ej.transform(e),getAnimatableNone:e=>{let t=eI.parse(e);return t.alpha=0,eI.transform(t)}},eD=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,eN="number",eM="color",eL=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function e$(e){let t=e.toString(),r=[],n={color:[],number:[],var:[]},i=[],s=0,o=t.replace(eL,e=>(eI.test(e)?(n.color.push(s),i.push(eM),r.push(eI.parse(e))):e.startsWith("var(")?(n.var.push(s),i.push("var"),r.push(e)):(n.number.push(s),i.push(eN),r.push(parseFloat(e))),++s,"${}")).split("${}");return{values:r,split:o,indexes:n,types:i}}function eU(e){return e$(e).values}function eB(e){let{split:t,types:r}=e$(e),n=t.length;return e=>{let i="";for(let s=0;s<n;s++)if(i+=t[s],void 0!==e[s]){let t=r[s];t===eN?i+=eE(e[s]):t===eM?i+=eI.transform(e[s]):i+=e[s]}return i}}let eF=e=>"number"==typeof e?0:eI.test(e)?eI.getAnimatableNone(e):e,eV={test:function(e){return isNaN(e)&&"string"==typeof e&&(e.match(eT)?.length||0)+(e.match(eD)?.length||0)>0},parse:eU,createTransformer:eB,getAnimatableNone:function(e){let t=eU(e);return eB(e)(t.map(eF))}},eq=new Set(["brightness","contrast","saturate","opacity"]);function eW(e){let[t,r]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;let[n]=r.match(eT)||[];if(!n)return e;let i=r.replace(n,""),s=eq.has(t)?1:0;return n!==r&&(s*=100),t+"("+s+i+")"}let ez=/\b([a-z-]*)\(.*?\)/gu,eH={...eV,getAnimatableNone:e=>{let t=e.match(ez);return t?t.map(eW).join(" "):e}},eK={...U,transform:Math.round},eG={borderWidth:z,borderTopWidth:z,borderRightWidth:z,borderBottomWidth:z,borderLeftWidth:z,borderRadius:z,radius:z,borderTopLeftRadius:z,borderTopRightRadius:z,borderBottomRightRadius:z,borderBottomLeftRadius:z,width:z,maxWidth:z,height:z,maxHeight:z,top:z,right:z,bottom:z,left:z,padding:z,paddingTop:z,paddingRight:z,paddingBottom:z,paddingLeft:z,margin:z,marginTop:z,marginRight:z,marginBottom:z,marginLeft:z,backgroundPositionX:z,backgroundPositionY:z,rotate:q,rotateX:q,rotateY:q,rotateZ:q,scale:F,scaleX:F,scaleY:F,scaleZ:F,skew:q,skewX:q,skewY:q,distance:z,translateX:z,translateY:z,translateZ:z,x:z,y:z,z:z,perspective:z,transformPerspective:z,opacity:B,originX:G,originY:G,originZ:z,zIndex:eK,fillOpacity:B,strokeOpacity:B,numOctaves:eK},eJ={...eG,color:eI,backgroundColor:eI,outlineColor:eI,fill:eI,stroke:eI,borderColor:eI,borderTopColor:eI,borderRightColor:eI,borderBottomColor:eI,borderLeftColor:eI,filter:eH,WebkitFilter:eH},eY=e=>eJ[e];function eX(e,t){let r=eY(e);return r!==eH&&(r=eV),r.getAnimatableNone?r.getAnimatableNone(t):void 0}
37let eQ=new Set(["auto","none","0"]);class eZ extends ex{constructor(e,t,r,n,i){super(e,t,r,n,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:r}=this;if(!t||!t.current)return;super.readKeyframes();for(let r=0;r<e.length;r++){let n=e[r];if("string"==typeof n&&_(n=n.trim())){let i=function e(t,r,n=1){Z(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");let[i,s]=function(e){let t=et.exec(e);if(!t)return[,];let[,r,n,i]=t;return[`--${r??n}`,i]}(t);if(!i)return;let o=window.getComputedStyle(r).getPropertyValue(i);if(o){let e=o.trim();return ee(e)?parseFloat(e):e}return _(s)?e(s,r,n+1):s}(n,t.current);void 0!==i&&(e[r]=i),r===e.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!L.has(r)||2!==e.length)return;let[n,i]=e,s=X(n),o=X(i);if(s!==o){if(er(s)&&er(o))for(let t=0;t<e.length;t++){let r=e[t];"string"==typeof r&&(e[t]=parseFloat(r))}else es[r]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,r=[];for(let t=0;t<e.length;t++){var n;(null===e[t]||("number"==typeof(n=e[t])?0===n:null===n||"none"===n||"0"===n||e_(n)))&&r.push(t)}r.length&&function(e,t,r){let n,i=0;for(;i<e.length&&!n;){let t=e[i];"string"==typeof t&&!eQ.has(t)&&e$(t).values.length&&(n=e[i]),i++}if(n&&r)for(let i of t)e[i]=eX(r,n)}(e,r,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:r}=this;if(!e||!e.current)return;"height"===r&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=es[r](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let n=t[t.length-1];void 0!==n&&e.getValue(r,n).jump(n,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:r}=this;if(!e||!e.current)return;let n=e.getValue(t);n&&n.jump(this.measuredOrigin,!1);let i=r.length-1,s=r[i];r[i]=es[t](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==s&&void 0===this.finalKeyframe&&(this.finalKeyframe=s),this.removedTransforms?.length&&this.removedTransforms.forEac
37h(([t,r])=>{e.getValue(t).set(r)}),this.resolveNoneKeyframes()}}let e0=e=>!!(e&&e.getVelocity);function e1(){n=void 0}let e2={now:()=>(void 0===n&&e2.set(ef.isProcessing||ea.useManualTiming?ef.timestamp:performance.now()),n),set:e=>{n=e,queueMicrotask(e1)}};function e5(e,t){-1===e.indexOf(t)&&e.push(t)}function e6(e,t){let r=e.indexOf(t);r>-1&&e.splice(r,1)}class e3{constructor(){this.subscriptions=[]}add(e){return e5(this.subscriptions,e),()=>e6(this.subscriptions,e)}notify(e,t,r){let n=this.subscriptions.length;if(n){if(1===n)this.subscriptions[0](e,t,r);else for(let i=0;i<n;i++){let n=this.subscriptions[i];n&&n(e,t,r)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}let e8=e=>!isNaN(parseFloat(e)),e4={current:void 0};class e9{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=e2.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=e2.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=e8(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new e3);let r=this.events[e].add(t);return"change"===e?()=>{r(),eh.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,r){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return e4.current&&e4.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){var e;let t=e2.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;let r=Math.min(this.updatedAt-this.prevUpdatedAt,30);return e=parseFloat(this.current)-parseFloat(this.prevFrameValue),r?1e3/r*e:0}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function e7(e,t){return new e9(e,t)}let te=[...Y,eI,eV],tt=e=>te.find(J(e)),{schedule:tr,cancel:tn}=ec(queueMicrotask,!1),ti={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},ts={};for(let e in ti)ts[e]={isEnabled:t=>ti[e].some(e=>!!t[e])};let to=()=>({translate:0,scale:1,origin:0,originPoint:0}),ta=()=>({x:to(),y:to()}),tl=()=>({min:0,max:0}),tu=()=>({x:tl(),y:tl()});var tc=r(4563);let th={current:null},td={current:!1},tf=new WeakMap;function tp(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}function tm(e){return"string"==typeof e||Array.isArray(e)}let tg=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ty=["initial",...tg];function tv(e){return tp(e.animate)||ty.some(t=>tm(e[t]))}function tb(e){return!!(tv(e)||e.variants)}function tw(e){let t=[{},{}];
37return e?.values.forEach((e,r)=>{t[0][r]=e.get(),t[1][r]=e.getVelocity()}),t}function tx(e,t,r,n){if("function"==typeof t){let[i,s]=tw(n);t=t(void 0!==r?r:e.custom,i,s)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){let[i,s]=tw(n);t=t(void 0!==r?r:e.custom,i,s)}return t}let t_=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class tE{scrapeMotionValuesFromProps(e,t,r){return{}}constructor({parent:e,props:t,presenceContext:r,reducedMotionConfig:n,blockInitialAnimation:i,visualState:s},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=ex,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=e2.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,eh.render(this.render,!1,!0))};let{latestValues:a,renderState:l}=s;this.latestValues=a,this.baseTarget={...a},this.initialValues=t.initial?{...a}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=n,this.options=o,this.blockInitialAnimation=!!i,this.isControllingVariants=tv(t),this.isVariantNode=tb(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...c}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in c){let t=c[e];void 0!==a[e]&&e0(t)&&t.set(a[e])}}mount(e){this.current=e,tf.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),td.current||function(){if(td.current=!0,tc.j){if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>th.current=e.matches;e.addEventListener("change",t),t()}else th.current=!1}}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||th.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){for(let e in this.projection&&this.projection.unmount(),ed(this.notifyUpdate),ed(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this),this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){let r;this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();let n=a.has(e);n&&this.onBindTransform&&this.onBindTransform();let i=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&eh.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{i(),r&&r(),t.owner&&t.stop()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in ts){let t=ts[e];if(!t)continue;let{isEnabled:r,Feature:n}=t;if(!this.features[e]&&n&&r(this.props)&&(this.features[e]=new n(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):tu()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<t_.length;t++){let r=t_[t];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);let n=e["on"+r];n&&(this.propEventSubscriptions[r]=this.on(r,n))}this.prevMotionValues=function(e,t,r){for(let n in t){let i=t[n],s=r[n];if(e0(i))e.addValue(n,i);else if(e0(s))e.addValue(n,e7(i,{owner:e}));else if(s!==i){if(e.hasValue(n)){let t=e.getValue(n);!0===t.liveStyle?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(n);e.addValue(n,e7(void 0!==t?t:i,{owner:e}))}}}for(let n in r)void 0===t[n]&&e.removeValue(n);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}
37addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let r=this.values.get(e);t!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return void 0===r&&void 0!==t&&(r=e7(null===t?void 0:t,{owner:this}),this.addValue(e,r)),r}readValue(e,t){let r=void 0===this.latestValues[e]&&this.current?this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];return null!=r&&("string"==typeof r&&(ee(r)||e_(r))?r=parseFloat(r):!tt(r)&&eV.test(t)&&(r=eX(e,t)),this.setBaseTarget(e,e0(r)?r.get():r)),e0(r)?r.get():r}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let t;let{initial:r}=this.props;if("string"==typeof r||"object"==typeof r){let n=tx(this.props,r,this.presenceContext?.custom);n&&(t=n[e])}if(r&&void 0!==t)return t;let n=this.getBaseTargetFromProps(this.props,e);return void 0===n||e0(n)?void 0!==this.initialValues[e]&&void 0===t?void 0:this.baseTarget[e]:n}on(e,t){return this.events[e]||(this.events[e]=new e3),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){tr.render(this.render)}}class tT extends tE{constructor(){super(...arguments),this.KeyframeResolver=eZ}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:r}){delete t[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;e0(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}let tS=(e,t)=>t&&"number"==typeof e?t.transform(e):e,tk={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},tA=o.length;function tP(e,t,r){let{style:n,vars:i,transformOrigin:s}=e,l=!1,u=!1;for(let e in t){let r=t[e];if(a.has(e)){l=!0;continue}if(w(e)){i[e]=r;continue}{let t=tS(r,eG[e]);e.startsWith("origin")?(u=!0,s[e]=t):n[e]=t}}if(!t.transform&&(l||r?n.transform=function(e,t,r){let n="",i=!0;for(let s=0;s<tA;s++){let a=o[s],l=e[a];if(void 0===l)continue;let u=!0;if(!(u="number"==typeof l?l===(a.startsWith("scale")?1:0):0===parseFloat(l))||r){let e=tS(l,eG[a]);if(!u){i=!1;let t=tk[a]||a;n+=`${t}(${e}) `}r&&(t[a]=e)}}return n=n.trim(),r?n=r(t,i?"":n):i&&(n="none"),n}(t,e.transform,r):n.transform&&(n.transform="none")),u){let{originX:e="50%",originY:t="50%",originZ:r=0}=s;n.transformOrigin=`${e} ${t} ${r}`}}function tO(e,{style:t,vars:r},n,i){let s;let o=e.style;for(s in t)o[s]=t[s];for(s in i?.applyProjectionStyles(o,n),r)o.setProperty(s,r[s])}function tR(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}let tC={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!z.test(e))return e;e=parseFloat(e)}let r=tR(e,t.target.x),n=tR(e,t.target.y);return`${r}% ${n}%`}},tj={borderRadius:{...tC,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:tC,borderTopRightRadius:tC,borderBottomLeftRadius:tC,borderBottomRightRadius:tC,boxShadow:{correct:(e,{treeScale:t,projectionDelta:r})=>{let n=eV.parse(e);if(n.length>5)return e;let i=eV.createTransformer(e),s="number"!=typeof n[0]?1:0,o=r.x.scale*t.x,a=r.y.scale*t.y;n[0+s]/=o,n[1+s]/=a;let l=S(o,a,.5);return"number"==typeof n[2+s]&&(n[2+s]/=l),"number"==typeof n[3+s]&&(n[3+s]/=l),i(n)}}};function tI(e,{layout:t,layoutId:r}){return a.has(e)||e.startsWith("origin")||(t||void 0!==r)&&(!!tj[e]||"opacity"===e)}function tD(e,t,r){let{style:n}=e,i={};for(let s in n)(e0(n[s])||t.style&&e0(t.style[s])||tI(s,e)||r?.getValue(s)?.liveStyle!==void 0)&&(i[s]=n[s]);return i}class tN extends tT{constructor(){super(...arguments),this.type="html",this.renderInstance=tO}readValueFromInstance(e,t){if(a.has(t))return this.projection?.isProjecting?m(t):y(e,t);{let r=window.getComputedStyle(e),n=(w(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof n?n.trim():n}}measureInstanceViewportBox(e,{transformPagePoint:t}){return M(e,t)}build(e,t,r){tP(e,t,r.transformTemplate)}scrapeMotionValuesFromProps(e,t,r){return tD(e,t,r)}}let tM=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),tL={offset:"stroke-dashoffset",array:"stroke-dasharray"},t$={offset:"strokeDashoffset",array:"strokeDasharray"};function tU(e,{attrX:t,attrY:r,attrScale:n,pathLength:i,pathSpacing:s=1,pathOffset:o=0,...a}
37,l,u,c){if(tP(e,a,u),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:h,style:d}=e;h.transform&&(d.transform=h.transform,delete h.transform),(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=c?.transformBox??"fill-box",delete h.transformBox),void 0!==t&&(h.x=t),void 0!==r&&(h.y=r),void 0!==n&&(h.scale=n),void 0!==i&&function(e,t,r=1,n=0,i=!0){e.pathLength=1;let s=i?tL:t$;e[s.offset]=z.transform(-n);let o=z.transform(t),a=z.transform(r);e[s.array]=`${o} ${a}`}(h,i,s,o,!1)}let tB=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),tF=e=>"string"==typeof e&&"svg"===e.toLowerCase();function tV(e,t,r){let n=tD(e,t,r);for(let r in e)(e0(e[r])||e0(t[r]))&&(n[-1!==o.indexOf(r)?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r]=e[r]);return n}class tq extends tT{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=tu}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(a.has(t)){let e=eY(t);return e&&e.default||0}return t=tB.has(t)?t:tM(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,r){return tV(e,t,r)}build(e,t,r){tU(e,t,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,t,r,n){!function(e,t,r,n){for(let r in tO(e,t,void 0,n),t.attrs)e.setAttribute(tB.has(r)?r:tM(r),t.attrs[r])}(e,t,0,n)}mount(e){this.isSVGTag=tF(e.tagName),super.mount(e)}}let tW=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function tz(e){if("string"!=typeof e||e.includes("-"));else if(tW.indexOf(e)>-1||/[A-Z]/u.test(e))return!0;return!1}var tH=r(7437),tK=r(8881);let tG=(0,s.createContext)({strict:!1});var tJ=r(5750);let tY=(0,s.createContext)({});function tX(e){return Array.isArray(e)?e.join(" "):e}let tQ=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function tZ(e,t,r){for(let n in t)e0(t[n])||tI(n,r)||(e[n]=t[n])}let t0=()=>({...tQ(),attrs:{}}),t1=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function t2(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||t1.has(e)}let t5=e=>!t2(e);try{i=require("@emotion/is-prop-valid").default,"function"==typeof i&&(t5=e=>e.startsWith("on")?!t2(e):i(e))}catch{}var t6=r(4252),t3=r(3576);function t8(e){return e0(e)?e.get():e}let t4=e=>(t,r)=>{let n=(0,s.useContext)(tY),i=(0,s.useContext)(t6.O),o=()=>(function(e,t,r,n){let{scrapeMotionValuesFromProps:i,createRenderState:s}=e;return{latestValues:function(e,t,r,n){let i={},s=n(e,{});for(let e in s)i[e]=t8(s[e]);let{initial:o,animate:a}=e,l=tv(e),u=tb(e);t&&u&&!l&&!1!==e.inherit&&(void 0===o&&(o=t.initial),void 0===a&&(a=t.animate));let c=!!r&&!1===r.initial,h=(c=c||!1===o)?a:o;if(h&&"boolean"!=typeof h&&!tp(h)){let t=Array.isArray(h)?h:[h];for(let r=0;r<t.length;r++){let n=tx(e,t[r]);if(n){let{transitionEnd:e,transition:t,...r}=n;for(let e in r){let t=r[e];if(Array.isArray(t)){let e=c?t.length-1:0;t=t[e]}null!==t&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}(t,r,n,i),renderState:s()}})(e,t,n,i);return r?o():(0,t3.h)(o)},t9=t4({scrapeMotionValuesFromProps:tD,createRenderState:tQ}),t7=t4({scrapeMotionValuesFromProps:tV,createRenderState:t0}),re=Symbol.for("motionComponentSymbol");function rt(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}let rr="data-"+tM("framerAppearId"),rn=(0,s.createContext)({});var ri=r(1534);function rs(e){var t,r;let{forwardMotionProps:n=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0;i&&function(e){for(let t in e)ts[t]={...ts[t],...e[t]}}(i);let a=tz(e)?t7:t9;function l(t,r){var i;let l;let u={...(0,s.useContext)(tJ._),...t,layoutId:function(e){let{layoutId:t}=e,r=(0,s.useContext)(tK.p).id;return r&&void 0!==t?r+"-"+t:t}(t)},{isStatic:c}=u,h=function(e){let{initial:t,animate:r}=function(e,t){if(tv(e)){let{initial:t,animate:r}=e;return{initial:!1===t||tm(t)?t:void 0,animate:tm(r)?r:void 0}}return!1!==e.inherit?t:{}}(e,(0,s.useContext)(tY));return(0,s.useMemo)(()=>({initial:t,animate:r}),[tX(t),tX(r)])}(t),d=a(t,c);if(!c&&tc.j){(0,s.useContext)(tG).strict;let t=function(e){let{drag:t,layout:r}=ts;if(!t&&!r)return{};let n={...t,...r};return{MeasureLayout:(null==t?void 0:t.isEnabled(e))||(null==r?void 0:r.isEnabled(e))?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}
37(u);l=t.MeasureLayout,h.visualElement=function(e,t,r,n,i){var o,a,l,u;let{visualElement:c}=(0,s.useContext)(tY),h=(0,s.useContext)(tG),d=(0,s.useContext)(t6.O),f=(0,s.useContext)(tJ._).reducedMotion,p=(0,s.useRef)(null);n=n||h.renderer,!p.current&&n&&(p.current=n(e,{visualState:t,parent:c,props:r,presenceContext:d,blockInitialAnimation:!!d&&!1===d.initial,reducedMotionConfig:f}));let m=p.current,g=(0,s.useContext)(rn);m&&!m.projection&&i&&("html"===m.type||"svg"===m.type)&&function(e,t,r,n){let{layoutId:i,layout:s,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u,layoutCrossfade:c}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:function e(t){if(t)return!1!==t.options.allowProjection?t.projection:e(t.parent)}(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&rt(a),visualElement:e,animationType:"string"==typeof s?s:"both",initialPromotionConfig:n,crossfade:c,layoutScroll:l,layoutRoot:u})}(p.current,r,i,g);let y=(0,s.useRef)(!1);(0,s.useInsertionEffect)(()=>{m&&y.current&&m.update(r,d)});let v=r[rr],b=(0,s.useRef)(!!v&&!(null===(o=(a=window).MotionHandoffIsComplete)||void 0===o?void 0:o.call(a,v))&&(null===(l=(u=window).MotionHasOptimisedAnimation)||void 0===l?void 0:l.call(u,v)));return(0,ri.L)(()=>{m&&(y.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),b.current&&m.animationState&&m.animationState.animateChanges())}),(0,s.useEffect)(()=>{m&&(!b.current&&m.animationState&&m.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{var e,t;null===(e=(t=window).MotionHandoffMarkAsComplete)||void 0===e||e.call(t,v)}),b.current=!1),m.enteringChildren=void 0)}),m}(e,d,u,o,t.ProjectionNode)}return(0,tH.jsxs)(tY.Provider,{value:h,children:[l&&h.visualElement?(0,tH.jsx)(l,{visualElement:h.visualElement,...u}):null,function(e,t,r,n,i){let{latestValues:o}=n,a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],l=(tz(e)?function(e,t,r,n){let i=(0,s.useMemo)(()=>{let r=t0();return tU(r,t,tF(n),e.transformTemplate,e.style),{...r.attrs,style:{...r.style}}},[t]);if(e.style){let t={};tZ(t,e.style,e),i.style={...t,...i.style}}return i}:function(e,t){let r={},n=function(e,t){let r=e.style||{},n={};return tZ(n,r,e),Object.assign(n,function(e,t){let{transformTemplate:r}=e;return(0,s.useMemo)(()=>{let e=tQ();return tP(e,t,r),Object.assign({},e.vars,e.style)},[t])}(e,t)),n}(e,t);return e.drag&&!1!==e.dragListener&&(r.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=!0===e.drag?"none":"pan-".concat("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=n,r})(t,o,i,e),u=function(e,t,r){let n={};for(let i in e)("values"!==i||"object"!=typeof e.values)&&(t5(i)||!0===r&&t2(i)||!t&&!t2(i)||e.draggable&&i.startsWith("onDrag"))&&(n[i]=e[i]);return n}(t,"string"==typeof e,a),c=e!==s.Fragment?{...u,...l,ref:r}:{},{children:h}=t,d=(0,s.useMemo)(()=>e0(h)?h.get():h,[h]);return(0,s.createElement)(e,{...c,children:d})}(e,t,(i=h.visualElement,(0,s.useCallback)(e=>{e&&d.onMount&&d.onMount(e),i&&(e?i.mount(e):i.unmount()),r&&("function"==typeof r?r(e):rt(r)&&(r.current=e))},[i])),d,c,n)]})}l.displayName="motion.".concat("string"==typeof e?e:"create(".concat(null!==(r=null!==(t=e.displayName)&&void 0!==t?t:e.name)&&void 0!==r?r:"",")"));let u=(0,s.forwardRef)(l);return u[re]=e,u}function ro(e,t,r){let n=e.getProps();return tx(n,t,void 0!==r?r:n.custom,e)}function ra(e,t){return e?.[t]??e?.default??e}let rl=e=>Array.isArray(e);function ru(e,t){let r=e.getValue("willChange");if(e0(r)&&r.add)return r.add(t);if(!r&&ea.WillChange){let r=new ea.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function rc(e){e.duration=0,e.type="keyframes"}let rh=(e,t)=>r=>t(e(r)),rd=(...e)=>e.reduce(rh),rf=e=>1e3*e,rp=e=>e/1e3,rm={layout:0,mainThread:0,waapi:0};function rg(e,t,r){return(r<0&&(r+=1),r>1&&(r-=1),r<1/6)?e+(t-e)*6*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function ry(e,t){return r=>r>0?t:e}let rv=(e,t,r)=>{let n=e*e,i=r*(t*t-n)+n;return i<0?0:Math.sqrt(i)},rb=[eC,eR,ej],rw=e=>rb.find(t=>t.test(e));function rx(e){let t=rw(e);if(Q(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let r=t.parse(e);return t===ej&&(r=function({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,r/=100;let i=0,s=0,o=0;if(t/=100){let n=r<.5?r*(1+t):r+t-r*t,a=2*r-n;i=rg(a,n,e+1/3),s=rg(a,n,e),o=rg(a,n,e-1/3)}else i=s=o=r;return{red:Math.round(255*i),green:Math.round(255*s),blue:Math.round(255*o),alpha:n}}(r)),r}let r_=(e,t)=>
37{let r=rx(e),n=rx(t);if(!r||!n)return ry(e,t);let i={...r};return e=>(i.red=rv(r.red,n.red,e),i.green=rv(r.green,n.green,e),i.blue=rv(r.blue,n.blue,e),i.alpha=S(r.alpha,n.alpha,e),eR.transform(i))},rE=new Set(["none","hidden"]);function rT(e,t){return r=>S(e,t,r)}function rS(e){return"number"==typeof e?rT:"string"==typeof e?_(e)?ry:eI.test(e)?r_:rP:Array.isArray(e)?rk:"object"==typeof e?eI.test(e)?r_:rA:ry}function rk(e,t){let r=[...e],n=r.length,i=e.map((e,r)=>rS(e)(e,t[r]));return e=>{for(let t=0;t<n;t++)r[t]=i[t](e);return r}}function rA(e,t){let r={...e,...t},n={};for(let i in r)void 0!==e[i]&&void 0!==t[i]&&(n[i]=rS(e[i])(e[i],t[i]));return e=>{for(let t in n)r[t]=n[t](e);return r}}let rP=(e,t)=>{let r=eV.createTransformer(t),n=e$(e),i=e$(t);return n.indexes.var.length===i.indexes.var.length&&n.indexes.color.length===i.indexes.color.length&&n.indexes.number.length>=i.indexes.number.length?rE.has(e)&&!i.values.length||rE.has(t)&&!n.values.length?rE.has(e)?r=>r<=0?e:t:r=>r>=1?t:e:rd(rk(function(e,t){let r=[],n={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let s=t.types[i],o=e.indexes[s][n[s]],a=e.values[o]??0;r[i]=a,n[s]++}return r}(n,i),i.values),r):(Q(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),ry(e,t))};function rO(e,t,r){return"number"==typeof e&&"number"==typeof t&&"number"==typeof r?S(e,t,r):rS(e)(e,t)}let rR=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>eh.update(t,e),stop:()=>ed(t),now:()=>ef.isProcessing?ef.timestamp:e2.now()}},rC=(e,t,r=10)=>{let n="",i=Math.max(Math.round(t/r),2);for(let t=0;t<i;t++)n+=Math.round(1e4*e(t/(i-1)))/1e4+", ";return`linear(${n.substring(0,n.length-2)})`};function rj(e){let t=0,r=e.next(t);for(;!r.done&&t<2e4;)t+=50,r=e.next(t);return t>=2e4?1/0:t}function rI(e,t,r){var n,i;let s=Math.max(t-5,0);return n=r-e(s),(i=t-s)?1e3/i*n:0}let rD={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function rN(e,t){return e*Math.sqrt(1-t*t)}let rM=["duration","bounce"],rL=["stiffness","damping","mass"];function r$(e,t){return t.some(t=>void 0!==e[t])}function rU(e=rD.visualDuration,t=rD.bounce){let r;let n="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e,{restSpeed:i,restDelta:s}=n,o=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],l={done:!1,value:o},{stiffness:u,damping:c,mass:h,duration:d,velocity:f,isResolvedFromDuration:p}=function(e){let t={velocity:rD.velocity,stiffness:rD.stiffness,damping:rD.damping,mass:rD.mass,isResolvedFromDuration:!1,...e};if(!r$(e,rL)&&r$(e,rM)){if(e.visualDuration){let r=2*Math.PI/(1.2*e.visualDuration),n=r*r,i=2*$(.05,1,1-(e.bounce||0))*Math.sqrt(n);t={...t,mass:rD.mass,stiffness:n,damping:i}}else{let r=function({duration:e=rD.duration,bounce:t=rD.bounce,velocity:r=rD.velocity,mass:n=rD.mass}){let i,s;Q(e<=rf(rD.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-t;o=$(rD.minDamping,rD.maxDamping,o),e=$(rD.minDuration,rD.maxDuration,rp(e)),o<1?(i=t=>{let n=t*o,i=n*e;return .001-(n-r)/rN(t,o)*Math.exp(-i)},s=t=>{let n=t*o*e,s=Math.pow(o,2)*Math.pow(t,2)*e,a=rN(Math.pow(t,2),o);return(n*r+r-s)*Math.exp(-n)*(-i(t)+.001>0?-1:1)/a}):(i=t=>-.001+Math.exp(-t*e)*((t-r)*e+1),s=t=>e*e*(r-t)*Math.exp(-t*e));let a=function(e,t,r){let n=r;for(let r=1;r<12;r++)n-=e(n)/t(n);return n}(i,s,5/e);if(e=rf(e),isNaN(a))return{stiffness:rD.stiffness,damping:rD.damping,duration:e};{let t=Math.pow(a,2)*n;return{stiffness:t,damping:2*o*Math.sqrt(n*t),duration:e}}}(e);(t={...t,...r,mass:rD.mass}).isResolvedFromDuration=!0}}return t}({...n,velocity:-rp(n.velocity||0)}),m=f||0,g=c/(2*Math.sqrt(u*h)),y=a-o,v=rp(Math.sqrt(u/h)),b=5>Math.abs(y);if(i||(i=b?rD.restSpeed.granular:rD.restSpeed.default),s||(s=b?rD.restDelta.granular:rD.restDelta.default),g<1){let e=rN(v,g);r=t=>a-Math.exp(-g*v*t)*((m+g*v*y)/e*Math.sin(e*t)+y*Math.cos(e*t))}else if(1===g)r=e=>a-Math.exp(-v*e)*(y+(m+v*y)*e);else{let e=v*Math.sqrt(g*g-1);r=t=>{let r=Math.exp(-g*v*t),n=Math.min(e*t,300);return a-r*((m+g*v*y)*Math.sinh(n)+e*y*Math.cosh(n))/e}}
37let w={calculatedDuration:p&&d||null,next:e=>{let t=r(e);if(p)l.done=e>=d;else{let n=0===e?m:0;g<1&&(n=0===e?rf(m):rI(r,e,t));let o=Math.abs(n)<=i,u=Math.abs(a-t)<=s;l.done=o&&u}return l.value=l.done?a:t,l},toString:()=>{let e=Math.min(rj(w),2e4),t=rC(t=>w.next(e*t).value,e,30);return e+"ms "+t},toTransition:()=>{}};return w}function rB({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){let h,d;let f=e[0],p={done:!1,value:f},m=e=>void 0!==a&&e<a||void 0!==l&&e>l,g=e=>void 0===a?l:void 0===l?a:Math.abs(a-e)<Math.abs(l-e)?a:l,y=r*t,v=f+y,b=void 0===o?v:o(v);b!==v&&(y=b-f);let w=e=>-y*Math.exp(-e/n),x=e=>b+w(e),_=e=>{let t=w(e),r=x(e);p.done=Math.abs(t)<=u,p.value=p.done?b:r},E=e=>{m(p.value)&&(h=e,d=rU({keyframes:[p.value,g(p.value)],velocity:rI(x,e,p.value),damping:i,stiffness:s,restDelta:u,restSpeed:c}))};return E(0),{calculatedDuration:null,next:e=>{let t=!1;return(d||void 0!==h||(t=!0,_(e),E(e)),void 0!==h&&e>=h)?d.next(e-h):(t||_(e),p)}}}rU.applyToOptions=e=>{let t=function(e,t=100,r){let n=r({...e,keyframes:[0,t]}),i=Math.min(rj(n),2e4);return{type:"keyframes",ease:e=>n.next(i*e).value/t,duration:rp(i)}}(e,100,rU);return e.ease=t.ease,e.duration=rf(t.duration),e.type="keyframes",e};let rF=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e;function rV(e,t,r,n){if(e===t&&r===n)return eo;let i=t=>(function(e,t,r,n,i){let s,o;let a=0;do(s=rF(o=t+(r-t)/2,n,i)-e)>0?r=o:t=o;while(Math.abs(s)>1e-7&&++a<12);return o})(t,0,1,e,r);return e=>0===e||1===e?e:rF(i(e),t,n)}let rq=rV(.42,0,1,1),rW=rV(0,0,.58,1),rz=rV(.42,0,.58,1),rH=e=>Array.isArray(e)&&"number"!=typeof e[0],rK=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,rG=e=>t=>1-e(1-t),rJ=rV(.33,1.53,.69,.99),rY=rG(rJ),rX=rK(rY),rQ=e=>(e*=2)<1?.5*rY(e):.5*(2-Math.pow(2,-10*(e-1))),rZ=e=>1-Math.sin(Math.acos(e)),r0=rG(rZ),r1=rK(rZ),r2=e=>Array.isArray(e)&&"number"==typeof e[0],r5={linear:eo,easeIn:rq,easeInOut:rz,easeOut:rW,circIn:rZ,circInOut:r1,circOut:r0,backIn:rY,backInOut:rX,backOut:rJ,anticipate:rQ},r6=e=>"string"==typeof e,r3=e=>{if(r2(e)){Z(4===e.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");let[t,r,n,i]=e;return rV(t,r,n,i)}return r6(e)?(Z(void 0!==r5[e],`Invalid easing type '${e}'`,"invalid-easing-type"),r5[e]):e},r8=(e,t,r)=>{let n=t-e;return 0===n?1:(r-e)/n};function r4({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){let i=rH(n)?n.map(r3):r3(n),s={done:!1,value:t[0]},o=function(e,t,{clamp:r=!0,ease:n,mixer:i}={}){let s=e.length;if(Z(s===t.length,"Both input and output ranges must be the same length","range-length"),1===s)return()=>t[0];if(2===s&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());let a=function(e,t,r){let n=[],i=r||ea.mix||rO,s=e.length-1;for(let r=0;r<s;r++){let s=i(e[r],e[r+1]);t&&(s=rd(Array.isArray(t)?t[r]||eo:t,s)),n.push(s)}return n}(t,n,i),l=a.length,u=r=>{if(o&&r<e[0])return t[0];let n=0;if(l>1)for(;n<e.length-2&&!(r<e[n+1]);n++);let i=r8(e[n],e[n+1],r);return a[n](i)};return r?t=>u($(e[0],e[s-1],t)):u}((r&&r.length===t.length?r:function(e){let t=[0];return function(e,t){let r=e[e.length-1];for(let n=1;n<=t;n++){let i=r8(0,t,n);e.push(S(r,1,i))}}(t,e.length-1),t}(t)).map(t=>t*e),t,{ease:Array.isArray(i)?i:t.map(()=>i||rz).splice(0,t.length-1)});return{calculatedDuration:e,next:t=>(s.value=o(t),s.done=t>=e,s)}}let r9=e=>null!==e;function r7(e,{repeat:t,repeatType:r="loop"},n,i=1){let s=e.filter(r9),o=i<0||t&&"loop"!==r&&t%2==1?0:s.length-1;return o&&void 0!==n?n:s[o]}let ne={decay:rB,inertia:rB,tween:r4,keyframes:r4,spring:rU};function nt(e){"string"==typeof e.type&&(e.type=ne[e.type])}class nr{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}}let nn=e=>e/100;class ni extends nr{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==e2.now()&&this.tick(e2.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},rm.mainThread++,this.options=e,this.initAnimation(),this.play(),!1===e.autoplay&&this.pause()}initAnimation(){let{options:e}=this;nt(e);let{type:t=r4,repeat:r=0,repeatDelay:n=0,repeatType:i,velocity:s=0}=e,{keyframes:o}=e,a=t||r4;a!==r4&&"number"!=typeof o[0]&&(this.mixKeyframes=rd(nn,rO(o[0],o[1])),o=[0,100]);let l=a({...e,keyframes:o});"mirror"===i&&(this.mirroredGenerator=a({...e,keyframes:[...o].reverse(),velocity:-s})),null===l.calculatedDuration&&(l.calculatedDuration=rj(l));let{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+n,this.totalDuration=this.resolvedDuration*(r+1)-n,this.generator=l}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=t}tick(e,t=!1){let{generator:r,totalDuration:n,mixKeyframes:i,mirroredGenerator:s,resolvedDuration:o,calculatedDuration:a}=this;if(null===this.startTime)return r.next(0);let{delay:l=0,keyframes:u,repeat:c,repeatType:h,repeatDelay:d,type:f,onUpdate:p,finalKeyframe:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-n/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?g<0:g>n;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=n);let v=this.currentTime,b=r;if(c){let e=Math.min(this.currentTime,n)/o,t=Math.floor(e),r=e%1;!r&&e>=1&&(r=1),1===r&&t--,(t=Math.min(t,c+1))%2&&("reverse"===h?(r=1-r,d&&(r-=d/o)):"mirror"===h&&(b=s)),v=$(0,1,r)*o}let w=y?{done:!1,value:u[0]}:b.next(v);
37i&&(w.value=i(w.value));let{done:x}=w;y||null===a||(x=this.playbackSpeed>=0?this.currentTime>=n:this.currentTime<=0);let _=null===this.holdTime&&("finished"===this.state||"running"===this.state&&x);return _&&f!==rB&&(w.value=r7(u,this.options,m,this.speed)),p&&p(w.value),_&&this.finish(),w}then(e,t){return this.finished.then(e,t)}get duration(){return rp(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+rp(e)}get time(){return rp(this.currentTime)}set time(e){e=rf(e),this.currentTime=e,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(e2.now());let t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=rp(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=rR,startTime:t}=this.options;this.driver||(this.driver=e(e=>this.tick(e))),this.options.onPlay?.();let r=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=r):null!==this.holdTime?this.startTime=r-this.holdTime:this.startTime||(this.startTime=t??r),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(e2.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,rm.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}let ns=e=>e.startsWith("--");function no(e){let t;return()=>(void 0===t&&(t=e()),t)}let na=no(()=>void 0!==window.ScrollTimeline),nl={},nu=function(e,t){let r=no(e);return()=>nl[t]??r()}(()=>{try{document.createElement("div").animate({opacity:0}
37,{easing:"linear(0, 1)"})}catch(e){return!1}return!0},"linearEasing"),nc=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`,nh={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:nc([0,.65,.55,1]),circOut:nc([.55,0,1,.45]),backIn:nc([.31,.01,.66,-.59]),backOut:nc([.33,1.53,.69,.99])};function nd(e){return"function"==typeof e&&"applyToOptions"in e}class nf extends nr{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,!e)return;let{element:t,name:r,keyframes:n,pseudoElement:i,allowFlatten:s=!1,finalKeyframe:o,onComplete:a}=e;this.isPseudoElement=!!i,this.allowFlatten=s,this.options=e,Z("string"!=typeof e.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");let l=function({type:e,...t}){return nd(e)&&nu()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}(e);this.animation=function(e,t,r,{delay:n=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a="easeOut",times:l}={},u){let c={[t]:r};l&&(c.offset=l);let h=function e(t,r){if(t)return"function"==typeof t?nu()?rC(t,r):"ease-out":r2(t)?nc(t):Array.isArray(t)?t.map(t=>e(t,r)||nh.easeOut):nh[t]}(a,i);Array.isArray(h)&&(c.easing=h),eu.value&&rm.waapi++;let d={delay:n,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:s+1,direction:"reverse"===o?"alternate":"normal"};u&&(d.pseudoElement=u);let f=e.animate(c,d);return eu.value&&f.finished.finally(()=>{rm.waapi--}),f}(t,r,n,l,i),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=r7(n,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(e):ns(r)?t.style.setProperty(r,e):t.style[r]=e,this.animation.cancel()}a?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(e){}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;"idle"!==e&&"finished"!==e&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){return rp(Number(this.animation.effect?.getComputedTiming?.().duration||0))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+rp(e)}get time(){return rp(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=rf(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e}attachTimeline({timeline:e,observe:t}){return(this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&na())?(this.animation.timeline=e,eo):t(this)}}let np={anticipate:rQ,backInOut:rX,circInOut:r1};class nm extends nf{constructor(e){"string"==typeof e.ease&&e.ease in np&&(e.ease=np[e.ease]),nt(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:r,onComplete:n,element:i,...s}=this.options;if(!t)return;if(void 0!==e){t.set(e);return}let o=new ni({...s,autoplay:!1}),a=rf(this.finishedTime??this.time);t.setWithVelocity(o.sample(a-10).value,o.sample(a).value,10),o.stop()}}let ng=(e,t)=>"zIndex"!==t&&!!("number"==typeof e||Array.isArray(e)||"string"==typeof e&&(eV.test(e)||"0"===e)&&!e.startsWith("url(")),ny=new Set(["opacity","clipPath","filter","transform"]),nv=no(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class nb extends nr{constructor({autoplay:e=!0,delay:t=0,type:r="keyframes",repeat:n=0,repeatDelay:i=0,repeatType:s="loop",keyframes:o,name:a,motionValue:l,element:u,...c}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=e2.now();let h={autoplay:e,delay:t,type:r,repeat:n,repeatDelay:i,repeatType:s,name:a,motionValue:l,element:u,...c},d=u?.KeyframeResolver||ex;this.keyframeResolver=new d(o,(e,t,r)=>this.onKeyframesResolved(e,t,h,!r),a,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,r,n){this.keyframeResolver=void 0;let{name:i,type:s,velocity:o,delay:a,isHandoff:l,onUpdate:u}=r;this.resolvedAt=e2.now(),!function(e,t,r,n){let i=e[0];if(null===i)return!1;if("display"===t||"visibility"===t)return!0;let s=e[e.length-1],o=ng(i,t),a=ng(s,t);return Q(o===a,`You are trying to animate ${t} from "${i}" to "${s}". "${o?s:i}" is not an animatable value.`,"value-not-animatable"),!!o&&!!a&&(function(e){let t=e[0];if(1===e.length)return!0;for(let r=0;r<e.length;r++)if(e[r]!==t)return!0}(e)||("spring"===r||nd(r))&&n)}(e,i,s,o)&&((ea.instantAnimations||!a)&&u?.(r7(e,r,t)),e[0]=e[e.length-1],rc(r),r.repeat=0);let c={startTime:n?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...r,keyframes:e},h=!l&&function(e){let{motionValue:t,name:r,repeatDelay:n,repeatType:i,damping:s,type:o}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;
37let{onUpdate:a,transformTemplate:l}=t.owner.getProps();return nv()&&r&&ny.has(r)&&("transform"!==r||!l)&&!a&&!n&&"mirror"!==i&&0!==s&&"inertia"!==o}(c)?new nm({...c,element:c.motionValue.owner.current}):new ni(c);h.finished.then(()=>this.notifyFinished()).catch(eo),this.pendingTimeline&&(this.stopTimeline=h.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=h}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),ev=!0,ew(),eb(),ev=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}let nw=e=>null!==e,nx={type:"spring",stiffness:500,damping:25,restSpeed:10},n_=e=>({type:"spring",stiffness:550,damping:0===e?2*Math.sqrt(550):30,restSpeed:10}),nE={type:"keyframes",duration:.8},nT={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},nS=(e,{keyframes:t})=>t.length>2?nE:a.has(e)?e.startsWith("scale")?n_(t[1]):nx:nT,nk=(e,t,r,n={},i,s)=>o=>{let a=ra(n,e)||{},l=a.delay||n.delay||0,{elapsed:u=0}=n;u-=rf(l);let c={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-u,onUpdate:e=>{t.set(e),a.onUpdate&&a.onUpdate(e)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:i};!function({when:e,delay:t,delayChildren:r,staggerChildren:n,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}(a)&&Object.assign(c,nS(e,c)),c.duration&&(c.duration=rf(c.duration)),c.repeatDelay&&(c.repeatDelay=rf(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let h=!1;if(!1!==c.type&&(0!==c.duration||c.repeatDelay)||(rc(c),0!==c.delay||(h=!0)),(ea.instantAnimations||ea.skipAnimations)&&(h=!0,rc(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,h&&!s&&void 0!==t.get()){let e=function(e,{repeat:t,repeatType:r="loop"},n){let i=e.filter(nw),s=t&&"loop"!==r&&t%2==1?0:i.length-1;return i[s]}(c.keyframes,a);if(void 0!==e){eh.update(()=>{c.onUpdate(e),c.onComplete()});return}}return a.isSync?new ni(c):new nb(c)};function nA(e,t,{delay:r=0,transitionOverride:n,type:i}={}){let{transition:s=e.getDefaultTransition(),transitionEnd:o,...a}=t;n&&(s=n);let l=[],u=i&&e.animationState&&e.animationState.getState()[i];for(let t in a){let n=e.getValue(t,e.latestValues[t]??null),i=a[t];if(void 0===i||u&&function({protectedKeys:e,needsAnimating:t},r){let n=e.hasOwnProperty(r)&&!0!==t[r];return t[r]=!1,n}(u,t))continue;let o={delay:r,...ra(s||{},t)},c=n.get();if(void 0!==c&&!n.isAnimating&&!Array.isArray(i)&&i===c&&!o.velocity)continue;let h=!1;if(window.MotionHandoffAnimation){let r=e.props[rr];if(r){let e=window.MotionHandoffAnimation(r,t,eh);null!==e&&(o.startTime=e,h=!0)}}ru(e,t),n.start(nk(t,n,i,e.shouldReduceMotion&&L.has(t)?{type:!1}:o,e,h));let d=n.animation;d&&l.push(d)}return o&&Promise.all(l).then(()=>{eh.update(()=>{o&&function(e,t){let{transitionEnd:r={},transition:n={},...i}=ro(e,t)||{};for(let t in i={...i,...r}){var s;let r=rl(s=i[t])?s[s.length-1]||0:s;e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,e7(r))}}(e,o)})}),l}function nP(e,t,r,n=0,i=1){let s=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,a=(o-1)*n;return"function"==typeof r?r(s,o):1===i?s*n:a-s*n}function nO(e,t,r={}){let n=ro(e,t,"exit"===r.type?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=n||{};r.transitionOverride&&(i=r.transitionOverride);let s=n?()=>Promise.all(nA(e,n,r)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(n=0)=>{let{delayChildren:s=0,staggerChildren:o,staggerDirection:a}=i;return function(e,t,r=0,n=0,i=0,s=1,o){let a=[];for(let l of e.variantChildren)l.notify("AnimationStart",t),a.push(nO(l,t,{...o,delay:r+("function"==typeof n?0:n)+nP(e.variantChildren,l,n,i,s)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}(e,t,n,s,o,a,r)}:()=>Promise.resolve(),{when:a}=i;if(!a)return Promise.all([s(),o(r.delay)]);{let[e,t]="beforeChildren"===a?[s,o]:[o,s];return e().then(()=>t())}}function nR(e,t){if(!Array.isArray(t))return!1;let r=t.length;if(r!==e.length)return!1;for(let n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}let nC=ty.length,nj=[...tg].reverse(),nI=tg.length;function nD(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function nN(){return{animate:nD(!0),whileInView:nD(),whileHover:nD(),whileTap:nD(),whileDrag:nD(),whileFocus:nD(),exit:nD()}}class nM{constructor(e){this.isMounted=!1,this.node=e}update(){}}class nL extends nM{constructor(e){super(e),e.animationState||(e.animationState=function(e){let t=t=>Promise.all(t.map(({animation:t,options:r})=>(function(e,t,r={}){let n;if(e.notify("AnimationStart",t),Array.isArray(t))n=Promise.all(t.map(t=>nO(e,t,r)));else if("string"==typeof t)n=nO(e,t,r);else{let i="function"==typeof t?ro(e,t,r.custom):t;n=Promise.all(nA(e,i,r))}return n.then(()=>
37{e.notify("AnimationComplete",t)})})(e,t,r))),r=nN(),n=!0,i=t=>(r,n)=>{let i=ro(e,n,"exit"===t?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...n}=i;r={...r,...n,...t}}return r};function s(s){let{props:o}=e,a=function e(t){if(!t)return;if(!t.isControllingVariants){let r=t.parent&&e(t.parent)||{};return void 0!==t.props.initial&&(r.initial=t.props.initial),r}let r={};for(let e=0;e<nC;e++){let n=ty[e],i=t.props[n];(tm(i)||!1===i)&&(r[n]=i)}return r}(e.parent)||{},l=[],u=new Set,c={},h=1/0;for(let t=0;t<nI;t++){var d;let f=nj[t],p=r[f],m=void 0!==o[f]?o[f]:a[f],g=tm(m),y=f===s?p.isActive:null;!1===y&&(h=t);let v=m===a[f]&&m!==o[f]&&g;if(v&&n&&e.manuallyAnimateOnMount&&(v=!1),p.protectedKeys={...c},!p.isActive&&null===y||!m&&!p.prevProp||tp(m)||"boolean"==typeof m)continue;let b=(d=p.prevProp,"string"==typeof m?m!==d:!!Array.isArray(m)&&!nR(m,d)),w=b||f===s&&p.isActive&&!v&&g||t>h&&g,x=!1,_=Array.isArray(m)?m:[m],E=_.reduce(i(f),{});!1===y&&(E={});let{prevResolvedValues:T={}}=p,S={...T,...E},k=t=>{w=!0,u.has(t)&&(x=!0,u.delete(t)),p.needsAnimating[t]=!0;let r=e.getValue(t);r&&(r.liveStyle=!1)};for(let e in S){let t=E[e],r=T[e];if(!c.hasOwnProperty(e))(rl(t)&&rl(r)?nR(t,r):t===r)?void 0!==t&&u.has(e)?k(e):p.protectedKeys[e]=!0:null!=t?k(e):u.add(e)}p.prevProp=m,p.prevResolvedValues=E,p.isActive&&(c={...c,...E}),n&&e.blockInitialAnimation&&(w=!1);let A=v&&b,P=!A||x;w&&P&&l.push(..._.map(t=>{let r={type:f};if("string"==typeof t&&n&&!A&&e.manuallyAnimateOnMount&&e.parent){let{parent:n}=e,i=ro(n,t);if(n.enteringChildren&&i){let{delayChildren:t}=i.transition||{};r.delay=nP(n.enteringChildren,e,t)}}return{animation:t,options:r}}))}if(u.size){let t={};if("boolean"!=typeof o.initial){let r=ro(e,Array.isArray(o.initial)?o.initial[0]:o.initial);r&&r.transition&&(t.transition=r.transition)}u.forEach(r=>{let n=e.getBaseTarget(r),i=e.getValue(r);i&&(i.liveStyle=!0),t[r]=n??null}),l.push({animation:t})}let f=!!l.length;return n&&(!1===o.initial||o.initial===o.animate)&&!e.manuallyAnimateOnMount&&(f=!1),n=!1,f?t(l):Promise.resolve()}return{animateChanges:s,setActive:function(t,n){if(r[t].isActive===n)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,n)),r[t].isActive=n;let i=s(t);for(let e in r)r[e].protectedKeys={};return i},setAnimateFunction:function(r){t=r(e)},getState:()=>r,reset:()=>{r=nN()}}}(e))}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();tp(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let n$=0;class nU extends nM{constructor(){super(...arguments),this.id=n$++}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;let n=this.node.animationState.setActive("exit",!e);t&&!e&&n.then(()=>{t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}let nB={x:!1,y:!1};function nF(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r)}let nV=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary;function nq(e){return{point:{x:e.pageX,y:e.pageY}}}let nW=e=>t=>nV(t)&&e(t,nq(t));function nz(e,t,r,n){return nF(e,t,nW(r),n)}function nH(e){return e.max-e.min}function nK(e,t,r,n=.5){e.origin=n,e.originPoint=S(t.min,t.max,e.origin),e.scale=nH(r)/nH(t),e.translate=S(r.min,r.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function nG(e,t,r,n){nK(e.x,t.x,r.x,n?n.originX:void 0),nK(e.y,t.y,r.y,n?n.originY:void 0)}function nJ(e,t,r){e.min=r.min+t.min,e.max=e.min+nH(t)}function nY(e,t,r){e.min=t.min-r.min,e.max=e.min+nH(t)}function nX(e,t,r){nY(e.x,t.x,r.x),nY(e.y,t.y,r.y)}function nQ(e){return[e("x"),e("y")]}let nZ=({current:e})=>e?e.ownerDocument.defaultView:null,n0=(e,t)=>Math.abs(e-t);class n1{constructor(e,t,{transformPagePoint:r,contextWindow:n=window,dragSnapToOrigin:i=!1,distanceThreshold:s=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{var e,t;if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let r=n6(this.lastMoveEventInfo,this.history),n=null!==this.startEvent,i=(e=r.offset,t={x:0,y:0},Math.sqrt(n0(e.x,t.x)**2+n0(e.y,t.y)**2)>=this.distanceThreshold);if(!n&&!i)return;let{point:s}=r,{timestamp:o}=ef;this.history.push({...s,timestamp:o});let{onStart:a,onMove:l}=this.handlers;n||(a&&a(this.lastMoveEvent,r),this.startEvent=this.lastMoveEvent),l&&l(this.lastMoveEvent,r)},this.handlePointerMove=(e,t)=>
37{this.lastMoveEvent=e,this.lastMoveEventInfo=n2(t,this.transformPagePoint),eh.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:r,onSessionEnd:n,resumeAnimation:i}=this.handlers;if(this.dragSnapToOrigin&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let s=n6("pointercancel"===e.type?this.lastMoveEventInfo:n2(t,this.transformPagePoint),this.history);this.startEvent&&r&&r(e,s),n&&n(e,s)},!nV(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=r,this.distanceThreshold=s,this.contextWindow=n||window;let o=n2(nq(e),this.transformPagePoint),{point:a}=o,{timestamp:l}=ef;this.history=[{...a,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,n6(o,this.history)),this.removeListeners=rd(nz(this.contextWindow,"pointermove",this.handlePointerMove),nz(this.contextWindow,"pointerup",this.handlePointerUp),nz(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),ed(this.updatePoint)}}function n2(e,t){return t?{point:t(e.point)}:e}function n5(e,t){return{x:e.x-t.x,y:e.y-t.y}}function n6({point:e},t){return{point:e,delta:n5(e,n3(t)),offset:n5(e,t[0]),velocity:function(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,n=null,i=n3(e);for(;r>=0&&(n=e[r],!(i.timestamp-n.timestamp>rf(.1)));)r--;if(!n)return{x:0,y:0};let s=rp(i.timestamp-n.timestamp);if(0===s)return{x:0,y:0};let o={x:(i.x-n.x)/s,y:(i.y-n.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}(t,0)}}function n3(e){return e[e.length-1]}function n8(e,t,r){return{min:void 0!==t?e.min+t:void 0,max:void 0!==r?e.max+r-(e.max-e.min):void 0}}function n4(e,t){let r=t.min-e.min,n=t.max-e.max;return t.max-t.min<e.max-e.min&&([r,n]=[n,r]),{min:r,max:n}}function n9(e,t,r){return{min:n7(e,t),max:n7(e,r)}}function n7(e,t){return"number"==typeof e?e:e[t]||0}let ie=new WeakMap;class it{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=tu(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:r}={}){let{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;let{dragSnapToOrigin:i}=this.getProps();this.panSession=new n1(e,{onSessionStart:e=>{let{dragSnapToOrigin:r}=this.getProps();r?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(nq(e).point)},onStart:(e,t)=>{let{drag:r,dragPropagation:n,onDragStart:i}=this.getProps();if(r&&!n&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===r||"y"===r?nB[r]?null:(nB[r]=!0,()=>{nB[r]=!1}):nB.x||nB.y?null:(nB.x=nB.y=!0,()=>{nB.x=nB.y=!1}),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),nQ(e=>{let t=this.getAxisMotionValue(e).get()||0;if(W.test(t)){let{projection:r}=this.visualElement;if(r&&r.layout){let n=r.layout.layoutBox[e];if(n){let e=nH(n);t=parseFloat(t)/100*e}}}this.originPoint[e]=t}),i&&eh.postRender(()=>i(e,t)),ru(this.visualElement,"transform");let{animationState:s}=this.visualElement;s&&s.setActive("whileDrag",!0)},onMove:(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:r,dragDirectionLock:n,onDirectionLock:i,onDrag:s}=this.getProps();if(!r&&!this.openDragLock)return;let{offset:o}=t;if(n&&null===this.currentDirection){this.currentDirection=function(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}(o),null!==this.currentDirection&&i&&i(this.currentDirection);return}this.updateAxis("x",t.point,o),this.updateAxis("y",t.point,o),this.visualElement.render(),s&&s(e,t)},onSessionEnd:(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>nQ(e=>"paused"===this.getAnimationState(e)&&this.getAxisMotionValue(e).animation?.play())},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:i,distanceThreshold:r,contextWindow:nZ(this.visualElement)})}stop(e,t){let r=e||this.latestPointerEvent,n=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!n||!r)return;let{velocity:s}=n;this.startAnimation(s);let{onDragEnd:o}=this.getProps();o&&eh.postRender(()=>o(r,n))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,r){let{drag:n}=this.getProps();if(!r||!ir(e,n,this.currentDirection))return;let i=this.getAxisMotionValue(e),s=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(s=function(e,{min:t,max:r},n){return void 0!==t&&e<t?e=n?S(t,e,n.min):Math.max(e,t):void 0!==r&&e>r&&(e=n?S(r,e,n.max):Math.min(e,r)),e}(s,this.constraints[e],this.elastic[e])),i.set(s)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,n=this.constraints;e&&rt(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=function(e,{top:t,left:r,bottom:n,right:i}){return{x:n8(e.x,r,i),y:n8(e.y,t,n)}}(r.layoutBox,e):this.constraints=!1,this.elastic=function(e=.35){return!1===e?e=0:!0===e&&(e=.35),{x:n9(e,"left","right"),y:n9(e,"top","bottom")}}(t),n!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&nQ(e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){let r={};return void 0!==t.min&&(r.min=t.min-e.min),void 0!==t.max&&(r.max=t.max-e.min),r}(r.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){var e;let{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!rt(t))return!1;let n=t.current;Z(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");let{projection:i}=this.visualElement;if(!i||!i.layout)return!1;let s=function(e,t,r){let n=M(e,r),{scroll:i}=t;return i&&(I(n.x,i.offset.x),I(n.y,i.offset.y)),n}(n,i.root,this.visualElement.getTransformPagePoint()),o={x:n4((e=i.layout.layoutBox).x,s.x),y:n4(e.y,s.y)};if(r){let e=r(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(o));this.hasMutatedConstraints=!!e,e&&(o=T(e))}return o}startAnimation(e){let{drag:t,dragMomentum:r,dragElastic:n,dragTransition:i,dragSnapToOrigin:s,onDragTransitionEnd:o}=this.getProps(),a=this.constraints||{};return Promise.all(nQ(o=>{if(!ir(o,t,this.currentDirection))return;let l=a&&a[o]||{};s&&(l={min:0,max:0});
37let u={type:"inertia",velocity:r?e[o]:0,bounceStiffness:n?200:1e6,bounceDamping:n?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...i,...l};return this.startAxisValueAnimation(o,u)})).then(o)}startAxisValueAnimation(e,t){let r=this.getAxisMotionValue(e);return ru(this.visualElement,e),r.start(nk(e,r,0,t,this.visualElement,!1))}stopAnimation(){nQ(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){nQ(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps();return r[t]||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){nQ(t=>{let{drag:r}=this.getProps();if(!ir(t,r,this.currentDirection))return;let{projection:n}=this.visualElement,i=this.getAxisMotionValue(t);if(n&&n.layout){let{min:r,max:s}=n.layout.layoutBox[t];i.set(e[t]-S(r,s,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:r}=this.visualElement;if(!rt(t)||!r||!this.constraints)return;this.stopAnimation();let n={x:0,y:0};nQ(e=>{let t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){let r=t.get();n[e]=function(e,t){let r=.5,n=nH(e),i=nH(t);return i>n?r=r8(t.min,t.max-n,e.min):n>i&&(r=r8(e.min,e.max-i,t.min)),$(0,1,r)}({min:r,max:r},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),nQ(t=>{if(!ir(t,e,null))return;let r=this.getAxisMotionValue(t),{min:i,max:s}=this.constraints[t];r.set(S(i,s,n[t]))})}addListeners(){if(!this.visualElement.current)return;ie.set(this.visualElement,this);let e=nz(this.visualElement.current,"pointerdown",e=>{let{drag:t,dragListener:r=!0}=this.getProps();t&&r&&this.start(e)}),t=()=>{let{dragConstraints:e}=this.getProps();rt(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,n=r.addEventListener("measure",t);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),eh.read(t);let i=nF(window,"resize",()=>this.scalePositionWithinConstraints()),s=r.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(nQ(t=>{let r=this.getAxisMotionValue(t);r&&(this.originPoint[t]+=e[t].translate,r.set(r.get()+e[t].translate))}),this.visualElement.render())});return()=>{i(),e(),n(),s&&s()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:r=!1,dragPropagation:n=!1,dragConstraints:i=!1,dragElastic:s=.35,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:r,dragPropagation:n,dragConstraints:i,dragElastic:s,dragMomentum:o}}}function ir(e,t,r){return(!0===t||t===e)&&(null===r||r===e)}class ii extends nM{constructor(e){super(e),this.removeGroupControls=eo,this.removeListeners=eo,this.controls=new it(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||eo}unmount(){this.removeGroupControls(),this.removeListeners()}}let is=e=>(t,r)=>{e&&eh.postRender(()=>e(t,r))};class io extends nM{constructor(){super(...arguments),this.removePointerDownListener=eo}onPointerDown(e){this.session=new n1(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:nZ(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:r,onPanEnd:n}=this.node.getProps();return{onSessionStart:is(e),onStart:is(t),onMove:r,onEnd:(e,t)=>{delete this.session,n&&eh.postRender(()=>n(e,t))}}}mount(){this.removePointerDownListener=nz(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}var ia=r(9637);let il={hasAnimatedSinceResize:!0,hasEverUpdated:!1},iu=!1;class ic extends s.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:r,layoutId:n}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),r&&r.register&&n&&r.register(i),iu&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),il.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:r,drag:n,isPresent:i}=this.props,{projection:s}=r;return s&&(s.isPresent=i,iu=!0,n||e.layoutDependency!==t||void 0===t||e.isPresent!==i?s.willUpdate():this.safeToRemove(),e.isPresent===i||(i?s.promote():s.relegate()||eh.postRender(()=>{let e=s.getStack();e&&e.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),tr.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:r}=this.props,{projection:n}=e;iu=!0,n&&(n.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(n),r&&r.deregister&&r.deregister(n))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}}function ih(e){let[t,r]=(0,ia.oO)(),n=(0,s.useContext)(tK.p);return(0,tH.jsx)(ic,{...e,layoutGroup:n,switchLayoutGroup:(0,s.useContext)(rn),isPresent:t,safeToRemove:r})}var id=r(1464);function ip(e){return(0,id.K)(e)&&"ownerSVGElement"in e}let im=(e,t)=>e.depth-t.depth;class ig{constructor(){this.children=[],this.isDirty=!1}add(e){e5(this.children,e),this.isDirty=!0}remove(e){e6(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(im),this.isDirty=!1,this.children.forEac
37h(e)}}let iy=["TopLeft","TopRight","BottomLeft","BottomRight"],iv=iy.length,ib=e=>"string"==typeof e?parseFloat(e):e,iw=e=>"number"==typeof e||z.test(e);function ix(e,t){return void 0!==e[t]?e[t]:e.borderRadius}let i_=iT(0,.5,r0),iE=iT(.5,.95,eo);function iT(e,t,r){return n=>n<e?0:n>t?1:r(r8(e,t,n))}function iS(e,t){e.min=t.min,e.max=t.max}function ik(e,t){iS(e.x,t.x),iS(e.y,t.y)}function iA(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function iP(e,t,r,n,i){return e-=t,e=n+1/r*(e-n),void 0!==i&&(e=n+1/i*(e-n)),e}function iO(e,t,[r,n,i],s,o){!function(e,t=0,r=1,n=.5,i,s=e,o=e){if(W.test(t)&&(t=parseFloat(t),t=S(o.min,o.max,t/100)-o.min),"number"!=typeof t)return;let a=S(s.min,s.max,n);e===s&&(a-=t),e.min=iP(e.min,t,r,a,i),e.max=iP(e.max,t,r,a,i)}(e,t[r],t[n],t[i],t.scale,s,o)}let iR=["x","scaleX","originX"],iC=["y","scaleY","originY"];function ij(e,t,r,n){iO(e.x,t,iR,r?r.x:void 0,n?n.x:void 0),iO(e.y,t,iC,r?r.y:void 0,n?n.y:void 0)}function iI(e){return 0===e.translate&&1===e.scale}function iD(e){return iI(e.x)&&iI(e.y)}function iN(e,t){return e.min===t.min&&e.max===t.max}function iM(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function iL(e,t){return iM(e.x,t.x)&&iM(e.y,t.y)}function i$(e){return nH(e.x)/nH(e.y)}function iU(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class iB{constructor(){this.members=[]}add(e){e5(this.members,e),e.scheduleRender()}remove(e){if(e6(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){let t;let r=this.members.findIndex(t=>e===t);if(0===r)return!1;for(let e=r;e>=0;e--){let r=this.members[e];if(!1!==r.isPresent){t=r;break}}return!!t&&(this.promote(t),!0)}promote(e,t){let r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,t&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);let{crossfade:n}=e.options;!1===n&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{let{options:t,resumingFrom:r}=e;t.onExitComplete&&t.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}let iF={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},iV=["","X","Y","Z"],iq=0;function iW(e,t,r,n){let{latestValues:i}=t;i[e]&&(r[e]=i[e],t.setStaticValue(e,0),n&&(n[e]=0))}function iz({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(e={},r=t?.()){this.id=iq++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,eu.value&&(iF.nodes=iF.calculatedTargetDeltas=iF.calculatedProjections=0),this.nodes.forEach(iG),this.nodes.forEach(i1),this.nodes.forEach(i2),this.nodes.forEach(iJ),eu.addProjectionMetrics&&eu.addProjectionMetrics(iF)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=r?r.root||r:this,this.path=r?[...r.path,r]:[],this.parent=r,this.depth=r?r.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new ig)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new e3),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let r=this.eventHandlers.get(e);r&&r.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=ip(t)&&!(ip(t)&&"svg"===t.tagName),this.instance=t;let{layoutId:r,layout:n,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(n||r)&&(this.isLayoutDirty=!0),e){let r;let n=0,i=()=>this.root.updateBlockedByResize=!1;eh.read(()=>{n=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==n&&(n=e,this.root.updateBlockedByResize=!0,r&&r(),r=function(e,t){let r=e2.now(),n=({timestamp:t})=>{let i=t-r;i>=250&&(ed(n),e(i-250))};return eh.setup(n,!0),()=>ed(n)}(i,0),il.hasAnimatedSinceResize&&(il.hasAnimatedSinceResize=!1,this.nodes.forEac
37h(i0)))})}r&&this.root.registerSharedNode(r,this),!1!==this.options.animate&&i&&(r||n)&&this.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:r,layout:n})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let s=this.options.transition||i.getDefaultTransition()||i9,{onLayoutAnimationStart:o,onLayoutAnimationComplete:a}=i.getProps(),l=!this.targetLayout||!iL(this.targetLayout,n),u=!t&&r;if(this.options.layoutRoot||this.resumeFrom||u||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...ra(s,"layout"),onPlay:o,onComplete:a};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,u)}else t||i0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=n})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ed(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){!this.isUpdateBlocked()&&(this.isUpdating=!0,this.nodes&&this.nodes.forEach(i5),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&function e(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;let{visualElement:r}=t.options;if(!r)return;let n=r.props[rr];if(window.MotionHasOptimisedAnimation(n,"transform")){let{layout:e,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",eh,!(e||r))}let{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&e(i)}(this),this.root.isUpdating||this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,t.updateScroll("snapshot"),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:r}=this.options;if(void 0===t&&!r)return;let n=this.getTransformTemplate();this.prevTransformTemplateValue=n?n(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(iX);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(iQ);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(iZ),this.nodes.forEach(iH),this.nodes.forEach(iK)):this.nodes.forEach(iQ),this.clearAllSnapshots();let e=e2.now();ef.delta=$(0,1e3/60,e-ef.timestamp),ef.timestamp=e,ef.isProcessing=!0,ep.update.process(ef),ep.preRender.process(ef),ep.render.process(ef),ef.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,tr.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(iY),this.sharedNodes.forEach(i6)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,eh.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){eh.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),!this.snapshot||nH(this.snapshot.measuredBox.x)||nH(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=tu(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e="measure"){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=n(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!iD(this.projectionDelta),r=this.getTransformTemplate(),n=r?r(this.latestValues,""):void 0,s=n!==this.prevTransformTemplateValue;e&&this.instance&&(t||P(this.latestValues)||s)&&(i(this.instance,n),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){var t;let r=this.measurePageBox(),n=this.removeElementScroll(r);return e&&(n=this.removeTransform(n)),st((t=n).x),st(t.y),{animationId:this.root.animationId,measuredBox:r,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return tu();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(sn))){let{scroll:e}=this.root;e&&(I(t.x,e.offset.x),I(t.y,e.offset.y))}return t}removeElementScroll(e){let t=tu();if(ik(t,e),this.scroll?.wasRoot)return t;for(let r=0;r<this.path.length;r++){let n=this.path[r],{scroll:i,options:s}=n;n!==this.root&&i&&s.layoutScroll&&(i.wasRoot&&ik(t,e),I(t.x,i.offset.x),I(t.y,i.offset.y))}return t}applyTransform(e,t=!1){let r=tu();ik(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&N(r,{x:-n.scroll.offset.x,y:-n.scroll.offset.y}),P(n.latestValues)&&N(r,n.latestValues)}return P(this.latestValues)&&N(r,this.latestValues),r}removeTransform(e){let t=tu();ik(t,e);for(let e=0;e<this.path.length;e++){let r=this.path[e];if(!r.instance||!P(r.latestValues))continue;A(r.latestValues)&&r.updateSnapshot();let n=tu();ik(n,r.measurePageBox()),ij(t,r.latestValues,r.snapshot?r.snapshot.layoutBox:void 0,n)}return P(this.latestValues)&&ij(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:void 0===e.crossfade||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==ef.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=t.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=t.
37isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=t.isSharedProjectionDirty);let r=!!this.resumingFrom||this!==t;if(!(e||r&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:n,layoutId:i}=this.options;if(!this.layout||!(n||i))return;this.resolvedRelativeTargetAt=ef.timestamp;let s=this.getClosestProjectingParent();if(s&&this.linkedParentVersion!==s.layoutVersion&&!s.options.layoutRoot&&this.removeRelativeTarget(),this.targetDelta||this.relativeTarget||(s&&s.layout?this.createRelativeTarget(s,this.layout.layoutBox,s.layout.layoutBox):this.removeRelativeTarget()),this.relativeTarget||this.targetDelta){if(this.target||(this.target=tu(),this.targetWithTransforms=tu()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target){var o,a,l;this.forceRelativeParentToResolveTarget(),o=this.target,a=this.relativeTarget,l=this.relativeParent.target,nJ(o.x,a.x,l.x),nJ(o.y,a.y,l.y)}else this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ik(this.target,this.layout.layoutBox),j(this.target,this.targetDelta)):ik(this.target,this.layout.layoutBox);this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,s&&!!s.resumingFrom==!!this.resumingFrom&&!s.options.layoutScroll&&s.target&&1!==this.animationProgress?this.createRelativeTarget(s,this.target,s.target):this.relativeParent=this.relativeTarget=void 0),eu.value&&iF.calculatedTargetDeltas++}}getClosestProjectingParent(){return!this.parent||A(this.parent.latestValues)||O(this.parent.latestValues)?void 0:this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,r){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=tu(),this.relativeTargetOrigin=tu(),nX(this.relativeTargetOrigin,t,r),ik(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,r=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(r=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(r=!1),this.resolvedRelativeTargetAt===ef.timestamp&&(r=!1),r)return;let{layout:n,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(n||i))return;ik(this.layoutCorrected,this.layout.layoutBox);let s=this.treeScale.x,o=this.treeScale.y;!function(e,t,r,n=!1){let i,s;let o=r.length;if(o){t.x=t.y=1;for(let a=0;a<o;a++){s=(i=r[a]).projectionDelta;let{visualElement:o}=i.options;(!o||!o.props.style||"contents"!==o.props.style.display)&&(n&&i.options.layoutScroll&&i.scroll&&i!==i.root&&N(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,j(e,s)),n&&P(i.latestValues)&&N(e,i.latestValues))}t.x<1.0000000000001&&t.x>.999999999999&&(t.x=1),t.y<1.0000000000001&&t.y>.999999999999&&(t.y=1)}}(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(1!==this.treeScale.x||1!==this.treeScale.y)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=tu());let{target:a}=e;if(!a){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}this.projectionDelta&&this.prevProjectionDelta?(iA(this.prevProjectionDelta.x,this.projectionDelta.x),iA(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),nG(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.treeScale.x===s&&this.treeScale.y===o&&iU(this.projectionDelta.x,this.prevProjectionDelta.x)&&iU(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",a)),eu.value&&iF.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ta(),this.projectionDelta=ta(),this.projectionDeltaWithTransform=ta()}setAnimationOrigin(e,t=!1){let r;let n=this.snapshot,i=n?n.latestValues:{},s={...this.latestValues},o=ta();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let a=tu(),l=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),u=this.getStack(),c=!u||u.members.length<=1,h=!!(l&&!c&&!0===this.options.crossfade&&!this.path.some(i4));this.animationProgress=0,this.mixTargetDelta=t=>{let n=t/1e3;if(i3(o.x,e.x,n),i3(o.y,e.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout){var u,d,f,p;nX(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox),f=this.relativeTarget,p=this.relativeTargetOrigin,i8(f.x,p.x,a.x,n),i8(f.y,p.y,a.y,n),r&&(u=this.relativeTarget,d=r,iN(u.x,d.x)&&iN(u.y,d.y))&&(this.isProjectionDirty=!1),r||(r=tu()),ik(r,this.relativeTarget)}l&&(this.animationValues=s,function(e,t,r,n,i,s){i?(e.opacity=S(0,r.opacity??1,i_(n)),e.opacityExit=S(t.opacity??1,0,iE(n))):s&&(e.opacity=S(t.o
37pacity??1,r.opacity??1,n));for(let i=0;i<iv;i++){let s=`border${iy[i]}Radius`,o=ix(t,s),a=ix(r,s);(void 0!==o||void 0!==a)&&(o||(o=0),a||(a=0),0===o||0===a||iw(o)===iw(a)?(e[s]=Math.max(S(ib(o),ib(a),n),0),(W.test(a)||W.test(o))&&(e[s]+="%")):e[s]=a)}(t.rotate||r.rotate)&&(e.rotate=S(t.rotate||0,r.rotate||0,n))}(s,i,this.latestValues,n,h,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(ed(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=eh.update(()=>{il.hasAnimatedSinceResize=!0,rm.layout++,this.motionValue||(this.motionValue=e7(0)),this.currentAnimation=function(e,t,r){let n=e0(e)?e:e7(e);return n.start(nk("",n,t,r)),n.animation}(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{rm.layout--},onComplete:()=>{rm.layout--,e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:r,layout:n,latestValues:i}=e;if(t&&r&&n){if(this!==e&&this.layout&&n&&sr(this.options.animationType,this.layout.layoutBox,n.layoutBox)){r=this.target||tu();let t=nH(this.layout.layoutBox.x);r.x.min=e.target.x.min,r.x.max=r.x.min+t;let n=nH(this.layout.layoutBox.y);r.y.min=e.target.y.min,r.y.max=r.y.min+n}ik(t,r),N(t,i),nG(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new iB),this.sharedNodes.get(e).add(t);let r=t.options.initialPromotionConfig;t.promote({transition:r?r.transition:void 0,preserveFollowOpacity:r&&r.shouldPreserveFollowOpacity?r.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:r}={}){let n=this.getStack();n&&n.promote(this,r),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:r}=e;if((r.z||r.rotate||r.rotateX||r.rotateY||r.rotateZ||r.skewX||r.skewY)&&(t=!0),!t)return;let n={};r.z&&iW("z",e,n,this.animationValues);for(let t=0;t<iV.length;t++)iW(`rotate${iV[t]}`,e,n,this.animationValues),iW(`skew${iV[t]}`,e,n,this.animationValues);for(let t in e.render(),n)e.setStaticValue(t,n[t]),this.animationValues&&(this.animationValues[t]=n[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility="hidden";return}let r=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility="",e.opacity="",e.pointerEvents=t8(t?.pointerEvents)||"",e.transform=r?r(this.latestValues,""):"none";return}let n=this.getLead();if(!this.projectionDelta||!this.layout||!n.target){this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=t8(t?.pointerEvents)||""),this.hasProjected&&!P(this.latestValues)&&(e.transform=r?r({},""):"none",this.hasProjected=!1);return}e.visibility="";let i=n.animationValues||n.latestValues;this.applyTransformsToTarget();let s=function(e,t,r){let n="",i=e.x.translate/t.x,s=e.y.translate/t.y,o=r?.z||0;if((i||s||o)&&(n=`translate3d(${i}px, ${s}px, ${o}px) `),(1!==t.x||1!==t.y)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),r){let{transformPerspective:e,rotate:t,rotateX:i,rotateY:s,skewX:o,skewY:a}=r;e&&(n=`perspective(${e}px) ${n}`),t&&(n+=`rotate(${t}deg) `),i&&(n+=`rotateX(${i}deg) `),s&&(n+=`rotateY(${s}deg) `),o&&(n+=`skewX(${o}deg) `),a&&(n+=`skewY(${a}deg) `)}let a=e.x.scale*t.x,l=e.y.scale*t.y;return(1!==a||1!==l)&&(n+=`scale(${a}, ${l})`),n||"none"}(this.projectionDeltaWithTransform,this.treeScale,i);r&&(s=r(i,s)),e.transform=s;let{x:o,y:a}=this.projectionDelta;for(let t in e.transformOrigin=`${100*o.origin}% ${100*a.origin}% 0`,n.animationValues?e.opacity=n===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:e.opacity=n===this?void 0!==i.opacity?i.opacity:"":void 0!==i.opacityExit?i.opacityExit:0,tj){if(void 0===i[t])continue;let{correct:r,applyTo:o,isCSSVariable:a}=tj[t],l="none"===s?i[t]:r(i[t],n);
37if(o){let t=o.length;for(let r=0;r<t;r++)e[o[r]]=l}else a?this.options.visualElement.renderState.vars[t]=l:e[t]=l}this.options.layoutId&&(e.pointerEvents=n===this?t8(t?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(iX),this.root.sharedNodes.clear()}}}function iH(e){e.updateLayout()}function iK(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){let{layoutBox:r,measuredBox:n}=e.layout,{animationType:i}=e.options,s=t.source!==e.layout.source;"size"===i?nQ(e=>{let n=s?t.measuredBox[e]:t.layoutBox[e],i=nH(n);n.min=r[e].min,n.max=n.min+i}):sr(i,t.layoutBox,r)&&nQ(n=>{let i=s?t.measuredBox[n]:t.layoutBox[n],o=nH(r[n]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[n].max=e.relativeTarget[n].min+o)});let o=ta();nG(o,r,t.layoutBox);let a=ta();s?nG(a,e.applyTransform(n,!0),t.measuredBox):nG(a,r,t.layoutBox);let l=!iD(o),u=!1;if(!e.resumeFrom){let n=e.getClosestProjectingParent();if(n&&!n.resumeFrom){let{snapshot:i,layout:s}=n;if(i&&s){let o=tu();nX(o,t.layoutBox,i.layoutBox);let a=tu();nX(a,r,s.layoutBox),iL(o,a)||(u=!0),n.options.layoutRoot&&(e.relativeTarget=a,e.relativeTargetOrigin=o,e.relativeParent=n)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:a,layoutDelta:o,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function iG(e){eu.value&&iF.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function iJ(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function iY(e){e.clearSnapshot()}function iX(e){e.clearMeasurements()}function iQ(e){e.isLayoutDirty=!1}function iZ(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function i0(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function i1(e){e.resolveTargetDelta()}function i2(e){e.calcProjection()}function i5(e){e.resetSkewAndRotation()}function i6(e){e.removeLeadSnapshot()}function i3(e,t,r){e.translate=S(t.translate,0,r),e.scale=S(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function i8(e,t,r,n){e.min=S(t.min,r.min,n),e.max=S(t.max,r.max,n)}function i4(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}let i9={duration:.45,ease:[.4,0,.1,1]},i7=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),se=i7("applewebkit/")&&!i7("chrome/")?Math.round:eo;function st(e){e.min=se(e.min),e.max=se(e.max)}function sr(e,t,r){return"position"===e||"preserve-aspect"===e&&!(.2>=Math.abs(i$(t)-i$(r)))}function sn(e){return e!==e.root&&e.scroll?.wasRoot}let si=iz({attachResizeListener:(e,t)=>nF(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ss={current:void 0},so=iz({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!ss.current){let e=new si({});e.mount(window),e.setOptions({layoutScroll:!0}),ss.current=e}return ss.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>"fixed"===window.getComputedStyle(e).position});function sa(e,t){let r=function(e,t,r){if(e instanceof EventTarget)return[e];if("string"==typeof e){let t=document,r=(void 0)??t.querySelectorAll(e);return r?Array.from(r):[]}return Array.from(e)}(e),n=new AbortController;return[r,{passive:!0,...t,signal:n.signal},()=>n.abort()]}function sl(e){return!("touch"===e.pointerType||nB.x||nB.y)}function su(e,t,r){let{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover","Start"===r);let i=n["onHover"+r];i&&eh.postRender(()=>i(t,nq(t)))}class sc extends nM{mount(){let{current:e}=this.node;e&&(this.unmount=function(e,t,r={}){let[n,i,s]=sa(e,r),o=e=>{if(!sl(e))return;let{target:r}=e,n=t(r,e);if("function"!=typeof n||!r)return;let s=e=>{sl(e)&&(n(e),r.removeEventListener("pointerleave",s))};r.addEventListener("pointerleave",s,i)};
37return n.forEach(e=>{e.addEventListener("pointerenter",o,i)}),s}(e,(e,t)=>(su(this.node,t,"Start"),e=>su(this.node,e,"End"))))}unmount(){}}class sh extends nM{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=rd(nF(this.node.current,"focus",()=>this.onFocus()),nF(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}var sd=r(3537);let sf=(e,t)=>!!t&&(e===t||sf(e,t.parentElement)),sp=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]),sm=new WeakSet;function sg(e){return t=>{"Enter"===t.key&&e(t)}}function sy(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}let sv=(e,t)=>{let r=e.currentTarget;if(!r)return;let n=sg(()=>{if(sm.has(r))return;sy(r,"down");let e=sg(()=>{sy(r,"up")});r.addEventListener("keyup",e,t),r.addEventListener("blur",()=>sy(r,"cancel"),t)});r.addEventListener("keydown",n,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),t)};function sb(e){return nV(e)&&!(nB.x||nB.y)}function sw(e,t,r){let{props:n}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap","Start"===r);let i=n["onTap"+("End"===r?"":r)];i&&eh.postRender(()=>i(t,nq(t)))}class sx extends nM{mount(){let{current:e}=this.node;e&&(this.unmount=function(e,t,r={}){let[n,i,s]=sa(e,r),o=e=>{let n=e.currentTarget;if(!sb(e))return;sm.add(n);let s=t(n,e),o=(e,t)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),sm.has(n)&&sm.delete(n),sb(e)&&"function"==typeof s&&s(e,{success:t})},a=e=>{o(e,n===window||n===document||r.useGlobalTarget||sf(n,e.target))},l=e=>{o(e,!1)};window.addEventListener("pointerup",a,i),window.addEventListener("pointercancel",l,i)};return n.forEach(e=>{(r.useGlobalTarget?window:e).addEventListener("pointerdown",o,i),(0,sd.R)(e)&&(e.addEventListener("focus",e=>sv(e,i)),sp.has(e.tagName)||-1!==e.tabIndex||e.hasAttribute("tabindex")||(e.tabIndex=0))}),s}(e,(e,t)=>(sw(this.node,t,"Start"),(e,{success:t})=>sw(this.node,e,t?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}let s_=new WeakMap,sE=new WeakMap,sT=e=>{let t=s_.get(e.target);t&&t(e)},sS=e=>{e.forEach(sT)},sk={some:0,all:1};class sA extends nM{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:e={}}=this.node.getProps(),{root:t,margin:r,amount:n="some",once:i}=e,s={root:t?t.current:void 0,rootMargin:r,threshold:"number"==typeof n?n:sk[n]};return function(e,t,r){let n=function({root:e,...t}){let r=e||document;sE.has(r)||sE.set(r,{});let n=sE.get(r),i=JSON.stringify(t);return n[i]||(n[i]=new IntersectionObserver(sS,{root:e,...t})),n[i]}(t);return s_.set(e,r),n.observe(e),()=>{s_.delete(e),n.unobserve(e)}}(this.node.current,s,e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);let{onViewportEnter:r,onViewportLeave:n}=this.node.getProps(),s=t?r:n;s&&s(e)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;let{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}(e,t))&&this.startObserver()}unmount(){}}let sP=function(e,t){if("undefined"==typeof Proxy)return rs;let r=new Map,n=(r,n)=>rs(r,n,e,t);return new Proxy((e,t)=>n(e,t),{get:(i,s)=>"create"===s?n:(r.has(s)||r.set(s,rs(s,void 0,e,t)),r.get(s))})}({animation:{Feature:nL},exit:{Feature:nU},inView:{Feature:sA},tap:{Feature:sx},focus:{Feature:sh},hover:{Feature:sc},pan:{Feature:io},drag:{Feature:ii,ProjectionNode:so,MeasureLayout:ih},layout:{ProjectionNode:so,MeasureLayout:ih}},(e,t)=>tz(e)?new tq(t):new tN(t,{allowProjection:e!==s.Fragment}))},4563:function(e,t,r){"use strict";r.d(t,{j:function(){return n}});let n="undefined"!=typeof window},3576:function(e,t,r){"use strict";r.d(t,{h:function(){return i}});var n=r(2265);function i(e){let t=(0,n.useRef)(null);return null===t.current&&(t.current=e()),t.current}},1534:function(e,t,r){"use strict";r.d(t,{L:function(){return i}});var n=r(2265);let i=r(4563).j?n.useLayoutEffect:n.useEffect},3537:function(e,t,r){"use strict";r.d(t,{R:function(){return i}});var n=r(1464);function i(e){return(0,n.K)(e)&&"offsetHeight"in e}},1464:function(e,t,r){"use strict";function n(e){return"object"==typeof e&&null!==e}r.d(t,{K:function(){return n}})},5922:function(e,t,r){"use strict";r.d(t,{F:function(){return o}});var n=r(2265),i=n.createContext(void 0),s={setTheme:e=>{},themes:[]},o=()=>{var e;return null!=(e=n.useContext(i))?e:s}},4438:function(e,t,r){"use strict";r.d(t,{x7:function(){return x}});var n=r(2265),i=r(4887),s=e=>{switch(e){case"success":return l;case"info":return c;case"warning":return u;case"error":return h;default:return null}},o=Array(12).fill(0),a=e=>{let{visible:t,className:r}=e;return n.createElement("div",{className:["sonner-loading-wrapper",r].filter(
37Boolean).join(" "),"data-visible":t},n.createElement("div",{className:"sonner-spinner"},o.map((e,t)=>n.createElement("div",{className:"sonner-loading-bar",key:"spinner-bar-".concat(t)}))))},l=n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},n.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),u=n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},n.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),c=n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},n.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),h=n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},n.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),d=n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),f=()=>{let[e,t]=n.useState(document.hidden);return n.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",e),()=>window.removeEventListener("visibilitychange",e)},[]),e},p=1,m=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,i="number"==typeof(null==e?void 0:e.id)||(null==(t=e.id)?void 0:t.length)>0?e.id:p++,s=this.toasts.find(e=>e.id===i),o=void 0===e.dismissible||e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),s?this.toasts=this.toasts.map(t=>t.id===i?(this.publish({...t,...e,id:i,title:r}),{...t,...e,id:i,dismissible:o,title:r}):t):this.addToast({title:r,...n,dismissible:o,id:i}),i},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>
37this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{let r;if(!t)return;void 0!==t.loading&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:"function"!=typeof t.description?t.description:void 0}));let i=e instanceof Promise?e:e(),s=void 0!==r,o,a=i.then(async e=>{if(o=["resolve",e],n.isValidElement(e))s=!1,this.create({id:r,type:"default",message:e});else if(g(e)&&!e.ok){s=!1;let n="function"==typeof t.error?await t.error("HTTP error! status: ".concat(e.status)):t.error,i="function"==typeof t.description?await t.description("HTTP error! status: ".concat(e.status)):t.description;this.create({id:r,type:"error",message:n,description:i})}else if(void 0!==t.success){s=!1;let n="function"==typeof t.success?await t.success(e):t.success,i="function"==typeof t.description?await t.description(e):t.description;this.create({id:r,type:"success",message:n,description:i})}}).catch(async e=>{if(o=["reject",e],void 0!==t.error){s=!1;let n="function"==typeof t.error?await t.error(e):t.error,i="function"==typeof t.description?await t.description(e):t.description;this.create({id:r,type:"error",message:n,description:i})}}).finally(()=>{var e;s&&(this.dismiss(r),r=void 0),null==(e=t.finally)||e.call(t)}),l=()=>new Promise((e,t)=>a.then(()=>"reject"===o[0]?t(o[1]):e(o[1])).catch(t));return"string"!=typeof r&&"number"!=typeof r?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(e,t)=>{let r=(null==t?void 0:t.id)||p++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},g=e=>e&&"object"==typeof e&&"ok"in e&&"boolean"==typeof e.ok&&"status"in e&&"number"==typeof e.status;function y(e){return void 0!==e.label}function v(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter(Boolean).join(" ")}Object.assign((e,t)=>{let r=(null==t?void 0:t.id)||p++;return m.addToast({title:e,...t,id:r}),r},{success:m.success,info:m.info,warning:m.warning,error:m.error,custom:m.custom,message:m.message,promise:m.promise,dismiss:m.dismiss,loading:m.loading},{getHistory:()=>m.toasts,getToasts:()=>m.getActiveToasts()}),function(e){let{insertAt:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e||"undefined"==typeof document)return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===t&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}(':where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;
37left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}
37:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);
37--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}\n');var b=e=>{var t,r,i,o,l,u,c,h,p,m,g,b,w,x;let{invert:_,toast:E,unstyled:T,interacting:S,setHeights:k,visibleToasts:A,heights:P,index:O,toasts:R,expanded:C,removeToast:j,defaultRichColors:I,closeButton:D,style:N,cancelButtonStyle:M,actionButtonStyle:L,className:$="",descriptionClassName:U="",duration:B,position:F,gap:V,loadingIcon:q,expandByDefault:W,classNames:z,icons:H,closeButtonAriaLabel:K="Close toast",pauseWhenPageIsHidden:G}=e,[J,Y]=n.useState(null),[X,Q]=n.useState(null),[Z,ee]=n.useState(!1),[et,er]=n.useState(!1),[en,ei]=n.useState(!1),[es,eo]=n.useState(!1),[ea,el]=n.useState(!1),[eu,ec]=n.useState(0),[eh,ed]=n.useState(0),ef=n.useRef(E.duration||B||4e3),ep=n.useRef(null),em=n.useRef(null),eg=0===O,ey=O+1<=A,ev=E.type,eb=!1!==E.dismissible,ew=E.className||"",ex=E.descriptionClassName||"",e_=n.useMemo(()=>P.findIndex(e=>e.toastId===E.id)||0,[P,E.id]),eE=n.useMemo(()=>{var e;return null!=(e=E.closeButton)?e:D},[E.closeButton,D]),eT=n.useMemo(()=>E.duration||B||4e3,[E.duration,B]),eS=n.useRef(0),ek=n.useRef(0),eA=n.useRef(0),eP=n.useRef(null),[eO,eR]=F.split("-"),eC=n.useMemo(()=>P.reduce((e,t,r)=>r>=e_?e:e+t.height,0),[P,e_]),ej=f(),eI=E.invert||_,eD="loading"===ev;ek.current=n.useMemo(()=>e_*V+eC,[e_,eC]),n.useEffect(()=>{ef.current=eT},[eT]),n.useEffect(()=>{ee(!0)},[]),n.useEffect(()=>{let e=em.current;if(e){let t=e.getBoundingClientRect().height;return ed(t),k(e=>[{toastId:E.id,height:t,position:E.position},...e]),()=>k(e=>e.filter(e=>e.toastId!==E.id))}},[k,E.id]),n.useLayoutEffect(()=>{if(!Z)return;let e=em.current,t=e.style.height;e.style.height="auto";let r=e.getBoundingClientRect().height;e.style.height=t,ed(r),k(e=>e.find(e=>e.toastId===E.id)?e.map(e=>e.toastId===E.id?{...e,height:r}:e):[{toastId:E.id,height:r,position:E.position},...e])},[Z,E.title,E.description,k,E.id]);let eN=n.useCallback(()=>{er(!0),ec(ek.current),k(e=>e.filter(e=>e.toastId!==E.id)),setTimeout(()=>{j(E)},200)},[E,j,k,ek]);return n.useEffect(()=>{let e;if((!E.promise||"loading"!==ev)&&E.duration!==1/0&&"loading"!==E.type)return C||S||G&&ej?(()=>{if(eA.current<eS.current){let e=new Date().getTime()-eS.current;ef.current=ef.current-e}
37eA.current=new Date().getTime()})():ef.current!==1/0&&(eS.current=new Date().getTime(),e=setTimeout(()=>{var e;null==(e=E.onAutoClose)||e.call(E,E),eN()},ef.current)),()=>clearTimeout(e)},[C,S,E,ev,G,ej,eN]),n.useEffect(()=>{E.delete&&eN()},[eN,E.delete]),n.createElement("li",{tabIndex:0,ref:em,className:v($,ew,null==z?void 0:z.toast,null==(t=null==E?void 0:E.classNames)?void 0:t.toast,null==z?void 0:z.default,null==z?void 0:z[ev],null==(r=null==E?void 0:E.classNames)?void 0:r[ev]),"data-sonner-toast":"","data-rich-colors":null!=(i=E.richColors)?i:I,"data-styled":!(E.jsx||E.unstyled||T),"data-mounted":Z,"data-promise":!!E.promise,"data-swiped":ea,"data-removed":et,"data-visible":ey,"data-y-position":eO,"data-x-position":eR,"data-index":O,"data-front":eg,"data-swiping":en,"data-dismissible":eb,"data-type":ev,"data-invert":eI,"data-swipe-out":es,"data-swipe-direction":X,"data-expanded":!!(C||W&&Z),style:{"--index":O,"--toasts-before":O,"--z-index":R.length-O,"--offset":"".concat(et?eu:ek.current,"px"),"--initial-height":W?"auto":"".concat(eh,"px"),...N,...E.style},onDragEnd:()=>{ei(!1),Y(null),eP.current=null},onPointerDown:e=>{eD||!eb||(ep.current=new Date,ec(ek.current),e.target.setPointerCapture(e.pointerId),"BUTTON"!==e.target.tagName&&(ei(!0),eP.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{var e,t,r,n;if(es||!eb)return;eP.current=null;let i=Number((null==(e=em.current)?void 0:e.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),s=Number((null==(t=em.current)?void 0:t.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),o=new Date().getTime()-(null==(r=ep.current)?void 0:r.getTime()),a="x"===J?i:s;if(Math.abs(a)>=20||Math.abs(a)/o>.11){ec(ek.current),null==(n=E.onDismiss)||n.call(E,E),Q("x"===J?i>0?"right":"left":s>0?"down":"up"),eN(),eo(!0),el(!1);return}ei(!1),Y(null)},onPointerMove:t=>{var r,n,i,s;if(!eP.current||!eb||(null==(r=window.getSelection())?void 0:r.toString().length)>0)return;let o=t.clientY-eP.current.y,a=t.clientX-eP.current.x,l=null!=(n=e.swipeDirections)?n:function(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}(F);!J&&(Math.abs(a)>1||Math.abs(o)>1)&&Y(Math.abs(a)>Math.abs(o)?"x":"y");let u={x:0,y:0};"y"===J?(l.includes("top")||l.includes("bottom"))&&(l.includes("top")&&o<0||l.includes("bottom")&&o>0)&&(u.y=o):"x"===J&&(l.includes("left")||l.includes("right"))&&(l.includes("left")&&a<0||l.includes("right")&&a>0)&&(u.x=a),(Math.abs(u.x)>0||Math.abs(u.y)>0)&&el(!0),null==(i=em.current)||i.style.setProperty("--swipe-amount-x","".concat(u.x,"px")),null==(s=em.current)||s.style.setProperty("--swipe-amount-y","".concat(u.y,"px"))}},eE&&!E.jsx?n.createElement("button",{"aria-label":K,"data-disabled":eD,"data-close-button":!0,onClick:eD||!eb?()=>{}:()=>{var e;eN(),null==(e=E.onDismiss)||e.call(E,E)},className:v(null==z?void 0:z.closeButton,null==(o=null==E?void 0:E.classNames)?void 0:o.closeButton)},null!=(l=null==H?void 0:H.close)?l:d):null,E.jsx||(0,n.isValidElement)(E.title)?E.jsx?E.jsx:"function"==typeof E.title?E.title():E.title:n.createElement(n.Fragment,null,ev||E.icon||E.promise?n.createElement("div",{"data-icon":"",className:v(null==z?void 0:z.icon,null==(u=null==E?void 0:E.classNames)?void 0:u.icon)},E.promise||"loading"===E.type&&!E.icon?E.icon||(null!=H&&H.loading?n.createElement("div",{className:v(null==z?void 0:z.loader,null==(b=null==E?void 0:E.classNames)?void 0:b.loader,"sonner-loader"),"data-visible":"loading"===ev},H.loading):q?n.createElement("div",{className:v(null==z?void 0:z.loader,null==(w=null==E?void 0:E.classNames)?void 0:w.loader,"sonner-loader"),"data-visible":"loading"===ev},q):n.createElement(a,{className:v(null==z?void 0:z.loader,null==(x=null==E?void 0:E.classNames)?void 0:x.loader),visible:"loading"===ev})):null,"loading"!==E.type?E.icon||(null==H?void 0:H[ev])||s(ev):null):null,n.createElement("div",{"data-content":"",className:v(null==z?void 0:z.content,null==(c=null==E?void 0:E.classNames)?void 0:c.content)},n.createElement("div",{"data-title":"",className:v(null==z?void 0:z.title,null==(h=null==E?void 0:E.classNames)?void 0:h.title)},"function"==typeof E.title?E.title():E.title),E.description?n.createElement("div",{"data-description":"",className:v(U,ex,null==z?void 0:z.description,null==(p=null==E?void 0:E.
37classNames)?void 0:p.description)},"function"==typeof E.description?E.description():E.description):null),(0,n.isValidElement)(E.cancel)?E.cancel:E.cancel&&y(E.cancel)?n.createElement("button",{"data-button":!0,"data-cancel":!0,style:E.cancelButtonStyle||M,onClick:e=>{var t,r;y(E.cancel)&&eb&&(null==(r=(t=E.cancel).onClick)||r.call(t,e),eN())},className:v(null==z?void 0:z.cancelButton,null==(m=null==E?void 0:E.classNames)?void 0:m.cancelButton)},E.cancel.label):null,(0,n.isValidElement)(E.action)?E.action:E.action&&y(E.action)?n.createElement("button",{"data-button":!0,"data-action":!0,style:E.actionButtonStyle||L,onClick:e=>{var t,r;y(E.action)&&(null==(r=(t=E.action).onClick)||r.call(t,e),e.defaultPrevented||eN())},className:v(null==z?void 0:z.actionButton,null==(g=null==E?void 0:E.classNames)?void 0:g.actionButton)},E.action.label):null))};function w(){if("undefined"==typeof window||"undefined"==typeof document)return"ltr";let e=document.documentElement.getAttribute("dir");return"auto"!==e&&e?e:window.getComputedStyle(document.documentElement).direction}var x=(0,n.forwardRef)(function(e,t){let{invert:r,position:s="bottom-right",hotkey:o=["altKey","KeyT"],expand:a,closeButton:l,className:u,offset:c,mobileOffset:h,theme:d="light",richColors:f,duration:p,style:g,visibleToasts:y=3,toastOptions:v,dir:x=w(),gap:_=14,loadingIcon:E,icons:T,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:k}=e,[A,P]=n.useState([]),O=n.useMemo(()=>Array.from(new Set([s].concat(A.filter(e=>e.position).map(e=>e.position)))),[A,s]),[R,C]=n.useState([]),[j,I]=n.useState(!1),[D,N]=n.useState(!1),[M,L]=n.useState("system"!==d?d:"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),$=n.useRef(null),U=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),B=n.useRef(null),F=n.useRef(!1),V=n.useCallback(e=>{P(t=>{var r;return null!=(r=t.find(t=>t.id===e.id))&&r.delete||m.dismiss(e.id),t.filter(t=>{let{id:r}=t;return r!==e.id})})},[]);return n.useEffect(()=>m.subscribe(e=>{if(e.dismiss){P(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t));return}setTimeout(()=>{i.flushSync(()=>{P(t=>{let r=t.findIndex(t=>t.id===e.id);return -1!==r?[...t.slice(0,r),{...t[r],...e},...t.slice(r+1)]:[e,...t]})})})}),[]),n.useEffect(()=>{if("system"!==d){L(d);return}if("system"===d&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?L("dark"):L("light")),"undefined"==typeof window)return;let e=window.matchMedia("(prefers-color-scheme: dark)");try{e.addEventListener("change",e=>{let{matches:t}=e;L(t?"dark":"light")})}catch(t){e.addListener(e=>{let{matches:t}=e;try{L(t?"dark":"light")}catch(e){console.error(e)}})}},[d]),n.useEffect(()=>{A.length<=1&&I(!1)},[A]),n.useEffect(()=>{let e=e=>{var t,r;o.every(t=>e[t]||e.code===t)&&(I(!0),null==(t=$.current)||t.focus()),"Escape"===e.code&&(document.activeElement===$.current||null!=(r=$.current)&&r.contains(document.activeElement))&&I(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[o]),n.useEffect(()=>{if($.current)return()=>{B.current&&(B.current.focus({preventScroll:!0}),B.current=null,F.current=!1)}},[$.current]),n.createElement("section",{ref:t,"aria-label":"".concat(S," ").concat(U),tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},O.map((t,i)=>{var s;let o;let[d,m]=t.split("-");return A.length?n.createElement("ol",{key:t,dir:"auto"===x?w():x,tabIndex:-1,ref:$,className:u,"data-sonner-toaster":!0,"data-theme":M,"data-y-position":d,"data-lifted":j&&A.length>1&&!a,"data-x-position":m,style:{"--front-toast-height":"".concat((null==(s=R[0])?void 0:s.height)||0,"px"),"--width":"".concat(356,"px"),"--gap":"".concat(_,"px"),...g,...(o={},[c,h].forEach((e,t)=>{let r=1===t,n=r?"--mobile-offset":"--offset",i=r?"16px":"32px";function s(e){["top","right","bottom","left"].forEach(t=>{o["".concat(n,"-").concat(t)]="number"==typeof e?"".concat(e,"px"):e})}"number"==typeof e||"string"==typeof e?s(e):"object"==typeof e?["top","right","bottom","left"].forEach(t=>{void 0===e[t]?o["".concat(n,"-").concat(t)]=i:o["".concat(n,"-").concat(t)]="number"==typeof e[t]?"".concat(e[t],"px"):e[t]}):s(i)}),o)},onBlur:e=>{F.current&&!e.currentTarget.contains(e.relatedTarget)&&(F.current=!1,B.current&&(B.current.focus({preventScroll:!0}),B.current=null))},onFocus:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||F.current||(F.current=!0,B.current=e.relatedTarget)},onMouseEnter:()=>I(!0),onMouseMove:()=>I(!0),onMouseLeave:()=>{D||I(!1)},onDragEnd:()=>I(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||N(!0)},onPointerUp:()=>N(!1)},A.filter(e=>!e.position&&0===i||e.position===t).map((i,s)=>{var o,u;
37return n.createElement(b,{key:i.id,icons:T,index:s,toast:i,defaultRichColors:f,duration:null!=(o=null==v?void 0:v.duration)?o:p,className:null==v?void 0:v.className,descriptionClassName:null==v?void 0:v.descriptionClassName,invert:r,visibleToasts:y,closeButton:null!=(u=null==v?void 0:v.closeButton)?u:l,interacting:D,position:t,style:null==v?void 0:v.style,unstyled:null==v?void 0:v.unstyled,classNames:null==v?void 0:v.classNames,cancelButtonStyle:null==v?void 0:v.cancelButtonStyle,actionButtonStyle:null==v?void 0:v.actionButtonStyle,removeToast:V,toasts:A.filter(e=>e.position==i.position),heights:R.filter(e=>e.position==i.position),setHeights:C,expandByDefault:a,gap:_,loadingIcon:E,expanded:j,pauseWhenPageIsHidden:k,swipeDirections:e.swipeDirections})})):null}))})},3335:function(e,t,r){"use strict";r.d(t,{m6:function(){return J}});let n=e=>{let t=a(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{let r=e.split("-");return""===r[0]&&1!==r.length&&r.shift(),i(r,t)||o(e)},getConflictingClassGroupIds:(e,t)=>{let i=r[e]||[];return t&&n[e]?[...i,...n[e]]:i}}},i=(e,t)=>{if(0===e.length)return t.classGroupId;let r=e[0],n=t.nextPart.get(r),s=n?i(e.slice(1),n):void 0;if(s)return s;if(0===t.validators.length)return;let o=e.join("-");return t.validators.find(({validator:e})=>e(o))?.classGroupId},s=/^\[(.+)\]$/,o=e=>{if(s.test(e)){let t=s.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},a=e=>{let{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return h(Object.entries(e.classGroups),r).forEach(([e,r])=>
37{l(r,n,e,t)}),n},l=(e,t,r,n)=>{e.forEach(e=>{if("string"==typeof e){(""===e?t:u(t,e)).classGroupId=r;return}if("function"==typeof e){if(c(e)){l(e(n),t,r,n);return}t.validators.push({validator:e,classGroupId:r});return}Object.entries(e).forEach(([e,i])=>{l(i,u(t,e),r,n)})})},u=(e,t)=>{let r=e;return t.split("-").forEach(e=>{r.nextPart.has(e)||r.nextPart.set(e,{nextPart:new Map,validators:[]}),r=r.nextPart.get(e)}),r},c=e=>e.isThemeGetter,h=(e,t)=>t?e.map(([e,r])=>[e,r.map(e=>"string"==typeof e?t+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,r])=>[t+e,r])):e)]):e,d=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,r=new Map,n=new Map,i=(i,s)=>{r.set(i,s),++t>e&&(t=0,n=r,r=new Map)};return{get(e){let t=r.get(e);return void 0!==t?t:void 0!==(t=n.get(e))?(i(e,t),t):void 0},set(e,t){r.has(e)?r.set(e,t):i(e,t)}}},f=e=>{let{separator:t,experimentalParseClassName:r}=e,n=1===t.length,i=t[0],s=t.length,o=e=>{let r;let o=[],a=0,l=0;for(let u=0;u<e.length;u++){let c=e[u];if(0===a){if(c===i&&(n||e.slice(u,u+s)===t)){o.push(e.slice(l,u)),l=u+s;continue}if("/"===c){r=u;continue}}"["===c?a++:"]"===c&&a--}let u=0===o.length?e:e.substring(l),c=u.startsWith("!"),h=c?u.substring(1):u;return{modifiers:o,hasImportantModifier:c,baseClassName:h,maybePostfixModifierPosition:r&&r>l?r-l:void 0}};return r?e=>r({className:e,parseClassName:o}):o},p=e=>{if(e.length<=1)return e;let t=[],r=[];return e.forEach(e=>{"["===e[0]?(t.push(...r.sort(),e),r=[]):r.push(e)}),t.push(...r.sort()),t},m=e=>({cache:d(e.cacheSize),parseClassName:f(e),...n(e)}),g=/\s+/,y=(e,t)=>{let{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i}=t,s=[],o=e.trim().split(g),a="";for(let e=o.length-1;e>=0;e-=1){let t=o[e],{modifiers:l,hasImportantModifier:u,baseClassName:c,maybePostfixModifierPosition:h}=r(t),d=!!h,f=n(d?c.substring(0,h):c);if(!f){if(!d||!(f=n(c))){a=t+(a.length>0?" "+a:a);continue}d=!1}let m=p(l).join(":"),g=u?m+"!":m,y=g+f;if(s.includes(y))continue;s.push(y);let v=i(f,d);for(let e=0;e<v.length;++e){let t=v[e];s.push(g+t)}a=t+(a.length>0?" "+a:a)}return a};function v(){let e,t,r=0,n="";for(;r<arguments.length;)(e=arguments[r++])&&(t=b(e))&&(n&&(n+=" "),n+=t);return n}let b=e=>{let t;if("string"==typeof e)return e;let r="";for(let n=0;n<e.length;n++)e[n]&&(t=b(e[n]))&&(r&&(r+=" "),r+=t);return r},w=e=>{let t=t=>t[e]||[];return t.isThemeGetter=!0,t},x=/^\[(?:([a-z-]+):)?(.+)\]$/i,_=/^\d+\/\d+$/,E=new Set(["px","full","screen"]),T=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,S=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,k=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,A=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,P=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,O=e=>C(e)||E.has(e)||_.test(e),R=e=>W(e,"length",z),C=e=>!!e&&!Number.isNaN(Number(e)),j=e=>W(e,"number",C),I=e=>!!e&&Number.isInteger(Number(e)),D=e=>e.endsWith("%")&&C(e.slice(0,-1)),N=e=>x.test(e),M=e=>T.test(e),L=new Set(["length","size","percentage"]),$=e=>W(e,L,H),U=e=>W(e,"position",H),B=new Set(["image","url"]),F=e=>W(e,B,G),V=e=>W(e,"",K),q=()=>!0,W=(e,t,r)=>{let n=x.exec(e);return!!n&&(n[1]?"string"==typeof t?n[1]===t:t.has(n[1]):r(n[2]))},z=e=>S.test(e)&&!k.test(e),H=()=>!1,K=e=>A.test(e),G=e=>P.test(e),J=function(e,...t){let r,n,i;let s=function(a){return n=(r=m(t.reduce((e,t)=>t(e),e()))).cache.get,i=r.cache.set,s=o,o(a)};function o(e){let t=n(e);if(t)return t;let s=y(e,r);return i(e,s),s}return function(){return s(v.apply(null,arguments))}}(()=>{let e=w("colors"),t=w("spacing"),r=w("blur"),n=w("brightness"),i=w("borderColor"),s=w("borderRadius"),o=w("borderSpacing"),a=w("borderWidth"),l=w("contrast"),u=w("grayscale"),c=w("hueRotate"),h=w("invert"),d=w("gap"),f=w("gradientColorStops"),p=w("gradientColorStopPositions"),m=w("inset"),g=w("margin"),y=w("opacity"),v=w("padding"),b=w("saturate"),x=w("scale"),_=w("sepia"),E=w("skew"),T=w("space"),S=w("translate"),k=()=>["auto","contain","none"],A=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto",N,t],L=()=>[N,t],B=()=>["",O,R],W=()=>["auto",C,N],z=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],H=()=>["solid","dashed","dotted","double","none"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],G=()=>["start","end","center","between","around","evenly","stretch"],J=()=>["","0",N],Y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],X=()=>[C,N];return{cacheSize:500,separator:":",theme:{colors:[q],spacing:[O,R],blur:["none","",M,N],brightness:X(),borderColor:[e],borderRadius:["n
37one","","full",M,N],borderSpacing:L(),borderWidth:B(),contrast:X(),grayscale:J(),hueRotate:X(),invert:J(),gap:L(),gradientColorStops:[e],gradientColorStopPositions:[D,R],inset:P(),margin:P(),opacity:X(),padding:L(),saturate:X(),scale:X(),sepia:J(),skew:X(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",N]}],container:["container"],columns:[{columns:[M]}],"break-after":[{"break-after":Y()}],"break-before":[{"break-before":Y()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...z(),N]}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",I,N]}],basis:[{basis:P()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",N]}],grow:[{grow:J()}],shrink:[{shrink:J()}],order:[{order:["first","last","none",I,N]}],"grid-cols":[{"grid-cols":[q]}],"col-start-end":[{col:["auto",{span:["full",I,N]},N]}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":[q]}],"row-start-end":[{row:["auto",{span:[I,N]},N]}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",N]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",N]}],gap:[{gap:[d]}],"gap-x":[{"gap-x":[d]}],"gap-y":[{"gap-y":[d]}],"justify-content":[{justify:["normal",...G()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...G(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...G(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",N,t]}],"min-w":[{"min-w":[N,t,"min","max","fit"]}],"max-w":[{"max-w":[N,t,"none","full","min","max","fit","prose",{screen:[M]},M]}],h:[{h:[N,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[N,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[N,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[N,t,"auto","min","max","fit"]}],"font-size":[{text:["base",M,R]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",j]}],"font-family":[{font:[q]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",N]}],"line-clamp":[{"line-clamp":["none",C,j]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",O,N]}],"list-image":[{"list-image":["none",N]}],"list-style-type":[{list:["none","disc","decimal",N]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",O,R]}],"underline-offset":[{"underline-offset":["auto",O,N]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",N]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",N]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...z(),U]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",$]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},F]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[p]}
37],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...H(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}
vendor: 4,445 bytes, line 37
37],"divide-style":[{divide:H()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...H()]}],"outline-offset":[{"outline-offset":[O,N]}],"outline-w":[{outline:[O,R]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:B()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[O,R]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",M,V]}],"shadow-color":[{shadow:[q]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...K(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":K()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",M,N]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[h]}],saturate:[{saturate:[b]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",N]}],duration:[{duration:X()}],ease:[{ease:["linear","in","out","in-out",N]}],delay:[{delay:X()}],animate:[{animate:["none","spin","ping","pulse","bounce",N]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[I,N]}],"translate-x":[{"translate-x":[S]}],"translate-y":[{"translate-y":[S]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",N]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",N]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",N]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[O,R,j]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","
37none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}})},6200:function(e,t,r){"use strict";r.r(t),r.d(t,{__addDisposableResource:function(){return N},__assign:function(){return s},__asyncDelegator:function(){return S},__asyncGenerator:function(){return T},__asyncValues:function(){return k},__await:function(){return E},__awaiter:function(){return p},__classPrivateFieldGet:function(){return j},__classPrivateFieldIn:function(){return D},__classPrivateFieldSet:function(){return I},__createBinding:function(){return g},__decorate:function(){return a},__disposeResources:function(){return L},__esDecorate:function(){return u},__exportStar:function(){return y},__extends:function(){return i},__generator:function(){return m},__importDefault:function(){return C},__importStar:function(){return R}
37,__makeTemplateObject:function(){return A},__metadata:function(){return f},__param:function(){return l},__propKey:function(){return h},__read:function(){return b},__rest:function(){return o},__rewriteRelativeImportExtension:function(){return $},__runInitializers:function(){return c},__setFunctionName:function(){return d},__spread:function(){return w},__spreadArray:function(){return _},__spreadArrays:function(){return x},__values:function(){return v}});var n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var s=function(){return(s=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function o(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)0>t.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function a(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o}function l(e,t){return function(r,n){t(r,n,e)}}function u(e,t,r,n,i,s){function o(e){if(void 0!==e&&"function"!=typeof e)throw TypeError("Function expected");return e}for(var a,l=n.kind,u="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?n.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),d=!1,f=r.length-1;f>=0;f--){var p={};for(var m in n)p[m]="access"===m?{}:n[m];for(var m in n.access)p.access[m]=n.access[m];p.addInitializer=function(e){if(d)throw TypeError("Cannot add initializers after decoration has completed");s.push(o(e||null))};var g=(0,r[f])("accessor"===l?{get:h.get,set:h.set}:h[u],p);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw TypeError("Object expected");(a=o(g.get))&&(h.get=a),(a=o(g.set))&&(h.set=a),(a=o(g.init))&&i.unshift(a)}else(a=o(g))&&("field"===l?i.unshift(a):h[u]=a)}c&&Object.defineProperty(c,n.name,h),d=!0}function c(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0}function h(e){return"symbol"==typeof e?e:"".concat(e)}function d(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function f(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function p(e,t,r,n){return new(r||(r=Promise))(function(i,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})}function m(e,t){var r,n,i,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(r)throw TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}var g=Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);
vendor: 1,832 bytes, line 37
37(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]};function y(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||g(t,e,r)}function v(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function b(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return o}function w(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(b(arguments[t]));return e}function x(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),i=0,t=0;t<r;t++)for(var s=arguments[t],o=0,a=s.length;o<a;o++,i++)n[i]=s[o];return n}function _(e,t,r){if(r||2==arguments.length)for(var n,i=0,s=t.length;i<s;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}function E(e){return this instanceof E?(this.v=e,this):new E(e)}function T(e,t,r){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(e,t||[]),s=[];return n=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",function(e){return function(t){return Promise.resolve(t).then(e,u)}}),n[Symbol.asyncIterator]=function(){return this},n;function o(e,t){i[e]&&(n[e]=function(t){return new Promise(function(r,n){
37s.push([e,t,r,n])>1||a(e,t)})},t&&(n[e]=t(n[e])))}function a(e,t){try{var r;(r=i[e](t)).value instanceof E?Promise.resolve(r.value.v).then(l,u):c(s[0][2],r)}catch(e){c(s[0][3],e)}}function l(e){a("next",e)}function u(e){a("throw",e)}function c(e,t){e(t),s.shift(),s.length&&a(s[0][0],s[0][1])}}function S(e){var t,r;return t={},n("next"),n("throw",function(e){throw e}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,i){t[n]=e[n]?function(t){return(r=!r)?{value:E(e[n](t)),done:!1}:i?i(t):t}:i}}function k(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=v(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise(function(n,i){!function(e,t,r,n){Promise.resolve(n).then(function(t){e({value:t,done:r})},t)}(n,i,(t=e[r](t)).done,t.value)})}}}function A(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var P=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},O=function(e){return(O=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t})(e)};function R(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=O(e),n=0;n<r.length;n++)"default"!==r[n]&&g(t,e,r[n]);return P(t,e),t}function C(e){return e&&e.__esModule?e:{default:e}}function j(e,t,r,n){if("a"===r&&!n)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function I(e,t,r,n,i){if("m"===n)throw TypeError("Private method is not writable");if("a"===n&&!i)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r}function D(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function N(e,t,r){if(null!=t){var n,i;if("object"!=typeof t&&"function"!=typeof t)throw TypeError("Object expected.");if(r){if(!Symbol.asyncDispose)throw TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],r&&(i=n)}if("function"!=typeof n)throw TypeError("Object not disposable.");i&&(n=function(){try{i.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}var M="function"==typeof SuppressedError?SuppressedError:function(e,t,r){var n=Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function L(e){function t(t){e.error=e.hasError?new M(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}var r,n=0;return function i(){for(;r=e.stack.pop();)try{if(!r.async&&1===n)return n=0,e.stack.push(r),Promise.resolve().then(i);if(r.dispose){var s=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(s).then(i,function(e){return t(e),i()})}else n|=1}catch(e){t(e)}if(1===n)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}()}function $(e,t){return"string"==typeof e&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(e,r,n,i,s){return r?t?".jsx":".js":!n||i&&s?n+i+"."+s.toLowerCase()+"js":e}):e}t.default={__extends:i,__assign:s,__rest:o,__decorate:a,__param:l,__esDecorate:u,__runInitializers:c,__propKey:h,__setFunctionName:d,__metadata:f,__awaiter:p,__generator:m,__createBinding:g,__exportStar:y,__values:v,__read:b,__spread:w,__spreadArrays:x,__spreadArray:_,__await:E,__asyncGenerator:T,__asyncDelegator:S,__asyncValues:k,__makeTemplateOb
37ject:A,__importStar:R,__importDefault:C,__classPrivateFieldGet:j,__classPrivateFieldSet:I,__classPrivateFieldIn:D,__addDisposableResource:N,__disposeResources:L,__rewriteRelativeImportExtension:$}}}]);
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.