* `);returnc.length=0,n===!1?(Fe(u),s):u}}returns}functiontt(e,t){varn=Object.defineProperties(t,{_vueTypes_name:{value:e,writable:!0},isRequired:{get:function(){returnthis.required=!0,this}},def:{value:function(s){returns!==void0||this.default?Qn(s)||Pn(this,s,!0)===!0?(this.default=Yn(s)?function(){return[].concat(s)}:Tn(s)?function(){returnObject.assign({},s)}:s,this):(Fe(this._vueTypes_name+' - invalid default value: "'+s+'"'),this):this}}}),r=n.validator;returnQn(r)&&(n.validator=Ia(r,n)),n}functionOt(e,t){varn=tt(e,t);returnObject.defineProperty(n,"validate",{value:function(r){returnQn(this.validator)&&Fe(this._vueTypes_name+` - calling .validate() will overwrite the current custom validator function. Validator info:
`+JSON.stringify(this)),this.validator=Ia(r,this),this}})}functionrc(e,t,n){varr,s,i=(r=t,s={},Object.getOwnPropertyNames(r).forEach(function(f){s[f]=Object.getOwnPropertyDescriptor(r,f)}),Object.defineProperties({},s));if(i._vueTypes_name=e,!Tn(n))returni;varo,a,l=n.validator,c=Wf(n,["validator"]);if(Qn(l)){varu=i.validator;u&&(u=(a=(o=u).__original)!==null&&a!==void0?a:o),i.validator=Ia(u?function(f){returnu.call(this,f)&&l.call(this,f)}:l,i)}returnObject.assign(i,c)}functionmi(e){returne.replace(/^(?!\s*$)/gm," ")}varpv=function(){returnOt("any",{})},gv=function(){returnOt("function",{type:Function})},mv=function(){returnOt("boolean",{type:Boolean})},vv=function(){returnOt("string",{type:String})},yv=function(){returnOt("number",{type:Number})},bv=function(){returnOt("array",{type:Array})},_v=function(){returnOt("object",{type:Object})},wv=function(){returntt("integer",{type:Number,validator:function(e){returnhv(e)}})},Ev=function(){returntt("symbol",{validator:function(e){returntypeofe=="symbol"}})};functionSv(e,t){if(t===void0&&(t="custom validation failed"),typeofe!="function")thrownewTypeError("[VueTypes error]: You must provide a function as argument");returntt(e.name||"<<anonymous function>>",{validator:function(n){varr=e(n);returnr||Fe(this._vueTypes_name+" - "+t),r}})}functionCv(e){if(!Yn(e))thrownewTypeError("[VueTypes error]: You must provide an array as argument.");vart='oneOf - value should be one of "'+e.join('", "')+'".',n=e.reduce(function(r,s){if(s!=null){vari=s.constructor;r.indexOf(i)===-1&&r.push(i)}returnr},[]);returntt("oneOf",{type:n.length>0?n:void0,validator:function(r){vars=e.indexOf(r)!==-1;returns||Fe(t),s}})}functionOv(e){if(!Yn(e))thrownewTypeError("[VueTypes error]: You must provide an array as argument");for(vart=!1,n=[],r=0;r<e.length;r+=1){vars=e[r];if(Yf(s)){if(Ks(s)&&s._vueTypes_name==="oneOf"){n=n.concat(s.type);continue}if(Qn(s.validator)&&(t=!0),s.type!==!0&&s.type){n=n.concat(s.type);continue}}n.push(s)}returnn=n.filter(function(i,o){returnn.indexOf(i)===o}),tt("oneOfType",t?{type:n,validator:function(i){varo=[],a=e.some(function(l){varc=Pn(Ks(l)&&l._vueTypes_name==="oneOf"?l.type||null:l,i,!0);returntypeofc=="string"&&o.push(c),c===!0});returna||Fe("oneOfType - provided value does not match any of the "+o.length+` passed-in validators:
`+mi(o.join(`
`))),a}}:{type:n})}functionTv(e){returntt("arrayOf",{type:Array,validator:function(t){varn,r=t.every(function(s){return(n=Pn(e,s,!0))===!0});returnr||Fe(`arrayOf - value validation error:
`+mi(n)),r}})}functionxv(e){returntt("instanceOf",{type:e})}functionPv(e){returntt("objectOf",{type:Object,validator:function(t){varn,r=Object.keys(t).every(function(s){return(n=Pn(e,t[s],!0))===!0});returnr||Fe(`objectOf - value validation error:
`+mi(n)),r}})}functionAv(e){vart=Object.keys(e),n=t.filter(function(s){vari;return!!(!((i=e[s])===null||i===void0)&&i.required)}),r=tt("shape",{type:Object,validator:function(s){vari=this;if(!Tn(s))return!1;varo=Object.keys(s);if(n.length>0&&n.some(function(l){returno.indexOf(l)===-1})){vara=n.filter(function(l){returno.indexOf(l)===-1});returnFe(a.length===1?'shape - required property "'+a[0]+'" is not defined.':'shape - required properties "'+a.join('", "')+'" are not defined.'),!1}returno.every(function(l){if(t.indexOf(l)===-1)returni._vueTypes_isLoose===!0||(Fe('shape - shape definition does not include a "'+l+'" property. Allowed keys: "'+t.join('", "')+'".'),!1);varc=Pn(e[l],s[l],!0);returntypeofc=="string"&&Fe('shape - "'+l+`" property validation error:
`+mi(c)),c===!0})}});returnObject.defineProperty(r,"_vueTypes_isLoose",{writable:!0,value:!1}),Object.defineProperty(r,"loose",{get:function(){returnthis._vueTypes_isLoose=!0,this}}),r}varvt=function(){functione(){}returne.extend=function(t){varn=this;if(Yn(t))returnt.forEach(function(f){returnn.extend(f)}),this;varr=t.name,s=t.validate,i=s!==void0&&s,o=t.getter,a=o!==void0&&o,l=Wf(t,["name","validate","getter"]);if(Yr(this,r))thrownewTypeError('[VueTypes error]: Type "'+r+'" already defined');varc,u=l.type;returnKs(u)?(deletel.type,Object.defineProperty(this,r,a?{get:function(){returnrc(r,u,l)}}:{value:function(){varf,d=rc(r,u,l);returnd.validator&&(d.validator=(f=d.validator).bind.apply(f,[d].concat([].slice.call(arguments)))),d}})):(c=a?{get:function(){varf=Object.assign({},l);returni?Ot(r,f):tt(r,f)},enumerable:!0}:{value:function(){varf,d,h=Object.assign({},l);returnf=i?Ot(r,h):tt(r,h),h.validator&&(f.validator=(d=h.validator).bind.apply(d,[f].concat([].slice.call(arguments)))),f},enumerable:!0},Object.defineProperty(this,r,c))},Vf(e,null,[{key:"any",get:function(){returnpv()}},{key:"func",get:function(){returngv().def(this.defaults.func)}},{key:"bool",get:function(){returnmv().def(this.defaults.bool)}},{key:"string",get:function(){returnvv().def(this.defaults.string)}},{key:"number",get:function(){returnyv().def(this.defaults.number)}},{key:"array",get:function(){returnbv().def(this.defaults.array)}},{key:"object",get:function(){return_v().def(this.defaults.object)}},{key:"integer",get:function(){returnwv().def(this.defaults.integer)}},{key:"symbol",get:function(){returnEv()}}]),e}();functionQf(e){vart;returne===void0&&(e={func:function(){},bool:!0,string:"",number:0,array:function(){return[]},object:function(){return{}},integer:0}),(t=function(n){functionr(){returnn.apply(this,arguments)||this}returnKf(r,n),Vf(r,null,[{key:"sensibleDefaults",get:function(){returnPs({},this.defaults)},set:function(s){this.defaults=s!==!1?Ps({},s!==!0?s:e):{}}}]),r}(vt)).defaults=Ps({},e),t}vt.defaults={},vt.custom=Sv,vt.oneOf=Cv,vt.instanceOf=xv,vt.oneOfType=Ov,vt.arrayOf=Tv,vt.objectOf=Pv,vt.shape=Av,vt.utils={validate:function(e,t){returnPn(t,e,!0)===!0},toType:function(e,t,n){returnn===void0&&(n=!1),n?Ot(e,t):tt(e,t)}};(function(e){functiont(){returne.apply(this,arguments)||this}returnKf(t,e),t})(Qf());varXf=Qf({func:void0,bool:void0,string:void0,number:void0,array:void0,object:void0,integer:void0});Xf.extend([{name:"looseBool",getter:!0,type:Boolean,default:void0},{name:"style",getter:!0,type:[String,Object],default:void0},{name:"VueNode",getter:!0,type:null}]);functionUC(e){returne.default=void0,e}constsc=Xf;varkv=["image","description","imageStyle","class"],Zf=M(cv,null,null),ed=M(uv,null,null),ar=function(t,n){varr,s=n.slots,i=s===void0?{}:s,o=n.attrs,a=vi("empty",t),l=a.direction,c=a.prefixCls,u=c.value,f=re(re({},t),o),d=f.image,h=d===void0?Zf:d,p=f.description,v=p===void0?((r=i.description)===null||r===void0?void0:r.call(i))||void0:p,b=f.imageStyle,w=f.class,y=w===void0?"":w,E=Ff(f,kv);returnM(Bf,{componentName:"Empty",children:function(N){varD,U=typeofv<"u"?v:N.description,k=typeofU=="string"?U:"empty",I=null;returntypeofh=="string"?I=M("img",{alt:k,src:h},null):I=h,M("div",re({class:or(u,y,(D={},Dt(D,"".concat(u,"-normal"),h===ed),Dt(D,"".concat(u,"-rtl"),l.value==="rtl"),D))},E),[M("div",{class:"".concat(u,"-image"),style:b},[I]),U&&M("p",{class:"".concat(u,"-description")},[U]),i.default&&M("div",{class:"".concat(u,"-footer")},[ja(i.default())])])}},null)};ar.displayName="AEmpty";ar.PRESENTED_IMAGE_DEFAULT=Zf;ar.PRESENTED_IMAGE_SIMPLE=ed;ar.inheritAttrs=!1;ar.props={prefixCls:String,image:sc.any,description:sc.any,imageStyle:{type:Object,default:void0}};constmr=Df(ar);varRv=function(t){varn=vi("empty",t),r=n.prefixCls,s=function(o){switch(o){case"Table":case"List":returnM(mr,{image:mr.PRESENTED_IMAGE_SIMPLE},null);case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":returnM(mr,{image:mr.PRESENTED_IMAGE_SIMPLE,class
`),"".concat(Db,"-dynamic-theme")):Nb(!1,"ConfigProvider","SSR do not support dynamic theme with css variables.")}varkd=Symbol("GlobalFormContextKey"),Ub=function(t){En(kd,t)},WC=function(){returnNe(kd,{validateMessages:ie(function(){})})},Bb=function(){return{getTargetContainer:{type:Function},getPopupContainer:{type:Function},prefixCls:String,getPrefixCls:{type:Function},renderEmpty:{type:Function},transformCellText:{type:Function},csp:{type:Object,default:void0},input:{type:Object},autoInsertSpaceInButton:{type:Boolean,default:void0},locale:{type:Object,default:void0},pageHeader:{type:Object},componentSize:{type:String},direction:{type:String},space:{type:Object},virtual:{type:Boolean,default:void0},dropdownMatchSelectWidth:{type:[Number,Boolean],default:!0},form:{type:Object,default:void0},notUpdateGlobalConfig:Boolean}},Hb="ant";functionWn(){returnZe.prefixCls||Hb}varjo=We({}),Rd=We({}),Ze=We({});ui(function(){On(Ze,jo,Rd),Ze.prefixCls=Wn(),Ze.getPrefixCls=function(e,t){returnt||(e?"".concat(Ze.prefixCls,"-").concat(e):Ze.prefixCls)},Ze.getRootPrefixCls=function(e,t){returne||(Ze.prefixCls?Ze.prefixCls:t&&t.includes("-")?t.replace(/^(.*)-[^-]*$/,"$1"):Wn())}});varWi,qb=function(t){Wi&&Wi(),Wi=ui(function(){On(Rd,We(t)),On(Ze,We(t))}),t.theme&&Fb(Wn(),t.theme)},Vb=function(){return{getPrefixCls:function(n,r){returnr||(n?"".concat(Wn(),"-").concat(n):Wn())},getRootPrefixCls:function(n,r){returnn||(Ze.prefixCls?Ze.prefixCls:r&&r.includes("-")?r.replace(/^(.*)-[^-]*$/,"$1"):Wn())}}},jr=Ft({compatConfig:{MODE:3},name:"AConfigProvider",inheritAttrs:!1,props:Bb(),setup:function(t,n){varr=n.slots,s=function(f,d){varh=t.prefixCls,p=h===void0?"ant":h;returnd||(f?"".concat(p,"-").concat(f):p)},i=function(f){vard=t.renderEmpty||r.renderEmpty||td;returnd(f)},o=function(f,d){varh=t.prefixCls;if(d)returnd;varp=h||s("");returnf?"".concat(p,"-").concat(f):p},a=We(re(re({},t),{},{getPrefixCls:o,renderEmpty:i}));Object.keys(t).forEach(function(u){$t(function(){returnt[u]},function(){a[u]=t[u]})}),t.notUpdateGlobalConfig||(On(jo,a),$t(a,function(){On(jo,a)}));varl=ie(function(){varu={};if(t.locale){varf,d;u=((f=t.locale.Form)===null||f===void0?void0:f.defaultValidateMessages)||((d=Vs.Form)===null||d===void0?void0:d.defaultValidateMessages)||{}}returnt.form&&t.form.validateMessages&&(u=re(re({},u),t.form.validateMessages)),u});Ub({validateMessages:l}),En("configProvider",a);varc=function(f){vard;returnM(Mv,{locale:t.locale||f,ANT_MARK__:Eo},{default:function(){return[(d=r.default)===null||d===void0?void0:d.call(r)]}})};returnui(function(){t.direction&&(Rs.config({rtl:t.direction==="rtl"}),Ib.config({rtl:t.direction==="rtl"}))}),function(){returnM(Bf,{children:function(f,d,h){returnc(h)}},null)}}}),Kb=We({getPrefixCls:function(t,n){returnn||(t?"ant-".concat(t):"ant")},renderEmpty:td,direction:"ltr"});jr.config=qb;jr.install=function(e){e.component(jr.name,jr)};constjd=jr,vi=function(e,t){varn=Ne("configProvider",Kb),r=ie(function(){returnn.getPrefixCls(e,t.prefixCls)}),s=ie(function(){vary;return(y=t.direction)!==null&&y!==void0?y:n.direction}),i=ie(function(){returnn.getPrefixCls()}),o=ie(function(){returnn.autoInsertSpaceInButton}),a=ie(function(){returnn.renderEmpty}),l=ie(function(){returnn.space}),c=ie(function(){returnn.pageHeader}),u=ie(function(){returnn.form}),f=ie(function(){returnt.getTargetContainer||n.getTargetContainer}),d=ie(function(){returnt.getPopupContainer||n.getPopupContainer}),h=ie(function(){vary;return(y=t.dropdownMatchSelectWidth)!==null&&y!==void0?y:n.dropdownMatchSelectWidth}),p=ie(function(){return(t.virtual===void0?n.virtual!==!1:t.virtual!==!1)&&h.value!==!1}),v=ie(function(){returnt.size||n.componentSize}),b=ie(function(){vary;returnt.autocomplete||((y=n.input)===null||y===void0?void0:y.autocomplete)}),w=ie(function(){returnn.csp});return{configProvider:n,prefixCls:r,direction:s,size:v,getTargetContainer:f,getPopupContainer:d,space:l,pageHeader:c,form:u,autoInsertSpaceInButton:o,renderEmpty:a,virtual:p,dropdownMatchSelectWidth:h,rootPrefixC
new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"UnknownJavaScriptruntimewithoutWebSocketsupport.",workaround:"Ensureyou're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const t=this.detectEnvironment();if(t.constructor)return t.constructor;let n=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(n+=`
});`;class hS{constructor(t,n){var r;if(this.accessTokenValue=null,this.apiKey=null,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=Ko,this.transport=null,this.heartbeatIntervalMs=_s.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=to,this.ref=0,this.reconnectTimer=null,this.logger=to,this.conn=null,this.sendBuffer=[],this.serializer=new rS,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._resolveFetch=s=>{let i;return s?i=s:typeof fetch>"u"?i=(...o)=>z(()=>Promise.resolve().then(()=>fr),void 0).then(({default:a})=>a(...o)).catch(a=>{throw new Error(`Failed to load @supabase/node-fetch: ${a.message}. This is required for HTTP requests in Node.js environments without native fetch.`)}):i=fetch,(...o)=>i(...o)},!(!((r=n==null?void 0:n.params)===null||r===void 0)&&r.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=n.params.apikey,this.endPoint=`${t}/${Wo.websocket}`,this.httpEndpoint=Ph(t),this._initializeOptions(n),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(n==null?void 0:n.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=QE.createWebSocket(this.endpointURL())}catch(t){this._setConnectionState("disconnected");const n=t.message;throw n.includes("Node.js")?new Error(`${n}
\r=`.split(""),e1=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<vu.length;t+=1)e[vu[t].charCodeAt(0)]=-2;for(let t=0;t<Ys.length;t+=1)e[Ys[t].charCodeAt(0)]=t;return e})();function yu(e,t,n){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const r=t.queue>>t.queuedBits-6&63;n(Ys[r]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const r=t.queue>>t.queuedBits-6&63;n(Ys[r]),t.queuedBits-=6}}function $h(e,t,n){const r=e1[e];if(r>-1)for(t.queue=t.queue<<6|r,t.queuedBits+=6;t.queuedBits>=8;)n(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function bu(e){const t=[],n=o=>{t.push(String.fromCodePoint(o))},r={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},i=o=>{r1(o,r,n)};for(let o=0;o<e.length;o+=1)$h(e.charCodeAt(o),s,i);return t.join("")}function t1(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function n1(e,t){for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r>55295&&r<=56319){const s=(r-55296)*1024&65535;r=(e.charCodeAt(n+1)-56320&65535|s)+65536,n+=1}t1(r,t)}}function r1(e,t,n){if(t.utf8seq===0){if(e<=127){n(e);return}for(let r=1;r<6;r+=1)if(!(e>>7-r&1)){t.utf8seq=r;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&n(t.codepoint)}}function s1(e){const t=[],n={queue:0,queuedBits:0},r=s=>{t.push(s)};for(let s=0;s<e.length;s+=1)$h(e.charCodeAt(s),n,r);return new Uint8Array(t)}function i1(e){const t=[];return n1(e,n=>t.push(n)),new Uint8Array(t)}function o1(e){const t=[],n={queue:0,queuedBits:0},r=s=>{t.push(s)};return e.forEach(s=>yu(s,n,r)),yu(null,n,r),t.join("")}function a1(e){return Math.round(Date.now()/1e3)+e}function l1(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}const rt=()=>typeof window<"u"&&typeof document<"u",fn={tested:!1,writable:!1},Mh=()=>{if(!rt())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(fn.tested)return fn.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),fn.tested=!0,fn.writable=!0}catch{fn.tested=!0,fn.writable=!1}return fn.writable};function c1(e){const t={},n=new URL(e);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEach((s,i)=>{t[i]=s})}catch{}return n.searchParams.forEach((r,s)=>{t[s]=r}),t}const Lh=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...n)=>z(()=>Promise.resolve().then(()=>fr),void 0).then(({default:r})=>r(...n)):t=fetch,(...n)=>t(...n)},u1=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",Bn=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},dn=async(e,t)=>{const n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return n}},Kt=async(e,t)=>{await e.removeItem(t)};class Ri{constructor(){this.promise=new Ri.promiseConstructor((t,n)=>{this.resolve=t,this.reject=n})}}Ri.promiseConstructor=Promise;function io(e){const t=e.split(".");if(t.length!==3)throw new ea("Invalid JWT structure");for(let r=0;r<t.length;r++)if(!GS.test(t[r]))throw new ea("JWT not in base64url format");return{header:JSON.parse(bu(t[0])),payload:JSON.parse(bu(t[1])),signature:s1(t[2]),raw:{header:t[0],payload:t[1]}}}async function f1(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function d1(e,t){return new Promise((r,s)=>{(async()=>{for(let i=0;i<1/0;i++)try{const o=await e(i);if(!t(i,null,o)
`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'.Providedvalue:${e.statement}`)}const h=Dh(e.address),p=u?`${u}://${r}`:r,v=e.statement?`${e.statement}
Resources:`;for(const E of c){if(!E||typeof E!="string")throw new Error(`@supabase/auth-js:InvalidSIWEmessagefield"resources".Everyresourcemustbeavalidstring.Providedvalue:${E}`);y+=`
${w}`}j1();const D1={url:KS,storageKey:WS,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:zS,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1};async function Cu(e,t,n){return await n()}const Nn={};class ts{constructor(t){var n,r;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,this.instanceID=ts.nextInstanceID,ts.nextInstanceID+=1,this.instanceID>0&&rt()&&console.warn("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.");const s=Object.assign(Object.assign({},D1),t);if(this.logDebugMessages=!!s.debug,typeof s.debug=="function"&&(this.logger=s.debug),this.persistSession=s.persistSession,this.storageKey=s.storageKey,this.autoRefreshToken=s.autoRefreshToken,this.admin=new R1({url:s.url,headers:s.headers,fetch:s.fetch}),this.url=s.url,this.headers=s.headers,this.fetch=Lh(s.fetch),this.lock=s.lock||Cu,this.detectSessionInUrl=s.detectSessionInUrl,this.flowType=s.flowType,this.hasCustomAuthorizationHeader=s.hasCustomAuthorizationHeader,s.lock?this.lock=s.lock:rt()&&(!((n=globalThis==null?void 0:globalThis.navigator)===null||n===void 0)&&n.locks)?this.lock=$1:this.lock=Cu,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)},this.persistSession?(s.storage?this.storage=s.storage:Mh()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=Su(this.memoryStorage)),s.userStorage&&(this.userStorage=s.userStorage)):(this.memoryStorage={},this.storage=Su(this.memoryStorage)),rt()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(i){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",i)}(r=this.broadcastChannel)===null||r===void 0||r.addEventListener("message",async i=>{this._debug("received broadcast notification from other tab or client",i),await this._notifyAllSubscribers(i.data.event,i.data.session,!1)})}this.initialize()}get jwks(){var t,n;return(n=(t=Nn[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(t){Nn[this.storageKey]=Object.assign(Object.assign({},Nn[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,n;return(n=(t=Nn[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){Nn[this.storageKey]=Object.assign(Object.assign({},Nn[this.storageKey]),{cachedAt:t})}_debug(...t){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID}(${Rh})${newDate().toISOString()}`,...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{const n=c1(window.location.href);let r="none";if(this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce"),rt()&&this.detectSessionInUrl&&r!=="none"){const{data:s,error:i}=await this._getSessionFromURL(n,r);if(i){if(this._debug("#_initialize()","error detecting session from URL",i),ZS(i)){const l=(t=i.details)===null||t===void 0?void 0:t.code;if(l==="identity_already_exists"||l==="identity_not_found"||l==="single_identity_not_deletable")return{e
`);constD=awaitC.signMessage(newTextEncoder().encode(p),"utf8");if(!D||!(DinstanceofUint8Array))thrownewError("@supabase/auth-js: Wallet signMessage() API returned an recognized value");v=D}}try{const{data:b,error:w}=awaitle(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:p,signature:o1(v)},!((d=t.options)===null||d===void0)&&d.captchaToken?{gotrue_meta_security:{captcha_token:(h=t.options)===null||h===void0?void0:h.captchaToken}}:null),xform:yt});if(w)throww;return!b||!b.session||!b.user?{data:{user:null,session:null},error:newEr}:(b.session&&(awaitthis._saveSession(b.session),awaitthis._notifyAllSubscribers("SIGNED_IN",b.session)),{data:Object.assign({},b),error:w})}catch(b){if(ne(b))return{data:{user:null,session:null},error:b};throwb}}async_exchangeCodeForSession(t){constn=awaitdn(this.storage,`${this.storageKey}-code-verifier`),[r,s]=(n??"").split("/");try{const{data:i,error:o}=awaitle(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:r},xform:yt});if(awaitKt(this.storage,`${this.storageKey}-code-verifier`),o)throwo;return!i||!i.session||!i.user?{data:{user:null,session:null,redirectType:null},error:newEr}:(i.session&&(awaitthis._saveSession(i.session),awaitthis._notifyAllSubscribers("SIGNED_IN",i.session)),{data:Object.assign(Object.assign({},i),{redirectType:s??null}),error:o})}catch(i){if(ne(i))return{data:{user:null,session:null,redirectType:null},error:i};throwi}}asyncsignInWithIdToken(t){try{const{options:n,provider:r,token:s,access_token:i,nonce:o}=t,a=awaitle(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:s,access_token:i,nonce:o,gotrue_meta_security:{captcha_token:n==null?void0:n.captchaToken}},xform:yt}),{data:l,error:c}=a;returnc?{data:{user:null,session:null},error:c}:!l||!l.session||!l.user?{data:{user:null,session:null},error:newEr}:(l.session&&(awaitthis._saveSession(l.session),awaitthis._notifyAllSubscribers("SIGNED_IN",l.session)),{data:l,error:c})}catch(n){if(ne(n))return{data:{user:null,session:null},error:n};thrown}}asyncsignInWithOtp(t){varn,r,s,i,o;try{if("email"int){const{email:a,options:l}=t;letc=null,u=null;this.flowType==="pkce"&&([c,u]=await$n(this.storage,this.storageKey));const{error:f}=awaitle(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:a,data:(n=l==null?void0:l.data)!==null&&n!==void0?n:{},create_user:(r=l==null?void0:l.shouldCreateUser)!==null&&r!==void0?r:!0,gotrue_meta_security:{captcha_token:l==null?void0:l.captchaToken},code_challenge:c,code_challenge_method:u},redirectTo:l==null?void0:l.emailRedirectTo});return{data:{user:null,session:null},error:f}}if("phone"int){const{phone:a,options:l}=t,{data:c,error:u}=awaitle(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:a,data:(s=l==null?void0:l.data)!==null&&s!==void0?s:{},create_user:(i=l==null?void0:l.shouldCreateUser)!==null&&i!==void0?i:!0,gotrue_meta_security:{captcha_token:l==null?void0:l.captchaToken},channel:(o=l==null?void0:l.channel)!==null&&o!==void0?o:"sms"}});return{data:{user:null,session:null,messageId:c==null?void0:c.message_id},error:u}}thrownewws("You must provide either an email or phone number.")}catch(a){if(ne(a))return{data:{user:null,session:null},error:a};throwa}}asyncverifyOtp(t){varn,r;try{lets,i;"options"int&&(s=(n=t.options)===null||n===void0?void0:n.redirectTo,i=(r=t.options)===null||r===void0?void0:r.captchaToken);const{data:o,error:a}=awaitle(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:i}}),redirectTo:s,xform:yt});if(a)throwa;if(!o)thrownewError("An error occurred on token verification.");constl=o.session,c=o.user;returnl!=null&&l.access_token&&(awaitthis._saveSession(l),awaitthis._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",l)),{data:{user:c,session:l},error:null}}catch(s){if(ne(s